text:
<?xml version="1.0"?>
<!-- -->

<document>
    <properties>
        <title>Changes</title>
    </properties>
    <body>
        <release version="4.0.18" date="2021-12-22" description="Maintenance">
            <action dev="benoitx" type="fix">Update Dependencies.</action>
        </release>
        <release version="4.0.17" date="2021-12-22" description="Maintenance">
            <action dev="benoitx" type="fix">Upgrades to Lombok and SLF4j.</action>
        </release>
        <release version="4.0.16" date="2021-11-01" description="Maintenance">
            <action dev="benoitx" type="fix" due-to="srikanthprathi">Fixed Security issue for XXE.</action>
        </release>
        <release version="4.0.15" date="2021-09-17" description="Maintenance">
            <action dev="benoitx" type="fix">Fixed when new line of a multi line starts with "".</action>
        </release>
        <release version="4.0.14" date="2021-09-16" description="Maintenance">
            <action dev="benoitx" type="fix">Fixed esoteric Delimiter multi-line issue if the CR is just at the end of the String and the next line is the qualifier.</action>
        </release>
        <release version="4.0.13" date="2021-09-16" description="Small Improvement">
            <action dev="benoitx" type="add">WriterOptions provides option to replace newLine/CarriageReturn in a string.</action>
        </release>
        <release version="4.0.12" date="2021-09-09" description="Maintenance">
            <action dev="benoitx" type="add">DataError may contain last Column Name and Value for better investigation.</action>
        </release>
        <release version="4.0.11" date="2021-09-09" description="Maintenance">
            <action dev="benoitx" type="add">Improve error message for the too few columns error.</action>
        </release>
        <release version="4.0.10" date="2021-09-09" description="Maintenance">
            <action dev="benoitx" type="add">Improve error message for the too few columns error.</action>
        </release>
        <release version="4.0.9" date="2021-09-09" description="Maintenance">
            <action dev="benoitx" type="add">Error for 'too few columns' will attempt to show the last column parsed (most likely with issue).</action>
        </release>
        <release version="4.0.8" date="2021-09-08" description="Maintenance">
            <action dev="benoitx" type="fix">Fix issue if multi-line starts with first or last character..</action>
        </release>
        <release version="4.0.7" date="2021-09-08" description="Maintenance">
            <action dev="benoitx" type="fix">Multi line did not cope with a true empty line part of a group.</action>
        </release>
        <release version="4.0.6" date="2021-09-08" description="Maintenance">
            <action dev="mvlakh" type="fix" issue="63" due-to="mvlakh">Issues with multi-lines.</action>
        </release>
        <release version="4.0.5" date="2021-05-30" description="Maintenance">
            <action dev="benoitx" type="fix">Fixing default LocalDate Parsing to be ISO 8601 and add the ability to give a DateTimeFormatter to the
                parser.</action>
            <action dev="omarsmak" type="update">Update libraries to work under Java 16/17.</action>
            <action dev="mvlakh" type="fix" issue="60" due-to="mvlakh">Issues when parsing CSV files that extensively use text qualifiers.</action>
        </release>
        <release version="4.0.4" date="2019-01-06" description="Maintenance">
            <action dev="benoitx" type="fix">Fixing issue with comma inside double quote (delimiter inside qualifier).</action>
            <action dev="benoitx" type="update">Fixing ability to handle '\uFEFF' dodgy character.</action>
        </release>
        <release version="4.0.3" date="2018-08-04" description="Maintenance">
            <action dev="benoitx" type="update">Fixing SonaCloud.io issues</action>
            <action dev="benoitx" type="add" issue="44">Create an Excel module and remove dependency on JExcelAPI for the main Flatpack, see
                ExcelTransformer.
            </action>
            <action dev="benoitx" type="add">Create CsvParserFactory as an easy way to get one of the most common CSV Parser.</action>
            <action dev="benoitx" type="remove">Removed Version class.</action>
        </release>
        <release version="4.0.2" date="2018-07-21" description="Maintenance">
            <action dev="benoitx" type="add">
                new option to automatically "de-duplicate" column names by appending a number at the end of it if it
                already exist. This is off by default but can be
                set via call to parser.setAddSuffixToDuplicateColumnNames(true).
            </action>
            <action dev="benoitx" type="fix">
                RowRecord.getBigDecimal should trim the string to avoid potential parsing issues.
            </action>
            <action dev="benoitx" type="fix" issue="27" due-to="benoitx">Delimiter Writer does not handle field ending with new line.</action>
            <action dev="benoitx" type="fix" issue="33" due-to="benoitx">CSV Writer not compliant with RFC4180, Thanks to Martin Diphoorn for the patch.
                Also fixed some
                reader issues for double qualifiers.
            </action>
            <action dev="benoitx" type="update" issue="11" due-to="benoitx">Remove JDOM's depencency.</action>
            <action dev="martindiphoorn" type="update" issue="36" due-to="martindiphoorn">Adding tests for strict RFC4180 (CSV) compliance.</action>
            <action dev="benoitx" type="update" issue="28">It transpired that String.replace is very inefficient and we replaced it with the Apache
                Commons equivalent. 50% speed improvement.</action>
        </release>
        <release version="4.0.1" date="2014-12-10" description="Maintenance">
            <action dev="ks-appendium" type="fix" issue="10">When parsing a header column, trim the leading and trailing spaces.</action>
            <action dev="benoitx" type="fix" issue="16" due-to="dkulp">Mark jxl imports optional in OSGi.</action>
            <action dev="ks-appendium" type="fix" issue="15" due-to="ks-appendium">Need to handle multi-line.</action>
            <action dev="benoitx" type="fix" issue="14" due-to="moffatn">Fix for java.lang.NullPointerException
                at
                net.sf.flatpack.DefaultDataSet.getString.
            </action>
            <action dev="ks-appendium" type="fix" issue="13" due-to="antubis23">Fix DelimiterWriter not consistent with ParserUtils</action>
        </release>
        <release version="4.0.0" date="2014-10-01" description="Move to JDK8">
            <action dev="benoitx" type="add" issue="8">dataSet.getRecord should never return null, use java.util.Optional.</action>
            <action dev="benoitx" type="add" issue="4">Writer interface is now more 'fluent'.</action>
            <action dev="benoitx" type="add" issue="1">Writer is now Autocloseable.</action>
            <action dev="benoitx" type="add" issue="2">StreamingDataSet has stream() method for JDK8 manipulation.</action>
            <action dev="benoitx" type="add" issue="3">Records interface defines getXXX methods with a Supplier interface.</action>
            <action dev="benoitx" due-to="ovstetun" type="add" issue="6">Preserve leading/trailing whitespace, Thanks to Trond Ovstetun.
            </action>
            <action dev="benoitx" due-to="SvenNold" type="add" issue="9">isRecordID NPE if using absolute.</action>
        </release>
        <release version="3.4.2" date="2014-09-02" description="Maintenance">
            <action dev="benoitx" type="fix" issue="9" due-to="SvenNold">Fix for NPE in isRecordID if using absolute.</action>
        </release>
        <release version="3.4.0" date="2014-05-23" description="Maintenance, JDK1.5 and fluent">
            <action dev="benoitx" type="add">Add convenience method
                DefaultParserFactory.newCsvParser.
            </action>
            <action dev="benoitx" type="add">Make interface more 'fluent'.
            </action>
            <action dev="benoitx" type="fix">Use JDK 1.5.</action>
            <action dev="zepernick" type="add">Ability to over ride the table names for DATAFILE and
                DATASTRUCTURE when using the DB for the MetaData.
            </action>
            <action dev="zepernick" type="fix">DBDelimitedParser was trying to
                build column names from the first record when ignore first was set to
                false.
                Column mappings should always come from the DB for this class.
            </action>
            <action dev="zepernick" type="add">BuffReader Parser now support
                Database Column Mappings
            </action>
            <action dev="zepernick" type="fix">DelimiterWriter now also quotes
                elements that contain a
                qualifier. It was previously only checking to
                see if the
                data contained a
                delmiter.
            </action>
            <action dev="zepernick" type="add">Added a
                setNumericColumns(String[]) to the ExcelTransformer.
                Any columns contained in the array will be
                written
                to Excel as a
                Numeric instead of a Text field.
            </action>
            <action dev="zepernick" type="add">Added the ability to use the
                DelimiterWriter with no column
                mappings. Added new class
                DelimiterWriterOptions to
                achieve this.
            </action>
            <action dev="zepernick" type="add">Fixed and Delimiter writers now
                support multiple record
                types in the same file.
            </action>
        </release>
        <release version="3.2.0" date="2010-03-03" description="New parse options">
            <action dev="benoitx" type="add">Added a getBigDecimal method on
                DataSet.
            </action>
            <action dev="zepernick" type="fix">Fixed SF Bug 1869636. The
                parameters for the XML Map and
                data file were reversed in the
                BuffReaderDelimParser.
            </action>
            <action dev="zepernick" type="update">Added optional 3rd parameter to
                the OrderColumn constructor which
                allows the specification of the type
                of column
                being sorted:
                OrderColumn.COLTYPE_STRING, OrderColumn.COLTYPE_DATE,
                OrderColumn.COLTYPE_NUMERIC
            </action>
            <action dev="zepernick" type="update">New Parser option to log the raw
                line data of the record in the
                DataSet object.
                Parser.setStoreRawDataToDataSet()
            </action>
            <action dev="zepernick" type="fix">Stopped the fixed width parser
                from removing leading spaces in a data element.
                Added the
                ParserUtils.rTrim()
                method.
            </action>
            <action dev="zepernick" type="update">Added getLong() to DataSet
                interface
            </action>
            <action dev="zepernick" type="fix">Added check for duplicate column
                names when using file
                header for column names.
            </action>
            <action dev="zepernick" type="fix">Applied patch from Dirk Olmes to
                prevent duplicate
                column names in the XML mapping.
                IllegalArgumentException is
                now thrown if
                a duplicate
                column name exists in the map. Thanks Dirk...
            </action>
            <action dev="zepernick" type="fix">doParse() on DBFixedLengthParser
                was returning a null
                and was never getting a DataSet returned
            </action>
            <action dev="zepernick" type="update">Added an option on the Paser
                setFlagEmptyRows().
                This will make the DataSet.isRowEmpty() method
                available. This
                method
                will return
                true when there is no data on any columns in the row.
            </action>
            <action dev="zepernick" type="update">New Parser option to log the raw
                line data in the
                DataError object for parse errors.
                Parser.setStoreRawDataToDataError()
            </action>
        </release>
        <release version="3.1.1" date="2007-10-01" description="Fix">
            <action dev="zepernick" type="fix">[1818818] ClassCastException when
                accessing header or trailer records
            </action>
            <action dev="zepernick" type="fix">Fixed bug in delimited parse when
                using Reader for data and map. Parameters
                were being reversed in the
                code.
            </action>
            <action dev="zepernick" type="fix">[1811210] When parsing multi-line
                delimited files, blank lines inside the
                elements were being removed
                from the
                result of the parse. Blank lines inside
                a delimited element
                were also causing a StringIndexOutOfBoundsException.
            </action>
        </release>
        <release version="3.1.0" date="2007-09-10" description="Name and structure change and new writers">
            <action dev="benoitx" type="add">Paul and I would like to thank Dirk
                Holmes and Holger Hoffstatte from MuleSource for the initial
                contribution to
                the writer package.
                The writer package will let you EXPORT a DataSet in a fixed length or
                Delimited (csv, etc) format.
                Thanks guys!
            </action>
            <action dev="zepernick" type="update">added contains() method to
                DataSet to check for the existance of
                a column name on the current row.
                DataSet must
                be on a valid row.
            </action>
            <action dev="zepernick" type="update">Added clearRows(), clearErrors(),
                and clearAll() methods to DataSet
            </action>
            <action dev="benoitx" type="update">Goodbye PZFileReader, Hello
                FlatPack!!!
            </action>
            <action dev="zepernick" type="update">Moved package strcuture from
                net.sf.pzfilereader to net.sf.flatpack
            </action>
            <action dev="zepernick" type="update">XML mapping dtd renamed from
                pzfilereader.dtd to flatpack.dtd
            </action>
            <action dev="zepernick" type="update">pzconvert.properties renamed to
                fpconvert.properties
            </action>
            <action dev="zepernick" type="update">The following classes had the
                "PZ" removed from their name;
                PZMapParser, PZMetaData,
                BuffReaderDelimPZParser,
                BuffReaderFixedPZParser,
                BuffReaderPZDataSet,
                BuffReaderPZParseFactory, AbstractDelimiterPZParser,
                AbstractFixedLengthPZParser,
                AbstractPZParser,
                DBDelimiterPZParser, DBFixedLengthPZParser, DefaultPZParserFactory, DelimiterPZParser,
                FixedLengthPZParser, PZParser, PZParserFactory, PZConverter
            </action>
            <action dev="zepernick" type="update">The following classes had the
                "PZ" changed to "FP" in their name;
                PZConstants, PZStringUtils,
                PZConvertException
            </action>
            <action dev="benoitx" type="update">Created a PZMetaData class for
                internal use, it contains the list of column names and index for
                fast
                access.
            </action>
            <action dev="zepernick" type="update">Feature Request 1596087. Added
                attribute "elementCount" on record
                element mapping, which can determine a
                header,
                trailer, or detail record by
                the number of elements contained
                on the record. This only applies to delimited files.
            </action>
            <action dev="zepernick" type="update">Feature Request 1569891. Added
                setNullEmptyStrings to the
                PZParser. This will make the
                DataSet.getString() return
                null if the column is
                empty.
            </action>
            <action dev="zepernick" type="update">Added option to the PZParser
                setIgnoreParseWarnings(boolean).
                When true, the parser will not log warning
                into the
                error collection in
                the DataSet. The
                default is false.
            </action>
            <action dev="zepernick" type="update">Removing deprecated methods in
                ParserUtils;
                isMultiLine(), splitLine(), getCMDKeyForFixedLengthFile()
            </action>
            <action dev="zepernick" type="update">Added option to PZParser
                setColumnNamesCaseSensitive().
                This will force the user to lookup the column
                value in
                the exact same
                case as the column was specified
                in the mapping or file. Deprecated the current method signatures
                for;ParserUtils.buidColumnIndexMap,
                ParserUtils.getColumnIndex,ParserUtils.getColumnMDFromFile. Added
                PZParser parameter to new
                signatures,
                however, this parameter CAN BE null.
                Registered PZParser with the
                DefaultDataSet. This will provide
                the ability to see what
                options were set pertaining to data retrieval.
            </action>
            <action dev="zepernick" type="update">Changing the PZParseFactory to
                use java.io.Reader instead of File
                or InputStream. The File and
                InputStream
                methods are still available,
                but are now deprecated.
            </action>
            <action dev="zepernick" type="update">Removed deprecated
                PZMapParser.parse(File).
                Added PZMapParser.parse(Reader). Deprecated
                PZMapParser.parse(InputStream).
            </action>
            <action dev="zepernick" type="fix">Stopped column lookup from being
                case sensitive
            </action>
            <action dev="zepernick" type="update">Feature Request 1566626. Added
                setIgnoreExtraColumns() method to the PZParser.
                Added the ability to
                ignore extra
                columns/bytes from delimited &
                fixed width files. Data is truncated when it goes
                outside of the column definition.
            </action>
        </release>
        <release version="3.0.0" date="2007-02-11" description="Move to Maven and Subversion">
            <action dev="zepernick" type="update">Added new dependency, SLF4j. This
                is used to log parsing issues. SLF4j is a facade
                to the following
                loggers;
                log4j, jcl, nop, and jdk 1.4. See 3.0 User
                Doc for further instruction.
            </action>
            <action dev="zepernick" type="update">DataSet.getDate() will now return
                a null on empty Strings
            </action>
            <action dev="zepernick" type="update">Removed
                ParserUtils.getColumnMDFromFile(InputStream, String, String) this
                method
                was deprecated in 2.2
            </action>
            <action dev="zepernick" type="update">Removed setters and default
                constructor from DataError. Error properties
                are set through the new
                constructor.
            </action>
            <action dev="zepernick" type="add">added the ability to limit the
                column which are exported to Excel in the ExcelTransformer class
            </action>
            <action dev="zepernick" type="add">added getObject(String column,
                Class toConvert) method. PZFileReader will ship with
                default classes to
                handle
                conversions. Custom conversions can be easily
                added by adding to the pzconvert.properties
            </action>
            <action dev="zepernick" type="add">Unqualified elements have leading
                and trailing whitespace removed in a delimited parse
            </action>
            <action dev="zepernick" type="add">Ability to issue an OrderBy On
                DataSet's containing record mapping elements
            </action>
            <action dev="benoitx" type="add">Move build to Maven 1.1.x and
                generate the entire website from the build.
            </action>
            <action dev="benoitx" type="fix">Modify code following warning by
                Findbugs, checkstyle and PMD.
            </action>
            <action dev="marchy" type="add">Move to Subversion.</action>
        </release>
        <release version="2.2.2" date="2006-08-18" description="Fix">
            <action dev="zepernick" type="fix">Fixed bug in LargeDataSet.
                Multiline delimited records were not being parsed correctly. They
                were
                showing
                up as
                errors when being parsed.
            </action>
        </release>
        <release version="2.2.1" date="2006-08-12" description="Fix">
            <action dev="zepernick" type="fix">Fixed a bug in the delimited
                parser. Errors were caused by multiple column multi-line records.
                Special
                thanks
                to
                Malcolm Dobson for bringing the bug to attention and providing the
                fix.
            </action>
        </release>
        <release version="2.2.0" date="2006-06-11" description="Fix">
            <action dev="zepernick" type="fix">When using column names out of
                the CSV file 2 input streams were being created. One to read the
                file and
                the other
                to get the column names. This has been reduced to one.
            </action>
            <action dev="zepernick" type="add">Added a new constructor to have
                the ability to provide an InputStream when reading columns from the
                file.
            </action>
            <action dev="zepernick" type="add">Added a LargeDataSet class. This
                should be used to read large files. It provides the ability to read
                large
                files
                without reading them into memory. The following methods are not
                applicable for this class;
                previous(), writeToExcel,
                orderRows(), absolute(),
                remove(), getIndex(),
                goBottom(), goTop(),
                setValue(). An exception will be thrown if these are called.
            </action>
            <action dev="zepernick" type="add">Added the ability to specify
                Header, Trailer, or other records which can be uniquly identified by
                a
                piece
                of data
                on the record. These get mapped to their own set of column
                names seperate from the detail records.
                See the documentation
                included in the download
                for details on the new
                options in the mapping file.
            </action>
            <action dev="zepernick" type="add">Added setDebug(boolean) to
                PZMapParser class. When flagged true, the Parser will spit the
                results of the
                XML
                parse to the console
            </action>
            <action dev="zepernick" type="add">Added 2 new samples;
                CSVHeaderAndTrailer, FixedLengthHeaderAndTrailer.
            </action>
        </release>

        <release version="2.1.0" date="2006-02-26" description="Maintenance">
            <action dev="zepernick" type="fix">A VERY Special Thanks to Roland
                Klein for contributing the following enchancements:
                - Ability to read a
                file from
                an InputStream, File object support
                still exists. This enhancement makes pzfilereader Java Web Start
                friendly :)
                - Added a
                method in ParserUtils to
                create an InputStream from a File
                object.
                - Changed all ArrayLists and Vectors to List objects. This affects
                the
                getErrors() method which was
                returning
                a Vector. This may potentially cause compilation errors if migrating
                from a previous version..
            </action>
            <action dev="zepernick" type="add">Implemented Roland's changed in
                cvs HEAD
            </action>
            <action dev="zepernick" type="fix">Removed constructors deprecated
                in 2.0.0
            </action>
            <action dev="zepernick" type="add">Added ability to parse delimited
                file which have records spanning multiple lines in the file. The
                element
                which is
                breaking to the next line must be qualified. The data can be
                qualified with any char, a double quote
                is used in the
                example.

                ie. element, element,
                "element with line break
                more element data
                more element data
                more element data"
                start next rec here
            </action>
            <action dev="zepernick" type="add">Begining to write some simple
                Junit tests under com.test.* These will be excluded from the
                production
                jar.
            </action>
            <action dev="zepernick" type="add">Added getRowCount() method. This
                returns the total amount of rows parsed from the file. Rows which
                had
                errors
                during the parse are excluded from this count and are added to the error
                collection.
            </action>
            <action dev="zepernick" type="add">Added getReaderVersion() method.
                This will return a String representation for the pzFileReader
                version
                being
                used.
            </action>
            <action dev="zepernick" type="add">Added ability to transform a
                DataSet into excel. This utilizes JExcelApi which can be found here:
                http://sourceforge.net/projects/jexcelapi. The jxl.jar has been
                included in the download for your convience and must be on the
                classpath if using
                this
                new method --> writeToExcel(File) in the DataSet class
            </action>
            <action dev="zepernick" type="add">Changed examples to work with
                2.1.0. Some examples still refered to deprecated constructors from
                2.0.0
                which have
                been removed in this version.
            </action>
            <action dev="zepernick" type="add">Added 2 new examples to
                demonstrate the export to Excel and the parsing of multiline
                records.
            </action>
            <action dev="zepernick" type="add">Updated Java Docs.
            </action>
        </release>

        <release version="2.0.0" date="2005-11-27" description="Maintenance">
            <action dev="zepernick" type="add">Re-coded the way the MetaData was
                being stored. It was being duplicated for every row in the file. It
                is now only
                being stored
                once for the entire file. This will drastically reduce memory usage.
            </action>
            <action dev="zepernick" type="add">Created a ParserUtils class. This
                class can be used to perform low level reads if needed (no mapping
                file
                required).
                For now, this change only applies to delimited files.
            </action>
            <action dev="zepernick" type="add">Changed the delimited file parser
                to use a StringBuffer. It was performing a lot of String
                concatinations which
                could have been
                bogging down performance, and creating un-necessary overhead.
            </action>
            <action dev="zepernick" type="add">created ANT build build file, and
                published to CVS
            </action>
            <action dev="zepernick" type="add">Removed the use of the Column
                object. This was able to cut down on the parse time.
            </action>
            <action dev="zepernick" type="add">Add patch provided by Luke
                Driscoll [1371162]. This provides 2 new constructors for fixed
                length files.
                There is
                a boolean
                that can now be passed which will tell the parser to allow lines which
                are shorter then the allowed line length for a
                record.
                Missing
                columns will be filled in with empties.
            </action>
            <action dev="zepernick" type="add">The following objects in the
                DataSet are now public; rows, errors, columnMD, empty constructor.
                This
                allows for
                the DataSet class to be extended if needed to
                provide custom functionality.
            </action>
            <action dev="zepernick" type="add">Took patch [1371162] a step
                further and also implemented for delimited files. If the row is
                missing any
                columns,
                the parser
                will automatically add the columns in as empty's. This functionality
                happens only when the handleShortLines parameter
                is set
                to true.
            </action>
            <action dev="zepernick" type="add">Revamped user documenation. The
                user documenation is now much more detailed. User documentation and
                Java Docs are
                now
                included with the distribution instead of having them in seperate downloads.
            </action>
        </release>
        <release version="1.0.5" date="2005-10-01" description="Maintenance">
            <action dev="zepernick" type="fix">Fixed bug in delimited parse. If
                the last column of the last column of the file was empty, the row
                was
                being
                logged to the
                "errors" collection. Thank you very much to Luke Driscoll who found this bug
                and submitted the patch. See bug
                [
                1275910 ] CSV File with
                blank last column, for more information.
            </action>
            <action dev="zepernick" type="fix">While fixing bug 1275910, a
                couple of other bugs were brought to light. Spaces before or after
                the
                delimiter with
                a text qualifier
                was breaking the parse. Example...assuming comma as delimter and double
                quote as the text qualifier.
                "value1" , "value2" ,"value"
            </action>
            <action dev="zepernick" type="add">Added new method, freeMemory(),
                when called, the DataSet is cleared.
            </action>
            <action dev="zepernick" type="add">Updated examples and JavaDocs.
            </action>
        </release>
        <release version="1.0.4" date="2005-07-20" description="Maintenance">
            <action dev="zepernick" type="fix">Fixed bug in delimited parse. If
                parsing a delimited file with text qualifiers, and the last column
                of a
                line had
                hard spaces at the end, a string out of bounds exception was
                being thrown.
            </action>
            <action dev="zepernick" type="fix">Added
                setStrictNumericParse(boolean) method. This is defaulted to false.
                When calling getDouble or
                getInt
                on a
                column, all non numeric chars will be striped before performing
                the parse. If the column is empty after the strip, it will be
                returned as 0. Setting
                this to true will parse all numeric values as
                is.
            </action>
        </release>

        <release version="1.0.3" date="2005-05-02" description="Maintenance">
            <action dev="zepernick" type="add">added methods to set data in
                DataSet to all lower or all upper case setLowerCase(),
                setUpperCase()
            </action>
            <action dev="zepernick" type="add">Changed the OrderBy class to make
                sure the elements being compared were the same case, so as not to
                make
                case a
                factor when comparing. If they are not the same case elements are
                converted to lower before comparing.
            </action>
            <action dev="zepernick" type="add">Added setLowerCase() and
                setUpperCase() to Java Docs
            </action>
            <action dev="zepernick" type="add">Added JSP example to samples
            </action>
        </release>

        <release version="1.0.2" date="2005-01-27" description="Maintenance">
            <action dev="zepernick" type="add">Changed parsing logic for
                delimited files with text qualifiers. The parser will now parse
                lines that are
                qualified
                and not qualified. For example:
                "here",1234,"test",50,test
                This will now parse into 5 seperate columns. However if the text
                contains a
                delimiter or seperator inside the text, it must be
                qualified to work correctly.
            </action>
        </release>

        <release version="1.0.1" date="2005-01-23" description="Maintenance">
            <action dev="zepernick" type="fix">Fixed bug in delimted parse. If
                no elements were found in a line, a string index out of bounds
                exception was
                thrown.
            </action>
            <action dev="zepernick" type="fix">Added
                getDate(String,SimpleDateFormat). By default, the current
                getDate(String) method
                was expecting the
                date in
                yyyyMMdd format. This method allows for
                another date format to be
                specified. This format should match the format in the text
                file. If you would
                like
                to change the
                formating of the date after it is returned from the DataSet, you can use
                SimpleDateFormat.format(Date)
            </action>
            <action dev="zepernick" type="fix">Corrected javadocs for the
                getDate methods. Had return type of double, changed to Date.
            </action>
            <action dev="zepernick" type="fix">Added samples
            </action>
        </release>

    </body>
