aim4.im.v2i.RequestHandler
Class BatchModeRequestHandler.IndexedProposal

java.lang.Object
  extended by aim4.im.v2i.RequestHandler.BatchModeRequestHandler.IndexedProposal
All Implemented Interfaces:
Comparable<BatchModeRequestHandler.IndexedProposal>, Comparator<BatchModeRequestHandler.IndexedProposal>
Enclosing class:
BatchModeRequestHandler

public static class BatchModeRequestHandler.IndexedProposal
extends Object
implements Comparator<BatchModeRequestHandler.IndexedProposal>, Comparable<BatchModeRequestHandler.IndexedProposal>

A proposal with a unique ID.


Constructor Summary
BatchModeRequestHandler.IndexedProposal(int id, Request.Proposal proposal, Request request, List<BatchModeRequestHandler.IndexedProposal> proposalGroup, double submissionTime)
          Create a new indexed proposal
 
Method Summary
 int compare(BatchModeRequestHandler.IndexedProposal ip1, BatchModeRequestHandler.IndexedProposal ip2)
          Compare two indexed proposals
 int compareTo(BatchModeRequestHandler.IndexedProposal ip)
          Compare this indexed proposal with a given indexed proposal
 boolean equals(BatchModeRequestHandler.IndexedProposal ip)
          Whether or not this indexed proposal is equal to the given indexed proposal.
 Request.Proposal getProposal()
          Get the proposal.
 List<BatchModeRequestHandler.IndexedProposal> getProposalGroup()
          Get the reference to the group of proposals of the request message in to which the proposal belongs.
 Request getRequest()
          Get the request message of this proposal.
 double getSubmissionTime()
          Get the submission time of the request.
 String toString()
          Get the description of this batch policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

BatchModeRequestHandler.IndexedProposal

public BatchModeRequestHandler.IndexedProposal(int id,
                                               Request.Proposal proposal,
                                               Request request,
                                               List<BatchModeRequestHandler.IndexedProposal> proposalGroup,
                                               double submissionTime)
Create a new indexed proposal

Parameters:
id - the ID of this request policy
proposal - a proposal
request - the request message of the proposal
proposalGroup - a reference to the group of proposals of a request message
submissionTime - the submission time
Method Detail

getProposal

public Request.Proposal getProposal()
Get the proposal.

Returns:
the proposal

getRequest

public Request getRequest()
Get the request message of this proposal.

Returns:
the request message of this proposal.

getProposalGroup

public List<BatchModeRequestHandler.IndexedProposal> getProposalGroup()
Get the reference to the group of proposals of the request message in to which the proposal belongs.

Returns:
a reference to the group of proposals

getSubmissionTime

public double getSubmissionTime()
Get the submission time of the request.

Returns:
the submission time of the request.

equals

public boolean equals(BatchModeRequestHandler.IndexedProposal ip)
Whether or not this indexed proposal is equal to the given indexed proposal.

Parameters:
ip - an indexed proposal
Returns:
whether or not this indexed proposal is equal to the given indexed proposal.

compare

public int compare(BatchModeRequestHandler.IndexedProposal ip1,
                   BatchModeRequestHandler.IndexedProposal ip2)
Compare two indexed proposals

Specified by:
compare in interface Comparator<BatchModeRequestHandler.IndexedProposal>
Parameters:
ip1 - an indexed proposal
ip2 - an indexed proposal
Returns:
-1 if ip1 < ip2; +1 if ip1 > ip2; 0 if ip1 == ip2

compareTo

public int compareTo(BatchModeRequestHandler.IndexedProposal ip)
Compare this indexed proposal with a given indexed proposal

Specified by:
compareTo in interface Comparable<BatchModeRequestHandler.IndexedProposal>
Parameters:
ip - an indexed proposal
Returns:
-1 if < ip; +1 if > ip; 0 if == ip

toString

public String toString()
Get the description of this batch policy.

Overrides:
toString in class Object
Returns:
the description of this batch policy


Copyright © 2011. All Rights Reserved.