|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsimpledb.record.Schema
public class Schema
The record schema of a table. A schema contains the name and type of each field of the table, as well as the length of each varchar field.
| Constructor Summary | |
|---|---|
Schema()
Creates an empty schema. |
|
| Method Summary | |
|---|---|
void |
add(String fldname,
Schema sch)
Adds a field to the schema having the same type and length as the corresponding field in another schema. |
void |
addAll(Schema sch)
Adds all of the fields in the specified schema to the current schema. |
void |
addField(String fldname,
int type,
int length)
Adds a field to the schema having a specified name, type, and length. |
void |
addIntField(String fldname)
Adds an integer field to the schema. |
void |
addStringField(String fldname,
int length)
Adds a string field to the schema. |
Collection<String> |
fields()
Returns a collection containing the name of each field in the schema. |
boolean |
hasField(String fldname)
Returns true if the specified field is in the schema |
int |
length(String fldname)
Returns the conceptual length of the specified field. |
int |
type(String fldname)
Returns the type of the specified field, using the constants in Types. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Schema()
| Method Detail |
|---|
public void addField(String fldname,
int type,
int length)
fldname - the name of the fieldtype - the type of the field, according to the constants in simpledb.sql.typeslength - the conceptual length of a string field.public void addIntField(String fldname)
fldname - the name of the field
public void addStringField(String fldname,
int length)
fldname - the name of the fieldlength - the number of chars in the varchar definition
public void add(String fldname,
Schema sch)
fldname - the name of the fieldsch - the other schemapublic void addAll(Schema sch)
sch - the other schemapublic Collection<String> fields()
public boolean hasField(String fldname)
fldname - the name of the field
public int type(String fldname)
Types.
fldname - the name of the field
public int length(String fldname)
fldname - the name of the field
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||