@Test public void testResultsCountSummaryNoCount() { assertNull( page.resultsCountSummary() ); }
public String resultsCountSummary() { String s = null; int total = totalResults(); if (total >= 0) { int perPage = itemsPerPage(); int from = startIndex(); if (perPage > 0 && from >= 0 && total > 0) { int to = from + perPage - 1; if (to > total) { to = total; } s = String.format( "Showing items %d to %d of %d", from, to, total ); } else { String plural = (total == 1) ? "" : "s"; s = String.format( "%d result%s", total, plural ); } } return s; }
Page extends CommonNodeWrapper { public String resultsCountSummary() { String s = null; int total = totalResults(); if (total >= 0) { int perPage = itemsPerPage(); int from = startIndex(); if (perPage > 0 && from >= 0 && total > 0) { int to = from + perPage - 1; if (to > total) { to = total; } s = String.format( "Showing items %d to %d of %d", from, to, total ); } else { String plural = (total == 1) ? "" : "s"; s = String.format( "%d result%s", total, plural ); } } return s; } }
Page extends CommonNodeWrapper { public String resultsCountSummary() { String s = null; int total = totalResults(); if (total >= 0) { int perPage = itemsPerPage(); int from = startIndex(); if (perPage > 0 && from >= 0 && total > 0) { int to = from + perPage - 1; if (to > total) { to = total; } s = String.format( "Showing items %d to %d of %d", from, to, total ); } else { String plural = (total == 1) ? "" : "s"; s = String.format( "%d result%s", total, plural ); } } return s; } Page( ResultsModel mw, Resource root ); }
Page extends CommonNodeWrapper { public String resultsCountSummary() { String s = null; int total = totalResults(); if (total >= 0) { int perPage = itemsPerPage(); int from = startIndex(); if (perPage > 0 && from >= 0 && total > 0) { int to = from + perPage - 1; if (to > total) { to = total; } s = String.format( "Showing items %d to %d of %d", from, to, total ); } else { String plural = (total == 1) ? "" : "s"; s = String.format( "%d result%s", total, plural ); } } return s; } Page( ResultsModel mw, Resource root ); void initialiseShortNameRenderer( ShortnameService sns ); ShortNameRenderer shortNameRenderer(); EldaURL pageURL(); boolean isItemEndpoint(); int pageNumber(); int itemsPerPage(); int totalResults(); String resultsCountSummary(); int startIndex(); Resource isPartOf(); Resource definition(); String extendedMetadataURL(); Resource firstPage(); Resource prevPage(); Resource nextPage(); Resource lastPage(); boolean hasPageData(); List<PageFormat> formats(); List<EldaView> views(); List<Binding<Resource>> termBindings(); List<Binding<String>> varBindings(); Map<String, String> varBindingsMap(); List<DisplayRdfNode> items(); Model pageObjectModel(); EldaView currentView(); EldaView findViewByName( String viewName ); PageMetadata metadata(); List<PropertyPath> currentPropertyPaths(); String pageTitle(); boolean itemHasAllProperties( List<Object> properties ); boolean itemHasAllProperties( Object... properties ); List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ); List<Link> filterRemovalLinks(); List<Link> sortRemovalLinks(); }
Page extends CommonNodeWrapper { public String resultsCountSummary() { String s = null; int total = totalResults(); if (total >= 0) { int perPage = itemsPerPage(); int from = startIndex(); if (perPage > 0 && from >= 0 && total > 0) { int to = from + perPage - 1; if (to > total) { to = total; } s = String.format( "Showing items %d to %d of %d", from, to, total ); } else { String plural = (total == 1) ? "" : "s"; s = String.format( "%d result%s", total, plural ); } } return s; } Page( ResultsModel mw, Resource root ); void initialiseShortNameRenderer( ShortnameService sns ); ShortNameRenderer shortNameRenderer(); EldaURL pageURL(); boolean isItemEndpoint(); int pageNumber(); int itemsPerPage(); int totalResults(); String resultsCountSummary(); int startIndex(); Resource isPartOf(); Resource definition(); String extendedMetadataURL(); Resource firstPage(); Resource prevPage(); Resource nextPage(); Resource lastPage(); boolean hasPageData(); List<PageFormat> formats(); List<EldaView> views(); List<Binding<Resource>> termBindings(); List<Binding<String>> varBindings(); Map<String, String> varBindingsMap(); List<DisplayRdfNode> items(); Model pageObjectModel(); EldaView currentView(); EldaView findViewByName( String viewName ); PageMetadata metadata(); List<PropertyPath> currentPropertyPaths(); String pageTitle(); boolean itemHasAllProperties( List<Object> properties ); boolean itemHasAllProperties( Object... properties ); List<DisplayRdfNode> resourcesWithAllProperties( List<Object> properties ); List<Link> filterRemovalLinks(); List<Link> sortRemovalLinks(); static final int NO_VALUE; static final String DEFAULT_VIEW_NAME; }