text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>lib/yui3/src/app/js/model-list.js - AlloyUI</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.4.0/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/../../build/aui-skin-classic/css/aui-skin-classic-all-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">

                AlloyUI 1.7.0

                    YUI 3.7.3

APIs

Classes

Modules

Everything

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

A.DataType.DateMath

A.HTML5

A.io

A.Node

A.NodeList

A.Plugin.IO

Anim

App

App.Base

App.Content

App.Transitions

App.TransitionsNative

AreaSeries

AreaSplineSeries

Array

ArrayList

ArraySort

AsyncQueue

Attribute

AttributeCore

AttributeEvents

AttributeExtras

AttributeLite

AUI~event~input

AutoComplete

AutoCompleteBase

AutoCompleteFilters

AutoCompleteHighlighters

AutoCompleteList

Axis

AxisType

BarSeries

Base

BaseCellEditor

BaseCore

BaseOptionsCellEditor

BottomAxisLayout

Button

ButtonCore

ButtonGroup

ButtonItem

ButtonPlugin

Cache

CacheOffline

Calendar

CalendarBase

CanvasCircle

CanvasDrawing

CanvasEllipse

CanvasGraphic

CanvasPath

CanvasPieSlice

CanvasRect

CanvasShape

Carousel

CartesianChart

CartesianSeries

CategoryAxis

CellEditorSupport

CharCounter

Chart

ChartBase

ChartLegend

CheckboxCellEditor

Circle

CircleGroup

ClassNameManager

ClickableRail

ColorPicker

ColumnSeries

ComboSeries

ComboSplineSeries

Component

config

Console

Controller

Cookie

CurveUtil

CustomEvent

DataSchema.Array

DataSchema.Base

DataSchema.JSON

DataSchema.Text

DataSchema.XML

DataSource.Function

DataSource.Get

DataSource.IO

DataSource.Local

DataSourceArraySchema

DataSourceCache

DataSourceCacheExtension

DataSourceJSONSchema

DataSourceTextSchema

DataSourceXMLSchema

DataTable

DataTable.Base

DataTable.BodyView

DataTable.ColumnWidths

DataTable.Core

DataTable.HeaderView

DataTable.Message

DataTable.Mutable

DataTable.Scrollable

DataTable.Sortable

DataTable.TableView

DataType.Boolean

DataType.Date.Locale

DataType.String

Date

DateCellEditor

DatepickerManager

DatePickerSelect

DD.DDM

DD.Delegate

DD.Drag

DD.Drop

DD.Scroll

DelayedTask

Dial

Dialog

DialogManager

DialogMask

Do

Do.AlterArgs

Do.AlterReturn

Do.Error

Do.Halt

Do.Method

Do.Prevent

DOM

DOMEventFacade

Drawing

DropDownCellEditor

Easing

Editable

EditorBase

EditorSelection

Ellipse

EllipseGroup

Escape

Event

EventFacade

EventHandle

EventTarget

ExecCommand

Features

File

FileFlash

FileHTML5

Fills

Frame

Get

Get.Transaction

GetNodeJS

Graph

Graphic

GraphicBase

Gridlines

GroupDiamond

GroupRect

Handlebars

Highlight

Histogram

HistoryBase

HistoryHash

HistoryHTML5

HorizontalLegendLayout

ImageGallery

ImageViewer

ImageViewerMask

ImgLoadGroup

ImgLoadImgObj

Intl

IO

IORequest

JSON

JSONPRequest

Lang

LazyModelList

LeftAxisLayout

Lines

LineSeries

LiveSearch

Loader

LoadingMask

MarkerSeries

Matrix

MatrixUtil

Model

ModelList

ModelSync.REST

NestedList

Node

NodeList

Number

NumericAxis

Object

Overlay

OverlayBase

OverlayContext

OverlayContextManager

OverlayContextPanel

OverlayContextPanelManager

OverlayManager

OverlayMask

Paginator

Panel

Parallel

ParseContent

Path

PieChart

PieSeries

Pjax

PjaxBase

PjaxContent

Plots

Plugin.Align

Plugin.AutoComplete

Plugin.Base

Plugin.Cache

Plugin.CalendarNavigator

Plugin.ConsoleFilters

Plugin.CreateLinkBase

Plugin.DataTableDataSource

Plugin.DDConstrained

Plugin.DDNodeScroll

Plugin.DDProxy

Plugin.DDWindowScroll

Plugin.Drag

Plugin.Drop

Plugin.EditorBidi

Plugin.EditorBR

Plugin.EditorLists

Plugin.EditorPara

Plugin.EditorParaBase

Plugin.EditorParaIE

Plugin.EditorTab

Plugin.ExecCommand

Plugin.Flick

Plugin.Host

plugin.NodeFocusManager

Plugin.NodeFX

plugin.NodeMenuNav

Plugin.Pjax

Plugin.Resize

Plugin.ResizeConstrained

Plugin.ResizeProxy

Plugin.ScrollInfo

Plugin.ScrollViewList

Plugin.ScrollViewPaginator

Plugin.ScrollViewScrollbars

Plugin.Shim

Plugin.SortScroll

Plugin.WidgetAnim

Pollable

PortalLayout

Profiler

ProgressBar

QueryString

Queue

RadioCellEditor

Rating

Record

Recordset

RecordsetFilter

RecordsetIndexer

RecordsetSort

Rect

Renderer

Resize

RightAxisLayout

Router

ScrollView

Selector

Shape

ShapeGroup

Slider

SliderBase

SliderValueRange

Sortable

SplineSeries

StackedAreaSeries

StackedAreaSplineSeries

StackedAxis

StackedBarSeries

StackedColumnSeries

StackedComboSeries

StackedComboSplineSeries

StackedLineSeries

StackedMarkerSeries

StackedSplineSeries

StackingUtil

State

StyleSheet

Subscriber

SVGCircle

SVGDrawing

SVGEllipse

SVGGraphic

SVGPath

SVGPieSlice

SVGRect

SVGShape

SWF

SWFDetect

SyntheticEvent

SyntheticEvent.Notifier

SynthRegistry

Tab

TabView

Test.ArrayAssert

Test.Assert

Test.AssertionError

Test.ComparisonFailure

Test.Console

Test.CoverageFormat

Test.DateAssert

Test.EventTarget

Test.Mock

Test.Mock.Value

Test.ObjectAssert

Test.Reporter

Test.Results

Test.Runner

Test.ShouldError

Test.ShouldFail

Test.TestCase

Test.TestFormat

Test.TestNode

Test.TestRunner

Test.TestSuite

Test.UnexpectedError

Test.UnexpectedValue

Test.Wait

Text.AccentFold

Text.WordBreak

TextAreaCellEditor

Textboxlist

TextCellEditor

ThumbRating

TimeAxis

ToggleButton

Toolbar

Tooltip

TopAxisLayout

Transition

TreeData

TreeNode

TreeNodeCheck

TreeNodeIO

TreeNodeRadio

TreeNodeTask

TreeView

TreeViewDD

UA

Uploader

Uploader.Queue

UploaderFlash

UploaderHTML5

ValueChange

VerticalLegendLayout

View

View.NodeMap

VMLCircle

VMLDrawing

VMLEllipse

VMLGraphic

VMLPath

VMLPieSlice

VMLRect

VMLShape

Widget

WidgetAutohide

WidgetButtons

WidgetChild

WidgetModality

WidgetParent

WidgetPosition

WidgetPositionAlign

WidgetPositionConstrain

WidgetStack

WidgetStdMod

XML

YQL

YQLRequest

YUI

YUI~substitute

align-plugin

anim

anim-base

anim-color

anim-curve

anim-easing

anim-node-plugin

anim-scroll

anim-shape

anim-shape-transform

anim-xy

app

app-base

app-content

app-transitions

app-transitions-native

array-extras

array-invoke

arraylist

arraylist-add

arraylist-filter

arraysort

async-queue

attribute

attribute-base

attribute-complex

attribute-core

attribute-events

attribute-extras

aui-autocomplete

aui-button-item

aui-calendar

aui-calendar-base

aui-calendar-datepicker-select

aui-carousel

aui-char-counter

aui-color-picker

aui-component

aui-datatype

aui-delayed-task

aui-dialog

aui-editable

aui-event

aui-event-input

aui-image-viewer

aui-image-viewer-base

aui-image-viewer-gallery

aui-io

aui-io-plugin

aui-io-request

aui-live-search

aui-loading-mask

aui-media-viewer-plugin

aui-nested-list

aui-node

aui-node-base

aui-node-html5

aui-overlay

aui-overlay-base

aui-overlay-context

aui-overlay-context-panel

aui-overlay-manager

aui-overlay-mask

aui-paginator

aui-panel

aui-parse-content

aui-portal-layout

aui-progressbar

aui-rating

aui-resize

aui-text

aui-textboxlist

aui-toolbar

aui-tooltip

aui-tree

aui-tree-data

aui-tree-node

aui-tree-view

autocomplete

autocomplete-base

autocomplete-filters

autocomplete-filters-accentfold

autocomplete-highlighters

autocomplete-highlighters-accentfold

autocomplete-list

autocomplete-list-keys

autocomplete-plugin

autocomplete-sources

base

base-base

base-build

base-core

base-pluginhost

button

button-core

button-group

button-plugin

cache

cache-base

cache-offline

cache-plugin

calendar

calendar-base

calendarnavigator

charts

charts-base

charts-legend

classnamemanager

clickable-rail

collection

console

console-filters

cookie

createlink-base

dataschema

dataschema-array

dataschema-base

dataschema-json

dataschema-text

dataschema-xml

datasource

datasource-arrayschema

datasource-cache

datasource-function

datasource-get

datasource-io

datasource-jsonschema

datasource-local

datasource-polling

datasource-textschema

datasource-xmlschema

datatable

datatable-base

datatable-base-deprecated

datatable-body

datatable-column-widths

datatable-core

datatable-datasource

datatable-datasource-deprecated

datatable-deprecated

datatable-head

datatable-message

datatable-mutable

datatable-scroll

datatable-scroll-deprecated

datatable-sort

datatable-sort-deprecated

datatable-table

datatype

datatype-date

datatype-date-format

datatype-date-math

datatype-date-parse

datatype-number

datatype-number-format

datatype-number-parse

datatype-xml

datatype-xml-format

datatype-xml-parse

dd

dd-constrain

dd-ddm

dd-ddm-base

dd-ddm-drop

dd-delegate

dd-drag

dd-drop

dd-drop-plugin

dd-gestures

dd-plugin

dd-proxy

dd-scroll

dial

dom

dom-base

dom-screen

dom-style

dump

editor

editor-base

editor-bidi

editor-br

editor-lists

editor-para

editor-para-base

editor-para-ie

editor-tab

escape

event

event-base

event-contextmenu

event-custom

event-custom-base

event-custom-complex

event-delegate

event-flick

event-focus

event-gestures

event-hover

event-key

event-mouseenter

event-mousewheel

event-move

event-outside

event-resize

event-simulate

event-synthetic

event-tap

event-touch

event-valuechange

exec-command

features

file

file-flash

file-html5

frame

gesture-simulate

get

get-nodejs

graphics

handlebars

handlebars-base

handlebars-compiler

highlight

highlight-accentfold

highlight-base

history

history-base

history-hash

history-hash-ie

history-html5

imageloader

intl

io

io-base

io-form

io-nodejs

io-queue

io-upload-iframe

io-xdr

json

json-parse

json-stringify

jsonp

jsonp-url

lazy-model-list

loader

loader-base

matrix

model

model-list

model-sync-rest

node

node-base

node-core

node-data

node-deprecated

node-event-delegate

node-event-html5

node-event-simulate

node-flick

node-focusmanager

node-load

node-menunav

node-pluginhost

node-screen

node-scroll-info

node-style

oop

overlay

panel

parallel

pjax

pjax-base

pjax-content

pjax-plugin

plugin

pluginhost

pluginhost-base

pluginhost-config

profiler

querystring

querystring-parse

querystring-parse-simple

querystring-stringify

querystring-stringify-simple

queue-promote

range-slider

recordset

recordset-base

recordset-filter

recordset-indexer

recordset-sort

resize

resize-contrain

resize-plugin

resize-proxy

rollup

router

scrollview

scrollview-base

scrollview-base-ie

scrollview-list

scrollview-paginator

scrollview-scrollbars

selection

selector-css2

selector-css3

selector-native

shim-plugin

slider

slider-base

slider-value-range

sortable

sortable-scroll

stylesheet

substitute

swf

swfdetect

tabview

test

test-console

text

text-accentfold

text-wordbreak

transition

transition-timer

uploader

uploader-deprecated

uploader-flash

uploader-html5

uploader-queue

view

view-node-map

widget

widget-anim

widget-autohide

widget-base

widget-base-ie

widget-buttons

widget-child

widget-htmlparser

widget-locale

widget-modality

widget-parent

widget-position

widget-position-align

widget-position-constrain

widget-skin

widget-stack

widget-stdmod

widget-uievents

yql

yql-nodejs

yql-winjs

yui

yui-base

yui-later

yui-log

yui-throttle

yui3

Begin typing in the search box above to see results.

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

File: lib/yui3/src/app/js/model-list.js

/**
Provides an API for managing an ordered list of Model instances.

@module app
@submodule model-list
@since 3.4.0
**/

/**
Provides an API for managing an ordered list of Model instances.

In addition to providing convenient `add`, `create`, `reset`, and `remove`
methods for managing the models in the list, ModelLists are also bubble targets
for events on the model instances they contain. This means, for example, that
you can add several models to a list, and then subscribe to the `*:change` event
on the list to be notified whenever any model in the list changes.

ModelLists also maintain sort order efficiently as models are added and removed,
based on a custom `comparator` function you may define (if no comparator is
defined, models are sorted in insertion order).

@class ModelList
@extends Base
@uses ArrayList
@constructor
@param {Object} config Config options.
    @param {Model|Model[]|ModelList|Object|Object[]} config.items Model
        instance, array of model instances, or ModelList to add to this list on
        init. The `add` event will not be fired for models added on init.
@since 3.4.0
**/

var AttrProto = Y.Attribute.prototype,
    Lang      = Y.Lang,
    YArray    = Y.Array,

    /**
    Fired when a model is added to the list.

    Listen to the `on` phase of this event to be notified before a model is
    added to the list. Calling `e.preventDefault()` during the `on` phase will
    prevent the model from being added.

    Listen to the `after` phase of this event to be notified after a model has
    been added to the list.

    @event add
    @param {Model} model The model being added.
    @param {Number} index The index at which the model will be added.
    @preventable _defAddFn
    **/
    EVT_ADD = 'add',

    /**
    Fired when a model is created or updated via the `create()` method, but
    before the model is actually saved or added to the list. The `add` event
    will be fired after the model has been saved and added to the list.

    @event create
    @param {Model} model The model being created/updated.
    @since 3.5.0
    **/
    EVT_CREATE = 'create',

    /**
    Fired when an error occurs, such as when an attempt is made to add a
    duplicate model to the list, or when a sync layer response can't be parsed.

    @event error
    @param {Any} error Error message, object, or exception generated by the
      error. Calling `toString()` on this should result in a meaningful error
      message.
    @param {String} src Source of the error. May be one of the following (or any
      custom error source defined by a ModelList subclass):

      * `add`: Error while adding a model (probably because it's already in the
         list and can't be added again). The model in question will be provided
         as the `model` property on the event facade.
      * `parse`: An error parsing a JSON response. The response in question will
         be provided as the `response` property on the event facade.
      * `remove`: Error while removing a model (probably because it isn't in the
        list and can't be removed). The model in question will be provided as
        the `model` property on the event facade.
    **/
    EVT_ERROR = 'error',

    /**
    Fired after models are loaded from a sync layer.

    @event load
    @param {Object} parsed The parsed version of the sync layer's response to
        the load request.
    @param {Mixed} response The sync layer's raw, unparsed response to the load
        request.
    @since 3.5.0
    **/
    EVT_LOAD = 'load',

    /**
    Fired when a model is removed from the list.

    Listen to the `on` phase of this event to be notified before a model is
    removed from the list. Calling `e.preventDefault()` during the `on` phase
    will prevent the model from being removed.

    Listen to the `after` phase of this event to be notified after a model has
    been removed from the list.

    @event remove
    @param {Model} model The model being removed.
    @param {Number} index The index of the model being removed.
    @preventable _defRemoveFn
    **/
    EVT_REMOVE = 'remove',

    /**
    Fired when the list is completely reset via the `reset()` method or sorted
    via the `sort()` method.

    Listen to the `on` phase of this event to be notified before the list is
    reset. Calling `e.preventDefault()` during the `on` phase will prevent
    the list from being reset.

    Listen to the `after` phase of this event to be notified after the list has
    been reset.

    @event reset
    @param {Model[]} models Array of the list's new models after the reset.
    @param {String} src Source of the event. May be either `'reset'` or
      `'sort'`.
    @preventable _defResetFn
    **/
    EVT_RESET = 'reset';

function ModelList() {
    ModelList.superclass.constructor.apply(this, arguments);
}

Y.ModelList = Y.extend(ModelList, Y.Base, {
    // -- Public Properties ----------------------------------------------------

    /**
    The `Model` class or subclass of the models in this list.

    The class specified here will be used to create model instances
    automatically based on attribute hashes passed to the `add()`, `create()`,
    and `reset()` methods.

    You may specify the class as an actual class reference or as a string that
    resolves to a class reference at runtime (the latter can be useful if the
    specified class will be loaded lazily).

    @property model
    @type Model|String
    @default Y.Model
    **/
    model: Y.Model,

    // -- Protected Properties -------------------------------------------------

    /**
    Total hack to allow us to identify ModelList instances without using
    `instanceof`, which won't work when the instance was created in another
    window or YUI sandbox.

    @property _isYUIModelList
    @type Boolean
    @default true
    @protected
    @since 3.5.0
    **/
    _isYUIModelList: true,

    // -- Lifecycle Methods ----------------------------------------------------
    initializer: function (config) {
        config || (config = {});

        var model = this.model = config.model || this.model;

        if (typeof model === 'string') {
            // Look for a namespaced Model class on `Y`.
            this.model = Y.Object.getValue(Y, model.split('.'));

            if (!this.model) {
                Y.error('ModelList: Model class not found: ' + model);
            }
        }

        this.publish(EVT_ADD,    {defaultFn: this._defAddFn});
        this.publish(EVT_RESET,  {defaultFn: this._defResetFn});
        this.publish(EVT_REMOVE, {defaultFn: this._defRemoveFn});

        this.after('*:idChange', this._afterIdChange);

        this._clear();

        if (config.items) {
            this.add(config.items, {silent: true});
        }
    },

    destructor: function () {
        this._clear();
    },

    // -- Public Methods -------------------------------------------------------

    /**
    Adds the specified model or array of models to this list. You may also pass
    another ModelList instance, in which case all the models in that list will
    be added to this one as well.

    @example

        // Add a single model instance.
        list.add(new Model({foo: 'bar'}));

        // Add a single model, creating a new instance automatically.
        list.add({foo: 'bar'});

        // Add multiple models, creating new instances automatically.
        list.add([
            {foo: 'bar'},
            {baz: 'quux'}
        ]);

        // Add all the models in another ModelList instance.
        list.add(otherList);

    @method add
    @param {Model|Model[]|ModelList|Object|Object[]} models Model or array of
        models to add. May be existing model instances or hashes of model
        attributes, in which case new model instances will be created from the
        hashes. You may also pass a ModelList instance to add all the models it
        contains.
    @param {Object} [options] Data to be mixed into the event facade of the
        `add` event(s) for the added models.

        @param {Number} [options.index] Index at which to insert the added
            models. If not specified, the models will automatically be inserted
            in the appropriate place according to the current sort order as
            dictated by the `comparator()` method, if any.
        @param {Boolean} [options.silent=false] If `true`, no `add` event(s)
            will be fired.

    @return {Model|Model[]} Added model or array of added models.
    **/
    add: function (models, options) {
        var isList = models._isYUIModelList;

        if (isList || Lang.isArray(models)) {
            return YArray.map(isList ? models.toArray() : models, function (model, index) {
                var modelOptions = options || {};

                // When an explicit insertion index is specified, ensure that
                // the index is increased by one for each subsequent item in the
                // array.
                if ('index' in modelOptions) {
                    modelOptions = Y.merge(modelOptions, {
                        index: modelOptions.index + index
                    });
                }

                return this._add(model, modelOptions);
            }, this);
        } else {
            return this._add(models, options);
        }
    },

    /**
    Define this method to provide a function that takes a model as a parameter
    and returns a value by which that model should be sorted relative to other
    models in this list.

    By default, no comparator is defined, meaning that models will not be sorted
    (they'll be stored in the order they're added).

    @example
        var list = new Y.ModelList({model: Y.Model});

        list.comparator = function (model) {
            return model.get('id'); // Sort models by id.
        };

    @method comparator
    @param {Model} model Model being sorted.
    @return {Number|String} Value by which the model should be sorted relative
      to other models in this list.
    **/

    // comparator is not defined by default

    /**
    Creates or updates the specified model on the server, then adds it to this
    list if the server indicates success.

    @method create
    @param {Model|Object} model Model to create. May be an existing model
      instance or a hash of model attributes, in which case a new model instance
      will be created from the hash.
    @param {Object} [options] Options to be passed to the model's `sync()` and
        `set()` methods and mixed into the `create` and `add` event facades.
      @param {Boolean} [options.silent=false] If `true`, no `add` event(s) will
          be fired.
    @param {Function} [callback] Called when the sync operation finishes.
      @param {Error} callback.err If an error occurred, this parameter will
        contain the error. If the sync operation succeeded, _err_ will be
        falsy.
      @param {Any} callback.response The server's response.
    @return {Model} Created model.
    **/
    create: function (model, options, callback) {
        var self = this;

        // Allow callback as second arg.
        if (typeof options === 'function') {
            callback = options;
            options  = {};
        }

        options || (options = {});

        if (!model._isYUIModel) {
            model = new this.model(model);
        }

        self.fire(EVT_CREATE, Y.merge(options, {
            model: model
        }));

        return model.save(options, function (err) {
            if (!err) {
                self.add(model, options);
            }

            callback && callback.apply(null, arguments);
        });
    },

    /**
    Executes the supplied function on each model in this list.

    By default, the callback function's `this` object will refer to the model
    currently being iterated. Specify a `thisObj` to override the `this` object
    if desired.

    Note: Iteration is performed on a copy of the internal array of models, so
    it's safe to delete a model from the list during iteration.

    @method each
    @param {Function} callback Function to execute on each model.
        @param {Model} callback.model Model instance.
        @param {Number} callback.index Index of the current model.
        @param {ModelList} callback.list The ModelList being iterated.
    @param {Object} [thisObj] Object to use as the `this` object when executing
        the callback.
    @chainable
    @since 3.6.0
    **/
    each: function (callback, thisObj) {
        var items = this._items.concat(),
            i, item, len;

        for (i = 0, len = items.length; i < len; i++) {
            item = items[i];
            callback.call(thisObj || item, item, i, this);
        }

        return this;
    },

    /**
    Executes the supplied function on each model in this list. Returns an array
    containing the models for which the supplied function returned a truthy
    value.

    The callback function's `this` object will refer to this ModelList. Use
    `Y.bind()` to bind the `this` object to another object if desired.

    @example

        // Get an array containing only the models whose "enabled" attribute is
        // truthy.
        var filtered = list.filter(function (model) {
            return model.get('enabled');
        });

        // Get a new ModelList containing only the models whose "enabled"
        // attribute is truthy.
        var filteredList = list.filter({asList: true}, function (model) {
            return model.get('enabled');
        });

    @method filter
    @param {Object} [options] Filter options.
        @param {Boolean} [options.asList=false] If truthy, results will be
            returned as a new ModelList instance rather than as an array.

    @param {Function} callback Function to execute on each model.
        @param {Model} callback.model Model instance.
        @param {Number} callback.index Index of the current model.
        @param {ModelList} callback.list The ModelList being filtered.

    @return {Array|ModelList} Array of models for which the callback function
        returned a truthy value (empty if it never returned a truthy value). If
        the `options.asList` option is truthy, a new ModelList instance will be
        returned instead of an array.
    @since 3.5.0
    */
    filter: function (options, callback) {
        var filtered = [],
            items    = this._items,
            i, item, len, list;

        // Allow options as first arg.
        if (typeof options === 'function') {
            callback = options;
            options  = {};
        }

        for (i = 0, len = items.length; i < len; ++i) {
            item = items[i];

            if (callback.call(this, item, i, this)) {
                filtered.push(item);
            }
        }

        if (options.asList) {
            list = new this.constructor({model: this.model});

            if (filtered.length) {
                list.add(filtered, {silent: true});
            }

            return list;
        } else {
            return filtered;
        }
    },

    /**
    If _name_ refers to an attribute on this ModelList instance, returns the
    value of that attribute. Otherwise, returns an array containing the values
    of the specified attribute from each model in this list.

    @method get
    @param {String} name Attribute name or object property path.
    @return {Any|Array} Attribute value or array of attribute values.
    @see Model.get()
    **/
    get: function (name) {
        if (this.attrAdded(name)) {
            return AttrProto.get.apply(this, arguments);
        }

        return this.invoke('get', name);
    },

    /**
    If _name_ refers to an attribute on this ModelList instance, returns the
    HTML-escaped value of that attribute. Otherwise, returns an array containing
    the HTML-escaped values of the specified attribute from each model in this
    list.

    The values are escaped using `Escape.html()`.

    @method getAsHTML
    @param {String} name Attribute name or object property path.
    @return {String|String[]} HTML-escaped value or array of HTML-escaped
      values.
    @see Model.getAsHTML()
    **/
    getAsHTML: function (name) {
        if (this.attrAdded(name)) {
            return Y.Escape.html(AttrProto.get.apply(this, arguments));
        }

        return this.invoke('getAsHTML', name);
    },

    /**
    If _name_ refers to an attribute on this ModelList instance, returns the
    URL-encoded value of that attribute. Otherwise, returns an array containing
    the URL-encoded values of the specified attribute from each model in this
    list.

    The values are encoded using the native `encodeURIComponent()` function.

    @method getAsURL
    @param {String} name Attribute name or object property path.
    @return {String|String[]} URL-encoded value or array of URL-encoded values.
    @see Model.getAsURL()
    **/
    getAsURL: function (name) {
        if (this.attrAdded(name)) {
            return encodeURIComponent(AttrProto.get.apply(this, arguments));
        }

        return this.invoke('getAsURL', name);
    },

    /**
    Returns the model with the specified _clientId_, or `null` if not found.

    @method getByClientId
    @param {String} clientId Client id.
    @return {Model} Model, or `null` if not found.
    **/
    getByClientId: function (clientId) {
        return this._clientIdMap[clientId] || null;
    },

    /**
    Returns the model with the specified _id_, or `null` if not found.

    Note that models aren't expected to have an id until they're saved, so if
    you're working with unsaved models, it may be safer to call
    `getByClientId()`.

    @method getById
    @param {String|Number} id Model id.
    @return {Model} Model, or `null` if not found.
    **/
    getById: function (id) {
        return this._idMap[id] || null;
    },

    /**
    Calls the named method on every model in the list. Any arguments provided
    after _name_ will be passed on to the invoked method.

    @method invoke
    @param {String} name Name of the method to call on each model.
    @param {Any} [args*] Zero or more arguments to pass to the invoked method.
    @return {Array} Array of return values, indexed according to the index of
      the model on which the method was called.
    **/
    invoke: function (name /*, args* */) {
        var args = [this._items, name].concat(YArray(arguments, 1, true));
        return YArray.invoke.apply(YArray, args);
    },

    /**
    Returns the model at the specified _index_.

    @method item
    @param {Number} index Index of the model to fetch.
    @return {Model} The model at the specified index, or `undefined` if there
      isn't a model there.
    **/

    // item() is inherited from ArrayList.

    /**
    Loads this list of models from the server.

    This method delegates to the `sync()` method to perform the actual load
    operation, which is an asynchronous action. Specify a _callback_ function to
    be notified of success or failure.

    If the load operation succeeds, a `reset` event will be fired.

    @method load
    @param {Object} [options] Options to be passed to `sync()` and to
      `reset()` when adding the loaded models. It's up to the custom sync
      implementation to determine what options it supports or requires, if any.
    @param {Function} [callback] Called when the sync operation finishes.
      @param {Error} callback.err If an error occurred, this parameter will
        contain the error. If the sync operation succeeded, _err_ will be
        falsy.
      @param {Any} callback.response The server's response. This value will
        be passed to the `parse()` method, which is expected to parse it and
        return an array of model attribute hashes.
    @chainable
    **/
    load: function (options, callback) {
        var self = this;

        // Allow callback as only arg.
        if (typeof options === 'function') {
            callback = options;
            options  = {};
        }

        options || (options = {});

        this.sync('read', options, function (err, response) {
            var facade = {
                    options : options,
                    response: response
                },

                parsed;

            if (err) {
                facade.error = err;
                facade.src   = 'load';

                self.fire(EVT_ERROR, facade);
            } else {
                // Lazy publish.
                if (!self._loadEvent) {
                    self._loadEvent = self.publish(EVT_LOAD, {
                        preventable: false
                    });
                }

                parsed = facade.parsed = self._parse(response);

                self.reset(parsed, options);
                self.fire(EVT_LOAD, facade);
            }

            callback && callback.apply(null, arguments);
        });

        return this;
    },

    /**
    Executes the specified function on each model in this list and returns an
    array of the function's collected return values.

    @method map
    @param {Function} fn Function to execute on each model.
      @param {Model} fn.model Current model being iterated.
      @param {Number} fn.index Index of the current model in the list.
      @param {Model[]} fn.models Array of models being iterated.
    @param {Object} [thisObj] `this` object to use when calling _fn_.
    @return {Array} Array of return values from _fn_.
    **/
    map: function (fn, thisObj) {
        return YArray.map(this._items, fn, thisObj);
    },

    /**
    Called to parse the _response_ when the list is loaded from the server.
    This method receives a server _response_ and is expected to return an array
    of model attribute hashes.

    The default implementation assumes that _response_ is either an array of
    attribute hashes or a JSON string that can be parsed into an array of
    attribute hashes. If _response_ is a JSON string and either `Y.JSON` or the
    native `JSON` object are available, it will be parsed automatically. If a
    parse error occurs, an `error` event will be fired and the model will not be
    updated.

    You may override this method to implement custom parsing logic if necessary.

    @method parse
    @param {Any} response Server response.
    @return {Object[]} Array of model attribute hashes.
    **/
    parse: function (response) {
        if (typeof response === 'string') {
            try {
                return Y.JSON.parse(response) || [];
            } catch (ex) {
                this.fire(EVT_ERROR, {
                    error   : ex,
                    response: response,
                    src     : 'parse'
                });

                return null;
            }
        }

        return response || [];
    },

    /**
    Removes the specified model or array of models from this list. You may also
    pass another ModelList instance to remove all the models that are in both
    that instance and this instance, or pass numerical indices to remove the
    models at those indices.

    @method remove
    @param {Model|Model[]|ModelList|Number|Number[]} models Models or indices of
        models to remove.
    @param {Object} [options] Data to be mixed into the event facade of the
        `remove` event(s) for the removed models.

        @param {Boolean} [options.silent=false] If `true`, no `remove` event(s)
            will be fired.

    @return {Model|Model[]} Removed model or array of removed models.
    **/
    remove: function (models, options) {
        var isList = models._isYUIModelList;

        if (isList || Lang.isArray(models)) {
            // We can't remove multiple models by index because the indices will
            // change as we remove them, so we need to get the actual models
            // first.
            models = YArray.map(isList ? models.toArray() : models, function (model) {
                if (Lang.isNumber(model)) {
                    return this.item(model);
                }

                return model;
            }, this);

            return YArray.map(models, function (model) {
                return this._remove(model, options);
            }, this);
        } else {
            return this._remove(models, options);
        }
    },

    /**
    Completely replaces all models in the list with those specified, and fires a
    single `reset` event.

    Use `reset` when you want to add or remove a large number of items at once
    with less overhead, and without firing `add` or `remove` events for each
    one.

    @method reset
    @param {Model[]|ModelList|Object[]} [models] Models to add. May be existing
        model instances or hashes of model attributes, in which case new model
        instances will be created from the hashes. If a ModelList is passed, all
        the models in that list will be added to this list. Calling `reset()`
        without passing in any models will clear the list.
    @param {Object} [options] Data to be mixed into the event facade of the
        `reset` event.

        @param {Boolean} [options.silent=false] If `true`, no `reset` event will
            be fired.

    @chainable
    **/
    reset: function (models, options) {
        models  || (models  = []);
        options || (options = {});

        var facade = Y.merge({src: 'reset'}, options);

        if (models._isYUIModelList) {
            models = models.toArray();
        } else {
            models = YArray.map(models, function (model) {
                return model._isYUIModel ? model : new this.model(model);
            }, this);
        }

        facade.models = models;

        if (options.silent) {
            this._defResetFn(facade);
        } else {
            // Sort the models before firing the reset event.
            if (this.comparator) {
                models.sort(Y.bind(this._sort, this));
            }

            this.fire(EVT_RESET, facade);
        }

        return this;
    },

    /**
    Executes the supplied function on each model in this list, and stops
    iterating if the callback returns `true`.

    By default, the callback function's `this` object will refer to the model
    currently being iterated. Specify a `thisObj` to override the `this` object
    if desired.

    Note: Iteration is performed on a copy of the internal array of models, so
    it's safe to delete a model from the list during iteration.

    @method some
    @param {Function} callback Function to execute on each model.
        @param {Model} callback.model Model instance.
        @param {Number} callback.index Index of the current model.
        @param {ModelList} callback.list The ModelList being iterated.
    @param {Object} [thisObj] Object to use as the `this` object when executing
        the callback.
    @return {Boolean} `true` if the callback returned `true` for any item,
        `false` otherwise.
    @since 3.6.0
    **/
    some: function (callback, thisObj) {
        var items = this._items.concat(),
            i, item, len;

        for (i = 0, len = items.length; i < len; i++) {
            item = items[i];

            if (callback.call(thisObj || item, item, i, this)) {
                return true;
            }
        }

        return false;
    },

    /**
    Forcibly re-sorts the list.

    Usually it shouldn't be necessary to call this method since the list
    maintains its sort order when items are added and removed, but if you change
    the `comparator` function after items are already in the list, you'll need
    to re-sort.

    @method sort
    @param {Object} [options] Data to be mixed into the event facade of the
        `reset` event.
      @param {Boolean} [options.silent=false] If `true`, no `reset` event will
          be fired.
    @chainable
    **/
    sort: function (options) {
        if (!this.comparator) {
            return this;
        }

        var models = this._items.concat(),
            facade;

        options || (options = {});

        models.sort(Y.bind(this._sort, this));

        facade = Y.merge(options, {
            models: models,
            src   : 'sort'
        });

        options.silent ? this._defResetFn(facade) :
                this.fire(EVT_RESET, facade);

        return this;
    },

    /**
    Override this method to provide a custom persistence implementation for this
    list. The default method just calls the callback without actually doing
    anything.

    This method is called internally by `load()`.

    @method sync
    @param {String} action Sync action to perform. May be one of the following:

      * `create`: Store a list of newly-created models for the first time.
      * `delete`: Delete a list of existing models.
      * `read`  : Load a list of existing models.
      * `update`: Update a list of existing models.

      Currently, model lists only make use of the `read` action, but other
      actions may be used in future versions.

    @param {Object} [options] Sync options. It's up to the custom sync
      implementation to determine what options it supports or requires, if any.
    @param {Function} [callback] Called when the sync operation finishes.
      @param {Error} callback.err If an error occurred, this parameter will
        contain the error. If the sync operation succeeded, _err_ will be
        falsy.
      @param {Any} [callback.response] The server's response. This value will
        be passed to the `parse()` method, which is expected to parse it and
        return an array of model attribute hashes.
    **/
    sync: function (/* action, options, callback */) {
        var callback = YArray(arguments, 0, true).pop();

        if (typeof callback === 'function') {
            callback();
        }
    },

    /**
    Returns an array containing the models in this list.

    @method toArray
    @return {Array} Array containing the models in this list.
    **/
    toArray: function () {
        return this._items.concat();
    },

    /**
    Returns an array containing attribute hashes for each model in this list,
    suitable for being passed to `Y.JSON.stringify()`.

    Under the hood, this method calls `toJSON()` on each model in the list and
    pushes the results into an array.

    @method toJSON
    @return {Object[]} Array of model attribute hashes.
    @see Model.toJSON()
    **/
    toJSON: function () {
        return this.map(function (model) {
            return model.toJSON();
        });
    },

    // -- Protected Methods ----------------------------------------------------

    /**
    Adds the specified _model_ if it isn't already in this list.

    If the model's `clientId` or `id` matches that of a model that's already in
    the list, an `error` event will be fired and the model will not be added.

    @method _add
    @param {Model|Object} model Model or object to add.
    @param {Object} [options] Data to be mixed into the event facade of the
        `add` event for the added model.
      @param {Boolean} [options.silent=false] If `true`, no `add` event will be
          fired.
    @return {Model} The added model.
    @protected
    **/
    _add: function (model, options) {
        var facade, id;

        options || (options = {});

        if (!model._isYUIModel) {
            model = new this.model(model);
        }

        id = model.get('id');

        if (this._clientIdMap[model.get('clientId')]
                || (Lang.isValue(id) && this._idMap[id])) {

            this.fire(EVT_ERROR, {
                error: 'Model is already in the list.',
                model: model,
                src  : 'add'
            });

            return;
        }

        facade = Y.merge(options, {
            index: 'index' in options ? options.index : this._findIndex(model),
            model: model
        });

        options.silent ? this._defAddFn(facade) : this.fire(EVT_ADD, facade);

        return model;
    },

    /**
    Adds this list as a bubble target for the specified model's events.

    @method _attachList
    @param {Model} model Model to attach to this list.
    @protected
    **/
    _attachList: function (model) {
        // Attach this list and make it a bubble target for the model.
        model.lists.push(this);
        model.addTarget(this);
    },

    /**
    Clears all internal state and the internal list of models, returning this
    list to an empty state. Automatically detaches all models in the list.

    @method _clear
    @protected
    **/
    _clear: function () {
        YArray.each(this._items, this._detachList, this);

        this._clientIdMap = {};
        this._idMap       = {};
        this._items       = [];
    },

    /**
    Compares the value _a_ to the value _b_ for sorting purposes. Values are
    assumed to be the result of calling a model's `comparator()` method. You can
    override this method to implement custom sorting logic, such as a descending
    sort or multi-field sorting.

    @method _compare
    @param {Mixed} a First value to compare.
    @param {Mixed} b Second value to compare.
    @return {Number} `-1` if _a_ should come before _b_, `0` if they're
        equivalent, `1` if _a_ should come after _b_.
    @protected
    @since 3.5.0
    **/
    _compare: function (a, b) {
        return a < b ? -1 : (a > b ? 1 : 0);
    },

    /**
    Removes this list as a bubble target for the specified model's events.

    @method _detachList
    @param {Model} model Model to detach.
    @protected
    **/
    _detachList: function (model) {
        var index = YArray.indexOf(model.lists, this);

        if (index > -1) {
            model.lists.splice(index, 1);
            model.removeTarget(this);
        }
    },

    /**
    Returns the index at which the given _model_ should be inserted to maintain
    the sort order of the list.

    @method _findIndex
    @param {Model} model The model being inserted.
    @return {Number} Index at which the model should be inserted.
    @protected
    **/
    _findIndex: function (model) {
        var items = this._items,
            max   = items.length,
            min   = 0,
            item, middle, needle;

        if (!this.comparator || !max) {
            return max;
        }

        needle = this.comparator(model);

        // Perform an iterative binary search to determine the correct position
        // based on the return value of the `comparator` function.
        while (min < max) {
            middle = (min + max) >> 1; // Divide by two and discard remainder.
            item   = items[middle];

            if (this._compare(this.comparator(item), needle) < 0) {
                min = middle + 1;
            } else {
                max = middle;
            }
        }

        return min;
    },

    /**
    Calls the public, overrideable `parse()` method and returns the result.

    Override this method to provide a custom pre-parsing implementation. This
    provides a hook for custom persistence implementations to "prep" a response
    before calling the `parse()` method.

    @method _parse
    @param {Any} response Server response.
    @return {Object[]} Array of model attribute hashes.
    @protected
    @see ModelList.parse()
    @since 3.7.0
    **/
    _parse: function (response) {
        return this.parse(response);
    },

    /**
    Removes the specified _model_ if it's in this list.

    @method _remove
    @param {Model|Number} model Model or index of the model to remove.
    @param {Object} [options] Data to be mixed into the event facade of the
        `remove` event for the removed model.
      @param {Boolean} [options.silent=false] If `true`, no `remove` event will
          be fired.
    @return {Model} Removed model.
    @protected
    **/
    _remove: function (model, options) {
        var index, facade;

        options || (options = {});

        if (Lang.isNumber(model)) {
            index = model;
            model = this.item(index);
        } else {
            index = this.indexOf(model);
        }

        if (index === -1 || !model) {
            this.fire(EVT_ERROR, {
                error: 'Model is not in the list.',
                index: index,
                model: model,
                src  : 'remove'
            });

            return;
        }

        facade = Y.merge(options, {
            index: index,
            model: model
        });

        options.silent ? this._defRemoveFn(facade) :
                this.fire(EVT_REMOVE, facade);

        return model;
    },

    /**
    Array sort function used by `sort()` to re-sort the models in the list.

    @method _sort
    @param {Model} a First model to compare.
    @param {Model} b Second model to compare.
    @return {Number} `-1` if _a_ is less than _b_, `0` if equal, `1` if greater.
    @protected
    **/
    _sort: function (a, b) {
        return this._compare(this.comparator(a), this.comparator(b));
    },

    // -- Event Handlers -------------------------------------------------------

    /**
    Updates the model maps when a model's `id` attribute changes.

    @method _afterIdChange
    @param {EventFacade} e
    @protected
    **/
    _afterIdChange: function (e) {
        var newVal  = e.newVal,
            prevVal = e.prevVal,
            target  = e.target;

        if (Lang.isValue(prevVal)) {
            if (this._idMap[prevVal] === target) {
                delete this._idMap[prevVal];
            } else {
                // The model that changed isn't in this list. Probably just a
                // bubbled change event from a nested Model List.
                return;
            }
        } else {
            // The model had no previous id. Verify that it exists in this list
            // before continuing.
            if (this.indexOf(target) === -1) {
                return;
            }
        }

        if (Lang.isValue(newVal)) {
            this._idMap[newVal] = target;
        }
    },

    // -- Default Event Handlers -----------------------------------------------

    /**
    Default event handler for `add` events.

    @method _defAddFn
    @param {EventFacade} e
    @protected
    **/
    _defAddFn: function (e) {
        var model = e.model,
            id    = model.get('id');

        this._clientIdMap[model.get('clientId')] = model;

        if (Lang.isValue(id)) {
            this._idMap[id] = model;
        }

        this._attachList(model);
        this._items.splice(e.index, 0, model);
    },

    /**
    Default event handler for `remove` events.

    @method _defRemoveFn
    @param {EventFacade} e
    @protected
    **/
    _defRemoveFn: function (e) {
        var model = e.model,
            id    = model.get('id');

        this._detachList(model);
        delete this._clientIdMap[model.get('clientId')];

        if (Lang.isValue(id)) {
            delete this._idMap[id];
        }

        this._items.splice(e.index, 1);
    },

    /**
    Default event handler for `reset` events.

    @method _defResetFn
    @param {EventFacade} e
    @protected
    **/
    _defResetFn: function (e) {
        // When fired from the `sort` method, we don't need to clear the list or
        // add any models, since the existing models are sorted in place.
        if (e.src === 'sort') {
            this._items = e.models.concat();
            return;
        }

        this._clear();

        if (e.models.length) {
            this.add(e.models, {silent: true});
        }
    }
}, {
    NAME: 'modelList'
});

Y.augment(ModelList, Y.ArrayList);


text:
/**
 * The Form Builder Component
 *
 * @module aui-form-builder
 * @submodule aui-form-builder-field-radio
 */

var L = A.Lang,

    AEscape = A.Escape,

    getCN = A.getClassName,

    CSS_FIELD = getCN('field'),
    CSS_FIELD_CHOICE = getCN('field', 'choice'),
    CSS_FIELD_RADIO = getCN('field', 'radio'),
    CSS_FORM_BUILDER_FIELD = getCN('form-builder-field'),
    CSS_FORM_BUILDER_FIELD_NODE = getCN('form-builder-field', 'node'),
    CSS_FORM_BUILDER_FIELD_OPTIONS_CONTAINER = getCN('form-builder-field', 'options', 'container'),

    TPL_OPTIONS_CONTAINER = '

',
    TPL_RADIO =
        '
<input id="{id}" class="' + [CSS_FIELD, CSS_FIELD_CHOICE, CSS_FIELD_RADIO, CSS_FORM_BUILDER_FIELD_NODE].join(
            ' ') +
        '" name="{name}" type="radio" value="{value}" {checked} {disabled} />{label}
';

/**
 * A base class for `A.FormBuilderRadioField`.
 *
 * @class A.FormBuilderRadioField
 * @extends A.FormBuilderMultipleChoiceField
 * @param {Object} config Object literal specifying widget configuration
 *     properties.
 * @constructor
 */
var FormBuilderRadioField = A.Component.create({

    /**
     * Static property provides a string to identify the class.
     *
     * @property NAME
     * @type String
     * @static
     */
    NAME: 'form-builder-radio-field',

    /**
     * Static property used to define the default attribute
     * configuration for the `A.FormBuilderRadioField`.
     *
     * @property ATTRS
     * @type Object
     * @static
     */
    ATTRS: {

        /**
         * Specifies a predefined value for the radio field.
         *
         * @attribute predefinedValue
         */
        predefinedValue: {
            valueFn: '_valuePredefinedValueFn'
        },

        /**
         * Reusable block of markup used to generate the field.
         *
         * @attribute template
         */
        template: {
            valueFn: function() {
                return TPL_RADIO;
            }
        }

    },

    /**
     * Static property provides a string to identify the CSS prefix.
     *
     * @property CSS_PREFIX
     * @type String
     * @static
     */
    CSS_PREFIX: CSS_FORM_BUILDER_FIELD,

    /**
     * Static property used to define which component it extends.
     *
     * @property EXTENDS
     * @type Object
     * @static
     */
    EXTENDS: A.FormBuilderMultipleChoiceField,

    prototype: {

        /**
         * Returns the HTML template.
         *
         * @method getHTML
         * @return {String}
         */
        getHTML: function() {
            return TPL_OPTIONS_CONTAINER;
        },

        /**
         * Set the `disabled` attribute in the UI.
         *
         * @method _uiSetDisabled
         * @param val
         * @protected
         */
        _uiSetDisabled: function(val) {
            var instance = this,
                templateNode = instance.get('templateNode');

            templateNode.all('input').each(function(input) {
                if (val) {
                    input.setAttribute('disabled', val);
                }
                else {
                    input.removeAttribute('disabled');
                }
            });
        },

        /**
         * Set the `options` attribute in the UI.
         *
         * @method _uiSetOptions
         * @param val
         * @protected
         */
        _uiSetOptions: function(val) {
            var instance = this,
                buffer = [],
                counter = 0,
                hasPredefinedValue = false,
                predefinedValue = instance.get('predefinedValue'),
                templateNode = instance.get('templateNode');

            A.each(val, function(item) {
                var checked = A.Array.indexOf(predefinedValue, item.value) > -1;

                buffer.push(
                    L.sub(
                        TPL_RADIO, {
                            checked: checked ? 'checked="checked"' : '',
                            disabled: instance.get('disabled') ? 'disabled="disabled"' : '',
                            id: AEscape.html(instance.get('id') + counter++),
                            label: AEscape.html(item.label),
                            name: AEscape.html(instance.get('name')),
                            value: AEscape.html(item.value)
                        }
                    )
                );

                if (checked) {
                    hasPredefinedValue = true;
                }
            });

            instance.optionNodes = A.NodeList.create(buffer.join(''));

            templateNode.setContent(instance.optionNodes);

            if (!hasPredefinedValue) {
                instance.set('predefinedValue', instance._valuePredefinedValueFn());

                instance.get('builder').editField(instance);
            }
        },

        /**
         * Set the `predefinedValue` attribute in the UI.
         *
         * @method _uiSetPredefinedValue
         * @param val
         * @protected
         */
        _uiSetPredefinedValue: function(val) {
            var instance = this,
                optionNodes = instance.optionNodes;

            if (!optionNodes) {
                return;
            }

            optionNodes.set('checked', false);

            optionNodes.all('input[value="' + AEscape.html(val) + '"]').set('checked', true);
        },

        /**
         * Returns the first option value if no predefined value is specified.
         *
         * @method _valuePredefinedValueFn
         * @protected
         */
        _valuePredefinedValueFn: function() {
            var instance = this,
                options = instance.get('options'),
                predefinedValue;

            if (options.length) {
                predefinedValue = options[0].value;
            }

            return predefinedValue;
        }

    }

});

A.FormBuilderRadioField = FormBuilderRadioField;

A.FormBuilderField.types.radio = A.FormBuilderRadioField;

redpajama_set_name: RedPajamaGithub


text:
extern "Java"
{
  namespace java
  {
    namespace rmi
    {
      namespace activation
      {
          class UnknownObjectException;
      }
    }
  }
}

class java::rmi::activation::UnknownObjectException : public ::java::rmi::activation::ActivationException
{

public:
  UnknownObjectException(::java::lang::String *);
private:
  static const jlong serialVersionUID = 3425547551622251430LL;
public:
  static ::java::lang::Class class$;
};

#endif // __java_rmi_activation_UnknownObjectException__


text:
package org.runetranscriber.core.viking.example;

import org.runetranscriber.core.AbstractExample;
import org.runetranscriber.core.FontLetterList;
import org.runetranscriber.core.LanguageLetterList;
import org.runetranscriber.core.Phoneme;
import org.runetranscriber.core.PhonemeList;
import org.runetranscriber.core.RuneList;
import org.runetranscriber.core.viking.AngloSaxonFontLetter;
import org.runetranscriber.core.viking.AngloSaxonRune;

/**
 * Provides an example for Anglo-Saxon runes from The Hobbit, Title Pages 1-2.
 */
