@Test public void testClear () { Styles s = Styles.make(Style.COLOR.is(0xFFAABBCC), Style.SHADOW.is(0xFF333333)); checkEquals(0xFFAABBCC, s, Style.COLOR); checkEquals(0xFF333333, s, Style.SHADOW); s = s.clear(Style.Mode.DEFAULT, Style.COLOR); checkEquals(null, s, Style.COLOR); }
public <V> Styles clear (Style.Mode mode, Style<V> style) { int index = Arrays.binarySearch(_bindings, new Binding<V>(style)); if (index < 0) return this; @SuppressWarnings("unchecked") Binding<V> binding = (Binding<V>)_bindings[index]; Binding<?>[] nbindings = new Binding<?>[_bindings.length]; System.arraycopy(_bindings, 0, nbindings, 0, nbindings.length); nbindings[index] = binding.clear(mode); return new Styles(nbindings); }
Styles { public <V> Styles clear (Style.Mode mode, Style<V> style) { int index = Arrays.binarySearch(_bindings, new Binding<V>(style)); if (index < 0) return this; @SuppressWarnings("unchecked") Binding<V> binding = (Binding<V>)_bindings[index]; Binding<?>[] nbindings = new Binding<?>[_bindings.length]; System.arraycopy(_bindings, 0, nbindings, 0, nbindings.length); nbindings[index] = binding.clear(mode); return new Styles(nbindings); } }
Styles { public <V> Styles clear (Style.Mode mode, Style<V> style) { int index = Arrays.binarySearch(_bindings, new Binding<V>(style)); if (index < 0) return this; @SuppressWarnings("unchecked") Binding<V> binding = (Binding<V>)_bindings[index]; Binding<?>[] nbindings = new Binding<?>[_bindings.length]; System.arraycopy(_bindings, 0, nbindings, 0, nbindings.length); nbindings[index] = binding.clear(mode); return new Styles(nbindings); } private  Styles(Binding<?>[] bindings); }
Styles { public <V> Styles clear (Style.Mode mode, Style<V> style) { int index = Arrays.binarySearch(_bindings, new Binding<V>(style)); if (index < 0) return this; @SuppressWarnings("unchecked") Binding<V> binding = (Binding<V>)_bindings[index]; Binding<?>[] nbindings = new Binding<?>[_bindings.length]; System.arraycopy(_bindings, 0, nbindings, 0, nbindings.length); nbindings[index] = binding.clear(mode); return new Styles(nbindings); } private  Styles(Binding<?>[] bindings); static Styles none(); static Styles make(Style.Binding<?>... bindings); static V resolveStyle(Element<?> element, Style<V> style); Styles add(Style.Binding<?>... bindings); Styles addDisabled(Style.Binding<?>... bindings); Styles addSelected(Style.Binding<?>... bindings); Styles addDisabledSelected(Style.Binding<?>... bindings); Styles add(Style.Mode mode, Style.Binding<?>... bindings); Styles clear(Style.Mode mode, Style<V> style); Styles merge(Styles styles); }
Styles { public <V> Styles clear (Style.Mode mode, Style<V> style) { int index = Arrays.binarySearch(_bindings, new Binding<V>(style)); if (index < 0) return this; @SuppressWarnings("unchecked") Binding<V> binding = (Binding<V>)_bindings[index]; Binding<?>[] nbindings = new Binding<?>[_bindings.length]; System.arraycopy(_bindings, 0, nbindings, 0, nbindings.length); nbindings[index] = binding.clear(mode); return new Styles(nbindings); } private  Styles(Binding<?>[] bindings); static Styles none(); static Styles make(Style.Binding<?>... bindings); static V resolveStyle(Element<?> element, Style<V> style); Styles add(Style.Binding<?>... bindings); Styles addDisabled(Style.Binding<?>... bindings); Styles addSelected(Style.Binding<?>... bindings); Styles addDisabledSelected(Style.Binding<?>... bindings); Styles add(Style.Mode mode, Style.Binding<?>... bindings); Styles clear(Style.Mode mode, Style<V> style); Styles merge(Styles styles);  }