/** * Returns a read-only synchronous view (not a snapshot) of * {@code this} as a {@link ClassicCounter}. Works only with one-dimensional * GeneralizedCounters. Exactly like {@link #counterView}, except * that {@link #getCount} operates on primitive objects of the counter instead * of singleton lists. Any calls to * count-changing or entry-removing operations will result in an * {@link UnsupportedOperationException}. At some point in the * future, this view may gain limited writable functionality. */ public ClassicCounter<K> oneDimensionalCounterView() { if (depth != 1) { throw new UnsupportedOperationException(); } return new OneDimensionalCounterView(); }
/** * Returns a read-only synchronous view (not a snapshot) of * <code>this</code> as a {@link ClassicCounter}. Works only with one-dimensional * GeneralizedCounters. Exactly like {@link #counterView}, except * that {@link #getCount} operates on primitive objects of the counter instead * of singleton lists. Any calls to * count-changing or entry-removing operations will result in an * {@link UnsupportedOperationException}. At some point in the * future, this view may gain limited writable functionality. */ public ClassicCounter<K> oneDimensionalCounterView() { if (depth != 1) { throw new UnsupportedOperationException(); } return new OneDimensionalCounterView(); }
/** * Returns a read-only synchronous view (not a snapshot) of * <code>this</code> as a {@link ClassicCounter}. Works only with one-dimensional * GeneralizedCounters. Exactly like {@link #counterView}, except * that {@link #getCount} operates on primitive objects of the counter instead * of singleton lists. Any calls to * count-changing or entry-removing operations will result in an * {@link UnsupportedOperationException}. At some point in the * future, this view may gain limited writable functionality. */ public ClassicCounter<K> oneDimensionalCounterView() { if (depth != 1) { throw new UnsupportedOperationException(); } return new OneDimensionalCounterView(); }
/** * Returns a read-only synchronous view (not a snapshot) of * {@code this} as a {@link ClassicCounter}. Works only with one-dimensional * GeneralizedCounters. Exactly like {@link #counterView}, except * that {@link #getCount} operates on primitive objects of the counter instead * of singleton lists. Any calls to * count-changing or entry-removing operations will result in an * {@link UnsupportedOperationException}. At some point in the * future, this view may gain limited writable functionality. */ public ClassicCounter<K> oneDimensionalCounterView() { if (depth != 1) { throw new UnsupportedOperationException(); } return new OneDimensionalCounterView(); }
/** * Returns a read-only synchronous view (not a snapshot) of * {@code this} as a {@link ClassicCounter}. Works only with one-dimensional * GeneralizedCounters. Exactly like {@link #counterView}, except * that {@link #getCount} operates on primitive objects of the counter instead * of singleton lists. Any calls to * count-changing or entry-removing operations will result in an * {@link UnsupportedOperationException}. At some point in the * future, this view may gain limited writable functionality. */ public ClassicCounter<K> oneDimensionalCounterView() { if (depth != 1) { throw new UnsupportedOperationException(); } return new OneDimensionalCounterView(); }