code: public int[] toArray() {
          int[] array = new int[length];
          for (int p : positiveDimensions)
              array[p] = 1;
          for (int n : negativeDimensions)
              array[n] = -1;
          return array;
      }
docs: {@inheritDoc}.