Package com.uic.ase.proj.xbn.array

Examples of com.uic.ase.proj.xbn.array.UniqueString


   **/
  public final void addString(String s_tr)  {
    throwLXIfLocked(isLocked(), "addString");
    throwAXIfNull(s_tr, "s_tr", "addString");

    UniqueString us = null;

    if(ht.containsKey(s_tr))  {
      bLastStringUnique = false;

      if(!areDupStringsOk())  {
        throwAX("addString:  s_tr at array index " + acoAbsolute.size() + " ('" + s_tr + "') already exists at array index " + ((UniqueString)ht.get(s_tr)).getUnqArrIdx() + ".");
      }
      us = (UniqueString)ht.get(s_tr);

    else  {

      //The string does not exist in the Hashtable.  It is unique;
      if(getUnqStrCount() > -&&  ht.size() == getUnqStrCount())  {
        throwAX("addString:  s_tr equals '" + s_tr + "' and has not been added (it is unique).  However, getUnqStrCount() equals " + getUnqStrCount() + ", and this addString would result in " + (getUnqStrCount() + 1) + " unique strings.");
      }

      bLastStringUnique = true;
      int iNewUnqArrIdx = ht.size();
      us = (new UniqueString(s_tr, iNewUnqArrIdx));

      acoUnique.add(us);
      ht.put(s_tr, us);
    }

    acoAbsolute.add(us);
    us.incInstanceCount();
  }
View Full Code Here


  /**
    <P>Get a full (deep) copy of this UniqueString as an Object.</P>
   **/
  protected final Object clone() throws CloneNotSupportedException  {
    return (new UniqueString(iUnqArrIdx, iInstances, bLocked));
  }
View Full Code Here

      VWInt vwi = new VWInt();

      while(e.hasMoreElements())  {
        String sKey = (String)e.nextElement();

        UniqueString us = null;
        try  {
          us = ((UniqueString)ht.get(sKey));
        catch(ClassCastException ccx)  {
          throwAX("constructor:  h_ashtable.get(" + sKey + ") is not of type xbn.array.UniqueString.  Currently, '" + ht.get(sKey).getClass().getName() + "'.");
        }

        if(!sKey.equals(us.getString()))  {
          throwAX("constructor:  Key named '" + sKey + "' has a UniqueString object as its value, but UniqueString.getString() equals '" + us.getString() + "'.  They must be equal.");
        }

        vwi.add(us.getUnqArrIdx());
      }

      PAIInt paii = new PAIInt(vwi.getAOInt(), (new PARIStrict()));
      paii.crashIfBad("xbn.array.AOSLHashtable.constructor", "[The UniqueString.getUnqArrIdx() int values found in each UniqueString value in h_ashtable]");
      int iMin = paii.getMinimum();
View Full Code Here

    @param  s_key  The string value of the key, which points to the desired UniqueString object.
    @return  <CODE>((UniqueString)h_ashtable.<A HREF="~JD~ht#get(o)~EJD~">get</A>(s_key))</CODE>  Where h_ashtable is exactly as provided to the <A HREF="~JD~aoslh(ht,b)~EJD~">constructor</A>.
   **/
  public UniqueString getUniqueString(String s_key)  {
    try  {
      UniqueString us = ((UniqueString)ht.get(s_key));

      if(us == null)  {
        throwAX("getUniqueString:  containsKey(s_key) equals false.  s_key equals '" + s_key + "'.");
      }

View Full Code Here

TOP

Related Classes of com.uic.ase.proj.xbn.array.UniqueString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.