proper.imp
Class Namer

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.imp.Namer
All Implemented Interfaces:
ProperInterface

public class Namer
extends ProperObject

A class for creating table names, column names, etc.

Version:
$Revision: 1.2 $
Author:
FracPete
See Also:
Importer

Field Summary
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
Namer(Traverser t, Indexer i)
          initializes the object
 
Method Summary
 java.util.Vector createIdNames(Data d)
          creates all the names of the IDs for the given predicate
 java.lang.String fixName(java.lang.String name)
          fixes the name, s.t.
 java.lang.String getColumnName(Data d, int index)
          creates the column name for the predicate and argument index, can be NULL
 boolean getContainsID()
          whether an argument of a predicate continas the ID
 java.lang.String getParentPrimaryKey(Data d)
          returns the name of the primary key of the parent predicate, is "" if the predicate has no parent!
 java.lang.String getPrimaryKey(Data d)
          returns the name of the primary key for the given predicate/list
 java.lang.String getPrimaryKey(java.lang.String name)
          returns the name of the primary key for the given predicate/list
 java.lang.String getTable(Data d)
          returns the name of the table for the given predicate/list
 java.lang.String getTable(java.lang.String name)
          returns the name of the table for the given predicate/list
 boolean hasIdentifiers()
          whether we have identifiers among the predicates, i.e.
 void setContainsID(boolean containsID)
          sets whether an argument of a predicate continas the ID
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Namer

public Namer(Traverser t,
             Indexer i)
initializes the object

Parameters:
t - the traverser to use
i - the indexer to use
Method Detail

setContainsID

public void setContainsID(boolean containsID)
sets whether an argument of a predicate continas the ID


getContainsID

public boolean getContainsID()
whether an argument of a predicate continas the ID


hasIdentifiers

public boolean hasIdentifiers()
whether we have identifiers among the predicates, i.e. we imported a CSV-file with identifiers for the columns


createIdNames

public java.util.Vector createIdNames(Data d)
creates all the names of the IDs for the given predicate


fixName

public java.lang.String fixName(java.lang.String name)
fixes the name, s.t. MySQL has no problems with it


getTable

public java.lang.String getTable(java.lang.String name)
returns the name of the table for the given predicate/list


getTable

public java.lang.String getTable(Data d)
returns the name of the table for the given predicate/list


getPrimaryKey

public java.lang.String getPrimaryKey(java.lang.String name)
returns the name of the primary key for the given predicate/list


getPrimaryKey

public java.lang.String getPrimaryKey(Data d)
returns the name of the primary key for the given predicate/list


getParentPrimaryKey

public java.lang.String getParentPrimaryKey(Data d)
returns the name of the primary key of the parent predicate, is "" if the predicate has no parent!


getColumnName

public java.lang.String getColumnName(Data d,
                                      int index)
creates the column name for the predicate and argument index, can be NULL