Android Open Source - SimpleStrengthLog Muscle Groups

From Project

Back to project page SimpleStrengthLog.


The source code is released under:

MIT License

If you think the Android project SimpleStrengthLog listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.nomachetejuggling.ssl.model;
/* w w w  .j av a 2s. co  m*/
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class MuscleGroups implements Serializable {
  private static final long serialVersionUID = -2281995191088855472L;
  private Map<String, List<String>> muscleGroupToMuscles;
  private ArrayList<String> cachedMuscleGroups;
  private ArrayList<String> cachedMuscles;

  public MuscleGroups(Map<String, List<String>> muscleGroupToMuscles) {
    this.muscleGroupToMuscles = muscleGroupToMuscles;
  synchronized public ArrayList<String> getMuscleGroups() {
    if(this.cachedMuscleGroups == null) {
      this.cachedMuscleGroups = cacheMuscleGroups();
    return this.cachedMuscleGroups;
  synchronized public ArrayList<String> getMuscles() {
    if(this.cachedMuscles == null) {
      this.cachedMuscles = cacheMuscles();
    return this.cachedMuscles;
  private ArrayList<String> cacheMuscleGroups() {
    ArrayList<String> groups = new ArrayList<String>();
    return groups;
  private ArrayList<String> cacheMuscles() {
    Set<String> muscles = new HashSet<String>();
    for(List<String> someMuscles: muscleGroupToMuscles.values()) {
    ArrayList<String> muscleList = new ArrayList<String>();
    return muscleList;

  public boolean contains(CharSequence filter, Exercise exercise) {
    List<String> muscles = muscleGroupToMuscles.get(filter);
    if(muscles == null) return false;
    for(String exerciseMuscle: exercise.muscles) {
      if(muscles.contains(exerciseMuscle)) {
        return true;
    return false;

Java Source Code List