1 package com.android.launcher3.util; 2 3 public abstract class FlagOp { 4 5 public static FlagOp NO_OP = new FlagOp() {}; 6 FlagOp()7 private FlagOp() {} 8 apply(int flags)9 public int apply(int flags) { 10 return flags; 11 } 12 addFlag(final int flag)13 public static FlagOp addFlag(final int flag) { 14 return new FlagOp() { 15 @Override 16 public int apply(int flags) { 17 return flags | flag; 18 } 19 }; 20 } 21 22 public static FlagOp removeFlag(final int flag) { 23 return new FlagOp() { 24 @Override 25 public int apply(int flags) { 26 return flags & ~flag; 27 } 28 }; 29 } 30 } 31