当前位置: 首页>>代码示例>>Java>>正文


Java List.size方法代码示例

本文整理汇总了Java中java.util.List.size方法的典型用法代码示例。如果您正苦于以下问题:Java List.size方法的具体用法?Java List.size怎么用?Java List.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.List的用法示例。


在下文中一共展示了List.size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: exportExcel

import java.util.List; //导入方法依赖的package包/类
/**
 * 导出
 * @param modelName 模型名称
 * @param excelType excel格式
 * @param response
 * @return
 * @throws IOException
 */
@RequestMapping(value = { "/excel/{modelName}","/excel/{modelName}/{excelType}" }, method = RequestMethod.GET)
public void exportExcel(@PathVariable String modelName,@PathVariable(required = false) String excelType, HttpServletResponse response) throws IOException {
    //默认导出xls格式excel
    if(excelType==null||"".equals(excelType)){
        excelType="XLS";
    }
    List<SysExportModel> models = modelService.queryExportModelByCondition(modelName);
    // 模型不存在 直接结束
    if (models == null || models.size() == 0) {
        return;
    }
    // 获取导出数据
    SysExportModel model = models.get(0);
    List<List<Object>> exportData = commonService.getAllData(model.getModelName(), model.getEnames(), null);
    List<String> exportHeaderNames = new ArrayList<String>();
    String[] headerNames = model.getCnames().split(",");
    for (String headerName : headerNames) {
        exportHeaderNames.add(headerName);
    }

    response.reset();
    // 文件下载
    response.setContentType("application/vnd.ms-excel");
    String filename = "报表"+modelName+"("+ new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())+ ")";

    filename = new String(filename.getBytes("gbk"), "iso-8859-1");
    response.setHeader("Content-disposition", "attachment;filename="+ filename + "."+excelType.toLowerCase());
    response.setBufferSize(1024);

    //获取excel表单
    ExcelGenerater excelGenerater=new ExcelGenerater();
    ExcelGeneraterBean excelGeneraterBean = excelGenerater.create(modelName, exportHeaderNames, exportData);
    Workbook workbook = excelGeneraterBean.getWorkbook();
    //写入数据 到流
    workbook.write(response.getOutputStream());
    workbook.close();
}
 
开发者ID:babymm,项目名称:mumu,代码行数:46,代码来源:ExportController.java

示例2: findFirstLambda

import java.util.List; //导入方法依赖的package包/类
/**
 * Returns list of consecutive resources in given set of lambdas.
 *
 * @param lambdas list of lambdas
 * @param count number of consecutive lambdas to return
 * @return list of consecutive lambdas
 */
