-
Notifications
You must be signed in to change notification settings - Fork 0
/
IdentifierInterface.java
47 lines (38 loc) · 1.38 KB
/
IdentifierInterface.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package assignment1;
public interface IdentifierInterface {
/*
@Elements: characters of type char
@Structure: Linear
@Domain: alphanumeric characters that begin with a letter and have a length of at least 1
constructors
* Identifier();
* @precondition - *
* @postcondition - A new Identifier that contains an undefined value
*
* Identifier
* @precondition - *
* @postcondition - A new Identifier-object that contains a copy of src
*
*/
void init(char c);
/* @precondition - char c is an alphanumeric character
@postcondition - Identifier has one char, char c
*/
void add(char c);
/* @precondition - char c is an alphanumeric character
@postcondition - the char falls inside the domain and is added to set with length+1
*/
int size();
/* @precondition -
@postcondition - the number of chars in the identifier has been returned
*/
boolean equals(Identifier comparand);
/* @precondition -
@postcondition - succes: The value of this identifier is equal to the value of the argument identifier
failure: The value of this identifier is not equal to the value of the argument identifier
*/
String get();
/* @precondition -
@postcondition - identifier as string has been returned
*/
}