2023-06-10 15:50:10 +03:00
|
|
|
/*
|
|
|
|
* %W% %E% Dymik739
|
|
|
|
* Email: dymik739@109.86.70.81
|
|
|
|
*
|
|
|
|
* Copyright (C) 2023 FIOT Dev Team
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which represents a single character and replaces the default
|
|
|
|
* 'char' data type.
|
|
|
|
*
|
|
|
|
* @since 0.2
|
|
|
|
* @author Dymik739
|
|
|
|
*/
|
2023-06-08 15:31:50 +03:00
|
|
|
public class Symbol {
|
2023-06-10 15:50:10 +03:00
|
|
|
/** contains character that the object represents. */
|
2023-06-08 15:31:50 +03:00
|
|
|
private char symbol;
|
2023-06-10 15:50:10 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor which creates this object using a single char.
|
|
|
|
*
|
|
|
|
* @since the_world_was_created
|
|
|
|
* @param symbol character this object represents
|
|
|
|
*/
|
2023-06-08 15:31:50 +03:00
|
|
|
public Symbol(char symbol) {
|
|
|
|
this.symbol = symbol;
|
|
|
|
}
|
|
|
|
|
2023-06-10 15:50:10 +03:00
|
|
|
/**
|
|
|
|
* Method used to get a proper String representation of this symbol.
|
|
|
|
*
|
|
|
|
* @since 0.2
|
|
|
|
* @return String representation of this symbol
|
|
|
|
*/
|
|
|
|
@Override
|
2023-06-08 15:31:50 +03:00
|
|
|
public String toString() {
|
|
|
|
char[] arr = new char[1];
|
|
|
|
arr[0] = this.symbol;
|
|
|
|
return new String(arr);
|
|
|
|
}
|
2023-06-10 15:50:10 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method used to compare two symbols.
|
|
|
|
*
|
|
|
|
* @since 0.2
|
|
|
|
* @param o another symbol to compare to
|
|
|
|
* @return true if symbols are the same, false otherwise
|
|
|
|
*/
|
2023-06-08 15:31:50 +03:00
|
|
|
public boolean equals(Symbol o) {
|
|
|
|
return this.symbol == o.symbol;
|
|
|
|
}
|
|
|
|
}
|