equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
41 protected Name(Table table) { |
41 protected Name(Table table) { |
42 this.table = table; |
42 this.table = table; |
43 } |
43 } |
44 |
44 |
45 /** |
45 /** |
46 * @inheritDoc |
46 * {@inheritDoc} |
47 */ |
47 */ |
48 public boolean contentEquals(CharSequence cs) { |
48 public boolean contentEquals(CharSequence cs) { |
49 return toString().equals(cs.toString()); |
49 return toString().equals(cs.toString()); |
50 } |
50 } |
51 |
51 |
52 /** |
52 /** |
53 * @inheritDoc |
53 * {@inheritDoc} |
54 */ |
54 */ |
55 public int length() { |
55 public int length() { |
56 return toString().length(); |
56 return toString().length(); |
57 } |
57 } |
58 |
58 |
59 /** |
59 /** |
60 * @inheritDoc |
60 * {@inheritDoc} |
61 */ |
61 */ |
62 public char charAt(int index) { |
62 public char charAt(int index) { |
63 return toString().charAt(index); |
63 return toString().charAt(index); |
64 } |
64 } |
65 |
65 |
66 /** |
66 /** |
67 * @inheritDoc |
67 * {@inheritDoc} |
68 */ |
68 */ |
69 public CharSequence subSequence(int start, int end) { |
69 public CharSequence subSequence(int start, int end) { |
70 return toString().subSequence(start, end); |
70 return toString().subSequence(start, end); |
71 } |
71 } |
72 |
72 |
140 return table.fromUtf(getByteArray(), getByteOffset() + start, end - start); |
140 return table.fromUtf(getByteArray(), getByteOffset() + start, end - start); |
141 } |
141 } |
142 |
142 |
143 /** Return the string representation of this name. |
143 /** Return the string representation of this name. |
144 */ |
144 */ |
|
145 @Override |
145 public String toString() { |
146 public String toString() { |
146 return Convert.utf2string(getByteArray(), getByteOffset(), getByteLength()); |
147 return Convert.utf2string(getByteArray(), getByteOffset(), getByteLength()); |
147 } |
148 } |
148 |
149 |
149 /** Return the Utf8 representation of this name. |
150 /** Return the Utf8 representation of this name. |