org.ijsberg.iglu.util.collection
Class CollectionPart
java.lang.Object
org.ijsberg.iglu.util.collection.CollectionPart
public class CollectionPart
- extends Object
Wrapper class for a specific part of a collection
(which is currently to be displayed in some user interface).
The collection may have been divided in parts to make it browsable.
The wrapper has data on other parts of the full collection as well.
|
Constructor Summary |
CollectionPart(Collection full,
int maxPartSize,
int offset)
Constructs a CollectionPart based on a complete Collection. |
CollectionPart(Collection part,
int maxPartSize,
int offset,
int fullCollectionSize)
Constructs a CollectionPart based on a previously defined subset of a Collection. |
CollectionPart
public CollectionPart(Collection full,
int maxPartSize,
int offset)
- Constructs a CollectionPart based on a complete Collection.
- Parameters:
full - the complete collection this is part ofmaxPartSize - size of this part or less if it's the last bitoffset - distance in elements from 0
CollectionPart
public CollectionPart(Collection part,
int maxPartSize,
int offset,
int fullCollectionSize)
- Constructs a CollectionPart based on a previously defined subset of a Collection.
- Parameters:
part - subset of the complete CollectionmaxPartSize - size of this part or less if it's the last bitoffset - distance in elements from 0fullCollectionSize - size of the complete collection
getPart
public Collection getPart()
- Returns:
- subset of the complete collection
getFullCollectionSize
public int getFullCollectionSize()
- Returns:
- size of the complete collection
getMaxPartSize
public int getMaxPartSize()
- Returns:
- default size of collection parts
getPartSize
public int getPartSize()
- Returns:
- actual size of this part of the collection
getNrofParts
public int getNrofParts()
- Returns:
- the total number of parts the complete collection is divided in
getLastPartSize
public int getLastPartSize()
- Returns:
- the size of the last part of the collection (which mey be less than the desired size)
toString
public String toString()
- Overrides:
toString in class Object
- Returns:
- a String representation of the wrapped Collection
getPreceedingCollectionPartDescription
public CollectionPart.CollectionPartDescription getPreceedingCollectionPartDescription()
- Returns:
- a description of the preceeding CollectionPart or null if that does not exist
getTrailingCollectionPartDescription
public CollectionPart.CollectionPartDescription getTrailingCollectionPartDescription()
- Returns:
- a description of the trailing CollectionPart or null if that does not exist
getFirstCollectionPartDescription
public CollectionPart.CollectionPartDescription getFirstCollectionPartDescription()
- Returns:
- a description of the first CollectionPart or null if that does not exist
getLastCollectionPartDescription
public CollectionPart.CollectionPartDescription getLastCollectionPartDescription()
- Returns:
- a description of the last CollectionPart or null if that does not exist
getNearCollectionPartDescriptions
public CollectionPart.CollectionPartDescription[] getNearCollectionPartDescriptions(int scope)
- Parameters:
scope - the number of CollectonParts around this CollectionPart to be shown
- Returns:
- descriptions of CollectionParts within a certain range around this part
getAllCollectionPartDescriptions
public CollectionPart.CollectionPartDescription[] getAllCollectionPartDescriptions()
- Returns:
- descriptions of all collection parts the complete collection consists of
Copyright © 2011. All Rights Reserved.