</document>


text:
package capabilities

import (
	"reflect"
	"testing"

	api "k8s.io/kubernetes/pkg/apis/core"
	"k8s.io/kubernetes/pkg/apis/extensions"
)

func TestGenerateAdds(t *testing.T) {
	tests := map[string]struct {
		defaultAddCaps []api.Capability
		containerCaps  *api.Capabilities
		expectedCaps   *api.Capabilities
	}{
		"no required, no container requests": {},
		"no required, no container requests, non-nil": {
			containerCaps: &api.Capabilities{},
			expectedCaps:  &api.Capabilities{},
		},
		"required, no container requests": {
			defaultAddCaps: []api.Capability{"foo"},
			expectedCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
		},
		"required, container requests add required": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
			expectedCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
		},
		"multiple required, container requests add required": {
			defaultAddCaps: []api.Capability{"foo", "bar", "baz"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
			expectedCaps: &api.Capabilities{
				Add: []api.Capability{"bar", "baz", "foo"},
			},
		},
		"required, container requests add non-required": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"bar"},
			},
			expectedCaps: &api.Capabilities{
				Add: []api.Capability{"bar", "foo"},
			},
		},
		"generation does not mutate unnecessarily": {
			defaultAddCaps: []api.Capability{"foo", "bar"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo", "foo", "bar", "baz"},
			},
			expectedCaps: &api.Capabilities{
				Add: []api.Capability{"foo", "foo", "bar", "baz"},
			},
		},
		"generation dedupes": {
			defaultAddCaps: []api.Capability{"foo", "bar"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo", "baz"},
			},
			expectedCaps: &api.Capabilities{
				Add: []api.Capability{"bar", "baz", "foo"},
			},
		},
		"generation is case sensitive - will not dedupe": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"FOO"},
			},
			expectedCaps: &api.Capabilities{
				Add: []api.Capability{"FOO", "foo"},
			},
		},
	}

	for k, v := range tests {
		container := &api.Container{
			SecurityContext: &api.SecurityContext{
				Capabilities: v.containerCaps,
			},
		}

		strategy, err := NewDefaultCapabilities(v.defaultAddCaps, nil, nil)
		if err != nil {
			t.Errorf("%s failed: %v", k, err)
			continue
		}
		generatedCaps, err := strategy.Generate(nil, container)
		if err != nil {
			t.Errorf("%s failed generating: %v", k, err)
			continue
		}
		if v.expectedCaps == nil && generatedCaps != nil {
			t.Errorf("%s expected nil caps to be generated but got %v", k, generatedCaps)
			continue
		}
		if !reflect.DeepEqual(v.expectedCaps, generatedCaps) {
			t.Errorf("%s did not generate correctly.  Expected: %#v, Actual: %#v", k, v.expectedCaps, generatedCaps)
		}
	}
}

