'Constructor
@param tablename: the tablename
@param hierarchy: the hierarchy setting for the table
(replaces the current setting)
@param represent: a representation method for the node IDs
@param filter: additional filter query for the table to
select the relevant subset
@param leafonly: filter strictly for leaf nodes'

def __init__(self, tablename=None, hierarchy=None, represent=None, filter=None, leafonly=True):

    self.tablename = tablename
    if hierarchy:
        current.s3db.configure(tablename, hierarchy=hierarchy)
    self.represent = represent
    self.filter = filter
    self.leafonly = leafonly
    self.__theset = None
    self.__flags = None
    self.__nodes = None
    self.__roots = None
    self.__pkey = None
    self.__fkey = None
    self.__ckey = None
    self.__link = DEFAULT
    self.__lkey = DEFAULT
    self.__left = DEFAULT
