Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Regex {
- private int id;
- private String pattern;
- private String description;
- private int rating;
- private static int nextId = 0;
- public Regex(String pattern, String description){
- this.pattern = pattern;
- this.description = description;
- this.rating = 0;
- nextId += 1;
- this.id = nextId;
- }
- public String getPattern() {
- return this.pattern;
- }
- public void setId(int id) {
- this.id = id;
- }
- public void setRating(int rating) {
- this.rating = rating;
- }
- public String getDescription() {
- return this.description;
- }
- public int getRating () {
- return this.rating;
- }
- public int getId () {
- return this.id;
- }
- @Override
- public String toString()
- {
- return id + "," + pattern + "," + description + "," + rating;
- }
- }
Add Comment
Please, Sign In to add comment