func TestGenerateDrops(t *testing.T) {
	tests := map[string]struct {
		defaultAddCaps   []api.Capability
		requiredDropCaps []api.Capability
		containerCaps    *api.Capabilities
		expectedCaps     *api.Capabilities
	}{
		"no required, no container requests": {
			expectedCaps: nil,
		},
		"no required, no container requests, non-nil": {
			containerCaps: &api.Capabilities{},
			expectedCaps:  &api.Capabilities{},
		},
		"required drops are defaulted": {
			requiredDropCaps: []api.Capability{"foo"},
			expectedCaps: &api.Capabilities{
				Drop: []api.Capability{"foo"},
			},
		},
		"required drops are defaulted when making container requests": {
			requiredDropCaps: []api.Capability{"baz"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"foo", "bar"},
			},
			expectedCaps: &api.Capabilities{
				Drop: []api.Capability{"bar", "baz", "foo"},
			},
		},
		"required drops do not mutate unnecessarily": {
			requiredDropCaps: []api.Capability{"baz"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"foo", "bar", "baz"},
			},
			expectedCaps: &api.Capabilities{
				Drop: []api.Capability{"foo", "bar", "baz"},
			},
		},
		"can drop a required add": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"foo"},
			},
			expectedCaps: &api.Capabilities{
				Drop: []api.Capability{"foo"},
			},
		},
		"can drop non-required add": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"bar"},
			},
			expectedCaps: &api.Capabilities{
				Add:  []api.Capability{"foo"},
				Drop: []api.Capability{"bar"},
			},
		},
		"defaulting adds and drops, dropping a required add": {
			defaultAddCaps:   []api.Capability{"foo", "bar", "baz"},
			requiredDropCaps: []api.Capability{"abc"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"foo"},
			},
			expectedCaps: &api.Capabilities{
				Add:  []api.Capability{"bar", "baz"},
				Drop: []api.Capability{"abc", "foo"},
			},
		},
		"generation dedupes": {
			requiredDropCaps: []api.Capability{"baz", "foo"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"bar", "foo"},
			},
			expectedCaps: &api.Capabilities{
				Drop: []api.Capability{"bar", "baz", "foo"},
			},
		},
		"generation is case sensitive - will not dedupe": {
			requiredDropCaps: []api.Capability{"bar"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"BAR"},
			},
			expectedCaps: &api.Capabilities{
				Drop: []api.Capability{"BAR", "bar"},
			},
		},
	}
	for k, v := range tests {
		container := &api.Container{
			SecurityContext: &api.SecurityContext{
				Capabilities: v.containerCaps,
			},
		}

		strategy, err := NewDefaultCapabilities(v.defaultAddCaps, v.requiredDropCaps, nil)
		if err != nil {
			t.Errorf("%s failed: %v", k, err)
			continue
		}
		generatedCaps, err := strategy.Generate(nil, container)
		if err != nil {
			t.Errorf("%s failed generating: %v", k, err)
			continue
		}
		if v.expectedCaps == nil && generatedCaps != nil {
			t.Errorf("%s expected nil caps to be generated but got %#v", k, generatedCaps)
			continue
		}
		if !reflect.DeepEqual(v.expectedCaps, generatedCaps) {
			t.Errorf("%s did not generate correctly.  Expected: %#v, Actual: %#v", k, v.expectedCaps, generatedCaps)
		}
	}
}

