/** * Constructs a {@code PropertySet} instance. Its * primary task is to initialize the field with their proper values. * It also sets fields that might change to reasonable defaults. */ public PropertySet() { /* Initialize the "byteOrder" field. */ byteOrder = BYTE_ORDER_ASSERTION; /* Initialize the "format" field. */ format = FORMAT_ASSERTION; /* Initialize "osVersion" field as if the property has been created on * a Win32 platform, whether this is the case or not. */ osVersion = (OS_WIN32 << 16) | 0x0A04; /* Initialize the "classID" field. */ classID = new ClassID(); /* Initialize the sections. Since property set must have at least * one section it is added right here. */ addSection(new Section()); }
/** * Creates section 2 if it is not already present. */ private void ensureSection2() { if (getSectionCount() < 2) { Section s2 = new Section(); s2.setFormatID(USER_DEFINED_PROPERTIES); addSection(s2); } }
/** * Constructs a {@code PropertySet} by doing a deep copy of * an existing {@code PropertySet}. All nested elements, i.e. * {@code Section}s and {@code Property} instances, will be their * counterparts in the new {@code PropertySet}. * * @param ps The property set to copy */ public PropertySet(PropertySet ps) { setByteOrder(ps.getByteOrder()); setFormat(ps.getFormat()); setOSVersion(ps.getOSVersion()); setClassID(ps.getClassID()); for (final Section section : ps.getSections()) { sections.add(new Section(section)); } }
final Section s = new Section(src, o); o += ClassID.LENGTH + LittleEndianConsts.INT_SIZE; sections.add(s);
public void addElement(Section addValue) { Section sec = new Section(); // TODO copy fields daten.add(sec); fireTableRowsInserted(daten.size() - 1, daten.size() - 1); }
function Section() { this.children = []; } var section = new Section(); section.children.push(section);
new Section("Contact Info") { new StringElement("ID", ViewModel.Customer.ID ?? string.Empty), new EntryElement("Name", "Name").Bind(this, "{'Value':{'Path':'Customer.Name'}}"), new EntryElement("Website", "Website").Bind(this, "{'Value':{'Path':'Customer.Website'}}"), new EntryElement("Primary Phone", "Phone").Bind(this, "{'Value':{'Path':'Customer.PrimaryPhone'}}"), }, new Section("Primary Address") { new EntryElement("Address").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.Street1'}}"), new EntryElement("Address2").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.Street2'}}"), new EntryElement("City").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.City'}}"), new EntryElement("State").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.State'}}"), new EntryElement("Zip").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.Zip'}}"), },
function MainSection() { var self = this; self.selectedSection = ko.observable(); self.sections = ko.observableArray( [ new Section("Some Data"), new Section("Some Data"), new Section("Some Data"), new Section("Some Data"), new Section("Some Data"), new Section("Some Data") ]); self.selectSection = function(item) { //where item is a Section self.selectedSection(item); //passed from the click binding }; }
List<Section> sections = new ArrayList<Section>(); String temp = null; String line = null; int lineNumber = 0; while ((line = br.readLine()) != null) { lineNumber++; if (lineNumber % 2 == 0) { // Section Text sections.add(new Section(temp, line); } else { // Section Name temp = line; } }
function Section(id, name) { this.id = id; this.name = name; } Section.prototype.showSectionName = function () { alert("You clicked '" + this.name + "'"); } function ViewModel() { var self = this; self.sections = ko.observableArray([ new Section(1, "Section 1"), new Section(2, "Section 2"), new Section(3, "Section 3") ]); } $(function () { ko.applyBindings(new ViewModel()); });
JSONArray ja = new JSONArray(jsonStringReturnedByService); Data sections = new Data(); for (int i = 0; i < ja.length(); i++) { Section s = new Section(); JSONObject jsonSection = ja.getJSONObject(i); s.SectionId = Integer.ValueOf(jsonSection.getString("SectionId")); s.SectionName = jsonSection.getString("SectionName"); //add it to sections list sections.add(s); } return sections;
function Section () { this.Chapters = new Array( 10 ); } function CreateSection () { var sections = new Array ( 10 ); sections[0] = new Section (); sections[0].Chapters[0] = "dogs"; alert ( sections[0].Chapters[0] ); }
ArrayList<Section> aMainSection = new ArrayList<Section>(); int sectionsCount = 3; for (int i=1; i<=sectionsCount; i++) { Section aSection = new Section(); aSection.setName("Document " + i); aSection.setSection("Section " + i); aSection.setText("Text " + i); aMainSection.add(aSection); }
ArrayList<Section> aMainSection = new ArrayList<Section>(); for(int i = 0; i < 3; i++) { Section aSection = new Section(); aSection.setName("Document "+(i+1)); aSection.setSection("Section "+(i+1)); aSection.setText("Text "+(i+1)); aMainSection.Add(aSection); }
ArrayList<Section> aMainSection = new ArrayList<Section>(); int sectionNumber = 1; boolean done = false; while(!done) { Section aSection = new Section(); aSection.setName("Document "+ sectionNumber); aSection.setSection("Section "+ sectionNumber); aSection.setText("Text "+ sectionNumber); aMainSection.Add(aSection); sectionNumber++; done = <put something interesting here> }
/** * Constructs a {@code PropertySet} instance. Its * primary task is to initialize the field with their proper values. * It also sets fields that might change to reasonable defaults. */ public PropertySet() { /* Initialize the "byteOrder" field. */ byteOrder = BYTE_ORDER_ASSERTION; /* Initialize the "format" field. */ format = FORMAT_ASSERTION; /* Initialize "osVersion" field as if the property has been created on * a Win32 platform, whether this is the case or not. */ osVersion = (OS_WIN32 << 16) | 0x0A04; /* Initialize the "classID" field. */ classID = new ClassID(); /* Initialize the sections. Since property set must have at least * one section it is added right here. */ addSection(new Section()); }
/** * Creates section 2 if it is not already present. */ private void ensureSection2() { if (getSectionCount() < 2) { Section s2 = new Section(); s2.setFormatID(USER_DEFINED_PROPERTIES); addSection(s2); } }
for (int i=1; i<4; ++i) { Section aSection = new Section(); aSection.setName("Document " + i); aSection.setSection("Section " +i ); aSection.setText("Text " +i); }
Section section = new Section(); RootElement data = new RootElement("data"); // Use "requireChild" if a "section" is required as a child of "data". Element s = data.getChild("section"); s.setStartElementListener(section); s.setEndTextElementListener(section); try { Xml.parse(xml, data.getContentHandler()); } catch (SAXException e) { }
/** * Constructs a {@code PropertySet} by doing a deep copy of * an existing {@code PropertySet}. All nested elements, i.e. * {@code Section}s and {@code Property} instances, will be their * counterparts in the new {@code PropertySet}. * * @param ps The property set to copy */ public PropertySet(PropertySet ps) { setByteOrder(ps.getByteOrder()); setFormat(ps.getFormat()); setOSVersion(ps.getOSVersion()); setClassID(ps.getClassID()); for (final Section section : ps.getSections()) { sections.add(new Section(section)); } }