|
Lightweight Bartering Grid | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlbg.peer.register.negotiation.ConsumptionGrantsContainer
public class ConsumptionGrantsContainer
A ConsumptionGrantsContainer contains received Consumption grants that have been received since the received Consumption grants were last processed.
| Constructor Summary | |
|---|---|
ConsumptionGrantsContainer(java.util.Collection<PeerProfile> cgs,
int s)
|
|
| Method Summary | |
|---|---|
ExternalPeerHandle |
grantor(int i)
|
PeerProfile |
grantorProfile(int i)
|
PeerProfile[] |
grantors()
|
int |
initialConsumptionGrants(int i)
|
int |
pendingConsumptionGrants()
|
int |
pendingConsumptionGrants(int i)
|
java.lang.Integer |
pendingGrantorIndex(PeerProfile peer_profile)
Returns the index of target pending grantor. |
java.lang.Integer |
pendingGrantorIndex(java.lang.String peer_id)
Returns the index of target pending grantor. |
java.util.Collection<java.lang.String> |
pendingGrantors()
Returns the id set of pending grantors. |
int |
pendingGrantorsCount()
Returns the number of pending grantors. |
java.util.Collection<java.lang.Integer> |
pendingGrantorsIndex()
Returns the index of pending grantors. |
java.util.Iterator<java.lang.Integer> |
pendingGrantorsIndexIterator()
Returns an Iterator of the index of pending grantors. |
int |
randomPendingGrantorIndex()
|
int |
size()
|
void |
spillAllConsumptionGrants(int i)
Spills, i.e. |
void |
spillConsumptionGrants(int i,
int count)
Spills, i.e. |
java.lang.String |
toString()
|
int |
totalConsumptionGrants()
|
void |
useAllConsumptionGrants(int i)
Uses all Consumption Grants from target grantor. |
void |
useConsumptionGrants(int i,
int count)
Uses some Consumption Grants from target grantor. |
int |
usedConsumptionGrants()
|
int |
usedConsumptionGrants(int i)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConsumptionGrantsContainer(java.util.Collection<PeerProfile> cgs,
int s)
throws GridException
GridException| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic int size()
public PeerProfile[] grantors()
public PeerProfile grantorProfile(int i)
throws GridException
GridException
public ExternalPeerHandle grantor(int i)
throws GridException
GridExceptionpublic java.util.Collection<java.lang.String> pendingGrantors()
public int pendingGrantorsCount()
public java.util.Iterator<java.lang.Integer> pendingGrantorsIndexIterator()
public java.util.Collection<java.lang.Integer> pendingGrantorsIndex()
public java.lang.Integer pendingGrantorIndex(PeerProfile peer_profile)
throws GridException
peer_profile - target pending grantor profile
GridException - if a parameter is illegal
public java.lang.Integer pendingGrantorIndex(java.lang.String peer_id)
throws GridException
peer_id - target pending grantor id
GridException - if a parameter is illegal
public int randomPendingGrantorIndex()
throws GridException
GridException
public int initialConsumptionGrants(int i)
throws GridException
GridException
public int pendingConsumptionGrants(int i)
throws GridException
GridException
public int usedConsumptionGrants(int i)
throws GridException
GridException
public void useAllConsumptionGrants(int i)
throws GridException
Target grantor is removed from the index of remaining grantors.
i - index of target grantor
GridException - if a parameter is illegal
public void spillAllConsumptionGrants(int i)
throws GridException
Target grantor is removed from the index of remaining grantors.
i - index of target grantor
GridException - if a parameter is illegal
public void useConsumptionGrants(int i,
int count)
throws GridException
If target grantor has no more remaining Consumption Grants, it is removed from the index of remaining grantors.
i - index of target grantorcount - number of used Consumption Grants
GridException - if a parameter is illegal
public void spillConsumptionGrants(int i,
int count)
throws GridException
If target grantor has no more remaining Consumption Grants, it is removed from the index of remaining grantors.
i - index of target grantorcount - number of used Consumption Grants
GridException - if a parameter is illegalpublic int totalConsumptionGrants()
public int pendingConsumptionGrants()
public int usedConsumptionGrants()
|
Lightweight Bartering Grid | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.