func TestValidateAdds(t *testing.T) {
	tests := map[string]struct {
		defaultAddCaps []api.Capability
		allowedCaps    []api.Capability
		containerCaps  *api.Capabilities
		expectedError  string
	}{
		// no container requests
		"no required, no allowed, no container requests": {},
		"no required, allowed, no container requests": {
			allowedCaps: []api.Capability{"foo"},
		},
		"required, no allowed, no container requests": {
			defaultAddCaps: []api.Capability{"foo"},
			expectedError:  `capabilities: Invalid value: "null": required capabilities are not set on the securityContext`,
		},

		// container requests match required
		"required, no allowed, container requests valid": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
		},
		"required, no allowed, container requests invalid": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"bar"},
			},
			expectedError: `capabilities.add: Invalid value: "bar": capability may not be added`,
		},

		// container requests match allowed
		"no required, allowed, container requests valid": {
			allowedCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
		},
		"no required, all allowed, container requests valid": {
			allowedCaps: []api.Capability{extensions.AllowAllCapabilities},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
		},
		"no required, allowed, container requests invalid": {
			allowedCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"bar"},
			},
			expectedError: `capabilities.add: Invalid value: "bar": capability may not be added`,
		},

		// required and allowed
		"required, allowed, container requests valid required": {
			defaultAddCaps: []api.Capability{"foo"},
			allowedCaps:    []api.Capability{"bar"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"foo"},
			},
		},
		"required, allowed, container requests valid allowed": {
			defaultAddCaps: []api.Capability{"foo"},
			allowedCaps:    []api.Capability{"bar"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"bar"},
			},
		},
		"required, allowed, container requests invalid": {
			defaultAddCaps: []api.Capability{"foo"},
			allowedCaps:    []api.Capability{"bar"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"baz"},
			},
			expectedError: `capabilities.add: Invalid value: "baz": capability may not be added`,
		},
		"validation is case sensitive": {
			defaultAddCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Add: []api.Capability{"FOO"},
			},
			expectedError: `capabilities.add: Invalid value: "FOO": capability may not be added`,
		},
	}

	for k, v := range tests {
		strategy, err := NewDefaultCapabilities(v.defaultAddCaps, nil, v.allowedCaps)
		if err != nil {
			t.Errorf("%s failed: %v", k, err)
			continue
		}
		errs := strategy.Validate(nil, nil, v.containerCaps)
		if v.expectedError == "" && len(errs) > 0 {
			t.Errorf("%s should have passed but had errors %v", k, errs)
			continue
		}
		if v.expectedError != "" && len(errs) == 0 {
			t.Errorf("%s should have failed but received no errors", k)
			continue
		}
		if len(errs) == 1 && errs[0].Error() != v.expectedError {
			t.Errorf("%s should have failed with %v but received %v", k, v.expectedError, errs[0])
			continue
		}
		if len(errs) > 1 {
			t.Errorf("%s should have failed with at most one error, but received %v: %v", k, len(errs), errs)
		}
	}
}

func TestValidateDrops(t *testing.T) {
	tests := map[string]struct {
		requiredDropCaps []api.Capability
		containerCaps    *api.Capabilities
		expectedError    string
	}{
		// no container requests
		"no required, no container requests": {},
		"required, no container requests": {
			requiredDropCaps: []api.Capability{"foo"},
			expectedError:    `capabilities: Invalid value: "null": required capabilities are not set on the securityContext`,
		},

		// container requests match required
		"required, container requests valid": {
			requiredDropCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"foo"},
			},
		},
		"required, container requests invalid": {
			requiredDropCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"bar"},
			},
			expectedError: `capabilities.drop: Invalid value: []core.Capability{"bar"}: foo is required to be dropped but was not found`,
		},
		"validation is case sensitive": {
			requiredDropCaps: []api.Capability{"foo"},
			containerCaps: &api.Capabilities{
				Drop: []api.Capability{"FOO"},
			},
			expectedError: `capabilities.drop: Invalid value: []core.Capability{"FOO"}: foo is required to be dropped but was not found`,
		},
	}

	for k, v := range tests {
		strategy, err := NewDefaultCapabilities(nil, v.requiredDropCaps, nil)
		if err != nil {
			t.Errorf("%s failed: %v", k, err)
			continue
		}
		errs := strategy.Validate(nil, nil, v.containerCaps)
		if v.expectedError == "" && len(errs) > 0 {
			t.Errorf("%s should have passed but had errors %v", k, errs)
			continue
		}
		if v.expectedError != "" && len(errs) == 0 {
			t.Errorf("%s should have failed but received no errors", k)
			continue
		}
		if len(errs) == 1 && errs[0].Error() != v.expectedError {
			t.Errorf("%s should have failed with %v but received %v", k, v.expectedError, errs[0])
			continue
		}
		if len(errs) > 1 {
			t.Errorf("%s should have failed with at most one error, but received %v: %v", k, len(errs), errs)
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
//
//  WHC_VIEW+WHC_AutoLayout.h
//
//  Github <https://github.com/netyouli/WHC_AutoLayoutKit>
//
//  Created by 吴海超 on 16/2/17.
//  Copyright © 2016年 吴海超. All rights reserved.
//

//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import "WHC_AutoLayoutUtilities.h"

typedef WHC_CLASS_LGUIDE * (^LGLessOrEqual)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGGreaterOrEqual)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGResetConstraintAttribute)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGClearConstraintAttribute)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGRemoveConstraintAttribute)(NSLayoutAttribute attributes, ...) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGRemoveConstraintFromViewAttribute)(WHC_CLASS_VIEW * view, NSLayoutAttribute attributes, ...) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGRemoveConstraintToViewAttribute)(WHC_VIEW * toView, NSLayoutAttribute attributes, ...) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGPriorityLow)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGPriorityHigh)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGPriorityRequired)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGPriorityFitting)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGPriorityValue)(CGFloat value) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGLeftSpace)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGLeftSpaceToView)(CGFloat value , WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGLeftSpaceEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGLeftSpaceEqualViewOffset)(WHC_VIEW * view, CGFloat offset) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGLeadingSpace)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGLeadingSpaceToView)(CGFloat value , WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGLeadingSpaceEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGLeadingSpaceEqualViewOffset)(WHC_VIEW * view, CGFloat offset) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGTrailingSpace)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGTrailingSpaceToView)(CGFloat value , WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGTrailingSpaceEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGTrailingSpaceEqualViewOffset)(WHC_VIEW * view, CGFloat offset) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGBaseLineSpace)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGBaseLineSpaceToView)(CGFloat value , WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGBaseLineSpaceEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGBaseLineSpaceEqualViewOffset)(WHC_VIEW * view, CGFloat offset) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGRightSpace)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGRightSpaceToView)(CGFloat value , WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGRightSpaceEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGRightSpaceEqualViewOffset)(WHC_VIEW * view, CGFloat offset) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGTopSpace)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGTopSpaceToView)(CGFloat value , WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGTopSpaceEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGTopSpaceEqualViewOffset)(WHC_VIEW * view, CGFloat offset) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGBottomSpace)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGBottomSpaceToView)(CGFloat value , WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGBottomSpaceEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGBottomSpaceEqualViewOffset)(WHC_VIEW * view, CGFloat offset) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGWidth)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGWidthAuto)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGWidthEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGWidthEqualViewRatio)(WHC_VIEW * view, CGFloat ratio) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGWidthHeightRatio)(CGFloat ratio) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGHeight)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGHeightAuto)(void) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGHeightEqualView)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGHeightEqualViewRatio)(WHC_VIEW * view, CGFloat ratio) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGHeightWidthRatio)(CGFloat ratio);

typedef WHC_CLASS_LGUIDE * (^LGCenterX)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGCenterXToView)(CGFloat value, WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGCenterY)(CGFloat value) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGCenterYToView)(CGFloat value, WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGCenter)(CGFloat x, CGFloat y) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGCenterToView)(CGPoint center, WHC_VIEW * toView) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGsize)(CGFloat width, CGFloat height) NS_AVAILABLE(10_11, 9_0);
typedef WHC_CLASS_LGUIDE * (^LGSizeEqual)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);

