diff options
author | ArghKevin <kagheli@student.sdccd.edu> | 2024-05-08 21:24:42 -0700 |
---|---|---|
committer | ArghKevin <kagheli@student.sdccd.edu> | 2024-05-08 21:24:42 -0700 |
commit | 33cbc71a230e7522168fdfe41afd5e3acf5bb7b5 (patch) | |
tree | 64a0ed61c802009558f4c46f6ca8995df36d9137 /src/FontFamily.java | |
parent | ada80f74d26a632c1d6960f04f773f4fe51fc10d (diff) |
Javadoc beginning.
Diffstat (limited to 'src/FontFamily.java')
-rw-r--r-- | src/FontFamily.java | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/src/FontFamily.java b/src/FontFamily.java index 54e174f..8e32f05 100644 --- a/src/FontFamily.java +++ b/src/FontFamily.java @@ -8,28 +8,63 @@ import java.util.HashMap; * References: * * Date: - * 2024-04-28 + * 2024-05-08 * * Purpose of class: * Store and operate on font family metadata. */ public class FontFamily { - /* The directory containing the associated METADATA.pb */ - private String directoryName; + /* JSONReader from which metadata is pulled. */ + private JSONReader metadata; /* Taken from first line of METADATA.pb */ private String familyName; /* Taken from fonts/tags/all/families.csv */ - private ArrayList<String> styles; + private HashMap<String,Integer> styles; /* Taken from top level of METADATA.pb */ private String dateAdded; - /* Average glyph count of every font file specified in METADATA.pb */ - private int glyphCount; - /* Average file size of every font file specified in METADATA.pb */ - private int fileSize; - /* Author from METADATA.pb */ - private String author; + /* Languages supported. */ + private String[] languages; + private String designer; /* total views, 7day views, 30day views, 90day views, year views. Taken from popularity.json. */ private HashMap<String,Long> views; + private String license; + private String category; + /* popularity.json and families.csv are shared among all families. + Have their associated objects passed from outside. */ + + /* + * Constructor. + */ + public FontFamily(JSONReader metadata, JSONReader popularity, CSVReader styles) { + this.metadata = metadata; + parseMetadata(metadata); + parsePopularity(popularity); + parseStyles(styles); + } + + /* + * Parse metadata. + */ + private void parseMetadata(JSONReader metadata) { + familyName = metadata.get("name"); + dateAdded = metadata.get("date_added"); + languages = metadata.getAll("languages"); + designer = metadata.get("designer"); + license = metadata.get("license"); + category = metadata.get("category"); + } + + /* + * Parse popularity. + */ + private void parsePopularity(JSONReader popularity) { + } + + /* + * Parse styles. + */ + private void parseStyles(CSVReader styles) { + } } |