aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-06 08:38:28 +0000
committeraclement <aclement>2006-06-06 08:38:28 +0000
commit5e74f35fa0ac6002b0a291259b88c1b0017fbf40 (patch)
tree4058bc2e6745d73742c7faeea0d0130addf04879 /util
parentd1dbf827ea64012890fd2de97d684722f81f3226 (diff)
downloadaspectj-5e74f35fa0ac6002b0a291259b88c1b0017fbf40.tar.gz
aspectj-5e74f35fa0ac6002b0a291259b88c1b0017fbf40.zip
some code for 141730 - store type signatures in program elements rather than processed type names.
Diffstat (limited to 'util')
-rw-r--r--util/src/org/aspectj/util/CharOperation.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/util/src/org/aspectj/util/CharOperation.java b/util/src/org/aspectj/util/CharOperation.java
new file mode 100644
index 000000000..423d7258d
--- /dev/null
+++ b/util/src/org/aspectj/util/CharOperation.java
@@ -0,0 +1,48 @@
+/********************************************************************
+ * Copyright (c) 2006 Contributors. All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ * Helen Hawkins - initial version
+ *******************************************************************/
+package org.aspectj.util;
+
+
+/**
+ * Taken from org.aspectj.org.eclipse.jdt.core.compiler.CharOperation
+ *
+ */
+public class CharOperation {
+
+ /**
+ * Taken from org.aspectj.org.eclipse.jdt.core.compiler.CharOperation
+ */
+ public static final char[] subarray(char[] array, int start, int end) {
+ if (end == -1)
+ end = array.length;
+ if (start > end)
+ return null;
+ if (start < 0)
+ return null;
+ if (end > array.length)
+ return null;
+
+ char[] result = new char[end - start];
+ System.arraycopy(array, start, result, 0, end - start);
+ return result;
+ }
+
+ /**
+ * Taken from org.aspectj.org.eclipse.jdt.core.compiler.CharOperation
+ */
+ public static final int lastIndexOf(char toBeFound, char[] array) {
+ for (int i = array.length; --i >= 0;)
+ if (toBeFound == array[i])
+ return i;
+ return -1;
+ }
+
+}