typedef WHC_CLASS_LGUIDE * (^LGFrameEqual)(WHC_VIEW * view) NS_AVAILABLE(10_11, 9_0);

#pragma mark - UI自动布局 -

NS_AVAILABLE(10_11, 9_0)
@interface WHC_CLASS_LGUIDE (WHC_AutoLayout)

#pragma mark - api version ~ 2.0 -

/// 当前约束小于等于
@property (nonatomic ,copy , readonly)LGLessOrEqual whc_LessOrEqual;
/// 当前约束大于等于
@property (nonatomic ,copy , readonly)LGGreaterOrEqual whc_GreaterOrEqual;
/// 重置缓存约束
@property (nonatomic ,copy , readonly)LGResetConstraintAttribute whc_ResetConstraint;
/// 清除所有约束
@property (nonatomic ,copy , readonly)LGClearConstraintAttribute whc_ClearLayoutAttr;
/// 移除约束(NSLayoutAttribute attributes, ...)
@property (nonatomic ,copy , readonly)LGRemoveConstraintAttribute whc_RemoveLayoutAttrs;
/// 移除约束从指定视图上(WHC_VIEW * view, NSLayoutAttribute attributes, ...)
@property (nonatomic ,copy , readonly)LGRemoveConstraintFromViewAttribute whc_RemoveFromLayoutAttrs;
/// 移除约束从关联视图上(WHC_VIEW * toView, NSLayoutAttribute attributes, ...)
@property (nonatomic ,copy , readonly)LGRemoveConstraintToViewAttribute whc_RemoveToLayoutAttrs;

/// 设置当前约束的低优先级
@property (nonatomic ,copy , readonly)LGPriorityLow whc_PriorityLow;
/// 设置当前约束的高优先级
@property (nonatomic ,copy , readonly)LGPriorityHigh whc_PriorityHigh;
/// 设置当前约束的默认优先级
@property (nonatomic ,copy , readonly)LGPriorityRequired whc_PriorityRequired;
/// 设置当前约束的合适优先级
@property (nonatomic ,copy , readonly)LGPriorityFitting whc_PriorityFitting;
/// 设置当前约束的优先级 (CGFloat value): 优先级大小(0-1000)
@property (nonatomic ,copy , readonly)LGPriorityValue whc_Priority;

/// 与父视图左边间距(CGFloat value)
@property (nonatomic ,copy , readonly)LGLeftSpace whc_LeftSpace;
/// 与相对视图toView左边间距(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGLeftSpaceToView whc_LeftSpaceToView;
/// 与视图view左边间距相等(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGLeftSpaceEqualView whc_LeftSpaceEqualView;
/// 与视图view左边间距相等并偏移offset(WHC_VIEW * view, CGFloat offset)
@property (nonatomic ,copy , readonly)LGLeftSpaceEqualViewOffset whc_LeftSpaceEqualViewOffset;

/// 与父视图左边间距(CGFloat value)
@property (nonatomic ,copy , readonly)LGLeadingSpace whc_LeadingSpace;
/// 与相对视图toView左边间距(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGLeadingSpaceToView whc_LeadingSpaceToView;
/// 与视图view左边间距相等(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGLeadingSpaceEqualView whc_LeadingSpaceEqualView;
/// 与视图view左边间距相等并偏移offset (WHC_VIEW * view, CGFloat offset)
@property (nonatomic ,copy , readonly)LGLeadingSpaceEqualViewOffset whc_LeadingSpaceEqualViewOffset;

/// 与父视图右边间距(CGFloat value)
@property (nonatomic ,copy , readonly)LGTrailingSpace whc_TrailingSpace;
/// 与相对视图toView右边间距(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGTrailingSpaceToView whc_TrailingSpaceToView;
/// 与视图view右边间距相等(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGTrailingSpaceEqualView whc_TrailingSpaceEqualView;
/// 与视图view右边间距相等并偏移offset(WHC_VIEW * view, CGFloat offset)
@property (nonatomic ,copy , readonly)LGTrailingSpaceEqualViewOffset whc_TrailingSpaceEqualViewOffset;

#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
/// 与父视图底边间距Y(CGFloat value)
@property (nonatomic ,copy , readonly)LGBaseLineSpace whc_FirstBaseLine;
/// 与相对视图toView底边间距Y(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGBaseLineSpaceToView whc_FirstBaseLineToView;
/// 与视图view底边间距Y相等(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGBaseLineSpaceEqualView whc_FirstBaseLineEqualView;
/// 与视图view底边间距Y相等并偏移offset(WHC_VIEW * view, CGFloat offset)
@property (nonatomic ,copy , readonly)LGBaseLineSpaceEqualViewOffset whc_FirstBaseLineEqualViewOffset;
#endif

/// 与父视图底边间距Y(CGFloat value)
@property (nonatomic ,copy , readonly)LGBaseLineSpace whc_LastBaseLine;
/// 与相对视图toView底边间距Y(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGBaseLineSpaceToView whc_LastBaseLineToView;
/// 与视图view底边间距Y相等(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGBaseLineSpaceEqualView whc_LastBaseLineEqualView;
/// 与视图view底边间距Y相等并偏移offset(WHC_VIEW * view, CGFloat offset)
@property (nonatomic ,copy , readonly)LGBaseLineSpaceEqualViewOffset whc_LastBaseLineEqualViewOffset;
/// 与父视图右边间距(CGFloat value)
@property (nonatomic ,copy , readonly)LGRightSpace whc_RightSpace;
/// 与相对视图toView右边间距(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGRightSpaceToView whc_RightSpaceToView;
/// 与相对视图toView右边间距相等(WHC_VIEW toView)
@property (nonatomic ,copy , readonly)LGRightSpaceEqualView whc_RightSpaceEqualView;
/// 与相对视图toView右边间距相等并偏移offset(WHC_VIEW toView, CGFloat offset)
@property (nonatomic ,copy , readonly)LGRightSpaceEqualViewOffset whc_RightSpaceEqualViewOffset;

/// 与父视图顶边间距(CGFloat value)
@property (nonatomic ,copy , readonly)LGTopSpace whc_TopSpace;
/// 与相对视图toView顶边间距(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGTopSpaceToView whc_TopSpaceToView;
/// 与视图view顶边间距相等(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGTopSpaceEqualView whc_TopSpaceEqualView;
/// 与视图view顶边间距相等并偏移offset(WHC_VIEW * view, CGFloat offset)
@property (nonatomic ,copy , readonly)LGTopSpaceEqualViewOffset whc_TopSpaceEqualViewOffset;

/// 与父视图底边间距(CGFloat value)
@property (nonatomic ,copy , readonly)LGBottomSpace whc_BottomSpace;
/// 与相对视图toView底边间距(CGFloat value,WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGBottomSpaceToView whc_BottomSpaceToView;
/// 与相对视图toView底边间距相等(WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGBottomSpaceEqualView whc_BottomSpaceEqualView;
/// 与相对视图toView底边间距相等并偏移offset(WHC_VIEW * toView, CGFloat offset)
@property (nonatomic ,copy , readonly)LGBottomSpaceEqualViewOffset whc_BottomSpaceEqualViewOffset;

/// 宽度(CGFloat value)
@property (nonatomic ,copy , readonly)LGWidth whc_Width;
/// 宽度自动()
@property (nonatomic ,copy , readonly)LGWidthAuto whc_WidthAuto;
/// 宽度等于视图view(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGWidthEqualView whc_WidthEqualView;
/// 宽度等于视图view 参照比例Ratio(WHC_VIEW * view ,CGFloat ratio)
@property (nonatomic ,copy , readonly)LGWidthEqualViewRatio whc_WidthEqualViewRatio;
/// 视图自身宽度与高度的比(CGFloat Ratio)
@property (nonatomic ,copy , readonly)LGWidthHeightRatio whc_WidthHeightRatio;

/// 高度(CGFloat value)
@property (nonatomic ,copy , readonly)LGHeight whc_Height;
/// 高度自动()
@property (nonatomic ,copy , readonly)LGHeightAuto whc_HeightAuto;
/// 高度等于视图view(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGHeightEqualView whc_HeightEqualView;
/// 高度等于视图view 参照比例Ratio(WHC_VIEW * view ,CGFloat ratio)
@property (nonatomic ,copy , readonly)LGHeightEqualViewRatio whc_HeightEqualViewRatio;
/// 视图自身高度与宽度的比(CGFloat Ratio)
@property (nonatomic ,copy , readonly)LGHeightWidthRatio whc_HeightWidthRatio;

/// 中心X与父视图偏移(CGFloat value)
@property (nonatomic ,copy , readonly)LGCenterX whc_CenterX;
/// 中心X与视图view偏移(CGFloat value , WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGCenterXToView whc_CenterXToView;

/// 中心Y与父视图偏移(CGFloat value)
@property (nonatomic ,copy , readonly)LGCenterY whc_CenterY;
/// 中心Y与视图view偏移(CGFloat value , WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGCenterYToView whc_CenterYToView;

/// 中心与父视图偏移(CGFloat value)
@property (nonatomic ,copy , readonly)LGCenter whc_Center;
/// 中心与视图view偏移(CGFloat value , WHC_VIEW * toView)
@property (nonatomic ,copy , readonly)LGCenterToView whc_CenterToView;

/// size设置(CGFloat width, CGFloat height)
@property (nonatomic ,copy , readonly)LGsize whc_Size;
/// size设置(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGSizeEqual whc_SizeEqualView;

/// frame设置(WHC_VIEW * view)
@property (nonatomic ,copy , readonly)LGFrameEqual whc_FrameEqualView;
#pragma mark - api version ~ 1.0 -

