/*
 * Java Genetic Algorithm Library (@__identifier__@).
 * Copyright (c) @__year__@ Franz Wilhelmstötter
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Author:
 *     Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
 *
 */
package org.jenetics.util;


/**
 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 * @since 1.0
 * @version 1.0 &mdash; <em>$Date: 2013-06-02 $</em>
 */
abstract class AbstractCharSeq extends ArrayISeq<Character> {
	private static final long serialVersionUID = 1L;

	final char[] _characters;

	AbstractCharSeq(final char[] characters) {
		super(toArrayRef(characters), 0, characters.length);
		_characters = characters;
	}

	private static ArrayRef toArrayRef(final char[] characters) {
		final Object[] values = new Object[characters.length];
		for (int i = 0; i < characters.length; ++i) {
			values[i] = characters[i];
		}

		return new ArrayRef(values).seal();
	}


}

@@ -1062,17 +1062,17 @@
 rsion 1.
-0
+3
  &mdash;
@@ -1298,26 +1298,25 @@
 %09%09super(
-to
 Array
-Ref
+.box
 (charact
@@ -1323,165 +1323,27 @@
 ers)
-, 0, characters.length);%0A%09%09_characters = characters;%0A%09%7D%0A%0A%09private static ArrayRef toArrayRef(final char%5B%5D characters) %7B%0A%09%09final Object%5B%5D values = new Object%5B
+._array.seal(), 0, 
 char
@@ -1359,71 +1359,24 @@
 ngth
-%5D
+)
 ;%0A%09%09
-for (int i = 0; i %3C characters.length; ++i) %7B%0A%09%09%09values%5Bi%5D
+_characters
  = c
@@ -1388,59 +1388,12 @@
 ters
-%5Bi%5D
 ;%0A
-%09
 %09%7D%0A%0A
-%09%09return new ArrayRef(values).seal();%0A%09%7D%0A%0A%0A
 %7D%0A

Simplify 'AbstractCharSeq' object creation.