SlideShare a Scribd company logo
1 of 19
Download to read offline
package com.test;
public class Team {
private String teamId;
private String teamName;
private String pFirstName;
private String pLastName;
private String pemail;
private String phoneNumber;
public String getTeamId() {
return teamId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getpFirstName() {
return pFirstName;
}
public void setpFirstName(String pFirstName) {
this.pFirstName = pFirstName;
}
public String getpLastName() {
return pLastName;
}
public void setpLastName(String pLastName) {
this.pLastName = pLastName;
}
public String getPemail() {
return pemail;
}
public void setPemail(String pemail) {
this.pemail = pemail;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String toString() {
return "Team [teamId=" + teamId + ", teamName=" + teamName
+ ", pFirstName=" + pFirstName + ", pLastName=" + pLastName
+ ", pemail=" + pemail + ", phoneNumber=" + phoneNumber + "]";
}
public Team(String teamId, String teamName, String pFirstName,
String pLastName, String pemail, String phoneNumber) {
super();
this.teamId = teamId;
this.teamName = teamName;
this.pFirstName = pFirstName;
this.pLastName = pLastName;
this.pemail = pemail;
this.phoneNumber = phoneNumber;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((pFirstName == null) ? 0 : pFirstName.hashCode());
result = prime * result
+ ((pLastName == null) ? 0 : pLastName.hashCode());
result = prime * result + ((pemail == null) ? 0 : pemail.hashCode());
result = prime * result
+ ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
result = prime * result + ((teamId == null) ? 0 : teamId.hashCode());
result = prime * result
+ ((teamName == null) ? 0 : teamName.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Team other = (Team) obj;
if (pFirstName == null) {
if (other.pFirstName != null)
return false;
} else if (!pFirstName.equals(other.pFirstName))
return false;
if (pLastName == null) {
if (other.pLastName != null)
return false;
} else if (!pLastName.equals(other.pLastName))
return false;
if (pemail == null) {
if (other.pemail != null)
return false;
} else if (!pemail.equals(other.pemail))
return false;
if (phoneNumber == null) {
if (other.phoneNumber != null)
return false;
} else if (!phoneNumber.equals(other.phoneNumber))
return false;
if (teamId == null) {
if (other.teamId != null)
return false;
} else if (!teamId.equals(other.teamId))
return false;
if (teamName == null) {
if (other.teamName != null)
return false;
} else if (!teamName.equals(other.teamName))
return false;
return true;
}
}
package com.test;
import java.util.Date;
public class Game {
private String gameId;
private String teamId;
private String guestTeamId;
private Date gameDate;// yyyymmdd
private int homeTeamScore;
private int guestTeamScore;
public Game(String gameId, String teamId, String guestTeamId,
Date gameDate, int homeTeamScore, int guestTeamScore) {
super();
this.gameId = gameId;
this.teamId = teamId;
this.guestTeamId = guestTeamId;
this.gameDate = gameDate;
this.homeTeamScore = homeTeamScore;
this.guestTeamScore = guestTeamScore;
}
public String toString() {
return "Game [gameId=" + gameId + ", teamId=" + teamId
+ ", guestTeamId=" + guestTeamId + ", gameDate=" + gameDate
+ ", homeTeamScore=" + homeTeamScore + ", guestTeamScore="
+ guestTeamScore + "]";
}
public String getGameId() {
return gameId;
}
public void setGameId(String gameId) {
this.gameId = gameId;
}
public String getTeamId() {
return teamId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getGuestTeamId() {
return guestTeamId;
}
public void setGuestTeamId(String guestTeamId) {
this.guestTeamId = guestTeamId;
}
public Date getGameDate() {
return gameDate;
}
public void setGameDate(Date gameDate) {
this.gameDate = gameDate;
}
public int getHomeTeamScore() {
return homeTeamScore;
}
public void setHomeTeamScore(int homeTeamScore) {
this.homeTeamScore = homeTeamScore;
}
public int getGuestTeamScore() {
return guestTeamScore;
}
public void setGuestTeamScore(int guestTeamScore) {
this.guestTeamScore = guestTeamScore;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((gameDate == null) ? 0 : gameDate.hashCode());
result = prime * result + ((gameId == null) ? 0 : gameId.hashCode());
result = prime * result
+ ((guestTeamId == null) ? 0 : guestTeamId.hashCode());
result = prime * result + guestTeamScore;
result = prime * result + homeTeamScore;
result = prime * result + ((teamId == null) ? 0 : teamId.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Game other = (Game) obj;
if (gameDate == null) {
if (other.gameDate != null)
return false;
} else if (!gameDate.equals(other.gameDate))
return false;
if (gameId == null) {
if (other.gameId != null)
return false;
} else if (!gameId.equals(other.gameId))
return false;
if (guestTeamId == null) {
if (other.guestTeamId != null)
return false;
} else if (!guestTeamId.equals(other.guestTeamId))
return false;
if (guestTeamScore != other.guestTeamScore)
return false;
if (homeTeamScore != other.homeTeamScore)
return false;
if (teamId == null) {
if (other.teamId != null)
return false;
} else if (!teamId.equals(other.teamId))
return false;
return true;
}
}
package com.test;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class Test {
public static boolean findEmailtoSearch(Team team)
{
String stringToSearch =team.getPemail();
System.out.println(stringToSearch);
Pattern p = Pattern.compile("(at sign)"); // the pattern to search for
Matcher m = p.matcher(stringToSearch);
// now try to find at least one match
if (m.find())
{
System.out.println("Found a match");
return true;
}
else
{
System.out.println("Did not find a match");
return false;
}
}
public void textFileReadingExample() throws Throwable {
FileReader reader = new FileReader("D://MyFile.txt");
BufferedReader bufferedReader = new BufferedReader(reader);
String line;
while ((line = bufferedReader.readLine()) != null) {
System.out.println(line);
}
reader.close();
}
/**
* This program demonstrates how to write characters to a text file using
* a specified charset.
*
public void textFileWritingExample() throws IOException{
FileOutputStream outputStream = new FileOutputStream("D://MyFile.txt");
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, "UTF-
16");
BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
bufferedWriter.write("TEAM,teamId,teamName,firstName,lastName,phoneNumber,email");
bufferedWriter.newLine();
bufferedWriter.write("TEAM,1,Road Runner,David,Brown,303-123-4567,roadrunner(at
sign)gmail.com");
bufferedWriter.newLine();
bufferedWriter.write("GAME,gameId,homeTeamId,guestTeamId,gameDate,homeTeamScore,g
uestTeamScore");
bufferedWriter.newLine();
bufferedWriter.write("GAME,101,1,2,20160105,4,3");
bufferedWriter.close();
}
/**
* Find out if a String contains a very simple pattern.
*/
public static void main(String[] args) throws Throwable
{
Team team=new Team("1","Road Runner","Joe","Doe",
"roadrunner(at sign)gmail.com","(303) 123-4599");
Team team1 = new Team("1","Road Runner","Joe","Doe",
"roadrunne(at sign)gmail.com","(303) 123-4599");
Game game=new Game("101","1","2",new Date(),4,3);
System.out.println(game);
boolean flag= Test.findEmailtoSearch(team);
System.out.println(flag);
boolean flag1= Test.findEmailtoSearch(team1);
System.out.println(flag1);
Test test=new Test();
test.textFileWritingExample();
test.textFileReadingExample();
}
}
output
Game [gameId=101, teamId=1, guestTeamId=2, gameDate=Mon Sep 12 17:21:26 IST 2016,
homeTeamScore=4, guestTeamScore=3]
roadrunner(at sign)gmail.com
Found a match
true
roadrunne(at sign)gmail.com
Found a match
true
Solution
package com.test;
public class Team {
private String teamId;
private String teamName;
private String pFirstName;
private String pLastName;
private String pemail;
private String phoneNumber;
public String getTeamId() {
return teamId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getpFirstName() {
return pFirstName;
}
public void setpFirstName(String pFirstName) {
this.pFirstName = pFirstName;
}
public String getpLastName() {
return pLastName;
}
public void setpLastName(String pLastName) {
this.pLastName = pLastName;
}
public String getPemail() {
return pemail;
}
public void setPemail(String pemail) {
this.pemail = pemail;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String toString() {
return "Team [teamId=" + teamId + ", teamName=" + teamName
+ ", pFirstName=" + pFirstName + ", pLastName=" + pLastName
+ ", pemail=" + pemail + ", phoneNumber=" + phoneNumber + "]";
}
public Team(String teamId, String teamName, String pFirstName,
String pLastName, String pemail, String phoneNumber) {
super();
this.teamId = teamId;
this.teamName = teamName;
this.pFirstName = pFirstName;
this.pLastName = pLastName;
this.pemail = pemail;
this.phoneNumber = phoneNumber;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((pFirstName == null) ? 0 : pFirstName.hashCode());
result = prime * result
+ ((pLastName == null) ? 0 : pLastName.hashCode());
result = prime * result + ((pemail == null) ? 0 : pemail.hashCode());
result = prime * result
+ ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
result = prime * result + ((teamId == null) ? 0 : teamId.hashCode());
result = prime * result
+ ((teamName == null) ? 0 : teamName.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Team other = (Team) obj;
if (pFirstName == null) {
if (other.pFirstName != null)
return false;
} else if (!pFirstName.equals(other.pFirstName))
return false;
if (pLastName == null) {
if (other.pLastName != null)
return false;
} else if (!pLastName.equals(other.pLastName))
return false;
if (pemail == null) {
if (other.pemail != null)
return false;
} else if (!pemail.equals(other.pemail))
return false;
if (phoneNumber == null) {
if (other.phoneNumber != null)
return false;
} else if (!phoneNumber.equals(other.phoneNumber))
return false;
if (teamId == null) {
if (other.teamId != null)
return false;
} else if (!teamId.equals(other.teamId))
return false;
if (teamName == null) {
if (other.teamName != null)
return false;
} else if (!teamName.equals(other.teamName))
return false;
return true;
}
}
package com.test;
import java.util.Date;
public class Game {
private String gameId;
private String teamId;
private String guestTeamId;
private Date gameDate;// yyyymmdd
private int homeTeamScore;
private int guestTeamScore;
public Game(String gameId, String teamId, String guestTeamId,
Date gameDate, int homeTeamScore, int guestTeamScore) {
super();
this.gameId = gameId;
this.teamId = teamId;
this.guestTeamId = guestTeamId;
this.gameDate = gameDate;
this.homeTeamScore = homeTeamScore;
this.guestTeamScore = guestTeamScore;
}
public String toString() {
return "Game [gameId=" + gameId + ", teamId=" + teamId
+ ", guestTeamId=" + guestTeamId + ", gameDate=" + gameDate
+ ", homeTeamScore=" + homeTeamScore + ", guestTeamScore="
+ guestTeamScore + "]";
}
public String getGameId() {
return gameId;
}
public void setGameId(String gameId) {
this.gameId = gameId;
}
public String getTeamId() {
return teamId;
}
public void setTeamId(String teamId) {
this.teamId = teamId;
}
public String getGuestTeamId() {
return guestTeamId;
}
public void setGuestTeamId(String guestTeamId) {
this.guestTeamId = guestTeamId;
}
public Date getGameDate() {
return gameDate;
}
public void setGameDate(Date gameDate) {
this.gameDate = gameDate;
}
public int getHomeTeamScore() {
return homeTeamScore;
}
public void setHomeTeamScore(int homeTeamScore) {
this.homeTeamScore = homeTeamScore;
}
public int getGuestTeamScore() {
return guestTeamScore;
}
public void setGuestTeamScore(int guestTeamScore) {
this.guestTeamScore = guestTeamScore;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((gameDate == null) ? 0 : gameDate.hashCode());
result = prime * result + ((gameId == null) ? 0 : gameId.hashCode());
result = prime * result
+ ((guestTeamId == null) ? 0 : guestTeamId.hashCode());
result = prime * result + guestTeamScore;
result = prime * result + homeTeamScore;
result = prime * result + ((teamId == null) ? 0 : teamId.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Game other = (Game) obj;
if (gameDate == null) {
if (other.gameDate != null)
return false;
} else if (!gameDate.equals(other.gameDate))
return false;
if (gameId == null) {
if (other.gameId != null)
return false;
} else if (!gameId.equals(other.gameId))
return false;
if (guestTeamId == null) {
if (other.guestTeamId != null)
return false;
} else if (!guestTeamId.equals(other.guestTeamId))
return false;
if (guestTeamScore != other.guestTeamScore)
return false;
if (homeTeamScore != other.homeTeamScore)
return false;
if (teamId == null) {
if (other.teamId != null)
return false;
} else if (!teamId.equals(other.teamId))
return false;
return true;
}
}
package com.test;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class Test {
public static boolean findEmailtoSearch(Team team)
{
String stringToSearch =team.getPemail();
System.out.println(stringToSearch);
Pattern p = Pattern.compile("(at sign)"); // the pattern to search for
Matcher m = p.matcher(stringToSearch);
// now try to find at least one match
if (m.find())
{
System.out.println("Found a match");
return true;
}
else
{
System.out.println("Did not find a match");
return false;
}
}
public void textFileReadingExample() throws Throwable {
FileReader reader = new FileReader("D://MyFile.txt");
BufferedReader bufferedReader = new BufferedReader(reader);
String line;
while ((line = bufferedReader.readLine()) != null) {
System.out.println(line);
}
reader.close();
}
/**
* This program demonstrates how to write characters to a text file using
* a specified charset.
*
public void textFileWritingExample() throws IOException{
FileOutputStream outputStream = new FileOutputStream("D://MyFile.txt");
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, "UTF-
16");
BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);
bufferedWriter.write("TEAM,teamId,teamName,firstName,lastName,phoneNumber,email");
bufferedWriter.newLine();
bufferedWriter.write("TEAM,1,Road Runner,David,Brown,303-123-4567,roadrunner(at
sign)gmail.com");
bufferedWriter.newLine();
bufferedWriter.write("GAME,gameId,homeTeamId,guestTeamId,gameDate,homeTeamScore,g
uestTeamScore");
bufferedWriter.newLine();
bufferedWriter.write("GAME,101,1,2,20160105,4,3");
bufferedWriter.close();
}
/**
* Find out if a String contains a very simple pattern.
*/
public static void main(String[] args) throws Throwable
{
Team team=new Team("1","Road Runner","Joe","Doe",
"roadrunner(at sign)gmail.com","(303) 123-4599");
Team team1 = new Team("1","Road Runner","Joe","Doe",
"roadrunne(at sign)gmail.com","(303) 123-4599");
Game game=new Game("101","1","2",new Date(),4,3);
System.out.println(game);
boolean flag= Test.findEmailtoSearch(team);
System.out.println(flag);
boolean flag1= Test.findEmailtoSearch(team1);
System.out.println(flag1);
Test test=new Test();
test.textFileWritingExample();
test.textFileReadingExample();
}
}
output
Game [gameId=101, teamId=1, guestTeamId=2, gameDate=Mon Sep 12 17:21:26 IST 2016,
homeTeamScore=4, guestTeamScore=3]
roadrunner(at sign)gmail.com
Found a match
true
roadrunne(at sign)gmail.com
Found a match
true

More Related Content

Similar to package com.test;public class Team {    private String teamId;.pdf

Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfAroraRajinder1
 
import java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdfimport java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdfaquazac
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Seri Moth
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfformaxekochi
 
Bdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infiniteBdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infiniteGiordano Scalzo
 
Logic Equations Resolver J Script
Logic Equations Resolver   J ScriptLogic Equations Resolver   J Script
Logic Equations Resolver J ScriptRoman Agaev
 
import java.util.Scanner;class BinaryNode{     BinaryNode left.pdf
import java.util.Scanner;class BinaryNode{     BinaryNode left.pdfimport java.util.Scanner;class BinaryNode{     BinaryNode left.pdf
import java.util.Scanner;class BinaryNode{     BinaryNode left.pdfshaktisinhgandhinaga
 
MineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdfMineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdfaniyathikitchen
 
Ugly code
Ugly codeUgly code
Ugly codeOdd-e
 
Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11Stefano Leli
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tourSimon Proctor
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tourSimon Proctor
 
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev FedorProgramming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev FedorFedor Lavrentyev
 
Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldBTI360
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
i need help to edit the two methods below so that i can have them wo.pdf
i need help to edit the two methods below so that i can have them wo.pdfi need help to edit the two methods below so that i can have them wo.pdf
i need help to edit the two methods below so that i can have them wo.pdfirshadoptical
 
Pokemon battle simulator (Java Program written on Blue J Editor)
Pokemon battle simulator (Java Program written on Blue J Editor)Pokemon battle simulator (Java Program written on Blue J Editor)
Pokemon battle simulator (Java Program written on Blue J Editor)Mahir Bathija
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdfakkhan101
 

Similar to package com.test;public class Team {    private String teamId;.pdf (20)

include.docx
include.docxinclude.docx
include.docx
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
import java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdfimport java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdf
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdf
 
Bdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infiniteBdd: Tdd and beyond the infinite
Bdd: Tdd and beyond the infinite
 
Logic Equations Resolver J Script
Logic Equations Resolver   J ScriptLogic Equations Resolver   J Script
Logic Equations Resolver J Script
 
import java.util.Scanner;class BinaryNode{     BinaryNode left.pdf
import java.util.Scanner;class BinaryNode{     BinaryNode left.pdfimport java.util.Scanner;class BinaryNode{     BinaryNode left.pdf
import java.util.Scanner;class BinaryNode{     BinaryNode left.pdf
 
MineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdfMineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdf
 
Ugly code
Ugly codeUgly code
Ugly code
 
TDD Hands-on
TDD Hands-onTDD Hands-on
TDD Hands-on
 
Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev FedorProgramming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
 
Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 World
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
i need help to edit the two methods below so that i can have them wo.pdf
i need help to edit the two methods below so that i can have them wo.pdfi need help to edit the two methods below so that i can have them wo.pdf
i need help to edit the two methods below so that i can have them wo.pdf
 
Pokemon battle simulator (Java Program written on Blue J Editor)
Pokemon battle simulator (Java Program written on Blue J Editor)Pokemon battle simulator (Java Program written on Blue J Editor)
Pokemon battle simulator (Java Program written on Blue J Editor)
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
 

More from aparnacollection

What is an OS • Interface between application programs and hardwa.pdf
What is an OS • Interface between application programs and hardwa.pdfWhat is an OS • Interface between application programs and hardwa.pdf
What is an OS • Interface between application programs and hardwa.pdfaparnacollection
 
Using a broad definition of file(note that it doesnt count h.pdf
Using a broad definition of file(note that it doesnt count h.pdfUsing a broad definition of file(note that it doesnt count h.pdf
Using a broad definition of file(note that it doesnt count h.pdfaparnacollection
 
unable to open it ....it asks for username and passwordSolution.pdf
unable to open it ....it asks for username and passwordSolution.pdfunable to open it ....it asks for username and passwordSolution.pdf
unable to open it ....it asks for username and passwordSolution.pdfaparnacollection
 
This is called a dehydrationreaction. a) H2SO4 H20Solution.pdf
This is called a dehydrationreaction. a) H2SO4  H20Solution.pdfThis is called a dehydrationreaction. a) H2SO4  H20Solution.pdf
This is called a dehydrationreaction. a) H2SO4 H20Solution.pdfaparnacollection
 
The multiplication sign simply means that the molecules have their i.pdf
The multiplication sign simply means that the molecules have their i.pdfThe multiplication sign simply means that the molecules have their i.pdf
The multiplication sign simply means that the molecules have their i.pdfaparnacollection
 
SolutionThe variance of individual assets is measure of total ris.pdf
SolutionThe variance of individual assets is measure of total ris.pdfSolutionThe variance of individual assets is measure of total ris.pdf
SolutionThe variance of individual assets is measure of total ris.pdfaparnacollection
 
soldefnition of critical thinkingit is an intellectual process o.pdf
soldefnition of critical thinkingit is an intellectual process o.pdfsoldefnition of critical thinkingit is an intellectual process o.pdf
soldefnition of critical thinkingit is an intellectual process o.pdfaparnacollection
 
Program-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdfProgram-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdfaparnacollection
 
Given below is the completed code along with comments. Output of the.pdf
Given below is the completed code along with comments. Output of the.pdfGiven below is the completed code along with comments. Output of the.pdf
Given below is the completed code along with comments. Output of the.pdfaparnacollection
 
(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdf
(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdf(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdf
(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdfaparnacollection
 
Yes. The compound is actively active. It is mainl.pdf
                     Yes. The compound is actively active. It is mainl.pdf                     Yes. The compound is actively active. It is mainl.pdf
Yes. The compound is actively active. It is mainl.pdfaparnacollection
 
The probability of A and its complement will sum to oneSolution.pdf
 The probability of A and its complement will sum to oneSolution.pdf The probability of A and its complement will sum to oneSolution.pdf
The probability of A and its complement will sum to oneSolution.pdfaparnacollection
 
H+,CN-Solution H+,CN-.pdf
 H+,CN-Solution H+,CN-.pdf H+,CN-Solution H+,CN-.pdf
H+,CN-Solution H+,CN-.pdfaparnacollection
 
Adding elements public void add(String element) { For fi.pdf
 Adding elements public void add(String element) {  For fi.pdf Adding elements public void add(String element) {  For fi.pdf
Adding elements public void add(String element) { For fi.pdfaparnacollection
 
1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdf
    1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdf    1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdf
1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdfaparnacollection
 
When atoms share one or more pairs of electrons t.pdf
                     When atoms share one or more pairs of electrons t.pdf                     When atoms share one or more pairs of electrons t.pdf
When atoms share one or more pairs of electrons t.pdfaparnacollection
 
This is quite simple to do. Barium sulfate is ins.pdf
                     This is quite simple to do. Barium sulfate is ins.pdf                     This is quite simple to do. Barium sulfate is ins.pdf
This is quite simple to do. Barium sulfate is ins.pdfaparnacollection
 
Step1 Cocentration of NaCl =.250 moles Step2 Mol.pdf
                     Step1 Cocentration of NaCl =.250 moles  Step2 Mol.pdf                     Step1 Cocentration of NaCl =.250 moles  Step2 Mol.pdf
Step1 Cocentration of NaCl =.250 moles Step2 Mol.pdfaparnacollection
 
Nitric acid is a strong acid... we can assume com.pdf
                     Nitric acid is a strong acid... we can assume com.pdf                     Nitric acid is a strong acid... we can assume com.pdf
Nitric acid is a strong acid... we can assume com.pdfaparnacollection
 

More from aparnacollection (20)

}Solution}.pdf
}Solution}.pdf}Solution}.pdf
}Solution}.pdf
 
What is an OS • Interface between application programs and hardwa.pdf
What is an OS • Interface between application programs and hardwa.pdfWhat is an OS • Interface between application programs and hardwa.pdf
What is an OS • Interface between application programs and hardwa.pdf
 
Using a broad definition of file(note that it doesnt count h.pdf
Using a broad definition of file(note that it doesnt count h.pdfUsing a broad definition of file(note that it doesnt count h.pdf
Using a broad definition of file(note that it doesnt count h.pdf
 
unable to open it ....it asks for username and passwordSolution.pdf
unable to open it ....it asks for username and passwordSolution.pdfunable to open it ....it asks for username and passwordSolution.pdf
unable to open it ....it asks for username and passwordSolution.pdf
 
This is called a dehydrationreaction. a) H2SO4 H20Solution.pdf
This is called a dehydrationreaction. a) H2SO4  H20Solution.pdfThis is called a dehydrationreaction. a) H2SO4  H20Solution.pdf
This is called a dehydrationreaction. a) H2SO4 H20Solution.pdf
 
The multiplication sign simply means that the molecules have their i.pdf
The multiplication sign simply means that the molecules have their i.pdfThe multiplication sign simply means that the molecules have their i.pdf
The multiplication sign simply means that the molecules have their i.pdf
 
SolutionThe variance of individual assets is measure of total ris.pdf
SolutionThe variance of individual assets is measure of total ris.pdfSolutionThe variance of individual assets is measure of total ris.pdf
SolutionThe variance of individual assets is measure of total ris.pdf
 
soldefnition of critical thinkingit is an intellectual process o.pdf
soldefnition of critical thinkingit is an intellectual process o.pdfsoldefnition of critical thinkingit is an intellectual process o.pdf
soldefnition of critical thinkingit is an intellectual process o.pdf
 
Program-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdfProgram-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdf
 
Given below is the completed code along with comments. Output of the.pdf
Given below is the completed code along with comments. Output of the.pdfGiven below is the completed code along with comments. Output of the.pdf
Given below is the completed code along with comments. Output of the.pdf
 
(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdf
(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdf(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdf
(a) The American Institute of Certified Accountants. (AICPA)(b) Th.pdf
 
Yes. The compound is actively active. It is mainl.pdf
                     Yes. The compound is actively active. It is mainl.pdf                     Yes. The compound is actively active. It is mainl.pdf
Yes. The compound is actively active. It is mainl.pdf
 
The probability of A and its complement will sum to oneSolution.pdf
 The probability of A and its complement will sum to oneSolution.pdf The probability of A and its complement will sum to oneSolution.pdf
The probability of A and its complement will sum to oneSolution.pdf
 
H+,CN-Solution H+,CN-.pdf
 H+,CN-Solution H+,CN-.pdf H+,CN-Solution H+,CN-.pdf
H+,CN-Solution H+,CN-.pdf
 
Adding elements public void add(String element) { For fi.pdf
 Adding elements public void add(String element) {  For fi.pdf Adding elements public void add(String element) {  For fi.pdf
Adding elements public void add(String element) { For fi.pdf
 
1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdf
    1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdf    1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdf
1) Investment Grade Domestic Bonds As bond bears a fixed rate of i.pdf
 
When atoms share one or more pairs of electrons t.pdf
                     When atoms share one or more pairs of electrons t.pdf                     When atoms share one or more pairs of electrons t.pdf
When atoms share one or more pairs of electrons t.pdf
 
This is quite simple to do. Barium sulfate is ins.pdf
                     This is quite simple to do. Barium sulfate is ins.pdf                     This is quite simple to do. Barium sulfate is ins.pdf
This is quite simple to do. Barium sulfate is ins.pdf
 
Step1 Cocentration of NaCl =.250 moles Step2 Mol.pdf
                     Step1 Cocentration of NaCl =.250 moles  Step2 Mol.pdf                     Step1 Cocentration of NaCl =.250 moles  Step2 Mol.pdf
Step1 Cocentration of NaCl =.250 moles Step2 Mol.pdf
 
Nitric acid is a strong acid... we can assume com.pdf
                     Nitric acid is a strong acid... we can assume com.pdf                     Nitric acid is a strong acid... we can assume com.pdf
Nitric acid is a strong acid... we can assume com.pdf
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

package com.test;public class Team {    private String teamId;.pdf

  • 1. package com.test; public class Team { private String teamId; private String teamName; private String pFirstName; private String pLastName; private String pemail; private String phoneNumber; public String getTeamId() { return teamId; } public void setTeamId(String teamId) { this.teamId = teamId; } public String getTeamName() { return teamName; } public void setTeamName(String teamName) { this.teamName = teamName; } public String getpFirstName() { return pFirstName; } public void setpFirstName(String pFirstName) { this.pFirstName = pFirstName; } public String getpLastName() { return pLastName; } public void setpLastName(String pLastName) { this.pLastName = pLastName; } public String getPemail() { return pemail; }
  • 2. public void setPemail(String pemail) { this.pemail = pemail; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String toString() { return "Team [teamId=" + teamId + ", teamName=" + teamName + ", pFirstName=" + pFirstName + ", pLastName=" + pLastName + ", pemail=" + pemail + ", phoneNumber=" + phoneNumber + "]"; } public Team(String teamId, String teamName, String pFirstName, String pLastName, String pemail, String phoneNumber) { super(); this.teamId = teamId; this.teamName = teamName; this.pFirstName = pFirstName; this.pLastName = pLastName; this.pemail = pemail; this.phoneNumber = phoneNumber; } public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((pFirstName == null) ? 0 : pFirstName.hashCode()); result = prime * result + ((pLastName == null) ? 0 : pLastName.hashCode()); result = prime * result + ((pemail == null) ? 0 : pemail.hashCode()); result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
  • 3. result = prime * result + ((teamId == null) ? 0 : teamId.hashCode()); result = prime * result + ((teamName == null) ? 0 : teamName.hashCode()); return result; } public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Team other = (Team) obj; if (pFirstName == null) { if (other.pFirstName != null) return false; } else if (!pFirstName.equals(other.pFirstName)) return false; if (pLastName == null) { if (other.pLastName != null) return false; } else if (!pLastName.equals(other.pLastName)) return false; if (pemail == null) { if (other.pemail != null) return false; } else if (!pemail.equals(other.pemail)) return false; if (phoneNumber == null) { if (other.phoneNumber != null) return false; } else if (!phoneNumber.equals(other.phoneNumber)) return false; if (teamId == null) { if (other.teamId != null)
  • 4. return false; } else if (!teamId.equals(other.teamId)) return false; if (teamName == null) { if (other.teamName != null) return false; } else if (!teamName.equals(other.teamName)) return false; return true; } } package com.test; import java.util.Date; public class Game { private String gameId; private String teamId; private String guestTeamId; private Date gameDate;// yyyymmdd private int homeTeamScore; private int guestTeamScore; public Game(String gameId, String teamId, String guestTeamId, Date gameDate, int homeTeamScore, int guestTeamScore) { super(); this.gameId = gameId; this.teamId = teamId; this.guestTeamId = guestTeamId; this.gameDate = gameDate; this.homeTeamScore = homeTeamScore; this.guestTeamScore = guestTeamScore; } public String toString() { return "Game [gameId=" + gameId + ", teamId=" + teamId + ", guestTeamId=" + guestTeamId + ", gameDate=" + gameDate
  • 5. + ", homeTeamScore=" + homeTeamScore + ", guestTeamScore=" + guestTeamScore + "]"; } public String getGameId() { return gameId; } public void setGameId(String gameId) { this.gameId = gameId; } public String getTeamId() { return teamId; } public void setTeamId(String teamId) { this.teamId = teamId; } public String getGuestTeamId() { return guestTeamId; } public void setGuestTeamId(String guestTeamId) { this.guestTeamId = guestTeamId; } public Date getGameDate() { return gameDate; } public void setGameDate(Date gameDate) { this.gameDate = gameDate; } public int getHomeTeamScore() { return homeTeamScore; } public void setHomeTeamScore(int homeTeamScore) { this.homeTeamScore = homeTeamScore; } public int getGuestTeamScore() { return guestTeamScore; }
  • 6. public void setGuestTeamScore(int guestTeamScore) { this.guestTeamScore = guestTeamScore; } public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((gameDate == null) ? 0 : gameDate.hashCode()); result = prime * result + ((gameId == null) ? 0 : gameId.hashCode()); result = prime * result + ((guestTeamId == null) ? 0 : guestTeamId.hashCode()); result = prime * result + guestTeamScore; result = prime * result + homeTeamScore; result = prime * result + ((teamId == null) ? 0 : teamId.hashCode()); return result; } public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Game other = (Game) obj; if (gameDate == null) { if (other.gameDate != null) return false; } else if (!gameDate.equals(other.gameDate)) return false; if (gameId == null) { if (other.gameId != null) return false; } else if (!gameId.equals(other.gameId)) return false;
  • 7. if (guestTeamId == null) { if (other.guestTeamId != null) return false; } else if (!guestTeamId.equals(other.guestTeamId)) return false; if (guestTeamScore != other.guestTeamScore) return false; if (homeTeamScore != other.homeTeamScore) return false; if (teamId == null) { if (other.teamId != null) return false; } else if (!teamId.equals(other.teamId)) return false; return true; } } package com.test; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.OutputStreamWriter; public class Test { public static boolean findEmailtoSearch(Team team) { String stringToSearch =team.getPemail(); System.out.println(stringToSearch); Pattern p = Pattern.compile("(at sign)"); // the pattern to search for
  • 8. Matcher m = p.matcher(stringToSearch); // now try to find at least one match if (m.find()) { System.out.println("Found a match"); return true; } else { System.out.println("Did not find a match"); return false; } } public void textFileReadingExample() throws Throwable { FileReader reader = new FileReader("D://MyFile.txt"); BufferedReader bufferedReader = new BufferedReader(reader); String line; while ((line = bufferedReader.readLine()) != null) { System.out.println(line); } reader.close(); } /** * This program demonstrates how to write characters to a text file using * a specified charset. * public void textFileWritingExample() throws IOException{ FileOutputStream outputStream = new FileOutputStream("D://MyFile.txt"); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, "UTF- 16"); BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter); bufferedWriter.write("TEAM,teamId,teamName,firstName,lastName,phoneNumber,email"); bufferedWriter.newLine();
  • 9. bufferedWriter.write("TEAM,1,Road Runner,David,Brown,303-123-4567,roadrunner(at sign)gmail.com"); bufferedWriter.newLine(); bufferedWriter.write("GAME,gameId,homeTeamId,guestTeamId,gameDate,homeTeamScore,g uestTeamScore"); bufferedWriter.newLine(); bufferedWriter.write("GAME,101,1,2,20160105,4,3"); bufferedWriter.close(); } /** * Find out if a String contains a very simple pattern. */ public static void main(String[] args) throws Throwable { Team team=new Team("1","Road Runner","Joe","Doe", "roadrunner(at sign)gmail.com","(303) 123-4599"); Team team1 = new Team("1","Road Runner","Joe","Doe", "roadrunne(at sign)gmail.com","(303) 123-4599"); Game game=new Game("101","1","2",new Date(),4,3); System.out.println(game); boolean flag= Test.findEmailtoSearch(team); System.out.println(flag); boolean flag1= Test.findEmailtoSearch(team1); System.out.println(flag1); Test test=new Test(); test.textFileWritingExample(); test.textFileReadingExample(); } } output Game [gameId=101, teamId=1, guestTeamId=2, gameDate=Mon Sep 12 17:21:26 IST 2016, homeTeamScore=4, guestTeamScore=3] roadrunner(at sign)gmail.com
  • 10. Found a match true roadrunne(at sign)gmail.com Found a match true Solution package com.test; public class Team { private String teamId; private String teamName; private String pFirstName; private String pLastName; private String pemail; private String phoneNumber; public String getTeamId() { return teamId; } public void setTeamId(String teamId) { this.teamId = teamId; } public String getTeamName() { return teamName; } public void setTeamName(String teamName) { this.teamName = teamName; } public String getpFirstName() { return pFirstName; } public void setpFirstName(String pFirstName) { this.pFirstName = pFirstName; } public String getpLastName() { return pLastName;
  • 11. } public void setpLastName(String pLastName) { this.pLastName = pLastName; } public String getPemail() { return pemail; } public void setPemail(String pemail) { this.pemail = pemail; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String toString() { return "Team [teamId=" + teamId + ", teamName=" + teamName + ", pFirstName=" + pFirstName + ", pLastName=" + pLastName + ", pemail=" + pemail + ", phoneNumber=" + phoneNumber + "]"; } public Team(String teamId, String teamName, String pFirstName, String pLastName, String pemail, String phoneNumber) { super(); this.teamId = teamId; this.teamName = teamName; this.pFirstName = pFirstName; this.pLastName = pLastName; this.pemail = pemail; this.phoneNumber = phoneNumber; } public int hashCode() { final int prime = 31; int result = 1;
  • 12. result = prime * result + ((pFirstName == null) ? 0 : pFirstName.hashCode()); result = prime * result + ((pLastName == null) ? 0 : pLastName.hashCode()); result = prime * result + ((pemail == null) ? 0 : pemail.hashCode()); result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode()); result = prime * result + ((teamId == null) ? 0 : teamId.hashCode()); result = prime * result + ((teamName == null) ? 0 : teamName.hashCode()); return result; } public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Team other = (Team) obj; if (pFirstName == null) { if (other.pFirstName != null) return false; } else if (!pFirstName.equals(other.pFirstName)) return false; if (pLastName == null) { if (other.pLastName != null) return false; } else if (!pLastName.equals(other.pLastName)) return false; if (pemail == null) { if (other.pemail != null) return false; } else if (!pemail.equals(other.pemail)) return false;
  • 13. if (phoneNumber == null) { if (other.phoneNumber != null) return false; } else if (!phoneNumber.equals(other.phoneNumber)) return false; if (teamId == null) { if (other.teamId != null) return false; } else if (!teamId.equals(other.teamId)) return false; if (teamName == null) { if (other.teamName != null) return false; } else if (!teamName.equals(other.teamName)) return false; return true; } } package com.test; import java.util.Date; public class Game { private String gameId; private String teamId; private String guestTeamId; private Date gameDate;// yyyymmdd private int homeTeamScore; private int guestTeamScore; public Game(String gameId, String teamId, String guestTeamId, Date gameDate, int homeTeamScore, int guestTeamScore) { super(); this.gameId = gameId; this.teamId = teamId; this.guestTeamId = guestTeamId; this.gameDate = gameDate;
  • 14. this.homeTeamScore = homeTeamScore; this.guestTeamScore = guestTeamScore; } public String toString() { return "Game [gameId=" + gameId + ", teamId=" + teamId + ", guestTeamId=" + guestTeamId + ", gameDate=" + gameDate + ", homeTeamScore=" + homeTeamScore + ", guestTeamScore=" + guestTeamScore + "]"; } public String getGameId() { return gameId; } public void setGameId(String gameId) { this.gameId = gameId; } public String getTeamId() { return teamId; } public void setTeamId(String teamId) { this.teamId = teamId; } public String getGuestTeamId() { return guestTeamId; } public void setGuestTeamId(String guestTeamId) { this.guestTeamId = guestTeamId; } public Date getGameDate() { return gameDate; } public void setGameDate(Date gameDate) { this.gameDate = gameDate; } public int getHomeTeamScore() { return homeTeamScore;
  • 15. } public void setHomeTeamScore(int homeTeamScore) { this.homeTeamScore = homeTeamScore; } public int getGuestTeamScore() { return guestTeamScore; } public void setGuestTeamScore(int guestTeamScore) { this.guestTeamScore = guestTeamScore; } public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((gameDate == null) ? 0 : gameDate.hashCode()); result = prime * result + ((gameId == null) ? 0 : gameId.hashCode()); result = prime * result + ((guestTeamId == null) ? 0 : guestTeamId.hashCode()); result = prime * result + guestTeamScore; result = prime * result + homeTeamScore; result = prime * result + ((teamId == null) ? 0 : teamId.hashCode()); return result; } public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Game other = (Game) obj; if (gameDate == null) { if (other.gameDate != null) return false;
  • 16. } else if (!gameDate.equals(other.gameDate)) return false; if (gameId == null) { if (other.gameId != null) return false; } else if (!gameId.equals(other.gameId)) return false; if (guestTeamId == null) { if (other.guestTeamId != null) return false; } else if (!guestTeamId.equals(other.guestTeamId)) return false; if (guestTeamScore != other.guestTeamScore) return false; if (homeTeamScore != other.homeTeamScore) return false; if (teamId == null) { if (other.teamId != null) return false; } else if (!teamId.equals(other.teamId)) return false; return true; } } package com.test; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.OutputStreamWriter; public class Test {
  • 17. public static boolean findEmailtoSearch(Team team) { String stringToSearch =team.getPemail(); System.out.println(stringToSearch); Pattern p = Pattern.compile("(at sign)"); // the pattern to search for Matcher m = p.matcher(stringToSearch); // now try to find at least one match if (m.find()) { System.out.println("Found a match"); return true; } else { System.out.println("Did not find a match"); return false; } } public void textFileReadingExample() throws Throwable { FileReader reader = new FileReader("D://MyFile.txt"); BufferedReader bufferedReader = new BufferedReader(reader); String line; while ((line = bufferedReader.readLine()) != null) { System.out.println(line); } reader.close(); } /** * This program demonstrates how to write characters to a text file using * a specified charset. *
  • 18. public void textFileWritingExample() throws IOException{ FileOutputStream outputStream = new FileOutputStream("D://MyFile.txt"); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream, "UTF- 16"); BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter); bufferedWriter.write("TEAM,teamId,teamName,firstName,lastName,phoneNumber,email"); bufferedWriter.newLine(); bufferedWriter.write("TEAM,1,Road Runner,David,Brown,303-123-4567,roadrunner(at sign)gmail.com"); bufferedWriter.newLine(); bufferedWriter.write("GAME,gameId,homeTeamId,guestTeamId,gameDate,homeTeamScore,g uestTeamScore"); bufferedWriter.newLine(); bufferedWriter.write("GAME,101,1,2,20160105,4,3"); bufferedWriter.close(); } /** * Find out if a String contains a very simple pattern. */ public static void main(String[] args) throws Throwable { Team team=new Team("1","Road Runner","Joe","Doe", "roadrunner(at sign)gmail.com","(303) 123-4599"); Team team1 = new Team("1","Road Runner","Joe","Doe", "roadrunne(at sign)gmail.com","(303) 123-4599"); Game game=new Game("101","1","2",new Date(),4,3); System.out.println(game); boolean flag= Test.findEmailtoSearch(team); System.out.println(flag); boolean flag1= Test.findEmailtoSearch(team1); System.out.println(flag1); Test test=new Test(); test.textFileWritingExample();
  • 19. test.textFileReadingExample(); } } output Game [gameId=101, teamId=1, guestTeamId=2, gameDate=Mon Sep 12 17:21:26 IST 2016, homeTeamScore=4, guestTeamScore=3] roadrunner(at sign)gmail.com Found a match true roadrunne(at sign)gmail.com Found a match true