Various size floats such as these Slider Floats have a hollow middle to pass your line through, usually stopped at various depth's with sliding rubber stops or power gum line tied to the main line at the correct depth you wish to fish.
These were once made of painted cork but nowadays are more likely to be made of plastic. No matter, the usage remains the same.