本文整理汇总了Java中org.apache.commons.collections.map.MultiValueMap类的典型用法代码示例。如果您正苦于以下问题:Java MultiValueMap类的具体用法?Java MultiValueMap怎么用?Java MultiValueMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MultiValueMap类属于org.apache.commons.collections.map包,在下文中一共展示了MultiValueMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeMultiValueMapFile
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
public static void writeMultiValueMapFile(MultiValueMap mapping, String path)
{
try
{
FileOutputStream fos = new FileOutputStream(path);
DataOutputStream dos = new DataOutputStream(fos);
Set<Integer> keys = new TreeSet(mapping.keySet());
for(Integer key : keys)
{
Set<Integer> values = new TreeSet(mapping.getCollection(key));
dos.writeInt(key.intValue());
dos.writeInt(values.size());
for(Integer value : values)
dos.writeInt(value.intValue());
}
dos.close();
}
catch (Exception e) { e.printStackTrace(); }
}
示例2: Gui
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
public Gui(File xmlConfiguration, OsaActionBeanContext context) {
mapDataStreams = new MultiValueMap();
searchConfiguration = new SearchConfiguration();
try {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(xmlConfiguration);
doc.getDocumentElement().normalize();
getIngestForms(doc);
getSearchForm(doc);
getResultLayout(doc);
getLayout(doc, context);
getUploadConfig(doc);
getIdGenerationConfig(doc);
getFacetFieldsFromConf(doc);
getFacetFieldsforAdvBrowse(doc);
} catch (Exception e) {
logger.error("Failed to load configuration file: " + xmlConfiguration+", "+ e);
}
}
示例3: engagementStudentsValued
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
public Map<String,Integer> engagementStudentsValued(ArrayList<String> actors, MultiMap interac){
MultiValueMap interactions = (MultiValueMap)interac;
Map<String,Integer> engagement = new HashMap<String,Integer>();
int cont = 0;
for (String i:actors){
cont = interactions.size(i);
engagement.put(i, cont);
cont = 0;
//System.out.println("Engajamento: " + engagement);
}
return engagement;
}
示例4: noDuplicatedInteractions
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
public MultiMap noDuplicatedInteractions(ArrayList<String> actors, MultiMap interactions){
MultiMap clone = new MultiValueMap();
ArrayList<String> edges = new ArrayList<String>();
for (String j:actors){
edges = (ArrayList<String>)interactions.get(j);
if (edges != null){
for (String i:edges){
if (!(tuplaExist(i,(ArrayList<String>)clone.get(j)))){
clone.put(j, i);
}
}
}
}
System.out.println(clone);
return clone;
}
示例5: getSourcePlateTypesForEachAssayPlate
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
private MultiMap getSourcePlateTypesForEachAssayPlate(CherryPickRequest cherryPickRequest)
{
MultiMap assayPlateName2PlateTypes = MultiValueMap.decorate(new HashMap(),
new Factory()
{
public Object create() { return new HashSet(); }
});
for (LabCherryPick cherryPick : cherryPickRequest.getLabCherryPicks()) {
if (cherryPick.isAllocated() && cherryPick.isMapped()) {
assayPlateName2PlateTypes.put(cherryPick.getAssayPlate().getName(),
cherryPick.getSourceCopy().findPlate(cherryPick.getSourceWell().getPlateNumber()).getPlateType());
}
}
return assayPlateName2PlateTypes;
}
示例6: FileLogActionManager
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
public FileLogActionManager(AgentStatus agentStatus,
ExecutorService threadService, FileTrackerMemory fileMemory,
FileLogManagerMemory memory,
Collection<? extends FileLogManageAction> actions) {
this.agentStatus = agentStatus;
this.threadService = threadService;
this.fileMemory = fileMemory;
this.memory = memory;
fileMemory.addListener(this);
// build an index of actions by log type
if (actions != null) {
actionsByLogTypeMap = new MultiValueMap();
for (FileLogManageAction action : actions) {
actionsByLogTypeMap.put(action.getLogType(), action);
actionsByNameMap.put(action.getLogType() + action.getStatus()
+ action.getName(), action);
}
}
// create a schedule service
// expired events are checked every X seconds. X == eventParkThreshold
scheduledService = Executors.newScheduledThreadPool(1);
scheduledService.scheduleAtFixedRate(new Runnable() {
public void run() {
try {
checkExpiredEvents();
} catch (Throwable t) {
LOG.error(t.toString(), t);
}
}
}, 1000L, getEventParkThreshold() * 1000, TimeUnit.MILLISECONDS);
}
示例7: readMultiValueMapFile
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
public static MultiValueMap readMultiValueMapFile(String path)
{
MultiValueMap mapping = new MultiValueMap();
try
{
FileInputStream fis = new FileInputStream(path);
DataInputStream dis = new DataInputStream(fis);
int len, key, tmp;
while(dis.available() != 0)
{
key = dis.readInt();
if(dis.available() != 0)
{
len = dis.readInt();
while(dis.available() != 0 && len > 0)
{
tmp = dis.readInt();
mapping.put(key, tmp);
len--;
}
}
}
dis.close();
}
catch (Exception e) { e.printStackTrace(); }
return mapping;
}
示例8: PerturbData
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
public PerturbData(MyBaseGraph src, MyBaseGraph tar, MultiValueMap mvm, MultiValueMap all_mvm)
{
super();
g_src = src;
g_tar = tar;
mapping = mvm;
all_mapping = all_mvm;
common_vertices = new ArrayList<Integer>();
model_choices = new HashMap<Integer, Integer>();
lta_dict = new HashMap<Integer, Double>();
}
示例9: getNamespaces
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
/**
* Creates a {@link MultiValueMap} of {@link SPVariableResolver} user
* friendly names to their respective namespace.
*
* @param treeMember
* The {@link SPObject} whose root to get the namespaces from.
* @return The created {@link MultiValueMap}.
*/
public static MultiValueMap getNamespaces(SPObject treeMember) {
if (treeMember == null) {
return new MultiValueMap();
}
synchronized (resolvers) {
MultiValueMap results = new MultiValueMap();
SPObject root = init(treeMember);
for (SPVariableResolver resolver: resolvers.get(root.getUUID())) {
results.put(resolver.getUserFriendlyName(), resolver.getNamespace());
}
return results;
}
}
示例10: expungeWithoutBackup
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
/**
* 여러개의 메일을 백업 안남기고 삭제한다.
* @param userId 로그인 이메일
* @param multiMap 메일함 경로와 uid 목록
* @throws javax.mail.MessagingException
* @throws java.io.IOException
* @throws org.apache.james.mailbox.exception.MailboxException
*/
public void expungeWithoutBackup(String userId, MultiValueMap multiMap) throws IOException,
MessagingException, MailboxException {
MailboxSession session = null;
try {
session = loginMailboxByUserId(userId);
mailboxmanager.startProcessingRequest(session);
String userKey = session.getUser().getUserName();
for (Object mailInfo : multiMap.keySet()) {
String mailboxPath = mailInfo.toString();
//기존 메일함
MailboxPath existMailboxPath = new MailboxPath(session.getPersonalSpace(), userKey, mailboxPath);
MessageManager messageManager = mailboxmanager.getMailbox(existMailboxPath, session);
List<MessageRange> ranges = MessageRange.toRanges((List<Long>) multiMap.get(mailboxPath));
expungeWithoutBackup(messageManager, session, ranges); //백업안남기고 완전 삭제
}
} finally {
if (session != null) {
mailboxmanager.endProcessingRequest(session);
try {
mailboxmanager.logout(session, true);
} catch (MailboxException e) {
e.printStackTrace();
}
}
}
}
示例11: initEmbeddedPageActions
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
@Override
public MultiMap initEmbeddedPageActions() {
if(embeddedPageActions == null) {
MultiMap mm = new MultiValueMap();
Layout layout = pageInstance.getLayout();
for(ChildPage childPage : layout.getChildPages()) {
String layoutContainerInParent = childPage.getContainer();
if(layoutContainerInParent != null) {
String newPath = context.getActionPath() + "/" + childPage.getName();
newPath = ServletUtils.removePathParameters(newPath); //#PRT-1650 Path parameters mess with include
File pageDir = new File(pageInstance.getChildrenDirectory(), childPage.getName());
try {
Page page = DispatcherLogic.getPage(pageDir);
EmbeddedPageAction embeddedPageAction =
new EmbeddedPageAction(
childPage.getName(),
childPage.getActualOrder(),
newPath,
page);
mm.put(layoutContainerInParent, embeddedPageAction);
} catch (PageNotActiveException e) {
logger.warn("Embedded page action is not active, skipping! " + pageDir, e);
}
}
}
for(Object entryObj : mm.entrySet()) {
Map.Entry entry = (Map.Entry) entryObj;
List pageActionContainer = (List) entry.getValue();
Collections.sort(pageActionContainer);
}
embeddedPageActions = mm;
}
return embeddedPageActions;
}
示例12: getParameterMap
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
private MultiMap getParameterMap(HttpServletRequest request) {
MultiMap parameters = new MultiValueMap();
Page page = Page.fromRequest(request);
String pageSessionNameFromRequest = page.getSessionAttributeName();
if (null != pageSessionNameFromRequest) {
parameters.put(Page.IN_REQUEST, pageSessionNameFromRequest);
}
return parameters;
}
示例13: programs
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
@RequestMapping(value = "/programs.htm", method = RequestMethod.GET)
public String programs(final Model model) {
final List<Meta> knownClasses = executionService.getKnownClasses();
final Map map = TransformedMap.decorate(new MultiValueMap(),
TransformerUtils.invokerTransformer("getProgram"),
TransformerUtils.nopTransformer());
for (final Meta meta : knownClasses) {
map.put(meta, meta);
}
model.addAttribute("programmap", map);
return "programs";
}
示例14: getSocialInteractionsFromMessenger
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
/**
* M�todo que retorna as intera��es sociais referentes a ferramenta de mensagens ass�ncronas.
* @return Um multimap<Person,Person> que representa as intera��es sociais.
* Dessa forma Person "key" interage com os Persons "values"
* @throws Exception Lancada caso a data de fim venha antes da data de in�cio
*/
@SuppressWarnings("unchecked")
public static MultiValueMap getSocialInteractionsFromMessenger(Course course, Date inicio, Date fim) throws Exception {
if(fim.before(inicio))
throw new Exception("Data fim menor que a Data in�cio.");
MultiMap interactions = new MultiValueMap();
Facade facade = Facade.getInstance();
List<Person> teachers = facade.getTeachersByCourse(course);
List<Person> persons = facade.listStudentsByCourse(course);
for (Person p : persons) {
for (MessengerMessage m : p.getSent()) {
if( (isBetweenDates(m, inicio, fim)) && ( persons.contains(m.getReceiver()) || teachers.contains(m.getReceiver()) ) )
interactions.put(p.getName(), m.getReceiver().getName());
}
}
Set keys = interactions.keySet();
System.out.println("Cheguei");
for(Object k : keys){
System.out.println(k + " : " + interactions.get(k));
}
return (MultiValueMap) interactions;
}
示例15: getSocialInteractionsFromTwitterTool
import org.apache.commons.collections.map.MultiValueMap; //导入依赖的package包/类
/**
* M�todo que retorna as intera��es sociais referentes a ferramenta de monitoramento
* do twitter.
* @param inicio
* @param fim
* @return
*/
public static MultiMap getSocialInteractionsFromTwitterTool(Date inicio, Date fim){
Facade facade = Facade.getInstance();
List<Tweet> tweets = facade.getTweetBetweenDates(inicio, fim);
MultiMap map = new MultiValueMap();
for(Tweet t : tweets){
if(t.getDateOfTweet().after(inicio) && t.getDateOfTweet().before(fim))
map.put(t.getUserSender().getName(), t.getUserTarget().getName());
}
Set keys = map.keySet();
for(Object k : keys){
System.out.println(k + " : " + map.get(k));
}
return map;
}