|
||||||||||
| 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.
| Nested Class Summary | |
|---|---|
(package private) class |
Schema.FieldInfo
|
| Constructor Summary | |
|---|---|
Schema()
Creates an empty schema. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.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(java.lang.String fldname,
int type,
int length)
Adds a field to the schema having a specified name, type, and length. |
void |
addIntField(java.lang.String fldname)
Adds an integer field to the schema. |
void |
addStringField(java.lang.String fldname,
int length)
Adds a string field to the schema. |
java.util.Collection<java.lang.String> |
fields()
Returns a collection containing the name of each field in the schema. |
boolean |
hasField(java.lang.String fldname)
Returns true if the specified field is in the schema |
int |
length(java.lang.String fldname)
Returns the conceptual length of the specified field. |
int |
type(java.lang.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(java.lang.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(java.lang.String fldname)
fldname - the name of the field
public void addStringField(java.lang.String fldname,
int length)
fldname - the name of the fieldlength - the number of chars in the varchar definition
public void add(java.lang.String fldname,
Schema sch)
fldname - the name of the fieldsch - the other schemapublic void addAll(Schema sch)
sch - the other schemapublic java.util.Collection<java.lang.String> fields()
public boolean hasField(java.lang.String fldname)
fldname - the name of the field
public int type(java.lang.String fldname)
Types.
fldname - the name of the field
public int length(java.lang.String fldname)
fldname - the name of the field
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||