private List<OchSignal> findFirstLambda(Set<OchSignal> lambdas, int count) {
    // Sort available lambdas
    List<OchSignal> lambdaList = new ArrayList<>(lambdas);
    lambdaList.sort(new DefaultOchSignalComparator());

    // Look ahead by count and ensure spacing multiplier is as expected (i.e., no gaps)
    for (int i = 0; i < lambdaList.size() - count; i++) {
        if (lambdaList.get(i).spacingMultiplier() + 2 * count ==
                lambdaList.get(i + count).spacingMultiplier()) {
            return lambdaList.subList(i, i + count);
        }
    }

    return Collections.emptyList();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:OpticalConnectivityIntentCompiler.java

示例3: setBannerImageList

import java.util.List; //导入方法依赖的package包/类
/**
 * Sets the picture list
 *
 * @param imagesUrl picture list
 */
public void setBannerImageList(List<?> imagesUrl) {
    if (imagesUrl == null || imagesUrl.size() <= 0) {
        return;
    }
    count = imagesUrl.size();
    initImages();
    for (int i = 0; i <= count + 1; i++) {
        ImageView iv = new ImageView(context);
        iv.setScaleType(ImageView.ScaleType.FIT_XY);
        Object url;
        if (i == 0) {
            url = imagesUrl.get(count - 1);
        } else if (i == count + 1) {
            url = imagesUrl.get(0);
        } else {
            url = imagesUrl.get(i - 1);
        }
        imageViews.add(iv);
        if (defaultImage != -1)
            Glide.with(context).load(url).centerCrop().crossFade().into(iv);
        else
            Glide.with(context).load(url).centerCrop().crossFade().placeholder(defaultImage).into(iv);

    }
    setData();
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:32,代码来源:BannerView.java

示例4: isAccessibilityNodeEnable

import java.util.List; //导入方法依赖的package包/类
public static boolean isAccessibilityNodeEnable(AccessibilityNodeInfo info, String[] texts) {
    if (texts != null) {
        for (String textItem : texts) {
            List<AccessibilityNodeInfo> nodes = info.findAccessibilityNodeInfosByText(textItem);
            if (nodes != null && !nodes.isEmpty()) {
                AccessibilityNodeInfo node;
                for (int i = 0; i < nodes.size(); i++) {
                    node = nodes.get(i);
                    BaseAccessibility.logPrint("find text=" + textItem + "  enable=" + node.isEnabled());
                    CharSequence text = node.getText();
                    if (TextUtils.equals(text, textItem) && node.isEnabled()) {
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
 
开发者ID:miLLlulei,项目名称:Accessibility,代码行数:20,代码来源:BaseAccessibility.java

示例5: decode

import java.util.List; //导入方法依赖的package包/类
/**
 *
 * @param ABFSetCodes
 * @return
 */
public static List<String> decode(List<String> ABFSetCodes)   {

    List<String> abfStrings = new ArrayList<>();

    for (int i = 0; i < ABFSetCodes.size(); i++) {
        if(ABFSetCodes.get(i) == null ) continue;
        BitSet bs = convert(Long.parseLong(ABFSetCodes.get(i)));
        for (int j = 0; j < bs.length(); j++) {
            if (bs.get(j)==true) {
                abfStrings.add(ABFMAPPER.inverse().get(j + (64 * i) + ""));
            }
        }
    }
    return abfStrings;
}
 
开发者ID:tmobile,项目名称:keybiner,代码行数:21,代码来源:Permission64.java

示例6: deleteKeys

import java.util.List; //导入方法依赖的package包/类
private void deleteKeys(Iterable<Key> keys) {
	Datastore datastore = this.datastoreOptions.getService();

	List<Key> buffer = new ArrayList<>(BUFFER_SIZE);
	for (Key key : keys) {
		buffer.add(key);

		if (buffer.size() >= BUFFER_SIZE) {
			datastore.delete(buffer.toArray(new Key[buffer.size()]));
			buffer.clear();
		}
	}
	if (buffer.size() > 0) {
		datastore.delete(buffer.toArray(new Key[buffer.size()]));
	}
}
 
开发者ID:tkob,项目名称:spring-data-gclouddatastore,代码行数:17,代码来源:SimpleGcloudDatastoreRepository.java

示例7: dumpLayers

import java.util.List; //导入方法依赖的package包/类
private static void dumpLayers(StringBuilder sb, String prefix, List<? extends HighlightsLayer> layers) {
    sb.append(prefix).append(" layers:\n"); //NOI18N
    int digitCount = ArrayUtilities.digitCount(layers.size());
    for (int i = 0; i < layers.size(); i++) {
        HighlightsLayer layer = layers.get(i);
        HighlightsLayerAccessor layerAccessor = 
            HighlightingSpiPackageAccessor.get().getHighlightsLayerAccessor(layer);

        sb.append("  ");
        ArrayUtilities.appendBracketedIndex(sb, i, digitCount);
        sb.append(layerAccessor.getLayerTypeId());
        sb.append('['); //NOI18N
        sb.append(layerAccessor.getZOrder().toString()); //NOI18N
        sb.append(layerAccessor.isFixedSize() ? ",Fixed" : ",NonFixed");
        sb.append(']'); //NOI18N
        sb.append('@'); //NOI18N
        sb.append(Integer.toHexString(System.identityHashCode(layer)));
        sb.append("\n"); //NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:HighlightingManager.java

示例8: valideerAantalZoekResultaten

import java.util.List; //导入方法依赖的package包/类
@Override
protected void valideerAantalZoekResultaten(final List<Persoonslijst> persoonslijsten, final Autorisatiebundel autorisatiebundel,
                                            final ZoekPersoonGeneriekVerzoek.ZoekBereikParameters zoekBereikParameters) throws StapMeldingException {
    if (persoonslijsten.size() > 1) {
        throw new StapMeldingException(Regel.R2289);
    }
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:8,代码来源:PersoonsvraagOphalenPersoonServiceImpl.java

示例9: setTitles

import java.util.List; //导入方法依赖的package包/类
public void setTitles(List<? extends Object> values) {
    if (mSectionizer == null) {
        throw new NullPointerException("请在设置调用setTitles()之前调用setSectionizer()方法!");
    }

    if (values == null || values.size() == 0) {
        mTitles.clear();
        notifyDataSetChanged();
        return;
    }

    List<Title> titles = convertToTitleList(values);
    Title[] titleArray = new Title[titles.size()];
    Title[] newTitles = titles.toArray(titleArray);

    mTitles.clear();

    Arrays.sort(newTitles, new Comparator<Title>() {
        @Override
        public int compare(Title o1, Title o2) {
            return (o1.firstPosition == o2.firstPosition ? 0 : (o1.firstPosition < o2.firstPosition ? -1 : 1));
        }
    });

    int offset = 0;
    for (Title title : newTitles) {
        title.titlePosition = title.firstPosition + offset;
        mTitles.append(title.titlePosition, title);
        ++offset;
    }

    notifyDataSetChanged();
}
 
开发者ID:yedashen,项目名称:UltimateRecyclerView,代码行数:34,代码来源:TitleAdapter.java

示例10: main

import java.util.List; //导入方法依赖的package包/类
public static void main(String[] args) {
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
    int total = 0;
    List<String> list = new ArrayList<>();
    try {
        total = Integer.parseInt(bufferedReader.readLine());
        for (int i = 0; i < total; i++) {
            list.add(bufferedReader.readLine());
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    HashMap<Character, Integer> map = new HashMap<>();
    for (int i = 0; i < list.size(); i++) {
        String temp = list.get(i);
        for (int j = 0; j < temp.length(); j++) {
            if (map.containsKey(temp.charAt(j))) {
                map.put(temp.charAt(j), map.get(temp.charAt(j)) + 1);
            } else {
                map.put(temp.charAt(j), 1);
            }
        }
        for (int j = 0; j < temp.length(); j++) {
            if (map.get(temp.charAt(j)) == 1) {
                System.out.println(temp.charAt(j));
                break;
            }
        }
    }
}
 
开发者ID:leon66666,项目名称:JavaCommon,代码行数:31,代码来源:FindFirstOnceOccurCharactar.java

示例11: handleRow

import java.util.List; //导入方法依赖的package包/类
private List<Pair<String, String>> handleRow(List<Element> row) {
    List<Pair<String, String>> ret = Lists.newArrayList();

    for (int i = 0; i < row.size(); i++) {
        ret.add(Pair.of(keys.get(i), valueResolver.resolveValue(row.get(i))));
    }

    return ret;
}
 
开发者ID:virjar,项目名称:vscrawler,代码行数:10,代码来源:TableEvaluator.java

示例12: computeExistPageFunctionCells

import java.util.List; //导入方法依赖的package包/类
public static void computeExistPageFunctionCells(Report report) {
	Context context=report.getContext();
	List<Cell> existPageFunctionCells=context.getExistPageFunctionCells();
	for(Cell cell:existPageFunctionCells){
		List<BindData> dataList=context.buildCellData(cell);
		if(dataList==null || dataList.size()==0){
			continue;
		}
		BindData bindData=dataList.get(0);
		cell.setData(bindData.getValue());
		cell.setBindData(bindData.getDataList());
		cell.doFormat();
		cell.doDataWrapCompute(context);
	}
}
 
开发者ID:youseries,项目名称:ureport,代码行数:16,代码来源:PagingBuilder.java

示例13: readNewEvents

import java.util.List; //导入方法依赖的package包/类
private static List<EventLog.Event> readNewEvents(final CondomCore.CondomEvent type) throws IOException {
	final List<EventLog.Event> events = new ArrayList<>();
	EventLog.readEvents(new int[] { EVENT_TAG_MARK, "Condom".hashCode() + type.ordinal() }, events);
	if (events.isEmpty()) return Collections.emptyList();
	for (int i = events.size() - 1; i >= 0; i --) {
		final EventLog.Event event = events.get(i);
		if (event.getTag() == EVENT_TAG_MARK) {
			EventLog.writeEvent(EVENT_TAG_MARK);
			return events.subList(i + 1, events.size());
		}
	}
	EventLog.writeEvent(EVENT_TAG_MARK);
	return events;
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:15,代码来源:CondomMiscTest.java

示例14: getByMessageId

import java.util.List; //导入方法依赖的package包/类
@Override
   public MessageSeq getByMessageId(Long messageId) {
List list = doFind(SQL_QUERY_GET_SEQ_BY_MESSAGE, messageId);
if (list != null) {
    if (list.size() > 1) {
	log.warn("Looking up message seq by message id=" + messageId + ". More than one message seq found!"
		+ list.toString());
    }
    return (MessageSeq) list.get(0);
} else {
    return null;
}
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:MessageSeqDao.java

示例15: getExportHistoryFile

import java.util.List; //导入方法依赖的package包/类
@Test
public void getExportHistoryFile() {
	
	AdminService adminService = new AdminService();
	List<ExportLabel> exportHistoryLabels = adminService.getExportHistoryFile(7);
	for (int i = 0; i < exportHistoryLabels.size() ; i++) {
		System.out.println(exportHistoryLabels.get(i).getImg_id());
	} 
}
 
开发者ID:codekongs,项目名称:ImageClassify,代码行数:10,代码来源:AdminTest.java


注:本文中的java.util.List.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。