RCSB PDB Protein Data Bank A Member of the wwPDB
An Information Portal to Biological Macromolecular Structures
PDB Home | Contact Us
next up previous contents
Next: Search Up: Searching Methods Previous: Searching Methods

FindFirst

NAME FindFirst

PROTOTYPE

#include "ISTable.h"

ReVarPCifArray<int> * ISTable::FindFirst(
                                  ReVarCifArray<CifString> & targets,
                                  ReVarCifArray<CifString> & colNames,
                                  int & errCode);
ReVarPCifArray<int> * ISTable::FindFirst(
                                  ReVarCifArray<CifString> & targets,
                                  ReVarPCifArray<int> & colIds,
                                  int & errCode);
ReVarPCifArray<int> * ISTable::FindFirst(
                                  CifString indexName,
                                  ReVarCifArray<CifString> & targets,
                                  ReVarCifArray<CifString> & colNames,
                                  int & errCode);
ReVarPCifArray<int> * ISTable::FindFirst(
                                  CifString indexName,
                                  ReVarCifArray<CifString> & targets,
                                  ReVarPCifArray<int> & colIds,
                                  int & errCode);

EXAMPLE

#include "ISTable.h"

ISTable s("MyTable");
...
CifString cs("Hello"), cs2("World"), col1("A"), col2("B"), col3("C");
CifString newCS("!");
int errCode = 0;

ReVarCifArray<CifString> vals, names;
vals.Add(cs); vals.Add(cs2);
names.Add(col1); names.Add(col2);

int res;

//Creates index on columns "A" and "B"
s->CreateIndex("index0",names);

// Search column "A" for "Hello" and column "B" for "World" using the index
res = s.FindFirst("index0",vals, names, errCode);
s.GetRow(res);
}
PURPOSE

FindFirst returns the index of first row where all of the target strings match in their respective columns. For methods where no index name is specified, the method will be chose the best index.

RECEIVES

FindFirst(ReVarCifArray<CifString>&, ReVarCifArray<CifString>&, int &)

targets An array of target strings to search for.
colName An array of column names indicating which columns should be searched.
errCode A reference to an integer holding the error code resulting from this operation.

FindFirst(ReVarCifArray<CifString>&, ReVarPCifArray<int>&, int &)

targets An array of target strings to search for.
colIds An array of column indices indicating which columns should be searched.
errCode A reference to an integer holding the error code resulting from this operation.

FindFirst(CifString, ReVarCifArray<CifString>&,
ReVarCifArray<CifString>&, int &)

indexName Name of the index used for searching.
targets An array of target strings to search for.
colName An array of column names indicating which columns should be searched.
errCode A reference to an integer holding the error code resulting from this operation.

FindFirst(CifString, ReVarCifArray<CifString>&,
ReVarPCifArray<int>&, int &)

indexName Name of the index used for searching.
targets An array of target strings to search for.
colIds An array of column indices indicating which columns should be searched.
errCode A reference to an integer holding the error code resulting from this operation.

RETURN VALUE

A integer holding the row index having matches in all of the columns specified.
A negative value indicates a possible error or an unsuccessful search.
A negative value in errCode indicates an error or warning.

REMARKS

See also: Search


next up previous contents
Next: Search Up: Searching Methods Previous: Searching Methods
Olivera Tosic
6/12/2002

 

© RCSB PDB