/**
 重置缓存的约束,该方法在当前视图对象移除从父视图上可能需要调用清除与父视图之前旧约束缓存对象

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_ResetConstraints;

/**
 清除所有布局属性

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_ClearLayoutAttrs;

/**
 移除一个或者一组约束

 @param attributes 约束类型(可变参数)
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RemoveLayoutAttr:(NSLayoutAttribute)attributes, ...;

/**
 移除一个单个属性

 @param attribute 约束类型
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RemoveLayoutOneAttr:(NSLayoutAttribute)attribute;

/**
 移除一个或者一组约束从指定的视图上

 @param view 指定视图
 @param attributes 约束类型(可变参数)
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RemoveFrom:(WHC_CLASS_LGUIDE *)view layoutAttrs:(NSLayoutAttribute)attributes, ...;

/**
 移除一个约束从指定的视图上

 @param view 指定视图
 @param attribute 约束类型
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RemoveFrom:(WHC_CLASS_LGUIDE *)view layoutAttr:(NSLayoutAttribute)attribute;

/**
 移除一个约束从关联的视图

 @param view 关联的视图
 @param attribute 移除的约束
 @return 当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RemoveTo:(WHC_VIEW *)view attr:(NSLayoutAttribute)attribute;

/**
 移除多个约束从关联的视图

 @param view 关联的视图
 @param attributes 移除的约束
 @return 当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_RemoveTo:(WHC_VIEW *)view layoutAttrs:(NSLayoutAttribute)attributes, ... ;

/**
 设置当前约束的低优先级

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_priorityLow;

/**
 设置当前约束的高优先级

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_priorityHigh;

/**
 设置当前约束的默认优先级

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_priorityRequired;

/**
 设置当前约束的合适优先级

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_priorityFitting;

/**
 设置当前约束的优先级

 @param value 优先级大小(0-1000)
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_priority:(CGFloat)value;

/**
 设置左边距(默认相对父视图)

 @param leftSpace 左边距
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LeftSpace:(CGFloat)leftSpace;

/**
 设置左边距

 @param leftSpace 左边距
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LeftSpace:(CGFloat)leftSpace toView:(WHC_VIEW *)toView;

/**
 设置左边距与视图view左边距相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LeftSpaceEqualView:(WHC_VIEW *)view;

/**
 设置左边距与视图view左边距相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LeftSpaceEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

/**
 设置右边距(默认相对父视图)

 @param rightSpace 右边距
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RightSpace:(CGFloat)rightSpace;

/**
 设置右边距

 @param rightSpace 右边距
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RightSpace:(CGFloat)rightSpace toView:(WHC_VIEW *)toView;

/**
 设置右边距与视图view左对齐边距相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RightSpaceEqualView:(WHC_VIEW *)view;

/**
 设置右边距与视图view左对齐边距相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_RightSpaceEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

/**
 设置左对齐(默认相对父视图)

 @param leadingSpace 左边距
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LeadingSpace:(CGFloat)leadingSpace;

/**
 设置左对齐

 @param leadingSpace 左边距
 @param toView 相对视图
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_LeadingSpace:(CGFloat)leadingSpace toView:(WHC_VIEW *)toView;

/**
 设置左对齐边距与某视图左对齐边距相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LeadingSpaceEqualView:(WHC_VIEW *)view;

/**
 设置左对齐边距与某视图左对齐边距相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LeadingSpaceEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

/**
 设置右对齐(默认相对父视图)

 @param trailingSpace 右边距
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TrailingSpace:(CGFloat)trailingSpace;

/**
 设置右对齐

 @param trailingSpace 右边距
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TrailingSpace:(CGFloat)trailingSpace toView:(WHC_VIEW *)toView;

/**
 设置右对齐边距与某视图右对齐边距相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TrailingSpaceEqualView:(WHC_VIEW *)view;

/**
 设置右对齐边距与某视图右对齐边距相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TrailingSpaceEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

/**
 设置顶边距(默认相对父视图)

 @param topSpace 顶边距
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TopSpace:(CGFloat)topSpace;

/**
 设置顶边距

 @param topSpace 顶边距
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TopSpace:(CGFloat)topSpace toView:(WHC_VIEW *)toView;

/**
 设置顶边距与视图view顶边距相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TopSpaceEqualView:(WHC_VIEW *)view;

/**
 设置顶边距与视图view顶边距相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_TopSpaceEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

/**
 设置底边距(默认相对父视图)

 @param bottomSpace 底边距
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_BottomSpace:(CGFloat)bottomSpace;

/**
 设置底边距

 @param bottomSpace 底边距
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_BottomSpace:(CGFloat)bottomSpace toView:(WHC_VIEW *)toView;

/**
 设置底边距与视图view底边距相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_BottomSpaceEqualView:(WHC_VIEW *)view;

/**
 设置底边距与视图view底边距相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_BottomSpaceEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

/**
 设置宽度

 @param width 宽度
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_Width:(CGFloat)width;

/**
 设置宽度与某个视图相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_WidthEqualView:(WHC_VIEW *)view;

/**
 设置宽度与视图view相等

 @param view 相对视图
 @param ratio 比例
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_WidthEqualView:(WHC_VIEW *)view ratio:(CGFloat)ratio;

/**
 设置自动宽度

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_AutoWidth;

/**
 设置视图自身宽度与高度的比

 @param ratio 比例
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_WidthHeightRatio:(CGFloat)ratio;

/**
 设置高度

 @param height 高度
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_Height:(CGFloat)height;

/**
 设置高度与视图view相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_HeightEqualView:(WHC_VIEW *)view;

/**
 设置高度与视图view相等

 @param view 相对视图
 @param ratio 比例
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_HeightEqualView:(WHC_VIEW *)view ratio:(CGFloat)ratio;

/**
 设置自动高度

 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_AutoHeight;

/**
 设置视图自身高度与宽度的比

 @param ratio 比例
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_HeightWidthRatio:(CGFloat)ratio;

/**
 设置中心x与父视图中心的偏移 centerX = 0 与父视图中心x重合

 @param centerX 中心x坐标偏移
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_CenterX:(CGFloat)centerX;

/**
 设置中心x与相对视图中心的偏移 centerX = 0 与相对视图中心x重合

 @param centerX 中心x坐标偏移
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_CenterX:(CGFloat)centerX toView:(WHC_VIEW *)toView;

/**
 设置中心y与父视图中心的偏移 centerY = 0 与父视图中心y重合

 @param centerY 中心y坐标偏移
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_CenterY:(CGFloat)centerY;

/**
 设置中心y与相对视图中心的偏移 centerY = 0 与相对视图中心y重合

 @param centerY 中心y坐标偏移
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_CenterY:(CGFloat)centerY toView:(WHC_VIEW *)toView;

#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
/**
 设置顶部基线偏移(默认相对父视图)

 @param space 间隙
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_FirstBaseLine:(CGFloat)space;

/**
 设置顶部基线与对象视图底部基线偏移

 @param space 间隙
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_FirstBaseLine:(CGFloat)space toView:(WHC_VIEW *)toView;

/**
 设置顶部基线与相对视图顶部基线相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_FirstBaseLineEqualView:(WHC_VIEW *)view;

/**
 设置顶部基线与相对视图顶部基线相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_FirstBaseLineEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

#endif

/**
 设置底部基线偏移(默认相对父视图)

 @param space 间隙
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LastBaseLine:(CGFloat)space;

/**
 设置底部基线与对象视图顶部基线偏移

 @param space 间隙
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LastBaseLine:(CGFloat)space toView:(WHC_VIEW *)toView;

/**
 设置底部基线与相对视图底部基线相等

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LastBaseLineEqualView:(WHC_VIEW *)view;

/**
 设置底部基线与相对视图底部基线相等并偏移offset

 @param view 相对视图
 @param offset 偏移量
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_LastBaseLineEqualView:(WHC_VIEW *)view offset:(CGFloat)offset;

/**
 设置中心偏移(默认相对父视图)center = CGPointZero 与父视图中心重合

 @param center 中心偏移xy
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_Center:(CGPoint)center;

/**
 设置中心偏移(默认相对父视图)center = CGPointZero 与父视图中心重合

 @param center 中心偏移xy
 @param toView 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_Center:(CGPoint)center toView:(WHC_VIEW *)toView;

/**
 设置frame(默认相对父视图)

 @param left 左边距
 @param top 顶边距
 @param width 宽度
 @param height 高度
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_Frame:(CGFloat)left top:(CGFloat)top width:(CGFloat)width height:(CGFloat)height;

/**
 设置frame (默认相对父视图)

 @param left 左边距
 @param top 顶边距
 @param right 右边距
 @param bottom 底边距
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_AutoSize:(CGFloat)left top:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom;

/**
 设置frame

 @param left 左边距
 @param top 顶边距
 @param width 宽度
 @param height 高度
 @param toView 相对视图
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_Frame:(CGFloat)left top:(CGFloat)top width:(CGFloat)width height:(CGFloat)height toView:(WHC_VIEW *)toView;

/**
 设置frame (默认相对父视图)

 @param left 左边距
 @param top 顶边距
 @param right 右边距
 @param height 高度
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_AutoWidth:(CGFloat)left top:(CGFloat)top right:(CGFloat)right height:(CGFloat)height;

/**
 设置frame (默认相对父视图)

 @param left 左边距
 @param top 顶边距
 @param width 宽度
 @param bottom 底边距
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_AutoHeight:(CGFloat)left top:(CGFloat)top width:(CGFloat)width bottom:(CGFloat)bottom;

/**
 设置frame

 @param left 左边距
 @param top 顶边距
 @param right 右边距
 @param bottom 底边距
 @param toView 相对视图
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_AutoSize:(CGFloat)left top:(CGFloat)top right:(CGFloat)right bottom:(CGFloat)bottom toView:(WHC_VIEW *)toView;

/**
 设置frame

 @param left 左边距
 @param top 顶边距
 @param right 右边距
 @param height 高度
 @param toView 相对视图
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_AutoWidth:(CGFloat)left top:(CGFloat)top right:(CGFloat)right height:(CGFloat)height toView:(WHC_VIEW *)toView;

/**
 设置frame (默认相对父视图)

 @param left 左边距
 @param top 顶边距
 @param width 宽度
 @param bottom 底边距
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_AutoHeight:(CGFloat)left top:(CGFloat)top width:(CGFloat)width bottom:(CGFloat)bottom toView:(WHC_VIEW *)toView;

/**
 设置视图显示宽高

 @param size 视图宽高
 @return 返回当前视图
 */

- (WHC_CLASS_LGUIDE *)whc_Size:(CGSize)size;

