FreeLing  3.1
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends
freeling::tree< T > Class Template Reference

#include <tree.h>

Inheritance diagram for freeling::tree< T >:
Inheritance graph
[legend]
Collaboration diagram for freeling::tree< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef class generic_iterator< T > generic_iterator
typedef class
generic_const_iterator< T > 
generic_const_iterator
typedef class
preorder_iterator< T > 
preorder_iterator
typedef class
const_preorder_iterator< T > 
const_preorder_iterator
typedef class sibling_iterator< T > sibling_iterator
typedef class
const_sibling_iterator< T > 
const_sibling_iterator
typedef preorder_iterator iterator
typedef const_preorder_iterator const_iterator

Public Member Functions

 tree ()
 Method implementations for class tree.
 tree (const T &)
 constructor: one-node tree
 tree (const tree< T > &)
 copy constructor
 tree (const typename tree< T >::preorder_iterator &)
 constructor from an iterator
 ~tree ()
 destructor
tree< T > & operator= (const tree< T > &)
 assignment
unsigned int num_children () const
 number of children
sibling_iterator nth_child (unsigned int) const
 access nth child
iterator get_parent () const
 access parent
tree< T > & nth_child_ref (unsigned int) const
 access nth child ref (useful for Java API)
T & get_info ()
 access info (useful for Java API)
void append_child (const tree< T > &)
 append child to a tree
void hang_child (tree< T > &, bool=true)
 hang a tree as last child of another (no copying!!)
void clear ()
bool empty () const
 detect empty tree
sibling_iterator sibling_begin ()
 begin/end sibling iterator
const_sibling_iterator sibling_begin () const
sibling_iterator sibling_end ()
const_sibling_iterator sibling_end () const
sibling_iterator sibling_rbegin ()
const_sibling_iterator sibling_rbegin () const
sibling_iterator sibling_rend ()
const_sibling_iterator sibling_rend () const
preorder_iterator begin ()
 begin/end preorder iterator
const_preorder_iterator begin () const
preorder_iterator end ()
const_preorder_iterator end () const

Public Attributes

info

Private Member Functions

void clone (const tree< T > &)
 clone an entire tree

Private Attributes

bool isempty
treeparent
treefirst
treelast
treeprev
treenext

Friends

class preorder_iterator< T >
class const_preorder_iterator< T >
class sibling_iterator< T >
class const_sibling_iterator< T >

template<class T>
class freeling::tree< T >


Member Typedef Documentation

template<class T>
typedef const_preorder_iterator freeling::tree< T >::const_iterator
template<class T>
typedef class const_preorder_iterator< T > freeling::tree< T >::const_preorder_iterator
template<class T>
typedef class const_sibling_iterator< T > freeling::tree< T >::const_sibling_iterator
template<class T>
typedef class generic_const_iterator< T > freeling::tree< T >::generic_const_iterator
template<class T>
typedef class generic_iterator< T > freeling::tree< T >::generic_iterator
template<class T>
typedef preorder_iterator freeling::tree< T >::iterator
template<class T>
typedef class preorder_iterator< T > freeling::tree< T >::preorder_iterator
template<class T>
typedef class sibling_iterator< T > freeling::tree< T >::sibling_iterator

Constructor & Destructor Documentation

template<class T >
freeling::tree< T >::tree ( )

Method implementations for class tree.

constructor: empty tree doesn't exist, it's a one-node tree with no info. Be careful

References last, next, and prev.

template<class T>
freeling::tree< T >::tree ( const T &  x)
template<class T>
freeling::tree< T >::tree ( const tree< T > &  t)

copy constructor

template<class T>
freeling::tree< T >::tree ( const typename tree< T >::preorder_iterator p)

constructor from an iterator

template<class T >
freeling::tree< T >::~tree ( )

destructor

References freeling::tree< T >::next.


Member Function Documentation

template<class T>
void freeling::tree< T >::append_child ( const tree< T > &  child)
template<class T >
tree< T >::preorder_iterator freeling::tree< T >::begin ( )
template<class T >
tree< T >::const_preorder_iterator freeling::tree< T >::begin ( ) const
template<class T >
void freeling::tree< T >::clear ( )
template<class T>
void freeling::tree< T >::clone ( const tree< T > &  t) [private]
template<class T >
bool freeling::tree< T >::empty ( ) const

detect empty tree

template<class T >
tree< T >::preorder_iterator freeling::tree< T >::end ( )
template<class T >
tree< T >::const_preorder_iterator freeling::tree< T >::end ( ) const
template<class T >
T & freeling::tree< T >::get_info ( )

access info (useful for Java API)

template<class T >
tree< T >::iterator freeling::tree< T >::get_parent ( ) const

access parent

template<class T>
void freeling::tree< T >::hang_child ( tree< T > &  child,
bool  last = true 
)
template<class T >
tree< T >::sibling_iterator freeling::tree< T >::nth_child ( unsigned int  n) const

access nth child

template<class T >
tree< T > & freeling::tree< T >::nth_child_ref ( unsigned int  n) const

access nth child ref (useful for Java API)

template<class T >
unsigned int freeling::tree< T >::num_children ( ) const

number of children

References freeling::tree< T >::next.

Referenced by freeling::completer::complete().

template<class T>
tree< T > & freeling::tree< T >::operator= ( const tree< T > &  t)

assignment

template<class T >
tree< T >::sibling_iterator freeling::tree< T >::sibling_begin ( )

begin/end sibling iterator

Referenced by freeling::completer::complete().

template<class T >
tree< T >::const_sibling_iterator freeling::tree< T >::sibling_begin ( ) const
template<class T >
tree< T >::sibling_iterator freeling::tree< T >::sibling_end ( )
template<class T >
tree< T >::const_sibling_iterator freeling::tree< T >::sibling_end ( ) const
template<class T >
tree< T >::sibling_iterator freeling::tree< T >::sibling_rbegin ( )

References last.

template<class T >
tree< T >::const_sibling_iterator freeling::tree< T >::sibling_rbegin ( ) const

References last.

template<class T >
tree< T >::sibling_iterator freeling::tree< T >::sibling_rend ( )
template<class T >
tree< T >::const_sibling_iterator freeling::tree< T >::sibling_rend ( ) const

Friends And Related Function Documentation

template<class T>
friend class const_preorder_iterator< T > [friend]
template<class T>
friend class const_sibling_iterator< T > [friend]
template<class T>
friend class preorder_iterator< T > [friend]
template<class T>
friend class sibling_iterator< T > [friend]

Member Data Documentation

template<class T>
tree* freeling::tree< T >::first [private]
template<class T>
T freeling::tree< T >::info
template<class T>
bool freeling::tree< T >::isempty [private]
template<class T>
tree * freeling::tree< T >::last [private]
template<class T>
tree * freeling::tree< T >::next [private]
template<class T>
tree* freeling::tree< T >::parent [private]
template<class T>
tree* freeling::tree< T >::prev [private]

The documentation for this class was generated from the following file: