1 17 package org.alfresco.repo.search; 18 19 import java.util.ArrayList ; 20 import java.util.Collections ; 21 import java.util.Iterator ; 22 import java.util.List ; 23 24 import org.alfresco.service.cmr.repository.ChildAssociationRef; 25 import org.alfresco.service.cmr.repository.NodeRef; 26 import org.alfresco.service.cmr.repository.Path; 27 import org.alfresco.service.cmr.search.LimitBy; 28 import org.alfresco.service.cmr.search.PermissionEvaluationMode; 29 import org.alfresco.service.cmr.search.ResultSet; 30 import org.alfresco.service.cmr.search.ResultSetMetaData; 31 import org.alfresco.service.cmr.search.ResultSetRow; 32 import org.alfresco.service.cmr.search.SearchParameters; 33 34 public class EmptyResultSet implements ResultSet 35 { 36 37 public EmptyResultSet() 38 { 39 super(); 40 } 41 42 public Path[] getPropertyPaths() 43 { 44 return new Path[]{}; 45 } 46 47 public int length() 48 { 49 return 0; 50 } 51 52 public NodeRef getNodeRef(int n) 53 { 54 throw new UnsupportedOperationException (); 55 } 56 57 public float getScore(int n) 58 { 59 throw new UnsupportedOperationException (); 60 } 61 62 public Iterator <ResultSetRow> iterator() 63 { 64 ArrayList <ResultSetRow> dummy = new ArrayList <ResultSetRow>(0); 65 return dummy.iterator(); 66 } 67 68 public void close() 69 { 70 71 } 72 73 public ResultSetRow getRow(int i) 74 { 75 throw new UnsupportedOperationException (); 77 } 78 79 public List <NodeRef> getNodeRefs() 80 { 81 return Collections.<NodeRef>emptyList(); 82 } 83 84 public List <ChildAssociationRef> getChildAssocRefs() 85 { 86 return Collections.<ChildAssociationRef>emptyList(); 87 } 88 89 public ChildAssociationRef getChildAssocRef(int n) 90 { 91 throw new UnsupportedOperationException (); 93 } 94 95 public ResultSetMetaData getResultSetMetaData() 96 { 97 return new SimpleResultSetMetaData(LimitBy.UNLIMITED, PermissionEvaluationMode.EAGER, new SearchParameters()); 98 } 99 } 100 | Popular Tags |