001/*
002 * Copyright (c) 2003-2010 The Regents of the University of California.
003 * All rights reserved.
004 *
005 * '$Author: welker $'
006 * '$Date: 2010-05-06 05:21:26 +0000 (Thu, 06 May 2010) $' 
007 * '$Revision: 24234 $'
008 * 
009 * Permission is hereby granted, without written agreement and without
010 * license or royalty fees, to use, copy, modify, and distribute this
011 * software and its documentation for any purpose, provided that the above
012 * copyright notice and the following two paragraphs appear in all copies
013 * of this software.
014 *
015 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
016 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
017 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
018 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
019 * SUCH DAMAGE.
020 *
021 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
022 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
023 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
024 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
025 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
026 * ENHANCEMENTS, OR MODIFICATIONS.
027 *
028 */
029
030package org.kepler.objectmanager.data.db;
031
032import java.util.Vector;
033
034import org.kepler.objectmanager.data.DataObjectDescription;
035
036/**
037 * Simple Implementation of DSTableKeyIFace/DSTableFieldIFace interface This
038 * class is derived from DataObjectDescription
039 */
040public class DSTableFieldDef extends DataObjectDescription implements
041                DSTableKeyIFace {
042        protected int mKeyType = DSTableKeyIFace.UNDEFINEDKEY;
043        protected DSTableIFace mTable = null;
044
045        // private Vector mMissingValueCode = new Vector();
046
047        /**
048         * Construct a DSTableFieldDef.
049         * 
050         * @param aId
051         *            the id of the field
052         * @param aName
053         *            the name of the field
054         * @param aDataType
055         *            the datatype of the field
056         */
057        public DSTableFieldDef(String aId, String aName, String aDataType,
058                        Vector aMissingValueCode) {
059                super(aId, aName, aDataType, null);
060                setMissingValueCode(aMissingValueCode);
061        }
062
063        /**
064         * Construct a DSTableFieldDef.
065         * 
066         * @param aId
067         *            the id of the field
068         * @param aName
069         *            the name of the field
070         * @param aDataType
071         *            the datatype of the field
072         * @param aKeyType
073         *            the datatype of the field
074         */
075        public DSTableFieldDef(String aId, String aName, String aDataType,
076                        int aKeyType, Vector aMissingValueCode) {
077                super(aId, aName, aDataType, null);
078                setMissingValueCode(aMissingValueCode);
079                mKeyType = aKeyType;
080                // mMissingValueCode = aMissingValueCode;
081        }
082
083        /**
084         * Sets the Parent DSTableDef object
085         * 
086         * @param aTable
087         *            DSTableDef object
088         */
089        public void setTable(DSTableIFace aTable) {
090                mTable = aTable;
091        }
092
093        /**
094         * Returns the table for the field
095         * 
096         * @return DSTableDef Object
097         */
098        public DSTableIFace getTable() {
099                return mTable;
100        }
101
102        /**
103         * @return Returns the mKeyType.
104         */
105        public int getKeyType() {
106                return mKeyType;
107        }
108
109}