You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ROBitSet.java 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. *
  3. *
  4. * Copyright 1999-2003 The Apache Software Foundation.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. *
  19. *
  20. * @author <a href="mailto:pbwest@powerup.com.au">Peter B. West</a>
  21. * @version $Revision$ $Name$
  22. */
  23. // $Id$
  24. package org.apache.fop.datastructs;
  25. import java.util.BitSet;
  26. /**
  27. * Implements a Read-Only <tt>BitSet</tt>. The set is created as a copy of
  28. * the set provided in the constructor, and no subsequent changes can occur.
  29. * All read operations from <tt>BitSet</tt> are preserved.
  30. */
  31. public class ROBitSet extends BitSet {
  32. /**
  33. * Initialise with <tt>BitSet</tt>. This is the only operation that
  34. * modifies the bit set.
  35. * @param bitset the unmodifiable <tt>Bitset</tt>
  36. */
  37. public ROBitSet(BitSet bitset) {
  38. super(bitset.length());
  39. super.or(bitset);
  40. }
  41. /**
  42. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  43. * @param set <tt>BitSet</tt>
  44. * @exception UnsupportedOperationException
  45. */
  46. public void and(BitSet set) {
  47. throw new UnsupportedOperationException("and invalid in ROBitSet");
  48. }
  49. /**
  50. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  51. * @param set <tt>BitSet</tt>
  52. * @exception UnsupportedOperationException
  53. */
  54. public void andNot(BitSet set) {
  55. throw new UnsupportedOperationException("andNot invalid in ROBitSet");
  56. }
  57. /**
  58. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  59. * @exception UnsupportedOperationException
  60. */
  61. public void clear() {
  62. throw new UnsupportedOperationException("clear invalid in ROBitSet");
  63. }
  64. /**
  65. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  66. * @param bitIndex <tt>int</tt>
  67. * @exception UnsupportedOperationException
  68. */
  69. public void clear(int bitIndex) {
  70. throw new UnsupportedOperationException("clear invalid in ROBitSet");
  71. }
  72. /**
  73. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  74. * @param fromIndex <tt>int</tt>
  75. * @param toIndex <tt>int</tt>
  76. * @exception UnsupportedOperationException
  77. */
  78. public void clear(int fromIndex, int toIndex) {
  79. throw new UnsupportedOperationException("clear invalid in ROBitSet");
  80. }
  81. /**
  82. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  83. * @param bitIndex <tt>int</tt>
  84. * @exception UnsupportedOperationException
  85. */
  86. public void flip(int bitIndex) {
  87. throw new UnsupportedOperationException("flip invalid in ROBitSet");
  88. }
  89. /**
  90. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  91. * @param fromIndex <tt>int</tt>
  92. * @param toIndex <tt>int</tt>
  93. * @exception UnsupportedOperationException
  94. */
  95. public void flip(int fromIndex, int toIndex) {
  96. throw new UnsupportedOperationException("flip invalid in ROBitSet");
  97. }
  98. /**
  99. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  100. * @param set <tt>BitSet</tt>
  101. * @exception UnsupportedOperationException
  102. */
  103. public void or(BitSet set) {
  104. throw new UnsupportedOperationException("or invalid in ROBitSet");
  105. }
  106. /**
  107. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  108. * @param bitIndex <tt>int</tt>
  109. * @exception UnsupportedOperationException
  110. */
  111. public void set(int bitIndex) {
  112. throw new UnsupportedOperationException("set invalid in ROBitSet");
  113. }
  114. /**
  115. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  116. * @param bitIndex <tt>int</tt>
  117. * @param value <tt>boolean</tt>
  118. * @exception UnsupportedOperationException
  119. */
  120. public void set(int bitIndex, boolean value) {
  121. throw new UnsupportedOperationException("set invalid in ROBitSet");
  122. }
  123. /**
  124. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  125. * @param fromIndex <tt>int</tt>
  126. * @param toIndex <tt>int</tt>
  127. * @exception UnsupportedOperationException
  128. */
  129. public void set(int fromIndex, int toIndex) {
  130. throw new UnsupportedOperationException("set invalid in ROBitSet");
  131. }
  132. /**
  133. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  134. * @param fromIndex <tt>int</tt>
  135. * @param toIndex <tt>int</tt>
  136. * @param value <tt>boolean</tt>
  137. * @exception UnsupportedOperationException
  138. */
  139. public void set(int fromIndex, int toIndex, boolean value) {
  140. throw new UnsupportedOperationException("set invalid in ROBitSet");
  141. }
  142. /**
  143. * Unsupported operation. Overrides <tt>BitSet</tt> method.
  144. * @param set <tt>BitSet</tt>
  145. * @exception UnsupportedOperationException
  146. */
  147. public void xor(BitSet set) {
  148. throw new UnsupportedOperationException("xor invalid in ROBitSet");
  149. }
  150. }