public final class AngloSaxonExample1 extends AbstractExample<AngloSaxonRune, AngloSaxonFontLetter>
{
    @Override
    protected FontLetterList<AngloSaxonFontLetter> createFontLetters()
    {
        final AngloSaxonFontLetter[] myFontLetters = {
                // Top 1 line 1
                // the
                AngloSaxonFontLetter.THORN,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.SPACE,
                // hobbit
                AngloSaxonFontLetter.HAEGL,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.TIW,
                AngloSaxonFontLetter.COMMA,
                // or
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.COMMA,
                // there
                AngloSaxonFontLetter.THORN,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.SPACE,
                // and
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.NEWLINE,

                // Top 2 line 1
                // back
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.CEN,
                AngloSaxonFontLetter.CEN,
                AngloSaxonFontLetter.SPACE,
                // again
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.GYFU,
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.PERIOD,
                // being
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.ING,
                AngloSaxonFontLetter.SPACE,
                // the
                AngloSaxonFontLetter.THORN,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.NEWLINE,

                // Top 1 line 2
                // record
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.CEN,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.SPACE,
                // of
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.FEOH,
                AngloSaxonFontLetter.SPACE,
                // a
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.SPACE,
                // years
                AngloSaxonFontLetter.YR,
                AngloSaxonFontLetter.EAR,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.SIGEL,
                AngloSaxonFontLetter.SPACE,
                // journey
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.UR,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.YR,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.NEWLINE,

                // Top 2 line 2
                // made
                AngloSaxonFontLetter.MANN,
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.SPACE,
                // by
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.YR,
                AngloSaxonFontLetter.SPACE,
                // bilbo
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.LAGU,
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.SPACE,
                // baggins
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.GYFU,
                AngloSaxonFontLetter.GYFU,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.SIGEL,
                AngloSaxonFontLetter.SPACE,
                // of
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.FEOH,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.NEWLINE,

                // Bottom 1 line 1
                // hobbiton
                AngloSaxonFontLetter.HAEGL,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.TIW,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.PERIOD,
                // compiled
                AngloSaxonFontLetter.CEN,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.MANN,
                AngloSaxonFontLetter.PEORD,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.LAGU,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.SPACE,
                // from
                AngloSaxonFontLetter.FEOH,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.MANN,
                AngloSaxonFontLetter.SPACE,
                // his
                AngloSaxonFontLetter.HAEGL,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.SIGEL,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.NEWLINE,

                // Bottom 2 line 1
                // memoirs
                AngloSaxonFontLetter.MANN,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.MANN,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.SIGEL,
                AngloSaxonFontLetter.SPACE,
                // by
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.YR,
                AngloSaxonFontLetter.SPACE,
                // j r r
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.SPACE,
                // tolkien.
                AngloSaxonFontLetter.TIW,
                AngloSaxonFontLetter.OS,
                AngloSaxonFontLetter.LAGU,
                AngloSaxonFontLetter.CEN,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.PERIOD,
                AngloSaxonFontLetter.NEWLINE,

                // Bottom 1 line 2
                // and
                AngloSaxonFontLetter.AESC,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.SPACE,
                // published
                AngloSaxonFontLetter.PEORD,
                AngloSaxonFontLetter.UR,
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.LAGU,
                AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.SIGEL,
                AngloSaxonFontLetter.HAEGL,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.SPACE,
                // by
                AngloSaxonFontLetter.BEORC,
                AngloSaxonFontLetter.YR,
                AngloSaxonFontLetter.SPACE,
                // george
                AngloSaxonFontLetter.GYFU,
                AngloSaxonFontLetter.EOH,
                AngloSaxonFontLetter.RAD,
                AngloSaxonFontLetter.GYFU,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.SPACE,
                AngloSaxonFontLetter.NEWLINE,

                // Bottom 2 line 2
                // allen
                AngloSaxonFontLetter.AESC, AngloSaxonFontLetter.LAGU, AngloSaxonFontLetter.LAGU,
                AngloSaxonFontLetter.EH,
                AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.SPACE,
                // and
                AngloSaxonFontLetter.AESC, AngloSaxonFontLetter.NYD,
                AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.SPACE,
                // unwin
                AngloSaxonFontLetter.UR, AngloSaxonFontLetter.NYD, AngloSaxonFontLetter.WYNN, AngloSaxonFontLetter.IS,
                AngloSaxonFontLetter.NYD, AngloSaxonFontLetter.SPACE,
                // ltd.
                AngloSaxonFontLetter.LAGU, AngloSaxonFontLetter.TIW, AngloSaxonFontLetter.DAEG,
                AngloSaxonFontLetter.PERIOD, };

        return new FontLetterList<AngloSaxonFontLetter>(myFontLetters);
    }

    @Override
    protected LanguageLetterList createLanguageLetters()
    {
        final String text =
        // Top 1 line 1
        "The hobbit, or, there and \n"
        // Top 2 line 1
                + "back again. Being the \n"
                // Top 1 line 2
                + "record of a year's journey \n"
                // Top 2 line 2
                + "made by Bilbo Baggins of \n"
                // Bottom 1 line 1
                + "Hobbiton. Compiled from his \n"
                // Bottom 2 line 1
                + "memoirs by J R R Tolkien. \n"
                // Bottom 1 line 2
                + "And published by George \n"
                // Bottom 2 line 2
                + "Allen and Unwin Ltd.";

        return new LanguageLetterList(text);
    }

    /**
     * @return phonemes.
     */
    @Override
    protected PhonemeList createPhonemes()
    {
        final Phoneme[] myPhonemes = {
                // Top 1 line 1
                // the
                Phoneme.TH,
                Phoneme.E,
                Phoneme.SPACE,
                // hobbit
                Phoneme.H, Phoneme.O, Phoneme.B, Phoneme.B, Phoneme.I,
                Phoneme.T,
                Phoneme.COMMA,
                // or
                Phoneme.O,
                Phoneme.R,
                Phoneme.COMMA,
                // there
                Phoneme.TH, Phoneme.E,
                Phoneme.R,
                Phoneme.E,
                Phoneme.SPACE,
                // and
                Phoneme.AE,
                Phoneme.N,
                Phoneme.D,
                Phoneme.SPACE,
                Phoneme.NEWLINE,

                // Top 2 line 1
                // back
                Phoneme.B, Phoneme.AE, Phoneme.K,
                Phoneme.K,
                Phoneme.SPACE,
                // again
                Phoneme.AE, Phoneme.G, Phoneme.AE, Phoneme.I,
                Phoneme.N,
                Phoneme.PERIOD,
                // being
                Phoneme.B,
                Phoneme.E,
                Phoneme.I,
                Phoneme.NG2,
                Phoneme.SPACE,
                // the
                Phoneme.TH,
                Phoneme.E,
                Phoneme.SPACE,
                Phoneme.NEWLINE,

                // Top 1 line 2
                // record
                Phoneme.R, Phoneme.E, Phoneme.K, Phoneme.O,
                Phoneme.R,
                Phoneme.D,
                Phoneme.SPACE,
                // of
                Phoneme.O,
                Phoneme.F,
                Phoneme.SPACE,
                // a
                Phoneme.AE,
                Phoneme.SPACE,
                // years
                Phoneme.Y, Phoneme.EA, Phoneme.R,
                Phoneme.S,
                Phoneme.SPACE,
                // journey
                Phoneme.J, Phoneme.O, Phoneme.U, Phoneme.R, Phoneme.N,
                Phoneme.E,
                Phoneme.Y,
                Phoneme.SPACE,
                Phoneme.NEWLINE,

                // Top 2 line 2
                // made
                Phoneme.M, Phoneme.AE, Phoneme.D, Phoneme.E,
                Phoneme.SPACE,
                // by
                Phoneme.B, Phoneme.Y,
                Phoneme.SPACE,
                // bilbo
                Phoneme.B, Phoneme.I, Phoneme.L, Phoneme.B, Phoneme.O,
                Phoneme.SPACE,
                // baggins
                Phoneme.B, Phoneme.AE, Phoneme.G, Phoneme.G, Phoneme.I, Phoneme.N, Phoneme.S,
                Phoneme.SPACE,
                // of
                Phoneme.O,
                Phoneme.F,
                Phoneme.SPACE,
                Phoneme.NEWLINE,

                // Bottom 1 line 1
                // hobbiton.
                Phoneme.H, Phoneme.O, Phoneme.B, Phoneme.B, Phoneme.I, Phoneme.T, Phoneme.O, Phoneme.N,
                Phoneme.PERIOD,
                // compiled
                Phoneme.K, Phoneme.O, Phoneme.M, Phoneme.P, Phoneme.I, Phoneme.L, Phoneme.E, Phoneme.D,
                Phoneme.SPACE,
                // from
                Phoneme.F, Phoneme.R, Phoneme.O, Phoneme.M,
                Phoneme.SPACE,
                // his
                Phoneme.H, Phoneme.I,
                Phoneme.S,
                Phoneme.SPACE,
                Phoneme.NEWLINE,

                // Bottom 2 line 1
                // memoirs
                Phoneme.M, Phoneme.E, Phoneme.M, Phoneme.O, Phoneme.I, Phoneme.R, Phoneme.S,
                Phoneme.SPACE,
                // by
                Phoneme.B, Phoneme.Y,
                Phoneme.SPACE,
                // j r r
                Phoneme.J, Phoneme.SPACE, Phoneme.R, Phoneme.SPACE, Phoneme.R,
                Phoneme.SPACE,
                // tolkien.
                Phoneme.T, Phoneme.O, Phoneme.L, Phoneme.K, Phoneme.I, Phoneme.E, Phoneme.N,
                Phoneme.PERIOD,
                Phoneme.NEWLINE,

                // Bottom 1 line 2
                // and
                Phoneme.AE, Phoneme.N, Phoneme.D, Phoneme.SPACE,
                // published
                Phoneme.P, Phoneme.U, Phoneme.B, Phoneme.L, Phoneme.I, Phoneme.S, Phoneme.H, Phoneme.E, Phoneme.D,
                Phoneme.SPACE,
                // by
                Phoneme.B, Phoneme.Y, Phoneme.SPACE,
                // george
                Phoneme.G, Phoneme.EO, Phoneme.R, Phoneme.G, Phoneme.E, Phoneme.SPACE, Phoneme.NEWLINE,

                // Bottom 2 line 2
                // allen
                Phoneme.AE, Phoneme.L, Phoneme.L, Phoneme.E, Phoneme.N, Phoneme.SPACE,
                // and
                Phoneme.AE, Phoneme.N, Phoneme.D, Phoneme.SPACE,
                // unwin
                Phoneme.U, Phoneme.N, Phoneme.W, Phoneme.I, Phoneme.N, Phoneme.SPACE,
                // ltd.
                Phoneme.L, Phoneme.T, Phoneme.D, Phoneme.PERIOD,

        };

        return new PhonemeList(myPhonemes);
    }

