sg.edu.nus.peer.info
Class Schema

java.lang.Object
  extended by sg.edu.nus.peer.info.Schema

public class Schema
extends java.lang.Object

record the schema of the relations

Author:
Wu Sai THIS CLASS is intended to be used for initial database keywords indexed in Lucence

Field Summary
static int INTEGER_TYPE
           
static int STRING_TYPE
           
 
Constructor Summary
Schema(java.lang.String file)
           
 
Method Summary
 java.lang.String[] getAttributeName(java.lang.String relation)
          given a relation name return its attribute names
 java.lang.Object[] getDomain(java.lang.String relation, java.lang.String attribute)
          given a relation and one of its attribute, return the domain of the attribute
 int getType(java.lang.String relation, java.lang.String attribute)
          given a relation and one of its attribute, return the type of the attribute
 void load()
          load the schema info from file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING_TYPE

public static int STRING_TYPE

INTEGER_TYPE

public static int INTEGER_TYPE
Constructor Detail

Schema

public Schema(java.lang.String file)
Method Detail

load

public void load()
load the schema info from file


getAttributeName

public java.lang.String[] getAttributeName(java.lang.String relation)
given a relation name return its attribute names

Parameters:
relation -
Returns:

getType

public int getType(java.lang.String relation,
                   java.lang.String attribute)
given a relation and one of its attribute, return the type of the attribute

Parameters:
relation -
attribute -
Returns:

getDomain

public java.lang.Object[] getDomain(java.lang.String relation,
                                    java.lang.String attribute)
given a relation and one of its attribute, return the domain of the attribute

Parameters:
relation -
attribute -
Returns: