Commit Graph

2755 Commits

Author SHA1 Message Date
samskivert c9a12f1b3e Eliminate check for impossible nullness.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2715 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-02-09 20:21:55 +00:00
samskivert d25492df43 Break not if getSourceClassName() is null.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2714 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-02-09 20:20:07 +00:00
samskivert c7e16e52b3 Correct and easier to read.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2713 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-02-09 20:14:44 +00:00
samskivert 09d98be8d7 Avoid NPE.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2712 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-02-09 20:13:01 +00:00
samskivert 3a0f8e3fc2 Less wacky.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2711 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-02-09 20:11:43 +00:00
ray.j.greenwell 9b602fd73e This inferCaller() isn't used, but let's at least format it with spaces instead of tabs.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2710 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-27 21:42:23 +00:00
ray.j.greenwell 2d0625ee75 A sample usage of @ReplacedBy.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2709 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-21 00:52:54 +00:00
ray.j.greenwell 28b9755e3b Ye olde experiment.
I am starting to prefer things in the guava library when there are
equivalents. I've been wondering what we want to do about informing
people about the changes. Something more interesting will happen,
because I want a place to put useful bits of code built atop guava,
and that's not samskivert, at least not now.

So anyway, here's a lighter-weight @Deprecated sorta annotation.
It can be used to indicate methods that have a replacement in guava
(or new stuff in the standard java libraries). It will show up
in the javadocs. Let's see how it looks.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2708 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-21 00:52:21 +00:00
ray.j.greenwell b09afabba8 Formatting, annotations, and other pedantry from Dave Hoover.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2707 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-18 21:59:57 +00:00
ray.j.greenwell 0534e40a60 Correctly return the new count from add().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2706 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-18 21:56:20 +00:00
ray.j.greenwell efad5d31f6 Same speed, but create our Entry instead of the int[].
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2705 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-18 09:56:06 +00:00
ray.j.greenwell c48106695a Ok, Charlie Groves has done a good job convincing me I'm crazy, but I'll
check this in anyway, at least for posterity.

The advantages over the 'CountingMap' (currently in yohoho):
- Faster, because adding to a count doesn't add to a boxed int, nor does
  it hash twice (except on the intial use of a particular key).

The disadvantages:
- More complicated implementation (CountingMap builds upon google
  collections)
- If a non-HashMap is desired, the fact that the underlying map is
  <K, int[]> is exposed.
- When iterating over the entrySet, each entry is a new object
  created solely for your iteration.

So.. yeah. I'll check it in. Maybe I'll blow it away. We should
probably think about how samskivert will move forward- do we want to
depend on google-collect or guava? Do we want to deprecate huge
swaths of this library in preference to those? A lot of what's
in here is a bit outdated, but maintained to support code built
atop it.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2704 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-16 03:00:23 +00:00
ray.j.greenwell 74d5d82704 Buh-bye.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2703 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-15 01:49:15 +00:00
ray.j.greenwell 2a6397ddcb I'm just going to commit these for posterity, but I'll remove them.
Hell, maybe I should remove IntSets.java too.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2702 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-15 01:48:57 +00:00
ray.j.greenwell e0e2f1cf7d AbstractCollection's isEmpty() calls size(). We can often do better:
- Provide an implementation in AbstractIntSet that checks the interator
  for at least one element.
