public Tick getAvailTickThread(Tickable E, long TICK_TIME, int tickID) { Tick tock = null; Tick almostTock = null; ThreadGroup grp = null; char threadGroupNum = Thread.currentThread().getThreadGroup().getName().charAt(0); for (Iterator<Tick> e = tickGroups(); e.hasNext(); ) { almostTock = e.next(); if (almostTock != null) { if (almostTock.contains(E, tickID)) return null; if ((tock == null) && (almostTock.TICK_TIME == TICK_TIME) && (!almostTock.solitaryTicker) && (almostTock.numTickers() < TickableGroup.MAX_TICK_CLIENTS)) { grp = almostTock.getThreadGroup(); if ((grp != null) && (grp.getName().charAt(0) == threadGroupNum)) { tock = almostTock; } } } } if (tock != null) return tock; tock = new Tick(TICK_TIME); addTickGroup(tock); return tock; }