I think you are a beginner in cloudSim, If you are expert in java you will learn it easily. but I recommend you to read cloudSim manuals first. Algorithms that you want are very easy to implement. These links may help you:
There are some examples in the CloudSim simulator. After creation of tasks (Cloudlets) and VMs, all are submitted to the CloudletList and VMList respectively. Then, the allocation of tasks to VMs is taking place. In this place, you can put your algorithms (RR, SJF, etc.) and the default scheduler in cloudSim is FCFS.