/**
 设置视图size等于view

 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_SizeEqualView:(WHC_VIEW *)view;

/**
 设置视图frame等于view
 @param view 相对视图
 @return 返回当前视图
 */
- (WHC_CLASS_LGUIDE *)whc_FrameEqualView:(WHC_VIEW *)view;

@end


text:
package eu.inloop.knight.builder;

import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.TypeSpec;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Generated;
import javax.annotation.processing.Filer;
import javax.inject.Qualifier;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;

import eu.inloop.knight.KnightProcessor;
import eu.inloop.knight.name.GCN;
import eu.inloop.knight.name.GPN;
import eu.inloop.knight.util.ProcessorError;
import eu.inloop.knight.util.StringUtils;

/**
 * Class {@link BaseClassBuilder} is used for building a Java class file.
 *
 * @author FrantisekGazo
 * @version 2015-10-17
 */
public abstract class BaseClassBuilder {

    /**
     * Format of full class name.
     */
    private static final String FORMAT_FULL_CLASS_NAME = "%s.%s";
    /**
     * Format of class field.
     */
    private static final String FORMAT_CLASS_FIELD_NAME = "m%s";

    private TypeSpec.Builder mBuilder;
    private ClassName mClassName = null;
    private final GCN mGenClassName;
    private final ClassName mGenClassNameArg;
    private final GPN[] mGenPackageName;

    /**
     * Constructor
     *
     * @param isClass         true if generated should be class. false if interface.
     * @param genClassName    Name of generated class.
     * @param arg             Class name that will be used when formatting generated class name.
     * @param genPackageNames Package in which class will be generated.
     */
    public BaseClassBuilder(boolean isClass, GCN genClassName, ClassName arg, GPN... genPackageNames) throws ProcessorError {
        mGenClassName = genClassName;
        mGenClassNameArg = arg;
        mGenPackageName = genPackageNames;
        if (isClass) {
            mBuilder = TypeSpec.classBuilder(getClassName().simpleName());
        } else {
            mBuilder = TypeSpec.interfaceBuilder(getClassName().simpleName());
        }
        start();
    }

    /**
     * Constructor for class builder.
     *
     * @param genClassName    Name of generated class.
     * @param arg             Class name that will be used when formatting generated class name.
     * @param genPackageNames Package in which class will be generated.
     */
    public BaseClassBuilder(GCN genClassName, ClassName arg, GPN... genPackageNames) throws ProcessorError {
        this(true, genClassName, arg, genPackageNames);
    }

    /**
     * Constructor for class builder.
     *
     * @param genClassName    Name of generated class.
     * @param genPackageNames Package in which class will be generated.
     */
    public BaseClassBuilder(GCN genClassName, GPN... genPackageNames) throws ProcessorError {
        this(true, genClassName, null, genPackageNames);
    }

    /**
     * Constructor
     *
     * @param isClass         true if generated should be class. false if interface.
     * @param genClassName    Name of generated class.
     * @param genPackageNames Package in which class will be generated.
     */
    public BaseClassBuilder(boolean isClass, GCN genClassName, GPN... genPackageNames) throws ProcessorError {
        this(isClass, genClassName, null, genPackageNames);
    }

    /**
     * Returns {@link TypeSpec.Builder} of generated class.
     */
    public TypeSpec.Builder getBuilder() {
        return mBuilder;
    }

    protected ClassName getArgClassName() {
        return mGenClassNameArg;
    }

    /**
     * Returns {@link ClassName} of generated class.
     */
    public ClassName getClassName() {
        if (mClassName == null) {
            // build CLASS name
            String name = mGenClassName.formatName(mGenClassNameArg);
            // save
            mClassName = ClassName.get(GPN.toString(mGenPackageName), name);
        }
        return mClassName;
    }

    /**
     * Returns full name of generated class.
     */
    protected String getFullName() {
        return String.format(FORMAT_FULL_CLASS_NAME, getClassName().packageName(), getClassName().simpleName());
    }

    /**
     * Called in the constructor.
     */
    public void start() throws ProcessorError {
        // add @Generated
        getBuilder().addAnnotation(
                AnnotationSpec.builder(Generated.class)
                        .addMember("value", "$S", KnightProcessor.class.getName())
                        .build()
        );
    }

    /**
     * Called before building java file.
     */
    public void end() throws ProcessorError {
    }

    /**
     * Builds Java file for generated class.
     *
     * @param filer File creator.
     */
    public void build(Filer filer) throws ProcessorError, IOException {
        end();
        TypeSpec cls = mBuilder.build();
        // create file
        JavaFile javaFile = JavaFile.builder(getClassName().packageName(), cls).build();
        javaFile.writeTo(filer);
        //javaFile.writeTo(System.out);

        System.out.println(String.format("Class <%s> successfully generated.", getFullName()));
    }

    /**
     * Returns list of all annotations given element has.
     *
     * @param element Element.
     */
    public List<AnnotationSpec> getQualifiers(Element element) {
        List<AnnotationSpec> list = new ArrayList<>();
        for (AnnotationMirror a : element.getAnnotationMirrors()) {
            if (a.getAnnotationType().asElement().getAnnotation(Qualifier.class) == null) {
                continue; // ignore non-Qualifier annotations
            }

            ClassName annotationClassName = (ClassName) ClassName.get(a.getAnnotationType());
            AnnotationSpec.Builder annotation = AnnotationSpec.builder(annotationClassName);
            for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : a.getElementValues().entrySet()) {
                String format = (entry.getValue().getValue() instanceof String) ? "$S" : "$L";
                annotation.addMember(entry.getKey().getSimpleName().toString(), format, entry.getValue().getValue());
            }
            list.add(annotation.build());
        }
        return list;
    }

    /**
     * Creates class field name.
     */
    protected String createFieldName(String name) {
        return String.format(FORMAT_CLASS_FIELD_NAME, StringUtils.startUpperCase(name));
    }

}


text:
// Copyright (c) Microsoft Corporation.  All rights reserved.
// Licensed under the MIT License.  See License.txt in the project root for license information.

using System.Web.Http;
using System.Web.OData.Formatter;
using System.Web.OData.Properties;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OData;

namespace System.Web.OData.Query.Validators
{
    /// <summary>
    /// Represents a validator used to validate OData queries based on the <see cref="ODataValidationSettings"/>.
    /// </summary>
    public class ODataQueryValidator
    {
        /// <summary>
        /// Validates the OData query.
        /// </summary>
        /// <param name="options">The OData query to validate.</param>
        /// <param name="validationSettings">The validation settings.</param>
        public virtual void Validate(ODataQueryOptions options, ODataValidationSettings validationSettings)
        {
            if (options == null)
            {
                throw Error.ArgumentNull("options");
            }

            if (validationSettings == null)
            {
                throw Error.ArgumentNull("validationSettings");
            }

            // Validate each query options
            if (options.Apply != null)
            {
                if (options.Apply.ApplyClause != null)
                {
                    ValidateQueryOptionAllowed(AllowedQueryOptions.Apply, validationSettings.AllowedQueryOptions);
                }
            }

            if (options.Skip != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.Skip, validationSettings.AllowedQueryOptions);
                options.Skip.Validate(validationSettings);
            }

            if (options.Top != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.Top, validationSettings.AllowedQueryOptions);
                options.Top.Validate(validationSettings);
            }

            if (options.OrderBy != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.OrderBy, validationSettings.AllowedQueryOptions);
                options.OrderBy.Validate(validationSettings);
            }

            if (options.Filter != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.Filter, validationSettings.AllowedQueryOptions);
                options.Filter.Validate(validationSettings);
            }

            if (options.Count != null || ODataCountMediaTypeMapping.IsCountRequest(options.Request))
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.Count, validationSettings.AllowedQueryOptions);

                if (options.Count != null)
                {
                    options.Count.Validate(validationSettings);
                }
            }

            if (options.RawValues.Expand != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.Expand, validationSettings.AllowedQueryOptions);
            }

            if (options.RawValues.Select != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.Select, validationSettings.AllowedQueryOptions);
            }

            if (options.SelectExpand != null)
            {
                options.SelectExpand.Validate(validationSettings);
            }

            if (options.RawValues.Format != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.Format, validationSettings.AllowedQueryOptions);
            }

            if (options.RawValues.SkipToken != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.SkipToken, validationSettings.AllowedQueryOptions);
            }

            if (options.RawValues.DeltaToken != null)
            {
                ValidateQueryOptionAllowed(AllowedQueryOptions.DeltaToken, validationSettings.AllowedQueryOptions);
            }
        }

        internal static ODataQueryValidator GetODataQueryValidator(ODataQueryContext context)
        {
            if (context == null || context.RequestContainer == null)
            {
                return new ODataQueryValidator();
            }

            return context.RequestContainer.GetRequiredService<ODataQueryValidator>();
        }

        private static void ValidateQueryOptionAllowed(AllowedQueryOptions queryOption, AllowedQueryOptions allowed)
        {
            if ((queryOption & allowed) == AllowedQueryOptions.None)
            {
                throw new ODataException(Error.Format(SRResources.NotAllowedQueryOption, queryOption, "AllowedQueryOptions"));
            }
        }
    }
}


text:
require File.join(File.dirname(__FILE__), "/../test_helper")

class TestASDocPackageOpts < Test::Unit::TestCase

  context "A AsDoc Package Tool Options Parser" do

    should "return default hash if no arguments are specified" do
      args = []
      opts = ASDocPackageOpts.parse(args)

      assert_equal 'asdoc-package-config.xml', opts[:output]
      assert_equal '.', opts[:src]
      assert_equal false, opts[:verbose]
    end

    should "display a name" do
      assert_match(/\w+/, ASDocPackageOpts.name)
    end

    should "describe itself" do
      assert_match(/\w+/, ASDocPackageOpts.description)
    end

  end

end


text:
package com.foilen.lanspeedtest.core;

public class SpeedTestContants {

    // Discovery
    public static final int DISCOVERY_PORT = 9999;
    public static final String APP_NAME = "LAN Speed Test";
    public static final String APP_VERSION = "2";
    public static final String SERVICE_NAME = "Speed";

