/** * Get the associated object for a row. * @param rowcnt The row ccount. * @return The object. */ public synchronized Object getObjectForRow(int rowcnt) { //System.out.println("All: "+rowcnt+data+" --- "+data.get(rowcnt)); return ((Tuple)data.get(rowcnt)).get(1); }
public void report(String msg, String type, Object info, ILocation location) throws Exception { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)AReader.READ_CONTEXT.get(); Map user = (Map)context.getUserContext(); MultiCollection<Tuple, String> report = (MultiCollection<Tuple, String>)user.get(CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.add(stack, msg+pos); } });
public void report(String msg, String type, Object info, ILocation location) throws Exception { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)AReader.READ_CONTEXT.get(); Map user = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)user.get(CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.put(stack, msg+pos); } });
/** * Get the value from a field. * @param row The row index. * @param column The column index. * @return The value. */ public synchronized Object getValueAt(int row, int column) { return ((ArrayList)((Tuple)data.get(row)).get(0)).get(column); } }
public void report(String msg, String type, Object info, ILocation location) throws XMLStreamException { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)(info instanceof IContext ? info : AReader.READ_CONTEXT.get()); Tuple stack = new Tuple(info instanceof StackElement[] ? (StackElement[])info : ((AReadContext)context).getStack()); Map user = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)user.get(CONTEXT_ENTRIES); String pos; if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.put(stack, msg+pos); } });
/** * returns an array with roundNumbers, either of an player * or of the dealer */ public int[] getXArray(Player player) { int[] retArray; List coors = (List)playerModels.getCollection(player); retArray = new int[coors.size()]; for (int i=0; i < coors.size(); i++) { Tuple dummy = (Tuple)coors.get(i); retArray[i] = ((Integer)dummy.get(0)).intValue(); } return retArray; }
public void report(String msg, String type, Object info, ILocation location) throws XMLStreamException { // System.out.println("XML error: "+msg+", "+type+", "+info+", "+location); // Thread.dumpStack(); IContext context = (IContext)(info instanceof IContext ? info : AReader.READ_CONTEXT.get()); Tuple stack = new Tuple(info instanceof StackElement[] ? (StackElement[])info : ((AReadContext)context).getStack()); Map user = (Map)context.getUserContext(); MultiCollection<Tuple, String> report = (MultiCollection<Tuple, String>)user.get(CONTEXT_ENTRIES); String pos; if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.add(stack, msg+pos); } });
/** * returns an array with account-stati, either of an player * or of the dealer */ public int[] getYArray(Player player) { int[] retArray; List coors = (List)playerModels.getCollection(player); retArray = new int[coors.size()]; for (int i=0; i < coors.size(); i++) { Tuple dummy = (Tuple)coors.get(i); retArray[i] = ((Integer)dummy.get(1)).intValue(); } return retArray; }
/** * Report an error including the line and column. */ protected static void reportError(IContext context, String error) { Map user = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)user.get(ComponentXMLReader.CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.add(stack, error+pos); }
/** * Remove a row from the model. * @param object The associated object. */ public synchronized void removeRow(Object object) { for(int i=0; i<getRowCount() && object!=null; i++) { if(object.equals(((Tuple)data.get(i)).get(1))) { data.remove(i); fireTableRowsDeleted(i, i); } } }
/** * Report an error including the line and column. */ protected static void reportError(IContext context, String error) { Map ouc = (Map)context.getUserContext(); MultiCollection report = (MultiCollection)ouc.get(ComponentXMLReader.CONTEXT_ENTRIES); String pos; Tuple stack = new Tuple(((AReadContext)context).getStack()); if(stack.getEntities().length>0) { StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")"; } else { pos = " (line 0, column 0)"; } report.put(stack, error+pos); }
int val = ((Integer)tup.get(1)).intValue();
if(stack.getEntities().length>0) StackElement se = (StackElement)stack.get(stack.getEntities().length-1); pos = " (line "+se.getLocation().getLineNumber()+", column "+se.getLocation().getColumnNumber()+")";