home *** CD-ROM | disk | FTP | other *** search
Java Source | 2002-12-19 | 4.0 KB | 222 lines |
- package com.ibm.extricity.adapters.mqseries.mqak;
-
- /**
- * Insert the type's description here.
- * Creation date: (10/24/00 10:13:16 AM)
- * @author: Administrator
- */
- import java.util.*;
-
- public class TestElement implements com.extricity.document.api.Element
- {
- protected Hashtable tbl = new Hashtable();
-
- /**
- * TestElement constructor comment.
- */
- public TestElement()
- {
- super();
- }
-
- /**
- * clearAll method comment.
- */
- public void clearAll()
- {
- tbl.clear();
- }
-
- /**
- * clearData method comment.
- */
- public void clearData()
- {
- tbl.clear();
- }
-
- /**
- * copyIn method comment.
- */
- public void copyIn(com.extricity.document.api.Element arg1)
- throws com.extricity.document.api.ElementTypeException
- {
- copyIn("",arg1);
- }
-
- /**
- * copyIn method comment.
- */
- public void copyIn(String arg1, com.extricity.document.api.Element arg2)
- throws IndexOutOfBoundsException, com.extricity.document.api.InvalidQueryException, com.extricity.document.api.ElementTypeException
- {
- TestElement src = (TestElement)arg2;
-
- Enumeration en = src.tbl.keys();
- String key;
-
- if(arg1.length() > 0)
- {
- if(!arg1.endsWith("\\") && !arg1.endsWith("/"))
- {
- arg1 = arg1 + "/";
- }
- }
- while(en.hasMoreElements())
- {
- key = (String)en.nextElement();
- tbl.put(arg1 + key,src.tbl.get(key));
- }
- }
-
- /**
- * getBusinessObject method comment.
- */
- public com.extricity.document.api.BusinessObject getBusinessObject()
- {
- return null;
- }
-
- /**
- * getData method comment.
- */
- public String getData()
- throws com.extricity.document.api.ElementTypeException
- {
- return null;
- }
-
- /**
- * getData method comment.
- */
- public String getData(String arg1)
- throws IndexOutOfBoundsException, com.extricity.document.api.InvalidQueryException, com.extricity.document.api.ElementTypeException
- {
- return (String)tbl.get(arg1);
- }
-
- /**
- * getDataType method comment.
- */
- public String getDataType()
- throws com.extricity.document.api.ElementTypeException
- {
- return null;
- }
-
- /**
- * getElement method comment.
- */
- public com.extricity.document.api.Element getElement(String arg1)
- throws IndexOutOfBoundsException, com.extricity.document.api.InvalidQueryException
- {
- return null;
- }
-
- /**
- * getElementSequence method comment.
- */
- public com.extricity.document.api.ElementSequence getElementSequence(String arg1)
- throws IndexOutOfBoundsException, com.extricity.document.api.InvalidQueryException
- {
- return null;
- }
-
- /**
- * getTagName method comment.
- */
- public String getTagName()
- {
- return null;
- }
-
- /**
- * hasData method comment.
- */
- public boolean hasData()
- {
- return !tbl.isEmpty();
- }
-
- /**
- * isField method comment.
- */
- public boolean isField()
- {
- return true;
- }
-
- /**
- * isValid method comment.
- */
- public boolean isValid()
- {
- return true;
- }
-
- /**
- * setData method comment.
- */
- public void setData(String arg1)
- throws com.extricity.document.api.ElementTypeException
- {
- setData(null,arg1);
- }
-
- /**
- * setData method comment.
- */
- public void setData(String arg1, String arg2)
- throws IndexOutOfBoundsException, com.extricity.document.api.InvalidQueryException, com.extricity.document.api.ElementTypeException
- {
- if(arg1 != null)
- {
- if(arg1.length() == 0)
- {
- arg1 = null;
- }
- }
- if(arg2 != null)
- {
- if(arg2.length() == 0)
- {
- arg2 = null;
- }
- }
- if(arg2 == null)
- {
- tbl.remove(arg1);
- }
- else
- {
- tbl.put(arg1,arg2);
- }
- }
-
- /**
- * Insert the method's description here.
- * Creation date: (10/24/00 4:06:37 PM)
- * @return java.lang.String
- */
- public String toString()
- {
- return toString(false);
- }
-
- /**
- * toString method comment.
- */
- public String toString(boolean arg1)
- {
- Enumeration en = tbl.keys();
- String key;
- String res = new String("\n");
-
- while(en.hasMoreElements())
- {
- key = (String)en.nextElement();
- res = res + key + "=" + tbl.get(key) + "\n";
- }
- return res;
- }
- }