/*
 *
 * Copyright (C)   20 dec. 2003 Jean-Yves Beaujean 
 * 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 2 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, write to the Free Software Foundation, Inc.,  59
 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.

 */
package jxtray.diag;


import java.awt.Graphics;



public class DiField 
{
		
		/**
		 *  Un champ d'une table est caratérisé par : son nom, son type,
		 *  est-il clé primaire, peut-il être null ?
		 */
		private String name;
		private boolean primaryKey;
		private boolean nullable;
		private String type;
		private String length;
		
		public DiField(String name)
		{ 
				this.name = name;
		}
		
		public void paint(Graphics g)
		{
		}
		
		
		/**
		 * @return String
		 */
		public String getLength() {
			return length;
		}

		/**
		 * @return String
		 */ 
		public String getName() {
			return name;
		}

		/**
		 * @return boolean
		 */
		public boolean isNullable() {
			return nullable;
		}

		/**
		 * @return boolean
		 */
		public boolean isPrimaryKey() {
			return primaryKey;
		}

		/**
		 * @return String
		 */
		public String getType() {
			return type;
		}

		/**
		 * @param string
		 */
		public void setLength(String string) {
			length = string;
		}

		/**
		 * @param string
		 */
		public void setName(String string) {
			name = string;
		}

		/**
		 * @param b
		 */
		public void setNullable(boolean b) {
			nullable = b;
		}

		/**
		 * @param b
		 */
		public void setPrimaryKey(boolean b) {
			primaryKey = b;
		}

		/**
		 * @param string
		 */
		public void setType(String string) {
			type = string;
		}

}
