Mercurial > jhg
diff 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 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/IntVector.java Fri Feb 15 16:48:54 2013 +0100 +++ b/src/org/tmatesoft/hg/internal/IntVector.java Fri Feb 15 22:15:13 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 TMate Software Ltd + * Copyright (c) 2011-2013 TMate Software Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,10 +54,21 @@ return data[i]; } + public void set(int i, int v) { + if (i < 0 || i >= count) { + throw new IndexOutOfBoundsException(String.format("Index: %d, size: %d", i, count)); + } + data[i] = v; + } + public int size() { return count; } + public boolean isEmpty() { + return count == 0; + } + public void clear() { count = 0; }