-
Notifications
You must be signed in to change notification settings - Fork 0
/
Field.java
40 lines (34 loc) · 1.06 KB
/
Field.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
package simpledb;
import java.io.*;
/**
* Interface for values of fields in tuples in SimpleDB.
*/
public interface Field {
/**
* Write the bytes representing this field to the specified
* DataOutputStream.
* @see DataOutputStream
* @param dos The DataOutputStream to write to.
*/
void serialize(DataOutputStream dos) throws IOException;
/**
* Compare the value of this field object to the passed in value.
* @param op The operator
* @param value The value to compare this Field to
* @return Whether or not the comparison yields true.
*/
public boolean compare(Predicate.Op op, Field value);
/**
* Returns the type of this field (see {@link Type#INT_TYPE} or {@link Type#STRING_TYPE}
* @return type of this field
*/
public Type getType();
/**
* Hash code.
* Different Field objects representing the same value should probably
* return the same hashCode.
*/
public int hashCode();
public boolean equals(Object field);
public String toString();
}