/*
    Copyright (C) 2012 Bartosz Broda, Jacek Bochenek, Łukasz Biłeńkij, 
    Damian Jaworski, Wojciech Mazur, Dominik Piasecki, Maciej Piasecki, 
    Radosław Ramocki
    
    This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.

    This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. 

    See the LICENSE and COPYING files for more details.
*/

#include "node.h"

Node::Node(int id, size_t level, double similarity): id(id), level(level), similarity(similarity)
{

}

int Node::GetID() const
{
    return id;
}

size_t Node::GetLevel() const
{
    return level;
}

size_t Node::GetLevelsAhead() const
{
    return levelsAhead;
}

void Node::SetLevelsAhead(size_t levels)
{
    this->levelsAhead = levels;
}

double Node::GetSimilarity() const
{
    return similarity;
}

void Node::AddChild(Node * child)
{
    children.push_back(child);
}

Node * Node::GetChild(size_t pos)
{
    if (pos < children.size())
	return children[pos];
    else
	return NULL;
}

size_t Node::GetChildrenNo()
{
    return children.size();
}

bool Node::HasChildren()
{
    return !children.empty();
}

void Node::SetOffsets(size_t xoffset, size_t yoffset)
{
    this->xoffset = xoffset;
    this->yoffset = yoffset;
}

size_t Node::GetXOffset() const
{
    return xoffset;
}

size_t Node::GetYOffset() const
{
    return yoffset;
}