    /**
     * @return runes.
     */
    @Override
    protected RuneList<AngloSaxonRune> createRunes()
    {
        final AngloSaxonRune[] myRunes = {
                // Top 1 line 1
                // the
                AngloSaxonRune.THORN,
                AngloSaxonRune.EH,
                AngloSaxonRune.SPACE,
                // hobbit
                AngloSaxonRune.HAEGL,
                AngloSaxonRune.OS,
                AngloSaxonRune.BEORC,
                AngloSaxonRune.BEORC,
                AngloSaxonRune.IS,
                AngloSaxonRune.TIW,
                AngloSaxonRune.COMMA,
                // or
                AngloSaxonRune.OS,
                AngloSaxonRune.RAD,
                AngloSaxonRune.COMMA,
                // there
                AngloSaxonRune.THORN,
                AngloSaxonRune.EH,
                AngloSaxonRune.RAD,
                AngloSaxonRune.EH,
                AngloSaxonRune.SPACE,
                // and
                AngloSaxonRune.AESC,
                AngloSaxonRune.NYD,
                AngloSaxonRune.DAEG,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.NEWLINE,

                // Top 2 line 1
                // back
                AngloSaxonRune.BEORC,
                AngloSaxonRune.AESC,
                AngloSaxonRune.CEN,
                AngloSaxonRune.CEN,
                AngloSaxonRune.SPACE,
                // again
                AngloSaxonRune.AESC,
                AngloSaxonRune.GYFU,
                AngloSaxonRune.AESC,
                AngloSaxonRune.IS,
                AngloSaxonRune.NYD,
                AngloSaxonRune.PERIOD,
                // being
                AngloSaxonRune.BEORC,
                AngloSaxonRune.EH,
                AngloSaxonRune.IS,
                AngloSaxonRune.ING,
                AngloSaxonRune.SPACE,
                // the
                AngloSaxonRune.THORN,
                AngloSaxonRune.EH,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.NEWLINE,

                // Top 1 line 2
                // record
                AngloSaxonRune.RAD,
                AngloSaxonRune.EH,
                AngloSaxonRune.CEN,
                AngloSaxonRune.OS,
                AngloSaxonRune.RAD,
                AngloSaxonRune.DAEG,
                AngloSaxonRune.SPACE,
                // of
                AngloSaxonRune.OS,
                AngloSaxonRune.FEOH,
                AngloSaxonRune.SPACE,
                // a
                AngloSaxonRune.AESC,
                AngloSaxonRune.SPACE,
                // year's
                AngloSaxonRune.YR,
                AngloSaxonRune.EAR,
                AngloSaxonRune.RAD,
                AngloSaxonRune.SIGEL,
                AngloSaxonRune.SPACE,
                // journey
                AngloSaxonRune.IS,
                AngloSaxonRune.OS,
                AngloSaxonRune.UR,
                AngloSaxonRune.RAD,
                AngloSaxonRune.NYD,
                AngloSaxonRune.EH,
                AngloSaxonRune.YR,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.NEWLINE,

                // Top 2 line 2
                // made
                AngloSaxonRune.MANN,
                AngloSaxonRune.AESC,
                AngloSaxonRune.DAEG,
                AngloSaxonRune.EH,
                AngloSaxonRune.SPACE,
                // by
                AngloSaxonRune.BEORC,
                AngloSaxonRune.YR,
                AngloSaxonRune.SPACE,
                // bilbo
                AngloSaxonRune.BEORC,
                AngloSaxonRune.IS,
                AngloSaxonRune.LAGU,
                AngloSaxonRune.BEORC,
                AngloSaxonRune.OS,
                AngloSaxonRune.SPACE,
                // baggins
                AngloSaxonRune.BEORC,
                AngloSaxonRune.AESC,
                AngloSaxonRune.GYFU,
                AngloSaxonRune.GYFU,
                AngloSaxonRune.IS,
                AngloSaxonRune.NYD,
                AngloSaxonRune.SIGEL,
                AngloSaxonRune.SPACE,
                // of
                AngloSaxonRune.OS,
                AngloSaxonRune.FEOH,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.NEWLINE,

                // Bottom 1 line 1
                // hobbiton
                AngloSaxonRune.HAEGL,
                AngloSaxonRune.OS,
                AngloSaxonRune.BEORC,
                AngloSaxonRune.BEORC,
                AngloSaxonRune.IS,
                AngloSaxonRune.TIW,
                AngloSaxonRune.OS,
                AngloSaxonRune.NYD,
                AngloSaxonRune.PERIOD,
                // compiled
                AngloSaxonRune.CEN,
                AngloSaxonRune.OS,
                AngloSaxonRune.MANN,
                AngloSaxonRune.PEORD,
                AngloSaxonRune.IS,
                AngloSaxonRune.LAGU,
                AngloSaxonRune.EH,
                AngloSaxonRune.DAEG,
                AngloSaxonRune.SPACE,
                // from
                AngloSaxonRune.FEOH,
                AngloSaxonRune.RAD,
                AngloSaxonRune.OS,
                AngloSaxonRune.MANN,
                AngloSaxonRune.SPACE,
                // his
                AngloSaxonRune.HAEGL,
                AngloSaxonRune.IS,
                AngloSaxonRune.SIGEL,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.NEWLINE,

                // Bottom 2 line 1
                // memoirs
                AngloSaxonRune.MANN,
                AngloSaxonRune.EH,
                AngloSaxonRune.MANN,
                AngloSaxonRune.OS,
                AngloSaxonRune.IS,
                AngloSaxonRune.RAD,
                AngloSaxonRune.SIGEL,
                AngloSaxonRune.SPACE,
                // by
                AngloSaxonRune.BEORC,
                AngloSaxonRune.YR,
                AngloSaxonRune.SPACE,
                // j r r
                AngloSaxonRune.IS,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.RAD,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.RAD,
                AngloSaxonRune.SPACE,
                // tolkien.
                AngloSaxonRune.TIW,
                AngloSaxonRune.OS,
                AngloSaxonRune.LAGU,
                AngloSaxonRune.CEN,
                AngloSaxonRune.IS,
                AngloSaxonRune.EH,
                AngloSaxonRune.NYD,
                AngloSaxonRune.PERIOD,
                AngloSaxonRune.NEWLINE,

                // Bottom 1 line 2
                // and
                AngloSaxonRune.AESC,
                AngloSaxonRune.NYD,
                AngloSaxonRune.DAEG,
                AngloSaxonRune.SPACE,
                // published
                AngloSaxonRune.PEORD, AngloSaxonRune.UR, AngloSaxonRune.BEORC, AngloSaxonRune.LAGU, AngloSaxonRune.IS,
                AngloSaxonRune.SIGEL, AngloSaxonRune.HAEGL,
                AngloSaxonRune.EH,
                AngloSaxonRune.DAEG,
                AngloSaxonRune.SPACE,
                // by
                AngloSaxonRune.BEORC,
                AngloSaxonRune.YR,
                AngloSaxonRune.SPACE,
                // george
                AngloSaxonRune.GYFU, AngloSaxonRune.EOH, AngloSaxonRune.RAD,
                AngloSaxonRune.GYFU,
                AngloSaxonRune.EH,
                AngloSaxonRune.SPACE,
                AngloSaxonRune.NEWLINE,

                // Bottom 2 line 2
                // allen
                AngloSaxonRune.AESC, AngloSaxonRune.LAGU, AngloSaxonRune.LAGU, AngloSaxonRune.EH, AngloSaxonRune.NYD,
                AngloSaxonRune.SPACE,
                // and
                AngloSaxonRune.AESC, AngloSaxonRune.NYD, AngloSaxonRune.DAEG, AngloSaxonRune.SPACE,
                // unwin
                AngloSaxonRune.UR, AngloSaxonRune.NYD, AngloSaxonRune.WYNN, AngloSaxonRune.IS, AngloSaxonRune.NYD,
                AngloSaxonRune.SPACE,
                // ltd.
                AngloSaxonRune.LAGU, AngloSaxonRune.TIW, AngloSaxonRune.DAEG, AngloSaxonRune.PERIOD, };

        return new RuneList<AngloSaxonRune>(myRunes);
    }
}


text:
require 'test_helper'

