Exemplo n.º 1
0
        public void hashCode(HashFunction hashfunction, bool only_structure) //only_structure=false
        {
            SafraTreeNode root = getRootNode();

            if (root != null)
            {
                root.hashCode(hashfunction, only_structure);
            }
        }
Exemplo n.º 2
0
        /**
         * Calculate a hashvalue using HashFunction for this node.
         * @param hashfunction the HashFunction functor
         * @param only_structure Ignore naming of the nodes?
         */
        public void hashCode(HashFunction hashfunction, bool only_structure)  //=false
        {
            if (!only_structure)
            {
                hashfunction.hash(getID());
            }

            getLabeling().hashCode(hashfunction);
            hashfunction.hash(hasFinalFlag());

            if (getChildCount() > 0)
            {
                //for (child_iterator cit=children_begin();cit!=children_end();++cit)
                for (SafraTreeNode cit = children_begin(); cit != children_end(); cit = cit.increment())
                {
                    cit.hashCode(hashfunction, only_structure);
                }
            }
        }