/*
 * $Id: VKCCategoryAbsPath.java,v 1.12 2005/06/28 00:02:09 marbobo Exp $
 * 
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: VKCCategoryAbsPath.java,v $
 * Revision 1.12  2005/06/28 00:02:09  marbobo
 * + Darstellungsprobleme mit Nahost-Schriftarten korrigiert
 *
 * Revision 1.11  2004/07/20 08:46:27  jonyp
 * added copyright info + cvs log
 *
 *
 */

package vkc.util;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Vector;

/**
 * Diese Klasse stellt Methoden
 * <p>
 * @author jonyP
 */

public final class VKCCategoryAbsPath implements Serializable
{
   private Vector pathNodes = new Vector();
   private String absolutePath = "";

   public void setAbsolutePathString(String absPath) {
       this.absolutePath = absPath;
   }

   public String getAbsolutePathString() {
       return this.absolutePath;
   }

   public void setPathNodes(Vector pathNodes) {
       this.pathNodes = pathNodes;
   }

   public Vector getPathNodes() {
       return this.pathNodes;
   }

   public int getNumPathNodes() {
       return pathNodes.size();
   }

   public void addNode(VKCCategoryPathNode pathNode) {
       pathNodes.add(0, pathNode);
   }
   
   public VKCCategoryPathNode getLastNode() {
   	   if (pathNodes.size() == 0)
	   	   return new VKCCategoryPathNode();

   	   return ((VKCCategoryPathNode) pathNodes.elementAt(pathNodes.size() - 1 ));	
   }
   
   public String toString() {

		StringBuffer sb = new StringBuffer();
		
   		for ( Iterator iter = pathNodes.iterator() ; iter.hasNext() ; ) {
			VKCCategoryPathNode node = (VKCCategoryPathNode)iter.next();
			sb.append( node.getPathName() );
			if ( !node.isLastNode() ) {
				sb.append( "\u200E> \u200E" );
			}
   		}
   		
   		return sb.toString();
   }
   
   public String getPathString() {
   		return this.toString();	
   }
}