|
|
@ -33,13 +33,6 @@ import java.util.*;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public abstract class HabitList implements Iterable<Habit>
|
|
|
|
public abstract class HabitList implements Iterable<Habit>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public enum Order
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BY_NAME,
|
|
|
|
|
|
|
|
BY_COLOR,
|
|
|
|
|
|
|
|
BY_POSITION
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ModelObservable observable;
|
|
|
|
private ModelObservable observable;
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
@NonNull
|
|
|
@ -55,9 +48,7 @@ public abstract class HabitList implements Iterable<Habit>
|
|
|
|
public HabitList()
|
|
|
|
public HabitList()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
observable = new ModelObservable();
|
|
|
|
observable = new ModelObservable();
|
|
|
|
filter = new HabitMatcherBuilder()
|
|
|
|
filter = new HabitMatcherBuilder().setArchivedAllowed(true).build();
|
|
|
|
.setArchivedAllowed(true)
|
|
|
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected HabitList(@NonNull HabitMatcher filter)
|
|
|
|
protected HabitList(@NonNull HabitMatcher filter)
|
|
|
@ -113,6 +104,15 @@ public abstract class HabitList implements Iterable<Habit>
|
|
|
|
return observable;
|
|
|
|
return observable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public abstract Order getOrder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Changes the order of the elements on the list.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param order the new order criterea
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public abstract void setOrder(@NonNull Order order);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the index of the given habit in the list, or -1 if the list does
|
|
|
|
* Returns the index of the given habit in the list, or -1 if the list does
|
|
|
|
* not contain the habit.
|
|
|
|
* not contain the habit.
|
|
|
@ -164,13 +164,6 @@ public abstract class HabitList implements Iterable<Habit>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Changes the order of the elements on the list.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param order the new order criterea
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public abstract void setOrder(Order order);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the number of habits in this list.
|
|
|
|
* Returns the number of habits in this list.
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -242,4 +235,11 @@ public abstract class HabitList implements Iterable<Habit>
|
|
|
|
|
|
|
|
|
|
|
|
csv.close();
|
|
|
|
csv.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public enum Order
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BY_NAME,
|
|
|
|
|
|
|
|
BY_COLOR,
|
|
|
|
|
|
|
|
BY_POSITION
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|