[System.Web.Services.WebMethod] public static object testmethod(string serial) { ItemList itemlist = new ItemList(); itemlist.Item = "Testing"; return itemList; }
var vm = new ItemList(); ko.applyBindings(vm); vm.load();
public ItemList sublist(int start) { if ( _size() < start+offset ) return null ; ItemList x = new ItemList(noLine, noColumn, offset+start, elements) ; return x ; }
public ItemList sublist(int start) { if ( _size() < start+offset ) return null ; ItemList x = new ItemList(noLine, noColumn, offset+start, elements) ; return x ; }
public static Item createList(int line, int column) { Item item = new Item(line, column) ; item.list = new ItemList(line, column) ; return item ; }
public static Item createList(int line, int column) { Item item = new Item(line, column) ; item.list = new ItemList(line, column) ; return item ; }
/** Slice of the list from start (inclusive) to finish (exclusive) */ public ItemList sublist(int start, int finish) { if ( start < 0 || finish < 0 || finish < start ) return null ; if ( _size() < start ) return null ; if ( finish > _size() ) return null ; ItemList x = new ItemList() ; // Take a slice. // Note : this is a copy. // Note: List.subList just puts a wrapper around the overlying list // but don't do this a lot because ArrayList.get recurses to the core list (may run out of stack). // Better would an adjusting slice over base array but it's quite tricky to do the calculations correctly. // This way is mnore likely to be correct. x.elements.addAll(elements.subList(start+offset, finish+offset)) ; return x ; }
/** Slice of the list from start (inclusive) to finish (exclusive) */ public ItemList sublist(int start, int finish) { if ( start < 0 || finish < 0 || finish < start ) return null ; if ( _size() < start ) return null ; if ( finish > _size() ) return null ; ItemList x = new ItemList() ; // Take a slice. // Note : this is a copy. // Note: List.subList just puts a wrapper around the overlying list // but don't do this a lot because ArrayList.get recurses to the core list (may run out of stack). // Better would an adjusting slice over base array but it's quite tricky to do the calculations correctly. // This way is mnore likely to be correct. x.elements.addAll(elements.subList(start+offset, finish+offset)) ; return x ; }
itemList = new ItemList();
public ItemList cdrOrNull() { if ( _size() == 0 ) return null ; ItemList x = new ItemList(super.getLine(), super.getColumn(), offset+1, elements) ; return x ; }
public void listStart(int line, int column) { ItemList list = new ItemList(line, column) ; pushList(list) ; setCurrentItem(Item.createList(list)) ; }
public ItemList cdrOrNull() { if ( _size() == 0 ) return null ; ItemList x = new ItemList(super.getLine(), super.getColumn(), offset+1, elements) ; return x ; }
@Override public void listStart(int line, int column) { ItemList list = new ItemList(line, column) ; pushList(list) ; setCurrentItem(Item.createList(list)) ; }
ItemList unique = new ItemList(); String query="Select id,name from item"; ResultSet rs = d.sendQuery(query);
public ItemList cdr() { if ( _size() == 0 ) throw new ItemException("ItemList.cdr: list is zero length") ; ItemList x = new ItemList(super.getLine(), super.getColumn(), offset+1, elements) ; return x ; }
public ItemList cdr() { if ( _size() == 0 ) throw new ItemException("ItemList.cdr: list is zero length") ; ItemList x = new ItemList(super.getLine(), super.getColumn(), offset+1, elements) ; return x ; }
ObjectMapper mapper = new ObjectMapper(); ObjectWriter writer = mapper.writer(); Item item1 = new Item(); item1.setFoo(1); Item item2 = new Item(); item2.setFoo(2); ItemList itemList = new ItemList(); itemList.add(item1); itemList.add(item2); String json = writer .with(SerializationFeature.WRAP_ROOT_VALUE) .writeValueAsString(itemList); // json contains {"item":[{"foo":1},{"foo":2}]}
public void visit(Item item, ItemList list) { ItemList newList = new ItemList(item.getLine(), item.getColumn()) ; for ( Item subItem : list ) { subItem.visit(this) ; Item newItem = pop(); newList.add(newItem) ; } Item newItemList = Item.createList(newList, item.getLine(), item.getColumn()) ; push(newItemList) ; }
@Override public void visit(Item item, ItemList list) { ItemList newList = new ItemList(item.getLine(), item.getColumn()) ; for ( Item subItem : list ) { subItem.visit(this) ; Item newItem = pop(); newList.add(newItem) ; } Item newItemList = Item.createList(newList, item.getLine(), item.getColumn()) ; push(newItemList) ; }
private Op compileElementFetch(ElementFetch elt) { Node serviceNode = elt.getFetchNode() ; // Probe to see if enabled. OpExtBuilder builder = OpExtRegistry.builder("fetch") ; if ( builder == null ) { Log.warn(this, "Attempt to use OpFetch - need to enable first with a call to OpFetch.enable()") ; return OpLabel.create("fetch/"+serviceNode, OpTable.unit()) ; } Item item = Item.createNode(elt.getFetchNode()) ; ItemList args = new ItemList() ; args.add(item) ; return builder.make(args) ; }