/*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2008 Aimluck,Inc.
 * http://aipostyle.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU 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
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.aimluck.eip.document.beans;

import java.util.ArrayList;
import java.util.Hashtable;

import com.aimluck.commons.field.ALNumberField;
import com.aimluck.commons.field.ALStringField;
import com.aimluck.eip.document.FolderInfo;
import com.aimluck.eip.common.ALData;

/**
 * 文書管理のフォルダ階層データを管理するクラスです。
 *
 */
public class DocumentBean implements ALData, Cloneable {

  /** <code>document_id</code> フォルダまたはファイルID */
  private ALNumberField document_id;

  /** <code>document_name</code> フォルダまたはファイル名 */
  private ALStringField document_name;

  /** <code>type</code> タイプ */
  private ALNumberField type;

  /** <code>document_numberofitems</code> フォルダまたはファイル名が持つ要素の数 */
  // private ALNumberField document_numberofitems;
  /** <code>document_child</code> フォルダの中の要素 */
  private ArrayList<Hashtable> document_child;

  /** items フォルダに属するファイル */
  // private ArrayList<DocumentBean> items;
  /*
   * @see com.aimluck.eip.common.ALData#initField()
   */
  public void initField() {
    document_id = new ALNumberField();
    document_name = new ALStringField();
    // document_numberofitems = new ALNumberField();
    document_child = new ArrayList();
    // items = new ArrayList();
    type = new ALNumberField();
  }

  public void setResultData(FolderInfo info) {
  }

  public int getdocumentid() {
    return (int) document_id.getValue();
  }

  public void setDocumentId(int number) {
    document_id.setValue(number);
  }

  public String getDocumentName() {
    return document_name.toString();
  }

  public void setDocumentName(String str) {
    document_name.setValue(str);
  }

  /*
   * public int getDocumentNumberofitems() { return (int)
   * document_numberofitems.getValue(); }
   *
   * public void setDocumentNumberofitems(int number) {
   * document_numberofitems.setValue(number); }
   */
  public ArrayList<Hashtable> getchildren() {
    return document_child;
  }

  public void setDocumentChild(ArrayList<Hashtable> list) {
    document_child = list;
  }

  /*
   * public ArrayList<DocumentBean> getItems() { return items; }
   *
   * public void setItems(ArrayList<DocumentBean> list) { items = list; }
   */

  public String gettype() {
    return type.toString();
  }

  public void settype(int i) {
    type.setValue(i);
  }
  @Override
  protected Object clone() throws CloneNotSupportedException {
    // TODO 自動生成されたメソッド・スタブ
    return super.clone();
  }
}
