Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrucz/selection-manager
Simple and lightweight Java API to represent a selection of items. It gives you the ability to represent a selection of all items when your collection is not fully known.
https://github.com/andrucz/selection-manager
Last synced: 28 days ago
JSON representation
Simple and lightweight Java API to represent a selection of items. It gives you the ability to represent a selection of all items when your collection is not fully known.
- Host: GitHub
- URL: https://github.com/andrucz/selection-manager
- Owner: andrucz
- Created: 2013-01-04T11:59:41.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-11-05T16:29:15.000Z (about 8 years ago)
- Last Synced: 2024-04-15T00:41:40.399Z (9 months ago)
- Language: Java
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
selection-manager
=================Simple and lightweight Java API to represent a selection of items. It gives you the ability to represent a selection of all items when your collection is not fully known.
All the interactions with this API are centralized in Selection class.
There are methods to select and deselect items, to verify if an item is selected, invert and clear the selection and select all items.
Example
-------```java
Selection selection = new Selection();selection.select(foo1);
selection.select(foo2);selection.deselect(foo2);
boolean b = selection.isSelected(foo1);
selection.invert();
selection.clear();
selection.selectAll();
```Note that after calling ```selection.selectAll()```, calls to ```selection.isSelected``` will return true for any parameter. It allows a representation of a full selection without knowing all the items involved.