class ActsAsSitemap04Test < ActiveSupport::TestCase

  ##################################################################################
  test "acts_as_sitemap separate keys same value" do

    DuckMap::Config.reset

    DuckMap::Config.acts_as_sitemap :default, title: :my_title
    DuckMap::Config.acts_as_sitemap :edit, title: :my_title
    DuckMap::Config.acts_as_sitemap :index, title: :my_title
    DuckMap::Config.acts_as_sitemap :new, title: :my_title
    DuckMap::Config.acts_as_sitemap :show, title: :my_title

    assert HashModel.verify("unit/sitemap/models/test01", DuckMap::Config.sitemap_attributes_hash)

  end

  ##################################################################################
  test "acts_as_sitemap separate keys separate values" do

    DuckMap::Config.reset

    DuckMap::Config.acts_as_sitemap :default, title: :default_title
    DuckMap::Config.acts_as_sitemap :edit, title: :edit_title
    DuckMap::Config.acts_as_sitemap :index, title: :index_title
    DuckMap::Config.acts_as_sitemap :new, title: :new_title
    DuckMap::Config.acts_as_sitemap :show, title: :show_title

    assert HashModel.verify("unit/sitemap/models/test04", DuckMap::Config.sitemap_attributes_hash)

  end

  ##################################################################################
  test "acts_as_sitemap multiple keys multiple values" do

    DuckMap::Config.reset

    DuckMap::Config.acts_as_sitemap :default, title: :default_title,
                                              keywords: "moe larry the cheese",
                                              description: "this is a test",
                                              priority: "0.4",
                                              changefreq: "monthly"

    DuckMap::Config.acts_as_sitemap :edit, title: "edit_title",
                                              keywords: "rails duck_map",
                                              description: "testing duck map",
                                              priority: "0.6",
                                              changefreq: "yearly",
                                              canonical: "http://localhost:3000/",
                                              canonical_host: "example.com",
                                              url_format: "xml",
                                              url_limit: 4000

    DuckMap::Config.acts_as_sitemap :index, title: nil,
                                              keywords: nil,
                                              description: nil,
                                              priority: nil,
                                              changefreq: nil,
                                              lastmod: nil,
                                              url_limit: 8000

    DuckMap::Config.acts_as_sitemap :new, title: :new_title,
                                              handler: {action_name: nil, first_model: false}

    DuckMap::Config.acts_as_sitemap :show, title: :show_title,
                                              handler: {action_name: :my_action,
                                                        first_model: false,
                                                        my_attribute: :my_value},
                                              segments: {id: :my_id,
                                                          sub_id: :book_id,
                                                          title: :my_title}

    assert HashModel.verify("unit/sitemap/models/test05", DuckMap::Config.sitemap_attributes_hash)

  end

  ##################################################################################
  test "config block acts_as_sitemap title: :my_title" do

    DuckMap::Config.reset

    Rails.application.routes.draw do
      acts_as_sitemap :default, title: :default_title,
                                keywords: "moe larry the cheese",
                                description: "this is a test",
                                priority: "0.4",
                                changefreq: "monthly"

      acts_as_sitemap :edit, title: "edit_title",
                                keywords: "rails duck_map",
                                description: "testing duck map",
                                priority: "0.6",
                                changefreq: "yearly",
                                canonical: "http://localhost:3000/",
                                canonical_host: "example.com",
                                url_format: "xml",
                                url_limit: 4000

      acts_as_sitemap :index, title: nil,
                                keywords: nil,
                                description: nil,
                                priority: nil,
                                changefreq: nil,
                                lastmod: nil,
                                url_limit: 8000

      acts_as_sitemap :new, title: :new_title,
                                handler: {action_name: nil, first_model: false}

      acts_as_sitemap :show, title: :show_title,
                                handler: {action_name: :my_action,
                                          first_model: false,
                                          my_attribute: :my_value},
                                segments: {id: :my_id,
                                            sub_id: :book_id,
                                            title: :my_title}
    end

    assert HashModel.verify("unit/sitemap/models/test05", DuckMap::Config.sitemap_attributes_hash)

  end

  ##################################################################################
  test "class acts_as_sitemap title: :my_title" do

    # reset here in case other tests bigfoot the class variables.
    DuckMap::Config.reset

    class ActsAsSitemap04TestObject01
      include DuckMap::InheritableClassAttributes
      include DuckMap::Attributes
      include DuckMap::SitemapObject

      acts_as_sitemap :default, title: :default_title,
                                keywords: "moe larry the cheese",
                                description: "this is a test",
                                priority: "0.4",
                                changefreq: "monthly"

      acts_as_sitemap :edit, title: "edit_title",
                                keywords: "rails duck_map",
                                description: "testing duck map",
                                priority: "0.6",
                                changefreq: "yearly",
                                canonical: "http://localhost:3000/",
                                canonical_host: "example.com",
                                url_format: "xml",
                                url_limit: 4000

      acts_as_sitemap :index, title: nil,
                                keywords: nil,
                                description: nil,
                                priority: nil,
                                changefreq: nil,
                                lastmod: nil,
                                url_limit: 8000

      acts_as_sitemap :new, title: :new_title,
                                handler: {action_name: nil, first_model: false}

      acts_as_sitemap :show, title: :show_title,
                                handler: {action_name: :my_action,
                                          first_model: false,
                                          my_attribute: :my_value},
                                segments: {id: :my_id,
                                            sub_id: :book_id,
                                            title: :my_title}

    end

    a = ActsAsSitemap04TestObject01.new

    assert HashModel.verify("unit/sitemap/models/test05", a.sitemap_attributes_hash)

  end

  ##################################################################################
  test "object acts_as_sitemap title: :my_title" do

    # reset here in case other tests bigfoot the class variables.
    DuckMap::Config.reset

    class ActsAsSitemap01TestObject02
      include DuckMap::InheritableClassAttributes
      include DuckMap::Attributes
      include DuckMap::SitemapObject

      acts_as_sitemap :default, title: :default_title,
                                keywords: "moe larry the cheese",
                                description: "this is a test",
                                priority: "0.4",
                                changefreq: "monthly"

      acts_as_sitemap :edit, title: "edit_title",
                                keywords: "rails duck_map",
                                description: "testing duck map",
                                priority: "0.6",
                                changefreq: "yearly",
                                canonical: "http://localhost:3000/",
                                canonical_host: "example.com",
                                url_format: "xml",
                                url_limit: 4000

      acts_as_sitemap :index, title: nil,
                                keywords: nil,
                                description: nil,
                                priority: nil,
                                changefreq: nil,
                                lastmod: nil,
                                url_limit: 8000

      acts_as_sitemap :new, title: :new_title,
                                handler: {action_name: nil, first_model: false}

      acts_as_sitemap :show, title: :show_title,
                                handler: {action_name: :my_action,
                                          first_model: false,
                                          my_attribute: :my_value},
                                segments: {id: :my_id,
                                            sub_id: :book_id,
                                            title: :my_title}

    end

    assert HashModel.verify("unit/sitemap/models/test05", ActsAsSitemap01TestObject02.sitemap_attributes_hash)

  end

  ##################################################################################
  test "sitemap_handler and sitemap_segments" do

    # reset here in case other tests bigfoot the class variables.
    DuckMap::Config.reset

    class ActsAsSitemap04TestObject01
      include DuckMap::InheritableClassAttributes
      include DuckMap::Attributes
      include DuckMap::SitemapObject

      acts_as_sitemap :default, title: :default_title,
                                keywords: "moe larry the cheese",
                                description: "this is a test",
                                priority: "0.4",
                                changefreq: "monthly"

      acts_as_sitemap :edit, title: "edit_title",
                                keywords: "rails duck_map",
                                description: "testing duck map",
                                priority: "0.6",
                                changefreq: "yearly",
                                canonical: "http://localhost:3000/",
                                canonical_host: "example.com",
                                url_format: "xml",
                                url_limit: 4000

      acts_as_sitemap :index, title: nil,
                                keywords: nil,
                                description: nil,
                                priority: nil,
                                changefreq: nil,
                                lastmod: nil,
                                url_limit: 8000

      acts_as_sitemap :new, title: :new_title
      sitemap_handler :new, action_name: nil, first_model: false

      acts_as_sitemap :show, title: :show_title
      sitemap_handler :show, action_name: :my_action, first_model: false, my_attribute: :my_value
      sitemap_segments :show, id: :my_id, sub_id: :book_id, title: :my_title

    end

    a = ActsAsSitemap04TestObject01.new

    assert HashModel.verify("unit/sitemap/models/test05", a.sitemap_attributes_hash)

  end

end


text:
namespace System.Windows.Forms
{
    using System;
    using System.Drawing;
    using System.Diagnostics;
    using System.ComponentModel;

    /// <include file='doc\DataGridViewDataErrorEventArgs.uex' path='docs/doc[@for="DataGridViewDataErrorEventArgs"]/*' />
    public class DataGridViewDataErrorEventArgs : DataGridViewCellCancelEventArgs
    {
        private Exception exception;
        private bool throwException;
        private DataGridViewDataErrorContexts context;

        /// <include file='doc\DataGridViewDataErrorEventArgs.uex' path='docs/doc[@for="DataGridViewDataErrorEventArgs.DataGridViewDataErrorEventArgs"]/*' />
        public DataGridViewDataErrorEventArgs(Exception exception,
            int columnIndex,
            int rowIndex,
            DataGridViewDataErrorContexts context) : base(columnIndex, rowIndex)
        {
            Debug.Assert(rowIndex > -1);
            this.exception = exception;
            this.context = context;
        }

        /// <include file='doc\DataGridViewDataErrorEventArgs.uex' path='docs/doc[@for="DataGridViewDataErrorEventArgs.Context"]/*' />
        public DataGridViewDataErrorContexts Context
        {
            get
            {
                return this.context;
            }
        }

        /// <include file='doc\DataGridViewDataErrorEventArgs.uex' path='docs/doc[@for="DataGridViewDataErrorEventArgs.Exception"]/*' />
        public Exception Exception
        {
            get
            {
                return this.exception;
            }
        }

        /// <include file='doc\DataGridViewDataErrorEventArgs.uex' path='docs/doc[@for="DataGridViewDataErrorEventArgs.ThrowException"]/*' />
        public bool ThrowException
        {
            get
            {
                return this.throwException;
            }
            set
            {
                if (value && this.exception == null)
                {
                    throw new ArgumentException(SR.GetString(SR.DataGridView_CannotThrowNullException));
                }
                this.throwException = value;
            }
        }
    }
}


text:
class PropertyOwner < ActiveRecord::Base
  has_many  :buildings
  has_many  :ellis_acts

  has_many  :tenants, through: :buildings

  has_many  :harassments, through: :buildings
  has_many  :fix_orders, through: :buildings
  has_many  :rent_notices, through: :buildings
  has_many  :eviction_notices, through: :buildings
end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="hu.diveino.droid.BleDeviceListActivity">

    <ListView
        android:id="@+id/bleDevicesListView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</LinearLayout>


text:
<?php

Loader::load('controller', 'portfolio/DefaultPageController');

class ContactController extends DefaultPageController
{

    protected function set_head_data()
    {
        $this->set_title("Contact Page | Jacob Emerick's Portfolio");
        $this->set_description("Contact page for Jacob Emerick's Portfolio");
        $this->set_keywords([
            'portfolio',
            'programming portfolio',
            'contact',
            'Jacob Emerick',
            'information',
            'freelance',
        ]);
    }

    protected function set_body_data()
    {
        $this->set_body('body_view', 'Contact');

        $body_data = [];
        if (!empty($_POST)) {
            $body_data = $this->process_form_data();
        }
        $body_data['domain_container'] = $this->get_domain_container();
        $this->set_body('body_data', $body_data);

        parent::set_body_data();
    }

    private function process_form_data()
    {
        $errors = [];

        if (
            empty($_POST['name']) ||
            !is_string($_POST['name']) ||
            strlen($_POST['name']) > 100
        ) {
            $errors['name'] = 'Please enter a valid name.';
        }

        if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
            $errors['email'] = 'Please enter a valid email.';
        }

        if (
            empty($_POST['message']) ||
            !is_string($_POST['message']) ||
            strlen($_POST['message']) > 10000
        ) {
            $errors['message'] = 'Please enter a valid message.';
        }

        if (!empty($errors)) {
            $values = $_POST;
            $values = array_intersect_key($values, array_flip([
                'name',
                'email',
                'message',
            ]));

            return [
                'errors' => $errors,
                'values' => $values,
            ];
        }

        $message = [
            "Name: {$_POST['name']}",
            "Email: {$_POST['email']}",
            '',
            'Message:',
            $_POST['message'],
        ];
        $message = implode("\n", $message);

        global $container;
        $container['mail']
            ->addTo($container['config']->admin_email)
            ->setSubject('Portfolio Contact')
            ->setPlainMessage($message)
            ->send();

        return [
            'success' =>
                "Thank you for your message, {$_POST['name']}! " .
                "I'll get back to you as soon as possible."
        ];
    }
}