    // Protocol
    public static final int SERVER_SEND_DATA = 0;
    public static final int SERVER_RECEIVE_DATA = 1;

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 334762 $ -->
<refentry xml:id="function.curl-copy-handle" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>curl_copy_handle</refname>
  <refpurpose>Copy a cURL handle along with all of its preferences</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>resource</type><methodname>curl_copy_handle</methodname>
   <methodparam><type>resource</type><parameter>ch</parameter></methodparam>
  </methodsynopsis>
  <para>
   Copies a cURL handle keeping the same preferences.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    &curl.ch.description;
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns a new cURL handle.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>Copying a cURL handle</title>
    <programlisting role="php">
<![CDATA[
<?php
// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
curl_setopt($ch, CURLOPT_HEADER, 0);

// copy the handle
$ch2 = curl_copy_handle($ch);

// grab URL (http://www.example.com/) and pass it to the browser
curl_exec($ch2);

// close cURL resources, and free up system resources
curl_close($ch2);
curl_close($ch);
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text: This inspection spots extra closing tag for the empty elements like IMG or BR.


text:
Police API Client (Python)
==========================

.. currentmodule:: police_api
.. py:module:: police_api

The Police API Client is an open-source client for the `Police API`_. It was
built to power the new Police.uk_ website.

View the README_ for installation instructions and quick-start examples.

Reference
---------

.. toctree::
   :maxdepth: 2
   :glob:

   reference/police_api
   reference/forces
   reference/neighbourhoods
   reference/crime
   reference/stop_and_search

Configuration
-------------

The API doesn't require any configuration or authentication, so all you need to
do to get going is make a PoliceAPI instance::

    >>> from police_api import PoliceAPI
    >>> api = PoliceAPI()

For available methods and configuration parameters, see the :class:`PoliceAPI`
reference.

Forces
------

To retrieve a list of police forces, use :func:`PoliceAPI.get_forces`::

    >>> api.get_forces()
    [<Force> Avon and Somerset Constabulary, ..., <Force> Wiltshire Police]

If you know the ID of a particular force, then you can use :func:`PoliceAPI.get_force`::

    >>> force = api.get_force('leicestershire')
    >>> force
    <Force> Leicestershire Police

For available attributes and methods, see the :class:`forces.Force` reference.

Neighbourhoods
--------------

Forces are broken down into *Neighbourhood Policing Teams*::

    >>> force.neighbourhoods
    [<Neighbourhood> C02, <Neighbourhood> L03, ..., <Neighbourhood> L69]

If you know the ID of a particular neighbourhood, then you can use
:func:`PoliceAPI.get_neighbourhood`::

    >>> neighbourhood = api.get_neighbourhood('leicestershire', 'C02')
    >>> neighbourhood
    <Neighbourhood> C02

Or, if you already have a Force object::

    >>> neighbourhood = force.get_neighbourhood('C02')
    >>> neighbourhood
    <Neighbourhood> C02

For available attributes and methods, see the
:class:`neighbourhoods.Neighbourhood` reference.

Officers
^^^^^^^^

The contact details for each officer in a particular neighbourhood are
available::

    >>> neighbourhood.officers
    [<Neighbourhood.Officer> Michelle Zakoscielny, ..., <Neighbourhood.Officer> Richard Jones]

For available attributes and methods, see the
:class:`neighbourhoods.Neighbourhood.Officer` reference.

Events
^^^^^^

Neighbourhood-level events (beat meetings, surgeries, etc.) are available::

    >>> neighbourhood.events
    [<Neighbourhood.Event> Stocking Farm beat surgery, ..., <Neighbourhood.Event> Stocking Farm beat surgery]

For available attributes and methods, see the
:class:`neighbourhoods.Neighbourhood.Event` reference.

Priorities
^^^^^^^^^^

Policing teams set priorities to deal with in their neighbourhoods, which are
represented by an *issue*, and an *action* to be taken::

    >>> neighbourhood.priorities
    [<Neighbourhood.Priority>
To address the issues of people begging next to cash machines in Market Street and surrounding area.
, ..., <Neighbourhood.Priority>
To reduce street drinking and associated anti-social behaviour on Conduit Street and London Road between 10am and 6pm each day.
]

For available attributes and methods, see the
:class:`neighbourhoods.Neighbourhood.Priority` reference.

Crime & Outcomes
----------------

The crime data is updated monthly, and each data set is represented by a date
string, in the format ``YYYY-MM``::

    >>> api.get_dates()
    [u'2014-03', u'2014-02', u'2014-01', ..., u'2010-12']
    >>> api.get_latest_date()
    u'2014-03'

To get crimes within a particular neighbourhood, call
:func:`PoliceAPI.get_crimes_area` with that neighbourhood's boundary::

    >>> pprint(api.get_crimes_area(neighbourhood.boundary))
    [<Crime> 30412621,
     <Crime> 30412622,
     <Crime> 30409577,
     <Crime> 30411516,
     ...
     <Crime> 30410475,
     <Crime> 30412775,
     <Crime> 30411518,
     <Crime> 30412182]

To fetch data for months other than the latest one, use a date string like the
ones returned by :func:`PoliceAPI.get_dates`::

    >>> pprint(api.get_crimes_area(neighbourhood.boundary, date='2013-10'))
    [<Crime> 27566767,
     <Crime> 27573059,
     <Crime> 27570299,
     <Crime> 27570923,
     ...
     <Crime> 27569847,
     <Crime> 27570896,
     <Crime> 27571396,
     <Crime> 27570916]

Crimes contain the date, category and location::

    >>> crime = api.get_crime('ddf4c172d29569ab0cb667a346bcffad18f54a9bc3e0ae9694d2daf6738f068b')
    >>> crime
    <Crime> 20325597
    >>> crime.month
    u'2013-01'
    >>> crime.category
    <CrimeCategory> Shoplifting
    >>> crime.location
    <Location> 701166
    >>> crime.location.name, crime.location.latitude, crime.location.longitude
    (u'On or near Constance Close', u'51.737837', u'-2.235178')

Crimes have a list of outcomes, which represents the timeline of events since
the crime was reported::

    >>> pprint(crime.outcomes)
    [<Crime.Outcome> Under investigation,
     <Crime.Outcome> Suspect charged,
     <Crime.Outcome> Awaiting court outcome,
     <Crime.Outcome> Offender imprisoned]
    >>> crime.outcomes[-1].date
    u'2013-01'

Crime objects representing Anti-Social Behaviour will not have outcomes::

   >>> asb = api.get_crimes_area(neighbourhood.boundary, category='anti-social-behaviour')[0]
   >>> asb.outcomes
   []

For available attributes and methods, see the :class:`crime.Crime` reference.

.. _Police API: https://data.police.uk/docs/
.. _Police.uk: https://www.police.uk/
.. _README: https://github.com/rkhleics/police-api-client-python/


text:
package com.team254.frc2015.subsystems;

import com.team254.frc2015.Constants;
import com.team254.lib.util.CheesySpeedController;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.Solenoid;

public class BottomCarriage extends ElevatorCarriage {

    Solenoid m_pusher;
    Solenoid m_flapper;

    public BottomCarriage(String name, CheesySpeedController motor,
                          Solenoid brake, Encoder encoder, DigitalInput home,
                          Solenoid pusher, Solenoid flapper) {
        super(name, motor, brake, encoder, home, false);
        m_pusher = pusher;
        m_flapper = flapper;
    }

    @Override
    public void reloadConstants() {
        m_limits.m_min_position = Constants.kBottomCarriageMinPositionInches;
        m_limits.m_max_position = Constants.kBottomCarriageMaxPositionInches;
        m_limits.m_home_position = Constants.kBottomCarriageHomePositionInches;
        m_limits.m_rezero_position = Constants.kBottomCarriageReZeroPositionInches;
        super.reloadConstants();
    }

    public void setPusherExtended(boolean extended) {
        m_pusher.set(extended);
    }

    public boolean getPusherExtended() {
        return m_pusher.get();
    }

    public void setFlapperOpen(boolean open) {
        m_flapper.set(!open);
    }

    public boolean getFlapperOpen() {
        return m_flapper.get();
    }

}


text:
Sample JS: virtualized dropdownlist powered by local data (using Kendo UI (core)).
Install deps:
  bower install
Tip 1: integrating with KnockoutJs: http://volaresystems.com/blog/post/2013/02/18/Integrating-Kendo-UI-drop-downs-with-Knockout-JS
Tip 2: integrating with Bootstrap 3 modal: file bt3ModaKendoUiCorelFix.js


text:
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">

<dom-module id="iron-image">

  <template>

    <content></content>

  </template>

</dom-module>


text:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <LinearLayout
        android:id="@+id/container_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/infoXXLight"
        android:orientation="vertical"
        android:padding="@dimen/container_padding"
        android:visibility="gone"
        tools:visibility="visible">

        <TextView
            android:id="@+id/banner_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/edx_half_margin"
            android:fontFamily="?attr/fontSemiBold"
            android:text="@string/course_schedule_title"
            android:textColor="@color/primaryDarkColor"
            android:textSize="@dimen/edx_large"
            android:visibility="gone"
            tools:visibility="visible" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/iv_calender"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/widget_margin_x_half"
                android:layout_marginEnd="@dimen/widget_margin"
                android:visibility="gone"
                app:srcCompat="@drawable/ic_calendar"
                tools:visibility="visible" />

            <TextView
                android:id="@+id/banner_info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fontFamily="?attr/fontRegular"
                android:lineSpacingMultiplier="@dimen/course_date_desc_line_spacing"
                android:text="@string/course_dates_info_banner"
                android:textColor="@color/neutralXDark"
                android:textSize="@dimen/edx_x_small" />
        </LinearLayout>

        <!--  Use legacy text field instated of material-components-->
        <!--  Ref: https://medium.com/androiddevelopers/migrating-to-material-components-for-android-ec6757795351  -->
        <androidx.appcompat.widget.AppCompatButton
            android:id="@+id/btn_shift_dates"
            style="@style/edX.Widget.PrimaryActionButton"
            android:padding="@dimen/edx_half_margin"
            android:textSize="@dimen/edx_x_small"
            android:visibility="gone"
            tools:text="@string/course_dates_banner_reset_date_button"
            tools:visibility="visible" />
    </LinearLayout>
</layout>