Xiaomi Open source File Manager micodefileexplorer-Source Research (1)-2 model models

Source: Internet
Author: User

In the previous article, the Millet Java code was organized into 5 packages, of which 1 were net.micode.fileexplorer.model.
This package has 2 model classes, the most basic, FileInfo and Favoriteitem.
Package net.micode.fileexplorer.model;/** Abstracts The most basic information for a file */public class FileInfo {//filename public String filename;// File path public String filepath;//file size (what is the unit?) Public long filesize;//is the directory public boolean isdir;//does not understand public int count;//Last modified date public long modifieddate;//whether public B is selected Oolean selected;//whether the public boolean canread;//can be read if the public boolean canwrite;//whether to hide the public boolean ishidden;//if it is from the database, Is the Idpublic long dbId in the database; ID in the database, if was from database}




Indeterminate there are 2 fields, filesize file size units, and Count fields.
One strange thing is that some fields start with lowercase letters, and some fields start with uppercase letters. Why is this?


Package net.micode.fileexplorer.model;/** Favorites */public class Favoriteitem {//ID in the Databasepublic long id;public Stri ng title;//pathpublic string location;public FileInfo fileinfo;public favoriteitem (String T, string l) {title = T;locatio n = l;} Public Favoriteitem (Long I, string T, string l) {id = I;title = t;location = l;}}

At present, the whole procedure is not fully understood.
My own analysis: FileInfo is a file entry that is stored in a database, and Favoriteitem is a favorite item.
Not sure if the filepath of path and FileInfo are the same.


These 2 entity classes, is considered the simplest of the source code 2, no logic, but some fields are not very clear.


Have an appetizer and prepare for the next dish ~

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Xiaomi Open source File Manager micodefileexplorer-Source Research (1)-2 model models

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.