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