Check-in [db5936fbd9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove the string BasicSequence stuff since it is no longer used and this greatly simplifies `String`.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:db5936fbd98b88cb7f83d681dfe70d3da19922e3
User & Date: stephanie.gawroriski 2019-05-24 14:37:53
Context
2019-05-24
14:39
Remove Memory UTF sequence from the fixed class IDs. check-in: cfbc792882 user: stephanie.gawroriski tags: trunk
14:37
Remove the string BasicSequence stuff since it is no longer used and this greatly simplifies `String`. check-in: db5936fbd9 user: stephanie.gawroriski tags: trunk
14:28
Implement String.intern() using an internal LinkedList<WeakReference<String>> table. check-in: b3ceace762 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/BasicSequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This interface is used for providing access to the data contained within
 * {@link java.lang.String}. It is similar to {@link java.lang.CharSequence}
 * except that it only has valid length and characters.
 *
 * Some strings may refer to characters which have been mapped to another
 * address space and as such will require remote access to the memory of
 * that process.
 *
 * @since 2018/02/24
 */
@Deprecated
public abstract class BasicSequence
{
	/**
	 * Returns the character at the given index.
	 *
	 * @param __i The index of the character.
	 * @return The character at the given index.
	 * @throws StringIndexOutOfBoundsException If the index is outside of
	 * bounds.
	 * @since 2018/02/24
	 */
	public abstract char charAt(int __i)
		throws StringIndexOutOfBoundsException;
	
	/**
	 * Returns the length of the string.
	 *
	 * @return The string length.
	 * @since 2018/02/24
	 */
	public abstract int length();
	
	/**
	 * Returns the subsequence of this sequence.
	 *
	 * @param __s The starting point.
	 * @param __e The ending point.
	 * @return The subsequence.
	 * @throws IndexOutOfBoundsException If the sequence is out of bounds.
	 * @since 2018/12/01
	 */
	public SubBasicSequenceSequence subSequence(int __s, int __e)
		throws IndexOutOfBoundsException
	{
		return new SubBasicSequenceSequence(this, __s, __e);
	}
	
	/**
	 * Converts this basic sequence to a character array.
	 *
	 * @return The resulting character array.
	 * @since 2018/12/04
	 */
	public char[] toCharArray()
	{
		int len = this.length();
		char[] rv = new char[len];
		
		for (int i = 0; i < len; i++)
			rv[i] = this.charAt(i);
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/ByteArraySequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This is a sequence of characters which uses basic bytes to represent basic
 * character sequences.
 *
 * @since 2019/04/27
 */
@Deprecated
public final class ByteArraySequence
	extends BasicSequence
{
	/** The array data. */
	protected final byte[] data;
	
	/** The array length. */
	protected final int length;
	
	/**
	 * Initializes the byte array sequence.
	 *
	 * @param __data The input data, this is set directly and is not copied.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/04/27
	 */
	public ByteArraySequence(byte... __data)
		throws NullPointerException
	{
		if (__data == null)
			throw new NullPointerException("NARG");
		
		this.data = __data;
		this.length = __data.length;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/04/27
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		try
		{
			throw new todo.TODO();
		}
		catch (IndexOutOfBoundsException e)
		{
			throw new StringIndexOutOfBoundsException(__i);
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/04/27
	 */
	@Override
	public final int length()
	{
		throw new todo.TODO();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/04/27
	 */
	@Override
	public char[] toCharArray()
	{
		throw new todo.TODO();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/CharArraySequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This is a sequence which is backed by a directly access character array.
 *
 * The array data is not copied.
 *
 * @since 2018/09/16
 */
@Deprecated
public final class CharArraySequence
	extends BasicSequence
{
	/** The array data. */
	protected final char[] data;
	
	/** The array length. */
	protected final int length;
	
	/**
	 * Initializes the character array sequence.
	 *
	 * @param __data The input data, this is set directly and is not copied.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/09/16
	 */
	public CharArraySequence(char... __data)
		throws NullPointerException
	{
		if (__data == null)
			throw new NullPointerException("NARG");
		
		this.data = __data;
		this.length = __data.length;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/16
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		try
		{
			return this.data[__i];
		}
		catch (IndexOutOfBoundsException e)
		{
			throw new StringIndexOutOfBoundsException(__i);
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/16
	 */
	@Override
	public final int length()
	{
		return this.length;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/04
	 */
	@Override
	public char[] toCharArray()
	{
		return this.data.clone();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/CharSequenceSequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * A sequence which uses a character sequence.
 *
 * @since 2018/09/20
 */
@Deprecated
public final class CharSequenceSequence
	extends BasicSequence
{
	/** The sequence to wrap. */
	protected final CharSequence sequence;
	
	/**
	 * Initializes the sequence.
	 *
	 * @param __cs The sequence to wrap.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/09/20
	 */
	public CharSequenceSequence(CharSequence __cs)
		throws NullPointerException
	{
		if (__cs == null)
			throw new NullPointerException("NARG");
		
		this.sequence = __cs;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/20
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		try
		{
			return this.sequence.charAt(__i);
		}
		catch (IndexOutOfBoundsException e)
		{
			if (e instanceof StringIndexOutOfBoundsException)
				throw (StringIndexOutOfBoundsException)e;
			
			// {@squirreljme.error ZZ0b Out of bounds access while accessing
			// character sequence.}
			StringIndexOutOfBoundsException t =
				new StringIndexOutOfBoundsException("ZZ0b");
			t.initCause(e);
			throw t;
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/20
	 */
	@Override
	public final int length()
	{
		return this.sequence.length();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/ClassConstantCharArraySequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This is a sequence which is backed by a directly access character array.
 *
 * The array data is not copied.
 *
 * This is a special class to indicate the character array is a class constant.
 *
 * @since 2018/11/11
 */
@Deprecated
public final class ClassConstantCharArraySequence
	extends BasicSequence
{
	/** The array data. */
	protected final char[] data;
	
	/** The array length. */
	protected final int length;
	
	/**
	 * Initializes the character array sequence.
	 *
	 * @param __data The input data, this is set directly and is not copied.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/11/11
	 */
	public ClassConstantCharArraySequence(char... __data)
		throws NullPointerException
	{
		if (__data == null)
			throw new NullPointerException("NARG");
		
		this.data = __data;
		this.length = __data.length;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/11/11
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		try
		{
			return this.data[__i];
		}
		catch (IndexOutOfBoundsException e)
		{
			throw new StringIndexOutOfBoundsException(__i);
		}
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/11/11
	 */
	@Override
	public final int length()
	{
		return this.length;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/04
	 */
	@Override
	public char[] toCharArray()
	{
		return this.data.clone();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/EmptySequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This represents an empty string.
 *
 * @since 2018/02/24
 */
@Deprecated
public final class EmptySequence
	extends BasicSequence
{
	/** Single instance of the empty string. */
	public static final EmptySequence INSTANCE =
		new EmptySequence();
	
	/**
	 * {@inheritDoc}
	 * @since 2018/02/24
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		// {@squirreljme.error ZZ0c The empty string has no valid characters.}
		throw new StringIndexOutOfBoundsException("ZZ0c");
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/02/24
	 */
	@Override
	public final int length()
	{
		return -1;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/04
	 */
	@Override
	public char[] toCharArray()
	{
		return new char[0];
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/MemoryUTFSequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This is a sequence which accesses memory and uses the UTF encoded form.
 *
 * @since 2019/04/30
 */
@Deprecated
public final class MemoryUTFSequence
	extends BasicSequence
{
	/** The memory pointer. */
	protected final int pointer;
	
	/**
	 * Initializes the sequence.
	 *
	 * @param __p The pointer.
	 * @since 2019/04/30
	 */
	public MemoryUTFSequence(int __p)
	{
		this.pointer = __p;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/04/30
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		throw new todo.TODO();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/04/30
	 */
	@Override
	public final int length()
	{
		throw new todo.TODO();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/SingleCharacterSequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This is a sequence which contains only a single character.
 *
 * @since 2018/10/12
 */
@Deprecated
public final class SingleCharacterSequence
	extends BasicSequence
{
	/** The value to store. */
	protected final char value;
	
	/**
	 * Initializes the single character sequence.
	 *
	 * @param __v The value to use.
	 * @since 2018/10/12
	 */
	public SingleCharacterSequence(char __v)
	{
		this.value = __v;
	}	
	
	/**
	 * {@inheritDoc}
	 * @since 2018/10/12
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		// {@squirreljme.error ZZ0d Only a single character is valid.}
		if (__i != 0)
			throw new StringIndexOutOfBoundsException("ZZ0d");
		
		return this.value;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/10/12
	 */
	@Override
	public final int length()
	{
		return 1;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/12/04
	 */
	@Override
	public char[] toCharArray()
	{
		return new char[]{this.value};
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/SubBasicSequenceSequence.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.cldc.string;

/**
 * This is a sequence which provides a sub-sequence.
 *
 * @since 2018/09/29
 */
@Deprecated
public final class SubBasicSequenceSequence
	extends BasicSequence
{
	/** The sequence to wrap. */
	protected final BasicSequence sequence;
	
	/** The start index. */
	protected final int start;
	
	/** The length. */
	protected final int length;
	
	/**
	 * Initializes this sequence.
	 *
	 * @param __q The sequence to wrap.
	 * @param __s The start point.
	 * @param __e The end point.
	 * @throws IndexOutOfBoundsException If the start is negative, the end
	 * exceeds the sequence length, or the start is greater than the end.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/09/29
	 */
	public SubBasicSequenceSequence(BasicSequence __q, int __s, int __e)
		throws IndexOutOfBoundsException, NullPointerException
	{
		if (__q == null)
			throw new NullPointerException("NARG");
		
		// {@squirreljme.error ZZ0e Out of bounds sequence access.}
		if (__s < 0 || __s > __e || __e > __q.length())
			throw new IndexOutOfBoundsException("ZZ0e");
		
		this.sequence = __q;
		this.start = __s;
		this.length = __e - __s;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/29
	 */
	@Override
	public final char charAt(int __i)
		throws StringIndexOutOfBoundsException
	{
		// {@squirreljme.error ZZ0f Sub-basic sequence index is out of
		// bounds. (The index)}
		if (__i < 0 || __i > this.length)
			throw new StringIndexOutOfBoundsException("ZZ0f " + __i);
		
		return this.sequence.charAt(this.start + __i);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/29
	 */
	@Override
	public final int length()
	{
		return this.length;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/29
	 */
	@Override
	public final SubBasicSequenceSequence subSequence(int __s, int __e)
		throws IndexOutOfBoundsException
	{
		// {@squirreljme.error ZZ0g Out of bounds sequence access.}
		int start = this.start,
			newend = start + __e;
		if (__s < 0 || __s > __e || __e > newend)
			throw new IndexOutOfBoundsException("ZZ0g");
		
		return new SubBasicSequenceSequence(this.sequence,
			start + __s, newend);
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































































































































Deleted runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/string/package-info.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

/**
 * This contains backing characters stores for contained string data that will
 * be internally used by {@link java.lang.String}.
 *
 * @since 2018/02/24
 */

@Deprecated
package cc.squirreljme.runtime.cldc.string;

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































Changes to runt/apis/cldc-compact/java/lang/Character.java.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
...
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
// ---------------------------------------------------------------------------

package java.lang;

import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.cldc.asm.ObjectAccess;
import cc.squirreljme.runtime.cldc.i18n.DefaultLocale;
import cc.squirreljme.runtime.cldc.string.SingleCharacterSequence;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

/**
 * This is a boxed representation of {@link char}.
 *
 * @since 2018/10/13
................................................................................
		String rv;
		
		// We can represent a string for our single character as this
		// special sequence instead of just creating a new temporary string
		// just to store a single character or creating some kind of array.
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>(
				(rv = new String(new SingleCharacterSequence(this._value))));
		
		return rv;
	}
	
	/**
	 * Returns the digit for the given character and radix.
	 *
................................................................................
	 *
	 * @param __c The character to represent as a string.
	 * @return The string representation of that character.
	 * @since 2018/10/13
	 */
	public static String toString(char __c)
	{
		return new String(new SingleCharacterSequence(__c));
	}
	
	/**
	 * Converts the specified character to lower case without considering
	 * locale.
	 *
	 * @param __c The character to convert.







<







 







|







 







|







9
10
11
12
13
14
15

16
17
18
19
20
21
22
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
...
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
// ---------------------------------------------------------------------------

package java.lang;

import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.cldc.asm.ObjectAccess;
import cc.squirreljme.runtime.cldc.i18n.DefaultLocale;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

/**
 * This is a boxed representation of {@link char}.
 *
 * @since 2018/10/13
................................................................................
		String rv;
		
		// We can represent a string for our single character as this
		// special sequence instead of just creating a new temporary string
		// just to store a single character or creating some kind of array.
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>(
				(rv = new String(new char[]{this._value}, (short)0)));
		
		return rv;
	}
	
	/**
	 * Returns the digit for the given character and radix.
	 *
................................................................................
	 *
	 * @param __c The character to represent as a string.
	 * @return The string representation of that character.
	 * @since 2018/10/13
	 */
	public static String toString(char __c)
	{
		return new String(new char[]{__c}, (short)0);
	}
	
	/**
	 * Converts the specified character to lower case without considering
	 * locale.
	 *
	 * @param __c The character to convert.

Changes to runt/apis/cldc-compact/java/lang/String.java.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
80
81
82
83
84
85
86
87


88
89







90

91
92







93
94
95
96
97
98
99
...
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.cldc.annotation.ProgrammerTip;
import cc.squirreljme.runtime.cldc.i18n.DefaultLocale;
import cc.squirreljme.runtime.cldc.i18n.Locale;
import cc.squirreljme.runtime.cldc.io.CodecFactory;
import cc.squirreljme.runtime.cldc.io.Decoder;
import cc.squirreljme.runtime.cldc.io.Encoder;
import cc.squirreljme.runtime.cldc.string.BasicSequence;
import cc.squirreljme.runtime.cldc.string.CharArraySequence;
import cc.squirreljme.runtime.cldc.string.CharSequenceSequence;
import cc.squirreljme.runtime.cldc.string.EmptySequence;
import cc.squirreljme.runtime.cldc.string.SubBasicSequenceSequence;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.Collection;
................................................................................
	/**
	 * Initializes a new empty string.
	 *
	 * @since 2018/02/24
	 */
	public String()
	{
		this(EmptySequence.INSTANCE);


	}
	







	public String(String __a)

	{
		this(new CharSequenceSequence(__a));







	}
	
	/**
	 * Initializes a string which uses characters which are a copy of the given
	 * character array.
	 *
	 * @param __c The characters to copy.
................................................................................
		if (__c == null)
			throw new NullPointerException("NARG");
		
		this._chars = __c;
		this._quickflags = __qf;
	}
	
	/**
	 * Initializes the string using the given sequence for characters.
	 *
	 * @param __bs The sequence of characters to use.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/02/24
	 */
	@Deprecated
	String(BasicSequence __bs)
		throws NullPointerException
	{
		this(__bs, (short)0);
	}
	
	/**
	 * Initializes the string using the given sequence for characters.
	 *
	 * @param __bs The sequence of characters to use.
	 * @param __qf Quick determination flags.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/02/24
	 */
	@Deprecated
	private String(BasicSequence __bs, short __qf)
		throws NullPointerException
	{
		this(__bs.toCharArray(), __qf);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/09/20
	 */
	@Override
	public char charAt(int __i)
		throws IndexOutOfBoundsException







<
<
<
<
<







 







|
>
>


>
>
>
>
>
>
>
|
>

<
>
>
>
>
>
>
>







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







13
14
15
16
17
18
19





20
21
22
23
24
25
26
..
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108
109
110
...
304
305
306
307
308
309
310





























311
312
313
314
315
316
317
import cc.squirreljme.runtime.cldc.annotation.ImplementationNote;
import cc.squirreljme.runtime.cldc.annotation.ProgrammerTip;
import cc.squirreljme.runtime.cldc.i18n.DefaultLocale;
import cc.squirreljme.runtime.cldc.i18n.Locale;
import cc.squirreljme.runtime.cldc.io.CodecFactory;
import cc.squirreljme.runtime.cldc.io.Decoder;
import cc.squirreljme.runtime.cldc.io.Encoder;





import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.Collection;
................................................................................
	/**
	 * Initializes a new empty string.
	 *
	 * @since 2018/02/24
	 */
	public String()
	{
		this._chars = new char[0];
		this._quickflags = _QUICK_ISLOWER | _QUICK_ISUPPER;
		this._hashcode = 0;
	}
	
	/**
	 * Initializes a string which is an exact copy of the other string.
	 *
	 * @param __s The other string.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/24
	 */
	public String(String __s)
		throws NullPointerException
	{

		if (__s == null)
			throw new NullPointerException("NARG");
		
		// Just copies all the fields since they were pre-calculated already
		this._chars = __s._chars;
		this._quickflags = ((short)(__s._quickflags & (~_QUICK_INTERN)));
		this._hashcode = __s._hashcode;
	}
	
	/**
	 * Initializes a string which uses characters which are a copy of the given
	 * character array.
	 *
	 * @param __c The characters to copy.
................................................................................
		if (__c == null)
			throw new NullPointerException("NARG");
		
		this._chars = __c;
		this._quickflags = __qf;
	}
	





























	/**
	 * {@inheritDoc}
	 * @since 2018/09/20
	 */
	@Override
	public char charAt(int __i)
		throws IndexOutOfBoundsException