public class Client extends Object
| Constructor and Description |
|---|
Client()
Creates a new Client.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addJob(Job job)
Adds a job to the working queue
|
void |
choke()
Marks the client as choked.
|
void |
clearJobs()
Clears all jobs from the queue.
|
Iterable<Job> |
getJobs()
Gets an iterable to allow iteration over the job list.
|
int |
getQueueSize()
The amount of jobs on the working queue
|
void |
interested()
Marks the client as interested.
|
boolean |
isChoked()
Returns if the client is choked or not.
|
boolean |
isInterested()
Returns if the client is interested or not.
|
Job |
popNextJob()
Grabs the first job on the workingQueue
|
void |
removeJob(Job job)
Removes a job from the working queue if it was listed
|
void |
unchoke()
Marks the client as unchoked.
|
void |
uninterested()
Marks the client as uninterested.
|
public void choke()
public void unchoke()
public void interested()
public void uninterested()
public boolean isChoked()
true when the client is choked, otherwise falsepublic boolean isInterested()
true when the client is interested, otherwise falsepublic Job popNextJob()
public Iterable<Job> getJobs()
public void removeJob(Job job)
job - The job to removepublic void addJob(Job job)
job - The job to add.public int getQueueSize()
public void clearJobs()
Copyright © 2016. All rights reserved.