- Override that in ArrayIntSet so that we're just checking our size again.
- Added optimized isEmpty()s for a few of the inner classes in IntSets.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2701 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-14 21:25:52 +00:00
ray.j.greenwell 8f24b4a8b8 Nix redundant cast.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2700 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-13 18:57:22 +00:00
ray.j.greenwell f731c7b406 Nix redundant cast.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2699 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-13 18:53:15 +00:00
ray.j.greenwell 05d562387c Added getProbability(), from Dave Hoover.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2698 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-13 18:34:15 +00:00
ray.j.greenwell eecca9d71b Dur, and now that we don't need the @SuppressWarnings, we don't
need the temporary variable to which it was applied.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2697 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-13 17:53:34 +00:00
ray.j.greenwell 959e953f99 Covariant return types for the win.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2696 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-13 17:50:13 +00:00
ray.j.greenwell 5bf7699dd4 Missed a spot.
Oh baby, look at the @SuppressWarnings and cast removal.
It's all itchy, flakey, and pale under the cast!


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2695 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-13 17:49:25 +00:00
ray.j.greenwell de860c5602 Now that this library is JDK 1.5, let's return the true type from clone().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2694 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-13 17:44:50 +00:00
samskivert 7480bb2e6c We should be toString-ing right into our StringBuilder and using the specified
open and close boxes for the internal elements of our sequences.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2693 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-11 05:19:38 +00:00
ray.j.greenwell 818e108f99 Nix import.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2692 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-08 22:05:22 +00:00
ray.j.greenwell d2464d9feb JDK 1.5 compatibility.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2691 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-08 22:04:02 +00:00
ray.j.greenwell 503d57d7de I've been messing with IntSets. I won't check in my more esoteric classes
(RangeIntSet, CompleteIntSet & ClumpyArrayIntSet (which both are capable
of holding every int, and not maxing out at Integer.MAX_VALUE size)).
But here's a bunch of useful stuff all wrapped up nicely.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2690 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-08 18:52:36 +00:00
ray.j.greenwell 61609ffcd5 Be more efficient if constructed with an Interable.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2689 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-08 18:47:28 +00:00
ray.j.greenwell 32d01f5651 Broke-out the notification that we've been posted to a shutdown RunQueue
into a method, so that it can be suppressed, etc.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2688 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-06 20:16:52 +00:00
ray.j.greenwell 838d725bb6 Sorry, Pär, you get slurped up into "et al." like me.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2687 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-06 01:01:03 +00:00
ray.j.greenwell ff9798927c Updated copyright dates, and holder. :)
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2686 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-06 00:53:25 +00:00
ray.j.greenwell f57af39108 Drop unneeded import.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2685 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-06 00:31:57 +00:00
ray.j.greenwell 42c7ea0009 This should be more efficient, right?
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2684 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-06 00:31:36 +00:00
ray.j.greenwell ee8f1aab7e Hey, samskivert requires 1.5 now, so let's label our Timer thread.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2683 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-06 00:28:11 +00:00
ray.j.greenwell 99a46d1613 Spell the package name correctly.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2682 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-05 19:02:21 +00:00
ray.j.greenwell 5282228ee9 Move Mapping all the way up to samskivert.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2681 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-01-05 00:56:19 +00:00
ray.j.greenwell 1a56333166 Nixed unneeded @SuppressWarnings, from Jamie Doornbos.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2680 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-14 19:27:20 +00:00
ray.j.greenwell deb50bc136 - Behave better at large sizes.
- Don't wig-out trying to grow from a size larger
    than half of Integer.MAX_VALUE.
  - Don't try to add any values once size reaches Integer.MAX_VALUE.
- Fixed the Interator's remove() to behave properly should it be
  called improperly.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2679 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-11 23:39:53 +00:00
ray.j.greenwell 791121ff37 I picked the wrong week to stop sniffing glue.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2678 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-10 22:33:45 +00:00
ray.j.greenwell 84c6cce89a Make get(), containsKey(), and remove() tolerant of non-Integer objects.
Our IntSets now do this, including the keySet returned by this class.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2677 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-10 20:18:17 +00:00
ray.j.greenwell 2d20fd3454 For debugging, an Interval's toString() should be informative.
The RunBuddy posted to a RunQueue will call its Interval's
toString() method. If an Interval is created with a Runnable,
let's call the Runnable's toString().
We could also add a form of create() that takes a String for the name...


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2676 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-10 19:58:35 +00:00
ray.j.greenwell 6819b85c66 I was a bit overzealous in my import removal.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2675 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-08 20:03:18 +00:00
ray.j.greenwell a6d64b1605 Fuckit. Executor all the way.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2674 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-08 19:57:52 +00:00
ray.j.greenwell 2c04b41b66 More Executor preferring.
Maybe I'm just crazy.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2673 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-08 19:04:49 +00:00
ray.j.greenwell 44c1d15c4b Added an Executor adapter class to RunQueue...
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2672 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-08 19:02:32 +00:00
ray.j.greenwell 7fb3c3354c Well, it's called "SerialExecutor", it would be a shame not to implement
the Executor interface.
- Also accept our "receiver" as an Executor, deprecating the old RunQueue
  constructor.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2671 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-07 21:23:18 +00:00
ray.j.greenwell 50862df9c3 Implement java.util.concurrent.Executor.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2670 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-07 21:18:52 +00:00
ray.j.greenwell 197c6fbbf8 Modernization from Dave Hoover.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2669 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-05 01:52:48 +00:00
ray.j.greenwell 6ca4287fb8 Some happiness for Eclipse, apparently, from Dave Hoover.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2668 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-05 01:52:26 +00:00
ray.j.greenwell a600bcae9c Slap on the old @Override; caught by David "David Hoover" Hoover.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2667 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-05 01:23:52 +00:00
ray.j.greenwell 09dbc956e5 Damn.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2666 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2009-12-05 00:00:32 +00:00