Mercurial > hg4j
comparison src/org/tmatesoft/hg/internal/IntVector.java @ 545:15b406c7cd9d
First round of annotate file is functional
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 15 Feb 2013 22:15:13 +0100 |
parents | 694ebabb5cb3 |
children | 83afa680555d |
comparison
equal
deleted
inserted
replaced
544:7f5998a9619d | 545:15b406c7cd9d |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 TMate Software Ltd | 2 * Copyright (c) 2011-2013 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
52 throw new IndexOutOfBoundsException(String.format("Index: %d, size: %d", i, count)); | 52 throw new IndexOutOfBoundsException(String.format("Index: %d, size: %d", i, count)); |
53 } | 53 } |
54 return data[i]; | 54 return data[i]; |
55 } | 55 } |
56 | 56 |
57 public void set(int i, int v) { | |
58 if (i < 0 || i >= count) { | |
59 throw new IndexOutOfBoundsException(String.format("Index: %d, size: %d", i, count)); | |
60 } | |
61 data[i] = v; | |
62 } | |
63 | |
57 public int size() { | 64 public int size() { |
58 return count; | 65 return count; |
66 } | |
67 | |
68 public boolean isEmpty() { | |
69 return count == 0; | |
59 } | 70 } |
60 | 71 |
61 public void clear() { | 72 public void clear() { |
62 count = 0; | 73 count = 0; |
63 } | 74 } |