* @param criteria [0.ConAll,1.ConAny,2.ConExact,3.ConHash,4.ConNone,5.From,6.Reference,7.Since(DATE),8.to,9.Until(Date)]
* @return
*/
private Tweet[] buscarAvanzada(Object[] criteria) {
SearchDevice s = SearchDevice.getInstance();
Query q=null;
for(int i=0; i<criteria.length;i++){
switch(i){
case 0:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.containAll((String)criteria[i]));
}else{
q=QueryComposer.containAll((String)criteria[i]);
}
}
break;
case 1:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.containAny((String)criteria[i]));
}else{
q=QueryComposer.containAny((String)criteria[i]);
}
}
break;
case 2:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.containExact((String)criteria[i]));
}else{
q=QueryComposer.containExact((String)criteria[i]);
}
}
break;
case 3:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.containHashtag((String)criteria[i]));
}else{
q=QueryComposer.containHashtag((String)criteria[i]);
}
}
break;
case 4:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.containNone((String)criteria[i]));
}else{
q=QueryComposer.containNone((String)criteria[i]);
}
}
break;
case 5:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.from((String)criteria[i]));
}else{
q=QueryComposer.from((String)criteria[i]);
}
}
break;
case 6:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.reference((String)criteria[i]));
}else{
q=QueryComposer.reference((String)criteria[i]);
}
}
break;
case 7:
if(((Date)criteria[i])!=null){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.since((Date)criteria[i]));
}else{
q=QueryComposer.since((Date)criteria[i]);
}
}
break;
case 8:
if(((String)criteria[i])!=null&&!((String)criteria[i]).equals("")){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.to((String)criteria[i]));
}else{
q=QueryComposer.to((String)criteria[i]);
}
}
break;
case 9:
if(((Date)criteria[i])!=null){
if(q!=null){
q=QueryComposer.append(q, QueryComposer.until((Date)criteria[i]));
}else{
q=QueryComposer.until((Date)criteria[i]);
}
}
break;
}
}
q = QueryComposer.append(q, QueryComposer.paginate(cantRes, page));
Tweet[] twts=null;
try {
twts = s.searchTweets(q);
} catch (IOException ex) {
ex.printStackTrace();
} catch (LimitExceededException ex) {
ex.printStackTrace();
}