Package org.xBaseJ.micro.indexes

Examples of org.xBaseJ.micro.indexes.Index


   */
  public Index useIndex(String filename)
    throws xBaseJException, IOException
  {
    int i;
    Index NDXes;
    for (i=1; i <= jNDXes.size(); i++)
        {
          NDXes = (Index) jNDXes.elementAt(i-1);
          if (NDXes.getName().compareTo(filename) == 0)
        {
          jNDX = NDXes;
              return jNDX;
        }
        }
View Full Code Here


   */
  public Index useIndex(Index ndx)
    throws xBaseJException, IOException
  {
    int i;
    Index NDXes;
    for (i=1; i<= jNDXes.size(); i++)
    {
      NDXes = (Index) jNDXes.elementAt(i-1);
      if (NDXes == ndx)
      {
View Full Code Here

    {
      tField = (Field) fld_root.elementAt(i);
      tField.read();
    }

    Index NDXes;
    for (i=1; i<= jNDXes.size(); i++)
    {
      NDXes =  (Index) jNDXes.elementAt(i-1);
      NDXes.set_active_key(NDXes.build_key());
    }

  }
View Full Code Here

    /** writes a new record in the database */
    int i;
    byte wb;
    Field tField;

    Index NDXes;
    for (i=1; i<= jNDXes.size(); i++)
      {
        NDXes =  (Index) jNDXes.elementAt(i-1);
        NDXes.check_for_duplicates(Index.findFirstMatchingKey);
      }


    seek(count);
    delete_ind = NOTDELETED;
    file.writeByte(delete_ind);


    for (i=0; i < fldcount; i++)
    {
      tField = (Field) fld_root.elementAt(i);
      tField.write();
    }


    wb = 0x1a;
    file.writeByte(wb);

    for (i=1; i<= jNDXes.size(); i++)
      {
        NDXes =  (Index) jNDXes.elementAt(i-1);
        NDXes.add_entry((count+1));
      }

        if (MDX_exist != 1 && (version == DBASEIII || version == DBASEIII_WITH_MEMO))
         {
        byte array[] = new byte[lrecl];
View Full Code Here

    }

    seek(current_record-1);
    file.readByte(); // don't change delete indicator let delete/undelete do that.

    Index NDXes;

    for (i=1; i<= jNDXes.size(); i++)
    {
      NDXes =  (Index) jNDXes.elementAt(i-1);
      NDXes.check_for_duplicates(current_record);
    }

    for (i=1; i<= jNDXes.size(); i++//  reposition record pointer and current key for index update
    {
      NDXes =  (Index) jNDXes.elementAt(i-1);
      NDXes.find_entry(NDXes.get_active_key(), current_record);
    }


    for (i=0; i < fldcount; i++)
    {
      tField = (Field) fld_root.elementAt(i);
      if (tField instanceof MemoField) tField.update();
      else tField.write();
    }

    for (i=1; i<= jNDXes.size(); i++)
    {
      NDXes =  (Index) jNDXes.elementAt(i-1);
      NDXes.update(current_record);
    }


  }
View Full Code Here


      if (dbtobj != null)
      dbtobj.close();

    Index NDXes;
    NDX n;

    for (i=1; i <= jNDXes.size(); i++)
      {
        NDXes = (Index) jNDXes.elementAt(i-1);
View Full Code Here

    read_dbhead();

    for (i=1; i<= fldcount; i++)
      getField(i).setFile(file);

    Index NDXes;

    if (MDXfile != null)
      MDXfile.reIndex();

    if (jNDXes.size() == 0)
    {
      current_record = 0;
    }
    else
    {
      for (i=1; i<= jNDXes.size(); i++)
      {
        NDXes = (Index) jNDXes.elementAt(i-1);
        NDXes.reIndex();
      }
      NDXes =  (Index) jNDXes.elementAt(0);
      if (count > 0)
          startTop();
    }
View Full Code Here

TOP

Related Classes of org.xBaseJ.micro.indexes.Index

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.