|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectAgentMsgHelpers
public class AgentMsgHelpers
Set of (static) helper routines to make writing agents easier.
| Nested Class Summary | |
|---|---|
static class |
AgentMsgHelpers.appendIter<T>
|
static class |
AgentMsgHelpers.consIter<T>
|
class |
AgentMsgHelpers.FindMatching
Exists solely for testing purposes |
static class |
AgentMsgHelpers.MsgFilter<T extends IMsg>
|
class |
AgentMsgHelpers.MsgIntWrapper
Exists solely for testing purposes |
static class |
AgentMsgHelpers.MsgPair<T1 extends IMsg,T2 extends IMsg>
|
static class |
AgentMsgHelpers.NullMsg
Empty message class. |
static class |
AgentMsgHelpers.PosMsg
Message class to hold a position in n dimensions |
| Constructor Summary | |
|---|---|
AgentMsgHelpers()
|
|
| Method Summary | ||
|---|---|---|
static
|
accumMsgs(java.util.Iterator<CommLink> iterChannels,
java.util.Collection<T> msgBag)
Accumulates all the readable messages from a list of channels. |
|
static
|
applyFunc(IFuncObj<T,java.lang.Boolean> func,
java.util.Iterator<T> iter)
|
|
static java.util.Vector<java.util.Iterator<CommLink>> |
duplicateLinks(java.util.Iterator<CommLink> toDup)
|
|
int |
getCountMsg(IFuncObj<IMsg,java.lang.Boolean> filter,
java.util.Collection<IMsg> msgBag)
|
|
static
|
getFilteredMsgs(IFuncObj<T,java.lang.Boolean> filter,
java.util.Collection<T> msgBag)
|
|
static
|
nDuplicateLinks(java.util.Iterator<T> toDup,
int nCopies)
|
|
boolean |
testFilters()
Exists solely for testing purposes |
|
static
|
zipMsgs(java.util.Iterator<T1> l1,
java.util.Iterator<T2> l2,
java.util.Collection<AgentMsgHelpers.MsgPair<T1,T2>> bag)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AgentMsgHelpers()
| Method Detail |
|---|
public static java.util.Vector<java.util.Iterator<CommLink>> duplicateLinks(java.util.Iterator<CommLink> toDup)
toDup - iterator of communication links to duplicate
public static <T> java.util.Vector<java.util.Iterator<T>> nDuplicateLinks(java.util.Iterator<T> toDup,
int nCopies)
toDup - iterator of communication links to duplicatenCopies - number of copies to make
public static <T extends IMsg> java.util.Collection<T> accumMsgs(java.util.Iterator<CommLink> iterChannels,
java.util.Collection<T> msgBag)
iterChannels - iterator for channels to read frommsgBag - initially empty bag to put messages intopublic static <T1 extends IMsg,T2 extends IMsg> java.util.Collection<AgentMsgHelpers.MsgPair<T1,T2>> zipMsgs(java.util.Iterator<T1> l1,
java.util.Iterator<T2> l2,
java.util.Collection<AgentMsgHelpers.MsgPair<T1,T2>> bag)
public static <T extends IMsg> java.util.Iterator<T> getFilteredMsgs(IFuncObj<T,java.lang.Boolean> filter,
java.util.Collection<T> msgBag)
public static <T extends IMsg> void applyFunc(IFuncObj<T,java.lang.Boolean> func,
java.util.Iterator<T> iter)
public int getCountMsg(IFuncObj<IMsg,java.lang.Boolean> filter,
java.util.Collection<IMsg> msgBag)
public boolean testFilters()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||