code
stringlengths 4
1.01M
| language
stringclasses 2
values |
|---|---|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package michid.jsonjerk;
import michid.jsonjerk.JsonValue.JsonArray;
import michid.jsonjerk.JsonValue.JsonAtom;
import michid.jsonjerk.JsonValue.JsonObject;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Utility class for parsing JSON objects and arrays into {@link JsonObject}s
* and {@link JsonArray}s, respectively. In contrast to {@link FullJsonParser},
* this implementation resolves nested structures lazily. That, is it does a
* level order traverse of the JSON tree.
* <p/>
* The parser looks for 'hints' in the JSON text to speed up parsing: when it
* encounters an integer value with the key ":size" in an object, that value
* is used for the size of the entire object (including sub-objects).
*
* @see FullJsonParser
*/
public final class LevelOrderJsonParser {
private LevelOrderJsonParser() { }
/**
* Parse a JSON object from {@code tokenizer}
* @param tokenizer
* @return a {@code JsonObject}
* @throws ParseException
*/
public static JsonObject parseObject(JsonTokenizer tokenizer) {
ObjectHandler objectHandler = new ObjectHandler();
new JsonParser(objectHandler).parseObject(tokenizer);
return objectHandler.getObject();
}
/**
* Parse a JSON array from {@code tokenizer}
* @param tokenizer
* @return a {@code JsonArray}
* @throws ParseException
*/
public static JsonArray parseArray(JsonTokenizer tokenizer) {
ArrayHandler arrayHandler = new ArrayHandler();
new JsonParser(arrayHandler).parseArray(tokenizer);
return arrayHandler.getArray();
}
/**
* This implementation of a {@code JsonHandler} builds up a {@code JsonObject}
* from its constituents. Nested objects are not fully parsed though, but a
* reference to the parser is kept which is only invoked when that nested object
* is actually accessed.
*/
public static class ObjectHandler extends JsonHandler {
private final JsonObject object = new JsonObject(new LinkedHashMap<String, JsonValue>());
@Override
public void atom(Token key, Token value) {
object.put(key.text(), new JsonAtom(value));
}
@Override
public void object(JsonParser parser, Token key, JsonTokenizer tokenizer) {
object.put(key.text(), new DeferredObjectValue(tokenizer.copy()));
tokenizer.setPos(getNextPairPos(tokenizer.copy()));
}
@Override
public void array(JsonParser parser, Token key, JsonTokenizer tokenizer) {
object.put(key.text(), parseArray(tokenizer));
}
public JsonObject getObject() {
return object;
}
}
/**
* This implementation of a {@code JsonHandler} builds up a {@code JsonArray}
* from its constituents. Nested objects are not fully parsed though, but a
* reference to the parser is kept which is only invoked when that nested object
* is actually accessed.
*/
public static class ArrayHandler extends JsonHandler {
private final JsonArray array = new JsonArray(new ArrayList<JsonValue>());
@Override
public void atom(Token key, Token value) {
array.add(new JsonAtom(value));
}
@Override
public void object(JsonParser parser, Token key, JsonTokenizer tokenizer) {
array.add(new DeferredObjectValue(tokenizer.copy()));
tokenizer.setPos(getNextPairPos(tokenizer.copy()));
}
@Override
public void array(JsonParser parser, Token key, JsonTokenizer tokenizer) {
array.add(parseArray(tokenizer));
}
public JsonArray getArray() {
return array;
}
}
//------------------------------------------< private >---
private static class BreakException extends RuntimeException{
private static final BreakException BREAK = new BreakException();
}
private static int getNextPairPos(JsonTokenizer tokenizer) {
SkipObjectHandler skipObjectHandler = new SkipObjectHandler(tokenizer.pos());
try {
new JsonParser(skipObjectHandler).parseObject(tokenizer);
}
catch (BreakException e) {
return skipObjectHandler.newPos;
}
return tokenizer.pos();
}
private static class DeferredObjectValue extends JsonObject {
private final JsonTokenizer tokenizer;
public DeferredObjectValue(JsonTokenizer tokenizer) {
super(null);
this.tokenizer = tokenizer;
}
@Override
public void put(String key, JsonValue value) {
throw new IllegalStateException("Cannot add value");
}
@Override
public JsonValue get(String key) {
return value().get(key);
}
@Override
public Map<String, JsonValue> value() {
return parseObject(tokenizer.copy()).value();
}
@Override
public String toString() {
return "<deferred>";
}
}
private static class SkipObjectHandler extends JsonHandler {
private final int startPos;
private int newPos;
public SkipObjectHandler(int startPos) {
this.startPos = startPos;
}
@Override
public void atom(Token key, Token value) {
if (key != null && ":size".equals(key.text()) && Token.Type.NUMBER == value.type()) {
newPos = startPos + Integer.parseInt(value.text());
throw BreakException.BREAK;
}
}
}
}
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Tue Feb 06 09:38:08 MST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>StaticContentContainer (BOM: * : All 2017.10.2 API)</title>
<meta name="date" content="2018-02-06">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="StaticContentContainer (BOM: * : All 2017.10.2 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":18,"i1":18,"i2":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StaticContentContainer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.10.2</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../org/wildfly/swarm/undertow/UndertowFraction.html" title="class in org.wildfly.swarm.undertow"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/wildfly/swarm/undertow/StaticContentContainer.html" target="_top">Frames</a></li>
<li><a href="StaticContentContainer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.wildfly.swarm.undertow</div>
<h2 title="Interface StaticContentContainer" class="title">Interface StaticContentContainer<T extends <any>></h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../org/wildfly/swarm/jaxrs/JAXRSArchive.html" title="interface in org.wildfly.swarm.jaxrs">JAXRSArchive</a>, <a href="../../../../org/wildfly/swarm/undertow/WARArchive.html" title="interface in org.wildfly.swarm.undertow">WARArchive</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">StaticContentContainer<T extends <any>></span></pre>
<div class="block">Archive mix-in supporting static content serving for .war files.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Bob McWhirter</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html#EXTERNAL_MOUNT_PATH">EXTERNAL_MOUNT_PATH</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging">Logger</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html#log">log</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>default <a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html" title="type parameter in StaticContentContainer">T</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html#mergeIgnoringDuplicates--java.lang.String--">mergeIgnoringDuplicates</a></span>(<any> source,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> base,
<any> filter)</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>default <a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html" title="type parameter in StaticContentContainer">T</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html#staticContent--">staticContent</a></span>()</code>
<div class="block">Enable static content to be served from the root of the classpath.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>default <a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html" title="type parameter in StaticContentContainer">T</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html#staticContent-java.lang.String-">staticContent</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> base)</code>
<div class="block">Enable static content to be served from a given base in the classpath.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="log">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>log</h4>
<pre>static final <a href="http://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging">Logger</a> log</pre>
</li>
</ul>
<a name="EXTERNAL_MOUNT_PATH">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>EXTERNAL_MOUNT_PATH</h4>
<pre>static final <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> EXTERNAL_MOUNT_PATH</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.wildfly.swarm.undertow.StaticContentContainer.EXTERNAL_MOUNT_PATH">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="staticContent--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>staticContent</h4>
<pre>default <a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html" title="type parameter in StaticContentContainer">T</a> staticContent()</pre>
<div class="block">Enable static content to be served from the root of the classpath.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>This archive.</dd>
</dl>
</li>
</ul>
<a name="staticContent-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>staticContent</h4>
<pre>default <a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html" title="type parameter in StaticContentContainer">T</a> staticContent(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> base)</pre>
<div class="block">Enable static content to be served from a given base in the classpath.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>base</code> - The path prefix to use for static content.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
</dl>
</li>
</ul>
<a name="mergeIgnoringDuplicates--java.lang.String--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>mergeIgnoringDuplicates</h4>
<pre>default <a href="../../../../org/wildfly/swarm/undertow/StaticContentContainer.html" title="type parameter in StaticContentContainer">T</a> mergeIgnoringDuplicates(<any> source,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> base,
<any> filter)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StaticContentContainer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.10.2</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../org/wildfly/swarm/undertow/UndertowFraction.html" title="class in org.wildfly.swarm.undertow"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/wildfly/swarm/undertow/StaticContentContainer.html" target="_top">Frames</a></li>
<li><a href="StaticContentContainer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
|
Java
|
/**
* For JavaDocs.
*@author dgagarsky
*@since 01.12.2016
*/
package ru.job4j;
|
Java
|
# Assignment 1
## Overview
This assignment will focus on your ability to implement an Android application using test driven development methods.
## Warning
UNDER NO CIRCUMSTANCES SHOULD YOU USE THIS APP "AS IS" IN PRODUCTION!!!
## Instructions
First clone this Git Repository and import it into Android Studio, and make sure to sync the gradle project to download all required dependencies.
This assignment tests your ability to correctly implement an Android application using well defined tests as a requirements guide.
We have provided the foundation of an application that implements a location tracking service. We have also provided two test files that define the behavior of a correct implementation (a correctly implemented service should pass 100% of the test methods in each of these files). Your task is to complete the location tracking service so that it passes each of these test files.
You will need to be familiar with [Android Services](https://developer.android.com/guide/components/services.html) as well as [Android's SQLite database API](https://developer.android.com/training/basics/data-storage/databases.html) to successfully complete this assignment.
### Code to complete
Out of the classes we have provided (each described below), there are only a few places you will need to write code for this assignment. Each place where you should complete the given implementation is represented by a TODO statement in the code, and are:
- **LocationLogService**:
- *onStartCommand()*: You will perform any start up actions, gather the required data to store, and store said data in the database using the LocLogDBManger methods that you write.
- **LocLogDBManager**:
- *storeLocationData()*: Store the given data in the database
- *deleteEntries()*: Delete all entries that match the given data. Passing 'null' for one of the parameters should delete any values for that parameter.
- *queryEntries()*: Query for all entries matching the passed parameters. Returns a Cursor over the queried entries.
You are free to write any helper methods or classes you wish, but **do not change the methods** we have provided outside of the TODO sections.
## Provided Code
### Application Code:
You will be completing an application that stores the device's location and a description provided by the user in a database. The database will be accessed via a service which is available to other applications. It consists of the following classes (classes with asterisks have TODO statements for you to complete):
- **UIActivity.java**: This class acts as a simple user interface to demonstrate how the service might be used. It has a single EditText element that allows the user to enter a text description. When the user clicks the 'Log Location' button, it stores the description in an intent and uses said intent to start the LocationLogService. This activity also makes sure to request the ACCESS_FINE_LOCATION permission if it is not granted before starting the service.
- **LocationLogService.java** *: This is a started service that stores the devices location (as Latitude and Longitude), the current time, and a passed description String in a database. It is exported, meaning that any application with knowledge of its API can access it, rather than just the UIActivity described above. The OnStartCommand(), which is called when some process attempts to start the service, needs to be implemented to store the necessary data. This method is passed an intent which will contain the description String that should be stored.
- **LocLogDBManager.java** *: This class interfaces with the underlying SQLite database that will be storing the location data. It has various interface methods that store, query for, and delete database entries that must be implemented. Please note that the getSQLite() public method is only for testing purposes, and that in a production app you normally shouldn't expose a database in this way.
- **LocDBSQLHelper.java** : This is a convenience class that makes creating and gaining access to the properly initialized SQLite database easier.
- **LocDBContract.java**: This Contract defines all of the constant identifiers for the SQLite database, specifically the column names. These Constants are used to access the specific columns, and should be referenced when interacting with the database in the LocLogDBManager.
### Testing
There are two test files that need to be passed successfully by your implementation. You should read and understand each test, as they define the requirements for the application. The Rubric annotation above each test method describes what each method is testing for, and how many points it is worth.
- **DBTest.java**: (in 'app\src\test\java\extensibleapps\vandy\mooc\locationtracker' directory) This file is focused on testing your LocLocDBManger class. It will make sure that each of your interface methods works as expected, and that the manager is interfacing with the SQLite db appropriately.
- **LocationLogServiceTest.java**: (in 'app\src\androidTest\java\extensibleapps\vandy\mooc\locationtracker' directory) This file focuses on the LocLogService itself. It ensures that the service starts and handles location storage requests correctly.
## Testing Your Implementation
We are using a new, in development AutoGrading framework for this assignment. The rubrics you see above each test method are part of this framework. This framework uses Gradle to check your implementation.
To run individual test files to check your current progress, you can run the 'runUnitTests' and 'runInstermentationTests' Gradle tasks. These tasks are available in your Gradle projects tab in android studio, in the ':app/Tasks/_autograder_' folder.
To get to these tasks, first open the Gradle projects tab:

And naviate to the ':app/Tasks/_autograder_' directory, and double click to run the desired task:

Running these tasks will run the tests and show you their output, as well as give you information contained in the Rubric. The 'runUnitTests' runs the database test file, while 'runInstermentationTests' tests the service.
When you run the tests, you will see output similar to this at the bottom of your screen:

To see the detailed output including rubric information and test results, press the 'Toggle tasks executions/text mode' button (pointed to by the red arrow). This will switch to a view like the one shown below, with detailed output.

**Note:** make sure that you have an Android Virtual Device running and connected before running Instermentaiton Tests, as they will need to connect to and run the project on this device for testing.
## Submitting Your Assignment
Our Grading backend is still in development, so for now you can view the results of your testing in the generated submission directory after running the autograder. Once the backend is complete, you will be able to recieve an offical grade.
|
Java
|
using System;
using System.Xml.Serialization;
namespace Aop.Api.Domain
{
/// <summary>
/// AlipayInsAutoAutoinsprodQuoteQueryModel Data Structure.
/// </summary>
[Serializable]
public class AlipayInsAutoAutoinsprodQuoteQueryModel : AopObject
{
/// <summary>
/// 询价ID
/// </summary>
[XmlElement("enquiry_biz_id")]
public string EnquiryBizId { get; set; }
/// <summary>
/// 报价ID
/// </summary>
[XmlElement("quote_biz_id")]
public string QuoteBizId { get; set; }
}
}
|
Java
|
/**************************************************************************\
* This file is part of CaSPER. *
* *
* Copyright: *
* 2009-2009 - Marco Correia <marco.v.correia@gmail.com> *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* http://www.apache.org/licenses/LICENSE-2.0 *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an *
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, *
* either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
\*************************************************************************/
#include <iostream>
#include <fstream>
#include <sstream>
#include <libxml++/libxml++.h>
#include <bindings/cpp/cpp.h>
#include <bindings/cpp/print.h> // tmp
#include <list>
#include <boost/algorithm/string.hpp>
#include <boost/xpressive/xpressive.hpp> // must be here
#include "exprparser.h"
// Parameterized predicates
struct ParPredicate
{
std::string pars;
std::string expr;
ParPredicate(const std::string& pars, const std::string& expr) :
pars(pars),expr(expr) {}
casperbind::cpp::SharedSymbol generateConstraint(const casperbind::cpp::SymbolArray& pars);
};
casperbind::cpp::SharedSymbol ParPredicate::generateConstraint(const casperbind::cpp::SymbolArray& sympars)
{
std::map<std::string,casperbind::cpp::SharedSymbol> mpars;
// parse pars str to vector
std::vector<std::string> strpars;
boost::split(strpars, pars, boost::is_space());
// create map from par name to current symbol instantiation
if (sympars.getSize() != (int)strpars.size()/2)
throw xmlpp::validity_error(std::string("predicate defined/called with diferent number of parameters: ")+expr);
for (int i = 0; i < (int)strpars.size()/2; ++i)
mpars.insert(make_pair(strpars[i*2+1],sympars[i]));
// parse expression
ExprParser e;
casperbind::cpp::SharedSymbol s = e.parse(expr,mpars);
if (s.getType(true) != casperbind::cpp::Symbol::sPredicate)
throw xmlpp::parse_error(std::string("parsing expression: ")+expr);
return s;
}
class XCSPParser : public xmlpp::SaxParser
{
public:
XCSPParser();
virtual ~XCSPParser();
void presentationBegin(const AttributeList& atts);
void domainBegin(const AttributeList& attributes);
void domainContents(const Glib::ustring& text);
void variableBegin(const AttributeList& attributes);
void relationBegin(const AttributeList& attributes);
void relationContents(const Glib::ustring& text);
void predicateBegin(const AttributeList& attributes);
void predicateEnd();
void expressionParsContents(const Glib::ustring& text);
void expressionContents(const Glib::ustring& text);
void constraintBegin(const AttributeList& attributes);
void constraintParsContents(const Glib::ustring& text);
void constraintEnd();
casperbind::cpp::Instance getInstance() const;
protected:
//overrides:
virtual void on_start_document();
virtual void on_end_document();
virtual void on_start_element(const Glib::ustring& name,
const AttributeList& properties);
virtual void on_end_element(const Glib::ustring& name);
virtual void on_characters(const Glib::ustring& characters);
virtual void on_characters_buffered();
virtual void on_comment(const Glib::ustring& text);
virtual void on_warning(const Glib::ustring& text);
virtual void on_error(const Glib::ustring& text);
virtual void on_fatal_error(const Glib::ustring& text);
void updatePathBegin(const Glib::ustring& text) { path.push_front(text); }
void updatePathEnd(const Glib::ustring& text);
void assertParent(const Glib::ustring& text);
const Glib::ustring& parent() const;
const Glib::ustring& grandParent() const;
casperbind::cpp::IntSet parseIntSet(const Glib::ustring& text);
casperbind::cpp::IntRange parseIntRange(const Glib::ustring& text);
casperbind::cpp::SharedSymbol parseIntDomain(const Glib::ustring& text);
casperbind::cpp::IntArray parseIntTupleList(const Glib::ustring& text,
int arity, int size);
casperbind::cpp::SymbolArray parseParameters(const std::string& s) const;
casperbind::cpp::SymbolArray parseScope(const std::string& s) const;
std::list<Glib::ustring> path;
casperbind::cpp::Index index;
std::list<casperbind::cpp::SharedSymbol> variables;
std::map<std::string,casperbind::cpp::SharedSymbol> posTables;
std::map<std::string,casperbind::cpp::SharedSymbol> negTables;
Glib::ustring curCharactersBuffer;
std::string curDomainKey;
std::string curRelationKey;
int curRelationArity;
int curRelationNbTuples;
std::string curPredicateKey;
std::string curExpressionPars;
std::string curExpression;
std::map<std::string,ParPredicate*> predicates;
std::string curConstraintKey;
std::string curConstraintScope;
std::string curConstraintRef;
std::string curConstraintPars;
std::list<casperbind::cpp::SharedSymbol> constraints;
enum { pos, neg } curRelationSemantics;
};
const Glib::ustring& XCSPParser::parent() const
{ return *path.begin(); }
const Glib::ustring& XCSPParser::grandParent() const
{ return *++path.begin(); }
void XCSPParser::updatePathEnd(const Glib::ustring& text)
{
assertParent(text);
path.pop_front();
}
void XCSPParser::assertParent(const Glib::ustring& text)
{
if (parent() != text)
throw xmlpp::parse_error(std::string("parsing element: ")+text);
}
struct StrToInt
{
int operator()(const std::string& s) const
{ return atoi(s.c_str()); }
};
casperbind::cpp::IntSet XCSPParser::parseIntSet(const Glib::ustring& text)
{
std::vector<std::string> tokens;
boost::split(tokens, text.raw(), boost::is_space());
casperbind::cpp::IntSet r;
std::transform(tokens.begin(),tokens.end(),
casperbind::cpp::Detail::inserter(r),StrToInt());
return r;
}
casperbind::cpp::IntRange XCSPParser::parseIntRange(const Glib::ustring& text)
{
unsigned int pos = text.find("..");
if (pos >= text.size())
throw xmlpp::parse_error(std::string("parsing integer range: ")+text);
int lb = atoi(text.substr(0,pos).c_str());
int ub = atoi(text.substr(pos+2,text.size()).c_str());
return casperbind::cpp::IntRange(lb,ub);
}
casperbind::cpp::SharedSymbol XCSPParser::parseIntDomain(const Glib::ustring& text)
{
std::vector<Glib::ustring> tokens;
boost::split(tokens, text.raw(), boost::is_any_of("\t \r\n"));
// if we have only one range, store it and leave
if (tokens.size()==1 and tokens[0].find("..") < tokens[0].size())
return parseIntRange(text);
casperbind::cpp::IntSet s;
// else store list of values since there is no mixed sets (ranges+int) in casperbind
for (std::vector<Glib::ustring>::iterator it = tokens.begin();
it != tokens.end(); ++it)
if (it->find("..") < tokens[0].size()) // is a range
{
casperbind::cpp::IntRange r(parseIntRange(*it));
for (int i = r.getLower(); i <= r.getUpper(); ++i)
s.add(i);
}
else // is a set
{
casperbind::cpp::IntSet r(parseIntSet(*it));
for (casperbind::cpp::IntSet::ConstIterator it2 = r.begin();
it2 != r.end(); ++it2)
s.add(*it2);
}
return s;
}
casperbind::cpp::IntArray XCSPParser::parseIntTupleList(const Glib::ustring& text,
int arity, int size)
{
int dims[2] = { size, arity };
casperbind::cpp::IntArray r(2,dims);
int c = 0;
std::vector<std::string> tuples;
boost::split(tuples, text.raw(), boost::is_any_of("|"));
for (std::vector<std::string>::iterator it = tuples.begin();
it != tuples.end(); ++it)
{
std::vector<std::string> elements;
boost::split(elements, *it, boost::is_any_of(" \t\r\n"));
std::transform(elements.begin(),elements.end(),&r[c],StrToInt());
c += elements.size();
}
return r;
}
casperbind::cpp::SymbolArray XCSPParser::parseParameters(const std::string& s) const
{
std::list<casperbind::cpp::SharedSymbol> l;
std::vector<std::string> pars;
boost::split(pars, s, boost::is_any_of("\t\r\n "));
for (std::vector<std::string>::const_iterator it = pars.begin();
it != pars.end(); ++it)
if (index.hasKey(*it)) // parameter is a variable
l.push_back(index.getSymbol(*it));
else // parameter is an integral constant
l.push_back(casperbind::cpp::int(atoi(it->c_str())));
casperbind::cpp::SymbolArray r(l.size());
std::copy(l.begin(),l.end(),r.getData());
return r;
}
casperbind::cpp::SymbolArray XCSPParser::parseScope(const std::string& s) const
{
std::list<casperbind::cpp::SharedSymbol> l;
std::vector<std::string> pars;
boost::split(pars, s, boost::is_any_of("\t\r\n "));
for (std::vector<std::string>::const_iterator it = pars.begin();
it != pars.end(); ++it)
if (index.hasKey(*it)) // parameter is a variable
l.push_back(index.getSymbol(*it));
else // something is wrong
throw xmlpp::parse_error(std::string("undeclared variable in constraint scope: ")+s);
casperbind::cpp::SymbolArray r(l.size());
std::copy(l.begin(),l.end(),r.getData());
return r;
}
void XCSPParser::presentationBegin(const AttributeList& attributes)
{
// test for valid XCSP format versions
const int n = 2;
Glib::ustring compatibleVersions[n] = { "XCSP 2.0","XCSP 2.1" };
Glib::ustring name = "format";
AttributeList::const_iterator versionIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName(name));
if (versionIt == attributes.end() or
std::find_if(compatibleVersions,
&compatibleVersions[n],
std::bind1st(std::equal_to<Glib::ustring>(),versionIt->value))==
&compatibleVersions[n])
{
std::ostringstream s;
std::copy(compatibleVersions,&compatibleVersions[n],
std::ostream_iterator<Glib::ustring>(s,", "));
throw xmlpp::validity_error("incompatible XCSP version. Supported versions: "+s.str());
}
}
void XCSPParser::domainBegin(const AttributeList& attributes)
{
AttributeList::const_iterator nameIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("name"));
if (nameIt == attributes.end())
throw xmlpp::validity_error("unnamed domain found");
curDomainKey = nameIt->value;
}
void XCSPParser::variableBegin(const AttributeList& attributes)
{
AttributeList::const_iterator nameIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("name"));
std::string curVariableKey = nameIt->value;
if (nameIt == attributes.end())
throw xmlpp::validity_error("unnamed variable");
AttributeList::const_iterator domIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("domain"));
if (domIt == attributes.end())
throw xmlpp::validity_error("variable with unspecified domain");
const casperbind::cpp::SharedSymbol& dom = index.getSymbol(domIt->value);
if (dom.getType()!=casperbind::cpp::Symbol::sSymbol)
throw xmlpp::validity_error("assertion failure in XCSPParser::variableBegin");
casperbind::cpp::SharedSymbol var = casperbind::cpp::Variable(dom);
variables.push_back(var);
index.add(var,curVariableKey);
}
void XCSPParser::relationBegin(const AttributeList& attributes)
{
AttributeList::const_iterator nameIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("name"));
if (nameIt == attributes.end())
throw xmlpp::validity_error("unnamed relation");
curRelationKey = nameIt->value;
AttributeList::const_iterator arityIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("arity"));
if (arityIt == attributes.end())
throw xmlpp::validity_error("relation with unspecified arity");
curRelationArity = atoi(arityIt->value.c_str());
AttributeList::const_iterator nbIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("nbTuples"));
if (nbIt == attributes.end())
throw xmlpp::validity_error("relation with unspecified nbTuples");
curRelationNbTuples = atoi(nbIt->value.c_str());
AttributeList::const_iterator semIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("semantics"));
if (semIt == attributes.end())
throw xmlpp::validity_error("relation with unspecified semantics");
if (semIt->value == "supports")
curRelationSemantics = pos;
else
curRelationSemantics = neg;
}
void XCSPParser::predicateBegin(const AttributeList& attributes)
{
AttributeList::const_iterator nameIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("name"));
if (nameIt == attributes.end())
throw xmlpp::validity_error("unnamed predicate found");
curPredicateKey = nameIt->value;
}
void XCSPParser::domainContents(const Glib::ustring& text)
{
index.add(parseIntDomain(text),curDomainKey);
}
void XCSPParser::relationContents(const Glib::ustring& text)
{
casperbind::cpp::IntArray a = parseIntTupleList(text,curRelationArity,
curRelationNbTuples);
index.add(a,curRelationKey);
if (curRelationSemantics == pos)
posTables.insert(make_pair(curRelationKey,index.getSymbol(curRelationKey)));
else
negTables.insert(make_pair(curRelationKey,index.getSymbol(curRelationKey)));
}
void XCSPParser::expressionParsContents(const Glib::ustring& text)
{
curExpressionPars = text;
}
void XCSPParser::expressionContents(const Glib::ustring& text)
{
curExpression = text;
}
void XCSPParser::predicateEnd()
{
if (predicates.find(curPredicateKey) != predicates.end())
throw xmlpp::validity_error("multiple definitions of predicate with same name");
predicates.insert(std::make_pair(curPredicateKey,new ParPredicate(curExpressionPars,curExpression)));
}
void XCSPParser::constraintBegin(const AttributeList& attributes)
{
AttributeList::const_iterator nameIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("name"));
if (nameIt == attributes.end())
throw xmlpp::validity_error("unnamed constraint");
curConstraintKey = nameIt->value;
AttributeList::const_iterator scopeIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("scope"));
if (scopeIt == attributes.end())
throw xmlpp::validity_error("constraint with unspecified scope");
curConstraintScope = scopeIt->value;
AttributeList::const_iterator refIt = std::find_if(attributes.begin(),
attributes.end(), AttributeHasName("reference"));
if (refIt == attributes.end())
throw xmlpp::validity_error("constraint with unspecified reference");
curConstraintRef = refIt->value;
}
void XCSPParser::constraintParsContents(const Glib::ustring& text)
{
curConstraintPars = text;
}
void XCSPParser::constraintEnd()
{
// if cur constraint is a predicate
if (predicates.find(curConstraintRef)!=predicates.end())
{
casperbind::cpp::SymbolArray pars = parseParameters(curConstraintPars);
index.add(predicates[curConstraintRef]->generateConstraint(pars),curConstraintKey);
constraints.push_back(index.getSymbol(curConstraintKey));
}
else // if cur constraint is a positive table
if (posTables.find(curConstraintRef) != posTables.end())
{
casperbind::cpp::SymbolArray vars = parseScope(curConstraintScope);
casperbind::cpp::SymbolArray pars(2);
pars[0] = vars;
pars[1] = posTables[curConstraintRef];
casperbind::cpp::SharedSymbol s =
casperbind::cpp::Predicate(casperbind::cpp::Predicate::pInTable,pars);
index.add(s,curConstraintKey);
constraints.push_back(s);
}
else
if (negTables.find(curConstraintRef) != negTables.end())
{
casperbind::cpp::SymbolArray vars = parseScope(curConstraintScope);
casperbind::cpp::SymbolArray pars(2);
pars[0] = vars;
pars[1] = negTables[curConstraintRef];
casperbind::cpp::SharedSymbol s =
casperbind::cpp::Predicate(casperbind::cpp::Predicate::pNotInTable,pars);
index.add(s,curConstraintKey);
constraints.push_back(s);
}
}
XCSPParser::XCSPParser()
: xmlpp::SaxParser()
{
}
XCSPParser::~XCSPParser()
{
}
void XCSPParser::on_start_document()
{
std::cout << "on_start_document()" << std::endl;
}
void XCSPParser::on_end_document()
{
std::cout << "on_end_document()" << std::endl;
}
void XCSPParser::on_start_element(const Glib::ustring& name,
const AttributeList& attributes)
{
if (name == "presentation")
{
assertParent("instance");
presentationBegin(attributes);
}
else
if (name == "domains")
assertParent("instance");
else
if (name == "domain")
{
assertParent("domains");
domainBegin(attributes);
}
else
if (name == "variables")
assertParent("instance");
else
if (name == "variable")
{
assertParent("variables");
variableBegin(attributes);
}
else
if (name == "relations")
assertParent("instance");
else
if (name == "relation")
{
assertParent("relations");
relationBegin(attributes);
}
else
if (name == "predicates")
assertParent("instance");
else
if (name == "predicate")
{
assertParent("predicates");
predicateBegin(attributes);
}
else
if (name == "constraint")
{
assertParent("constraints");
constraintBegin(attributes);
}
updatePathBegin(name);
curCharactersBuffer = "";
}
void XCSPParser::on_end_element(const Glib::ustring& name)
{
if (curCharactersBuffer.size()>0)
{
on_characters_buffered();
curCharactersBuffer = "";
}
if (parent()=="predicate")
predicateEnd();
else
if (parent()=="constraint")
constraintEnd();
updatePathEnd(name);
// std::cout << "on_end_element()" << std::endl;
}
void XCSPParser::on_characters(const Glib::ustring& text)
{
curCharactersBuffer += text;
}
void XCSPParser::on_characters_buffered()
{
if (parent()=="domain")
domainContents(curCharactersBuffer);
else
if (parent()=="relation")
relationContents(curCharactersBuffer);
else
if (parent()=="parameters" and grandParent()=="predicate")
expressionParsContents(curCharactersBuffer);
else
if (parent()=="functional" and grandParent()=="expression")
expressionContents(curCharactersBuffer);
else
if (parent()=="parameters" and grandParent()=="constraint")
constraintParsContents(curCharactersBuffer);
// std::cout << "on_characters(): " << text << std::endl;
}
void XCSPParser::on_comment(const Glib::ustring& text)
{
std::cout << "on_comment(): " << text << std::endl;
}
void XCSPParser::on_warning(const Glib::ustring& text)
{
std::cout << "on_warning(): " << text << std::endl;
}
void XCSPParser::on_error(const Glib::ustring& text)
{
std::cout << "on_error(): " << text << std::endl;
}
void XCSPParser::on_fatal_error(const Glib::ustring& text)
{
std::cout << "on_fatal_error(): " << text << std::endl;
}
casperbind::cpp::Instance XCSPParser::getInstance() const
{
casperbind::cpp::SymbolArray vars(variables.size());
int c = 0;
// FIXME this should be only labeling variables (the remaining are refd indirectly)
for (std::list<casperbind::cpp::SharedSymbol>::const_iterator it = variables.begin();
it != variables.end(); ++it)
vars[c++] = *it;
casperbind::cpp::SymbolArray cons(constraints.size());
c = 0;
for (std::list<casperbind::cpp::SharedSymbol>::const_iterator it = constraints.begin();
it != constraints.end(); ++it)
cons[c++] = *it;
return casperbind::cpp::Instance(index,vars,cons);
}
int
main(int argc, char* argv[])
{
std::string filepath;
if(argc > 1 )
filepath = argv[1]; //Allow the user to specify a different XML file to parse.
else
{
std::cerr << "usage: " << argv[0] << " xcspfile" << std::endl;
return 1;
}
// Parse the entire document in one go:
try
{
XCSPParser parser;
parser.set_substitute_entities(true); //
parser.parse_file(filepath);
SymStream scout(std::cout,parser.getInstance().getIndex());
scout << parser.getInstance() << std::endl;
}
catch(const xmlpp::exception& ex)
{
std::cout << "exception: " << ex.what() << std::endl;
}
return 0;
}
|
Java
|
# Poa densiflora Buckley SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package controller
import (
"github.com/op/go-logging"
"github.com/spf13/viper"
"github.com/openblockchain/obc-peer/openchain/consensus"
"github.com/openblockchain/obc-peer/openchain/consensus/noops"
"github.com/openblockchain/obc-peer/openchain/consensus/obcpbft"
)
var logger *logging.Logger // package-level logger
func init() {
logger = logging.MustGetLogger("consensus/controller")
}
// NewConsenter constructs a Consenter object
func NewConsenter(stack consensus.Stack) (consenter consensus.Consenter) {
plugin := viper.GetString("peer.validator.consensus")
if plugin == "obcpbft" {
//logger.Info("Running with consensus plugin %s", plugin)
consenter = obcpbft.GetPlugin(stack)
} else {
//logger.Info("Running with default consensus plugin (noops)")
consenter = noops.GetNoops(stack)
}
return
}
|
Java
|
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{{ with .Get 0 }}
<figure>
<img src="{{- relURL . -}}" />
</figure>
{{ end }}
|
Java
|
/*
* Copyright 2005-2007 Maarten Billemont
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.lyndir.lhunath.opal.gui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
/**
* <i>{@link ListenerAction} - [in short] (TODO).</i><br> <br> [description / usage].<br> <br>
*
* @author lhunath
*/
public class ListenerAction extends AbstractAction {
private final ActionListener listener;
/**
* Create a new {@link ListenerAction} instance.
*
* @param listener The listener that will be notified of this action.
*/
public ListenerAction(final ActionListener listener) {
this.listener = listener;
}
/**
* Create a new {@link ListenerAction} instance.
*
* @param name The name of the action.
* @param listener The listener that will be notified of this action.
*/
public ListenerAction(final String name, final ActionListener listener) {
super( name );
this.listener = listener;
}
/**
* Create a new {@link ListenerAction} instance.
*
* @param name The name of the action.
* @param command The string that will identify the action that must be taken.
* @param icon The icon of the action.
* @param listener The listener that will be notified of this action.
*/
public ListenerAction(final String name, final String command, final Icon icon, final ActionListener listener) {
super( name, icon );
this.listener = listener;
setActionCommand( command );
}
/**
* Specify an action command string for this action.
*
* @param command The string that will identify the action that must be taken.
*/
public void setActionCommand(final String command) {
putValue( ACTION_COMMAND_KEY, command );
}
/**
* Specify an action command string for this action.
*
* @return The string that will identify the action that must be taken.
*/
public String getActionCommand() {
return getValue( ACTION_COMMAND_KEY ) == null? null: getValue( ACTION_COMMAND_KEY ).toString();
}
/**
* {@inheritDoc}
*/
@Override
public void actionPerformed(final ActionEvent e) {
if (listener != null)
listener.actionPerformed( e );
}
}
|
Java
|
{$Header}
<main role="main" class="main" contenteditable="false">
<aside id="notifications">
<!-- Notifications -->
{if !empty($error)}<div class="notification-error">{$error}</div>{/if}
{if !empty($success)}<div class="notification-success">{$success}</div>{/if}
</aside>
<section class="frame">
<header>
<section class="box entry-title">
<form method="GET">
<input class="" type="text" name="q" value="{$keyword}" placeholder="Keyword..." />
</form>
</section>
</header>
<section class="entry-container" id="google-trend">
{$GoogleTrendScript}
</section>
</section>
</main>
|
Java
|
// TODO split modules, controllers, services
// info separate files and concat/uglify them
let remote = require('remote')
let fs = require('fs')
let mysql = require('promise-mysql')
let app = angular.module('ttableinstaller', ['ngRoute'])
photon.start(document)
app.config(($routeProvider) => {
$routeProvider
.when('/', {
templateUrl: 'templates/main.html',
controller: 'MainController'
})
.otherwise({
redirectTo: '/'
})
})
|
Java
|
#region Copyright 2010 by Roger Knapp, Licensed under the Apache License, Version 2.0
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.Security.Cryptography;
using Interop.BugTraqProvider;
using CSharpTest.Net.WinForms;
using CSharpTest.Net.Crypto;
using CSharpTest.Net.SvnPlugin.Interfaces;
using CSharpTest.Net.SvnPlugin.UI;
using System.Runtime.CompilerServices;
using System.Configuration;
using CSharpTest.Net.Serialization;
namespace CSharpTest.Net.SvnPlugin
{
/// <summary>
/// COM Registered InterOp for TortoiseSVN integration
/// </summary>
[ComVisible(true), ProgId("SvnPlugin.MyPlugin"), Guid(MyPlugin.GUID), ClassInterface(ClassInterfaceType.AutoDual)]
public class MyPlugin : IDisposable, IBugTraqProvider, IBugTraqProvider2
{
const string GUID = "CF732FD7-AA8A-4E9D-9E15-025E4D1A7E9D";
const string CLSID = "{" + GUID + "}";
const string BUTTON_TEXT = "{0} Issues";
private IIssuesService _connector = null;
private IIssuesServiceConnection _service = null;
private IssuesListView _issues = null;
private Configuration _config = null;
private bool _cancelled = true;
/// <summary> Constructs a MyPlugin </summary>
public MyPlugin()
{
//System.Diagnostics.Debugger.Break();
Log.Write("Started, logging to {0}", Log.Config.LogFile);
Resolver.Hook();
CertificateHandler.Hook();
}
#region Public Interfaces:
/// <summary> Returns true if the operation was cancelled </summary>
public bool Canceled { get { return _cancelled; } }
private string GetAppSetting(string name)
{
if (_config == null)
{
Log.Verbose("Settings = {0}", this.GetType().Assembly.Location);
_config = ConfigurationManager.OpenExeConfiguration(this.GetType().Assembly.Location);
}
KeyValueConfigurationElement setting = _config.AppSettings.Settings[name];
return setting == null ? null : setting.Value;
}
/// <summary> Returns the Issue tracking connector </summary>
public IIssuesService Connector
{
get
{
if (_connector == null)
{
string fullClass = GetAppSetting(typeof(IIssuesService).FullName);
Log.Verbose("IIssuesService = '{0}'", fullClass);
if (string.IsNullOrEmpty(fullClass))
throw new ApplicationException("Unable to locate CSharpTest.Net.SvnPlugin.Interfaces.IIssuesService entry in app.config");
_connector = (IIssuesService)Type.GetType(fullClass, true).InvokeMember("", System.Reflection.BindingFlags.CreateInstance, null, null, null);
}
return _connector;
}
}
/// <summary>
/// Returns true if the configuration is present (not nessessarily valid)
/// </summary>
public bool IsConfigured(IntPtr hParentWnd, string rootUrl, string commonRoot)
{
string service, user, password;
return TryParseParameters(hParentWnd, rootUrl, commonRoot, out service, out user, out password);
}
/// <summary>
/// Attepts to log on to the specified instance. The instance url must contain a user
/// name in the format of "http://user@server:port/".
/// </summary>
public bool Logon(IntPtr hParentWnd, string rootUrl, string commonRoot)
{
string message;
if (_service != null)
return true;
if (!TryLogon(hParentWnd, rootUrl, commonRoot, out message, out _service))
{
ShowError(hParentWnd, String.Format("Unable to connect to {1}, check your configuration.\r\nReason: {0}", message, Connector.ServiceName), "Login Error");
return false;
}
return _service != null;
}
/// <summary>
/// Prompt the user for the comments and related issues
/// </summary>
public string GetCommitMsg(IntPtr hParentWnd, string rootUrl, string originalMessage, string commonRoot, string[] files)
{
string message = originalMessage;
try
{
if (!Logon(hParentWnd, rootUrl, commonRoot))
return originalMessage;
if (_issues == null)
_issues = new IssuesListView(_service, originalMessage, files);
else
_issues.SyncComments(originalMessage);
IssuesList form = new IssuesList(_issues);
if (hParentWnd == IntPtr.Zero)
form.ShowInTaskbar = true;
if (form.ShowDialog(Win32Window.FromHandle(hParentWnd)) != DialogResult.OK)
{ _cancelled = true; return originalMessage; }
_cancelled = false;
return _issues.GetFullComments();
}
catch (OperationCanceledException) { _cancelled = true; return originalMessage; }
catch (Exception ex)
{
ShowError(hParentWnd, ex.Message, ex.GetType().FullName);
throw;
}
}
/// <summary>
/// Commit the requested changes for any related issues
/// </summary>
public string CommitChanges(IntPtr hParentWnd, string originalMessage, int revision, string[] files)
{
if (Canceled) return originalMessage;
if (_service == null || _issues == null)
throw new UnauthorizedAccessException();
_issues.SyncComments(originalMessage);
StringBuilder sbResponse = new StringBuilder();
sbResponse.AppendFormat("{0}", originalMessage);
if (GetAppSetting("addRevisionComment") == "false")
revision = -1;
if (GetAppSetting("addFilesComment") == "false")
files = new string[0];
foreach (Exception e in _issues.CommitChanges(revision, files))
{
sbResponse.AppendLine();
sbResponse.AppendFormat("ERROR: {0}", e.Message);
}
return sbResponse.ToString();
}
#endregion
#region Private Helpers
void ShowError(IntPtr hParentWnd, string text, string caption)
{
_cancelled = true;
MessageBox.Show(Win32Window.FromHandle(hParentWnd), text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
void SaveSettings(string userId, string uri, string password)
{
INameValueStore storage = new CSharpTest.Net.Serialization.StorageClasses.RegistryStorage();
try
{
if (String.IsNullOrEmpty(password))
{
storage.Delete(uri, "UserName");
storage.Delete(uri, "Password");
}
else
{
storage.Write(uri, "UserName", userId);
storage.Write(uri, "Password", Encryption.CurrentUser.Encrypt(password));
}
}
catch { }
}
string ReadSettings(IntPtr hParentWnd, string serviceUri, ref string userId)
{
INameValueStore storage = new CSharpTest.Net.Serialization.StorageClasses.RegistryStorage();
try
{
string password;
storage.Read(serviceUri, "UserName", out userId);
if (storage.Read(serviceUri, "Password", out password))
return Encryption.CurrentUser.Decrypt(password);
}
catch { }
PasswordEntry pwdDlg = new PasswordEntry(userId, serviceUri);
if (pwdDlg.ShowDialog(Win32Window.FromHandle(hParentWnd)) == DialogResult.OK)
{
userId = pwdDlg.UserName.Text;
SaveSettings(userId, serviceUri, pwdDlg.Password.Text);
return pwdDlg.Password.Text;
}
return null;
}
bool TryParseParameters(IntPtr hParentWnd, string parameters, string commonRoot, out string serviceUri, out string user, out string password)
{
serviceUri = user = password = null;
if (String.IsNullOrEmpty(parameters) && !String.IsNullOrEmpty(commonRoot))
{ //Read from svn...
SvnProperties props = new SvnProperties(commonRoot);
string testUri = props.Search(".", true, Connector.UriPropertyName);
if (!String.IsNullOrEmpty(testUri))
parameters = testUri;
}
if (String.IsNullOrEmpty(parameters))
{
string test = System.Configuration.ConfigurationManager.AppSettings[Connector.UriPropertyName];
if (!String.IsNullOrEmpty(test))
parameters = test;
}
Uri uri;
if (Uri.TryCreate(parameters, UriKind.Absolute, out uri))
{
serviceUri = String.Format("{0}://{1}:{2}{3}", uri.Scheme, uri.Host, uri.Port, uri.PathAndQuery);
if (!String.IsNullOrEmpty(uri.UserInfo))
{
string[] parts = uri.UserInfo.Split(':');
if (parts.Length == 2 && !String.IsNullOrEmpty(parts[0]) && !String.IsNullOrEmpty(parts[1]))
{
user = parts[0];
password = parts[1];
}
else
{
user = uri.UserInfo;
password = ReadSettings(hParentWnd, serviceUri, ref user);
}
}
else
password = ReadSettings(hParentWnd, serviceUri, ref user);
if (!String.IsNullOrEmpty(user) && !String.IsNullOrEmpty(password))
return true;
}
return false;
}
string GetParamDesc()
{
string message = "Parameter must be a valid absolute uri optionally with \r\n" +
"a user name and password. Leave blank to read value from svn \r\n" +
"property named: '{0}'\r\n" +
"\tExample 1: http://{2}.com:8080\r\n" +
"\tExample 2: http://username@{2}.com:8080\r\n" +
"\tExample 3: http://username:password@{2}.com:8080";
return String.Format(message, Connector.UriPropertyName, Connector.ServiceName, Connector.ServiceName.ToLower());
}
bool TryLogon(IntPtr hParentWnd, string parameters, string commonRoot, out string message, out IIssuesServiceConnection service)
{
IIssuesService connector = this.Connector;
string serviceUri, user, password;
message = null;
service = null;
if (!TryParseParameters(hParentWnd, parameters, commonRoot, out serviceUri, out user, out password))
{
message = GetParamDesc();
return false;
}
try
{
if (!connector.Connect(serviceUri, user, password, GetAppSetting, out service))
{
SaveSettings(user, serviceUri, null);
return false;
}
return true;
}
catch (Exception e)
{
Log.Error(e);
message = e.Message;
return false;
}
}
#endregion
/// <summary> Releases any locked resources </summary>
public void Dispose()
{
if (_issues != null)
_issues.Dispose();
_issues = null;
if (_service != null)
_service.Dispose();
_service = null;
}
#region IBugTraqProvider2 Members
bool IBugTraqProvider2.ValidateParameters(IntPtr hParentWnd, string parameters)
{
try
{
return String.IsNullOrEmpty(parameters) || Logon(hParentWnd, parameters, null);
}
catch (Exception e) { Log.Error(e); throw; }
}
string IBugTraqProvider2.GetLinkText(IntPtr hParentWnd, string parameters)
{
try
{
return String.Format(BUTTON_TEXT, Connector.ServiceName);
}
catch (Exception e) { Log.Error(e); throw; }
}
string IBugTraqProvider2.GetCommitMessage(IntPtr hParentWnd, string parameters, string commonRoot, string[] pathList, string originalMessage)
{
try
{
return GetCommitMsg(hParentWnd, parameters, originalMessage, commonRoot, pathList);
}
catch (Exception e) { Log.Error(e); throw; }
}
string IBugTraqProvider2.GetCommitMessage2(IntPtr hParentWnd, string parameters, string commonURL, string commonRoot, string[] pathList, string originalMessage, string bugID, out string bugIDOut, out string[] revPropNames, out string[] revPropValues)
{
try
{
bugIDOut = bugID;
revPropNames = new string[0];
revPropValues = new string[0];
string message = GetCommitMsg(hParentWnd, parameters, originalMessage, commonRoot, pathList);
if (_issues != null)
{
foreach (IIssue issue in _issues.SelectedIssues)
{ bugIDOut = issue.DisplayId; break; }
}
return message;
}
catch (Exception e) { Log.Error(e); throw; }
}
string IBugTraqProvider2.CheckCommit(IntPtr hParentWnd, string parameters, string commonURL, string commonRoot, string[] pathList, string commitMessage)
{
try
{
return String.Empty;
}
catch (Exception e) { Log.Error(e); throw; }
}
string IBugTraqProvider2.OnCommitFinished(IntPtr hParentWnd, string commonRoot, string[] pathList, string originalMessage, int revision)
{
try
{
return CommitChanges(hParentWnd, originalMessage, revision, pathList);
}
catch (Exception e) { Log.Error(e); throw; }
}
bool IBugTraqProvider2.HasOptions() { return true; }
///TODO: - need to complete implementation for options dialog
string IBugTraqProvider2.ShowOptionsDialog(IntPtr hParentWnd, string parameters)
{
try
{
OptionUrlEntry dlg = new OptionUrlEntry(parameters, GetParamDesc());
if (dlg.ShowDialog(Win32Window.FromHandle(hParentWnd)) == DialogResult.OK)
return dlg.ServiceUri.Text;
return parameters;
}
catch (Exception e) { Log.Error(e); throw; }
}
#endregion
#region IBugTraqProvider Members
bool IBugTraqProvider.ValidateParameters(IntPtr hParentWnd, string parameters)
{
try
{
return String.IsNullOrEmpty(parameters) || Logon(hParentWnd, parameters, null);
}
catch (Exception e) { Log.Error(e); throw; }
}
string IBugTraqProvider.GetLinkText(IntPtr hParentWnd, string parameters)
{
try
{
return String.Format(BUTTON_TEXT, Connector.ServiceName);
}
catch (Exception e) { Log.Error(e); throw; }
}
string IBugTraqProvider.GetCommitMessage(IntPtr hParentWnd, string parameters, string commonRoot, string[] pathList, string originalMessage)
{
try
{
string message = GetCommitMsg(hParentWnd, parameters, originalMessage, commonRoot, pathList);
message = CommitChanges(hParentWnd, message, -1, new string[0]);
return message;
}
catch (Exception e) { Log.Error(e); throw; }
}
#endregion
#region COM Interop/Registration
static IEnumerable<string> GetRegistryKeysToAdd()
{
yield return String.Format(@"CLSID\{0}\Implemented Categories\{{3494FA92-B139-4730-9591-01135D5E7831}}", CLSID);
yield return String.Format(@"CLSID\{0}\Implemented Categories\{{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}}", CLSID);
}
/// <summary>
/// Registeres this assembly with COM using the custom keys required for TortoiseSVN interop
/// </summary>
[ComRegisterFunction]
public static void RegisterFunction(Type t)
{
try
{
if (typeof(MyPlugin) == t)
{
foreach (string keypath in GetRegistryKeysToAdd())
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(keypath))
{ key.Close(); }//{ Console.WriteLine(key.ToString()); }
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(String.Format(@"CLSID\{0}\InprocServer32", CLSID)))
if (key != null) key.SetValue("Assembly", t.Assembly.FullName);
if (t.Assembly.Location != null && System.IO.File.Exists(t.Assembly.Location))
{
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(String.Format(@"CLSID\{0}\InprocServer32", CLSID)))
if (key != null) key.SetValue("CodeBase", t.Assembly.Location);
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(String.Format(@"CLSID\{0}\InprocServer32\{1}", CLSID, t.Assembly.GetName().Version)))
{
if (key != null)
{
key.SetValue(null, "mscoree.dll");
key.SetValue("ThreadingModel", "Both");
key.SetValue("CodeBase", t.Assembly.Location);
}
}
}
}
}
catch (Exception e)
{
Console.Error.WriteLine(e.ToString());
}
}
/// <summary>
/// Unregisteres this assembly removing the custom keys required for TortoiseSVN interop
/// </summary>
[ComUnregisterFunction]
public static void UnregisterFunction(Type t)
{
try
{
foreach (string key in GetRegistryKeysToAdd())
Registry.ClassesRoot.DeleteSubKey(key, false);
}
catch (Exception e)
{
Console.Error.WriteLine(e.ToString());
}
}
#endregion
}
}
|
Java
|
/*
* Copyright 2008-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.jpa.repository.config;
import static org.junit.Assert.*;
import org.springframework.test.context.ContextConfiguration;
/**
* Integration test to test {@link org.springframework.core.type.filter.TypeFilter} integration into namespace.
*
* @author Oliver Gierke
*/
@ContextConfiguration(locations = "classpath:config/namespace-autoconfig-typefilter-context.xml")
public class TypeFilterConfigTests extends AbstractRepositoryConfigTests {
/*
* (non-Javadoc)
*
* @see
* org.springframework.data.jpa.repository.config.AbstractRepositoryConfigTests
* #testContextCreation()
*/
@Override
public void testContextCreation() {
assertNotNull(userRepository);
assertNotNull(roleRepository);
assertNull(auditableUserRepository);
}
}
|
Java
|
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>DateField - ScalaTest 2.2.4 - org.scalatest.selenium.WebBrowser.DateField</title>
<meta name="description" content="DateField - ScalaTest 2.2.4 - org.scalatest.selenium.WebBrowser.DateField" />
<meta name="keywords" content="DateField ScalaTest 2.2.4 org.scalatest.selenium.WebBrowser.DateField" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../lib/jquery.js" id="jquery-js"></script>
<script type="text/javascript" src="../../../lib/jquery-ui.js"></script>
<script type="text/javascript" src="../../../lib/template.js"></script>
<script type="text/javascript" src="../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
if(top === self) {
var url = '../../../index.html';
var hash = 'org.scalatest.selenium.WebBrowser$DateField';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-71294502-3', 'auto');
ga('send', 'pageview');
</script>
</head>
<body class="type">
<!-- Top of doc.scalatest.org [javascript] -->
<script type="text/javascript">
var rnd = window.rnd || Math.floor(Math.random()*10e6);
var pid204546 = window.pid204546 || rnd;
var plc204546 = window.plc204546 || 0;
var abkw = window.abkw || '';
var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER';
document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>');
</script>
<div id="definition">
<img src="../../../lib/class_big.png" />
<p id="owner"><a href="../../package.html" class="extype" name="org">org</a>.<a href="../package.html" class="extype" name="org.scalatest">scalatest</a>.<a href="package.html" class="extype" name="org.scalatest.selenium">selenium</a>.<a href="WebBrowser.html" class="extype" name="org.scalatest.selenium.WebBrowser">WebBrowser</a></p>
<h1>DateField</h1>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">class</span>
</span>
<span class="symbol">
<span class="name">DateField</span><span class="result"> extends <a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a> with <a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>This class is part of ScalaTest's Selenium DSL. Please see the documentation for
<a href="WebBrowser.html"><code>WebBrowser</code></a> for an overview of the Selenium DSL.</p><p>This class enables syntax such as the following:</p><p><pre class="stHighlighted">
dateField(<span class="stQuotedString">"q"</span>).value should be (<span class="stQuotedString">"2003-03-01"</span>)
</pre>
</p></div><dl class="attributes block"> <dt>Source</dt><dd><a href="https://github.com/scalatest/scalatest/tree/release-2.2.4-for-scala-2.11-and-2.10/src/main/scala/org/scalatest/selenium/WebBrowser.scala" target="_blank">WebBrowser.scala</a></dd><dt>Exceptions thrown</dt><dd><span class="cmt">TestFailedExeption<p>if the passed <code>WebElement</code> does not represent a date field
</p></span></dd></dl><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a>, <a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="org.scalatest.selenium.WebBrowser.DateField"><span>DateField</span></li><li class="in" name="org.scalatest.selenium.WebBrowser.ValueElement"><span>ValueElement</span></li><li class="in" name="org.scalatest.selenium.WebBrowser.Element"><span>Element</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show all</span></li>
</ol>
<a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="constructors" class="members">
<h3>Instance Constructors</h3>
<ol><li name="org.scalatest.selenium.WebBrowser.DateField#<init>" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="<init>(underlying:org.openqa.selenium.WebElement):WebBrowser.this.DateField"></a>
<a id="<init>:DateField"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">new</span>
</span>
<span class="symbol">
<span class="name">DateField</span><span class="params">(<span name="underlying">underlying: <span class="extype" name="org.openqa.selenium.WebElement">WebElement</span></span>)</span>
</span>
</h4>
<p class="shortcomment cmt"></p><div class="fullcomment"><div class="comment cmt"></div><dl class="paramcmts block"><dt class="param">underlying</dt><dd class="cmt"><p>the <code>WebElement</code> representing a date field</p></dd></dl><dl class="attributes block"> <dt>Exceptions thrown</dt><dd><span class="cmt">TestFailedExeption<p>if the passed <code>WebElement</code> does not represent a date field
</p></span></dd></dl></div>
</li></ol>
</div>
<div id="values" class="values members">
<h3>Value Members</h3>
<ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:AnyRef):Boolean"></a>
<a id="!=(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Any#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a>
<a id="!=(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<a id="##():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:AnyRef):Boolean"></a>
<a id="==(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Any#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a>
<a id="==(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<a id="asInstanceOf[T0]:T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#attribute" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="attribute(name:String):Option[String]"></a>
<a id="attribute(String):Option[String]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">attribute</span><span class="params">(<span name="name">name: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Option">Option</span>[<span class="extype" name="scala.Predef.String">String</span>]</span>
</span>
</h4>
<p class="shortcomment cmt">The attribute value of the given attribute name of this element, wrapped in a <code>Some</code>, or <code>None</code> if no
such attribute exists on this <code>Element</code>.</p><div class="fullcomment"><div class="comment cmt"><p>The attribute value of the given attribute name of this element, wrapped in a <code>Some</code>, or <code>None</code> if no
such attribute exists on this <code>Element</code>.</p><p>This method invokes <code>getAttribute</code> on the underlying <code>WebElement</code>, passing in the
specified <code>name</code>.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the attribute with the given name, wrapped in a <code>Some</code>, else <code>None</code>
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.ValueElement#checkCorrectType" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="checkCorrectType(isA:org.openqa.selenium.WebElement=>Boolean,typeDescription:String):Unit"></a>
<a id="checkCorrectType((WebElement)⇒Boolean,String):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">checkCorrectType</span><span class="params">(<span name="isA">isA: (<span class="extype" name="org.openqa.selenium.WebElement">WebElement</span>) ⇒ <span class="extype" name="scala.Boolean">Boolean</span></span>, <span name="typeDescription">typeDescription: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.ValueElement#clear" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clear():Unit"></a>
<a id="clear():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clear</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">Clears this field.</p><div class="fullcomment"><div class="comment cmt"><p>Clears this field.
</p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a></dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a>
<a id="clone():AnyRef"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a>
<a id="eq(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(other:Any):Boolean"></a>
<a id="equals(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="other">other: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">Returns the result of invoking <code>equals</code> on the underlying <code>Element</code>, passing
in the specified <code>other</code> object.</p><div class="fullcomment"><div class="comment cmt"><p>Returns the result of invoking <code>equals</code> on the underlying <code>Element</code>, passing
in the specified <code>other</code> object.
</p></div><dl class="paramcmts block"><dt class="param">other</dt><dd class="cmt"><p>the object with which to compare for equality
</p></dd><dt>returns</dt><dd class="cmt"><p>true if the passed object is equal to this one
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a> → AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<a id="finalize():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<a id="getClass():Class[_]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="hashCode():Int"></a>
<a id="hashCode():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<p class="shortcomment cmt">Returns the result of invoking <code>hashCode</code> on the underlying <code>Element</code>.</p><div class="fullcomment"><div class="comment cmt"><p>Returns the result of invoking <code>hashCode</code> on the underlying <code>Element</code>.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>a hash code for this object
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a> → AnyRef → Any</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#isDisplayed" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isDisplayed:Boolean"></a>
<a id="isDisplayed:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isDisplayed</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">Indicates whether this <code>Element</code> is displayed.</p><div class="fullcomment"><div class="comment cmt"><p>Indicates whether this <code>Element</code> is displayed.</p><p>This invokes <code>isDisplayed</code> on the underlying <code>WebElement</code>.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p><code>true</code> if the element is currently displayed
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#isEnabled" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isEnabled:Boolean"></a>
<a id="isEnabled:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isEnabled</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">Indicates whether this <code>Element</code> is enabled.</p><div class="fullcomment"><div class="comment cmt"><p>Indicates whether this <code>Element</code> is enabled.</p><p>This invokes <code>isEnabled</code> on the underlying <code>WebElement</code>, which
will generally return <code>true</code> for everything but disabled input elements.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p><code>true</code> if the element is currently enabled
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<a id="isInstanceOf[T0]:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#isSelected" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isSelected:Boolean"></a>
<a id="isSelected:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isSelected</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">Indicates whether this <code>Element</code> is selected.</p><div class="fullcomment"><div class="comment cmt"><p>Indicates whether this <code>Element</code> is selected.</p><p>This method, which invokes <code>isSelected</code> on the underlying <code>WebElement</code>,
is relevant only for input elements such as checkboxes, options in a single- or multiple-selection
list box, and radio buttons. For any other element it will simply return <code>false</code>.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p><code>true</code> if the element is currently selected or checked
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#location" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="location:WebBrowser.this.Point"></a>
<a id="location:Point"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">location</span><span class="result">: <a href="WebBrowser$Point.html" class="extype" name="org.scalatest.selenium.WebBrowser.Point">Point</a></span>
</span>
</h4>
<p class="shortcomment cmt">The XY location of the top-left corner of this <code>Element</code>.</p><div class="fullcomment"><div class="comment cmt"><p>The XY location of the top-left corner of this <code>Element</code>.</p><p>This invokes <code>getLocation</code> on the underlying <code>WebElement</code>.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the location of the top-left corner of this element on the page
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a>
<a id="ne(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<a id="notify():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<a id="notifyAll():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#size" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="size:WebBrowser.this.Dimension"></a>
<a id="size:Dimension"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">size</span><span class="result">: <a href="WebBrowser$Dimension.html" class="extype" name="org.scalatest.selenium.WebBrowser.Dimension">Dimension</a></span>
</span>
</h4>
<p class="shortcomment cmt">The width/height size of this <code>Element</code>.</p><div class="fullcomment"><div class="comment cmt"><p>The width/height size of this <code>Element</code>.</p><p>This invokes <code>getSize</code> on the underlying <code>WebElement</code>.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the size of the element on the page
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a>
<a id="synchronized[T0](⇒T0):T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#tagName" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="tagName:String"></a>
<a id="tagName:String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">tagName</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4>
<p class="shortcomment cmt">The tag name of this element.</p><div class="fullcomment"><div class="comment cmt"><p>The tag name of this element.</p><p>This method invokes <code>getTagName</code> on the underlying <code>WebElement</code>.
Note it returns the name of the tag, not the value of the of the <code>name</code> attribute.
For example, it will return will return <code>"input"</code> for the element
<code><input name="city" /></code>, not <code>"city"</code>.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the tag name of this element
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#text" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="text:String"></a>
<a id="text:String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">text</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4>
<p class="shortcomment cmt">Returns the visible (<em>i.e.</em>, not hidden by CSS) text of this element, including sub-elements, without any leading or trailing whitespace.</p><div class="fullcomment"><div class="comment cmt"><p>Returns the visible (<em>i.e.</em>, not hidden by CSS) text of this element, including sub-elements, without any leading or trailing whitespace.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the visible text enclosed by this element, or an empty string, if the element encloses no visible text
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.Element#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString():String"></a>
<a id="toString():String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4>
<p class="shortcomment cmt">Returns the result of invoking <code>toString</code> on the underlying <code>Element</code>.</p><div class="fullcomment"><div class="comment cmt"><p>Returns the result of invoking <code>toString</code> on the underlying <code>Element</code>.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>a string representation of this object
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a> → AnyRef → Any</dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.DateField#underlying" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="underlying:org.openqa.selenium.WebElement"></a>
<a id="underlying:WebElement"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">underlying</span><span class="result">: <span class="extype" name="org.openqa.selenium.WebElement">WebElement</span></span>
</span>
</h4>
<p class="shortcomment cmt">the <code>WebElement</code> representing a date field</p><div class="fullcomment"><div class="comment cmt"><p>the <code>WebElement</code> representing a date field</p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="org.scalatest.selenium.WebBrowser.DateField">DateField</a> → <a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a> → <a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.ValueElement#value" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="value:String"></a>
<a id="value:String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">value</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4>
<p class="shortcomment cmt">Gets this field's value.</p><div class="fullcomment"><div class="comment cmt"><p>Gets this field's value.</p><p>This method invokes <code>getAttribute("value")</code> on the underlying <code>WebElement</code>.</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the field's value
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a></dd></dl></div>
</li><li name="org.scalatest.selenium.WebBrowser.ValueElement#value_=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="value_=(value:String):Unit"></a>
<a id="value_=(String):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: value_$eq" class="name">value_=</span><span class="params">(<span name="value">value: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">Sets this field's value.</p><div class="fullcomment"><div class="comment cmt"><p>Sets this field's value.
</p></div><dl class="paramcmts block"><dt class="param">value</dt><dd class="cmt"><p>the new value
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a></dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<a id="wait():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a>
<a id="wait(Long,Int):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a>
<a id="wait(Long):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">()</span>
</dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="org.scalatest.selenium.WebBrowser.ValueElement">
<h3>Inherited from <a href="WebBrowser$ValueElement.html" class="extype" name="org.scalatest.selenium.WebBrowser.ValueElement">ValueElement</a></h3>
</div><div class="parent" name="org.scalatest.selenium.WebBrowser.Element">
<h3>Inherited from <a href="WebBrowser$Element.html" class="extype" name="org.scalatest.selenium.WebBrowser.Element">Element</a></h3>
</div><div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</html>
|
Java
|
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>ScalaTest 3.0.8 - org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString</title>
<meta name="description" content="ScalaTest 3.0.8 - org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString" />
<meta name="keywords" content="ScalaTest 3.0.8 org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../lib/jquery.js"></script>
<script type="text/javascript" src="../../../lib/jquery.panzoom.min.js"></script>
<script type="text/javascript" src="../../../lib/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../../../lib/index.js"></script>
<script type="text/javascript" src="../../../index.js"></script>
<script type="text/javascript" src="../../../lib/scheduler.js"></script>
<script type="text/javascript" src="../../../lib/template.js"></script>
<script type="text/javascript" src="../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
/* this variable can be used by the JS to determine the path to the root document */
var toRoot = '../../../';
</script>
</head>
<body>
<div id="search">
<span id="doc-title">ScalaTest 3.0.8<span id="doc-version"></span></span>
<span class="close-results"><span class="left"><</span> Back</span>
<div id="textfilter">
<span class="input">
<input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
<i class="clear material-icons"></i>
<i id="search-icon" class="material-icons"></i>
</span>
</div>
</div>
<div id="search-results">
<div id="search-progress">
<div id="progress-fill"></div>
</div>
<div id="results-content">
<div id="entity-results"></div>
<div id="member-results"></div>
</div>
</div>
<div id="content-scroll-container" style="-webkit-overflow-scrolling: touch;">
<div id="content-container" style="-webkit-overflow-scrolling: touch;">
<div id="subpackage-spacer">
<div id="packages">
<h1>Packages</h1>
<ul>
<li name="_root_.root" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="_root_"></a><a id="root:_root_"></a>
<span class="permalink">
<a href="index.html#_root_" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../index.html"><span class="name">root</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="_root_.org" visbl="pub" class="indented1 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="org"></a><a id="org:org"></a>
<span class="permalink">
<a href="index.html#org" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../index.html"><span class="name">org</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="org.scalatest" visbl="pub" class="indented2 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="scalatest"></a><a id="scalatest:scalatest"></a>
<span class="permalink">
<a href="../org/index.html#scalatest" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter." href="../index.html"><span class="name">scalatest</span></a>
</span>
<p class="shortcomment cmt">ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.</p><div class="fullcomment"><div class="comment cmt"><p>ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.
</p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../index.html" class="extype" name="org">org</a></dd></dl></div>
</li><li name="org.scalatest.fixture" visbl="pub" class="indented3 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="fixture"></a><a id="fixture:fixture"></a>
<span class="permalink">
<a href="../../org/scalatest/index.html#fixture" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="index.html"><span class="name">fixture</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../index.html" class="extype" name="org.scalatest">scalatest</a></dd></dl></div>
</li><li name="org.scalatest.fixture.AsyncFreeSpecLike" visbl="pub" class="indented4 " data-isabs="true" fullComment="yes" group="Ungrouped">
<a id="AsyncFreeSpecLikeextendsAsyncTestSuitewithAsyncTestRegistrationwithInformingwithNotifyingwithAlertingwithDocumenting"></a><a id="AsyncFreeSpecLike:AsyncFreeSpecLike"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/index.html#AsyncFreeSpecLikeextendsAsyncTestSuitewithAsyncTestRegistrationwithInformingwithNotifyingwithAlertingwithDocumenting" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">trait</span>
</span>
<span class="symbol">
<a title="Implementation trait for class fixture.AsyncFreeSpec, which is a sister class to org.scalatest.AsyncFreeSpec that can pass a fixture object into its tests." href="AsyncFreeSpecLike.html"><span class="name">AsyncFreeSpecLike</span></a><span class="result"> extends <a href="AsyncTestSuite.html" class="extype" name="org.scalatest.fixture.AsyncTestSuite">AsyncTestSuite</a> with <a href="AsyncTestRegistration.html" class="extype" name="org.scalatest.fixture.AsyncTestRegistration">AsyncTestRegistration</a> with <a href="../Informing.html" class="extype" name="org.scalatest.Informing">Informing</a> with <a href="../Notifying.html" class="extype" name="org.scalatest.Notifying">Notifying</a> with <a href="../Alerting.html" class="extype" name="org.scalatest.Alerting">Alerting</a> with <a href="../Documenting.html" class="extype" name="org.scalatest.Documenting">Documenting</a></span>
</span>
<p class="shortcomment cmt">Implementation trait for class <code>fixture.AsyncFreeSpec</code>, which is
a sister class to <code>org.scalatest.AsyncFreeSpec</code> that can pass a
fixture object into its tests.</p><div class="fullcomment"><div class="comment cmt"><p>Implementation trait for class <code>fixture.AsyncFreeSpec</code>, which is
a sister class to <code>org.scalatest.AsyncFreeSpec</code> that can pass a
fixture object into its tests.</p><p><a href="AsyncFreeSpec.html"><code>fixture.AsyncFreeSpec</code></a> is a class,
not a trait, to minimize compile time given there is a slight compiler
overhead to mixing in traits compared to extending classes. If you need
to mix the behavior of <code>fixture.AsyncFreeSpec</code> into some other
class, you can use this trait instead, because class
<code>fixture.AsyncFreeSpec</code> does nothing more than extend this trait and add a nice <code>toString</code> implementation.</p><p>See the documentation of the class for a <a href="AsyncFreeSpec.html">detailed
overview of <code>fixture.AsyncFreeSpec</code></a>.</p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="index.html" class="extype" name="org.scalatest.fixture">fixture</a></dd></dl></div>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="class" href="../Assertions$AssertionsHelper.html" title="Helper class used by code generated by the assert macro."></a>
<a href="../Assertions$AssertionsHelper.html" title="Helper class used by code generated by the assert macro.">AssertionsHelper</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="class" href="AsyncFreeSpecLike$CheckingEqualizer.html" title=""></a>
<a href="AsyncFreeSpecLike$CheckingEqualizer.html" title="">CheckingEqualizer</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="class" href="AsyncFreeSpecLike$Equalizer.html" title=""></a>
<a href="AsyncFreeSpecLike$Equalizer.html" title="">Equalizer</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="abstract type" href="AsyncFreeSpecLike$FixtureParam.html" title="The type of the fixture parameter that can be passed into tests in this suite."></a>
<a href="AsyncFreeSpecLike$FixtureParam.html" title="The type of the fixture parameter that can be passed into tests in this suite.">FixtureParam</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="class" href="AsyncFreeSpecLike$FreeSpecStringWrapper.html" title="A class that via an implicit conversion (named convertToFreeSpecStringWrapper) enables methods when, that, in, is, taggedAs and ignore to be invoked on Strings."></a>
<a href="AsyncFreeSpecLike$FreeSpecStringWrapper.html" title="A class that via an implicit conversion (named convertToFreeSpecStringWrapper) enables methods when, that, in, is, taggedAs and ignore to be invoked on Strings.">FreeSpecStringWrapper</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="trait" href="../AsyncTestSuite$NoArgAsyncTest.html" title="A test function taking no arguments and returning a FutureOutcome."></a>
<a href="../AsyncTestSuite$NoArgAsyncTest.html" title="A test function taking no arguments and returning a FutureOutcome.">NoArgAsyncTest</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="trait" href="AsyncTestSuite$OneArgAsyncTest.html" title="A test function taking no arguments and returning an FutureOutcome."></a>
<a href="AsyncTestSuite$OneArgAsyncTest.html" title="A test function taking no arguments and returning an FutureOutcome.">OneArgAsyncTest</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="class" href="../CompleteLastly$ResultOfCompleteInvocation.html" title="Class that provides the lastly method of the complete-lastly syntax."></a>
<a href="../CompleteLastly$ResultOfCompleteInvocation.html" title="Class that provides the lastly method of the complete-lastly syntax.">ResultOfCompleteInvocation</a>
</li><li class="current-entities indented4">
<span class="separator"></span>
<a class="class" href="" title="Class that supports the registration of tagged tests."></a>
<a href="" title="Class that supports the registration of tagged tests.">ResultOfTaggedAsInvocationOnString</a>
</li>
</ul>
</div>
</div>
<div id="content">
<body class="class type">
<!-- Top of doc.scalatest.org [javascript] -->
<script type="text/javascript">
var rnd = window.rnd || Math.floor(Math.random()*10e6);
var pid204546 = window.pid204546 || rnd;
var plc204546 = window.plc204546 || 0;
var abkw = window.abkw || '';
var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER';
document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>');
</script>
<div id="definition">
<div class="big-circle class">c</div>
<p id="owner"><a href="../../index.html" class="extype" name="org">org</a>.<a href="../index.html" class="extype" name="org.scalatest">scalatest</a>.<a href="index.html" class="extype" name="org.scalatest.fixture">fixture</a>.<a href="AsyncFreeSpecLike.html" class="extype" name="org.scalatest.fixture.AsyncFreeSpecLike">AsyncFreeSpecLike</a></p>
<h1>ResultOfTaggedAsInvocationOnString<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span></h1>
<h3><span class="morelinks"></span></h3>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">class</span>
</span>
<span class="symbol">
<span class="name">ResultOfTaggedAsInvocationOnString</span><span class="result"> extends <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>Class that supports the registration of tagged tests.</p><p>Instances of this class are returned by the <code>taggedAs</code> method of
class <code>FreeSpecStringWrapper</code>.</p></div><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Source</dt><dd><a href="https://github.com/scalatest/scalatest/tree/release-3.0.8/scalatest//src/main/scala/org/scalatest/fixture/AsyncFreeSpecLike.scala" target="_blank">AsyncFreeSpecLike.scala</a></dd></dl><div class="toggleContainer block">
<span class="toggle">
Linear Supertypes
</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div class="toggle"></div>
<div id="memberfilter">
<i class="material-icons arrow"></i>
<span class="input">
<input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />
</span>
<i class="clear material-icons"></i>
</div>
<div id="filterby">
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By Inheritance</span></li>
</ol>
</div>
<div class="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString"><span>ResultOfTaggedAsInvocationOnString</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div class="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show All</span></li>
</ol>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="constructors" class="members">
<h3>Instance Constructors</h3>
<ol><li name="org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString#<init>" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="<init>(specText:String,tags:List[org.scalatest.Tag],pos:org.scalactic.source.Position):AsyncFreeSpecLike.this.ResultOfTaggedAsInvocationOnString"></a><a id="<init>:ResultOfTaggedAsInvocationOnString"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#<init>(specText:String,tags:List[org.scalatest.Tag],pos:org.scalactic.source.Position):AsyncFreeSpecLike.this.ResultOfTaggedAsInvocationOnString" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">new</span>
</span>
<span class="symbol">
<span class="name">ResultOfTaggedAsInvocationOnString</span><span class="params">(<span name="specText">specText: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="tags">tags: <span class="extype" name="scala.List">List</span>[<a href="../Tag.html" class="extype" name="org.scalatest.Tag">Tag</a>]</span>, <span name="pos">pos: <span class="extype" name="org.scalactic.source.Position">Position</span></span>)</span>
</span>
<p class="shortcomment cmt"></p><div class="fullcomment"><div class="comment cmt"></div><dl class="paramcmts block"><dt class="param">specText</dt><dd class="cmt"><p>the specification text</p></dd><dt class="param">tags</dt><dd class="cmt"><p>the list of tags</p></dd></dl></div>
</li></ol>
</div>
<div class="values members">
<h3>Value Members</h3>
<ol>
<li name="scala.AnyRef#!=" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a><a id="!=(Any):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#!=(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html###():Int" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a><a id="==(Any):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#==(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#asInstanceOf[T0]:T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a><a id="clone():AnyRef"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#clone():Object" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a><a id="eq(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#eq(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#equals" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(x$1:Any):Boolean"></a><a id="equals(Any):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#equals(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#finalize():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#getClass():Class[_]" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#hashCode" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="hashCode():Int"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#hashCode():Int" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString#ignore" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ignore(testFun:()=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit"></a><a id="ignore(()⇒Future[compatible.Assertion]):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#ignore(testFun:()=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ignore</span><span class="params">(<span name="testFun">testFun: () ⇒ <span class="extype" name="scala.concurrent.Future">Future</span>[<a href="../compatible/Assertion.html" class="extype" name="org.scalatest.compatible.Assertion">compatible.Assertion</a>]</span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<p class="shortcomment cmt">Supports registration of tagged, ignored tests that take no fixture parameter.</p><div class="fullcomment"><div class="comment cmt"><p>Supports registration of tagged, ignored tests that take no fixture parameter.</p><p>For example, this method supports syntax such as the following:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"complain on peek"</span> taggedAs(<span class="stType">SlowTest</span>) ignore { () => ... }
^
</pre></p><p>For more information and examples of this method's use, see the <a href="FreeSpec.html">main documentation</a> for trait <code>FreeSpec</code>.</p></div><dl class="paramcmts block"><dt class="param">testFun</dt><dd class="cmt"><p>the test function</p></dd></dl></div>
</li><li name="org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString#ignore" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ignore(testFun:AsyncFreeSpecLike.this.FixtureParam=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit"></a><a id="ignore((AsyncFreeSpecLike.FixtureParam)⇒Future[compatible.Assertion]):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#ignore(testFun:AsyncFreeSpecLike.this.FixtureParam=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ignore</span><span class="params">(<span name="testFun">testFun: (<a href="AsyncFreeSpecLike.html#FixtureParam" class="extmbr" name="org.scalatest.fixture.AsyncFreeSpecLike.FixtureParam">AsyncFreeSpecLike.FixtureParam</a>) ⇒ <span class="extype" name="scala.concurrent.Future">Future</span>[<a href="../compatible/Assertion.html" class="extype" name="org.scalatest.compatible.Assertion">compatible.Assertion</a>]</span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<p class="shortcomment cmt">Supports registration of tagged, ignored tests.</p><div class="fullcomment"><div class="comment cmt"><p>Supports registration of tagged, ignored tests.</p><p>For example, this method supports syntax such as the following:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"complain on peek"</span> taggedAs(<span class="stType">SlowTest</span>) ignore { fixture => ... }
^
</pre></p><p>For more information and examples of this method's use, see the <a href="FreeSpec.html">main documentation</a> for trait <code>FreeSpec</code>.</p></div><dl class="paramcmts block"><dt class="param">testFun</dt><dd class="cmt"><p>the test function</p></dd></dl></div>
</li><li name="org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString#in" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="in(testFun:()=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit"></a><a id="in(()⇒Future[compatible.Assertion]):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#in(testFun:()=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">in</span><span class="params">(<span name="testFun">testFun: () ⇒ <span class="extype" name="scala.concurrent.Future">Future</span>[<a href="../compatible/Assertion.html" class="extype" name="org.scalatest.compatible.Assertion">compatible.Assertion</a>]</span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<p class="shortcomment cmt">Supports tagged test registration, for tests that don't take a fixture.</p><div class="fullcomment"><div class="comment cmt"><p>Supports tagged test registration, for tests that don't take a fixture.</p><p>For example, this method supports syntax such as the following:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"complain on peek"</span> taggedAs(<span class="stType">SlowTest</span>) in { () => ... }
^
</pre></p><p>For more information and examples of this method's use, see the <a href="FreeSpec.html">main documentation</a> for trait <code>FreeSpec</code>.</p></div><dl class="paramcmts block"><dt class="param">testFun</dt><dd class="cmt"><p>the test function</p></dd></dl></div>
</li><li name="org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString#in" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="in(testFun:AsyncFreeSpecLike.this.FixtureParam=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit"></a><a id="in((AsyncFreeSpecLike.FixtureParam)⇒Future[compatible.Assertion]):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#in(testFun:AsyncFreeSpecLike.this.FixtureParam=>scala.concurrent.Future[org.scalatest.compatible.Assertion]):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">in</span><span class="params">(<span name="testFun">testFun: (<a href="AsyncFreeSpecLike.html#FixtureParam" class="extmbr" name="org.scalatest.fixture.AsyncFreeSpecLike.FixtureParam">AsyncFreeSpecLike.FixtureParam</a>) ⇒ <span class="extype" name="scala.concurrent.Future">Future</span>[<a href="../compatible/Assertion.html" class="extype" name="org.scalatest.compatible.Assertion">compatible.Assertion</a>]</span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<p class="shortcomment cmt">Supports tagged test registration.</p><div class="fullcomment"><div class="comment cmt"><p>Supports tagged test registration.</p><p>For example, this method supports syntax such as the following:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"complain on peek"</span> taggedAs(<span class="stType">SlowTest</span>) in { fixture => ... }
^
</pre></p><p>For more information and examples of this method's use, see the <a href="FreeSpec.html">main documentation</a> for trait <code>FreeSpec</code>.</p></div><dl class="paramcmts block"><dt class="param">testFun</dt><dd class="cmt"><p>the test function</p></dd></dl></div>
</li><li name="org.scalatest.fixture.AsyncFreeSpecLike.ResultOfTaggedAsInvocationOnString#is" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="is(testFun:=>org.scalatest.PendingStatement):Unit"></a><a id="is(⇒PendingStatement):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#is(testFun:=>org.scalatest.PendingStatement):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">is</span><span class="params">(<span name="testFun">testFun: ⇒ <a href="../PendingStatement.html" class="extype" name="org.scalatest.PendingStatement">PendingStatement</a></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<p class="shortcomment cmt">Supports registration of tagged, pending tests.</p><div class="fullcomment"><div class="comment cmt"><p>Supports registration of tagged, pending tests.</p><p>For example, this method supports syntax such as the following:</p><p><pre class="stHighlighted">
<span class="stQuotedString">"complain on peek"</span> taggedAs(<span class="stType">SlowTest</span>) is (pending)
^
</pre></p><p>For more information and examples of this method's use, see the <a href="FreeSpec.html">main documentation</a> for trait <code>FreeSpec</code>.</p></div><dl class="paramcmts block"><dt class="param">testFun</dt><dd class="cmt"><p>the test function</p></dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#isInstanceOf[T0]:Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a><a id="ne(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#ne(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#notify():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#notifyAll():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a><a id="synchronized[T0](⇒T0):T0"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#synchronized[T0](x$1:=>T0):T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#toString" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString():String"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#toString():String" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#wait():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a><a id="wait(Long,Int):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#wait(x$1:Long,x$2:Int):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a><a id="wait(Long):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/fixture/AsyncFreeSpecLike$ResultOfTaggedAsInvocationOnString.html#wait(x$1:Long):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li>
</ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</div>
</div>
</div>
</body>
</html>
|
Java
|
package org.drools.rule;
/*
* Copyright 2005 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This exception is thrown when an invalid package (ie one that has errors)
* it attempted to be added to a RuleBase.
* The package and builder should be interrogated to show the specific errors.
*
* @author Michael Neale
*/
public class InvalidRulePackage extends RuntimeException {
private static final long serialVersionUID = 400L;
public InvalidRulePackage(final String summary) {
super( summary );
}
}
|
Java
|
package com.twu.biblioteca.service.impl;
import com.twu.biblioteca.mapper.BookListMapper;
import com.twu.biblioteca.mapper.MyBatisUtil;
import com.twu.biblioteca.model.Book;
import com.twu.biblioteca.service.BookListService;
import org.apache.ibatis.session.SqlSession;
import java.util.ArrayList;
public class BookListServiceImpl implements BookListService {
private SqlSession sqlSession;
private BookListMapper bookListMapper;
public BookListServiceImpl() {
this.sqlSession = MyBatisUtil.getSqlSessionFactory().openSession();
this.bookListMapper = sqlSession.getMapper(BookListMapper.class);
}
public BookListServiceImpl(BookListMapper bookListMapper) {
this.bookListMapper = bookListMapper;
}
@Override
public ArrayList<Book> getBookList() {
return bookListMapper.getBookList();
}
}
|
Java
|
/**************************************************************************
* Copyright 2015 John Denholm *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.*
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
* *
* selfstats.h - defines self reporting functions *
* *
* Updates: *
**************************************************************************/
#ifndef CARBON_COPY_SELFSTATS_H
#define CARBON_COPY_SELFSTATS_H
#define DEFAULT_SELF_PREFIX "self.carbon_copy."
#define DEFAULT_SELF_INTERVAL 10
enum self_timestamp_type
{
SELF_TSTYPE_SEC = 0,
SELF_TSTYPE_MSEC,
SELF_TSTYPE_USEC,
SELF_TSTYPE_NSEC,
SELF_TSTYPE_NONE,
SELF_TSTYPE_MAX
};
extern const char *self_ts_types[SELF_TSTYPE_MAX];
struct selfstats_control
{
HOST * host;
BUF * buf;
char * prefix;
char * ts;
int64_t intv;
int64_t tsdiv;
int tstype;
int enabled;
int tslen;
uint32_t prlen;
};
loop_call_fn self_stats_pass;
throw_fn self_stats_loop;
void self_stats_init( void );
SST_CTL *self_stats_config_defaults( void );
conf_line_fn self_stats_config_line;
#endif
|
Java
|
/*
* Copyright 2015 Thomas Hoffmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.j4velin.wifiAutoOff;
import android.app.IntentService;
import android.content.Intent;
import com.google.android.gms.location.FusedLocationProviderApi;
import com.google.android.gms.location.Geofence;
import com.google.android.gms.location.GeofencingEvent;
import com.google.android.gms.maps.model.LatLng;
public class GeoFenceService extends IntentService {
public GeoFenceService() {
super("WiFiAutomaticGeoFenceService");
}
@Override
protected void onHandleIntent(final Intent intent) {
if (intent == null) return;
if (intent.hasExtra(FusedLocationProviderApi.KEY_LOCATION_CHANGED)) {
android.location.Location loc = (android.location.Location) intent.getExtras()
.get(FusedLocationProviderApi.KEY_LOCATION_CHANGED);
if (BuildConfig.DEBUG) Logger.log("Location update received " + loc);
Database db = Database.getInstance(this);
if (db.inRangeOfLocation(loc)) {
sendBroadcast(new Intent(this, Receiver.class)
.setAction(Receiver.LOCATION_ENTERED_ACTION));
}
db.close();
} else {
GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
// First check for errors
if (geofencingEvent.hasError()) {
// Get the error code with a static method
// Log the error
if (BuildConfig.DEBUG) Logger.log("Location Services error: " +
Integer.toString(geofencingEvent.getErrorCode()));
} else {
// Test that a valid transition was reported
if (geofencingEvent.getGeofenceTransition() == Geofence.GEOFENCE_TRANSITION_ENTER) {
Database db = Database.getInstance(this);
for (Geofence gf : geofencingEvent.getTriggeringGeofences()) {
if (BuildConfig.DEBUG) Logger.log("geofence entered: " + gf.getRequestId());
String[] data = gf.getRequestId().split("@");
LatLng ll = new LatLng(Double.parseDouble(data[0]),
Double.parseDouble(data[1]));
String name = db.getNameForLocation(ll);
if (name != null) {
sendBroadcast(new Intent(this, Receiver.class)
.setAction(Receiver.LOCATION_ENTERED_ACTION)
.putExtra(Receiver.EXTRA_LOCATION_NAME, name));
break;
}
}
db.close();
}
}
}
}
}
|
Java
|
windmill-game
=============
The classic windmill game made in Scala.
|
Java
|
# Crinum exaltatum Herb. SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
/*
* Copyright 2015-2020 OpenCB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.opencb.opencga.analysis.individual.qc;
import org.junit.Test;
import org.opencb.biodata.models.clinical.qc.MendelianErrorReport;
import org.opencb.biodata.models.clinical.qc.RelatednessReport;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.biodata.models.variant.avro.IssueEntry;
import org.opencb.biodata.models.variant.avro.IssueType;
import org.opencb.opencga.analysis.family.qc.IBDComputation;
import org.opencb.opencga.core.common.JacksonUtils;
import org.opencb.opencga.core.exceptions.ToolException;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.nio.file.Paths;
import java.util.*;
import static org.opencb.opencga.storage.core.variant.VariantStorageBaseTest.getResourceUri;
public class IndividualQcUtilsTest {
@Test
public void buildRelatednessReport() throws ToolException, IOException {
URI resourceUri = getResourceUri("ibd.genome");
File file = Paths.get(resourceUri.getPath()).toFile();
List<RelatednessReport.RelatednessScore> relatednessReport = IBDComputation.parseRelatednessScores(file);
System.out.println(JacksonUtils.getDefaultNonNullObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(relatednessReport));
}
@Test
public void parseMendelianError() throws IOException {
URI resourceUri = getResourceUri("mendelian.error.variants.json");
File file = Paths.get(resourceUri.getPath()).toFile();
List<Variant> variants = Arrays.asList(JacksonUtils.getDefaultNonNullObjectMapper().readValue(file, Variant[].class));
System.out.println(variants.size());
MendelianErrorReport mendelianErrorReport = buildMendelianErrorReport(variants.iterator(), variants.size());
System.out.println(JacksonUtils.getDefaultNonNullObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(mendelianErrorReport));
// List<Variant> variants = JacksonUtils.getDefaultNonNullObjectMapper().readerFor(Variant.class).readValue(path.toFile());
// System.out.println(variants.size());
}
@Test
public void parseKaryotypicSexThresholds() throws IOException {
URI resourceUri = getResourceUri("karyotypic_sex_thresholds.json");
File file = Paths.get(resourceUri.getPath()).toFile();
Map<String, Double> thresholds = JacksonUtils.getDefaultNonNullObjectMapper().readerFor(Map.class).readValue(file);
System.out.println(JacksonUtils.getDefaultNonNullObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(thresholds));
}
private MendelianErrorReport buildMendelianErrorReport(Iterator iterator, long numVariants) {
// Create auxiliary map
// sample chrom error count
Map<String, Map<String, Map<String, Integer>>> counter = new HashMap<>();
int numErrors = 0;
while (iterator.hasNext()) {
Variant variant = (Variant) iterator.next();
// Get sampleId and error code from variant issues
boolean foundError = false;
for (IssueEntry issue : variant.getStudies().get(0).getIssues()) {
if (IssueType.MENDELIAN_ERROR == issue.getType() || IssueType.DE_NOVO == issue.getType()) {
foundError = true;
String sampleId = issue.getSample().getSampleId();
String errorCode = issue.getSample().getData().get(0);
if (!counter.containsKey(sampleId)) {
counter.put(sampleId, new HashMap<>());
}
if (!counter.get(sampleId).containsKey(variant.getChromosome())) {
counter.get(sampleId).put(variant.getChromosome(), new HashMap<>());
}
int val = 0;
if (counter.get(sampleId).get(variant.getChromosome()).containsKey(errorCode)) {
val = counter.get(sampleId).get(variant.getChromosome()).get(errorCode);
}
counter.get(sampleId).get(variant.getChromosome()).put(errorCode, val + 1);
}
}
if (foundError) {
numErrors++;
}
}
// Create mendelian error report from auxiliary map
MendelianErrorReport meReport = new MendelianErrorReport();
meReport.setNumErrors(numErrors);
for (String sampleId : counter.keySet()) {
MendelianErrorReport.SampleAggregation sampleAgg = new MendelianErrorReport.SampleAggregation();
int numSampleErrors = 0;
for (String chrom : counter.get(sampleId).keySet()) {
int numChromErrors = counter.get(sampleId).get(chrom).values().stream().mapToInt(Integer::intValue).sum();
MendelianErrorReport.SampleAggregation.ChromosomeAggregation chromAgg = new MendelianErrorReport.SampleAggregation.ChromosomeAggregation();
chromAgg.setChromosome(chrom);
chromAgg.setNumErrors(numChromErrors);
chromAgg.setErrorCodeAggregation(counter.get(sampleId).get(chrom));
// Update sample aggregation
sampleAgg.getChromAggregation().add(chromAgg);
numSampleErrors += numChromErrors;
}
sampleAgg.setSample(sampleId);
sampleAgg.setNumErrors(numSampleErrors);
sampleAgg.setRatio(1.0d * numSampleErrors / numVariants);
meReport.getSampleAggregation().add(sampleAgg);
}
return meReport;
}
}
|
Java
|
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.siyeh.ig.redundancy;
import com.google.common.collect.ImmutableSet;
import com.intellij.codeInspection.ex.InspectionElementsMergerBase;
import com.intellij.util.ArrayUtilRt;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
import java.util.Set;
public class RedundantStringOperationMerger extends InspectionElementsMergerBase {
private static final String OLD_MERGER_NAME = "RedundantStringOperation";
private static final Set<String> OLD_SOURCE_NAMES = ImmutableSet.of("StringToString", "SubstringZero", "ConstantStringIntern");
@NotNull
@Override
public String getMergedToolName() {
return "StringOperationCanBeSimplified";
}
@Override
protected Element getSourceElement(@NotNull Map<String, Element> inspectionElements, @NotNull String sourceToolName) {
if (inspectionElements.containsKey(sourceToolName)) {
return inspectionElements.get(sourceToolName);
}
if (sourceToolName.equals(OLD_MERGER_NAME)) {//need to merge initial tools to get merged redundant string operations
return new InspectionElementsMergerBase(){
@NotNull
@Override
public String getMergedToolName() {
return OLD_MERGER_NAME;
}
@Override
public String @NotNull [] getSourceToolNames() {
return ArrayUtilRt.toStringArray(OLD_SOURCE_NAMES);
}
@Override
public Element merge(@NotNull Map<String, Element> inspectionElements) {
return super.merge(inspectionElements);
}
@Override
protected boolean writeMergedContent(@NotNull Element toolElement) {
return true;
}
}.merge(inspectionElements);
}
else if (OLD_SOURCE_NAMES.contains(sourceToolName)) {
Element merged = inspectionElements.get(OLD_MERGER_NAME);
if (merged != null) { // RedundantStringOperation already replaced the content
Element clone = merged.clone();
clone.setAttribute("class", sourceToolName);
return clone;
}
}
return null;
}
@Override
public String @NotNull [] getSourceToolNames() {
return new String[] {
"StringToString",
"SubstringZero",
"ConstantStringIntern",
"StringConstructor",
OLD_MERGER_NAME
};
}
@Override
public String @NotNull [] getSuppressIds() {
return new String[] {
"StringToString", "RedundantStringToString",
"SubstringZero", "ConstantStringIntern",
"RedundantStringConstructorCall", "StringConstructor", OLD_MERGER_NAME
};
}
}
|
Java
|
# Rhytisma E.M. Fries, 1818 GENUS
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
Rhytisma E.M. Fries, 1818
### Remarks
null
|
Java
|
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Scaladoc for org.scalatest.matchers.Matchers.ResultOfHaveWordForJavaList</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="../../../lib/jquery.js"></script>
<link href="../../../lib/template.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="../../../lib/template.js"></script>
<script type="text/javascript" src="../../../lib/tools.tooltip.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-71294502-3', 'auto');
ga('send', 'pageview');
</script>
</head>
<body class="type">
<p id="owner"><a href="../../package.html" class="extype" name="org">org</a>.<a href="../package.html" class="extype" name="org.scalatest">scalatest</a>.<a href="package.html" class="extype" name="org.scalatest.matchers">matchers</a>.<a href="Matchers.html" class="extype" name="org.scalatest.matchers.Matchers">Matchers</a></p>
<div id="definition">
<img src="../../../lib/class_big.png" />
<h1>ResultOfHaveWordForJavaList</h1>
</div>
<h4 class="signature" id="signature">
<span class="kind">class</span>
<span class="symbol">
<span class="name">ResultOfHaveWordForJavaList</span><span class="tparams">[<span name="T">T</span>]</span><span class="result"> extends <a href="Matchers$ResultOfHaveWordForJavaCollection.html" class="extype" name="org.scalatest.matchers.Matchers.ResultOfHaveWordForJavaCollection">ResultOfHaveWordForJavaCollection</a>[T]</span>
</span>
</h4>
<div class="fullcomment" id="comment"><div class="comment cmt"><p>This class is part of the ScalaTest matchers DSL. Please see the documentation for <a href="ShouldMatchers.html"><code>ShouldMatchers</code></a> or <a href="MustMatchers.html"><code>MustMatchers</code></a> for an overview of
the matchers DSL.
</p></div><div class="block">
attributes: final
</div>
<div class="block"><ol>authors:
<li><p>Bill Venners
</p></li>
</ol></div>
</div>
<div id="template">
<div id="mbrsel">
<div id="ancestors">
<span class="filtertype">Inherited</span>
<ol><li class="hideall">Hide All</li><li class="showall">Show all</li></ol>
<ol id="linearization"><li class="in" name="org.scalatest.matchers.Matchers.ResultOfHaveWordForJavaCollection">ResultOfHaveWordForJavaCollection</li><li class="in" name="scala.AnyRef">AnyRef</li><li class="in" name="scala.Any">Any</li></ol>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in">Public</li><li class="all out">All</li></ol>
</div>
</div>
<div class="members" id="constructors">
<h3>Instance constructors</h3>
<ol><li visbl="pub" name="org.scalatest.matchers.Matchers.ResultOfHaveWordForJavaList#this">
<h4 class="signature">
<span class="kind">new</span>
<span class="symbol">
<span class="name">ResultOfHaveWordForJavaList</span><span class="params">(<span name="left">left: <span class="extype" name="java.util.List">List</span>[T]</span>, <span name="shouldBeTrue">shouldBeTrue: <span class="extype" name="scala.Boolean">Boolean</span></span>)</span>
</span>
</h4>
</li></ol>
</div>
<div class="members" id="values">
<h3>Value Members</h3>
<ol><li visbl="pub" name="scala.AnyRef#!=">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">!=</span><span class="params">(<span name="arg0">arg0: AnyRef</span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div></div>
</li><li visbl="pub" name="scala.Any#!=">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt"><code>o != arg0</code> is the same as <code>!(o == (arg0))</code>.</p>
<div class="fullcomment"><div class="comment cmt"><p><code>o != arg0</code> is the same as <code>!(o == (arg0))</code>.
</p></div><dl class="paramcmts block"><dt class="param">arg0</dt><dd class="cmt"><p>the object to compare against this object for dis-equality.</p></dd><dt>returns</dt><dd class="cmt"><p><code>false</code> if the receiver object is equivalent to the argument; <code>true</code> otherwise.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: Any
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef###">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef → Any
</div></div>
</li><li visbl="pub" name="scala.AnyRef#$asInstanceOf">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">$asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">()</span><span class="result">: T0</span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div></div>
</li><li visbl="pub" name="scala.AnyRef#$isInstanceOf">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">$isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div></div>
</li><li visbl="pub" name="scala.AnyRef#==">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">==</span><span class="params">(<span name="arg0">arg0: AnyRef</span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt"><code>o == arg0</code> is the same as <code>if (o eq null) arg0 eq null else o.equals(arg0)</code>.</p>
<div class="fullcomment"><div class="comment cmt"><p><code>o == arg0</code> is the same as <code>if (o eq null) arg0 eq null else o.equals(arg0)</code>.
</p></div><dl class="paramcmts block"><dt class="param">arg0</dt><dd class="cmt"><p>the object to compare against this object for equality.</p></dd><dt>returns</dt><dd class="cmt"><p><code>true</code> if the receiver object is equivalent to the argument; <code>false</code> otherwise.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="scala.Any#==">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt"><code>o == arg0</code> is the same as <code>o.equals(arg0)</code>.</p>
<div class="fullcomment"><div class="comment cmt"><p><code>o == arg0</code> is the same as <code>o.equals(arg0)</code>.
</p></div><dl class="paramcmts block"><dt class="param">arg0</dt><dd class="cmt"><p>the object to compare against this object for equality.</p></dd><dt>returns</dt><dd class="cmt"><p><code>true</code> if the receiver object is equivalent to the argument; <code>false</code> otherwise.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: Any
</div>
</div>
</li><li visbl="pub" name="scala.Any#asInstanceOf">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: T0</span>
</span>
</h4>
<p class="shortcomment cmt">This method is used to cast the receiver object to be of type <code>T0</code>.</p>
<div class="fullcomment"><div class="comment cmt"><p>This method is used to cast the receiver object to be of type <code>T0</code>.</p><p>Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression<code>1.asInstanceOf[String]</code> will throw a <code>ClassCastException</code> at runtime, while the expression<code>List(1).asInstanceOf[List[String]]</code> will not. In the latter example, because the type argument is erased as
part of compilation it is not possible to check whether the contents of the list are of the requested typed.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the receiver object.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: Any
</div>
</div>
</li><li visbl="prt" name="scala.AnyRef#clone">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: AnyRef</span>
</span>
</h4>
<p class="shortcomment cmt">This method creates and returns a copy of the receiver object.</p>
<div class="fullcomment"><div class="comment cmt"><p>This method creates and returns a copy of the receiver object.</p><p>The default implementation of the <code>clone</code> method is platform dependent.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>a copy of the receiver object.</p></dd></dl><div class="block">
attributes: protected
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#eq">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: AnyRef</span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">This method is used to test whether the argument (<code>arg0</code>) is a reference to the
receiver object (<code>this</code>).</p>
<div class="fullcomment"><div class="comment cmt"><p>This method is used to test whether the argument (<code>arg0</code>) is a reference to the
receiver object (<code>this</code>).</p><p>The <code>eq</code> method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on
non-null instances of <code>AnyRef</code>:
* It is reflexive: for any non-null instance <code>x</code> of type <code>AnyRef</code>, <code>x.eq(x)</code> returns <code>true</code>.
* It is symmetric: for any non-null instances <code>x</code> and <code>y</code> of type <code>AnyRef</code>, <code>x.eq(y)</code> returns <code>true</code> if and
only if <code>y.eq(x)</code> returns <code>true</code>.
* It is transitive: for any non-null instances <code>x</code>, <code>y</code>, and <code>z</code> of type <code>AnyRef</code> if <code>x.eq(y)</code> returns <code>true</code> and <code>y.eq(z)</code> returns <code>true</code>, then <code>x.eq(z)</code> returns <code>true</code>.</p><p>Additionally, the <code>eq</code> method has three other properties.
* It is consistent: for any non-null instances <code>x</code> and <code>y</code> of type <code>AnyRef</code>, multiple invocations of
<code>x.eq(y)</code> consistently returns <code>true</code> or consistently returns <code>false</code>.
* For any non-null instance <code>x</code> of type <code>AnyRef</code>, <code>x.eq(null)</code> and <code>null.eq(x)</code> returns <code>false</code>.
* <code>null.eq(null)</code> returns <code>true</code>.</p><p>When overriding the <code>equals</code> or <code>hashCode</code> methods, it is important to ensure that their behavior is
consistent with reference equality. Therefore, if two objects are references to each other (<code>o1 eq o2</code>), they
should be equal to each other (<code>o1 == o2</code>) and they should hash to the same value (<code>o1.hashCode == o2.hashCode</code>).
</p></div><dl class="paramcmts block"><dt class="param">arg0</dt><dd class="cmt"><p>the object to compare against this object for reference equality.</p></dd><dt>returns</dt><dd class="cmt"><p><code>true</code> if the argument is a reference to the receiver object; <code>false</code> otherwise.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#equals">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">This method is used to compare the receiver object (<code>this</code>) with the argument object (<code>arg0</code>) for equivalence.</p>
<div class="fullcomment"><div class="comment cmt"><p>This method is used to compare the receiver object (<code>this</code>) with the argument object (<code>arg0</code>) for equivalence.</p><p>The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence
relation]:
* It is reflexive: for any instance <code>x</code> of type <code>Any</code>, <code>x.equals(x)</code> should return <code>true</code>.
* It is symmetric: for any instances <code>x</code> and <code>y</code> of type <code>Any</code>, <code>x.equals(y)</code> should return <code>true</code> if and
only if <code>y.equals(x)</code> returns <code>true</code>.
* It is transitive: for any instances <code>x</code>, <code>y</code>, and <code>z</code> of type <code>AnyRef</code> if <code>x.equals(y)</code> returns <code>true</code> and
<code>y.equals(z)</code> returns <code>true</code>, then <code>x.equals(z)</code> should return <code>true</code>.</p><p>If you override this method, you should verify that your implementation remains an equivalence relation.
Additionally, when overriding this method it is often necessary to override <code>hashCode</code> to ensure that objects
that are "equal" (<code>o1.equals(o2)</code> returns <code>true</code>) hash to the same
scala.Int
(<code>o1.hashCode.equals(o2.hashCode)</code>).
</p></div><dl class="paramcmts block"><dt class="param">arg0</dt><dd class="cmt"><p>the object to compare against this object for equality.</p></dd><dt>returns</dt><dd class="cmt"><p><code>true</code> if the receiver object is equivalent to the argument; <code>false</code> otherwise.</p></dd></dl><div class="block">
definition classes: AnyRef → Any
</div>
</div>
</li><li visbl="prt" name="scala.AnyRef#finalize">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">This method is called by the garbage collector on the receiver object when garbage collection determines that
there are no more references to the object.</p>
<div class="fullcomment"><div class="comment cmt"><p>This method is called by the garbage collector on the receiver object when garbage collection determines that
there are no more references to the object.</p><p>The details of when and if the <code>finalize</code> method are invoked, as well as the interaction between <code>finalize</code>and non-local returns and exceptions, are all platform dependent.</p></div><div class="block">
attributes: protected
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#getClass">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: java.lang.Class[_ <: java.lang.Object]</span>
</span>
</h4>
<p class="shortcomment cmt">Returns a representation that corresponds to the dynamic class of the receiver object.</p>
<div class="fullcomment"><div class="comment cmt"><p>Returns a representation that corresponds to the dynamic class of the receiver object.</p><p>The nature of the representation is platform dependent.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>a representation that corresponds to the dynamic class of the receiver object.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#hashCode">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<p class="shortcomment cmt">Returns a hash code value for the object.</p>
<div class="fullcomment"><div class="comment cmt"><p>Returns a hash code value for the object.</p><p>The default hashing algorithm is platform dependent.</p><p>Note that it is allowed for two objects to have identical hash codes (<code>o1.hashCode.equals(o2.hashCode)</code>) yet
not be equal (<code>o1.equals(o2)</code> returns <code>false</code>). A degenerate implementation could always return <code>0</code>.
However, it is required that if two objects are equal (<code>o1.equals(o2)</code> returns <code>true</code>) that they have
identical hash codes (<code>o1.hashCode.equals(o2.hashCode)</code>). Therefore, when overriding this method, be sure
to verify that the behavior is consistent with the <code>equals</code> method.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>the hash code value for the object.</p></dd></dl><div class="block">
definition classes: AnyRef → Any
</div>
</div>
</li><li visbl="pub" name="scala.Any#isInstanceOf">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">This method is used to test whether the dynamic type of the receiver object is <code>T0</code>.</p>
<div class="fullcomment"><div class="comment cmt"><p>This method is used to test whether the dynamic type of the receiver object is <code>T0</code>.</p><p>Note that the test result of the test is modulo Scala's erasure semantics. Therefore the expression<code>1.isInstanceOf[String]</code> will return <code>false</code>, while the expression <code>List(1).isInstanceOf[List[String]]</code> will
return <code>true</code>. In the latter example, because the type argument is erased as part of compilation it is not
possible to check whether the contents of the list are of the requested typed.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p><code>true</code> if the receiver object is an instance of erasure of type <code>T0</code>; <code>false</code> otherwise.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: Any
</div>
</div>
</li><li visbl="pub" name="org.scalatest.matchers.Matchers.ResultOfHaveWordForJavaList#length">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">length</span><span class="params">(<span name="expectedLength">expectedLength: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">This method enables the following syntax:</p>
<div class="fullcomment"><div class="comment cmt"><p>This method enables the following syntax:</p><p><pre>javaList should have length (12)
<sup></pre></sup></p><p>This method invokes <code>size</code> on the <code>java.util.List</code> passed as <code>left</code> to
determine its length.</p></div>
</div>
</li><li visbl="pub" name="scala.AnyRef#ne">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: AnyRef</span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt"><code>o.ne(arg0)</code> is the same as <code>!(o.eq(arg0))</code>.</p>
<div class="fullcomment"><div class="comment cmt"><p><code>o.ne(arg0)</code> is the same as <code>!(o.eq(arg0))</code>.
</p></div><dl class="paramcmts block"><dt class="param">arg0</dt><dd class="cmt"><p>the object to compare against this object for reference dis-equality.</p></dd><dt>returns</dt><dd class="cmt"><p><code>false</code> if the argument is not a reference to the receiver object; <code>true</code> otherwise.</p></dd></dl><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#notify">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">Wakes up a single thread that is waiting on the receiver object's monitor.</p>
<div class="fullcomment"><div class="comment cmt"><p>Wakes up a single thread that is waiting on the receiver object's monitor.</p></div><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#notifyAll">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">Wakes up all threads that are waiting on the receiver object's monitor.</p>
<div class="fullcomment"><div class="comment cmt"><p>Wakes up all threads that are waiting on the receiver object's monitor.</p></div><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div>
</div>
</li><li visbl="pub" name="org.scalatest.matchers.Matchers.ResultOfHaveWordForJavaCollection#size">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">size</span><span class="params">(<span name="expectedSize">expectedSize: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<p class="shortcomment cmt">This method enables the following syntax:</p>
<div class="fullcomment"><div class="comment cmt"><p>This method enables the following syntax:</p><p><pre>javaCollection should have size (10)
<sup></pre></sup></p></div><div class="block">
definition classes: <a href="Matchers$ResultOfHaveWordForJavaCollection.html" class="extype" name="org.scalatest.matchers.Matchers.ResultOfHaveWordForJavaCollection">ResultOfHaveWordForJavaCollection</a>
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#synchronized">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: T0</span>)</span><span class="result">: T0</span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div></div>
</li><li visbl="pub" name="scala.AnyRef#toString">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span>
</span>
</h4>
<p class="shortcomment cmt">Returns a string representation of the object.</p>
<div class="fullcomment"><div class="comment cmt"><p>Returns a string representation of the object.</p><p>The default representation is platform dependent.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>a string representation of the object.</p></dd></dl><div class="block">
definition classes: AnyRef → Any
</div>
</div>
</li><li visbl="pub" name="scala.AnyRef#wait">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div></div>
</li><li visbl="pub" name="scala.AnyRef#wait">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div></div>
</li><li visbl="pub" name="scala.AnyRef#wait">
<h4 class="signature">
<span class="kind">def</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><div class="block">
attributes: final
</div><div class="block">
definition classes: AnyRef
</div></div>
</li></ol>
</div>
</div>
<div id="tooltip"></div>
</body>
</html>
|
Java
|
select
'{{ var("from_root_to_second") }}' as from_root,
'{{ var("from_second_to_second") }}' as from_second
|
Java
|
package com.app.annotation.aspect;
/**
* Created by baixiaokang on 17/1/31.
*/
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Permission {
String[] value();
}
|
Java
|
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Class Hierarchy (JSparklines 1.0.12 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="class tree">
<meta name="generator" content="javadoc/TreeWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="script-dir/jquery-3.4.1.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.js"></script>
</head>
<body class="tree">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<div class="navListSearch"><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</div>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<main role="main">
<div class="header">
<h1 class="title">Hierarchy For All Packages</h1>
<span class="packageHierarchyLabel">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="no/uib/jsparklines/package-tree.html">no.uib.jsparklines</a>, </li>
<li><a href="no/uib/jsparklines/data/package-tree.html">no.uib.jsparklines.data</a>, </li>
<li><a href="no/uib/jsparklines/extra/package-tree.html">no.uib.jsparklines.extra</a>, </li>
<li><a href="no/uib/jsparklines/renderers/package-tree.html">no.uib.jsparklines.renderers</a>, </li>
<li><a href="no/uib/jsparklines/renderers/util/package-tree.html">no.uib.jsparklines.renderers.util</a></li>
</ul>
</div>
<div class="contentContainer">
<section class="hierarchy">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li class="circle">java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink"><span class="typeNameLink">Object</span></a>
<ul>
<li class="circle">org.jfree.data.general.AbstractDataset (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, org.jfree.data.general.Dataset, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/ObjectInputValidation.html?is-external=true" title="class or interface in java.io" class="externalLink">ObjectInputValidation</a>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">org.jfree.data.statistics.DefaultStatisticalCategoryDataset (implements org.jfree.util.PublicCloneable, org.jfree.data.RangeInfo, org.jfree.data.statistics.StatisticalCategoryDataset)
<ul>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/SignificantStatisticalCategoryDataset.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">SignificantStatisticalCategoryDataset</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="circle">org.jfree.chart.renderer.AbstractRenderer (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">org.jfree.chart.renderer.category.AbstractCategoryItemRenderer (implements org.jfree.chart.renderer.category.CategoryItemRenderer, java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, org.jfree.util.PublicCloneable, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">org.jfree.chart.renderer.category.BarRenderer (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, org.jfree.util.PublicCloneable, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">org.jfree.chart.renderer.category.BarRenderer3D (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, org.jfree.chart.Effect3D, org.jfree.util.PublicCloneable, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/BarChartColorRenderer.html" title="class in no.uib.jsparklines.renderers.util"><span class="typeNameLink">BarChartColorRenderer</span></a></li>
</ul>
</li>
<li class="circle">org.jfree.chart.renderer.category.StatisticalBarRenderer (implements org.jfree.chart.renderer.category.CategoryItemRenderer, java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, org.jfree.util.PublicCloneable, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/StatisticalBarChartColorRenderer.html" title="class in no.uib.jsparklines.renderers.util"><span class="typeNameLink">StatisticalBarChartColorRenderer</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="circle">org.jfree.chart.renderer.xy.AbstractXYItemRenderer (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>, org.jfree.chart.renderer.xy.XYItemRenderer)
<ul>
<li class="circle">org.jfree.chart.renderer.xy.XYAreaRenderer (implements org.jfree.util.PublicCloneable, org.jfree.chart.renderer.xy.XYItemRenderer)
<ul>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/AreaRenderer.html" title="class in no.uib.jsparklines.renderers.util"><span class="typeNameLink">AreaRenderer</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/ArrrayListDataPoints.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">ArrrayListDataPoints</span></a> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><T>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
<li class="circle">no.uib.jsparklines.extra.<a href="no/uib/jsparklines/extra/CellHighlighterRenderer.html" title="class in no.uib.jsparklines.extra"><span class="typeNameLink">CellHighlighterRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/Chromosome.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">Chromosome</span></a> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><T>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
<li class="circle">java.awt.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/Component.html?is-external=true" title="class or interface in java.awt" class="externalLink"><span class="typeNameLink">Component</span></a> (implements java.awt.image.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/image/ImageObserver.html?is-external=true" title="class or interface in java.awt.image" class="externalLink">ImageObserver</a>, java.awt.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/MenuContainer.html?is-external=true" title="class or interface in java.awt" class="externalLink">MenuContainer</a>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">java.awt.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/Container.html?is-external=true" title="class or interface in java.awt" class="externalLink"><span class="typeNameLink">Container</span></a>
<ul>
<li class="circle">javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JComponent.html?is-external=true" title="class or interface in javax.swing" class="externalLink"><span class="typeNameLink">JComponent</span></a> (implements java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JLabel.html?is-external=true" title="class or interface in javax.swing" class="externalLink"><span class="typeNameLink">JLabel</span></a> (implements javax.accessibility.<a href="http://docs.oracle.com/javase/7/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility" class="externalLink">Accessible</a>, javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/SwingConstants.html?is-external=true" title="class or interface in javax.swing" class="externalLink">SwingConstants</a>)
<ul>
<li class="circle">no.uib.jsparklines.extra.<a href="no/uib/jsparklines/extra/ChartPanelTableCellRenderer.html" title="class in no.uib.jsparklines.extra"><span class="typeNameLink">ChartPanelTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.extra.<a href="no/uib/jsparklines/extra/ChromosomeTableCellRenderer.html" title="class in no.uib.jsparklines.extra"><span class="typeNameLink">ChromosomeTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/DefaultListCellRenderer.html?is-external=true" title="class or interface in javax.swing" class="externalLink"><span class="typeNameLink">DefaultListCellRenderer</span></a> (implements javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/ListCellRenderer.html?is-external=true" title="class or interface in javax.swing" class="externalLink">ListCellRenderer</a><E>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">no.uib.jsparklines.<a href="no/uib/jsparklines/JSparklinesDemo.ComboBoxListCellRenderer.html" title="class in no.uib.jsparklines"><span class="typeNameLink">JSparklinesDemo.ComboBoxListCellRenderer</span></a></li>
<li class="circle">no.uib.jsparklines.<a href="no/uib/jsparklines/JSparklinesHeatMapDemo.ComboBoxListCellRenderer.html" title="class in no.uib.jsparklines"><span class="typeNameLink">JSparklinesHeatMapDemo.ComboBoxListCellRenderer</span></a></li>
</ul>
</li>
<li class="circle">javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/DefaultTableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink"><span class="typeNameLink">DefaultTableCellRenderer</span></a> (implements java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>, javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)
<ul>
<li class="circle">no.uib.jsparklines.<a href="no/uib/jsparklines/JSparklinesDemo.NonOpaqueCellRenderer.html" title="class in no.uib.jsparklines"><span class="typeNameLink">JSparklinesDemo.NonOpaqueCellRenderer</span></a></li>
<li class="circle">no.uib.jsparklines.<a href="no/uib/jsparklines/JSparklinesHeatMapDemo.NonOpaqueCellRenderer.html" title="class in no.uib.jsparklines"><span class="typeNameLink">JSparklinesHeatMapDemo.NonOpaqueCellRenderer</span></a></li>
<li class="circle">no.uib.jsparklines.extra.<a href="no/uib/jsparklines/extra/NimbusCheckBoxRenderer.html" title="class in no.uib.jsparklines.extra"><span class="typeNameLink">NimbusCheckBoxRenderer</span></a></li>
</ul>
</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklines3dTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklines3dTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesArrayListBarChartTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesArrayListBarChartTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesBubbleHeatMapTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesBubbleHeatMapTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesHeatMapTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesHeatMapTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesMultiIntervalChartTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesMultiIntervalChartTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesTwoValueBarChartTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesTwoValueBarChartTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
</ul>
</li>
<li class="circle">javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JPanel.html?is-external=true" title="class or interface in javax.swing" class="externalLink"><span class="typeNameLink">JPanel</span></a> (implements javax.accessibility.<a href="http://docs.oracle.com/javase/7/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility" class="externalLink">Accessible</a>)
<ul>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesBarChartTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesBarChartTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesColorTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesColorTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesErrorBarChartTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesErrorBarChartTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesIntegerColorTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesIntegerColorTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesIntegerIconTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesIntegerIconTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesIntervalChartTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesIntervalChartTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesMultiLabelTableCellRenderer.html" title="class in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesMultiLabelTableCellRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
</ul>
</li>
</ul>
</li>
<li class="circle">java.awt.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html?is-external=true" title="class or interface in java.awt" class="externalLink"><span class="typeNameLink">Window</span></a> (implements javax.accessibility.<a href="http://docs.oracle.com/javase/7/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility" class="externalLink">Accessible</a>)
<ul>
<li class="circle">java.awt.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/Dialog.html?is-external=true" title="class or interface in java.awt" class="externalLink"><span class="typeNameLink">Dialog</span></a>
<ul>
<li class="circle">javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JDialog.html?is-external=true" title="class or interface in javax.swing" class="externalLink"><span class="typeNameLink">JDialog</span></a> (implements javax.accessibility.<a href="http://docs.oracle.com/javase/7/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility" class="externalLink">Accessible</a>, javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/RootPaneContainer.html?is-external=true" title="class or interface in javax.swing" class="externalLink">RootPaneContainer</a>, javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/WindowConstants.html?is-external=true" title="class or interface in javax.swing" class="externalLink">WindowConstants</a>)
<ul>
<li class="circle">no.uib.jsparklines.<a href="no/uib/jsparklines/JSparklinesMultiLabelDemo.html" title="class in no.uib.jsparklines"><span class="typeNameLink">JSparklinesMultiLabelDemo</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="circle">java.awt.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/Frame.html?is-external=true" title="class or interface in java.awt" class="externalLink"><span class="typeNameLink">Frame</span></a> (implements java.awt.<a href="http://docs.oracle.com/javase/7/docs/api/java/awt/MenuContainer.html?is-external=true" title="class or interface in java.awt" class="externalLink">MenuContainer</a>)
<ul>
<li class="circle">javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JFrame.html?is-external=true" title="class or interface in javax.swing" class="externalLink"><span class="typeNameLink">JFrame</span></a> (implements javax.accessibility.<a href="http://docs.oracle.com/javase/7/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility" class="externalLink">Accessible</a>, javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/RootPaneContainer.html?is-external=true" title="class or interface in javax.swing" class="externalLink">RootPaneContainer</a>, javax.swing.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/WindowConstants.html?is-external=true" title="class or interface in javax.swing" class="externalLink">WindowConstants</a>)
<ul>
<li class="circle">no.uib.jsparklines.<a href="no/uib/jsparklines/JSparklinesDemo.html" title="class in no.uib.jsparklines"><span class="typeNameLink">JSparklinesDemo</span></a></li>
<li class="circle">no.uib.jsparklines.<a href="no/uib/jsparklines/JSparklinesHeatMapDemo.html" title="class in no.uib.jsparklines"><span class="typeNameLink">JSparklinesHeatMapDemo</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/GradientColorCoding.html" title="class in no.uib.jsparklines.renderers.util"><span class="typeNameLink">GradientColorCoding</span></a></li>
<li class="circle">no.uib.jsparklines.extra.<a href="no/uib/jsparklines/extra/HtmlLinksRenderer.html" title="class in no.uib.jsparklines.extra"><span class="typeNameLink">HtmlLinksRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/JSparklines3dDataSeries.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">JSparklines3dDataSeries</span></a></li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/JSparklines3dDataset.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">JSparklines3dDataset</span></a></li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/JSparklinesDataSeries.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">JSparklinesDataSeries</span></a></li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/JSparklinesDataset.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">JSparklinesDataset</span></a> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><T>)</li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/JSparklinesMultiLabel.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">JSparklinesMultiLabel</span></a> (implements java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/JSparklinesMultiLabelDataset.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">JSparklinesMultiLabelDataset</span></a> (implements java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/ReferenceArea.html" title="class in no.uib.jsparklines.renderers.util"><span class="typeNameLink">ReferenceArea</span></a></li>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/ReferenceLine.html" title="class in no.uib.jsparklines.renderers.util"><span class="typeNameLink">ReferenceLine</span></a></li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/StartIndexes.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">StartIndexes</span></a> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><T>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
<li class="circle">no.uib.jsparklines.extra.<a href="no/uib/jsparklines/extra/TrueFalseIconRenderer.html" title="class in no.uib.jsparklines.extra"><span class="typeNameLink">TrueFalseIconRenderer</span></a> (implements javax.swing.table.<a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellRenderer.html?is-external=true" title="class or interface in javax.swing.table" class="externalLink">TableCellRenderer</a>)</li>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/Util.html" title="class in no.uib.jsparklines.renderers.util"><span class="typeNameLink">Util</span></a></li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/ValueAndBooleanDataPoint.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">ValueAndBooleanDataPoint</span></a> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><T>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/XYDataPoint.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">XYDataPoint</span></a> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><T>, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
<li class="circle">no.uib.jsparklines.data.<a href="no/uib/jsparklines/data/XYZDataPoint.html" title="class in no.uib.jsparklines.data"><span class="typeNameLink">XYZDataPoint</span></a> (implements java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)</li>
</ul>
</li>
</ul>
</section>
<section class="hierarchy">
<h2 title="Enum Hierarchy">Enum Hierarchy</h2>
<ul>
<li class="circle">java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink"><span class="typeNameLink">Object</span></a>
<ul>
<li class="circle">java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang" class="externalLink"><span class="typeNameLink">Enum</span></a><E> (implements java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><T>, java.lang.constant.Constable, java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>)
<ul>
<li class="circle">no.uib.jsparklines.renderers.util.<a href="no/uib/jsparklines/renderers/util/GradientColorCoding.ColorGradient.html" title="enum in no.uib.jsparklines.renderers.util"><span class="typeNameLink">GradientColorCoding.ColorGradient</span></a></li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklines3dTableCellRenderer.PlotType.html" title="enum in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklines3dTableCellRenderer.PlotType</span></a></li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType.html" title="enum in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType</span></a></li>
<li class="circle">no.uib.jsparklines.renderers.<a href="no/uib/jsparklines/renderers/JSparklinesTableCellRenderer.PlotType.html" title="enum in no.uib.jsparklines.renderers"><span class="typeNameLink">JSparklinesTableCellRenderer.PlotType</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</section>
</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright © 2020. All rights reserved.</small></p>
</footer>
</body>
</html>
|
Java
|
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.module.impl;
import com.intellij.configurationStore.RenameableStateStorageManager;
import com.intellij.ide.highlighter.ModuleFileType;
import com.intellij.ide.plugins.ContainerDescriptor;
import com.intellij.ide.plugins.IdeaPluginDescriptorImpl;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.*;
import com.intellij.openapi.components.impl.stores.IComponentStore;
import com.intellij.openapi.components.impl.stores.ModuleStore;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleComponent;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.module.impl.scopes.ModuleScopeProviderImpl;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ex.ProjectEx;
import com.intellij.openapi.roots.ExternalProjectSystemRegistry;
import com.intellij.openapi.roots.ProjectModelElement;
import com.intellij.openapi.roots.ProjectModelExternalSource;
import com.intellij.openapi.util.SimpleModificationTracker;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.pointers.VirtualFilePointer;
import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener;
import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.serviceContainer.ComponentManagerImpl;
import com.intellij.util.xmlb.annotations.MapAnnotation;
import com.intellij.util.xmlb.annotations.Property;
import kotlin.Unit;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
public class ModuleImpl extends ComponentManagerImpl implements ModuleEx {
private static final Logger LOG = Logger.getInstance(ModuleImpl.class);
@NotNull private final Project myProject;
@Nullable protected VirtualFilePointer myImlFilePointer;
private volatile boolean isModuleAdded;
private String myName;
private final ModuleScopeProvider myModuleScopeProvider;
@ApiStatus.Internal
public ModuleImpl(@NotNull String name, @NotNull Project project, @NotNull String filePath) {
this(name, project);
myImlFilePointer = VirtualFilePointerManager.getInstance().create(
VfsUtilCore.pathToUrl(filePath), this,
new VirtualFilePointerListener() {
@Override
public void validityChanged(@NotNull VirtualFilePointer @NotNull [] pointers) {
if (myImlFilePointer == null) return;
VirtualFile virtualFile = myImlFilePointer.getFile();
if (virtualFile != null) {
((ModuleStore)getStore()).setPath(virtualFile.toNioPath(), virtualFile, false);
ModuleManager.getInstance(myProject).incModificationCount();
}
}
});
}
@ApiStatus.Internal
public ModuleImpl(@NotNull String name, @NotNull Project project, @Nullable VirtualFilePointer virtualFilePointer) {
this(name, project);
myImlFilePointer = virtualFilePointer;
}
@ApiStatus.Internal
public ModuleImpl(@NotNull String name, @NotNull Project project) {
super((ComponentManagerImpl)project);
registerServiceInstance(Module.class, this, ComponentManagerImpl.fakeCorePluginDescriptor);
myProject = project;
myModuleScopeProvider = new ModuleScopeProviderImpl(this);
myName = name;
}
@Override
public void init(@Nullable Runnable beforeComponentCreation) {
// do not measure (activityNamePrefix method not overridden by this class)
// because there are a lot of modules and no need to measure each one
registerComponents();
if (!isPersistent()) {
registerService(IComponentStore.class,
NonPersistentModuleStore.class,
ComponentManagerImpl.fakeCorePluginDescriptor,
true, ServiceDescriptor.PreloadMode.FALSE);
}
if (beforeComponentCreation != null) {
beforeComponentCreation.run();
}
createComponents(null);
}
private boolean isPersistent() {
return myImlFilePointer != null;
}
@Override
protected void setProgressDuringInit(@NotNull ProgressIndicator indicator) {
// Component loading progress is not reported for module, because at this stage minimal reporting unit it is the module itself.
// Stage "Loading modules" progress reported for each loaded module and module component count doesn't matter.
}
@Override
public final boolean isDisposed() {
// in case of light project in tests when it's temporarily disposed, the module should be treated as disposed too.
//noinspection TestOnlyProblems
return super.isDisposed() || ((ProjectEx)myProject).isLight() && myProject.isDisposed();
}
@Override
protected boolean isComponentSuitable(@NotNull ComponentConfig componentConfig) {
if (!super.isComponentSuitable(componentConfig)) {
return false;
}
Map<String, String> options = componentConfig.options;
if (options == null || options.isEmpty()) {
return true;
}
for (String optionName : options.keySet()) {
if ("workspace".equals(optionName) || "overrides".equals(optionName)) {
continue;
}
// we cannot filter using module options because at this moment module file data could be not loaded
String message = "Don't specify " + optionName + " in the component registration, transform component to service and implement your logic in your getInstance() method";
if (ApplicationManager.getApplication().isUnitTestMode()) {
LOG.error(message);
}
else {
LOG.warn(message);
}
}
return true;
}
@Override
@Nullable
public VirtualFile getModuleFile() {
if (myImlFilePointer == null) {
return null;
}
return myImlFilePointer.getFile();
}
@Override
public void rename(@NotNull String newName, boolean notifyStorage) {
myName = newName;
if (notifyStorage) {
((RenameableStateStorageManager)getStore().getStorageManager()).rename(newName + ModuleFileType.DOT_DEFAULT_EXTENSION);
}
}
protected @NotNull IComponentStore getStore() {
return Objects.requireNonNull(getService(IComponentStore.class));
}
@Override
public boolean canStoreSettings() {
return !(getStore() instanceof NonPersistentModuleStore);
}
@Override
@NotNull
public Path getModuleNioFile() {
if (!isPersistent()) {
return Paths.get("");
}
return getStore().getStorageManager().expandMacro(StoragePathMacros.MODULE_FILE);
}
@Override
public synchronized void dispose() {
isModuleAdded = false;
super.dispose();
}
@NotNull
@Override
protected ContainerDescriptor getContainerDescriptor(@NotNull IdeaPluginDescriptorImpl pluginDescriptor) {
return pluginDescriptor.moduleContainerDescriptor;
}
@Override
public void projectOpened() {
//noinspection deprecation
processInitializedComponents(ModuleComponent.class, (component, __) -> {
try {
//noinspection deprecation
component.projectOpened();
}
catch (Exception e) {
LOG.error(e);
}
return Unit.INSTANCE;
});
}
@Override
public void projectClosed() {
//noinspection deprecation
List<ModuleComponent> components = new ArrayList<>();
//noinspection deprecation
processInitializedComponents(ModuleComponent.class, (component, __) -> {
components.add(component);
return Unit.INSTANCE;
});
for (int i = components.size() - 1; i >= 0; i--) {
try {
//noinspection deprecation
components.get(i).projectClosed();
}
catch (Throwable e) {
LOG.error(e);
}
}
}
@Override
@NotNull
public Project getProject() {
return myProject;
}
@Override
@NotNull
public String getName() {
return myName;
}
@Override
public boolean isLoaded() {
return isModuleAdded;
}
@Override
public void moduleAdded() {
isModuleAdded = true;
//noinspection deprecation
processInitializedComponents(ModuleComponent.class, (component, __) -> {
//noinspection deprecation
component.moduleAdded();
return Unit.INSTANCE;
});
}
@Override
public void setOption(@NotNull String key, @Nullable String value) {
DeprecatedModuleOptionManager manager = getOptionManager();
if (value == null) {
if (manager.state.options.remove(key) != null) {
manager.incModificationCount();
}
}
else if (!value.equals(manager.state.options.put(key, value))) {
manager.incModificationCount();
}
}
@NotNull
private DeprecatedModuleOptionManager getOptionManager() {
//noinspection ConstantConditions
return ((Module)this).getService(DeprecatedModuleOptionManager.class);
}
@Override
public String getOptionValue(@NotNull String key) {
return getOptionManager().state.options.get(key);
}
@NotNull
@Override
public GlobalSearchScope getModuleScope() {
return myModuleScopeProvider.getModuleScope();
}
@NotNull
@Override
public GlobalSearchScope getModuleScope(boolean includeTests) {
return myModuleScopeProvider.getModuleScope(includeTests);
}
@NotNull
@Override
public GlobalSearchScope getModuleWithLibrariesScope() {
return myModuleScopeProvider.getModuleWithLibrariesScope();
}
@NotNull
@Override
public GlobalSearchScope getModuleWithDependenciesScope() {
return myModuleScopeProvider.getModuleWithDependenciesScope();
}
@NotNull
@Override
public GlobalSearchScope getModuleContentScope() {
return myModuleScopeProvider.getModuleContentScope();
}
@NotNull
@Override
public GlobalSearchScope getModuleContentWithDependenciesScope() {
return myModuleScopeProvider.getModuleContentWithDependenciesScope();
}
@NotNull
@Override
public GlobalSearchScope getModuleWithDependenciesAndLibrariesScope(boolean includeTests) {
return myModuleScopeProvider.getModuleWithDependenciesAndLibrariesScope(includeTests);
}
@NotNull
@Override
public GlobalSearchScope getModuleWithDependentsScope() {
return myModuleScopeProvider.getModuleWithDependentsScope();
}
@NotNull
@Override
public GlobalSearchScope getModuleTestsWithDependentsScope() {
return myModuleScopeProvider.getModuleTestsWithDependentsScope();
}
@NotNull
@Override
public GlobalSearchScope getModuleRuntimeScope(boolean includeTests) {
return myModuleScopeProvider.getModuleRuntimeScope(includeTests);
}
@Override
public void clearScopesCache() {
myModuleScopeProvider.clearCache();
}
@Override
public String toString() {
if (myName == null) return "Module (not initialized)";
return "Module: '" + getName() + "'" + (isDisposed() ? " (disposed)" : "");
}
@Override
public long getOptionsModificationCount() {
return getOptionManager().getModificationCount();
}
@ApiStatus.Internal
@State(name = "DeprecatedModuleOptionManager", useLoadedStateAsExisting = false /* doesn't make sense to check it */)
public static class DeprecatedModuleOptionManager extends SimpleModificationTracker implements PersistentStateComponent<DeprecatedModuleOptionManager.State>,
ProjectModelElement {
private final Module module;
DeprecatedModuleOptionManager(@NotNull Module module) {
this.module = module;
}
@Override
@Nullable
public ProjectModelExternalSource getExternalSource() {
if (state.options.size() > 1 || state.options.size() == 1 && !state.options.containsKey(Module.ELEMENT_TYPE) /* unrealistic case, but just to be sure */) {
return null;
}
return ExternalProjectSystemRegistry.getInstance().getExternalSource(module);
}
static final class State {
@Property(surroundWithTag = false)
@MapAnnotation(surroundKeyWithTag = false, surroundValueWithTag = false, surroundWithTag = false, entryTagName = "option")
public final Map<String, String> options = new HashMap<>();
}
private State state = new State();
@Nullable
@Override
public State getState() {
return state;
}
@Override
public void loadState(@NotNull State state) {
this.state = state;
}
}
}
|
Java
|
# Lespedeza trigonoclada Franch. SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
app.controller('PickerController', function ($scope, $modalInstance, itemColor) {
$scope.showCarrierColors = true;
$scope.brandColors = [
{
name: 'Brand Blue',
hex: '#276681'
},
{
name: 'Brand Green',
hex: '#66b245'
},
{
name: 'Brand Blue Desaturated',
hex: '#417c95'
},
{
name: 'Brand Green Desaturated',
hex: '#75b86f'
},
{
name: 'Bluest',
hex: '#5baebf'
},
{
name: 'Blue',
hex: '#66b7bb'
},
{
name: 'Blue Green',
hex: '#76beb6'
},
{
name: 'Green Blue',
hex: '#84c6ae'
},
{
name: 'Green',
hex: '#96cca7'
},
{
name: 'Greenest',
hex: '#a4d49a'
},
{
name: 'Level 2 Blend',
hex: '#7fced8'
},
{
name: 'Level 2 Blend',
hex: '#8fd4d6'
},
{
name: 'Level 2 Blend',
hex: '#a5d7d3'
},
{
name: 'Level 2 Blend',
hex: '#b5dcce'
},
{
name: 'Level 2 Blend',
hex: '#bfe0ca'
},
{
name: 'Level 2 Blend',
hex: '#c8e5c2'
},
{
name: 'Level 3 Blend',
hex: '#b0e2e7'
},
{
name: 'Level 3 Blend',
hex: '#bce5e6'
},
{
name: 'Level 3 Blend',
hex: '#c8e6e4'
},
{
name: 'Level 3 Blend',
hex: '#d3eae2'
},
{
name: 'Level 3 Blend',
hex: '#d8ecdf'
},
{
name: 'Level 3 Blend',
hex: '#ddefda'
},
{
name: 'Illustration Stroke Darkest',
hex: '#54636a'
},
{
name: 'Illustration Stroke Medium',
hex: '#7f8a8f'
},
{
name: 'Illustration Stroke Light',
hex: '#a9b1b4'
},
{
name: 'Illustration Stroke Lightest',
hex: '#d4d8da'
},
{
name: 'Yellow',
hex: '#f5db77'
},
{
name: 'Medium Yellow',
hex: '#f8e499'
},
{
name: 'Light Yellow',
hex: '#faedbb'
},
{
name: 'Lightest Yellow',
hex: '#fdf6dd'
},
{
name: 'Tang',
hex: '#f38871'
},
{
name: 'Medium Tang',
hex: '#f7a593'
},
{
name: 'Light Tang',
hex: '#fbc1b4'
},
{
name: 'Lightest Tang',
hex: '#ffded6'
},
{
name: 'Black',
hex: '#555555'
},
{
name: 'Dark Gray',
hex: '#797979'
},
{
name: 'Medium Gray',
hex: '#9c9c9c'
},
{
name: 'Light Gray',
hex: '#c0c0c0'
},
{
name: 'Lightest Gray',
hex: '#e3e3e3'
},
{
name: 'Off White',
hex: '#f9f9f9'
}
];
$scope.carrierColors = [
{
carrier: 'Verizon',
hex: '#ca5b59'
},
{
carrier: 'AT&T',
hex: '#5694b4'
},
{
carrier: 'T-Mobile',
hex: '#d45da0'
},
{
carrier: 'Sprint',
hex: '#e9b444'
},
{
carrier: 'Cricket',
hex: '#008752'
},
{
carrier: 'Cricket',
hex: '#439474'
},
{
carrier: 'MetroPCS',
hex: '#6764b3'
},
{
carrier: 'EE',
hex: '#2e9a9c'
},
{
carrier: 'O2',
hex: '#2566a8'
},
{
carrier: 'Orange',
hex: '#ff6c42'
},
{
carrier: 'Three',
hex: '#333333'
},
{
carrier: 'Vodafone',
hex: '#eb5247'
},
{
carrier: 'Bell',
hex: '#2876a5'
},
{
carrier: 'Leap',
hex: '#330066'
},
{
carrier: 'Rogers',
hex: '#d63e3e'
},
{
carrier: 'Telus',
hex: '#4e5cb5'
},
{
carrier: 'Videotron',
hex: '#fcc622'
},
{
carrier: 'Wind',
hex: '#ec7c23'
},
{
carrier: 'Tie',
hex: '#999999'
}
]
$scope.ok = function () {
$modalInstance.close(itemColor);
};
$scope.closeModal = function(color) {
$modalInstance.close(color);
}
});
|
Java
|
// Copyright 2007-2017 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit.Azure.ServiceBus.Core.Topology.Configuration
{
using System;
using MassTransit.Topology;
public interface IServiceBusConsumeTopologyConfigurator :
IConsumeTopologyConfigurator,
IServiceBusConsumeTopology
{
new IServiceBusMessageConsumeTopologyConfigurator<T> GetMessageTopology<T>()
where T : class;
void AddSpecification(IServiceBusConsumeTopologySpecification specification);
/// <summary>
/// Create a topic subscription on the endpoint
/// </summary>
/// <param name="topicName">The topic name</param>
/// <param name="subscriptionName">The name for the subscription</param>
/// <param name="callback">Configure the exchange and binding</param>
void Subscribe(string topicName, string subscriptionName, Action<ISubscriptionConfigurator> callback = null);
}
}
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Sun Dec 30 01:26:13 PST 2012 -->
<TITLE>
Uses of Class org.apache.hadoop.mapreduce.lib.partition.HashPartitioner (Hadoop 1.0.4-SNAPSHOT API)
</TITLE>
<META NAME="date" CONTENT="2012-12-30">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.hadoop.mapreduce.lib.partition.HashPartitioner (Hadoop 1.0.4-SNAPSHOT API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/hadoop/mapreduce/lib/partition/HashPartitioner.html" title="class in org.apache.hadoop.mapreduce.lib.partition"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/hadoop/mapreduce/lib/partition//class-useHashPartitioner.html" target="_top"><B>FRAMES</B></A>
<A HREF="HashPartitioner.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.apache.hadoop.mapreduce.lib.partition.HashPartitioner</B></H2>
</CENTER>
No usage of org.apache.hadoop.mapreduce.lib.partition.HashPartitioner
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../org/apache/hadoop/mapreduce/lib/partition/HashPartitioner.html" title="class in org.apache.hadoop.mapreduce.lib.partition"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?org/apache/hadoop/mapreduce/lib/partition//class-useHashPartitioner.html" target="_top"><B>FRAMES</B></A>
<A HREF="HashPartitioner.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2009 The Apache Software Foundation
</BODY>
</HTML>
|
Java
|
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.mirror.declaration;
import java.lang.annotation.Annotation;
import java.util.Collection;
import com.sun.mirror.type.*;
import com.sun.mirror.util.*;
/**
* Represents the declaration of a program element such as a package,
* class, or method. Each declaration represents a static, language-level
* construct (and not, for example, a runtime construct of the virtual
* machine), and typically corresponds one-to-one with a particular
* fragment of source code.
*
* <p> Declarations should be compared using the {@link #equals(Object)}
* method. There is no guarantee that any particular declaration will
* always be represented by the same object.
*
* @deprecated All components of this API have been superseded by the
* standardized annotation processing API. The replacement for the
* functionality of this interface is {@link
* javax.lang.model.element.Element}.
*
* @author Joseph D. Darcy
* @author Scott Seligman
*
* @see Declarations
* @see TypeMirror
* @since 1.5
*/
@Deprecated
@SuppressWarnings("deprecation")
public interface Declaration {
/**
* Tests whether an object represents the same declaration as this.
*
* @param obj the object to be compared with this declaration
* @return <tt>true</tt> if the specified object represents the same
* declaration as this
*/
boolean equals(Object obj);
/**
* Returns the text of the documentation ("javadoc") comment of
* this declaration.
*
* @return the documentation comment of this declaration, or <tt>null</tt>
* if there is none
*/
String getDocComment();
/**
* Returns the annotations that are directly present on this declaration.
*
* @return the annotations directly present on this declaration;
* an empty collection if there are none
*/
Collection<AnnotationMirror> getAnnotationMirrors();
/**
* Returns the annotation of this declaration having the specified
* type. The annotation may be either inherited or directly
* present on this declaration.
*
* <p> The annotation returned by this method could contain an element
* whose value is of type <tt>Class</tt>.
* This value cannot be returned directly: information necessary to
* locate and load a class (such as the class loader to use) is
* not available, and the class might not be loadable at all.
* Attempting to read a <tt>Class</tt> object by invoking the relevant
* method on the returned annotation
* will result in a {@link MirroredTypeException},
* from which the corresponding {@link TypeMirror} may be extracted.
* Similarly, attempting to read a <tt>Class[]</tt>-valued element
* will result in a {@link MirroredTypesException}.
*
* <blockquote>
* <i>Note:</i> This method is unlike
* others in this and related interfaces. It operates on run-time
* reflective information -- representations of annotation types
* currently loaded into the VM -- rather than on the mirrored
* representations defined by and used throughout these
* interfaces. It is intended for callers that are written to
* operate on a known, fixed set of annotation types.
* </blockquote>
*
* @param <A> the annotation type
* @param annotationType the <tt>Class</tt> object corresponding to
* the annotation type
* @return the annotation of this declaration having the specified type
*
* @see #getAnnotationMirrors()
*/
<A extends Annotation> A getAnnotation(Class<A> annotationType);
/**
* Returns the modifiers of this declaration, excluding annotations.
* Implicit modifiers, such as the <tt>public</tt> and <tt>static</tt>
* modifiers of interface members, are included.
*
* @return the modifiers of this declaration in undefined order;
* an empty collection if there are none
*/
Collection<Modifier> getModifiers();
/**
* Returns the simple (unqualified) name of this declaration.
* The name of a generic type does not include any reference
* to its formal type parameters.
* For example, the simple name of the interface declaration
* {@code java.util.Set<E>} is <tt>"Set"</tt>.
* If this declaration represents the empty package, an empty
* string is returned.
* If it represents a constructor, the simple name of its
* declaring class is returned.
*
* @return the simple name of this declaration
*/
String getSimpleName();
/**
* Returns the source position of the beginning of this declaration.
* Returns <tt>null</tt> if the position is unknown or not applicable.
*
* <p> This source position is intended for use in providing
* diagnostics, and indicates only approximately where a declaration
* begins.
*
* @return the source position of the beginning of this declaration,
* or null if the position is unknown or not applicable
*/
SourcePosition getPosition();
/**
* Applies a visitor to this declaration.
*
* @param v the visitor operating on this declaration
*/
void accept(DeclarationVisitor v);
}
|
Java
|
package com.xsolla.android.sdk.data.model;
import java.util.List;
public class XHoldSubscriptionStatus {
private String status;
private List<XMessage> errors;
private XApi api;
public String getStatus() {
return status;
}
public List<XMessage> getErrors() {
return errors;
}
public String getErrorMsg() {
StringBuilder sb = new StringBuilder();
for (XMessage message : errors) {
sb.append(message.getMessage()).append("\n");
}
sb.deleteCharAt(sb.length() - 1);
return sb.toString();
}
@Override
public String toString() {
return "XHoldSubscription{" +
"status='" + status + '\'' +
", errors=" + errors +
", api=" + api +
'}';
}
}
|
Java
|
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Evol.TMovie.Domain.Models.Entities;
using Evol.TMovie.Domain.QueryEntries.Parameters;
using Evol.Common;
using Evol.Domain.Data;
using Evol.Common.Data;
namespace Evol.TMovie.Domain.QueryEntries
{
public interface ISeatQueryEntry : IQueryEntry
{
Task<Seat> FindAsync(Guid id);
Task<List<Seat>> SelectAsync(SeatQueryParameter param);
Task<IPaged<Seat>> PagedAsync(SeatQueryParameter param, int pageIndex, int pageSize);
}
}
|
Java
|
package br.eti.arthurgregorio.fulljeearch.domain.security;
/**
*
* @author Arthur
*/
public interface ApplicationRoles {
public final String USER = "Usuario";
public final String ADMINISTRATOR = "Administrador";
}
|
Java
|
namespace SharpGCalendar.Domain.Model
{
public enum Frequency
{
None = 0,
Daily = 1,
Weekly = 2,
Monthly = 4,
Yearly = 8
}
}
|
Java
|
package com.almende.dialog.example.agent;
import java.io.Serializable;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Logger;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import com.almende.dialog.Settings;
import com.almende.dialog.model.Answer;
import com.almende.dialog.model.Question;
import com.almende.util.ParallelInit;
import com.almende.util.twigmongo.QueryResultIterator;
import com.almende.util.twigmongo.TwigCompatibleMongoDatastore;
import com.almende.util.twigmongo.TwigCompatibleMongoDatastore.RootFindCommand;
import com.almende.util.twigmongo.annotations.Id;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
@Path("yesno")
public class YesNoAgent {
static final ObjectMapper om =ParallelInit.getObjectMapper();
private static final String URL = "http://"+Settings.HOST+"/yesno/";
private static final String SOUNDURL = "http://ask4604.ask46.customers.luna.net/rest/";
private static final Logger log = Logger
.getLogger("DialogHandler");
public Question getQuestion(int question_no, String preferred_medium, String phonenumber) {
String questionURL = URL+"questions/"+question_no;
String answerYesURL = URL+"answers/0";
String answerNoURL = URL+"answers/1";
if (preferred_medium != null && preferred_medium.startsWith("audio")){
questionURL = this.getAudioFile(question_no);
answerYesURL= SOUNDURL+"14.wav";
answerNoURL= SOUNDURL+"14.wav";
}
Question question=new Question();
question.setRequester(URL+"id/");
question.setType("closed");
question.setQuestion_text(questionURL);
question.setAnswers(new ArrayList<Answer>(Arrays.asList(
new Answer(answerYesURL, URL+"questions/"+question_no+"?preferred_medium="+preferred_medium+"&pn="+phonenumber+"&answer=yes"),
new Answer(answerNoURL, URL+"questions/"+question_no+"?preferred_medium="+preferred_medium+"&pn="+phonenumber+"&answer=no"))));
return question;
}
@GET
@Path("/id/")
public Response getId(@QueryParam("preferred_language") String preferred_language){
ObjectNode node= om.createObjectNode();
node.put("url", URL);
node.put("nickname", "YesNo");
return Response.ok(node.toString()).build();
}
@GET
@Produces("application/json")
public Response firstQuestion(@QueryParam("preferred_medium") String preferred_medium, @QueryParam("remoteAddress") String responder, @QueryParam("requester") String requester){
int questionNo=0;
if(requester.contains("live") || requester.contains("0107421217")){
questionNo=1;
}
try {
responder = URLDecoder.decode(responder, "UTF-8");
} catch (Exception ex) {
log.severe(ex.getMessage());
}
Question question = getQuestion(questionNo, preferred_medium, responder);
return Response.ok(question.toJSON()).build();
}
@Path("/questions/{question_no}")
@POST
@Produces("application/json")
@Consumes("*/*")
public Response answerQuestion(@PathParam("question_no") String question_no, @QueryParam("preferred_medium") String preferred_medium,
@QueryParam("pn") String phonenumber, @QueryParam("answer") String answer){
Group group = this.getGroup("Group."+question_no+"."+answer);
group.addMember(phonenumber);
TwigCompatibleMongoDatastore datastore = new TwigCompatibleMongoDatastore();
datastore.store(group);
int responseQuestion=99;
String questionURL = URL+"questions/"+responseQuestion;
if (preferred_medium != null && preferred_medium.startsWith("audio")){
questionURL = this.getAudioFile(responseQuestion);
}
Question question=new Question();
question.setRequester(URL+"id/");
question.setType("comment");
question.setQuestion_text(questionURL);
return Response.ok( question.toJSON() ).build();
}
@Path("/questions/{question_no}")
@GET
@Produces("text/plain")
@Consumes("*/*")
public Response getQuestionText(@PathParam("question_no") String question_no ){
Integer questionNo = Integer.parseInt(question_no);
String result = "";
// These messages are now static but should be loaded from the LifeRay Database.
switch (questionNo){
case 0: result="Press 1 if you are available, press 2 if you are unavailable."; break;
case 1: result="Are you available?"; break;
case 99: result="Thank you for your input"; break;
default: result="Sorry, for some strange reason I don't have that question text available...";
}
return Response.ok(result).build();
}
@Path("/answers/{answer_no}")
@GET
@Produces("text/plain")
@Consumes("*/*")
public Response getAnswerText(@PathParam("answer_no") String answer_no, @QueryParam("preferred_medium") String prefered_mimeType){
Integer answerNo = Integer.parseInt(answer_no);
String result="";
// These messages can be static, because they are always the same.
switch (answerNo){
case 0: result="Yes"; break;
case 1: result="No"; break;
default: result="Sorry, for some strange reason I don't have that answer text available...";
}
return Response.ok(result).build();
}
// This urls will present the results
@Path("result")
@GET
public Response getResults() {
String result="";
ArrayList<Group> groups = (ArrayList<Group>) this.getAllGroups();
try {
result = om.writeValueAsString(groups);
} catch(Exception ex) {
ex.printStackTrace();
}
return Response.ok( result ).build();
}
// These functions should get there data from the liferay database.
// These are the audio files linked to the questions
public String getAudioFile(int question_no) {
switch(question_no) {
case 0: return SOUNDURL+"571.wav";
case 1: return SOUNDURL+"572.wav";
case 99: return SOUNDURL+"567.wav";
default: return SOUNDURL+"529.wav";
}
}
// These 2 functions are the group management
public Group getGroup(String id) {
TwigCompatibleMongoDatastore datastore = new TwigCompatibleMongoDatastore();
Group group = datastore.load(Group.class, id);
if(group!=null)
return group;
group = new Group();
group.setId(id);
return group;
}
public List<Group> getAllGroups() {
TwigCompatibleMongoDatastore datastore = new TwigCompatibleMongoDatastore();
RootFindCommand<Group> command = datastore.find()
.type(Group.class);
QueryResultIterator<Group> it = command.now();
List<Group> groups = new ArrayList<Group>();
while (it.hasNext()) {
groups.add(it.next());
}
return groups;
}
}
@SuppressWarnings("serial")
class Group implements Serializable {
public Group() {
this.members=new HashSet<String>();
}
public String getId(){
return id;
}
public void setId(String id){
this.id=id;
}
public Set<String> getMembers() {
return this.members;
}
public void addMember(String member) {
this.members.add(member);
}
@Id private String id=null;
private Set<String> members=null;
}
|
Java
|
CREATE TABLE IF NOT EXISTS `uctoo_district` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`level` tinyint(4) unsigned NOT NULL DEFAULT '0',
`upid` mediumint(8) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='中国省市区乡镇数据表';
INSERT INTO `uctoo_district` (`id`, `name`, `level`, `upid`) VALUES
(110000, '北京市', 1, 0),
(120000, '天津市', 1, 0),
(130000, '河北省', 1, 0),
(140000, '山西省', 1, 0),
(150000, '内蒙古', 1, 0),
(210000, '辽宁省', 1, 0),
(220000, '吉林省', 1, 0),
(230000, '黑龙江', 1, 0),
(310000, '上海市', 1, 0),
(320000, '江苏省', 1, 0),
(330000, '浙江省', 1, 0),
(340000, '安徽省', 1, 0),
(350000, '福建省', 1, 0),
(360000, '江西省', 1, 0),
(370000, '山东省', 1, 0),
(410000, '河南省', 1, 0),
(420000, '湖北省', 1, 0),
(430000, '湖南省', 1, 0),
(440000, '广东省', 1, 0),
(450000, '广西省', 1, 0),
(460000, '海南省', 1, 0),
(500000, '重庆市', 1, 0),
(510000, '四川省', 1, 0),
(520000, '贵州省', 1, 0),
(530000, '云南省', 1, 0),
(540000, '西 藏', 1, 0),
(610000, '陕西省', 1, 0),
(620000, '甘肃省', 1, 0),
(630000, '青海省', 1, 0),
(640000, '宁 夏', 1, 0),
(650000, '新 疆', 1, 0),
(710000, '台湾省', 1, 0),
(810000, '香 港', 1, 0),
(820000, '澳 门', 1, 0),
(110100, '北京市', 2, 110000),
(110200, '县', 2, 110000),
(120100, '市辖区', 2, 120000),
(120200, '县', 2, 120000),
(130100, '石家庄市', 2, 130000),
(130200, '唐山市', 2, 130000),
(130300, '秦皇岛市', 2, 130000),
(130400, '邯郸市', 2, 130000),
(130500, '邢台市', 2, 130000),
(130600, '保定市', 2, 130000),
(130700, '张家口市', 2, 130000),
(130800, '承德市', 2, 130000),
(130900, '沧州市', 2, 130000),
(131000, '廊坊市', 2, 130000),
(131100, '衡水市', 2, 130000),
(140100, '太原市', 2, 140000),
(140200, '大同市', 2, 140000),
(140300, '阳泉市', 2, 140000),
(140400, '长治市', 2, 140000),
(140500, '晋城市', 2, 140000),
(140600, '朔州市', 2, 140000),
(140700, '晋中市', 2, 140000),
(140800, '运城市', 2, 140000),
(140900, '忻州市', 2, 140000),
(141000, '临汾市', 2, 140000),
(141100, '吕梁市', 2, 140000),
(150100, '呼和浩特市', 2, 150000),
(150200, '包头市', 2, 150000),
(150300, '乌海市', 2, 150000),
(150400, '赤峰市', 2, 150000),
(150500, '通辽市', 2, 150000),
(150600, '鄂尔多斯市', 2, 150000),
(150700, '呼伦贝尔市', 2, 150000),
(150800, '巴彦淖尔市', 2, 150000),
(150900, '乌兰察布市', 2, 150000),
(152200, '兴安盟', 2, 150000),
(152500, '锡林郭勒盟', 2, 150000),
(152900, '阿拉善盟', 2, 150000),
(210100, '沈阳市', 2, 210000),
(210200, '大连市', 2, 210000),
(210300, '鞍山市', 2, 210000),
(210400, '抚顺市', 2, 210000),
(210500, '本溪市', 2, 210000),
(210600, '丹东市', 2, 210000),
(210700, '锦州市', 2, 210000),
(210800, '营口市', 2, 210000),
(210900, '阜新市', 2, 210000),
(211000, '辽阳市', 2, 210000),
(211100, '盘锦市', 2, 210000),
(211200, '铁岭市', 2, 210000),
(211300, '朝阳市', 2, 210000),
(211400, '葫芦岛市', 2, 210000),
(220100, '长春市', 2, 220000),
(220200, '吉林市', 2, 220000),
(220300, '四平市', 2, 220000),
(220400, '辽源市', 2, 220000),
(220500, '通化市', 2, 220000),
(220600, '白山市', 2, 220000),
(220700, '松原市', 2, 220000),
(220800, '白城市', 2, 220000),
(222400, '延边朝鲜族自治州', 2, 220000),
(230100, '哈尔滨市', 2, 230000),
(230200, '齐齐哈尔市', 2, 230000),
(230300, '鸡西市', 2, 230000),
(230400, '鹤岗市', 2, 230000),
(230500, '双鸭山市', 2, 230000),
(230600, '大庆市', 2, 230000),
(230700, '伊春市', 2, 230000),
(230800, '佳木斯市', 2, 230000),
(230900, '七台河市', 2, 230000),
(231000, '牡丹江市', 2, 230000),
(231100, '黑河市', 2, 230000),
(231200, '绥化市', 2, 230000),
(232700, '大兴安岭地区', 2, 230000),
(310100, '市辖区', 2, 310000),
(310200, '县', 2, 310000),
(320100, '南京市', 2, 320000),
(320200, '无锡市', 2, 320000),
(320300, '徐州市', 2, 320000),
(320400, '常州市', 2, 320000),
(320500, '苏州市', 2, 320000),
(320600, '南通市', 2, 320000),
(320700, '连云港市', 2, 320000),
(320800, '淮安市', 2, 320000),
(320900, '盐城市', 2, 320000),
(321000, '扬州市', 2, 320000),
(321100, '镇江市', 2, 320000),
(321200, '泰州市', 2, 320000),
(321300, '宿迁市', 2, 320000),
(330100, '杭州市', 2, 330000),
(330200, '宁波市', 2, 330000),
(330300, '温州市', 2, 330000),
(330400, '嘉兴市', 2, 330000),
(330500, '湖州市', 2, 330000),
(330600, '绍兴市', 2, 330000),
(330700, '金华市', 2, 330000),
(330800, '衢州市', 2, 330000),
(330900, '舟山市', 2, 330000),
(331000, '台州市', 2, 330000),
(331100, '丽水市', 2, 330000),
(340100, '合肥市', 2, 340000),
(340200, '芜湖市', 2, 340000),
(340300, '蚌埠市', 2, 340000),
(340400, '淮南市', 2, 340000),
(340500, '马鞍山市', 2, 340000),
(340600, '淮北市', 2, 340000),
(340700, '铜陵市', 2, 340000),
(340800, '安庆市', 2, 340000),
(341000, '黄山市', 2, 340000),
(341100, '滁州市', 2, 340000),
(341200, '阜阳市', 2, 340000),
(341300, '宿州市', 2, 340000),
(341500, '六安市', 2, 340000),
(341600, '亳州市', 2, 340000),
(341700, '池州市', 2, 340000),
(341800, '宣城市', 2, 340000),
(350100, '福州市', 2, 350000),
(350200, '厦门市', 2, 350000),
(350300, '莆田市', 2, 350000),
(350400, '三明市', 2, 350000),
(350500, '泉州市', 2, 350000),
(350600, '漳州市', 2, 350000),
(350700, '南平市', 2, 350000),
(350800, '龙岩市', 2, 350000),
(350900, '宁德市', 2, 350000),
(360100, '南昌市', 2, 360000),
(360200, '景德镇市', 2, 360000),
(360300, '萍乡市', 2, 360000),
(360400, '九江市', 2, 360000),
(360500, '新余市', 2, 360000),
(360600, '鹰潭市', 2, 360000),
(360700, '赣州市', 2, 360000),
(360800, '吉安市', 2, 360000),
(360900, '宜春市', 2, 360000),
(361000, '抚州市', 2, 360000),
(361100, '上饶市', 2, 360000),
(370100, '济南市', 2, 370000),
(370200, '青岛市', 2, 370000),
(370300, '淄博市', 2, 370000),
(370400, '枣庄市', 2, 370000),
(370500, '东营市', 2, 370000),
(370600, '烟台市', 2, 370000),
(370700, '潍坊市', 2, 370000),
(370800, '济宁市', 2, 370000),
(370900, '泰安市', 2, 370000),
(371000, '威海市', 2, 370000),
(371100, '日照市', 2, 370000),
(371200, '莱芜市', 2, 370000),
(371300, '临沂市', 2, 370000),
(371400, '德州市', 2, 370000),
(371500, '聊城市', 2, 370000),
(371600, '滨州市', 2, 370000),
(371700, '菏泽市', 2, 370000),
(410100, '郑州市', 2, 410000),
(410200, '开封市', 2, 410000),
(410300, '洛阳市', 2, 410000),
(410400, '平顶山市', 2, 410000),
(410500, '安阳市', 2, 410000),
(410600, '鹤壁市', 2, 410000),
(410700, '新乡市', 2, 410000),
(410800, '焦作市', 2, 410000),
(410900, '濮阳市', 2, 410000),
(411000, '许昌市', 2, 410000),
(411100, '漯河市', 2, 410000),
(411200, '三门峡市', 2, 410000),
(411300, '南阳市', 2, 410000),
(411400, '商丘市', 2, 410000),
(411500, '信阳市', 2, 410000),
(411600, '周口市', 2, 410000),
(411700, '驻马店市', 2, 410000),
(420100, '武汉市', 2, 420000),
(420200, '黄石市', 2, 420000),
(420300, '十堰市', 2, 420000),
(420500, '宜昌市', 2, 420000),
(420600, '襄樊市', 2, 420000),
(420700, '鄂州市', 2, 420000),
(420800, '荆门市', 2, 420000),
(420900, '孝感市', 2, 420000),
(421000, '荆州市', 2, 420000),
(421100, '黄冈市', 2, 420000),
(421200, '咸宁市', 2, 420000),
(421300, '随州市', 2, 420000),
(422800, '恩施土家族苗族自治州', 2, 420000),
(429000, '省直辖行政单位', 2, 420000),
(430100, '长沙市', 2, 430000),
(430200, '株洲市', 2, 430000),
(430300, '湘潭市', 2, 430000),
(430400, '衡阳市', 2, 430000),
(430500, '邵阳市', 2, 430000),
(430600, '岳阳市', 2, 430000),
(430700, '常德市', 2, 430000),
(430800, '张家界市', 2, 430000),
(430900, '益阳市', 2, 430000),
(431000, '郴州市', 2, 430000),
(431100, '永州市', 2, 430000),
(431200, '怀化市', 2, 430000),
(431300, '娄底市', 2, 430000),
(433100, '湘西土家族苗族自治州', 2, 430000),
(440100, '广州市', 2, 440000),
(440200, '韶关市', 2, 440000),
(440300, '深圳市', 2, 440000),
(440400, '珠海市', 2, 440000),
(440500, '汕头市', 2, 440000),
(440600, '佛山市', 2, 440000),
(440700, '江门市', 2, 440000),
(440800, '湛江市', 2, 440000),
(440900, '茂名市', 2, 440000),
(441200, '肇庆市', 2, 440000),
(441300, '惠州市', 2, 440000),
(441400, '梅州市', 2, 440000),
(441500, '汕尾市', 2, 440000),
(441600, '河源市', 2, 440000),
(441700, '阳江市', 2, 440000),
(441800, '清远市', 2, 440000),
(441900, '东莞市', 2, 440000),
(442000, '中山市', 2, 440000),
(445100, '潮州市', 2, 440000),
(445200, '揭阳市', 2, 440000),
(445300, '云浮市', 2, 440000),
(450100, '南宁市', 2, 450000),
(450200, '柳州市', 2, 450000),
(450300, '桂林市', 2, 450000),
(450400, '梧州市', 2, 450000),
(450500, '北海市', 2, 450000),
(450600, '防城港市', 2, 450000),
(450700, '钦州市', 2, 450000),
(450800, '贵港市', 2, 450000),
(450900, '玉林市', 2, 450000),
(451000, '百色市', 2, 450000),
(451100, '贺州市', 2, 450000),
(451200, '河池市', 2, 450000),
(451300, '来宾市', 2, 450000),
(451400, '崇左市', 2, 450000),
(460100, '海口市', 2, 460000),
(460200, '三亚市', 2, 460000),
(469000, '省直辖县级行政单位', 2, 460000),
(500100, '市辖区', 2, 500000),
(500200, '县', 2, 500000),
(500300, '市', 2, 500000),
(510100, '成都市', 2, 510000),
(510300, '自贡市', 2, 510000),
(510400, '攀枝花市', 2, 510000),
(510500, '泸州市', 2, 510000),
(510600, '德阳市', 2, 510000),
(510700, '绵阳市', 2, 510000),
(510800, '广元市', 2, 510000),
(510900, '遂宁市', 2, 510000),
(511000, '内江市', 2, 510000),
(511100, '乐山市', 2, 510000),
(511300, '南充市', 2, 510000),
(511400, '眉山市', 2, 510000),
(511500, '宜宾市', 2, 510000),
(511600, '广安市', 2, 510000),
(511700, '达州市', 2, 510000),
(511800, '雅安市', 2, 510000),
(511900, '巴中市', 2, 510000),
(512000, '资阳市', 2, 510000),
(513200, '阿坝藏族羌族自治州', 2, 510000),
(513300, '甘孜藏族自治州', 2, 510000),
(513400, '凉山彝族自治州', 2, 510000),
(520100, '贵阳市', 2, 520000),
(520200, '六盘水市', 2, 520000),
(520300, '遵义市', 2, 520000),
(520400, '安顺市', 2, 520000),
(522200, '铜仁地区', 2, 520000),
(522300, '黔西南布依族苗族自治州', 2, 520000),
(522400, '毕节地区', 2, 520000),
(522600, '黔东南苗族侗族自治州', 2, 520000),
(522700, '黔南布依族苗族自治州', 2, 520000),
(530100, '昆明市', 2, 530000),
(530300, '曲靖市', 2, 530000),
(530400, '玉溪市', 2, 530000),
(530500, '保山市', 2, 530000),
(530600, '昭通市', 2, 530000),
(530700, '丽江市', 2, 530000),
(530800, '思茅市', 2, 530000),
(530900, '临沧市', 2, 530000),
(532300, '楚雄彝族自治州', 2, 530000),
(532500, '红河哈尼族彝族自治州', 2, 530000),
(532600, '文山壮族苗族自治州', 2, 530000),
(532800, '西双版纳傣族自治州', 2, 530000),
(532900, '大理白族自治州', 2, 530000),
(533100, '德宏傣族景颇族自治州', 2, 530000),
(533300, '怒江傈僳族自治州', 2, 530000),
(533400, '迪庆藏族自治州', 2, 530000),
(540100, '拉萨市', 2, 540000),
(542100, '昌都地区', 2, 540000),
(542200, '山南地区', 2, 540000),
(542300, '日喀则地区', 2, 540000),
(542400, '那曲地区', 2, 540000),
(542500, '阿里地区', 2, 540000),
(542600, '林芝地区', 2, 540000),
(610100, '西安市', 2, 610000),
(610200, '铜川市', 2, 610000),
(610300, '宝鸡市', 2, 610000),
(610400, '咸阳市', 2, 610000),
(610500, '渭南市', 2, 610000),
(610600, '延安市', 2, 610000),
(610700, '汉中市', 2, 610000),
(610800, '榆林市', 2, 610000),
(610900, '安康市', 2, 610000),
(611000, '商洛市', 2, 610000),
(620100, '兰州市', 2, 620000),
(620200, '嘉峪关市', 2, 620000),
(620300, '金昌市', 2, 620000),
(620400, '白银市', 2, 620000),
(620500, '天水市', 2, 620000),
(620600, '武威市', 2, 620000),
(620700, '张掖市', 2, 620000),
(620800, '平凉市', 2, 620000),
(620900, '酒泉市', 2, 620000),
(621000, '庆阳市', 2, 620000),
(621100, '定西市', 2, 620000),
(621200, '陇南市', 2, 620000),
(622900, '临夏回族自治州', 2, 620000),
(623000, '甘南藏族自治州', 2, 620000),
(630100, '西宁市', 2, 630000),
(632100, '海东地区', 2, 630000),
(632200, '海北藏族自治州', 2, 630000),
(632300, '黄南藏族自治州', 2, 630000),
(632500, '海南藏族自治州', 2, 630000),
(632600, '果洛藏族自治州', 2, 630000),
(632700, '玉树藏族自治州', 2, 630000),
(632800, '海西蒙古族藏族自治州', 2, 630000),
(640100, '银川市', 2, 640000),
(640200, '石嘴山市', 2, 640000),
(640300, '吴忠市', 2, 640000),
(640400, '固原市', 2, 640000),
(640500, '中卫市', 2, 640000),
(650100, '乌鲁木齐市', 2, 650000),
(650200, '克拉玛依市', 2, 650000),
(652100, '吐鲁番地区', 2, 650000),
(652200, '哈密地区', 2, 650000),
(652300, '昌吉回族自治州', 2, 650000),
(652700, '博尔塔拉蒙古自治州', 2, 650000),
(652800, '巴音郭楞蒙古自治州', 2, 650000),
(652900, '阿克苏地区', 2, 650000),
(653000, '克孜勒苏柯尔克孜自治州', 2, 650000),
(653100, '喀什地区', 2, 650000),
(653200, '和田地区', 2, 650000),
(654000, '伊犁哈萨克自治州', 2, 650000),
(654200, '塔城地区', 2, 650000),
(654300, '阿勒泰地区', 2, 650000),
(659000, '省直辖行政单位', 2, 650000),
(110101, '东城区', 3, 110100),
(110102, '西城区', 3, 110100),
(110103, '崇文区', 3, 110100),
(110104, '宣武区', 3, 110100),
(110105, '朝阳区', 3, 110100),
(110106, '丰台区', 3, 110100),
(110107, '石景山区', 3, 110100),
(110108, '海淀区', 3, 110100),
(110109, '门头沟区', 3, 110100),
(110111, '房山区', 3, 110100),
(110112, '通州区', 3, 110100),
(110113, '顺义区', 3, 110100),
(110114, '昌平区', 3, 110100),
(110115, '大兴区', 3, 110100),
(110116, '怀柔区', 3, 110100),
(110117, '平谷区', 3, 110100),
(110228, '密云县', 3, 110200),
(110229, '延庆县', 3, 110200),
(120101, '和平区', 3, 120100),
(120102, '河东区', 3, 120100),
(120103, '河西区', 3, 120100),
(120104, '南开区', 3, 120100),
(120105, '河北区', 3, 120100),
(120106, '红桥区', 3, 120100),
(120107, '塘沽区', 3, 120100),
(120108, '汉沽区', 3, 120100),
(120109, '大港区', 3, 120100),
(120110, '东丽区', 3, 120100),
(120111, '西青区', 3, 120100),
(120112, '津南区', 3, 120100),
(120113, '北辰区', 3, 120100),
(120114, '武清区', 3, 120100),
(120115, '宝坻区', 3, 120100),
(120221, '宁河县', 3, 120200),
(120223, '静海县', 3, 120200),
(120225, '蓟 县', 3, 120200),
(130101, '市辖区', 3, 130100),
(130102, '长安区', 3, 130100),
(130103, '桥东区', 3, 130100),
(130104, '桥西区', 3, 130100),
(130105, '新华区', 3, 130100),
(130107, '井陉矿区', 3, 130100),
(130108, '裕华区', 3, 130100),
(130121, '井陉县', 3, 130100),
(130123, '正定县', 3, 130100),
(130124, '栾城县', 3, 130100),
(130125, '行唐县', 3, 130100),
(130126, '灵寿县', 3, 130100),
(130127, '高邑县', 3, 130100),
(130128, '深泽县', 3, 130100),
(130129, '赞皇县', 3, 130100),
(130130, '无极县', 3, 130100),
(130131, '平山县', 3, 130100),
(130132, '元氏县', 3, 130100),
(130133, '赵 县', 3, 130100),
(130181, '辛集市', 3, 130100),
(130182, '藁城市', 3, 130100),
(130183, '晋州市', 3, 130100),
(130184, '新乐市', 3, 130100),
(130185, '鹿泉市', 3, 130100),
(130201, '市辖区', 3, 130200),
(130202, '路南区', 3, 130200),
(130203, '路北区', 3, 130200),
(130204, '古冶区', 3, 130200),
(130205, '开平区', 3, 130200),
(130207, '丰南区', 3, 130200),
(130208, '丰润区', 3, 130200),
(130223, '滦 县', 3, 130200),
(130224, '滦南县', 3, 130200),
(130225, '乐亭县', 3, 130200),
(130227, '迁西县', 3, 130200),
(130229, '玉田县', 3, 130200),
(130230, '唐海县', 3, 130200),
(130281, '遵化市', 3, 130200),
(130283, '迁安市', 3, 130200),
(130301, '市辖区', 3, 130300),
(130302, '海港区', 3, 130300),
(130303, '山海关区', 3, 130300),
(130304, '北戴河区', 3, 130300),
(130321, '青龙满族自治县', 3, 130300),
(130322, '昌黎县', 3, 130300),
(130323, '抚宁县', 3, 130300),
(130324, '卢龙县', 3, 130300),
(130401, '市辖区', 3, 130400),
(130402, '邯山区', 3, 130400),
(130403, '丛台区', 3, 130400),
(130404, '复兴区', 3, 130400),
(130406, '峰峰矿区', 3, 130400),
(130421, '邯郸县', 3, 130400),
(130423, '临漳县', 3, 130400),
(130424, '成安县', 3, 130400),
(130425, '大名县', 3, 130400),
(130426, '涉 县', 3, 130400),
(130427, '磁 县', 3, 130400),
(130428, '肥乡县', 3, 130400),
(130429, '永年县', 3, 130400),
(130430, '邱 县', 3, 130400),
(130431, '鸡泽县', 3, 130400),
(130432, '广平县', 3, 130400),
(130433, '馆陶县', 3, 130400),
(130434, '魏 县', 3, 130400),
(130435, '曲周县', 3, 130400),
(130481, '武安市', 3, 130400),
(130501, '市辖区', 3, 130500),
(130502, '桥东区', 3, 130500),
(130503, '桥西区', 3, 130500),
(130521, '邢台县', 3, 130500),
(130522, '临城县', 3, 130500),
(130523, '内丘县', 3, 130500),
(130524, '柏乡县', 3, 130500),
(130525, '隆尧县', 3, 130500),
(130526, '任 县', 3, 130500),
(130527, '南和县', 3, 130500),
(130528, '宁晋县', 3, 130500),
(130529, '巨鹿县', 3, 130500),
(130530, '新河县', 3, 130500),
(130531, '广宗县', 3, 130500),
(130532, '平乡县', 3, 130500),
(130533, '威 县', 3, 130500),
(130534, '清河县', 3, 130500),
(130535, '临西县', 3, 130500),
(130581, '南宫市', 3, 130500),
(130582, '沙河市', 3, 130500),
(130601, '市辖区', 3, 130600),
(130602, '新市区', 3, 130600),
(130603, '北市区', 3, 130600),
(130604, '南市区', 3, 130600),
(130621, '满城县', 3, 130600),
(130622, '清苑县', 3, 130600),
(130623, '涞水县', 3, 130600),
(130624, '阜平县', 3, 130600),
(130625, '徐水县', 3, 130600),
(130626, '定兴县', 3, 130600),
(130627, '唐 县', 3, 130600),
(130628, '高阳县', 3, 130600),
(130629, '容城县', 3, 130600),
(130630, '涞源县', 3, 130600),
(130631, '望都县', 3, 130600),
(130632, '安新县', 3, 130600),
(130633, '易 县', 3, 130600),
(130634, '曲阳县', 3, 130600),
(130635, '蠡 县', 3, 130600),
(130636, '顺平县', 3, 130600),
(130637, '博野县', 3, 130600),
(130638, '雄 县', 3, 130600),
(130681, '涿州市', 3, 130600),
(130682, '定州市', 3, 130600),
(130683, '安国市', 3, 130600),
(130684, '高碑店市', 3, 130600),
(130701, '市辖区', 3, 130700),
(130702, '桥东区', 3, 130700),
(130703, '桥西区', 3, 130700),
(130705, '宣化区', 3, 130700),
(130706, '下花园区', 3, 130700),
(130721, '宣化县', 3, 130700),
(130722, '张北县', 3, 130700),
(130723, '康保县', 3, 130700),
(130724, '沽源县', 3, 130700),
(130725, '尚义县', 3, 130700),
(130726, '蔚 县', 3, 130700),
(130727, '阳原县', 3, 130700),
(130728, '怀安县', 3, 130700),
(130729, '万全县', 3, 130700),
(130730, '怀来县', 3, 130700),
(130731, '涿鹿县', 3, 130700),
(130732, '赤城县', 3, 130700),
(130733, '崇礼县', 3, 130700),
(130801, '市辖区', 3, 130800),
(130802, '双桥区', 3, 130800),
(130803, '双滦区', 3, 130800),
(130804, '鹰手营子矿区', 3, 130800),
(130821, '承德县', 3, 130800),
(130822, '兴隆县', 3, 130800),
(130823, '平泉县', 3, 130800),
(130824, '滦平县', 3, 130800),
(130825, '隆化县', 3, 130800),
(130826, '丰宁满族自治县', 3, 130800),
(130827, '宽城满族自治县', 3, 130800),
(130828, '围场满族蒙古族自治县', 3, 130800),
(130901, '市辖区', 3, 130900),
(130902, '新华区', 3, 130900),
(130903, '运河区', 3, 130900),
(130921, '沧 县', 3, 130900),
(130922, '青 县', 3, 130900),
(130923, '东光县', 3, 130900),
(130924, '海兴县', 3, 130900),
(130925, '盐山县', 3, 130900),
(130926, '肃宁县', 3, 130900),
(130927, '南皮县', 3, 130900),
(130928, '吴桥县', 3, 130900),
(130929, '献 县', 3, 130900),
(130930, '孟村回族自治县', 3, 130900),
(130981, '泊头市', 3, 130900),
(130982, '任丘市', 3, 130900),
(130983, '黄骅市', 3, 130900),
(130984, '河间市', 3, 130900),
(131001, '市辖区', 3, 131000),
(131002, '安次区', 3, 131000),
(131003, '广阳区', 3, 131000),
(131022, '固安县', 3, 131000),
(131023, '永清县', 3, 131000),
(131024, '香河县', 3, 131000),
(131025, '大城县', 3, 131000),
(131026, '文安县', 3, 131000),
(131028, '大厂回族自治县', 3, 131000),
(131081, '霸州市', 3, 131000),
(131082, '三河市', 3, 131000),
(131101, '市辖区', 3, 131100),
(131102, '桃城区', 3, 131100),
(131121, '枣强县', 3, 131100),
(131122, '武邑县', 3, 131100),
(131123, '武强县', 3, 131100),
(131124, '饶阳县', 3, 131100),
(131125, '安平县', 3, 131100),
(131126, '故城县', 3, 131100),
(131127, '景 县', 3, 131100),
(131128, '阜城县', 3, 131100),
(131181, '冀州市', 3, 131100),
(131182, '深州市', 3, 131100),
(140101, '市辖区', 3, 140100),
(140105, '小店区', 3, 140100),
(140106, '迎泽区', 3, 140100),
(140107, '杏花岭区', 3, 140100),
(140108, '尖草坪区', 3, 140100),
(140109, '万柏林区', 3, 140100),
(140110, '晋源区', 3, 140100),
(140121, '清徐县', 3, 140100),
(140122, '阳曲县', 3, 140100),
(140123, '娄烦县', 3, 140100),
(140181, '古交市', 3, 140100),
(140201, '市辖区', 3, 140200),
(140202, '城 区', 3, 140200),
(140203, '矿 区', 3, 140200),
(140211, '南郊区', 3, 140200),
(140212, '新荣区', 3, 140200),
(140221, '阳高县', 3, 140200),
(140222, '天镇县', 3, 140200),
(140223, '广灵县', 3, 140200),
(140224, '灵丘县', 3, 140200),
(140225, '浑源县', 3, 140200),
(140226, '左云县', 3, 140200),
(140227, '大同县', 3, 140200),
(140301, '市辖区', 3, 140300),
(140302, '城 区', 3, 140300),
(140303, '矿 区', 3, 140300),
(140311, '郊 区', 3, 140300),
(140321, '平定县', 3, 140300),
(140322, '盂 县', 3, 140300),
(140401, '市辖区', 3, 140400),
(140402, '城 区', 3, 140400),
(140411, '郊 区', 3, 140400),
(140421, '长治县', 3, 140400),
(140423, '襄垣县', 3, 140400),
(140424, '屯留县', 3, 140400),
(140425, '平顺县', 3, 140400),
(140426, '黎城县', 3, 140400),
(140427, '壶关县', 3, 140400),
(140428, '长子县', 3, 140400),
(140429, '武乡县', 3, 140400),
(140430, '沁 县', 3, 140400),
(140431, '沁源县', 3, 140400),
(140481, '潞城市', 3, 140400),
(140501, '市辖区', 3, 140500),
(140502, '城 区', 3, 140500),
(140521, '沁水县', 3, 140500),
(140522, '阳城县', 3, 140500),
(140524, '陵川县', 3, 140500),
(140525, '泽州县', 3, 140500),
(140581, '高平市', 3, 140500),
(140601, '市辖区', 3, 140600),
(140602, '朔城区', 3, 140600),
(140603, '平鲁区', 3, 140600),
(140621, '山阴县', 3, 140600),
(140622, '应 县', 3, 140600),
(140623, '右玉县', 3, 140600),
(140624, '怀仁县', 3, 140600),
(140701, '市辖区', 3, 140700),
(140702, '榆次区', 3, 140700),
(140721, '榆社县', 3, 140700),
(140722, '左权县', 3, 140700),
(140723, '和顺县', 3, 140700),
(140724, '昔阳县', 3, 140700),
(140725, '寿阳县', 3, 140700),
(140726, '太谷县', 3, 140700),
(140727, '祁 县', 3, 140700),
(140728, '平遥县', 3, 140700),
(140729, '灵石县', 3, 140700),
(140781, '介休市', 3, 140700),
(140801, '市辖区', 3, 140800),
(140802, '盐湖区', 3, 140800),
(140821, '临猗县', 3, 140800),
(140822, '万荣县', 3, 140800),
(140823, '闻喜县', 3, 140800),
(140824, '稷山县', 3, 140800),
(140825, '新绛县', 3, 140800),
(140826, '绛 县', 3, 140800),
(140827, '垣曲县', 3, 140800),
(140828, '夏 县', 3, 140800),
(140829, '平陆县', 3, 140800),
(140830, '芮城县', 3, 140800),
(140881, '永济市', 3, 140800),
(140882, '河津市', 3, 140800),
(140901, '市辖区', 3, 140900),
(140902, '忻府区', 3, 140900),
(140921, '定襄县', 3, 140900),
(140922, '五台县', 3, 140900),
(140923, '代 县', 3, 140900),
(140924, '繁峙县', 3, 140900),
(140925, '宁武县', 3, 140900),
(140926, '静乐县', 3, 140900),
(140927, '神池县', 3, 140900),
(140928, '五寨县', 3, 140900),
(140929, '岢岚县', 3, 140900),
(140930, '河曲县', 3, 140900),
(140931, '保德县', 3, 140900),
(140932, '偏关县', 3, 140900),
(140981, '原平市', 3, 140900),
(141001, '市辖区', 3, 141000),
(141002, '尧都区', 3, 141000),
(141021, '曲沃县', 3, 141000),
(141022, '翼城县', 3, 141000),
(141023, '襄汾县', 3, 141000),
(141024, '洪洞县', 3, 141000),
(141025, '古 县', 3, 141000),
(141026, '安泽县', 3, 141000),
(141027, '浮山县', 3, 141000),
(141028, '吉 县', 3, 141000),
(141029, '乡宁县', 3, 141000),
(141030, '大宁县', 3, 141000),
(141031, '隰 县', 3, 141000),
(141032, '永和县', 3, 141000),
(141033, '蒲 县', 3, 141000),
(141034, '汾西县', 3, 141000),
(141081, '侯马市', 3, 141000),
(141082, '霍州市', 3, 141000),
(141101, '市辖区', 3, 141100),
(141102, '离石区', 3, 141100),
(141121, '文水县', 3, 141100),
(141122, '交城县', 3, 141100),
(141123, '兴 县', 3, 141100),
(141124, '临 县', 3, 141100),
(141125, '柳林县', 3, 141100),
(141126, '石楼县', 3, 141100),
(141127, '岚 县', 3, 141100),
(141128, '方山县', 3, 141100),
(141129, '中阳县', 3, 141100),
(141130, '交口县', 3, 141100),
(141181, '孝义市', 3, 141100),
(141182, '汾阳市', 3, 141100),
(150101, '市辖区', 3, 150100),
(150102, '新城区', 3, 150100),
(150103, '回民区', 3, 150100),
(150104, '玉泉区', 3, 150100),
(150105, '赛罕区', 3, 150100),
(150121, '土默特左旗', 3, 150100),
(150122, '托克托县', 3, 150100),
(150123, '和林格尔县', 3, 150100),
(150124, '清水河县', 3, 150100),
(150125, '武川县', 3, 150100),
(150201, '市辖区', 3, 150200),
(150202, '东河区', 3, 150200),
(150203, '昆都仑区', 3, 150200),
(150204, '青山区', 3, 150200),
(150205, '石拐区', 3, 150200),
(150206, '白云矿区', 3, 150200),
(150207, '九原区', 3, 150200),
(150221, '土默特右旗', 3, 150200),
(150222, '固阳县', 3, 150200),
(150223, '达尔罕茂明安联合旗', 3, 150200),
(150301, '市辖区', 3, 150300),
(150302, '海勃湾区', 3, 150300),
(150303, '海南区', 3, 150300),
(150304, '乌达区', 3, 150300),
(150401, '市辖区', 3, 150400),
(150402, '红山区', 3, 150400),
(150403, '元宝山区', 3, 150400),
(150404, '松山区', 3, 150400),
(150421, '阿鲁科尔沁旗', 3, 150400),
(150422, '巴林左旗', 3, 150400),
(150423, '巴林右旗', 3, 150400),
(150424, '林西县', 3, 150400),
(150425, '克什克腾旗', 3, 150400),
(150426, '翁牛特旗', 3, 150400),
(150428, '喀喇沁旗', 3, 150400),
(150429, '宁城县', 3, 150400),
(150430, '敖汉旗', 3, 150400),
(150501, '市辖区', 3, 150500),
(150502, '科尔沁区', 3, 150500),
(150521, '科尔沁左翼中旗', 3, 150500),
(150522, '科尔沁左翼后旗', 3, 150500),
(150523, '开鲁县', 3, 150500),
(150524, '库伦旗', 3, 150500),
(150525, '奈曼旗', 3, 150500),
(150526, '扎鲁特旗', 3, 150500),
(150581, '霍林郭勒市', 3, 150500),
(150602, '东胜区', 3, 150600),
(150621, '达拉特旗', 3, 150600),
(150622, '准格尔旗', 3, 150600),
(150623, '鄂托克前旗', 3, 150600),
(150624, '鄂托克旗', 3, 150600),
(150625, '杭锦旗', 3, 150600),
(150626, '乌审旗', 3, 150600),
(150627, '伊金霍洛旗', 3, 150600),
(150701, '市辖区', 3, 150700),
(150702, '海拉尔区', 3, 150700),
(150721, '阿荣旗', 3, 150700),
(150722, '莫力达瓦达斡尔族自治旗', 3, 150700),
(150723, '鄂伦春自治旗', 3, 150700),
(150724, '鄂温克族自治旗', 3, 150700),
(150725, '陈巴尔虎旗', 3, 150700),
(150726, '新巴尔虎左旗', 3, 150700),
(150727, '新巴尔虎右旗', 3, 150700),
(150781, '满洲里市', 3, 150700),
(150782, '牙克石市', 3, 150700),
(150783, '扎兰屯市', 3, 150700),
(150784, '额尔古纳市', 3, 150700),
(150785, '根河市', 3, 150700),
(150801, '市辖区', 3, 150800),
(150802, '临河区', 3, 150800),
(150821, '五原县', 3, 150800),
(150822, '磴口县', 3, 150800),
(150823, '乌拉特前旗', 3, 150800),
(150824, '乌拉特中旗', 3, 150800),
(150825, '乌拉特后旗', 3, 150800),
(150826, '杭锦后旗', 3, 150800),
(150901, '市辖区', 3, 150900),
(150902, '集宁区', 3, 150900),
(150921, '卓资县', 3, 150900),
(150922, '化德县', 3, 150900),
(150923, '商都县', 3, 150900),
(150924, '兴和县', 3, 150900),
(150925, '凉城县', 3, 150900),
(150926, '察哈尔右翼前旗', 3, 150900),
(150927, '察哈尔右翼中旗', 3, 150900),
(150928, '察哈尔右翼后旗', 3, 150900),
(150929, '四子王旗', 3, 150900),
(150981, '丰镇市', 3, 150900),
(152201, '乌兰浩特市', 3, 152200),
(152202, '阿尔山市', 3, 152200),
(152221, '科尔沁右翼前旗', 3, 152200),
(152222, '科尔沁右翼中旗', 3, 152200),
(152223, '扎赉特旗', 3, 152200),
(152224, '突泉县', 3, 152200),
(152501, '二连浩特市', 3, 152500),
(152502, '锡林浩特市', 3, 152500),
(152522, '阿巴嘎旗', 3, 152500),
(152523, '苏尼特左旗', 3, 152500),
(152524, '苏尼特右旗', 3, 152500),
(152525, '东乌珠穆沁旗', 3, 152500),
(152526, '西乌珠穆沁旗', 3, 152500),
(152527, '太仆寺旗', 3, 152500),
(152528, '镶黄旗', 3, 152500),
(152529, '正镶白旗', 3, 152500),
(152530, '正蓝旗', 3, 152500),
(152531, '多伦县', 3, 152500),
(152921, '阿拉善左旗', 3, 152900),
(152922, '阿拉善右旗', 3, 152900),
(152923, '额济纳旗', 3, 152900),
(210101, '市辖区', 3, 210100),
(210102, '和平区', 3, 210100),
(210103, '沈河区', 3, 210100),
(210104, '大东区', 3, 210100),
(210105, '皇姑区', 3, 210100),
(210106, '铁西区', 3, 210100),
(210111, '苏家屯区', 3, 210100),
(210112, '东陵区', 3, 210100),
(210113, '新城子区', 3, 210100),
(210114, '于洪区', 3, 210100),
(210122, '辽中县', 3, 210100),
(210123, '康平县', 3, 210100),
(210124, '法库县', 3, 210100),
(210181, '新民市', 3, 210100),
(210201, '市辖区', 3, 210200),
(210202, '中山区', 3, 210200),
(210203, '西岗区', 3, 210200),
(210204, '沙河口区', 3, 210200),
(210211, '甘井子区', 3, 210200),
(210212, '旅顺口区', 3, 210200),
(210213, '金州区', 3, 210200),
(210224, '长海县', 3, 210200),
(210281, '瓦房店市', 3, 210200),
(210282, '普兰店市', 3, 210200),
(210283, '庄河市', 3, 210200),
(210301, '市辖区', 3, 210300),
(210302, '铁东区', 3, 210300),
(210303, '铁西区', 3, 210300),
(210304, '立山区', 3, 210300),
(210311, '千山区', 3, 210300),
(210321, '台安县', 3, 210300),
(210323, '岫岩满族自治县', 3, 210300),
(210381, '海城市', 3, 210300),
(210401, '市辖区', 3, 210400),
(210402, '新抚区', 3, 210400),
(210403, '东洲区', 3, 210400),
(210404, '望花区', 3, 210400),
(210411, '顺城区', 3, 210400),
(210421, '抚顺县', 3, 210400),
(210422, '新宾满族自治县', 3, 210400),
(210423, '清原满族自治县', 3, 210400),
(210501, '市辖区', 3, 210500),
(210502, '平山区', 3, 210500),
(210503, '溪湖区', 3, 210500),
(210504, '明山区', 3, 210500),
(210505, '南芬区', 3, 210500),
(210521, '本溪满族自治县', 3, 210500),
(210522, '桓仁满族自治县', 3, 210500),
(210601, '市辖区', 3, 210600),
(210602, '元宝区', 3, 210600),
(210603, '振兴区', 3, 210600),
(210604, '振安区', 3, 210600),
(210624, '宽甸满族自治县', 3, 210600),
(210681, '东港市', 3, 210600),
(210682, '凤城市', 3, 210600),
(210701, '市辖区', 3, 210700),
(210702, '古塔区', 3, 210700),
(210703, '凌河区', 3, 210700),
(210711, '太和区', 3, 210700),
(210726, '黑山县', 3, 210700),
(210727, '义 县', 3, 210700),
(210781, '凌海市', 3, 210700),
(210782, '北宁市', 3, 210700),
(210801, '市辖区', 3, 210800),
(210802, '站前区', 3, 210800),
(210803, '西市区', 3, 210800),
(210804, '鲅鱼圈区', 3, 210800),
(210811, '老边区', 3, 210800),
(210881, '盖州市', 3, 210800),
(210882, '大石桥市', 3, 210800),
(210901, '市辖区', 3, 210900),
(210902, '海州区', 3, 210900),
(210903, '新邱区', 3, 210900),
(210904, '太平区', 3, 210900),
(210905, '清河门区', 3, 210900),
(210911, '细河区', 3, 210900),
(210921, '阜新蒙古族自治县', 3, 210900),
(210922, '彰武县', 3, 210900),
(211001, '市辖区', 3, 211000),
(211002, '白塔区', 3, 211000),
(211003, '文圣区', 3, 211000),
(211004, '宏伟区', 3, 211000),
(211005, '弓长岭区', 3, 211000),
(211011, '太子河区', 3, 211000),
(211021, '辽阳县', 3, 211000),
(211081, '灯塔市', 3, 211000),
(211101, '市辖区', 3, 211100),
(211102, '双台子区', 3, 211100),
(211103, '兴隆台区', 3, 211100),
(211121, '大洼县', 3, 211100),
(211122, '盘山县', 3, 211100),
(211201, '市辖区', 3, 211200),
(211202, '银州区', 3, 211200),
(211204, '清河区', 3, 211200),
(211221, '铁岭县', 3, 211200),
(211223, '西丰县', 3, 211200),
(211224, '昌图县', 3, 211200),
(211281, '调兵山市', 3, 211200),
(211282, '开原市', 3, 211200),
(211301, '市辖区', 3, 211300),
(211302, '双塔区', 3, 211300),
(211303, '龙城区', 3, 211300),
(211321, '朝阳县', 3, 211300),
(211322, '建平县', 3, 211300),
(211324, '喀喇沁左翼蒙古族自治县', 3, 211300),
(211381, '北票市', 3, 211300),
(211382, '凌源市', 3, 211300),
(211401, '市辖区', 3, 211400),
(211402, '连山区', 3, 211400),
(211403, '龙港区', 3, 211400),
(211404, '南票区', 3, 211400),
(211421, '绥中县', 3, 211400),
(211422, '建昌县', 3, 211400),
(211481, '兴城市', 3, 211400),
(220101, '市辖区', 3, 220100),
(220102, '南关区', 3, 220100),
(220103, '宽城区', 3, 220100),
(220104, '朝阳区', 3, 220100),
(220105, '二道区', 3, 220100),
(220106, '绿园区', 3, 220100),
(220112, '双阳区', 3, 220100),
(220122, '农安县', 3, 220100),
(220181, '九台市', 3, 220100),
(220182, '榆树市', 3, 220100),
(220183, '德惠市', 3, 220100),
(220201, '市辖区', 3, 220200),
(220202, '昌邑区', 3, 220200),
(220203, '龙潭区', 3, 220200),
(220204, '船营区', 3, 220200),
(220211, '丰满区', 3, 220200),
(220221, '永吉县', 3, 220200),
(220281, '蛟河市', 3, 220200),
(220282, '桦甸市', 3, 220200),
(220283, '舒兰市', 3, 220200),
(220284, '磐石市', 3, 220200),
(220301, '市辖区', 3, 220300),
(220302, '铁西区', 3, 220300),
(220303, '铁东区', 3, 220300),
(220322, '梨树县', 3, 220300),
(220323, '伊通满族自治县', 3, 220300),
(220381, '公主岭市', 3, 220300),
(220382, '双辽市', 3, 220300),
(220401, '市辖区', 3, 220400),
(220402, '龙山区', 3, 220400),
(220403, '西安区', 3, 220400),
(220421, '东丰县', 3, 220400),
(220422, '东辽县', 3, 220400),
(220501, '市辖区', 3, 220500),
(220502, '东昌区', 3, 220500),
(220503, '二道江区', 3, 220500),
(220521, '通化县', 3, 220500),
(220523, '辉南县', 3, 220500),
(220524, '柳河县', 3, 220500),
(220581, '梅河口市', 3, 220500),
(220582, '集安市', 3, 220500),
(220601, '市辖区', 3, 220600),
(220602, '八道江区', 3, 220600),
(220621, '抚松县', 3, 220600),
(220622, '靖宇县', 3, 220600),
(220623, '长白朝鲜族自治县', 3, 220600),
(220625, '江源县', 3, 220600),
(220681, '临江市', 3, 220600),
(220701, '市辖区', 3, 220700),
(220702, '宁江区', 3, 220700),
(220721, '前郭尔罗斯蒙古族自治县', 3, 220700),
(220722, '长岭县', 3, 220700),
(220723, '乾安县', 3, 220700),
(220724, '扶余县', 3, 220700),
(220801, '市辖区', 3, 220800),
(220802, '洮北区', 3, 220800),
(220821, '镇赉县', 3, 220800),
(220822, '通榆县', 3, 220800),
(220881, '洮南市', 3, 220800),
(220882, '大安市', 3, 220800),
(222401, '延吉市', 3, 222400),
(222402, '图们市', 3, 222400),
(222403, '敦化市', 3, 222400),
(222404, '珲春市', 3, 222400),
(222405, '龙井市', 3, 222400),
(222406, '和龙市', 3, 222400),
(222424, '汪清县', 3, 222400),
(222426, '安图县', 3, 222400),
(230101, '市辖区', 3, 230100),
(230102, '道里区', 3, 230100),
(230103, '南岗区', 3, 230100),
(230104, '道外区', 3, 230100),
(230106, '香坊区', 3, 230100),
(230107, '动力区', 3, 230100),
(230108, '平房区', 3, 230100),
(230109, '松北区', 3, 230100),
(230111, '呼兰区', 3, 230100),
(230123, '依兰县', 3, 230100),
(230124, '方正县', 3, 230100),
(230125, '宾 县', 3, 230100),
(230126, '巴彦县', 3, 230100),
(230127, '木兰县', 3, 230100),
(230128, '通河县', 3, 230100),
(230129, '延寿县', 3, 230100),
(230181, '阿城市', 3, 230100),
(230182, '双城市', 3, 230100),
(230183, '尚志市', 3, 230100),
(230184, '五常市', 3, 230100),
(230201, '市辖区', 3, 230200),
(230202, '龙沙区', 3, 230200),
(230203, '建华区', 3, 230200),
(230204, '铁锋区', 3, 230200),
(230205, '昂昂溪区', 3, 230200),
(230206, '富拉尔基区', 3, 230200),
(230207, '碾子山区', 3, 230200),
(230208, '梅里斯达斡尔族区', 3, 230200),
(230221, '龙江县', 3, 230200),
(230223, '依安县', 3, 230200),
(230224, '泰来县', 3, 230200),
(230225, '甘南县', 3, 230200),
(230227, '富裕县', 3, 230200),
(230229, '克山县', 3, 230200),
(230230, '克东县', 3, 230200),
(230231, '拜泉县', 3, 230200),
(230281, '讷河市', 3, 230200),
(230301, '市辖区', 3, 230300),
(230302, '鸡冠区', 3, 230300),
(230303, '恒山区', 3, 230300),
(230304, '滴道区', 3, 230300),
(230305, '梨树区', 3, 230300),
(230306, '城子河区', 3, 230300),
(230307, '麻山区', 3, 230300),
(230321, '鸡东县', 3, 230300),
(230381, '虎林市', 3, 230300),
(230382, '密山市', 3, 230300),
(230401, '市辖区', 3, 230400),
(230402, '向阳区', 3, 230400),
(230403, '工农区', 3, 230400),
(230404, '南山区', 3, 230400),
(230405, '兴安区', 3, 230400),
(230406, '东山区', 3, 230400),
(230407, '兴山区', 3, 230400),
(230421, '萝北县', 3, 230400),
(230422, '绥滨县', 3, 230400),
(230501, '市辖区', 3, 230500),
(230502, '尖山区', 3, 230500),
(230503, '岭东区', 3, 230500),
(230505, '四方台区', 3, 230500),
(230506, '宝山区', 3, 230500),
(230521, '集贤县', 3, 230500),
(230522, '友谊县', 3, 230500),
(230523, '宝清县', 3, 230500),
(230524, '饶河县', 3, 230500),
(230601, '市辖区', 3, 230600),
(230602, '萨尔图区', 3, 230600),
(230603, '龙凤区', 3, 230600),
(230604, '让胡路区', 3, 230600),
(230605, '红岗区', 3, 230600),
(230606, '大同区', 3, 230600),
(230621, '肇州县', 3, 230600),
(230622, '肇源县', 3, 230600),
(230623, '林甸县', 3, 230600),
(230624, '杜尔伯特蒙古族自治县', 3, 230600),
(230701, '市辖区', 3, 230700),
(230702, '伊春区', 3, 230700),
(230703, '南岔区', 3, 230700),
(230704, '友好区', 3, 230700),
(230705, '西林区', 3, 230700),
(230706, '翠峦区', 3, 230700),
(230707, '新青区', 3, 230700),
(230708, '美溪区', 3, 230700),
(230709, '金山屯区', 3, 230700),
(230710, '五营区', 3, 230700),
(230711, '乌马河区', 3, 230700),
(230712, '汤旺河区', 3, 230700),
(230713, '带岭区', 3, 230700),
(230714, '乌伊岭区', 3, 230700),
(230715, '红星区', 3, 230700),
(230716, '上甘岭区', 3, 230700),
(230722, '嘉荫县', 3, 230700),
(230781, '铁力市', 3, 230700),
(230801, '市辖区', 3, 230800),
(230802, '永红区', 3, 230800),
(230803, '向阳区', 3, 230800),
(230804, '前进区', 3, 230800),
(230805, '东风区', 3, 230800),
(230811, '郊 区', 3, 230800),
(230822, '桦南县', 3, 230800),
(230826, '桦川县', 3, 230800),
(230828, '汤原县', 3, 230800),
(230833, '抚远县', 3, 230800),
(230881, '同江市', 3, 230800),
(230882, '富锦市', 3, 230800),
(230901, '市辖区', 3, 230900),
(230902, '新兴区', 3, 230900),
(230903, '桃山区', 3, 230900),
(230904, '茄子河区', 3, 230900),
(230921, '勃利县', 3, 230900),
(231001, '市辖区', 3, 231000),
(231002, '东安区', 3, 231000),
(231003, '阳明区', 3, 231000),
(231004, '爱民区', 3, 231000),
(231005, '西安区', 3, 231000),
(231024, '东宁县', 3, 231000),
(231025, '林口县', 3, 231000),
(231081, '绥芬河市', 3, 231000),
(231083, '海林市', 3, 231000),
(231084, '宁安市', 3, 231000),
(231085, '穆棱市', 3, 231000),
(231101, '市辖区', 3, 231100),
(231102, '爱辉区', 3, 231100),
(231121, '嫩江县', 3, 231100),
(231123, '逊克县', 3, 231100),
(231124, '孙吴县', 3, 231100),
(231181, '北安市', 3, 231100),
(231182, '五大连池市', 3, 231100),
(231201, '市辖区', 3, 231200),
(231202, '北林区', 3, 231200),
(231221, '望奎县', 3, 231200),
(231222, '兰西县', 3, 231200),
(231223, '青冈县', 3, 231200),
(231224, '庆安县', 3, 231200),
(231225, '明水县', 3, 231200),
(231226, '绥棱县', 3, 231200),
(231281, '安达市', 3, 231200),
(231282, '肇东市', 3, 231200),
(231283, '海伦市', 3, 231200),
(232721, '呼玛县', 3, 232700),
(232722, '塔河县', 3, 232700),
(232723, '漠河县', 3, 232700),
(310101, '黄浦区', 3, 310100),
(310103, '卢湾区', 3, 310100),
(310104, '徐汇区', 3, 310100),
(310105, '长宁区', 3, 310100),
(310106, '静安区', 3, 310100),
(310107, '普陀区', 3, 310100),
(310108, '闸北区', 3, 310100),
(310109, '虹口区', 3, 310100),
(310110, '杨浦区', 3, 310100),
(310112, '闵行区', 3, 310100),
(310113, '宝山区', 3, 310100),
(310114, '嘉定区', 3, 310100),
(310115, '浦东新区', 3, 310100),
(310116, '金山区', 3, 310100),
(310117, '松江区', 3, 310100),
(310118, '青浦区', 3, 310100),
(310119, '南汇区', 3, 310100),
(310120, '奉贤区', 3, 310100),
(310230, '崇明县', 3, 310200),
(320101, '市辖区', 3, 320100),
(320102, '玄武区', 3, 320100),
(320103, '白下区', 3, 320100),
(320104, '秦淮区', 3, 320100),
(320105, '建邺区', 3, 320100),
(320106, '鼓楼区', 3, 320100),
(320107, '下关区', 3, 320100),
(320111, '浦口区', 3, 320100),
(320113, '栖霞区', 3, 320100),
(320114, '雨花台区', 3, 320100),
(320115, '江宁区', 3, 320100),
(320116, '六合区', 3, 320100),
(320124, '溧水县', 3, 320100),
(320125, '高淳县', 3, 320100),
(320201, '市辖区', 3, 320200),
(320202, '崇安区', 3, 320200),
(320203, '南长区', 3, 320200),
(320204, '北塘区', 3, 320200),
(320205, '锡山区', 3, 320200),
(320206, '惠山区', 3, 320200),
(320211, '滨湖区', 3, 320200),
(320281, '江阴市', 3, 320200),
(320282, '宜兴市', 3, 320200),
(320301, '市辖区', 3, 320300),
(320302, '鼓楼区', 3, 320300),
(320303, '云龙区', 3, 320300),
(320304, '九里区', 3, 320300),
(320305, '贾汪区', 3, 320300),
(320311, '泉山区', 3, 320300),
(320321, '丰 县', 3, 320300),
(320322, '沛 县', 3, 320300),
(320323, '铜山县', 3, 320300),
(320324, '睢宁县', 3, 320300),
(320381, '新沂市', 3, 320300),
(320382, '邳州市', 3, 320300),
(320401, '市辖区', 3, 320400),
(320402, '天宁区', 3, 320400),
(320404, '钟楼区', 3, 320400),
(320405, '戚墅堰区', 3, 320400),
(320411, '新北区', 3, 320400),
(320412, '武进区', 3, 320400),
(320481, '溧阳市', 3, 320400),
(320482, '金坛市', 3, 320400),
(320501, '市辖区', 3, 320500),
(320502, '沧浪区', 3, 320500),
(320503, '平江区', 3, 320500),
(320504, '金阊区', 3, 320500),
(320505, '虎丘区', 3, 320500),
(320506, '吴中区', 3, 320500),
(320507, '相城区', 3, 320500),
(320581, '常熟市', 3, 320500),
(320582, '张家港市', 3, 320500),
(320583, '昆山市', 3, 320500),
(320584, '吴江市', 3, 320500),
(320585, '太仓市', 3, 320500),
(320601, '市辖区', 3, 320600),
(320602, '崇川区', 3, 320600),
(320611, '港闸区', 3, 320600),
(320621, '海安县', 3, 320600),
(320623, '如东县', 3, 320600),
(320681, '启东市', 3, 320600),
(320682, '如皋市', 3, 320600),
(320683, '通州市', 3, 320600),
(320684, '海门市', 3, 320600),
(320701, '市辖区', 3, 320700),
(320703, '连云区', 3, 320700),
(320705, '新浦区', 3, 320700),
(320706, '海州区', 3, 320700),
(320721, '赣榆县', 3, 320700),
(320722, '东海县', 3, 320700),
(320723, '灌云县', 3, 320700),
(320724, '灌南县', 3, 320700),
(320801, '市辖区', 3, 320800),
(320802, '清河区', 3, 320800),
(320803, '楚州区', 3, 320800),
(320804, '淮阴区', 3, 320800),
(320811, '清浦区', 3, 320800),
(320826, '涟水县', 3, 320800),
(320829, '洪泽县', 3, 320800),
(320830, '盱眙县', 3, 320800),
(320831, '金湖县', 3, 320800),
(320901, '市辖区', 3, 320900),
(320902, '亭湖区', 3, 320900),
(320903, '盐都区', 3, 320900),
(320921, '响水县', 3, 320900),
(320922, '滨海县', 3, 320900),
(320923, '阜宁县', 3, 320900),
(320924, '射阳县', 3, 320900),
(320925, '建湖县', 3, 320900),
(320981, '东台市', 3, 320900),
(320982, '大丰市', 3, 320900),
(321001, '市辖区', 3, 321000),
(321002, '广陵区', 3, 321000),
(321003, '邗江区', 3, 321000),
(321011, '郊 区', 3, 321000),
(321023, '宝应县', 3, 321000),
(321081, '仪征市', 3, 321000),
(321084, '高邮市', 3, 321000),
(321088, '江都市', 3, 321000),
(321101, '市辖区', 3, 321100),
(321102, '京口区', 3, 321100),
(321111, '润州区', 3, 321100),
(321112, '丹徒区', 3, 321100),
(321181, '丹阳市', 3, 321100),
(321182, '扬中市', 3, 321100),
(321183, '句容市', 3, 321100),
(321201, '市辖区', 3, 321200),
(321202, '海陵区', 3, 321200),
(321203, '高港区', 3, 321200),
(321281, '兴化市', 3, 321200),
(321282, '靖江市', 3, 321200),
(321283, '泰兴市', 3, 321200),
(321284, '姜堰市', 3, 321200),
(321301, '市辖区', 3, 321300),
(321302, '宿城区', 3, 321300),
(321311, '宿豫区', 3, 321300),
(321322, '沭阳县', 3, 321300),
(321323, '泗阳县', 3, 321300),
(321324, '泗洪县', 3, 321300),
(330101, '市辖区', 3, 330100),
(330102, '上城区', 3, 330100),
(330103, '下城区', 3, 330100),
(330104, '江干区', 3, 330100),
(330105, '拱墅区', 3, 330100),
(330106, '西湖区', 3, 330100),
(330108, '滨江区', 3, 330100),
(330109, '萧山区', 3, 330100),
(330110, '余杭区', 3, 330100),
(330122, '桐庐县', 3, 330100),
(330127, '淳安县', 3, 330100),
(330182, '建德市', 3, 330100),
(330183, '富阳市', 3, 330100),
(330185, '临安市', 3, 330100),
(330201, '市辖区', 3, 330200),
(330203, '海曙区', 3, 330200),
(330204, '江东区', 3, 330200),
(330205, '江北区', 3, 330200),
(330206, '北仑区', 3, 330200),
(330211, '镇海区', 3, 330200),
(330212, '鄞州区', 3, 330200),
(330225, '象山县', 3, 330200),
(330226, '宁海县', 3, 330200),
(330281, '余姚市', 3, 330200),
(330282, '慈溪市', 3, 330200),
(330283, '奉化市', 3, 330200),
(330301, '市辖区', 3, 330300),
(330302, '鹿城区', 3, 330300),
(330303, '龙湾区', 3, 330300),
(330304, '瓯海区', 3, 330300),
(330322, '洞头县', 3, 330300),
(330324, '永嘉县', 3, 330300),
(330326, '平阳县', 3, 330300),
(330327, '苍南县', 3, 330300),
(330328, '文成县', 3, 330300),
(330329, '泰顺县', 3, 330300),
(330381, '瑞安市', 3, 330300),
(330382, '乐清市', 3, 330300),
(330401, '市辖区', 3, 330400),
(330402, '秀城区', 3, 330400),
(330411, '秀洲区', 3, 330400),
(330421, '嘉善县', 3, 330400),
(330424, '海盐县', 3, 330400),
(330481, '海宁市', 3, 330400),
(330482, '平湖市', 3, 330400),
(330483, '桐乡市', 3, 330400),
(330501, '市辖区', 3, 330500),
(330502, '吴兴区', 3, 330500),
(330503, '南浔区', 3, 330500),
(330521, '德清县', 3, 330500),
(330522, '长兴县', 3, 330500),
(330523, '安吉县', 3, 330500),
(330601, '市辖区', 3, 330600),
(330602, '越城区', 3, 330600),
(330621, '绍兴县', 3, 330600),
(330624, '新昌县', 3, 330600),
(330681, '诸暨市', 3, 330600),
(330682, '上虞市', 3, 330600),
(330683, '嵊州市', 3, 330600),
(330701, '市辖区', 3, 330700),
(330702, '婺城区', 3, 330700),
(330703, '金东区', 3, 330700),
(330723, '武义县', 3, 330700),
(330726, '浦江县', 3, 330700),
(330727, '磐安县', 3, 330700),
(330781, '兰溪市', 3, 330700),
(330782, '义乌市', 3, 330700),
(330783, '东阳市', 3, 330700),
(330784, '永康市', 3, 330700),
(330801, '市辖区', 3, 330800),
(330802, '柯城区', 3, 330800),
(330803, '衢江区', 3, 330800),
(330822, '常山县', 3, 330800),
(330824, '开化县', 3, 330800),
(330825, '龙游县', 3, 330800),
(330881, '江山市', 3, 330800),
(330901, '市辖区', 3, 330900),
(330902, '定海区', 3, 330900),
(330903, '普陀区', 3, 330900),
(330921, '岱山县', 3, 330900),
(330922, '嵊泗县', 3, 330900),
(331001, '市辖区', 3, 331000),
(331002, '椒江区', 3, 331000),
(331003, '黄岩区', 3, 331000),
(331004, '路桥区', 3, 331000),
(331021, '玉环县', 3, 331000),
(331022, '三门县', 3, 331000),
(331023, '天台县', 3, 331000),
(331024, '仙居县', 3, 331000),
(331081, '温岭市', 3, 331000),
(331082, '临海市', 3, 331000),
(331101, '市辖区', 3, 331100),
(331102, '莲都区', 3, 331100),
(331121, '青田县', 3, 331100),
(331122, '缙云县', 3, 331100),
(331123, '遂昌县', 3, 331100),
(331124, '松阳县', 3, 331100),
(331125, '云和县', 3, 331100),
(331126, '庆元县', 3, 331100),
(331127, '景宁畲族自治县', 3, 331100),
(331181, '龙泉市', 3, 331100),
(340101, '市辖区', 3, 340100),
(340102, '瑶海区', 3, 340100),
(340103, '庐阳区', 3, 340100),
(340104, '蜀山区', 3, 340100),
(340111, '包河区', 3, 340100),
(340121, '长丰县', 3, 340100),
(340122, '肥东县', 3, 340100),
(340123, '肥西县', 3, 340100),
(340201, '市辖区', 3, 340200),
(340202, '镜湖区', 3, 340200),
(340203, '马塘区', 3, 340200),
(340204, '新芜区', 3, 340200),
(340207, '鸠江区', 3, 340200),
(340221, '芜湖县', 3, 340200),
(340222, '繁昌县', 3, 340200),
(340223, '南陵县', 3, 340200),
(340301, '市辖区', 3, 340300),
(340302, '龙子湖区', 3, 340300),
(340303, '蚌山区', 3, 340300),
(340304, '禹会区', 3, 340300),
(340311, '淮上区', 3, 340300),
(340321, '怀远县', 3, 340300),
(340322, '五河县', 3, 340300),
(340323, '固镇县', 3, 340300),
(340401, '市辖区', 3, 340400),
(340402, '大通区', 3, 340400),
(340403, '田家庵区', 3, 340400),
(340404, '谢家集区', 3, 340400),
(340405, '八公山区', 3, 340400),
(340406, '潘集区', 3, 340400),
(340421, '凤台县', 3, 340400),
(340501, '市辖区', 3, 340500),
(340502, '金家庄区', 3, 340500),
(340503, '花山区', 3, 340500),
(340504, '雨山区', 3, 340500),
(340521, '当涂县', 3, 340500),
(340601, '市辖区', 3, 340600),
(340602, '杜集区', 3, 340600),
(340603, '相山区', 3, 340600),
(340604, '烈山区', 3, 340600),
(340621, '濉溪县', 3, 340600),
(340701, '市辖区', 3, 340700),
(340702, '铜官山区', 3, 340700),
(340703, '狮子山区', 3, 340700),
(340711, '郊 区', 3, 340700),
(340721, '铜陵县', 3, 340700),
(340801, '市辖区', 3, 340800),
(340802, '迎江区', 3, 340800),
(340803, '大观区', 3, 340800),
(340811, '郊 区', 3, 340800),
(340822, '怀宁县', 3, 340800),
(340823, '枞阳县', 3, 340800),
(340824, '潜山县', 3, 340800),
(340825, '太湖县', 3, 340800),
(340826, '宿松县', 3, 340800),
(340827, '望江县', 3, 340800),
(340828, '岳西县', 3, 340800),
(340881, '桐城市', 3, 340800),
(341001, '市辖区', 3, 341000),
(341002, '屯溪区', 3, 341000),
(341003, '黄山区', 3, 341000),
(341004, '徽州区', 3, 341000),
(341021, '歙 县', 3, 341000),
(341022, '休宁县', 3, 341000),
(341023, '黟 县', 3, 341000),
(341024, '祁门县', 3, 341000),
(341101, '市辖区', 3, 341100),
(341102, '琅琊区', 3, 341100),
(341103, '南谯区', 3, 341100),
(341122, '来安县', 3, 341100),
(341124, '全椒县', 3, 341100),
(341125, '定远县', 3, 341100),
(341126, '凤阳县', 3, 341100),
(341181, '天长市', 3, 341100),
(341182, '明光市', 3, 341100),
(341201, '市辖区', 3, 341200),
(341202, '颍州区', 3, 341200),
(341203, '颍东区', 3, 341200),
(341204, '颍泉区', 3, 341200),
(341221, '临泉县', 3, 341200),
(341222, '太和县', 3, 341200),
(341225, '阜南县', 3, 341200),
(341226, '颍上县', 3, 341200),
(341282, '界首市', 3, 341200),
(341301, '市辖区', 3, 341300),
(341302, '墉桥区', 3, 341300),
(341321, '砀山县', 3, 341300),
(341322, '萧 县', 3, 341300),
(341323, '灵璧县', 3, 341300),
(341324, '泗 县', 3, 341300),
(341401, '庐江县', 3, 340100),
(341402, '巢湖市', 3, 340100),
(341422, '无为县', 3, 340200),
(341423, '含山县', 3, 340500),
(341424, '和 县', 3, 340500),
(341501, '市辖区', 3, 341500),
(341502, '金安区', 3, 341500),
(341503, '裕安区', 3, 341500),
(341521, '寿 县', 3, 341500),
(341522, '霍邱县', 3, 341500),
(341523, '舒城县', 3, 341500),
(341524, '金寨县', 3, 341500),
(341525, '霍山县', 3, 341500),
(341601, '市辖区', 3, 341600),
(341602, '谯城区', 3, 341600),
(341621, '涡阳县', 3, 341600),
(341622, '蒙城县', 3, 341600),
(341623, '利辛县', 3, 341600),
(341701, '市辖区', 3, 341700),
(341702, '贵池区', 3, 341700),
(341721, '东至县', 3, 341700),
(341722, '石台县', 3, 341700),
(341723, '青阳县', 3, 341700),
(341801, '市辖区', 3, 341800),
(341802, '宣州区', 3, 341800),
(341821, '郎溪县', 3, 341800),
(341822, '广德县', 3, 341800),
(341823, '泾 县', 3, 341800);
INSERT INTO `thinkox_district` (`id`, `name`, `level`, `upid`) VALUES
(341824, '绩溪县', 3, 341800),
(341825, '旌德县', 3, 341800),
(341881, '宁国市', 3, 341800),
(350101, '市辖区', 3, 350100),
(350102, '鼓楼区', 3, 350100),
(350103, '台江区', 3, 350100),
(350104, '仓山区', 3, 350100),
(350105, '马尾区', 3, 350100),
(350111, '晋安区', 3, 350100),
(350121, '闽侯县', 3, 350100),
(350122, '连江县', 3, 350100),
(350123, '罗源县', 3, 350100),
(350124, '闽清县', 3, 350100),
(350125, '永泰县', 3, 350100),
(350128, '平潭县', 3, 350100),
(350181, '福清市', 3, 350100),
(350182, '长乐市', 3, 350100),
(350201, '市辖区', 3, 350200),
(350203, '思明区', 3, 350200),
(350205, '海沧区', 3, 350200),
(350206, '湖里区', 3, 350200),
(350211, '集美区', 3, 350200),
(350212, '同安区', 3, 350200),
(350213, '翔安区', 3, 350200),
(350301, '市辖区', 3, 350300),
(350302, '城厢区', 3, 350300),
(350303, '涵江区', 3, 350300),
(350304, '荔城区', 3, 350300),
(350305, '秀屿区', 3, 350300),
(350322, '仙游县', 3, 350300),
(350401, '市辖区', 3, 350400),
(350402, '梅列区', 3, 350400),
(350403, '三元区', 3, 350400),
(350421, '明溪县', 3, 350400),
(350423, '清流县', 3, 350400),
(350424, '宁化县', 3, 350400),
(350425, '大田县', 3, 350400),
(350426, '尤溪县', 3, 350400),
(350427, '沙 县', 3, 350400),
(350428, '将乐县', 3, 350400),
(350429, '泰宁县', 3, 350400),
(350430, '建宁县', 3, 350400),
(350481, '永安市', 3, 350400),
(350501, '市辖区', 3, 350500),
(350502, '鲤城区', 3, 350500),
(350503, '丰泽区', 3, 350500),
(350504, '洛江区', 3, 350500),
(350505, '泉港区', 3, 350500),
(350521, '惠安县', 3, 350500),
(350524, '安溪县', 3, 350500),
(350525, '永春县', 3, 350500),
(350526, '德化县', 3, 350500),
(350527, '金门县', 3, 350500),
(350581, '石狮市', 3, 350500),
(350582, '晋江市', 3, 350500),
(350583, '南安市', 3, 350500),
(350601, '市辖区', 3, 350600),
(350602, '芗城区', 3, 350600),
(350603, '龙文区', 3, 350600),
(350622, '云霄县', 3, 350600),
(350623, '漳浦县', 3, 350600),
(350624, '诏安县', 3, 350600),
(350625, '长泰县', 3, 350600),
(350626, '东山县', 3, 350600),
(350627, '南靖县', 3, 350600),
(350628, '平和县', 3, 350600),
(350629, '华安县', 3, 350600),
(350681, '龙海市', 3, 350600),
(350701, '市辖区', 3, 350700),
(350702, '延平区', 3, 350700),
(350721, '顺昌县', 3, 350700),
(350722, '浦城县', 3, 350700),
(350723, '光泽县', 3, 350700),
(350724, '松溪县', 3, 350700),
(350725, '政和县', 3, 350700),
(350781, '邵武市', 3, 350700),
(350782, '武夷山市', 3, 350700),
(350783, '建瓯市', 3, 350700),
(350784, '建阳市', 3, 350700),
(350801, '市辖区', 3, 350800),
(350802, '新罗区', 3, 350800),
(350821, '长汀县', 3, 350800),
(350822, '永定县', 3, 350800),
(350823, '上杭县', 3, 350800),
(350824, '武平县', 3, 350800),
(350825, '连城县', 3, 350800),
(350881, '漳平市', 3, 350800),
(350901, '市辖区', 3, 350900),
(350902, '蕉城区', 3, 350900),
(350921, '霞浦县', 3, 350900),
(350922, '古田县', 3, 350900),
(350923, '屏南县', 3, 350900),
(350924, '寿宁县', 3, 350900),
(350925, '周宁县', 3, 350900),
(350926, '柘荣县', 3, 350900),
(350981, '福安市', 3, 350900),
(350982, '福鼎市', 3, 350900),
(360101, '市辖区', 3, 360100),
(360102, '东湖区', 3, 360100),
(360103, '西湖区', 3, 360100),
(360104, '青云谱区', 3, 360100),
(360105, '湾里区', 3, 360100),
(360111, '青山湖区', 3, 360100),
(360121, '南昌县', 3, 360100),
(360122, '新建县', 3, 360100),
(360123, '安义县', 3, 360100),
(360124, '进贤县', 3, 360100),
(360201, '市辖区', 3, 360200),
(360202, '昌江区', 3, 360200),
(360203, '珠山区', 3, 360200),
(360222, '浮梁县', 3, 360200),
(360281, '乐平市', 3, 360200),
(360301, '市辖区', 3, 360300),
(360302, '安源区', 3, 360300),
(360313, '湘东区', 3, 360300),
(360321, '莲花县', 3, 360300),
(360322, '上栗县', 3, 360300),
(360323, '芦溪县', 3, 360300),
(360401, '市辖区', 3, 360400),
(360402, '庐山区', 3, 360400),
(360403, '浔阳区', 3, 360400),
(360421, '九江县', 3, 360400),
(360423, '武宁县', 3, 360400),
(360424, '修水县', 3, 360400),
(360425, '永修县', 3, 360400),
(360426, '德安县', 3, 360400),
(360427, '星子县', 3, 360400),
(360428, '都昌县', 3, 360400),
(360429, '湖口县', 3, 360400),
(360430, '彭泽县', 3, 360400),
(360481, '瑞昌市', 3, 360400),
(360501, '市辖区', 3, 360500),
(360502, '渝水区', 3, 360500),
(360521, '分宜县', 3, 360500),
(360601, '市辖区', 3, 360600),
(360602, '月湖区', 3, 360600),
(360622, '余江县', 3, 360600),
(360681, '贵溪市', 3, 360600),
(360701, '市辖区', 3, 360700),
(360702, '章贡区', 3, 360700),
(360721, '赣 县', 3, 360700),
(360722, '信丰县', 3, 360700),
(360723, '大余县', 3, 360700),
(360724, '上犹县', 3, 360700),
(360725, '崇义县', 3, 360700),
(360726, '安远县', 3, 360700),
(360727, '龙南县', 3, 360700),
(360728, '定南县', 3, 360700),
(360729, '全南县', 3, 360700),
(360730, '宁都县', 3, 360700),
(360731, '于都县', 3, 360700),
(360732, '兴国县', 3, 360700),
(360733, '会昌县', 3, 360700),
(360734, '寻乌县', 3, 360700),
(360735, '石城县', 3, 360700),
(360781, '瑞金市', 3, 360700),
(360782, '南康市', 3, 360700),
(360801, '市辖区', 3, 360800),
(360802, '吉州区', 3, 360800),
(360803, '青原区', 3, 360800),
(360821, '吉安县', 3, 360800),
(360822, '吉水县', 3, 360800),
(360823, '峡江县', 3, 360800),
(360824, '新干县', 3, 360800),
(360825, '永丰县', 3, 360800),
(360826, '泰和县', 3, 360800),
(360827, '遂川县', 3, 360800),
(360828, '万安县', 3, 360800),
(360829, '安福县', 3, 360800),
(360830, '永新县', 3, 360800),
(360881, '井冈山市', 3, 360800),
(360901, '市辖区', 3, 360900),
(360902, '袁州区', 3, 360900),
(360921, '奉新县', 3, 360900),
(360922, '万载县', 3, 360900),
(360923, '上高县', 3, 360900),
(360924, '宜丰县', 3, 360900),
(360925, '靖安县', 3, 360900),
(360926, '铜鼓县', 3, 360900),
(360981, '丰城市', 3, 360900),
(360982, '樟树市', 3, 360900),
(360983, '高安市', 3, 360900),
(361001, '市辖区', 3, 361000),
(361002, '临川区', 3, 361000),
(361021, '南城县', 3, 361000),
(361022, '黎川县', 3, 361000),
(361023, '南丰县', 3, 361000),
(361024, '崇仁县', 3, 361000),
(361025, '乐安县', 3, 361000),
(361026, '宜黄县', 3, 361000),
(361027, '金溪县', 3, 361000),
(361028, '资溪县', 3, 361000),
(361029, '东乡县', 3, 361000),
(361030, '广昌县', 3, 361000),
(361101, '市辖区', 3, 361100),
(361102, '信州区', 3, 361100),
(361121, '上饶县', 3, 361100),
(361122, '广丰县', 3, 361100),
(361123, '玉山县', 3, 361100),
(361124, '铅山县', 3, 361100),
(361125, '横峰县', 3, 361100),
(361126, '弋阳县', 3, 361100),
(361127, '余干县', 3, 361100),
(361128, '鄱阳县', 3, 361100),
(361129, '万年县', 3, 361100),
(361130, '婺源县', 3, 361100),
(361181, '德兴市', 3, 361100),
(370101, '市辖区', 3, 370100),
(370102, '历下区', 3, 370100),
(370103, '市中区', 3, 370100),
(370104, '槐荫区', 3, 370100),
(370105, '天桥区', 3, 370100),
(370112, '历城区', 3, 370100),
(370113, '长清区', 3, 370100),
(370124, '平阴县', 3, 370100),
(370125, '济阳县', 3, 370100),
(370126, '商河县', 3, 370100),
(370181, '章丘市', 3, 370100),
(370201, '市辖区', 3, 370200),
(370202, '市南区', 3, 370200),
(370203, '市北区', 3, 370200),
(370205, '四方区', 3, 370200),
(370211, '黄岛区', 3, 370200),
(370212, '崂山区', 3, 370200),
(370213, '李沧区', 3, 370200),
(370214, '城阳区', 3, 370200),
(370281, '胶州市', 3, 370200),
(370282, '即墨市', 3, 370200),
(370283, '平度市', 3, 370200),
(370284, '胶南市', 3, 370200),
(370285, '莱西市', 3, 370200),
(370301, '市辖区', 3, 370300),
(370302, '淄川区', 3, 370300),
(370303, '张店区', 3, 370300),
(370304, '博山区', 3, 370300),
(370305, '临淄区', 3, 370300),
(370306, '周村区', 3, 370300),
(370321, '桓台县', 3, 370300),
(370322, '高青县', 3, 370300),
(370323, '沂源县', 3, 370300),
(370401, '市辖区', 3, 370400),
(370402, '市中区', 3, 370400),
(370403, '薛城区', 3, 370400),
(370404, '峄城区', 3, 370400),
(370405, '台儿庄区', 3, 370400),
(370406, '山亭区', 3, 370400),
(370481, '滕州市', 3, 370400),
(370501, '市辖区', 3, 370500),
(370502, '东营区', 3, 370500),
(370503, '河口区', 3, 370500),
(370521, '垦利县', 3, 370500),
(370522, '利津县', 3, 370500),
(370523, '广饶县', 3, 370500),
(370601, '市辖区', 3, 370600),
(370602, '芝罘区', 3, 370600),
(370611, '福山区', 3, 370600),
(370612, '牟平区', 3, 370600),
(370613, '莱山区', 3, 370600),
(370634, '长岛县', 3, 370600),
(370681, '龙口市', 3, 370600),
(370682, '莱阳市', 3, 370600),
(370683, '莱州市', 3, 370600),
(370684, '蓬莱市', 3, 370600),
(370685, '招远市', 3, 370600),
(370686, '栖霞市', 3, 370600),
(370687, '海阳市', 3, 370600),
(370701, '市辖区', 3, 370700),
(370702, '潍城区', 3, 370700),
(370703, '寒亭区', 3, 370700),
(370704, '坊子区', 3, 370700),
(370705, '奎文区', 3, 370700),
(370724, '临朐县', 3, 370700),
(370725, '昌乐县', 3, 370700),
(370781, '青州市', 3, 370700),
(370782, '诸城市', 3, 370700),
(370783, '寿光市', 3, 370700),
(370784, '安丘市', 3, 370700),
(370785, '高密市', 3, 370700),
(370786, '昌邑市', 3, 370700),
(370801, '市辖区', 3, 370800),
(370802, '市中区', 3, 370800),
(370811, '任城区', 3, 370800),
(370826, '微山县', 3, 370800),
(370827, '鱼台县', 3, 370800),
(370828, '金乡县', 3, 370800),
(370829, '嘉祥县', 3, 370800),
(370830, '汶上县', 3, 370800),
(370831, '泗水县', 3, 370800),
(370832, '梁山县', 3, 370800),
(370881, '曲阜市', 3, 370800),
(370882, '兖州市', 3, 370800),
(370883, '邹城市', 3, 370800),
(370901, '市辖区', 3, 370900),
(370902, '泰山区', 3, 370900),
(370903, '岱岳区', 3, 370900),
(370921, '宁阳县', 3, 370900),
(370923, '东平县', 3, 370900),
(370982, '新泰市', 3, 370900),
(370983, '肥城市', 3, 370900),
(371001, '市辖区', 3, 371000),
(371002, '环翠区', 3, 371000),
(371081, '文登市', 3, 371000),
(371082, '荣成市', 3, 371000),
(371083, '乳山市', 3, 371000),
(371101, '市辖区', 3, 371100),
(371102, '东港区', 3, 371100),
(371103, '岚山区', 3, 371100),
(371121, '五莲县', 3, 371100),
(371122, '莒 县', 3, 371100),
(371201, '市辖区', 3, 371200),
(371202, '莱城区', 3, 371200),
(371203, '钢城区', 3, 371200),
(371301, '市辖区', 3, 371300),
(371302, '兰山区', 3, 371300),
(371311, '罗庄区', 3, 371300),
(371312, '河东区', 3, 371300),
(371321, '沂南县', 3, 371300),
(371322, '郯城县', 3, 371300),
(371323, '沂水县', 3, 371300),
(371324, '苍山县', 3, 371300),
(371325, '费 县', 3, 371300),
(371326, '平邑县', 3, 371300),
(371327, '莒南县', 3, 371300),
(371328, '蒙阴县', 3, 371300),
(371329, '临沭县', 3, 371300),
(371401, '市辖区', 3, 371400),
(371402, '德城区', 3, 371400),
(371421, '陵 县', 3, 371400),
(371422, '宁津县', 3, 371400),
(371423, '庆云县', 3, 371400),
(371424, '临邑县', 3, 371400),
(371425, '齐河县', 3, 371400),
(371426, '平原县', 3, 371400),
(371427, '夏津县', 3, 371400),
(371428, '武城县', 3, 371400),
(371481, '乐陵市', 3, 371400),
(371482, '禹城市', 3, 371400),
(371501, '市辖区', 3, 371500),
(371502, '东昌府区', 3, 371500),
(371521, '阳谷县', 3, 371500),
(371522, '莘 县', 3, 371500),
(371523, '茌平县', 3, 371500),
(371524, '东阿县', 3, 371500),
(371525, '冠 县', 3, 371500),
(371526, '高唐县', 3, 371500),
(371581, '临清市', 3, 371500),
(371601, '市辖区', 3, 371600),
(371602, '滨城区', 3, 371600),
(371621, '惠民县', 3, 371600),
(371622, '阳信县', 3, 371600),
(371623, '无棣县', 3, 371600),
(371624, '沾化县', 3, 371600),
(371625, '博兴县', 3, 371600),
(371626, '邹平县', 3, 371600),
(371701, '市辖区', 3, 371700),
(371702, '牡丹区', 3, 371700),
(371721, '曹 县', 3, 371700),
(371722, '单 县', 3, 371700),
(371723, '成武县', 3, 371700),
(371724, '巨野县', 3, 371700),
(371725, '郓城县', 3, 371700),
(371726, '鄄城县', 3, 371700),
(371727, '定陶县', 3, 371700),
(371728, '东明县', 3, 371700),
(410101, '市辖区', 3, 410100),
(410102, '中原区', 3, 410100),
(410103, '二七区', 3, 410100),
(410104, '管城回族区', 3, 410100),
(410105, '金水区', 3, 410100),
(410106, '上街区', 3, 410100),
(410108, '邙山区', 3, 410100),
(410122, '中牟县', 3, 410100),
(410181, '巩义市', 3, 410100),
(410182, '荥阳市', 3, 410100),
(410183, '新密市', 3, 410100),
(410184, '新郑市', 3, 410100),
(410185, '登封市', 3, 410100),
(410201, '市辖区', 3, 410200),
(410202, '龙亭区', 3, 410200),
(410203, '顺河回族区', 3, 410200),
(410204, '鼓楼区', 3, 410200),
(410205, '南关区', 3, 410200),
(410211, '郊 区', 3, 410200),
(410221, '杞 县', 3, 410200),
(410222, '通许县', 3, 410200),
(410223, '尉氏县', 3, 410200),
(410224, '开封县', 3, 410200),
(410225, '兰考县', 3, 410200),
(410301, '市辖区', 3, 410300),
(410302, '老城区', 3, 410300),
(410303, '西工区', 3, 410300),
(410304, '廛河回族区', 3, 410300),
(410305, '涧西区', 3, 410300),
(410306, '吉利区', 3, 410300),
(410307, '洛龙区', 3, 410300),
(410322, '孟津县', 3, 410300),
(410323, '新安县', 3, 410300),
(410324, '栾川县', 3, 410300),
(410325, '嵩 县', 3, 410300),
(410326, '汝阳县', 3, 410300),
(410327, '宜阳县', 3, 410300),
(410328, '洛宁县', 3, 410300),
(410329, '伊川县', 3, 410300),
(410381, '偃师市', 3, 410300),
(410401, '市辖区', 3, 410400),
(410402, '新华区', 3, 410400),
(410403, '卫东区', 3, 410400),
(410404, '石龙区', 3, 410400),
(410411, '湛河区', 3, 410400),
(410421, '宝丰县', 3, 410400),
(410422, '叶 县', 3, 410400),
(410423, '鲁山县', 3, 410400),
(410425, '郏 县', 3, 410400),
(410481, '舞钢市', 3, 410400),
(410482, '汝州市', 3, 410400),
(410501, '市辖区', 3, 410500),
(410502, '文峰区', 3, 410500),
(410503, '北关区', 3, 410500),
(410505, '殷都区', 3, 410500),
(410506, '龙安区', 3, 410500),
(410522, '安阳县', 3, 410500),
(410523, '汤阴县', 3, 410500),
(410526, '滑 县', 3, 410500),
(410527, '内黄县', 3, 410500),
(410581, '林州市', 3, 410500),
(410601, '市辖区', 3, 410600),
(410602, '鹤山区', 3, 410600),
(410603, '山城区', 3, 410600),
(410611, '淇滨区', 3, 410600),
(410621, '浚 县', 3, 410600),
(410622, '淇 县', 3, 410600),
(410701, '市辖区', 3, 410700),
(410702, '红旗区', 3, 410700),
(410703, '卫滨区', 3, 410700),
(410704, '凤泉区', 3, 410700),
(410711, '牧野区', 3, 410700),
(410721, '新乡县', 3, 410700),
(410724, '获嘉县', 3, 410700),
(410725, '原阳县', 3, 410700),
(410726, '延津县', 3, 410700),
(410727, '封丘县', 3, 410700),
(410728, '长垣县', 3, 410700),
(410781, '卫辉市', 3, 410700),
(410782, '辉县市', 3, 410700),
(410801, '市辖区', 3, 410800),
(410802, '解放区', 3, 410800),
(410803, '中站区', 3, 410800),
(410804, '马村区', 3, 410800),
(410811, '山阳区', 3, 410800),
(410821, '修武县', 3, 410800),
(410822, '博爱县', 3, 410800),
(410823, '武陟县', 3, 410800),
(410825, '温 县', 3, 410800),
(410881, '济源市', 3, 410800),
(410882, '沁阳市', 3, 410800),
(410883, '孟州市', 3, 410800),
(410901, '市辖区', 3, 410900),
(410902, '华龙区', 3, 410900),
(410922, '清丰县', 3, 410900),
(410923, '南乐县', 3, 410900),
(410926, '范 县', 3, 410900),
(410927, '台前县', 3, 410900),
(410928, '濮阳县', 3, 410900),
(411001, '市辖区', 3, 411000),
(411002, '魏都区', 3, 411000),
(411023, '许昌县', 3, 411000),
(411024, '鄢陵县', 3, 411000),
(411025, '襄城县', 3, 411000),
(411081, '禹州市', 3, 411000),
(411082, '长葛市', 3, 411000),
(411101, '市辖区', 3, 411100),
(411102, '源汇区', 3, 411100),
(411103, '郾城区', 3, 411100),
(411104, '召陵区', 3, 411100),
(411121, '舞阳县', 3, 411100),
(411122, '临颍县', 3, 411100),
(411201, '市辖区', 3, 411200),
(411202, '湖滨区', 3, 411200),
(411221, '渑池县', 3, 411200),
(411222, '陕 县', 3, 411200),
(411224, '卢氏县', 3, 411200),
(411281, '义马市', 3, 411200),
(411282, '灵宝市', 3, 411200),
(411301, '市辖区', 3, 411300),
(411302, '宛城区', 3, 411300),
(411303, '卧龙区', 3, 411300),
(411321, '南召县', 3, 411300),
(411322, '方城县', 3, 411300),
(411323, '西峡县', 3, 411300),
(411324, '镇平县', 3, 411300),
(411325, '内乡县', 3, 411300),
(411326, '淅川县', 3, 411300),
(411327, '社旗县', 3, 411300),
(411328, '唐河县', 3, 411300),
(411329, '新野县', 3, 411300),
(411330, '桐柏县', 3, 411300),
(411381, '邓州市', 3, 411300),
(411401, '市辖区', 3, 411400),
(411402, '梁园区', 3, 411400),
(411403, '睢阳区', 3, 411400),
(411421, '民权县', 3, 411400),
(411422, '睢 县', 3, 411400),
(411423, '宁陵县', 3, 411400),
(411424, '柘城县', 3, 411400),
(411425, '虞城县', 3, 411400),
(411426, '夏邑县', 3, 411400),
(411481, '永城市', 3, 411400),
(411501, '市辖区', 3, 411500),
(411502, '师河区', 3, 411500),
(411503, '平桥区', 3, 411500),
(411521, '罗山县', 3, 411500),
(411522, '光山县', 3, 411500),
(411523, '新 县', 3, 411500),
(411524, '商城县', 3, 411500),
(411525, '固始县', 3, 411500),
(411526, '潢川县', 3, 411500),
(411527, '淮滨县', 3, 411500),
(411528, '息 县', 3, 411500),
(411601, '市辖区', 3, 411600),
(411602, '川汇区', 3, 411600),
(411621, '扶沟县', 3, 411600),
(411622, '西华县', 3, 411600),
(411623, '商水县', 3, 411600),
(411624, '沈丘县', 3, 411600),
(411625, '郸城县', 3, 411600),
(411626, '淮阳县', 3, 411600),
(411627, '太康县', 3, 411600),
(411628, '鹿邑县', 3, 411600),
(411681, '项城市', 3, 411600),
(411701, '市辖区', 3, 411700),
(411702, '驿城区', 3, 411700),
(411721, '西平县', 3, 411700),
(411722, '上蔡县', 3, 411700),
(411723, '平舆县', 3, 411700),
(411724, '正阳县', 3, 411700),
(411725, '确山县', 3, 411700),
(411726, '泌阳县', 3, 411700),
(411727, '汝南县', 3, 411700),
(411728, '遂平县', 3, 411700),
(411729, '新蔡县', 3, 411700),
(420101, '市辖区', 3, 420100),
(420102, '江岸区', 3, 420100),
(420103, '江汉区', 3, 420100),
(420104, '乔口区', 3, 420100),
(420105, '汉阳区', 3, 420100),
(420106, '武昌区', 3, 420100),
(420107, '青山区', 3, 420100),
(420111, '洪山区', 3, 420100),
(420112, '东西湖区', 3, 420100),
(420113, '汉南区', 3, 420100),
(420114, '蔡甸区', 3, 420100),
(420115, '江夏区', 3, 420100),
(420116, '黄陂区', 3, 420100),
(420117, '新洲区', 3, 420100),
(420201, '市辖区', 3, 420200),
(420202, '黄石港区', 3, 420200),
(420203, '西塞山区', 3, 420200),
(420204, '下陆区', 3, 420200),
(420205, '铁山区', 3, 420200),
(420222, '阳新县', 3, 420200),
(420281, '大冶市', 3, 420200),
(420301, '市辖区', 3, 420300),
(420302, '茅箭区', 3, 420300),
(420303, '张湾区', 3, 420300),
(420321, '郧 县', 3, 420300),
(420322, '郧西县', 3, 420300),
(420323, '竹山县', 3, 420300),
(420324, '竹溪县', 3, 420300),
(420325, '房 县', 3, 420300),
(420381, '丹江口市', 3, 420300),
(420501, '市辖区', 3, 420500),
(420502, '西陵区', 3, 420500),
(420503, '伍家岗区', 3, 420500),
(420504, '点军区', 3, 420500),
(420505, '猇亭区', 3, 420500),
(420506, '夷陵区', 3, 420500),
(420525, '远安县', 3, 420500),
(420526, '兴山县', 3, 420500),
(420527, '秭归县', 3, 420500),
(420528, '长阳土家族自治县', 3, 420500),
(420529, '五峰土家族自治县', 3, 420500),
(420581, '宜都市', 3, 420500),
(420582, '当阳市', 3, 420500),
(420583, '枝江市', 3, 420500),
(420601, '市辖区', 3, 420600),
(420602, '襄城区', 3, 420600),
(420606, '樊城区', 3, 420600),
(420607, '襄阳区', 3, 420600),
(420624, '南漳县', 3, 420600),
(420625, '谷城县', 3, 420600),
(420626, '保康县', 3, 420600),
(420682, '老河口市', 3, 420600),
(420683, '枣阳市', 3, 420600),
(420684, '宜城市', 3, 420600),
(420701, '市辖区', 3, 420700),
(420702, '梁子湖区', 3, 420700),
(420703, '华容区', 3, 420700),
(420704, '鄂城区', 3, 420700),
(420801, '市辖区', 3, 420800),
(420802, '东宝区', 3, 420800),
(420804, '掇刀区', 3, 420800),
(420821, '京山县', 3, 420800),
(420822, '沙洋县', 3, 420800),
(420881, '钟祥市', 3, 420800),
(420901, '市辖区', 3, 420900),
(420902, '孝南区', 3, 420900),
(420921, '孝昌县', 3, 420900),
(420922, '大悟县', 3, 420900),
(420923, '云梦县', 3, 420900),
(420981, '应城市', 3, 420900),
(420982, '安陆市', 3, 420900),
(420984, '汉川市', 3, 420900),
(421001, '市辖区', 3, 421000),
(421002, '沙市区', 3, 421000),
(421003, '荆州区', 3, 421000),
(421022, '公安县', 3, 421000),
(421023, '监利县', 3, 421000),
(421024, '江陵县', 3, 421000),
(421081, '石首市', 3, 421000),
(421083, '洪湖市', 3, 421000),
(421087, '松滋市', 3, 421000),
(421101, '市辖区', 3, 421100),
(421102, '黄州区', 3, 421100),
(421121, '团风县', 3, 421100),
(421122, '红安县', 3, 421100),
(421123, '罗田县', 3, 421100),
(421124, '英山县', 3, 421100),
(421125, '浠水县', 3, 421100),
(421126, '蕲春县', 3, 421100),
(421127, '黄梅县', 3, 421100),
(421181, '麻城市', 3, 421100),
(421182, '武穴市', 3, 421100),
(421201, '市辖区', 3, 421200),
(421202, '咸安区', 3, 421200),
(421221, '嘉鱼县', 3, 421200),
(421222, '通城县', 3, 421200),
(421223, '崇阳县', 3, 421200),
(421224, '通山县', 3, 421200),
(421281, '赤壁市', 3, 421200),
(421301, '市辖区', 3, 421300),
(421302, '曾都区', 3, 421300),
(421381, '广水市', 3, 421300),
(422801, '恩施市', 3, 422800),
(422802, '利川市', 3, 422800),
(422822, '建始县', 3, 422800),
(422823, '巴东县', 3, 422800),
(422825, '宣恩县', 3, 422800),
(422826, '咸丰县', 3, 422800),
(422827, '来凤县', 3, 422800),
(422828, '鹤峰县', 3, 422800),
(429004, '仙桃市', 3, 429000),
(429005, '潜江市', 3, 429000),
(429006, '天门市', 3, 429000),
(429021, '神农架林区', 3, 429000),
(430101, '市辖区', 3, 430100),
(430102, '芙蓉区', 3, 430100),
(430103, '天心区', 3, 430100),
(430104, '岳麓区', 3, 430100),
(430105, '开福区', 3, 430100),
(430111, '雨花区', 3, 430100),
(430121, '长沙县', 3, 430100),
(430122, '望城县', 3, 430100),
(430124, '宁乡县', 3, 430100),
(430181, '浏阳市', 3, 430100),
(430201, '市辖区', 3, 430200),
(430202, '荷塘区', 3, 430200),
(430203, '芦淞区', 3, 430200),
(430204, '石峰区', 3, 430200),
(430211, '天元区', 3, 430200),
(430221, '株洲县', 3, 430200),
(430223, '攸 县', 3, 430200),
(430224, '茶陵县', 3, 430200),
(430225, '炎陵县', 3, 430200),
(430281, '醴陵市', 3, 430200),
(430301, '市辖区', 3, 430300),
(430302, '雨湖区', 3, 430300),
(430304, '岳塘区', 3, 430300),
(430321, '湘潭县', 3, 430300),
(430381, '湘乡市', 3, 430300),
(430382, '韶山市', 3, 430300),
(430401, '市辖区', 3, 430400),
(430405, '珠晖区', 3, 430400),
(430406, '雁峰区', 3, 430400),
(430407, '石鼓区', 3, 430400),
(430408, '蒸湘区', 3, 430400),
(430412, '南岳区', 3, 430400),
(430421, '衡阳县', 3, 430400),
(430422, '衡南县', 3, 430400),
(430423, '衡山县', 3, 430400),
(430424, '衡东县', 3, 430400),
(430426, '祁东县', 3, 430400),
(430481, '耒阳市', 3, 430400),
(430482, '常宁市', 3, 430400),
(430501, '市辖区', 3, 430500),
(430502, '双清区', 3, 430500),
(430503, '大祥区', 3, 430500),
(430511, '北塔区', 3, 430500),
(430521, '邵东县', 3, 430500),
(430522, '新邵县', 3, 430500),
(430523, '邵阳县', 3, 430500),
(430524, '隆回县', 3, 430500),
(430525, '洞口县', 3, 430500),
(430527, '绥宁县', 3, 430500),
(430528, '新宁县', 3, 430500),
(430529, '城步苗族自治县', 3, 430500),
(430581, '武冈市', 3, 430500),
(430601, '市辖区', 3, 430600),
(430602, '岳阳楼区', 3, 430600),
(430603, '云溪区', 3, 430600),
(430611, '君山区', 3, 430600),
(430621, '岳阳县', 3, 430600),
(430623, '华容县', 3, 430600),
(430624, '湘阴县', 3, 430600),
(430626, '平江县', 3, 430600),
(430681, '汨罗市', 3, 430600),
(430682, '临湘市', 3, 430600),
(430701, '市辖区', 3, 430700),
(430702, '武陵区', 3, 430700),
(430703, '鼎城区', 3, 430700),
(430721, '安乡县', 3, 430700),
(430722, '汉寿县', 3, 430700),
(430723, '澧 县', 3, 430700),
(430724, '临澧县', 3, 430700),
(430725, '桃源县', 3, 430700),
(430726, '石门县', 3, 430700),
(430781, '津市市', 3, 430700),
(430801, '市辖区', 3, 430800),
(430802, '永定区', 3, 430800),
(430811, '武陵源区', 3, 430800),
(430821, '慈利县', 3, 430800),
(430822, '桑植县', 3, 430800),
(430901, '市辖区', 3, 430900),
(430902, '资阳区', 3, 430900),
(430903, '赫山区', 3, 430900),
(430921, '南 县', 3, 430900),
(430922, '桃江县', 3, 430900),
(430923, '安化县', 3, 430900),
(430981, '沅江市', 3, 430900),
(431001, '市辖区', 3, 431000),
(431002, '北湖区', 3, 431000),
(431003, '苏仙区', 3, 431000),
(431021, '桂阳县', 3, 431000),
(431022, '宜章县', 3, 431000),
(431023, '永兴县', 3, 431000),
(431024, '嘉禾县', 3, 431000),
(431025, '临武县', 3, 431000),
(431026, '汝城县', 3, 431000),
(431027, '桂东县', 3, 431000),
(431028, '安仁县', 3, 431000),
(431081, '资兴市', 3, 431000),
(431101, '市辖区', 3, 431100),
(431102, '芝山区', 3, 431100),
(431103, '冷水滩区', 3, 431100),
(431121, '祁阳县', 3, 431100),
(431122, '东安县', 3, 431100),
(431123, '双牌县', 3, 431100),
(431124, '道 县', 3, 431100),
(431125, '江永县', 3, 431100),
(431126, '宁远县', 3, 431100),
(431127, '蓝山县', 3, 431100),
(431128, '新田县', 3, 431100),
(431129, '江华瑶族自治县', 3, 431100),
(431201, '市辖区', 3, 431200),
(431202, '鹤城区', 3, 431200),
(431221, '中方县', 3, 431200),
(431222, '沅陵县', 3, 431200),
(431223, '辰溪县', 3, 431200),
(431224, '溆浦县', 3, 431200),
(431225, '会同县', 3, 431200),
(431226, '麻阳苗族自治县', 3, 431200),
(431227, '新晃侗族自治县', 3, 431200),
(431228, '芷江侗族自治县', 3, 431200),
(431229, '靖州苗族侗族自治县', 3, 431200),
(431230, '通道侗族自治县', 3, 431200),
(431281, '洪江市', 3, 431200),
(431301, '市辖区', 3, 431300),
(431302, '娄星区', 3, 431300),
(431321, '双峰县', 3, 431300),
(431322, '新化县', 3, 431300),
(431381, '冷水江市', 3, 431300),
(431382, '涟源市', 3, 431300),
(433101, '吉首市', 3, 433100),
(433122, '泸溪县', 3, 433100),
(433123, '凤凰县', 3, 433100),
(433124, '花垣县', 3, 433100),
(433125, '保靖县', 3, 433100),
(433126, '古丈县', 3, 433100),
(433127, '永顺县', 3, 433100),
(433130, '龙山县', 3, 433100),
(440101, '市辖区', 3, 440100),
(440102, '东山区', 3, 440100),
(440103, '荔湾区', 3, 440100),
(440104, '越秀区', 3, 440100),
(440105, '海珠区', 3, 440100),
(440106, '天河区', 3, 440100),
(440107, '芳村区', 3, 440100),
(440111, '白云区', 3, 440100),
(440112, '黄埔区', 3, 440100),
(440113, '番禺区', 3, 440100),
(440114, '花都区', 3, 440100),
(440183, '增城市', 3, 440100),
(440184, '从化市', 3, 440100),
(440201, '市辖区', 3, 440200),
(440203, '武江区', 3, 440200),
(440204, '浈江区', 3, 440200),
(440205, '曲江区', 3, 440200),
(440222, '始兴县', 3, 440200),
(440224, '仁化县', 3, 440200),
(440229, '翁源县', 3, 440200),
(440232, '乳源瑶族自治县', 3, 440200),
(440233, '新丰县', 3, 440200),
(440281, '乐昌市', 3, 440200),
(440282, '南雄市', 3, 440200),
(440301, '市辖区', 3, 440300),
(440303, '罗湖区', 3, 440300),
(440304, '福田区', 3, 440300),
(440305, '南山区', 3, 440300),
(440306, '宝安区', 3, 440300),
(440307, '龙岗区', 3, 440300),
(440308, '盐田区', 3, 440300),
(440401, '市辖区', 3, 440400),
(440402, '香洲区', 3, 440400),
(440403, '斗门区', 3, 440400),
(440404, '金湾区', 3, 440400),
(440501, '市辖区', 3, 440500),
(440507, '龙湖区', 3, 440500),
(440511, '金平区', 3, 440500),
(440512, '濠江区', 3, 440500),
(440513, '潮阳区', 3, 440500),
(440514, '潮南区', 3, 440500),
(440515, '澄海区', 3, 440500),
(440523, '南澳县', 3, 440500),
(440601, '市辖区', 3, 440600),
(440604, '禅城区', 3, 440600),
(440605, '南海区', 3, 440600),
(440606, '顺德区', 3, 440600),
(440607, '三水区', 3, 440600),
(440608, '高明区', 3, 440600),
(440701, '市辖区', 3, 440700),
(440703, '蓬江区', 3, 440700),
(440704, '江海区', 3, 440700),
(440705, '新会区', 3, 440700),
(440781, '台山市', 3, 440700),
(440783, '开平市', 3, 440700),
(440784, '鹤山市', 3, 440700),
(440785, '恩平市', 3, 440700),
(440801, '市辖区', 3, 440800),
(440802, '赤坎区', 3, 440800),
(440803, '霞山区', 3, 440800),
(440804, '坡头区', 3, 440800),
(440811, '麻章区', 3, 440800),
(440823, '遂溪县', 3, 440800),
(440825, '徐闻县', 3, 440800),
(440881, '廉江市', 3, 440800),
(440882, '雷州市', 3, 440800),
(440883, '吴川市', 3, 440800),
(440901, '市辖区', 3, 440900),
(440902, '茂南区', 3, 440900),
(440903, '茂港区', 3, 440900),
(440923, '电白县', 3, 440900),
(440981, '高州市', 3, 440900),
(440982, '化州市', 3, 440900),
(440983, '信宜市', 3, 440900),
(441201, '市辖区', 3, 441200),
(441202, '端州区', 3, 441200),
(441203, '鼎湖区', 3, 441200),
(441223, '广宁县', 3, 441200),
(441224, '怀集县', 3, 441200),
(441225, '封开县', 3, 441200),
(441226, '德庆县', 3, 441200),
(441283, '高要市', 3, 441200),
(441284, '四会市', 3, 441200),
(441301, '市辖区', 3, 441300),
(441302, '惠城区', 3, 441300),
(441303, '惠阳区', 3, 441300),
(441322, '博罗县', 3, 441300),
(441323, '惠东县', 3, 441300),
(441324, '龙门县', 3, 441300),
(441401, '市辖区', 3, 441400),
(441402, '梅江区', 3, 441400),
(441421, '梅 县', 3, 441400),
(441422, '大埔县', 3, 441400),
(441423, '丰顺县', 3, 441400),
(441424, '五华县', 3, 441400),
(441426, '平远县', 3, 441400),
(441427, '蕉岭县', 3, 441400),
(441481, '兴宁市', 3, 441400),
(441501, '市辖区', 3, 441500),
(441502, '城 区', 3, 441500),
(441521, '海丰县', 3, 441500),
(441523, '陆河县', 3, 441500),
(441581, '陆丰市', 3, 441500),
(441601, '市辖区', 3, 441600),
(441602, '源城区', 3, 441600),
(441621, '紫金县', 3, 441600),
(441622, '龙川县', 3, 441600),
(441623, '连平县', 3, 441600),
(441624, '和平县', 3, 441600),
(441625, '东源县', 3, 441600),
(441701, '市辖区', 3, 441700),
(441702, '江城区', 3, 441700),
(441721, '阳西县', 3, 441700),
(441723, '阳东县', 3, 441700),
(441781, '阳春市', 3, 441700),
(441801, '市辖区', 3, 441800),
(441802, '清城区', 3, 441800),
(441821, '佛冈县', 3, 441800),
(441823, '阳山县', 3, 441800),
(441825, '连山壮族瑶族自治县', 3, 441800),
(441826, '连南瑶族自治县', 3, 441800),
(441827, '清新县', 3, 441800),
(441881, '英德市', 3, 441800),
(441882, '连州市', 3, 441800),
(445101, '市辖区', 3, 445100),
(445102, '湘桥区', 3, 445100),
(445121, '潮安县', 3, 445100),
(445122, '饶平县', 3, 445100),
(445201, '市辖区', 3, 445200),
(445202, '榕城区', 3, 445200),
(445221, '揭东县', 3, 445200),
(445222, '揭西县', 3, 445200),
(445224, '惠来县', 3, 445200),
(445281, '普宁市', 3, 445200),
(445301, '市辖区', 3, 445300),
(445302, '云城区', 3, 445300),
(445321, '新兴县', 3, 445300),
(445322, '郁南县', 3, 445300),
(445323, '云安县', 3, 445300),
(445381, '罗定市', 3, 445300),
(450101, '市辖区', 3, 450100),
(450102, '兴宁区', 3, 450100),
(450103, '青秀区', 3, 450100),
(450105, '江南区', 3, 450100),
(450107, '西乡塘区', 3, 450100),
(450108, '良庆区', 3, 450100),
(450109, '邕宁区', 3, 450100),
(450122, '武鸣县', 3, 450100),
(450123, '隆安县', 3, 450100),
(450124, '马山县', 3, 450100),
(450125, '上林县', 3, 450100),
(450126, '宾阳县', 3, 450100),
(450127, '横 县', 3, 450100),
(450201, '市辖区', 3, 450200),
(450202, '城中区', 3, 450200),
(450203, '鱼峰区', 3, 450200),
(450204, '柳南区', 3, 450200),
(450205, '柳北区', 3, 450200),
(450221, '柳江县', 3, 450200),
(450222, '柳城县', 3, 450200),
(450223, '鹿寨县', 3, 450200),
(450224, '融安县', 3, 450200),
(450225, '融水苗族自治县', 3, 450200),
(450226, '三江侗族自治县', 3, 450200),
(450301, '市辖区', 3, 450300),
(450302, '秀峰区', 3, 450300),
(450303, '叠彩区', 3, 450300),
(450304, '象山区', 3, 450300),
(450305, '七星区', 3, 450300),
(450311, '雁山区', 3, 450300),
(450321, '阳朔县', 3, 450300),
(450322, '临桂县', 3, 450300),
(450323, '灵川县', 3, 450300),
(450324, '全州县', 3, 450300),
(450325, '兴安县', 3, 450300),
(450326, '永福县', 3, 450300),
(450327, '灌阳县', 3, 450300),
(450328, '龙胜各族自治县', 3, 450300),
(450329, '资源县', 3, 450300),
(450330, '平乐县', 3, 450300),
(450331, '荔蒲县', 3, 450300),
(450332, '恭城瑶族自治县', 3, 450300),
(450401, '市辖区', 3, 450400),
(450403, '万秀区', 3, 450400),
(450404, '蝶山区', 3, 450400),
(450405, '长洲区', 3, 450400),
(450421, '苍梧县', 3, 450400),
(450422, '藤 县', 3, 450400),
(450423, '蒙山县', 3, 450400),
(450481, '岑溪市', 3, 450400),
(450501, '市辖区', 3, 450500),
(450502, '海城区', 3, 450500),
(450503, '银海区', 3, 450500),
(450512, '铁山港区', 3, 450500),
(450521, '合浦县', 3, 450500),
(450601, '市辖区', 3, 450600),
(450602, '港口区', 3, 450600),
(450603, '防城区', 3, 450600),
(450621, '上思县', 3, 450600),
(450681, '东兴市', 3, 450600),
(450701, '市辖区', 3, 450700),
(450702, '钦南区', 3, 450700),
(450703, '钦北区', 3, 450700),
(450721, '灵山县', 3, 450700),
(450722, '浦北县', 3, 450700),
(450801, '市辖区', 3, 450800),
(450802, '港北区', 3, 450800),
(450803, '港南区', 3, 450800),
(450804, '覃塘区', 3, 450800),
(450821, '平南县', 3, 450800),
(450881, '桂平市', 3, 450800),
(450901, '市辖区', 3, 450900),
(450902, '玉州区', 3, 450900),
(450921, '容 县', 3, 450900),
(450922, '陆川县', 3, 450900),
(450923, '博白县', 3, 450900),
(450924, '兴业县', 3, 450900),
(450981, '北流市', 3, 450900),
(451001, '市辖区', 3, 451000),
(451002, '右江区', 3, 451000),
(451021, '田阳县', 3, 451000),
(451022, '田东县', 3, 451000),
(451023, '平果县', 3, 451000),
(451024, '德保县', 3, 451000),
(451025, '靖西县', 3, 451000),
(451026, '那坡县', 3, 451000),
(451027, '凌云县', 3, 451000),
(451028, '乐业县', 3, 451000),
(451029, '田林县', 3, 451000),
(451030, '西林县', 3, 451000),
(451031, '隆林各族自治县', 3, 451000),
(451101, '市辖区', 3, 451100),
(451102, '八步区', 3, 451100),
(451121, '昭平县', 3, 451100),
(451122, '钟山县', 3, 451100),
(451123, '富川瑶族自治县', 3, 451100),
(451201, '市辖区', 3, 451200),
(451202, '金城江区', 3, 451200),
(451221, '南丹县', 3, 451200),
(451222, '天峨县', 3, 451200),
(451223, '凤山县', 3, 451200),
(451224, '东兰县', 3, 451200),
(451225, '罗城仫佬族自治县', 3, 451200),
(451226, '环江毛南族自治县', 3, 451200),
(451227, '巴马瑶族自治县', 3, 451200),
(451228, '都安瑶族自治县', 3, 451200),
(451229, '大化瑶族自治县', 3, 451200),
(451281, '宜州市', 3, 451200),
(451301, '市辖区', 3, 451300),
(451302, '兴宾区', 3, 451300),
(451321, '忻城县', 3, 451300),
(451322, '象州县', 3, 451300),
(451323, '武宣县', 3, 451300),
(451324, '金秀瑶族自治县', 3, 451300),
(451381, '合山市', 3, 451300),
(451401, '市辖区', 3, 451400),
(451402, '江洲区', 3, 451400),
(451421, '扶绥县', 3, 451400),
(451422, '宁明县', 3, 451400),
(451423, '龙州县', 3, 451400),
(451424, '大新县', 3, 451400),
(451425, '天等县', 3, 451400),
(451481, '凭祥市', 3, 451400),
(460101, '市辖区', 3, 460100),
(460105, '秀英区', 3, 460100),
(460106, '龙华区', 3, 460100),
(460107, '琼山区', 3, 460100),
(460108, '美兰区', 3, 460100),
(460201, '市辖区', 3, 460200),
(469001, '五指山市', 3, 469000),
(469002, '琼海市', 3, 469000),
(469003, '儋州市', 3, 469000),
(469005, '文昌市', 3, 469000),
(469006, '万宁市', 3, 469000),
(469007, '东方市', 3, 469000),
(469025, '定安县', 3, 469000),
(469026, '屯昌县', 3, 469000),
(469027, '澄迈县', 3, 469000),
(469028, '临高县', 3, 469000),
(469030, '白沙黎族自治县', 3, 469000),
(469031, '昌江黎族自治县', 3, 469000),
(469033, '乐东黎族自治县', 3, 469000),
(469034, '陵水黎族自治县', 3, 469000),
(469035, '保亭黎族苗族自治县', 3, 469000),
(469036, '琼中黎族苗族自治县', 3, 469000),
(469037, '西沙群岛', 3, 469000),
(469038, '南沙群岛', 3, 469000),
(469039, '中沙群岛的岛礁及其海域', 3, 469000),
(500101, '万州区', 3, 500100),
(500102, '涪陵区', 3, 500100),
(500103, '渝中区', 3, 500100),
(500104, '大渡口区', 3, 500100),
(500105, '江北区', 3, 500100),
(500106, '沙坪坝区', 3, 500100),
(500107, '九龙坡区', 3, 500100),
(500108, '南岸区', 3, 500100),
(500109, '北碚区', 3, 500100),
(500110, '万盛区', 3, 500100),
(500111, '双桥区', 3, 500100),
(500112, '渝北区', 3, 500100),
(500113, '巴南区', 3, 500100),
(500114, '黔江区', 3, 500100),
(500115, '长寿区', 3, 500100),
(500222, '綦江县', 3, 500200),
(500223, '潼南县', 3, 500200),
(500224, '铜梁县', 3, 500200),
(500225, '大足县', 3, 500200),
(500226, '荣昌县', 3, 500200),
(500227, '璧山县', 3, 500200),
(500228, '梁平县', 3, 500200),
(500229, '城口县', 3, 500200),
(500230, '丰都县', 3, 500200),
(500231, '垫江县', 3, 500200),
(500232, '武隆县', 3, 500200),
(500233, '忠 县', 3, 500200),
(500234, '开 县', 3, 500200),
(500235, '云阳县', 3, 500200),
(500236, '奉节县', 3, 500200),
(500237, '巫山县', 3, 500200),
(500238, '巫溪县', 3, 500200),
(500240, '石柱土家族自治县', 3, 500200),
(500241, '秀山土家族苗族自治县', 3, 500200),
(500242, '酉阳土家族苗族自治县', 3, 500200),
(500243, '彭水苗族土家族自治县', 3, 500200),
(500381, '江津市', 3, 500300),
(500382, '合川市', 3, 500300),
(500383, '永川市', 3, 500300),
(500384, '南川市', 3, 500300),
(510101, '市辖区', 3, 510100),
(510104, '锦江区', 3, 510100),
(510105, '青羊区', 3, 510100),
(510106, '金牛区', 3, 510100),
(510107, '武侯区', 3, 510100),
(510108, '成华区', 3, 510100),
(510112, '龙泉驿区', 3, 510100),
(510113, '青白江区', 3, 510100),
(510114, '新都区', 3, 510100),
(510115, '温江区', 3, 510100),
(510121, '金堂县', 3, 510100),
(510122, '双流县', 3, 510100),
(510124, '郫 县', 3, 510100),
(510129, '大邑县', 3, 510100),
(510131, '蒲江县', 3, 510100),
(510132, '新津县', 3, 510100),
(510181, '都江堰市', 3, 510100),
(510182, '彭州市', 3, 510100),
(510183, '邛崃市', 3, 510100),
(510184, '崇州市', 3, 510100),
(510301, '市辖区', 3, 510300),
(510302, '自流井区', 3, 510300),
(510303, '贡井区', 3, 510300),
(510304, '大安区', 3, 510300),
(510311, '沿滩区', 3, 510300),
(510321, '荣 县', 3, 510300),
(510322, '富顺县', 3, 510300),
(510401, '市辖区', 3, 510400),
(510402, '东 区', 3, 510400),
(510403, '西 区', 3, 510400),
(510411, '仁和区', 3, 510400),
(510421, '米易县', 3, 510400),
(510422, '盐边县', 3, 510400),
(510501, '市辖区', 3, 510500),
(510502, '江阳区', 3, 510500),
(510503, '纳溪区', 3, 510500),
(510504, '龙马潭区', 3, 510500),
(510521, '泸 县', 3, 510500),
(510522, '合江县', 3, 510500),
(510524, '叙永县', 3, 510500),
(510525, '古蔺县', 3, 510500),
(510601, '市辖区', 3, 510600),
(510603, '旌阳区', 3, 510600),
(510623, '中江县', 3, 510600),
(510626, '罗江县', 3, 510600),
(510681, '广汉市', 3, 510600),
(510682, '什邡市', 3, 510600),
(510683, '绵竹市', 3, 510600),
(510701, '市辖区', 3, 510700),
(510703, '涪城区', 3, 510700),
(510704, '游仙区', 3, 510700),
(510722, '三台县', 3, 510700),
(510723, '盐亭县', 3, 510700),
(510724, '安 县', 3, 510700),
(510725, '梓潼县', 3, 510700),
(510726, '北川羌族自治县', 3, 510700),
(510727, '平武县', 3, 510700),
(510781, '江油市', 3, 510700),
(510801, '市辖区', 3, 510800),
(510802, '市中区', 3, 510800),
(510811, '元坝区', 3, 510800),
(510812, '朝天区', 3, 510800),
(510821, '旺苍县', 3, 510800),
(510822, '青川县', 3, 510800),
(510823, '剑阁县', 3, 510800),
(510824, '苍溪县', 3, 510800),
(510901, '市辖区', 3, 510900),
(510903, '船山区', 3, 510900),
(510904, '安居区', 3, 510900),
(510921, '蓬溪县', 3, 510900),
(510922, '射洪县', 3, 510900),
(510923, '大英县', 3, 510900),
(511001, '市辖区', 3, 511000),
(511002, '市中区', 3, 511000),
(511011, '东兴区', 3, 511000),
(511024, '威远县', 3, 511000),
(511025, '资中县', 3, 511000),
(511028, '隆昌县', 3, 511000),
(511101, '市辖区', 3, 511100),
(511102, '市中区', 3, 511100),
(511111, '沙湾区', 3, 511100),
(511112, '五通桥区', 3, 511100),
(511113, '金口河区', 3, 511100),
(511123, '犍为县', 3, 511100),
(511124, '井研县', 3, 511100),
(511126, '夹江县', 3, 511100),
(511129, '沐川县', 3, 511100),
(511132, '峨边彝族自治县', 3, 511100),
(511133, '马边彝族自治县', 3, 511100),
(511181, '峨眉山市', 3, 511100),
(511301, '市辖区', 3, 511300),
(511302, '顺庆区', 3, 511300),
(511303, '高坪区', 3, 511300),
(511304, '嘉陵区', 3, 511300),
(511321, '南部县', 3, 511300),
(511322, '营山县', 3, 511300),
(511323, '蓬安县', 3, 511300),
(511324, '仪陇县', 3, 511300),
(511325, '西充县', 3, 511300),
(511381, '阆中市', 3, 511300),
(511401, '市辖区', 3, 511400),
(511402, '东坡区', 3, 511400),
(511421, '仁寿县', 3, 511400),
(511422, '彭山县', 3, 511400),
(511423, '洪雅县', 3, 511400),
(511424, '丹棱县', 3, 511400),
(511425, '青神县', 3, 511400),
(511501, '市辖区', 3, 511500),
(511502, '翠屏区', 3, 511500),
(511521, '宜宾县', 3, 511500),
(511522, '南溪县', 3, 511500),
(511523, '江安县', 3, 511500),
(511524, '长宁县', 3, 511500),
(511525, '高 县', 3, 511500),
(511526, '珙 县', 3, 511500),
(511527, '筠连县', 3, 511500),
(511528, '兴文县', 3, 511500),
(511529, '屏山县', 3, 511500),
(511601, '市辖区', 3, 511600),
(511602, '广安区', 3, 511600),
(511621, '岳池县', 3, 511600),
(511622, '武胜县', 3, 511600),
(511623, '邻水县', 3, 511600),
(511681, '华莹市', 3, 511600),
(511701, '市辖区', 3, 511700),
(511702, '通川区', 3, 511700),
(511721, '达 县', 3, 511700),
(511722, '宣汉县', 3, 511700),
(511723, '开江县', 3, 511700),
(511724, '大竹县', 3, 511700),
(511725, '渠 县', 3, 511700),
(511781, '万源市', 3, 511700),
(511801, '市辖区', 3, 511800),
(511802, '雨城区', 3, 511800),
(511821, '名山县', 3, 511800),
(511822, '荥经县', 3, 511800),
(511823, '汉源县', 3, 511800),
(511824, '石棉县', 3, 511800),
(511825, '天全县', 3, 511800),
(511826, '芦山县', 3, 511800),
(511827, '宝兴县', 3, 511800),
(511901, '市辖区', 3, 511900),
(511902, '巴州区', 3, 511900),
(511921, '通江县', 3, 511900),
(511922, '南江县', 3, 511900),
(511923, '平昌县', 3, 511900),
(512001, '市辖区', 3, 512000),
(512002, '雁江区', 3, 512000),
(512021, '安岳县', 3, 512000),
(512022, '乐至县', 3, 512000),
(512081, '简阳市', 3, 512000),
(513221, '汶川县', 3, 513200),
(513222, '理 县', 3, 513200),
(513223, '茂 县', 3, 513200),
(513224, '松潘县', 3, 513200),
(513225, '九寨沟县', 3, 513200),
(513226, '金川县', 3, 513200),
(513227, '小金县', 3, 513200),
(513228, '黑水县', 3, 513200),
(513229, '马尔康县', 3, 513200),
(513230, '壤塘县', 3, 513200),
(513231, '阿坝县', 3, 513200),
(513232, '若尔盖县', 3, 513200),
(513233, '红原县', 3, 513200),
(513321, '康定县', 3, 513300),
(513322, '泸定县', 3, 513300),
(513323, '丹巴县', 3, 513300),
(513324, '九龙县', 3, 513300),
(513325, '雅江县', 3, 513300),
(513326, '道孚县', 3, 513300),
(513327, '炉霍县', 3, 513300),
(513328, '甘孜县', 3, 513300),
(513329, '新龙县', 3, 513300),
(513330, '德格县', 3, 513300),
(513331, '白玉县', 3, 513300),
(513332, '石渠县', 3, 513300),
(513333, '色达县', 3, 513300),
(513334, '理塘县', 3, 513300),
(513335, '巴塘县', 3, 513300),
(513336, '乡城县', 3, 513300),
(513337, '稻城县', 3, 513300),
(513338, '得荣县', 3, 513300),
(513401, '西昌市', 3, 513400),
(513422, '木里藏族自治县', 3, 513400),
(513423, '盐源县', 3, 513400),
(513424, '德昌县', 3, 513400),
(513425, '会理县', 3, 513400),
(513426, '会东县', 3, 513400),
(513427, '宁南县', 3, 513400),
(513428, '普格县', 3, 513400),
(513429, '布拖县', 3, 513400),
(513430, '金阳县', 3, 513400),
(513431, '昭觉县', 3, 513400),
(513432, '喜德县', 3, 513400),
(513433, '冕宁县', 3, 513400),
(513434, '越西县', 3, 513400),
(513435, '甘洛县', 3, 513400),
(513436, '美姑县', 3, 513400),
(513437, '雷波县', 3, 513400),
(520101, '市辖区', 3, 520100),
(520102, '南明区', 3, 520100),
(520103, '云岩区', 3, 520100),
(520111, '花溪区', 3, 520100),
(520112, '乌当区', 3, 520100),
(520113, '白云区', 3, 520100),
(520114, '小河区', 3, 520100),
(520121, '开阳县', 3, 520100),
(520122, '息烽县', 3, 520100),
(520123, '修文县', 3, 520100),
(520181, '清镇市', 3, 520100),
(520201, '钟山区', 3, 520200),
(520203, '六枝特区', 3, 520200),
(520221, '水城县', 3, 520200),
(520222, '盘 县', 3, 520200),
(520301, '市辖区', 3, 520300),
(520302, '红花岗区', 3, 520300),
(520303, '汇川区', 3, 520300),
(520321, '遵义县', 3, 520300),
(520322, '桐梓县', 3, 520300),
(520323, '绥阳县', 3, 520300),
(520324, '正安县', 3, 520300),
(520325, '道真仡佬族苗族自治县', 3, 520300),
(520326, '务川仡佬族苗族自治县', 3, 520300),
(520327, '凤冈县', 3, 520300),
(520328, '湄潭县', 3, 520300),
(520329, '余庆县', 3, 520300),
(520330, '习水县', 3, 520300),
(520381, '赤水市', 3, 520300),
(520382, '仁怀市', 3, 520300),
(520401, '市辖区', 3, 520400),
(520402, '西秀区', 3, 520400),
(520421, '平坝县', 3, 520400),
(520422, '普定县', 3, 520400),
(520423, '镇宁布依族苗族自治县', 3, 520400),
(520424, '关岭布依族苗族自治县', 3, 520400),
(520425, '紫云苗族布依族自治县', 3, 520400),
(522201, '铜仁市', 3, 522200),
(522222, '江口县', 3, 522200),
(522223, '玉屏侗族自治县', 3, 522200),
(522224, '石阡县', 3, 522200),
(522225, '思南县', 3, 522200),
(522226, '印江土家族苗族自治县', 3, 522200),
(522227, '德江县', 3, 522200),
(522228, '沿河土家族自治县', 3, 522200),
(522229, '松桃苗族自治县', 3, 522200),
(522230, '万山特区', 3, 522200),
(522301, '兴义市', 3, 522300),
(522322, '兴仁县', 3, 522300),
(522323, '普安县', 3, 522300),
(522324, '晴隆县', 3, 522300),
(522325, '贞丰县', 3, 522300),
(522326, '望谟县', 3, 522300),
(522327, '册亨县', 3, 522300),
(522328, '安龙县', 3, 522300),
(522401, '毕节市', 3, 522400),
(522422, '大方县', 3, 522400),
(522423, '黔西县', 3, 522400),
(522424, '金沙县', 3, 522400),
(522425, '织金县', 3, 522400),
(522426, '纳雍县', 3, 522400),
(522427, '威宁彝族回族苗族自治县', 3, 522400),
(522428, '赫章县', 3, 522400),
(522601, '凯里市', 3, 522600),
(522622, '黄平县', 3, 522600),
(522623, '施秉县', 3, 522600),
(522624, '三穗县', 3, 522600),
(522625, '镇远县', 3, 522600),
(522626, '岑巩县', 3, 522600),
(522627, '天柱县', 3, 522600),
(522628, '锦屏县', 3, 522600),
(522629, '剑河县', 3, 522600),
(522630, '台江县', 3, 522600),
(522631, '黎平县', 3, 522600),
(522632, '榕江县', 3, 522600),
(522633, '从江县', 3, 522600),
(522634, '雷山县', 3, 522600),
(522635, '麻江县', 3, 522600),
(522636, '丹寨县', 3, 522600),
(522701, '都匀市', 3, 522700),
(522702, '福泉市', 3, 522700),
(522722, '荔波县', 3, 522700),
(522723, '贵定县', 3, 522700),
(522725, '瓮安县', 3, 522700),
(522726, '独山县', 3, 522700),
(522727, '平塘县', 3, 522700),
(522728, '罗甸县', 3, 522700),
(522729, '长顺县', 3, 522700),
(522730, '龙里县', 3, 522700),
(522731, '惠水县', 3, 522700),
(522732, '三都水族自治县', 3, 522700),
(530101, '市辖区', 3, 530100),
(530102, '五华区', 3, 530100),
(530103, '盘龙区', 3, 530100),
(530111, '官渡区', 3, 530100),
(530112, '西山区', 3, 530100),
(530113, '东川区', 3, 530100),
(530121, '呈贡县', 3, 530100),
(530122, '晋宁县', 3, 530100),
(530124, '富民县', 3, 530100),
(530125, '宜良县', 3, 530100),
(530126, '石林彝族自治县', 3, 530100),
(530127, '嵩明县', 3, 530100),
(530128, '禄劝彝族苗族自治县', 3, 530100),
(530129, '寻甸回族彝族自治县', 3, 530100),
(530181, '安宁市', 3, 530100),
(530301, '市辖区', 3, 530300),
(530302, '麒麟区', 3, 530300),
(530321, '马龙县', 3, 530300),
(530322, '陆良县', 3, 530300),
(530323, '师宗县', 3, 530300),
(530324, '罗平县', 3, 530300),
(530325, '富源县', 3, 530300),
(530326, '会泽县', 3, 530300),
(530328, '沾益县', 3, 530300),
(530381, '宣威市', 3, 530300),
(530401, '市辖区', 3, 530400),
(530402, '红塔区', 3, 530400),
(530421, '江川县', 3, 530400),
(530422, '澄江县', 3, 530400),
(530423, '通海县', 3, 530400),
(530424, '华宁县', 3, 530400),
(530425, '易门县', 3, 530400),
(530426, '峨山彝族自治县', 3, 530400),
(530427, '新平彝族傣族自治县', 3, 530400),
(530428, '元江哈尼族彝族傣族自治县', 3, 530400),
(530501, '市辖区', 3, 530500),
(530502, '隆阳区', 3, 530500),
(530521, '施甸县', 3, 530500),
(530522, '腾冲县', 3, 530500),
(530523, '龙陵县', 3, 530500),
(530524, '昌宁县', 3, 530500),
(530601, '市辖区', 3, 530600),
(530602, '昭阳区', 3, 530600),
(530621, '鲁甸县', 3, 530600),
(530622, '巧家县', 3, 530600),
(530623, '盐津县', 3, 530600),
(530624, '大关县', 3, 530600),
(530625, '永善县', 3, 530600),
(530626, '绥江县', 3, 530600),
(530627, '镇雄县', 3, 530600),
(530628, '彝良县', 3, 530600),
(530629, '威信县', 3, 530600),
(530630, '水富县', 3, 530600),
(530701, '市辖区', 3, 530700),
(530702, '古城区', 3, 530700),
(530721, '玉龙纳西族自治县', 3, 530700),
(530722, '永胜县', 3, 530700),
(530723, '华坪县', 3, 530700),
(530724, '宁蒗彝族自治县', 3, 530700),
(530801, '市辖区', 3, 530800),
(530802, '翠云区', 3, 530800),
(530821, '普洱哈尼族彝族自治县', 3, 530800),
(530822, '墨江哈尼族自治县', 3, 530800),
(530823, '景东彝族自治县', 3, 530800),
(530824, '景谷傣族彝族自治县', 3, 530800),
(530825, '镇沅彝族哈尼族拉祜族自治县', 3, 530800),
(530826, '江城哈尼族彝族自治县', 3, 530800),
(530827, '孟连傣族拉祜族佤族自治县', 3, 530800),
(530828, '澜沧拉祜族自治县', 3, 530800),
(530829, '西盟佤族自治县', 3, 530800),
(530901, '市辖区', 3, 530900),
(530902, '临翔区', 3, 530900),
(530921, '凤庆县', 3, 530900),
(530922, '云 县', 3, 530900),
(530923, '永德县', 3, 530900),
(530924, '镇康县', 3, 530900),
(530925, '双江拉祜族佤族布朗族傣族自治县', 3, 530900),
(530926, '耿马傣族佤族自治县', 3, 530900),
(530927, '沧源佤族自治县', 3, 530900),
(532301, '楚雄市', 3, 532300),
(532322, '双柏县', 3, 532300),
(532323, '牟定县', 3, 532300),
(532324, '南华县', 3, 532300),
(532325, '姚安县', 3, 532300),
(532326, '大姚县', 3, 532300),
(532327, '永仁县', 3, 532300),
(532328, '元谋县', 3, 532300),
(532329, '武定县', 3, 532300),
(532331, '禄丰县', 3, 532300),
(532501, '个旧市', 3, 532500),
(532502, '开远市', 3, 532500),
(532522, '蒙自县', 3, 532500),
(532523, '屏边苗族自治县', 3, 532500),
(532524, '建水县', 3, 532500),
(532525, '石屏县', 3, 532500),
(532526, '弥勒县', 3, 532500),
(532527, '泸西县', 3, 532500),
(532528, '元阳县', 3, 532500),
(532529, '红河县', 3, 532500),
(532530, '金平苗族瑶族傣族自治县', 3, 532500),
(532531, '绿春县', 3, 532500),
(532532, '河口瑶族自治县', 3, 532500),
(532621, '文山县', 3, 532600),
(532622, '砚山县', 3, 532600),
(532623, '西畴县', 3, 532600),
(532624, '麻栗坡县', 3, 532600),
(532625, '马关县', 3, 532600),
(532626, '丘北县', 3, 532600),
(532627, '广南县', 3, 532600),
(532628, '富宁县', 3, 532600),
(532801, '景洪市', 3, 532800),
(532822, '勐海县', 3, 532800);
INSERT INTO `thinkox_district` (`id`, `name`, `level`, `upid`) VALUES
(532823, '勐腊县', 3, 532800),
(532901, '大理市', 3, 532900),
(532922, '漾濞彝族自治县', 3, 532900),
(532923, '祥云县', 3, 532900),
(532924, '宾川县', 3, 532900),
(532925, '弥渡县', 3, 532900),
(532926, '南涧彝族自治县', 3, 532900),
(532927, '巍山彝族回族自治县', 3, 532900),
(532928, '永平县', 3, 532900),
(532929, '云龙县', 3, 532900),
(532930, '洱源县', 3, 532900),
(532931, '剑川县', 3, 532900),
(532932, '鹤庆县', 3, 532900),
(533102, '瑞丽市', 3, 533100),
(533103, '潞西市', 3, 533100),
(533122, '梁河县', 3, 533100),
(533123, '盈江县', 3, 533100),
(533124, '陇川县', 3, 533100),
(533321, '泸水县', 3, 533300),
(533323, '福贡县', 3, 533300),
(533324, '贡山独龙族怒族自治县', 3, 533300),
(533325, '兰坪白族普米族自治县', 3, 533300),
(533421, '香格里拉县', 3, 533400),
(533422, '德钦县', 3, 533400),
(533423, '维西傈僳族自治县', 3, 533400),
(540101, '市辖区', 3, 540100),
(540102, '城关区', 3, 540100),
(540121, '林周县', 3, 540100),
(540122, '当雄县', 3, 540100),
(540123, '尼木县', 3, 540100),
(540124, '曲水县', 3, 540100),
(540125, '堆龙德庆县', 3, 540100),
(540126, '达孜县', 3, 540100),
(540127, '墨竹工卡县', 3, 540100),
(542121, '昌都县', 3, 542100),
(542122, '江达县', 3, 542100),
(542123, '贡觉县', 3, 542100),
(542124, '类乌齐县', 3, 542100),
(542125, '丁青县', 3, 542100),
(542126, '察雅县', 3, 542100),
(542127, '八宿县', 3, 542100),
(542128, '左贡县', 3, 542100),
(542129, '芒康县', 3, 542100),
(542132, '洛隆县', 3, 542100),
(542133, '边坝县', 3, 542100),
(542221, '乃东县', 3, 542200),
(542222, '扎囊县', 3, 542200),
(542223, '贡嘎县', 3, 542200),
(542224, '桑日县', 3, 542200),
(542225, '琼结县', 3, 542200),
(542226, '曲松县', 3, 542200),
(542227, '措美县', 3, 542200),
(542228, '洛扎县', 3, 542200),
(542229, '加查县', 3, 542200),
(542231, '隆子县', 3, 542200),
(542232, '错那县', 3, 542200),
(542233, '浪卡子县', 3, 542200),
(542301, '日喀则市', 3, 542300),
(542322, '南木林县', 3, 542300),
(542323, '江孜县', 3, 542300),
(542324, '定日县', 3, 542300),
(542325, '萨迦县', 3, 542300),
(542326, '拉孜县', 3, 542300),
(542327, '昂仁县', 3, 542300),
(542328, '谢通门县', 3, 542300),
(542329, '白朗县', 3, 542300),
(542330, '仁布县', 3, 542300),
(542331, '康马县', 3, 542300),
(542332, '定结县', 3, 542300),
(542333, '仲巴县', 3, 542300),
(542334, '亚东县', 3, 542300),
(542335, '吉隆县', 3, 542300),
(542336, '聂拉木县', 3, 542300),
(542337, '萨嘎县', 3, 542300),
(542338, '岗巴县', 3, 542300),
(542421, '那曲县', 3, 542400),
(542422, '嘉黎县', 3, 542400),
(542423, '比如县', 3, 542400),
(542424, '聂荣县', 3, 542400),
(542425, '安多县', 3, 542400),
(542426, '申扎县', 3, 542400),
(542427, '索 县', 3, 542400),
(542428, '班戈县', 3, 542400),
(542429, '巴青县', 3, 542400),
(542430, '尼玛县', 3, 542400),
(542521, '普兰县', 3, 542500),
(542522, '札达县', 3, 542500),
(542523, '噶尔县', 3, 542500),
(542524, '日土县', 3, 542500),
(542525, '革吉县', 3, 542500),
(542526, '改则县', 3, 542500),
(542527, '措勤县', 3, 542500),
(542621, '林芝县', 3, 542600),
(542622, '工布江达县', 3, 542600),
(542623, '米林县', 3, 542600),
(542624, '墨脱县', 3, 542600),
(542625, '波密县', 3, 542600),
(542626, '察隅县', 3, 542600),
(542627, '朗 县', 3, 542600),
(610101, '市辖区', 3, 610100),
(610102, '新城区', 3, 610100),
(610103, '碑林区', 3, 610100),
(610104, '莲湖区', 3, 610100),
(610111, '灞桥区', 3, 610100),
(610112, '未央区', 3, 610100),
(610113, '雁塔区', 3, 610100),
(610114, '阎良区', 3, 610100),
(610115, '临潼区', 3, 610100),
(610116, '长安区', 3, 610100),
(610122, '蓝田县', 3, 610100),
(610124, '周至县', 3, 610100),
(610125, '户 县', 3, 610100),
(610126, '高陵县', 3, 610100),
(610201, '市辖区', 3, 610200),
(610202, '王益区', 3, 610200),
(610203, '印台区', 3, 610200),
(610204, '耀州区', 3, 610200),
(610222, '宜君县', 3, 610200),
(610301, '市辖区', 3, 610300),
(610302, '渭滨区', 3, 610300),
(610303, '金台区', 3, 610300),
(610304, '陈仓区', 3, 610300),
(610322, '凤翔县', 3, 610300),
(610323, '岐山县', 3, 610300),
(610324, '扶风县', 3, 610300),
(610326, '眉 县', 3, 610300),
(610327, '陇 县', 3, 610300),
(610328, '千阳县', 3, 610300),
(610329, '麟游县', 3, 610300),
(610330, '凤 县', 3, 610300),
(610331, '太白县', 3, 610300),
(610401, '市辖区', 3, 610400),
(610402, '秦都区', 3, 610400),
(610403, '杨凌区', 3, 610400),
(610404, '渭城区', 3, 610400),
(610422, '三原县', 3, 610400),
(610423, '泾阳县', 3, 610400),
(610424, '乾 县', 3, 610400),
(610425, '礼泉县', 3, 610400),
(610426, '永寿县', 3, 610400),
(610427, '彬 县', 3, 610400),
(610428, '长武县', 3, 610400),
(610429, '旬邑县', 3, 610400),
(610430, '淳化县', 3, 610400),
(610431, '武功县', 3, 610400),
(610481, '兴平市', 3, 610400),
(610501, '市辖区', 3, 610500),
(610502, '临渭区', 3, 610500),
(610521, '华 县', 3, 610500),
(610522, '潼关县', 3, 610500),
(610523, '大荔县', 3, 610500),
(610524, '合阳县', 3, 610500),
(610525, '澄城县', 3, 610500),
(610526, '蒲城县', 3, 610500),
(610527, '白水县', 3, 610500),
(610528, '富平县', 3, 610500),
(610581, '韩城市', 3, 610500),
(610582, '华阴市', 3, 610500),
(610601, '市辖区', 3, 610600),
(610602, '宝塔区', 3, 610600),
(610621, '延长县', 3, 610600),
(610622, '延川县', 3, 610600),
(610623, '子长县', 3, 610600),
(610624, '安塞县', 3, 610600),
(610625, '志丹县', 3, 610600),
(610626, '吴旗县', 3, 610600),
(610627, '甘泉县', 3, 610600),
(610628, '富 县', 3, 610600),
(610629, '洛川县', 3, 610600),
(610630, '宜川县', 3, 610600),
(610631, '黄龙县', 3, 610600),
(610632, '黄陵县', 3, 610600),
(610701, '市辖区', 3, 610700),
(610702, '汉台区', 3, 610700),
(610721, '南郑县', 3, 610700),
(610722, '城固县', 3, 610700),
(610723, '洋 县', 3, 610700),
(610724, '西乡县', 3, 610700),
(610725, '勉 县', 3, 610700),
(610726, '宁强县', 3, 610700),
(610727, '略阳县', 3, 610700),
(610728, '镇巴县', 3, 610700),
(610729, '留坝县', 3, 610700),
(610730, '佛坪县', 3, 610700),
(610801, '市辖区', 3, 610800),
(610802, '榆阳区', 3, 610800),
(610821, '神木县', 3, 610800),
(610822, '府谷县', 3, 610800),
(610823, '横山县', 3, 610800),
(610824, '靖边县', 3, 610800),
(610825, '定边县', 3, 610800),
(610826, '绥德县', 3, 610800),
(610827, '米脂县', 3, 610800),
(610828, '佳 县', 3, 610800),
(610829, '吴堡县', 3, 610800),
(610830, '清涧县', 3, 610800),
(610831, '子洲县', 3, 610800),
(610901, '市辖区', 3, 610900),
(610902, '汉滨区', 3, 610900),
(610921, '汉阴县', 3, 610900),
(610922, '石泉县', 3, 610900),
(610923, '宁陕县', 3, 610900),
(610924, '紫阳县', 3, 610900),
(610925, '岚皋县', 3, 610900),
(610926, '平利县', 3, 610900),
(610927, '镇坪县', 3, 610900),
(610928, '旬阳县', 3, 610900),
(610929, '白河县', 3, 610900),
(611001, '市辖区', 3, 611000),
(611002, '商州区', 3, 611000),
(611021, '洛南县', 3, 611000),
(611022, '丹凤县', 3, 611000),
(611023, '商南县', 3, 611000),
(611024, '山阳县', 3, 611000),
(611025, '镇安县', 3, 611000),
(611026, '柞水县', 3, 611000),
(620101, '市辖区', 3, 620100),
(620102, '城关区', 3, 620100),
(620103, '七里河区', 3, 620100),
(620104, '西固区', 3, 620100),
(620105, '安宁区', 3, 620100),
(620111, '红古区', 3, 620100),
(620121, '永登县', 3, 620100),
(620122, '皋兰县', 3, 620100),
(620123, '榆中县', 3, 620100),
(620201, '市辖区', 3, 620200),
(620301, '市辖区', 3, 620300),
(620302, '金川区', 3, 620300),
(620321, '永昌县', 3, 620300),
(620401, '市辖区', 3, 620400),
(620402, '白银区', 3, 620400),
(620403, '平川区', 3, 620400),
(620421, '靖远县', 3, 620400),
(620422, '会宁县', 3, 620400),
(620423, '景泰县', 3, 620400),
(620501, '市辖区', 3, 620500),
(620502, '秦城区', 3, 620500),
(620503, '北道区', 3, 620500),
(620521, '清水县', 3, 620500),
(620522, '秦安县', 3, 620500),
(620523, '甘谷县', 3, 620500),
(620524, '武山县', 3, 620500),
(620525, '张家川回族自治县', 3, 620500),
(620601, '市辖区', 3, 620600),
(620602, '凉州区', 3, 620600),
(620621, '民勤县', 3, 620600),
(620622, '古浪县', 3, 620600),
(620623, '天祝藏族自治县', 3, 620600),
(620701, '市辖区', 3, 620700),
(620702, '甘州区', 3, 620700),
(620721, '肃南裕固族自治县', 3, 620700),
(620722, '民乐县', 3, 620700),
(620723, '临泽县', 3, 620700),
(620724, '高台县', 3, 620700),
(620725, '山丹县', 3, 620700),
(620801, '市辖区', 3, 620800),
(620802, '崆峒区', 3, 620800),
(620821, '泾川县', 3, 620800),
(620822, '灵台县', 3, 620800),
(620823, '崇信县', 3, 620800),
(620824, '华亭县', 3, 620800),
(620825, '庄浪县', 3, 620800),
(620826, '静宁县', 3, 620800),
(620901, '市辖区', 3, 620900),
(620902, '肃州区', 3, 620900),
(620921, '金塔县', 3, 620900),
(620922, '安西县', 3, 620900),
(620923, '肃北蒙古族自治县', 3, 620900),
(620924, '阿克塞哈萨克族自治县', 3, 620900),
(620981, '玉门市', 3, 620900),
(620982, '敦煌市', 3, 620900),
(621001, '市辖区', 3, 621000),
(621002, '西峰区', 3, 621000),
(621021, '庆城县', 3, 621000),
(621022, '环 县', 3, 621000),
(621023, '华池县', 3, 621000),
(621024, '合水县', 3, 621000),
(621025, '正宁县', 3, 621000),
(621026, '宁 县', 3, 621000),
(621027, '镇原县', 3, 621000),
(621101, '市辖区', 3, 621100),
(621102, '安定区', 3, 621100),
(621121, '通渭县', 3, 621100),
(621122, '陇西县', 3, 621100),
(621123, '渭源县', 3, 621100),
(621124, '临洮县', 3, 621100),
(621125, '漳 县', 3, 621100),
(621126, '岷 县', 3, 621100),
(621201, '市辖区', 3, 621200),
(621202, '武都区', 3, 621200),
(621221, '成 县', 3, 621200),
(621222, '文 县', 3, 621200),
(621223, '宕昌县', 3, 621200),
(621224, '康 县', 3, 621200),
(621225, '西和县', 3, 621200),
(621226, '礼 县', 3, 621200),
(621227, '徽 县', 3, 621200),
(621228, '两当县', 3, 621200),
(622901, '临夏市', 3, 622900),
(622921, '临夏县', 3, 622900),
(622922, '康乐县', 3, 622900),
(622923, '永靖县', 3, 622900),
(622924, '广河县', 3, 622900),
(622925, '和政县', 3, 622900),
(622926, '东乡族自治县', 3, 622900),
(622927, '积石山保安族东乡族撒拉族自治县', 3, 622900),
(623001, '合作市', 3, 623000),
(623021, '临潭县', 3, 623000),
(623022, '卓尼县', 3, 623000),
(623023, '舟曲县', 3, 623000),
(623024, '迭部县', 3, 623000),
(623025, '玛曲县', 3, 623000),
(623026, '碌曲县', 3, 623000),
(623027, '夏河县', 3, 623000),
(630101, '市辖区', 3, 630100),
(630102, '城东区', 3, 630100),
(630103, '城中区', 3, 630100),
(630104, '城西区', 3, 630100),
(630105, '城北区', 3, 630100),
(630121, '大通回族土族自治县', 3, 630100),
(630122, '湟中县', 3, 630100),
(630123, '湟源县', 3, 630100),
(632121, '平安县', 3, 632100),
(632122, '民和回族土族自治县', 3, 632100),
(632123, '乐都县', 3, 632100),
(632126, '互助土族自治县', 3, 632100),
(632127, '化隆回族自治县', 3, 632100),
(632128, '循化撒拉族自治县', 3, 632100),
(632221, '门源回族自治县', 3, 632200),
(632222, '祁连县', 3, 632200),
(632223, '海晏县', 3, 632200),
(632224, '刚察县', 3, 632200),
(632321, '同仁县', 3, 632300),
(632322, '尖扎县', 3, 632300),
(632323, '泽库县', 3, 632300),
(632324, '河南蒙古族自治县', 3, 632300),
(632521, '共和县', 3, 632500),
(632522, '同德县', 3, 632500),
(632523, '贵德县', 3, 632500),
(632524, '兴海县', 3, 632500),
(632525, '贵南县', 3, 632500),
(632621, '玛沁县', 3, 632600),
(632622, '班玛县', 3, 632600),
(632623, '甘德县', 3, 632600),
(632624, '达日县', 3, 632600),
(632625, '久治县', 3, 632600),
(632626, '玛多县', 3, 632600),
(632721, '玉树县', 3, 632700),
(632722, '杂多县', 3, 632700),
(632723, '称多县', 3, 632700),
(632724, '治多县', 3, 632700),
(632725, '囊谦县', 3, 632700),
(632726, '曲麻莱县', 3, 632700),
(632801, '格尔木市', 3, 632800),
(632802, '德令哈市', 3, 632800),
(632821, '乌兰县', 3, 632800),
(632822, '都兰县', 3, 632800),
(632823, '天峻县', 3, 632800),
(640101, '市辖区', 3, 640100),
(640104, '兴庆区', 3, 640100),
(640105, '西夏区', 3, 640100),
(640106, '金凤区', 3, 640100),
(640121, '永宁县', 3, 640100),
(640122, '贺兰县', 3, 640100),
(640181, '灵武市', 3, 640100),
(640201, '市辖区', 3, 640200),
(640202, '大武口区', 3, 640200),
(640205, '惠农区', 3, 640200),
(640221, '平罗县', 3, 640200),
(640301, '市辖区', 3, 640300),
(640302, '利通区', 3, 640300),
(640323, '盐池县', 3, 640300),
(640324, '同心县', 3, 640300),
(640381, '青铜峡市', 3, 640300),
(640401, '市辖区', 3, 640400),
(640402, '原州区', 3, 640400),
(640422, '西吉县', 3, 640400),
(640423, '隆德县', 3, 640400),
(640424, '泾源县', 3, 640400),
(640425, '彭阳县', 3, 640400),
(640501, '市辖区', 3, 640500),
(640502, '沙坡头区', 3, 640500),
(640521, '中宁县', 3, 640500),
(640522, '海原县', 3, 640500),
(650101, '市辖区', 3, 650100),
(650102, '天山区', 3, 650100),
(650103, '沙依巴克区', 3, 650100),
(650104, '新市区', 3, 650100),
(650105, '水磨沟区', 3, 650100),
(650106, '头屯河区', 3, 650100),
(650107, '达坂城区', 3, 650100),
(650108, '东山区', 3, 650100),
(650121, '乌鲁木齐县', 3, 650100),
(650201, '市辖区', 3, 650200),
(650202, '独山子区', 3, 650200),
(650203, '克拉玛依区', 3, 650200),
(650204, '白碱滩区', 3, 650200),
(650205, '乌尔禾区', 3, 650200),
(652101, '吐鲁番市', 3, 652100),
(652122, '鄯善县', 3, 652100),
(652123, '托克逊县', 3, 652100),
(652201, '哈密市', 3, 652200),
(652222, '巴里坤哈萨克自治县', 3, 652200),
(652223, '伊吾县', 3, 652200),
(652301, '昌吉市', 3, 652300),
(652302, '阜康市', 3, 652300),
(652303, '米泉市', 3, 652300),
(652323, '呼图壁县', 3, 652300),
(652324, '玛纳斯县', 3, 652300),
(652325, '奇台县', 3, 652300),
(652327, '吉木萨尔县', 3, 652300),
(652328, '木垒哈萨克自治县', 3, 652300),
(652701, '博乐市', 3, 652700),
(652722, '精河县', 3, 652700),
(652723, '温泉县', 3, 652700),
(652801, '库尔勒市', 3, 652800),
(652822, '轮台县', 3, 652800),
(652823, '尉犁县', 3, 652800),
(652824, '若羌县', 3, 652800),
(652825, '且末县', 3, 652800),
(652826, '焉耆回族自治县', 3, 652800),
(652827, '和静县', 3, 652800),
(652828, '和硕县', 3, 652800),
(652829, '博湖县', 3, 652800),
(652901, '阿克苏市', 3, 652900),
(652922, '温宿县', 3, 652900),
(652923, '库车县', 3, 652900),
(652924, '沙雅县', 3, 652900),
(652925, '新和县', 3, 652900),
(652926, '拜城县', 3, 652900),
(652927, '乌什县', 3, 652900),
(652928, '阿瓦提县', 3, 652900),
(652929, '柯坪县', 3, 652900),
(653001, '阿图什市', 3, 653000),
(653022, '阿克陶县', 3, 653000),
(653023, '阿合奇县', 3, 653000),
(653024, '乌恰县', 3, 653000),
(653101, '喀什市', 3, 653100),
(653121, '疏附县', 3, 653100),
(653122, '疏勒县', 3, 653100),
(653123, '英吉沙县', 3, 653100),
(653124, '泽普县', 3, 653100),
(653125, '莎车县', 3, 653100),
(653126, '叶城县', 3, 653100),
(653127, '麦盖提县', 3, 653100),
(653128, '岳普湖县', 3, 653100),
(653129, '伽师县', 3, 653100),
(653130, '巴楚县', 3, 653100),
(653131, '塔什库尔干塔吉克自治县', 3, 653100),
(653201, '和田市', 3, 653200),
(653221, '和田县', 3, 653200),
(653222, '墨玉县', 3, 653200),
(653223, '皮山县', 3, 653200),
(653224, '洛浦县', 3, 653200),
(653225, '策勒县', 3, 653200),
(653226, '于田县', 3, 653200),
(653227, '民丰县', 3, 653200),
(654002, '伊宁市', 3, 654000),
(654003, '奎屯市', 3, 654000),
(654021, '伊宁县', 3, 654000),
(654022, '察布查尔锡伯自治县', 3, 654000),
(654023, '霍城县', 3, 654000),
(654024, '巩留县', 3, 654000),
(654025, '新源县', 3, 654000),
(654026, '昭苏县', 3, 654000),
(654027, '特克斯县', 3, 654000),
(654028, '尼勒克县', 3, 654000),
(654201, '塔城市', 3, 654200),
(654202, '乌苏市', 3, 654200),
(654221, '额敏县', 3, 654200),
(654223, '沙湾县', 3, 654200),
(654224, '托里县', 3, 654200),
(654225, '裕民县', 3, 654200),
(654226, '和布克赛尔蒙古自治县', 3, 654200),
(654301, '阿勒泰市', 3, 654300),
(654321, '布尔津县', 3, 654300),
(654322, '富蕴县', 3, 654300),
(654323, '福海县', 3, 654300),
(654324, '哈巴河县', 3, 654300),
(654325, '青河县', 3, 654300),
(654326, '吉木乃县', 3, 654300),
(659001, '石河子市', 3, 659000),
(659002, '阿拉尔市', 3, 659000),
(659003, '图木舒克市', 3, 659000),
(659004, '五家渠市', 3, 659000),
(810001, '香港', 2, 810000),
(810002, '中西区', 3, 810001),
(810003, '九龙城区', 3, 810001),
(810004, '南区', 3, 810001),
(810005, '黄大仙区', 3, 810001),
(810006, '油尖旺区', 3, 810001),
(810007, '葵青区', 3, 810001),
(810008, '西贡区', 3, 810001),
(810009, '屯门区', 3, 810001),
(810010, '荃湾区', 3, 810001),
(810011, '东区', 3, 810001),
(810012, '观塘区', 3, 810001),
(810013, '深水步区', 3, 810001),
(810014, '湾仔区', 3, 810001),
(810015, '离岛区', 3, 810001),
(810016, '北区', 3, 810001),
(810017, '沙田区', 3, 810001),
(810018, '大埔区', 3, 810001),
(810019, '元朗区', 3, 810001),
(820001, '澳门', 2, 820000),
(820002, '澳门', 3, 820001),
(710001, '台北市', 2, 710000),
(710002, '台北县', 3, 710001),
(710003, '基隆市', 2, 710000),
(910005, '中山市', 3, 442000),
(710004, '花莲县', 3, 710003),
(910006, '东莞市', 3, 441900);
|
Java
|
package com.suscipio_solutions.consecro_mud.Commands;
import java.util.Vector;
import com.suscipio_solutions.consecro_mud.MOBS.interfaces.MOB;
import com.suscipio_solutions.consecro_mud.core.CMParms;
@SuppressWarnings("rawtypes")
public class NoFollow extends Follow
{
public NoFollow(){}
private final String[] access=I(new String[]{"NOFOLLOW","NOFOL"});
@Override public String[] getAccessWords(){return access;}
@Override
public boolean execute(MOB mob, Vector commands, int metaFlags)
throws java.io.IOException
{
if((commands.size()>1)&&(commands.elementAt(0) instanceof String))
{
if(((String)commands.elementAt(0)).equalsIgnoreCase("UNFOLLOW"))
{
unfollow(mob,((commands.size()>1)&&(commands.elementAt(1) instanceof String)&&(((String)commands.elementAt(1)).equalsIgnoreCase("QUIETLY"))));
return false;
}
MOB M=mob.fetchFollower(CMParms.combine(commands,1));
if((M==null)&&(mob.location()!=null))
{
M=mob.location().fetchInhabitant(CMParms.combine(commands,1));
if(M!=null)
mob.tell(L("@x1 is not following you!",M.name(mob)));
else
mob.tell(L("There is noone here called '@x1' following you!",CMParms.combine(commands,1)));
return false;
}
if((mob.location()!=null)&&(M!=null)&&(M.amFollowing()==mob))
{
nofollow(M,true,false);
return true;
}
mob.tell(L("There is noone called '@x1' following you!",CMParms.combine(commands,1)));
return false;
}
if(!mob.isAttribute(MOB.Attrib.NOFOLLOW))
{
mob.setAttribute(MOB.Attrib.NOFOLLOW,true);
//unfollow(mob,false);
mob.tell(L("You are no longer accepting new followers."));
}
else
{
mob.setAttribute(MOB.Attrib.NOFOLLOW,false);
mob.tell(L("You are now accepting new followers."));
}
return false;
}
@Override public boolean canBeOrdered(){return true;}
}
|
Java
|
/**
Copyright 2008 University of Rochester
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package edu.ur.ir.researcher;
import edu.ur.ir.FileSystem;
import edu.ur.ir.FileSystemType;
import edu.ur.persistent.CommonPersistent;
/**
* This is a link in the researcher folder. This
* creates a link between a link and a researcher
* folder
*
* @author Sharmila Ranganathan
*
*/
public class ResearcherLink extends CommonPersistent implements FileSystem{
/** Eclipse generated id */
private static final long serialVersionUID = 3144484183634385274L;
/** Link */
private String url;
/** researcher folder the link belongs to. */
private ResearcherFolder parentFolder;
/** Researcher the link belongs to */
private Researcher researcher;
/** represents the file system type for this researcher link */
private FileSystemType fileSystemType = FileSystemType.RESEARCHER_LINK;
/**
* Package protected constructor.
*/
ResearcherLink(){};
/**
* Create a researcher link with a null researcher folder. This means this
* is a root researcher link.
*
* @param linkVersion
*/
ResearcherLink(Researcher researcher, String link)
{
setResearcher(researcher);
setUrl(link);
}
/**
* Create a link between a folder and link.
*
* @param link - link to create a link with
* @param parentFolder - folder the link is in.
*/
ResearcherLink(Researcher researcher, ResearcherFolder parentFolder, String link)
{
if(link == null)
{
throw new IllegalStateException("link cannot be null");
}
setResearcher(researcher);
setUrl(link);
setParentFolder(parentFolder);
}
/**
* Returns the path for this linkVersion.
*
* The path is the path of the parent folder
*
* @return
*/
public String getPath()
{
String path = null;
if(parentFolder == null)
{
path = PATH_SEPERATOR;
}
else
{
path = parentFolder.getFullPath();
}
return path;
}
/**
* Overridden to string method.
*
* @see java.lang.Object#toString()
*/
public String toString()
{
StringBuffer sb = new StringBuffer("[ id = ");
sb.append(id);
sb.append( " path = ");
sb.append(getPath());
sb.append( " parent Folder = ");
sb.append(parentFolder);
sb.append(" name = ");
sb.append(name);
sb.append(" link = ");
sb.append(url);
sb.append("]");
return sb.toString();
}
/**
* Get the full path of this linkVersion. If there is
* no parent folder the path is just the name of
* the link.
*
* @return the full path.
*/
public String getFullPath()
{
return getPath() + getName();
}
/**
* Hash code for a researcher link.
*
* @see java.lang.Object#hashCode()
*/
public int hashCode()
{
int value = 0;
value += parentFolder == null ? 0 : parentFolder.hashCode();
value += getName() == null ? 0 : getName().hashCode();
value += researcher == null ? 0 : researcher.hashCode();
return value;
}
/**
* Equals method for a researcher link.
*
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object o)
{
if (this == o) return true;
if (!(o instanceof ResearcherLink)) return false;
final ResearcherLink other = (ResearcherLink) o;
if( (other.getName() != null && !other.getName().equals(getName())) ||
(other.getName() == null && getName() != null ) ) return false;
if( (other.getResearcher() != null && !other.getResearcher().equals(getResearcher())) ||
(other.getResearcher() == null && getResearcher() != null ) ) return false;
if( (other.getFullPath() != null && !other.getFullPath().equals(getFullPath())) ||
(other.getFullPath() == null && getFullPath() != null ) ) return false;
return true;
}
/**
* Returns the name of the link.
*
* @see edu.ur.simple.type.NameAware#getName()
*/
public String getName() {
return name;
}
/**
* Returns the description of the link.
*
* @see edu.ur.simple.type.DescriptionAware#getDescription()
*/
public String getDescription() {
return description;
}
/* (non-Javadoc)
* @see edu.ur.ir.FileSystem#getFileSystemType()
*/
public FileSystemType getFileSystemType() {
return fileSystemType;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public ResearcherFolder getParentFolder() {
return parentFolder;
}
public void setParentFolder(ResearcherFolder parentFolder) {
this.parentFolder = parentFolder;
}
public Researcher getResearcher() {
return researcher;
}
public void setResearcher(Researcher researcher) {
this.researcher = researcher;
}
}
|
Java
|
package org.dbflute.erflute.db.impl.mysql;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.dbflute.erflute.editor.model.dbimport.DBObject;
import org.dbflute.erflute.editor.model.dbimport.PreImportFromDBManager;
public class MySQLPreTableImportManager extends PreImportFromDBManager {
@Override
protected List<DBObject> importObjects(String[] types, String dbObjectType) throws SQLException {
final List<DBObject> list = new ArrayList<>();
ResultSet resultSet = null;
if (schemaList.isEmpty()) {
schemaList.add(null);
}
final String catalog = (8 <= metaData.getDriverMajorVersion()) ? dbSetting.getDatabase() : null;
for (final String schemaPattern : schemaList) {
try {
resultSet = metaData.getTables(catalog, schemaPattern, null, types);
while (resultSet.next()) {
final String schema = resultSet.getString("TABLE_SCHEM");
final String name = resultSet.getString("TABLE_NAME");
if (DBObject.TYPE_TABLE.equals(dbObjectType)) {
try {
getAutoIncrementColumnName(con, schema, name);
} catch (final SQLException e) {
e.printStackTrace();
// テーブル情報が取得できない場合(他のユーザの所有物などの場合)、
// このテーブルは使用しない。
continue;
}
}
final DBObject dbObject = new DBObject(schema, name, dbObjectType);
list.add(dbObject);
}
} finally {
if (resultSet != null) {
resultSet.close();
resultSet = null;
}
}
}
return list;
}
}
|
Java
|
// THIS FILE WAS AUTO-GENERATED BY ADKGEN -- DO NOT MODIFY!
//
// Copyright (c)1998-2011 Pearson Education, Inc. or its affiliate(s).
// All rights reserved.
//
using System;
using System.Text;
using System.Security.Permissions;
using System.Runtime.Serialization;
using OpenADK.Library;
using OpenADK.Library.Global;
using OpenADK.Library.au.Common;
namespace OpenADK.Library.au.School{
/// <summary>A MediumOfInstruction</summary>
/// <remarks>
///
/// <para>Author: Generated by adkgen</para>
/// <para>Version: 2.6</para>
/// <para>Since: 2.6</para>
/// </remarks>
[Serializable]
public class MediumOfInstruction : SifKeyedElement
{
/// <summary>
/// Creates an instance of a MediumOfInstruction
/// </summary>
public MediumOfInstruction() : base ( SchoolDTD.MEDIUMOFINSTRUCTION ){}
/// <summary>
/// Constructor that accepts values for all mandatory fields
/// </summary>
///<param name="code">A Code</param>
///
public MediumOfInstruction( AUCodeSetsMediumOfInstructionType code ) : base( SchoolDTD.MEDIUMOFINSTRUCTION )
{
this.SetCode( code );
}
/// <summary>
/// Constructor used by the .Net Serialization formatter
/// </summary>
[SecurityPermission( SecurityAction.Demand, SerializationFormatter=true )]
protected MediumOfInstruction( SerializationInfo info, StreamingContext context ) : base( info, context ) {}
/// <summary>
/// Gets the metadata fields that make up the key of this object
/// </summary>
/// <value>
/// an array of metadata fields that make up the object's key
/// </value>
public override IElementDef[] KeyFields {
get { return new IElementDef[] { SchoolDTD.MEDIUMOFINSTRUCTION_CODE }; }
}
/// <summary>
/// Gets or sets the value of the <c><Code></c> element.
/// </summary>
/// <value> The <c>Code</c> element of this object.</value>
/// <remarks>
/// <para>Version: 2.6</para>
/// <para>Since: 2.6</para>
/// </remarks>
public string Code
{
get
{
return GetFieldValue( SchoolDTD.MEDIUMOFINSTRUCTION_CODE );
}
set
{
SetField( SchoolDTD.MEDIUMOFINSTRUCTION_CODE, value );
}
}
/// <summary>
/// Sets the value of the <c><Code></c> element.
/// </summary>
/// <param name="val">A AUCodeSetsMediumOfInstructionType object</param>
/// <remarks>
/// <para>Version: 2.6</para>
/// <para>Since: 2.6</para>
/// </remarks>
public void SetCode( AUCodeSetsMediumOfInstructionType val )
{
SetField( SchoolDTD.MEDIUMOFINSTRUCTION_CODE, val );
}
/// <summary>
/// Gets or sets the value of the <c><OtherCodeList></c> element.
/// </summary>
/// <value> An OtherCodeList </value>
/// <remarks>
/// <para>To remove the <c>OtherCodeList</c>, set <c>OtherCodeList</c> to <c>null</c></para>
/// <para>Version: 2.6</para>
/// <para>Since: 2.6</para>
/// </remarks>
public OtherCodeList OtherCodeList
{
get
{
return (OtherCodeList)GetChild( SchoolDTD.MEDIUMOFINSTRUCTION_OTHERCODELIST);
}
set
{
RemoveChild( SchoolDTD.MEDIUMOFINSTRUCTION_OTHERCODELIST);
if( value != null)
{
AddChild( SchoolDTD.MEDIUMOFINSTRUCTION_OTHERCODELIST, value );
}
}
}
}}
|
Java
|
* * *
license: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
## under the License.
# Configuración de Android
El archivo `config.xml` controla la configuración básica de una app que se aplican a través de cada aplicación y una instancia de CordovaWebView. Esta sección detalla las preferencias que se aplican sólo a estructuras Android. Consulte [el archivo config.xml][1] para obtener información sobre las opciones de configuración global.
[1]: config_ref_index.md.html#The%20config.xml%20File
* `KeepRunning` (por defecto valor booleano, `true`): determina si la aplicación queda funcionando en segundo plano, incluso después de un `pause` de evento se desencadena. Si se establece como `false` no mata la aplicación después de un `pause` evento, sino simplemente detiene ejecución de código en la vista Web cordova mientras la aplicación está en el fondo.
<preference name="KeepRunning" value="false"/>
* `LoadUrlTimeoutValue`(número en milisegundos, por defecto `20000` , 20 segundos): cuando se carga una página, la cantidad de tiempo de espera antes de tirar un error de tiempo de espera. Este ejemplo especifica 10 segundos en lugar de 20:
<preference name="LoadUrlTimeoutValue" value="10000"/>
* `SplashScreen`(string, el valor predeterminado de `splash` ): el nombre del archivo sin su extensión en el `res/drawable` Directorio. Varios activos deben compartir este nombre común en diferentes subdirectorios.
<preference name="SplashScreen" value="mySplash"/>
* `SplashScreenDelay`(número en milisegundos, por defecto `3000` ): la cantidad de tiempo que muestra la imagen en pantalla splash.
<preference name="SplashScreenDelay" value="10000"/>
* `InAppBrowserStorageEnabled`(por defecto es booleano, `true` ): controles si abrieron páginas dentro de un InAppBrowser pueden acceder el mismo localStorage y WebSQL almacenamiento de información como páginas abrió con el navegador por defecto.
<preference name="InAppBrowserStorageEnabled" value="true"/>
* `LoadingDialog`(string, el valor predeterminado de `null` ): Si conjunto, muestra un diálogo con el mensaje y título especificado y un hilandero, cuando cargue la primera página de una aplicación. El título y el mensaje están separados por una coma en esta cadena de valor, y eso coma se retira antes de que se muestre el cuadro de diálogo.
<preference name="LoadingDialog" value="My Title,My Message"/>
* `LoadingPageDialog`(string, el valor predeterminado de `null` ): lo mismo que `LoadingDialog` , pero para cargar cada página después de la primera página de la aplicación.
<preference name="LoadingPageDialog" value="My Title,My Message"/>
* `ErrorUrl`(URL, por defecto `null` ): Si establece, se visualizará la página que se hace referencia a un error en la aplicación en lugar de un diálogo con el título "Error de aplicación".
<preference name="ErrorUrl" value="myErrorPage.html"/>
* `ShowTitle`(por defecto es booleano, `false` ): Mostrar el título en la parte superior de la pantalla.
<preference name="ShowTitle" value="true"/>
* `LogLevel`(string, el valor predeterminado de `ERROR` ): establece el nivel de registro mínimo a través de registro que se filtrarán los mensajes de la aplicación. Los valores válidos son `ERROR` , `WARN` , `INFO` , `DEBUG` , y`VERBOSE`.
<preference name="LogLevel" value="VERBOSE"/>
* `SetFullscreen`(por defecto es booleano, `false` ): igual que el `Fullscreen` parámetro en la configuración global de este archivo xml. Este elemento específico de Android está obsoleta a favor de la global `Fullscreen` elemento y se quitará en una versión futura.
* `AndroidLaunchMode`(string, el valor predeterminado de `singleTop` ): establece la actividad `android:launchMode` atributo. Esto cambia lo que pasa cuando la aplicación se inicia desde el icono de la aplicación o intención y está ya en ejecución. Los valores válidos son `standard` , `singleTop` , `singleTask` ,`singleInstance`.
<preference name="AndroidLaunchMode" value="singleTop"/>
* `DefaultVolumeStream`(string, el valor predeterminado de `default` , agregado en Córdoba-android 3.7.0): establece que volumen el volumen de hardware vinculan los botones. Por defecto es "llamar" por "medios" para tablets y teléfonos. Ajuste este parámetro a "medios" para los botones de volumen de su aplicación siempre cambiar el volumen de los medios de comunicación. Tenga en cuenta que al usar el plugin de los medios de comunicación de Cordova, los botones de volumen cambiará dinámicamente para controlar el volumen de los medios de comunicación cuando los objetos a los medios de comunicación están activos.
|
Java
|
package org.gradle.test.performance.mediummonolithicjavaproject.p36;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test730 {
Production730 objectUnderTest = new Production730();
@Test
public void testProperty0() {
String value = "value";
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
String value = "value";
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
String value = "value";
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
}
|
Java
|
/**
* Copyright 2016 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yahoo.athenz.common.metrics.impl;
import com.yahoo.athenz.common.metrics.Metric;
public class NoOpMetric implements Metric {
/**
* Constructs a new NoOpMetric object in which all methods are stubs.
* No metrics are recorded with this implementation.
*/
public NoOpMetric() {
}
@Override
public void increment(String metric) {
}
@Override
public void increment(String metric, String domainName) {
}
@Override
public void increment(String metric, String domainName, int count) {
}
@Override
public Object startTiming(String metric, String domainName) {
return null;
}
@Override
public void stopTiming(Object timerMetric) {
}
@Override
public void flush() {
}
@Override
public void quit() {
}
}
|
Java
|
app.service('UserService', ['$http', function($http) {
return {
getLogged: function(successCallback) {
$http.get('/api/user/logged').then(successCallback);
},
putPin: function(user, successCallback) {
$http.post('/api/user/pin/', user).then(successCallback);
}
};
}]);
|
Java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.sql.catalyst
import org.apache.spark.SparkFunSuite
import org.apache.spark.sql.Row
import org.apache.spark.sql.catalyst.expressions.UnsafeArrayData
import org.apache.spark.sql.catalyst.util.GenericArrayData
import org.apache.spark.sql.types._
class CatalystTypeConvertersSuite extends SparkFunSuite {
private val simpleTypes: Seq[DataType] = Seq(
StringType,
DateType,
BooleanType,
ByteType,
ShortType,
IntegerType,
LongType,
FloatType,
DoubleType,
DecimalType.SYSTEM_DEFAULT,
DecimalType.USER_DEFAULT)
test("null handling in rows") {
val schema = StructType(simpleTypes.map(t => StructField(t.getClass.getName, t)))
val convertToCatalyst = CatalystTypeConverters.createToCatalystConverter(schema)
val convertToScala = CatalystTypeConverters.createToScalaConverter(schema)
val scalaRow = Row.fromSeq(Seq.fill(simpleTypes.length)(null))
assert(convertToScala(convertToCatalyst(scalaRow)) === scalaRow)
}
test("null handling for individual values") {
for (dataType <- simpleTypes) {
assert(CatalystTypeConverters.createToScalaConverter(dataType)(null) === null)
}
}
test("option handling in convertToCatalyst") {
// convertToCatalyst doesn't handle unboxing from Options. This is inconsistent with
// createToCatalystConverter but it may not actually matter as this is only called internally
// in a handful of places where we don't expect to receive Options.
assert(CatalystTypeConverters.convertToCatalyst(Some(123)) === Some(123))
}
test("option handling in createToCatalystConverter") {
assert(CatalystTypeConverters.createToCatalystConverter(IntegerType)(Some(123)) === 123)
}
test("primitive array handling") {
val intArray = Array(1, 100, 10000)
val intUnsafeArray = UnsafeArrayData.fromPrimitiveArray(intArray)
val intArrayType = ArrayType(IntegerType, false)
assert(CatalystTypeConverters.createToScalaConverter(intArrayType)(intUnsafeArray) === intArray)
val doubleArray = Array(1.1, 111.1, 11111.1)
val doubleUnsafeArray = UnsafeArrayData.fromPrimitiveArray(doubleArray)
val doubleArrayType = ArrayType(DoubleType, false)
assert(CatalystTypeConverters.createToScalaConverter(doubleArrayType)(doubleUnsafeArray)
=== doubleArray)
}
test("An array with null handling") {
val intArray = Array(1, null, 100, null, 10000)
val intGenericArray = new GenericArrayData(intArray)
val intArrayType = ArrayType(IntegerType, true)
assert(CatalystTypeConverters.createToScalaConverter(intArrayType)(intGenericArray)
=== intArray)
assert(CatalystTypeConverters.createToCatalystConverter(intArrayType)(intArray)
== intGenericArray)
val doubleArray = Array(1.1, null, 111.1, null, 11111.1)
val doubleGenericArray = new GenericArrayData(doubleArray)
val doubleArrayType = ArrayType(DoubleType, true)
assert(CatalystTypeConverters.createToScalaConverter(doubleArrayType)(doubleGenericArray)
=== doubleArray)
assert(CatalystTypeConverters.createToCatalystConverter(doubleArrayType)(doubleArray)
== doubleGenericArray)
}
}
|
Java
|
UPDATE mod_open_tickets_form_value SET `value` = replace(`value`, '>', '>');
UPDATE mod_open_tickets_form_value SET `value` = replace(`value`, '<', '<');
|
Java
|
// Code generated by protoc-gen-gogo.
// source: combos/unsafemarshaler/casttype.proto
// DO NOT EDIT!
/*
Package casttype is a generated protocol buffer package.
It is generated from these files:
combos/unsafemarshaler/casttype.proto
It has these top-level messages:
Castaway
Wilson
*/
package casttype
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import github_com_gogo_protobuf_test_casttype "github.com/gogo/protobuf/test/casttype"
import github_com_gogo_protobuf_protoc_gen_gogo_descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
import compress_gzip "compress/gzip"
import bytes "bytes"
import io_ioutil "io/ioutil"
import strings "strings"
import reflect "reflect"
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Castaway struct {
Int32Ptr *int32 `protobuf:"varint,1,opt,name=Int32Ptr,casttype=int32" json:"Int32Ptr,omitempty"`
Int32 int32 `protobuf:"varint,2,opt,name=Int32,casttype=int32" json:"Int32"`
MyUint64Ptr *github_com_gogo_protobuf_test_casttype.MyUint64Type `protobuf:"varint,3,opt,name=MyUint64Ptr,casttype=github.com/gogo/protobuf/test/casttype.MyUint64Type" json:"MyUint64Ptr,omitempty"`
MyUint64 github_com_gogo_protobuf_test_casttype.MyUint64Type `protobuf:"varint,4,opt,name=MyUint64,casttype=github.com/gogo/protobuf/test/casttype.MyUint64Type" json:"MyUint64"`
MyFloat32Ptr *github_com_gogo_protobuf_test_casttype.MyFloat32Type `protobuf:"fixed32,5,opt,name=MyFloat32Ptr,casttype=github.com/gogo/protobuf/test/casttype.MyFloat32Type" json:"MyFloat32Ptr,omitempty"`
MyFloat32 github_com_gogo_protobuf_test_casttype.MyFloat32Type `protobuf:"fixed32,6,opt,name=MyFloat32,casttype=github.com/gogo/protobuf/test/casttype.MyFloat32Type" json:"MyFloat32"`
MyFloat64Ptr *github_com_gogo_protobuf_test_casttype.MyFloat64Type `protobuf:"fixed64,7,opt,name=MyFloat64Ptr,casttype=github.com/gogo/protobuf/test/casttype.MyFloat64Type" json:"MyFloat64Ptr,omitempty"`
MyFloat64 github_com_gogo_protobuf_test_casttype.MyFloat64Type `protobuf:"fixed64,8,opt,name=MyFloat64,casttype=github.com/gogo/protobuf/test/casttype.MyFloat64Type" json:"MyFloat64"`
MyBytes github_com_gogo_protobuf_test_casttype.Bytes `protobuf:"bytes,9,opt,name=MyBytes,casttype=github.com/gogo/protobuf/test/casttype.Bytes" json:"MyBytes,omitempty"`
NormalBytes []byte `protobuf:"bytes,10,opt,name=NormalBytes" json:"NormalBytes,omitempty"`
MyUint64S []github_com_gogo_protobuf_test_casttype.MyUint64Type `protobuf:"varint,11,rep,name=MyUint64s,casttype=github.com/gogo/protobuf/test/casttype.MyUint64Type" json:"MyUint64s,omitempty"`
MyMap github_com_gogo_protobuf_test_casttype.MyMapType `protobuf:"bytes,12,rep,name=MyMap,casttype=github.com/gogo/protobuf/test/casttype.MyMapType" json:"MyMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
MyCustomMap map[github_com_gogo_protobuf_test_casttype.MyStringType]github_com_gogo_protobuf_test_casttype.MyUint64Type `protobuf:"bytes,13,rep,name=MyCustomMap,castkey=github.com/gogo/protobuf/test/casttype.MyStringType,castvalue=github.com/gogo/protobuf/test/casttype.MyUint64Type" json:"MyCustomMap,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
MyNullableMap map[github_com_gogo_protobuf_test_casttype.MyInt32Type]*Wilson `protobuf:"bytes,14,rep,name=MyNullableMap,castkey=github.com/gogo/protobuf/test/casttype.MyInt32Type" json:"MyNullableMap,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
MyEmbeddedMap map[github_com_gogo_protobuf_test_casttype.MyInt32Type]Wilson `protobuf:"bytes,15,rep,name=MyEmbeddedMap,castkey=github.com/gogo/protobuf/test/casttype.MyInt32Type" json:"MyEmbeddedMap" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
String_ *github_com_gogo_protobuf_test_casttype.MyStringType `protobuf:"bytes,16,opt,name=String,casttype=github.com/gogo/protobuf/test/casttype.MyStringType" json:"String,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Castaway) Reset() { *m = Castaway{} }
func (*Castaway) ProtoMessage() {}
func (*Castaway) Descriptor() ([]byte, []int) { return fileDescriptorCasttype, []int{0} }
type Wilson struct {
Int64 *int64 `protobuf:"varint,1,opt,name=Int64" json:"Int64,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Wilson) Reset() { *m = Wilson{} }
func (*Wilson) ProtoMessage() {}
func (*Wilson) Descriptor() ([]byte, []int) { return fileDescriptorCasttype, []int{1} }
func init() {
proto.RegisterType((*Castaway)(nil), "casttype.Castaway")
proto.RegisterType((*Wilson)(nil), "casttype.Wilson")
}
func (this *Castaway) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return CasttypeDescription()
}
func (this *Wilson) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
return CasttypeDescription()
}
func CasttypeDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) {
d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{}
var gzipped = []byte{
// 3994 bytes of a gzipped FileDescriptorSet
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x7a, 0x5d, 0x70, 0x1b, 0xd7,
0x75, 0x3f, 0x17, 0x1f, 0x24, 0x70, 0x00, 0x82, 0xcb, 0x4b, 0x5a, 0x86, 0xe8, 0x18, 0xa4, 0x68,
0xcb, 0xa6, 0xed, 0x84, 0xf2, 0x48, 0x94, 0x2c, 0x43, 0x89, 0x3d, 0x00, 0x09, 0x31, 0xd4, 0x10,
0x24, 0xff, 0x4b, 0x32, 0xfe, 0xc8, 0x7f, 0x66, 0xe7, 0x72, 0x71, 0x09, 0xae, 0xb4, 0xd8, 0x45,
0x77, 0x17, 0x92, 0xe1, 0x27, 0x25, 0x6e, 0x9b, 0x49, 0x33, 0xfd, 0xee, 0x4c, 0x13, 0xc7, 0x71,
0xdd, 0xcc, 0xb4, 0x4e, 0xd3, 0xaf, 0xa4, 0x6d, 0xd2, 0x4e, 0x9e, 0xf2, 0x92, 0xd6, 0x4f, 0x9d,
0xe4, 0xad, 0x0f, 0x1d, 0x39, 0x62, 0x3d, 0x53, 0xa7, 0x75, 0x5b, 0xb7, 0xf5, 0x4c, 0x33, 0xf2,
0x4b, 0xe7, 0x7e, 0x2d, 0x16, 0x1f, 0xd4, 0x82, 0xca, 0x24, 0xe9, 0x13, 0x79, 0xcf, 0x3d, 0xbf,
0xdf, 0x9e, 0x7b, 0xee, 0xb9, 0xe7, 0x9c, 0xbd, 0x0b, 0xf8, 0xcc, 0x12, 0xcc, 0xd5, 0x1d, 0xa7,
0x6e, 0x91, 0x33, 0x4d, 0xd7, 0xf1, 0x9d, 0xbd, 0xd6, 0xfe, 0x99, 0x1a, 0xf1, 0x0c, 0xd7, 0x6c,
0xfa, 0x8e, 0xbb, 0xc8, 0x64, 0x68, 0x82, 0x6b, 0x2c, 0x4a, 0x8d, 0xf9, 0x2a, 0x4c, 0x5e, 0x36,
0x2d, 0xb2, 0x12, 0x28, 0x6e, 0x13, 0x1f, 0x5d, 0x84, 0xc4, 0xbe, 0x69, 0x91, 0xbc, 0x32, 0x17,
0x5f, 0xc8, 0x9c, 0x7d, 0x78, 0xb1, 0x07, 0xb4, 0xd8, 0x8d, 0xd8, 0xa2, 0x62, 0x8d, 0x21, 0xe6,
0xdf, 0x49, 0xc0, 0xd4, 0x80, 0x59, 0x84, 0x20, 0x61, 0xe3, 0x06, 0x65, 0x54, 0x16, 0xd2, 0x1a,
0xfb, 0x1f, 0xe5, 0x61, 0xac, 0x89, 0x8d, 0x6b, 0xb8, 0x4e, 0xf2, 0x31, 0x26, 0x96, 0x43, 0x54,
0x00, 0xa8, 0x91, 0x26, 0xb1, 0x6b, 0xc4, 0x36, 0xda, 0xf9, 0xf8, 0x5c, 0x7c, 0x21, 0xad, 0x85,
0x24, 0xe8, 0x09, 0x98, 0x6c, 0xb6, 0xf6, 0x2c, 0xd3, 0xd0, 0x43, 0x6a, 0x30, 0x17, 0x5f, 0x48,
0x6a, 0x2a, 0x9f, 0x58, 0xe9, 0x28, 0x3f, 0x0a, 0x13, 0x37, 0x08, 0xbe, 0x16, 0x56, 0xcd, 0x30,
0xd5, 0x1c, 0x15, 0x87, 0x14, 0x97, 0x21, 0xdb, 0x20, 0x9e, 0x87, 0xeb, 0x44, 0xf7, 0xdb, 0x4d,
0x92, 0x4f, 0xb0, 0xd5, 0xcf, 0xf5, 0xad, 0xbe, 0x77, 0xe5, 0x19, 0x81, 0xda, 0x69, 0x37, 0x09,
0x2a, 0x41, 0x9a, 0xd8, 0xad, 0x06, 0x67, 0x48, 0x1e, 0xe1, 0xbf, 0x8a, 0xdd, 0x6a, 0xf4, 0xb2,
0xa4, 0x28, 0x4c, 0x50, 0x8c, 0x79, 0xc4, 0xbd, 0x6e, 0x1a, 0x24, 0x3f, 0xca, 0x08, 0x1e, 0xed,
0x23, 0xd8, 0xe6, 0xf3, 0xbd, 0x1c, 0x12, 0x87, 0x96, 0x21, 0x4d, 0x5e, 0xf2, 0x89, 0xed, 0x99,
0x8e, 0x9d, 0x1f, 0x63, 0x24, 0xa7, 0x07, 0xec, 0x22, 0xb1, 0x6a, 0xbd, 0x14, 0x1d, 0x1c, 0xba,
0x00, 0x63, 0x4e, 0xd3, 0x37, 0x1d, 0xdb, 0xcb, 0xa7, 0xe6, 0x94, 0x85, 0xcc, 0xd9, 0x8f, 0x0c,
0x0c, 0x84, 0x4d, 0xae, 0xa3, 0x49, 0x65, 0xb4, 0x06, 0xaa, 0xe7, 0xb4, 0x5c, 0x83, 0xe8, 0x86,
0x53, 0x23, 0xba, 0x69, 0xef, 0x3b, 0xf9, 0x34, 0x23, 0x98, 0xed, 0x5f, 0x08, 0x53, 0x5c, 0x76,
0x6a, 0x64, 0xcd, 0xde, 0x77, 0xb4, 0x9c, 0xd7, 0x35, 0x46, 0x27, 0x60, 0xd4, 0x6b, 0xdb, 0x3e,
0x7e, 0x29, 0x9f, 0x65, 0x11, 0x22, 0x46, 0xf3, 0xff, 0x93, 0x84, 0x89, 0x61, 0x42, 0xec, 0x12,
0x24, 0xf7, 0xe9, 0x2a, 0xf3, 0xb1, 0xe3, 0xf8, 0x80, 0x63, 0xba, 0x9d, 0x38, 0x7a, 0x8f, 0x4e,
0x2c, 0x41, 0xc6, 0x26, 0x9e, 0x4f, 0x6a, 0x3c, 0x22, 0xe2, 0x43, 0xc6, 0x14, 0x70, 0x50, 0x7f,
0x48, 0x25, 0xee, 0x29, 0xa4, 0x9e, 0x87, 0x89, 0xc0, 0x24, 0xdd, 0xc5, 0x76, 0x5d, 0xc6, 0xe6,
0x99, 0x28, 0x4b, 0x16, 0x2b, 0x12, 0xa7, 0x51, 0x98, 0x96, 0x23, 0x5d, 0x63, 0xb4, 0x02, 0xe0,
0xd8, 0xc4, 0xd9, 0xd7, 0x6b, 0xc4, 0xb0, 0xf2, 0xa9, 0x23, 0xbc, 0xb4, 0x49, 0x55, 0xfa, 0xbc,
0xe4, 0x70, 0xa9, 0x61, 0xa1, 0xa7, 0x3b, 0xa1, 0x36, 0x76, 0x44, 0xa4, 0x54, 0xf9, 0x21, 0xeb,
0x8b, 0xb6, 0x5d, 0xc8, 0xb9, 0x84, 0xc6, 0x3d, 0xa9, 0x89, 0x95, 0xa5, 0x99, 0x11, 0x8b, 0x91,
0x2b, 0xd3, 0x04, 0x8c, 0x2f, 0x6c, 0xdc, 0x0d, 0x0f, 0xd1, 0x43, 0x10, 0x08, 0x74, 0x16, 0x56,
0xc0, 0xb2, 0x50, 0x56, 0x0a, 0x37, 0x70, 0x83, 0xcc, 0x5c, 0x84, 0x5c, 0xb7, 0x7b, 0xd0, 0x34,
0x24, 0x3d, 0x1f, 0xbb, 0x3e, 0x8b, 0xc2, 0xa4, 0xc6, 0x07, 0x48, 0x85, 0x38, 0xb1, 0x6b, 0x2c,
0xcb, 0x25, 0x35, 0xfa, 0xef, 0xcc, 0x53, 0x30, 0xde, 0xf5, 0xf8, 0x61, 0x81, 0xf3, 0x5f, 0x1c,
0x85, 0xe9, 0x41, 0x31, 0x37, 0x30, 0xfc, 0x4f, 0xc0, 0xa8, 0xdd, 0x6a, 0xec, 0x11, 0x37, 0x1f,
0x67, 0x0c, 0x62, 0x84, 0x4a, 0x90, 0xb4, 0xf0, 0x1e, 0xb1, 0xf2, 0x89, 0x39, 0x65, 0x21, 0x77,
0xf6, 0x89, 0xa1, 0xa2, 0x7a, 0x71, 0x9d, 0x42, 0x34, 0x8e, 0x44, 0xcf, 0x40, 0x42, 0xa4, 0x38,
0xca, 0xf0, 0xf8, 0x70, 0x0c, 0x34, 0x16, 0x35, 0x86, 0x43, 0x0f, 0x40, 0x9a, 0xfe, 0xe5, 0xbe,
0x1d, 0x65, 0x36, 0xa7, 0xa8, 0x80, 0xfa, 0x15, 0xcd, 0x40, 0x8a, 0x85, 0x59, 0x8d, 0xc8, 0xd2,
0x10, 0x8c, 0xe9, 0xc6, 0xd4, 0xc8, 0x3e, 0x6e, 0x59, 0xbe, 0x7e, 0x1d, 0x5b, 0x2d, 0xc2, 0x02,
0x26, 0xad, 0x65, 0x85, 0xf0, 0x53, 0x54, 0x86, 0x66, 0x21, 0xc3, 0xa3, 0xd2, 0xb4, 0x6b, 0xe4,
0x25, 0x96, 0x7d, 0x92, 0x1a, 0x0f, 0xd4, 0x35, 0x2a, 0xa1, 0x8f, 0xbf, 0xea, 0x39, 0xb6, 0xdc,
0x5a, 0xf6, 0x08, 0x2a, 0x60, 0x8f, 0x7f, 0xaa, 0x37, 0xf1, 0x3d, 0x38, 0x78, 0x79, 0xbd, 0xb1,
0x38, 0xff, 0xed, 0x18, 0x24, 0xd8, 0x79, 0x9b, 0x80, 0xcc, 0xce, 0x0b, 0x5b, 0x15, 0x7d, 0x65,
0x73, 0xb7, 0xbc, 0x5e, 0x51, 0x15, 0x94, 0x03, 0x60, 0x82, 0xcb, 0xeb, 0x9b, 0xa5, 0x1d, 0x35,
0x16, 0x8c, 0xd7, 0x36, 0x76, 0x2e, 0x2c, 0xa9, 0xf1, 0x00, 0xb0, 0xcb, 0x05, 0x89, 0xb0, 0xc2,
0xb9, 0xb3, 0x6a, 0x12, 0xa9, 0x90, 0xe5, 0x04, 0x6b, 0xcf, 0x57, 0x56, 0x2e, 0x2c, 0xa9, 0xa3,
0xdd, 0x92, 0x73, 0x67, 0xd5, 0x31, 0x34, 0x0e, 0x69, 0x26, 0x29, 0x6f, 0x6e, 0xae, 0xab, 0xa9,
0x80, 0x73, 0x7b, 0x47, 0x5b, 0xdb, 0x58, 0x55, 0xd3, 0x01, 0xe7, 0xaa, 0xb6, 0xb9, 0xbb, 0xa5,
0x42, 0xc0, 0x50, 0xad, 0x6c, 0x6f, 0x97, 0x56, 0x2b, 0x6a, 0x26, 0xd0, 0x28, 0xbf, 0xb0, 0x53,
0xd9, 0x56, 0xb3, 0x5d, 0x66, 0x9d, 0x3b, 0xab, 0x8e, 0x07, 0x8f, 0xa8, 0x6c, 0xec, 0x56, 0xd5,
0x1c, 0x9a, 0x84, 0x71, 0xfe, 0x08, 0x69, 0xc4, 0x44, 0x8f, 0xe8, 0xc2, 0x92, 0xaa, 0x76, 0x0c,
0xe1, 0x2c, 0x93, 0x5d, 0x82, 0x0b, 0x4b, 0x2a, 0x9a, 0x5f, 0x86, 0x24, 0x8b, 0x2e, 0x84, 0x20,
0xb7, 0x5e, 0x2a, 0x57, 0xd6, 0xf5, 0xcd, 0xad, 0x9d, 0xb5, 0xcd, 0x8d, 0xd2, 0xba, 0xaa, 0x74,
0x64, 0x5a, 0xe5, 0xff, 0xed, 0xae, 0x69, 0x95, 0x15, 0x35, 0x16, 0x96, 0x6d, 0x55, 0x4a, 0x3b,
0x95, 0x15, 0x35, 0x3e, 0x6f, 0xc0, 0xf4, 0xa0, 0x3c, 0x33, 0xf0, 0x64, 0x84, 0xb6, 0x38, 0x76,
0xc4, 0x16, 0x33, 0xae, 0xbe, 0x2d, 0xfe, 0xaa, 0x02, 0x53, 0x03, 0x72, 0xed, 0xc0, 0x87, 0x3c,
0x0b, 0x49, 0x1e, 0xa2, 0xbc, 0xfa, 0x3c, 0x36, 0x30, 0x69, 0xb3, 0x80, 0xed, 0xab, 0x40, 0x0c,
0x17, 0xae, 0xc0, 0xf1, 0x23, 0x2a, 0x30, 0xa5, 0xe8, 0x33, 0xf2, 0x15, 0x05, 0xf2, 0x47, 0x71,
0x47, 0x24, 0x8a, 0x58, 0x57, 0xa2, 0xb8, 0xd4, 0x6b, 0xc0, 0xa9, 0xa3, 0xd7, 0xd0, 0x67, 0xc5,
0x9b, 0x0a, 0x9c, 0x18, 0xdc, 0xa8, 0x0c, 0xb4, 0xe1, 0x19, 0x18, 0x6d, 0x10, 0xff, 0xc0, 0x91,
0xc5, 0xfa, 0x91, 0x01, 0x25, 0x80, 0x4e, 0xf7, 0xfa, 0x4a, 0xa0, 0xc2, 0x35, 0x24, 0x7e, 0x54,
0xb7, 0xc1, 0xad, 0xe9, 0xb3, 0xf4, 0xf3, 0x31, 0xb8, 0x6f, 0x20, 0xf9, 0x40, 0x43, 0x1f, 0x04,
0x30, 0xed, 0x66, 0xcb, 0xe7, 0x05, 0x99, 0xe7, 0xa7, 0x34, 0x93, 0xb0, 0xb3, 0x4f, 0x73, 0x4f,
0xcb, 0x0f, 0xe6, 0xe3, 0x6c, 0x1e, 0xb8, 0x88, 0x29, 0x5c, 0xec, 0x18, 0x9a, 0x60, 0x86, 0x16,
0x8e, 0x58, 0x69, 0x5f, 0xad, 0x7b, 0x12, 0x54, 0xc3, 0x32, 0x89, 0xed, 0xeb, 0x9e, 0xef, 0x12,
0xdc, 0x30, 0xed, 0x3a, 0x4b, 0xc0, 0xa9, 0x62, 0x72, 0x1f, 0x5b, 0x1e, 0xd1, 0x26, 0xf8, 0xf4,
0xb6, 0x9c, 0xa5, 0x08, 0x56, 0x65, 0xdc, 0x10, 0x62, 0xb4, 0x0b, 0xc1, 0xa7, 0x03, 0xc4, 0xfc,
0x17, 0xc6, 0x20, 0x13, 0x6a, 0xeb, 0xd0, 0x29, 0xc8, 0x5e, 0xc5, 0xd7, 0xb1, 0x2e, 0x5b, 0x75,
0xee, 0x89, 0x0c, 0x95, 0x6d, 0x89, 0x76, 0xfd, 0x49, 0x98, 0x66, 0x2a, 0x4e, 0xcb, 0x27, 0xae,
0x6e, 0x58, 0xd8, 0xf3, 0x98, 0xd3, 0x52, 0x4c, 0x15, 0xd1, 0xb9, 0x4d, 0x3a, 0xb5, 0x2c, 0x67,
0xd0, 0x79, 0x98, 0x62, 0x88, 0x46, 0xcb, 0xf2, 0xcd, 0xa6, 0x45, 0x74, 0xfa, 0xf2, 0xe0, 0xb1,
0x44, 0x1c, 0x58, 0x36, 0x49, 0x35, 0xaa, 0x42, 0x81, 0x5a, 0xe4, 0xa1, 0x55, 0x78, 0x90, 0xc1,
0xea, 0xc4, 0x26, 0x2e, 0xf6, 0x89, 0x4e, 0x7e, 0xa1, 0x85, 0x2d, 0x4f, 0xc7, 0x76, 0x4d, 0x3f,
0xc0, 0xde, 0x41, 0x7e, 0x3a, 0x4c, 0x70, 0x92, 0xea, 0xae, 0x0a, 0xd5, 0x0a, 0xd3, 0x2c, 0xd9,
0xb5, 0x4f, 0x62, 0xef, 0x00, 0x15, 0xe1, 0x04, 0x23, 0xf2, 0x7c, 0xd7, 0xb4, 0xeb, 0xba, 0x71,
0x40, 0x8c, 0x6b, 0x7a, 0xcb, 0xdf, 0xbf, 0x98, 0x7f, 0x20, 0xcc, 0xc0, 0x8c, 0xdc, 0x66, 0x3a,
0xcb, 0x54, 0x65, 0xd7, 0xdf, 0xbf, 0x88, 0xb6, 0x21, 0x4b, 0xf7, 0xa3, 0x61, 0xbe, 0x4c, 0xf4,
0x7d, 0xc7, 0x65, 0xc5, 0x25, 0x37, 0xe0, 0x70, 0x87, 0x9c, 0xb8, 0xb8, 0x29, 0x00, 0x55, 0xa7,
0x46, 0x8a, 0xc9, 0xed, 0xad, 0x4a, 0x65, 0x45, 0xcb, 0x48, 0x96, 0xcb, 0x8e, 0x4b, 0x63, 0xaa,
0xee, 0x04, 0x3e, 0xce, 0xf0, 0x98, 0xaa, 0x3b, 0xd2, 0xc3, 0xe7, 0x61, 0xca, 0x30, 0xf8, 0xb2,
0x4d, 0x43, 0x17, 0x5d, 0xbe, 0x97, 0x57, 0xbb, 0xfc, 0x65, 0x18, 0xab, 0x5c, 0x41, 0x84, 0xb9,
0x87, 0x9e, 0x86, 0xfb, 0x3a, 0xfe, 0x0a, 0x03, 0x27, 0xfb, 0x56, 0xd9, 0x0b, 0x3d, 0x0f, 0x53,
0xcd, 0x76, 0x3f, 0x10, 0x75, 0x3d, 0xb1, 0xd9, 0xee, 0x85, 0x9d, 0x66, 0x6f, 0x6e, 0x2e, 0x31,
0xb0, 0x4f, 0x6a, 0xf9, 0xfb, 0xc3, 0xda, 0xa1, 0x09, 0x74, 0x06, 0x54, 0xc3, 0xd0, 0x89, 0x8d,
0xf7, 0x2c, 0xa2, 0x63, 0x97, 0xd8, 0xd8, 0xcb, 0xcf, 0x86, 0x95, 0x73, 0x86, 0x51, 0x61, 0xb3,
0x25, 0x36, 0x89, 0x1e, 0x87, 0x49, 0x67, 0xef, 0xaa, 0xc1, 0x83, 0x4b, 0x6f, 0xba, 0x64, 0xdf,
0x7c, 0x29, 0xff, 0x30, 0x73, 0xd3, 0x04, 0x9d, 0x60, 0xa1, 0xb5, 0xc5, 0xc4, 0xe8, 0x31, 0x50,
0x0d, 0xef, 0x00, 0xbb, 0x4d, 0x56, 0xdd, 0xbd, 0x26, 0x36, 0x48, 0xfe, 0x34, 0x57, 0xe5, 0xf2,
0x0d, 0x29, 0x46, 0xcf, 0xc3, 0x74, 0xcb, 0x36, 0x6d, 0x9f, 0xb8, 0x4d, 0x97, 0xd0, 0x26, 0x9d,
0x9f, 0xb4, 0xfc, 0x3f, 0x8f, 0x1d, 0xd1, 0x66, 0xef, 0x86, 0xb5, 0xf9, 0xee, 0x6a, 0x53, 0xad,
0x7e, 0xe1, 0x7c, 0x11, 0xb2, 0xe1, 0x4d, 0x47, 0x69, 0xe0, 0xdb, 0xae, 0x2a, 0xb4, 0x86, 0x2e,
0x6f, 0xae, 0xd0, 0xea, 0xf7, 0x62, 0x45, 0x8d, 0xd1, 0x2a, 0xbc, 0xbe, 0xb6, 0x53, 0xd1, 0xb5,
0xdd, 0x8d, 0x9d, 0xb5, 0x6a, 0x45, 0x8d, 0x3f, 0x9e, 0x4e, 0xbd, 0x3b, 0xa6, 0xde, 0xbc, 0x79,
0xf3, 0x66, 0x6c, 0xfe, 0x7b, 0x31, 0xc8, 0x75, 0x77, 0xbe, 0xe8, 0xe3, 0x70, 0xbf, 0x7c, 0x4d,
0xf5, 0x88, 0xaf, 0xdf, 0x30, 0x5d, 0x16, 0x87, 0x0d, 0xcc, 0x7b, 0xc7, 0xc0, 0x85, 0xd3, 0x42,
0x6b, 0x9b, 0xf8, 0xcf, 0x99, 0x2e, 0x8d, 0xb2, 0x06, 0xf6, 0xd1, 0x3a, 0xcc, 0xda, 0x8e, 0xee,
0xf9, 0xd8, 0xae, 0x61, 0xb7, 0xa6, 0x77, 0x2e, 0x08, 0x74, 0x6c, 0x18, 0xc4, 0xf3, 0x1c, 0x5e,
0x02, 0x02, 0x96, 0x8f, 0xd8, 0xce, 0xb6, 0x50, 0xee, 0xe4, 0xc6, 0x92, 0x50, 0xed, 0xd9, 0xee,
0xf8, 0x51, 0xdb, 0xfd, 0x00, 0xa4, 0x1b, 0xb8, 0xa9, 0x13, 0xdb, 0x77, 0xdb, 0xac, 0x5f, 0x4b,
0x69, 0xa9, 0x06, 0x6e, 0x56, 0xe8, 0xf8, 0xa7, 0xb7, 0x07, 0x61, 0x3f, 0xfe, 0x63, 0x1c, 0xb2,
0xe1, 0x9e, 0x8d, 0xb6, 0xc0, 0x06, 0xcb, 0xcf, 0x0a, 0x3b, 0xbe, 0x0f, 0xdd, 0xb5, 0xc3, 0x5b,
0x5c, 0xa6, 0x89, 0xbb, 0x38, 0xca, 0x3b, 0x29, 0x8d, 0x23, 0x69, 0xd1, 0xa4, 0x07, 0x96, 0xf0,
0xfe, 0x3c, 0xa5, 0x89, 0x11, 0x5a, 0x85, 0xd1, 0xab, 0x1e, 0xe3, 0x1e, 0x65, 0xdc, 0x0f, 0xdf,
0x9d, 0xfb, 0xca, 0x36, 0x23, 0x4f, 0x5f, 0xd9, 0xd6, 0x37, 0x36, 0xb5, 0x6a, 0x69, 0x5d, 0x13,
0x70, 0x74, 0x12, 0x12, 0x16, 0x7e, 0xb9, 0xdd, 0x9d, 0xe2, 0x99, 0x68, 0x58, 0xc7, 0x9f, 0x84,
0xc4, 0x0d, 0x82, 0xaf, 0x75, 0x27, 0x56, 0x26, 0xfa, 0x29, 0x86, 0xfe, 0x19, 0x48, 0x32, 0x7f,
0x21, 0x00, 0xe1, 0x31, 0x75, 0x04, 0xa5, 0x20, 0xb1, 0xbc, 0xa9, 0xd1, 0xf0, 0x57, 0x21, 0xcb,
0xa5, 0xfa, 0xd6, 0x5a, 0x65, 0xb9, 0xa2, 0xc6, 0xe6, 0xcf, 0xc3, 0x28, 0x77, 0x02, 0x3d, 0x1a,
0x81, 0x1b, 0xd4, 0x11, 0x31, 0x14, 0x1c, 0x8a, 0x9c, 0xdd, 0xad, 0x96, 0x2b, 0x9a, 0x1a, 0x0b,
0x6f, 0xaf, 0x07, 0xd9, 0x70, 0xbb, 0xf6, 0xb3, 0x89, 0xa9, 0xef, 0x28, 0x90, 0x09, 0xb5, 0x5f,
0xb4, 0xf0, 0x63, 0xcb, 0x72, 0x6e, 0xe8, 0xd8, 0x32, 0xb1, 0x27, 0x82, 0x02, 0x98, 0xa8, 0x44,
0x25, 0xc3, 0x6e, 0xda, 0xcf, 0xc4, 0xf8, 0xd7, 0x15, 0x50, 0x7b, 0x5b, 0xb7, 0x1e, 0x03, 0x95,
0x9f, 0xab, 0x81, 0xaf, 0x29, 0x90, 0xeb, 0xee, 0xd7, 0x7a, 0xcc, 0x3b, 0xf5, 0x73, 0x35, 0xef,
0xcb, 0x0a, 0x8c, 0x77, 0x75, 0x69, 0xff, 0xa7, 0xac, 0x7b, 0x35, 0x0e, 0x53, 0x03, 0x70, 0xa8,
0x24, 0xda, 0x59, 0xde, 0x61, 0x7f, 0x6c, 0x98, 0x67, 0x2d, 0xd2, 0x6a, 0xb9, 0x85, 0x5d, 0x5f,
0x74, 0xbf, 0x8f, 0x81, 0x6a, 0xd6, 0x88, 0xed, 0x9b, 0xfb, 0x26, 0x71, 0xc5, 0x2b, 0x38, 0xef,
0x71, 0x27, 0x3a, 0x72, 0xfe, 0x16, 0xfe, 0x51, 0x40, 0x4d, 0xc7, 0x33, 0x7d, 0xf3, 0x3a, 0xd1,
0x4d, 0x5b, 0xbe, 0xaf, 0xd3, 0x9e, 0x37, 0xa1, 0xa9, 0x72, 0x66, 0xcd, 0xf6, 0x03, 0x6d, 0x9b,
0xd4, 0x71, 0x8f, 0x36, 0xcd, 0x7d, 0x71, 0x4d, 0x95, 0x33, 0x81, 0xf6, 0x29, 0xc8, 0xd6, 0x9c,
0x16, 0x6d, 0x1f, 0xb8, 0x1e, 0x4d, 0xb5, 0x8a, 0x96, 0xe1, 0xb2, 0x40, 0x45, 0xf4, 0x77, 0x9d,
0x8b, 0x82, 0xac, 0x96, 0xe1, 0x32, 0xae, 0xf2, 0x28, 0x4c, 0xe0, 0x7a, 0xdd, 0xa5, 0xe4, 0x92,
0x88, 0x37, 0xad, 0xb9, 0x40, 0xcc, 0x14, 0x67, 0xae, 0x40, 0x4a, 0xfa, 0x81, 0x56, 0x33, 0xea,
0x09, 0xbd, 0xc9, 0xaf, 0x6b, 0x62, 0x0b, 0x69, 0x2d, 0x65, 0xcb, 0xc9, 0x53, 0x90, 0x35, 0x3d,
0xbd, 0x73, 0x6f, 0x18, 0x9b, 0x8b, 0x2d, 0xa4, 0xb4, 0x8c, 0xe9, 0x05, 0x17, 0x45, 0xf3, 0x6f,
0xc6, 0x20, 0xd7, 0x7d, 0xef, 0x89, 0x56, 0x20, 0x65, 0x39, 0x06, 0x66, 0x81, 0xc0, 0x2f, 0xdd,
0x17, 0x22, 0xae, 0x4a, 0x17, 0xd7, 0x85, 0xbe, 0x16, 0x20, 0x67, 0xfe, 0x5e, 0x81, 0x94, 0x14,
0xa3, 0x13, 0x90, 0x68, 0x62, 0xff, 0x80, 0xd1, 0x25, 0xcb, 0x31, 0x55, 0xd1, 0xd8, 0x98, 0xca,
0xbd, 0x26, 0xb6, 0x59, 0x08, 0x08, 0x39, 0x1d, 0xd3, 0x7d, 0xb5, 0x08, 0xae, 0xb1, 0x76, 0xd8,
0x69, 0x34, 0x88, 0xed, 0x7b, 0x72, 0x5f, 0x85, 0x7c, 0x59, 0x88, 0xd1, 0x13, 0x30, 0xe9, 0xbb,
0xd8, 0xb4, 0xba, 0x74, 0x13, 0x4c, 0x57, 0x95, 0x13, 0x81, 0x72, 0x11, 0x4e, 0x4a, 0xde, 0x1a,
0xf1, 0xb1, 0x71, 0x40, 0x6a, 0x1d, 0xd0, 0x28, 0xbb, 0x54, 0xbb, 0x5f, 0x28, 0xac, 0x88, 0x79,
0x89, 0x9d, 0xff, 0x81, 0x02, 0x93, 0xb2, 0x81, 0xaf, 0x05, 0xce, 0xaa, 0x02, 0x60, 0xdb, 0x76,
0xfc, 0xb0, 0xbb, 0xfa, 0x43, 0xb9, 0x0f, 0xb7, 0x58, 0x0a, 0x40, 0x5a, 0x88, 0x60, 0xa6, 0x01,
0xd0, 0x99, 0x39, 0xd2, 0x6d, 0xb3, 0x90, 0x11, 0x97, 0xda, 0xec, 0xcb, 0x08, 0x7f, 0xeb, 0x03,
0x2e, 0xa2, 0x9d, 0x3e, 0x9a, 0x86, 0xe4, 0x1e, 0xa9, 0x9b, 0xb6, 0xb8, 0x6a, 0xe3, 0x03, 0x79,
0x81, 0x97, 0x08, 0x2e, 0xf0, 0xca, 0x9f, 0x86, 0x29, 0xc3, 0x69, 0xf4, 0x9a, 0x5b, 0x56, 0x7b,
0xde, 0x3c, 0xbd, 0x4f, 0x2a, 0x2f, 0x42, 0xa7, 0x3b, 0x7b, 0x43, 0x51, 0xbe, 0x1a, 0x8b, 0xaf,
0x6e, 0x95, 0xbf, 0x1e, 0x9b, 0x59, 0xe5, 0xd0, 0x2d, 0xb9, 0x52, 0x8d, 0xec, 0x5b, 0xc4, 0xa0,
0xd6, 0xc3, 0x1b, 0x8f, 0xc0, 0xc7, 0xea, 0xa6, 0x7f, 0xd0, 0xda, 0x5b, 0x34, 0x9c, 0xc6, 0x99,
0xba, 0x53, 0x77, 0x3a, 0x1f, 0x83, 0xe8, 0x88, 0x0d, 0xd8, 0x7f, 0xe2, 0x83, 0x50, 0x3a, 0x90,
0xce, 0x44, 0x7e, 0x3d, 0x2a, 0x6e, 0xc0, 0x94, 0x50, 0xd6, 0xd9, 0x8d, 0x34, 0xef, 0xc3, 0xd1,
0x5d, 0x6f, 0x25, 0xf2, 0xdf, 0x7c, 0x87, 0x55, 0x3a, 0x6d, 0x52, 0x40, 0xe9, 0x1c, 0xef, 0xd4,
0x8b, 0x1a, 0xdc, 0xd7, 0xc5, 0xc7, 0x8f, 0x26, 0x71, 0x23, 0x18, 0xbf, 0x27, 0x18, 0xa7, 0x42,
0x8c, 0xdb, 0x02, 0x5a, 0x5c, 0x86, 0xf1, 0xe3, 0x70, 0xfd, 0xad, 0xe0, 0xca, 0x92, 0x30, 0xc9,
0x2a, 0x4c, 0x30, 0x12, 0xa3, 0xe5, 0xf9, 0x4e, 0x83, 0xe5, 0xbd, 0xbb, 0xd3, 0xfc, 0xdd, 0x3b,
0xfc, 0xac, 0xe4, 0x28, 0x6c, 0x39, 0x40, 0x15, 0x8b, 0xc0, 0x2e, 0xe1, 0x6b, 0xc4, 0xb0, 0x22,
0x18, 0xde, 0x12, 0x86, 0x04, 0xfa, 0xc5, 0x4f, 0xc1, 0x34, 0xfd, 0x9f, 0xa5, 0xa5, 0xb0, 0x25,
0xd1, 0x77, 0x30, 0xf9, 0x1f, 0xbc, 0xc2, 0x8f, 0xe3, 0x54, 0x40, 0x10, 0xb2, 0x29, 0xb4, 0x8b,
0x75, 0xe2, 0xfb, 0xc4, 0xf5, 0x74, 0x6c, 0x0d, 0x32, 0x2f, 0xf4, 0x06, 0x9b, 0xff, 0xd2, 0x7b,
0xdd, 0xbb, 0xb8, 0xca, 0x91, 0x25, 0xcb, 0x2a, 0xee, 0xc2, 0xfd, 0x03, 0xa2, 0x62, 0x08, 0xce,
0x57, 0x05, 0xe7, 0x74, 0x5f, 0x64, 0x50, 0xda, 0x2d, 0x90, 0xf2, 0x60, 0x2f, 0x87, 0xe0, 0xfc,
0xb2, 0xe0, 0x44, 0x02, 0x2b, 0xb7, 0x94, 0x32, 0x5e, 0x81, 0xc9, 0xeb, 0xc4, 0xdd, 0x73, 0x3c,
0x71, 0x71, 0x30, 0x04, 0xdd, 0x6b, 0x82, 0x6e, 0x42, 0x00, 0xd9, 0x35, 0x02, 0xe5, 0x7a, 0x1a,
0x52, 0xfb, 0xd8, 0x20, 0x43, 0x50, 0x7c, 0x45, 0x50, 0x8c, 0x51, 0x7d, 0x0a, 0x2d, 0x41, 0xb6,
0xee, 0x88, 0xca, 0x14, 0x0d, 0x7f, 0x5d, 0xc0, 0x33, 0x12, 0x23, 0x28, 0x9a, 0x4e, 0xb3, 0x65,
0xd1, 0xb2, 0x15, 0x4d, 0xf1, 0x7b, 0x92, 0x42, 0x62, 0x04, 0xc5, 0x31, 0xdc, 0xfa, 0x86, 0xa4,
0xf0, 0x42, 0xfe, 0x7c, 0x16, 0x32, 0x8e, 0x6d, 0xb5, 0x1d, 0x7b, 0x18, 0x23, 0x7e, 0x5f, 0x30,
0x80, 0x80, 0x50, 0x82, 0x4b, 0x90, 0x1e, 0x76, 0x23, 0xfe, 0xe0, 0x3d, 0x79, 0x3c, 0xe4, 0x0e,
0xac, 0xc2, 0x84, 0x4c, 0x50, 0xa6, 0x63, 0x0f, 0x41, 0xf1, 0x87, 0x82, 0x22, 0x17, 0x82, 0x89,
0x65, 0xf8, 0xc4, 0xf3, 0xeb, 0x64, 0x18, 0x92, 0x37, 0xe5, 0x32, 0x04, 0x44, 0xb8, 0x72, 0x8f,
0xd8, 0xc6, 0xc1, 0x70, 0x0c, 0x5f, 0x93, 0xae, 0x94, 0x18, 0x4a, 0xb1, 0x0c, 0xe3, 0x0d, 0xec,
0x7a, 0x07, 0xd8, 0x1a, 0x6a, 0x3b, 0xfe, 0x48, 0x70, 0x64, 0x03, 0x90, 0xf0, 0x48, 0xcb, 0x3e,
0x0e, 0xcd, 0xd7, 0xa5, 0x47, 0x42, 0x30, 0x71, 0xf4, 0x3c, 0x9f, 0xdd, 0xcd, 0x1c, 0x87, 0xed,
0x8f, 0xe5, 0xd1, 0xe3, 0xd8, 0x6a, 0x98, 0xf1, 0x12, 0xa4, 0x3d, 0xf3, 0xe5, 0xa1, 0x68, 0xfe,
0x44, 0xee, 0x34, 0x03, 0x50, 0xf0, 0x0b, 0x70, 0x72, 0x60, 0x99, 0x18, 0x82, 0xec, 0x4f, 0x05,
0xd9, 0x89, 0x01, 0xa5, 0x42, 0xa4, 0x84, 0xe3, 0x52, 0xfe, 0x99, 0x4c, 0x09, 0xa4, 0x87, 0x6b,
0x8b, 0x76, 0xf6, 0x1e, 0xde, 0x3f, 0x9e, 0xd7, 0xfe, 0x5c, 0x7a, 0x8d, 0x63, 0xbb, 0xbc, 0xb6,
0x03, 0x27, 0x04, 0xe3, 0xf1, 0xf6, 0xf5, 0x1b, 0x32, 0xb1, 0x72, 0xf4, 0x6e, 0xf7, 0xee, 0x7e,
0x1a, 0x66, 0x02, 0x77, 0xca, 0xa6, 0xd4, 0xd3, 0x1b, 0xb8, 0x39, 0x04, 0xf3, 0x37, 0x05, 0xb3,
0xcc, 0xf8, 0x41, 0x57, 0xeb, 0x55, 0x71, 0x93, 0x92, 0x3f, 0x0f, 0x79, 0x49, 0xde, 0xb2, 0x5d,
0x62, 0x38, 0x75, 0xdb, 0x7c, 0x99, 0xd4, 0x86, 0xa0, 0xfe, 0x8b, 0x9e, 0xad, 0xda, 0x0d, 0xc1,
0x29, 0xf3, 0x1a, 0xa8, 0x41, 0xaf, 0xa2, 0x9b, 0x8d, 0xa6, 0xe3, 0xfa, 0x11, 0x8c, 0x7f, 0x29,
0x77, 0x2a, 0xc0, 0xad, 0x31, 0x58, 0xb1, 0x02, 0x39, 0x36, 0x1c, 0x36, 0x24, 0xff, 0x4a, 0x10,
0x8d, 0x77, 0x50, 0x22, 0x71, 0x18, 0x4e, 0xa3, 0x89, 0xdd, 0x61, 0xf2, 0xdf, 0xb7, 0x64, 0xe2,
0x10, 0x10, 0x91, 0x38, 0xfc, 0x76, 0x93, 0xd0, 0x6a, 0x3f, 0x04, 0xc3, 0xb7, 0x65, 0xe2, 0x90,
0x18, 0x41, 0x21, 0x1b, 0x86, 0x21, 0x28, 0xfe, 0x5a, 0x52, 0x48, 0x0c, 0x3f, 0x03, 0x13, 0x3d,
0xfd, 0x00, 0x8a, 0xfa, 0xfc, 0x9e, 0xff, 0xcc, 0x07, 0x22, 0x73, 0x74, 0xb7, 0x03, 0xc5, 0x75,
0xba, 0x49, 0xdd, 0x45, 0x3b, 0x9a, 0xec, 0x95, 0x0f, 0x82, 0x7d, 0xea, 0xaa, 0xd9, 0xc5, 0xcb,
0x30, 0xde, 0x55, 0xb0, 0xa3, 0xa9, 0x7e, 0x51, 0x50, 0x65, 0xc3, 0xf5, 0xba, 0x78, 0x1e, 0x12,
0xb4, 0xf8, 0x46, 0xc3, 0x7f, 0x49, 0xc0, 0x99, 0x7a, 0xf1, 0x13, 0x90, 0x92, 0x45, 0x37, 0x1a,
0xfa, 0xcb, 0x02, 0x1a, 0x40, 0x28, 0x5c, 0x16, 0xdc, 0x68, 0xf8, 0xe7, 0x24, 0x5c, 0x42, 0x28,
0x7c, 0x78, 0x17, 0x7e, 0xf7, 0x0b, 0x09, 0x91, 0x34, 0xa5, 0xef, 0x2e, 0xc1, 0x98, 0xa8, 0xb4,
0xd1, 0xe8, 0xcf, 0x8b, 0x87, 0x4b, 0x44, 0xf1, 0x29, 0x48, 0x0e, 0xe9, 0xf0, 0x5f, 0x15, 0x50,
0xae, 0x5f, 0x5c, 0x86, 0x4c, 0xa8, 0xba, 0x46, 0xc3, 0x7f, 0x4d, 0xc0, 0xc3, 0x28, 0x6a, 0xba,
0xa8, 0xae, 0xd1, 0x04, 0xbf, 0x2e, 0x4d, 0x17, 0x08, 0xea, 0x36, 0x59, 0x58, 0xa3, 0xd1, 0xbf,
0x21, 0xbd, 0x2e, 0x21, 0xc5, 0x67, 0x21, 0x1d, 0x24, 0xcb, 0x68, 0xfc, 0x6f, 0x0a, 0x7c, 0x07,
0x43, 0x3d, 0x10, 0x4a, 0xd6, 0xd1, 0x14, 0xbf, 0x25, 0x3d, 0x10, 0x42, 0xd1, 0x63, 0xd4, 0x5b,
0x80, 0xa3, 0x99, 0x7e, 0x5b, 0x1e, 0xa3, 0x9e, 0xfa, 0x4b, 0x77, 0x93, 0xe5, 0xac, 0x68, 0x8a,
0xdf, 0x91, 0xbb, 0xc9, 0xf4, 0xa9, 0x19, 0xbd, 0x15, 0x2d, 0x9a, 0xe3, 0x77, 0xa5, 0x19, 0x3d,
0x05, 0xad, 0xb8, 0x05, 0xa8, 0xbf, 0x9a, 0x45, 0xf3, 0x7d, 0x51, 0xf0, 0x4d, 0xf6, 0x15, 0xb3,
0xe2, 0x73, 0x70, 0x62, 0x70, 0x25, 0x8b, 0x66, 0xfd, 0xd2, 0x07, 0x3d, 0xef, 0x1e, 0xe1, 0x42,
0x56, 0xdc, 0xe9, 0xbc, 0x7b, 0x84, 0xab, 0x58, 0x34, 0xed, 0xab, 0x1f, 0x74, 0xbf, 0x9a, 0x86,
0x8b, 0x58, 0xb1, 0x04, 0xd0, 0x29, 0x20, 0xd1, 0x5c, 0xaf, 0x09, 0xae, 0x10, 0x88, 0x1e, 0x0d,
0x51, 0x3f, 0xa2, 0xf1, 0x5f, 0x91, 0x47, 0x43, 0x20, 0xe8, 0xd1, 0x90, 0xa5, 0x23, 0x1a, 0xfd,
0xba, 0x3c, 0x1a, 0x12, 0x52, 0xbc, 0x04, 0x29, 0xbb, 0x65, 0x59, 0x34, 0xb6, 0xd0, 0xdd, 0x7f,
0x11, 0x93, 0xff, 0xd1, 0x87, 0x02, 0x2c, 0x01, 0xc5, 0xf3, 0x90, 0x24, 0x8d, 0x3d, 0x52, 0x8b,
0x42, 0xfe, 0xcb, 0x87, 0x32, 0x9f, 0x50, 0xed, 0xe2, 0xb3, 0x00, 0xfc, 0xcd, 0x97, 0x7d, 0x10,
0x89, 0xc0, 0xfe, 0xeb, 0x87, 0xe2, 0x63, 0x7b, 0x07, 0xd2, 0x21, 0xe0, 0x9f, 0xee, 0xef, 0x4e,
0xf0, 0x5e, 0x37, 0x01, 0x7b, 0x5b, 0x7e, 0x1a, 0xc6, 0xae, 0x7a, 0x8e, 0xed, 0xe3, 0x7a, 0x14,
0xfa, 0xdf, 0x04, 0x5a, 0xea, 0x53, 0x87, 0x35, 0x1c, 0x97, 0xf8, 0xb8, 0xee, 0x45, 0x61, 0xff,
0x5d, 0x60, 0x03, 0x00, 0x05, 0x1b, 0xd8, 0xf3, 0x87, 0x59, 0xf7, 0x7f, 0x48, 0xb0, 0x04, 0x50,
0xa3, 0xe9, 0xff, 0xd7, 0x48, 0x3b, 0x0a, 0xfb, 0xbe, 0x34, 0x5a, 0xe8, 0x17, 0x3f, 0x01, 0x69,
0xfa, 0x2f, 0xff, 0x01, 0x4a, 0x04, 0xf8, 0x3f, 0x05, 0xb8, 0x83, 0xa0, 0x4f, 0xf6, 0xfc, 0x9a,
0x6f, 0x46, 0x3b, 0xfb, 0xbf, 0xc4, 0x4e, 0x4b, 0xfd, 0x62, 0x09, 0x32, 0x9e, 0x5f, 0xab, 0xb5,
0x5c, 0x7e, 0x13, 0x17, 0x01, 0xff, 0xef, 0x0f, 0x83, 0x37, 0xd2, 0x00, 0x53, 0x3e, 0x35, 0xf8,
0x72, 0x0d, 0x56, 0x9d, 0x55, 0x87, 0x5f, 0xab, 0xc1, 0x77, 0x26, 0xe0, 0xb4, 0xe1, 0x34, 0xf6,
0x1c, 0xef, 0x0c, 0x4f, 0x28, 0x41, 0x3a, 0x39, 0x23, 0xdd, 0x27, 0xae, 0xc6, 0x02, 0x77, 0xce,
0x1c, 0xef, 0x4e, 0x6d, 0xfe, 0x47, 0xe3, 0x90, 0x5a, 0xc6, 0x9e, 0x8f, 0x6f, 0xe0, 0x36, 0x3a,
0x0d, 0xa9, 0x35, 0xdb, 0x3f, 0x77, 0x76, 0xcb, 0x77, 0xd9, 0x17, 0x95, 0x78, 0x39, 0x7d, 0xe7,
0xd6, 0x6c, 0xd2, 0xa4, 0x32, 0x2d, 0x98, 0x42, 0x0f, 0x41, 0x92, 0xfd, 0xcf, 0x6e, 0x16, 0xe3,
0xe5, 0xf1, 0xb7, 0x6e, 0xcd, 0x8e, 0x74, 0xf4, 0xf8, 0x1c, 0x7a, 0x01, 0x32, 0xd5, 0xf6, 0xae,
0x69, 0xfb, 0x17, 0x96, 0x28, 0x1d, 0x75, 0x40, 0xa2, 0xfc, 0xd4, 0x9d, 0x5b, 0xb3, 0xe7, 0x8e,
0x34, 0x90, 0x96, 0xc5, 0xce, 0xc2, 0x24, 0x9a, 0xfd, 0x10, 0x2f, 0xcc, 0x85, 0x9e, 0x83, 0x94,
0x1c, 0xf2, 0x1b, 0xfa, 0xf2, 0x25, 0x61, 0xc2, 0x3d, 0x71, 0x07, 0x64, 0xe8, 0xff, 0x43, 0xb6,
0xda, 0xbe, 0x6c, 0x39, 0x58, 0xf8, 0x20, 0x39, 0xa7, 0x2c, 0xc4, 0xca, 0x17, 0xef, 0xdc, 0x9a,
0x5d, 0x1a, 0x9a, 0x58, 0xc0, 0x19, 0x73, 0x17, 0x1b, 0x7a, 0x11, 0xd2, 0xc1, 0x98, 0x7d, 0x03,
0x88, 0x95, 0x3f, 0x2e, 0xec, 0xbe, 0x37, 0xfa, 0x0e, 0x5d, 0xc8, 0x72, 0xee, 0xee, 0xb1, 0x39,
0x65, 0x41, 0xb9, 0x17, 0xcb, 0x85, 0x4f, 0xba, 0xd8, 0x42, 0x96, 0x5f, 0x58, 0x62, 0x1f, 0x1d,
0x94, 0x7b, 0xb5, 0x5c, 0xd0, 0x77, 0xe8, 0xd0, 0x15, 0x18, 0xab, 0xb6, 0xcb, 0x6d, 0x9f, 0x78,
0xec, 0xd7, 0x29, 0xd9, 0xf2, 0x93, 0x77, 0x6e, 0xcd, 0x7e, 0x74, 0x48, 0x56, 0x86, 0xd3, 0x24,
0x01, 0x9a, 0x83, 0xcc, 0x86, 0xe3, 0x36, 0xb0, 0xc5, 0xf9, 0x80, 0x7f, 0x44, 0x09, 0x89, 0xd0,
0x2e, 0x5d, 0x09, 0xdf, 0x6d, 0x8f, 0xfd, 0xb4, 0xfe, 0x27, 0x88, 0xc9, 0x0e, 0x13, 0x32, 0x21,
0x59, 0x6d, 0x57, 0x71, 0x33, 0x9f, 0x65, 0x37, 0xfc, 0x0f, 0x2e, 0x06, 0x08, 0x79, 0xb6, 0x16,
0xd9, 0x3c, 0xfb, 0x15, 0x41, 0x79, 0xe9, 0xce, 0xad, 0xd9, 0x27, 0x87, 0x7e, 0x62, 0x15, 0x37,
0xd9, 0xe3, 0xf8, 0x13, 0xd0, 0xb7, 0x14, 0x7a, 0xb0, 0xf8, 0x15, 0x29, 0x7d, 0xe2, 0x38, 0x7b,
0xe2, 0x43, 0x03, 0x9f, 0x18, 0x68, 0xf1, 0xe7, 0xda, 0x9f, 0x7d, 0xfb, 0x18, 0x2b, 0xe5, 0x6f,
0x36, 0xf4, 0xd1, 0xbf, 0xf2, 0xf6, 0x3d, 0x1f, 0xda, 0xc0, 0x02, 0xf4, 0x8a, 0x02, 0xe3, 0xd5,
0xf6, 0x86, 0xa8, 0xb1, 0xd4, 0xf2, 0x9c, 0xf8, 0x01, 0xf6, 0x20, 0xcb, 0x43, 0x7a, 0xdc, 0xf6,
0x0b, 0x9f, 0x7d, 0x7b, 0xf6, 0xec, 0xd0, 0x46, 0xb0, 0x14, 0xc4, 0x6c, 0xe8, 0x7e, 0x26, 0xfa,
0x1c, 0xb3, 0xa2, 0x42, 0xeb, 0x75, 0x8d, 0xd4, 0xa8, 0x15, 0x13, 0x77, 0xb1, 0x22, 0xa4, 0xc7,
0xad, 0x28, 0xd2, 0xa8, 0xbf, 0x77, 0x4b, 0x42, 0x7c, 0x68, 0x13, 0x46, 0xb9, 0x87, 0xd9, 0x2f,
0xa3, 0xd2, 0xc7, 0x0c, 0xc3, 0xce, 0xe6, 0x68, 0x82, 0x66, 0xe6, 0x22, 0x40, 0x27, 0xc6, 0x90,
0x0a, 0xf1, 0x6b, 0xa4, 0x2d, 0x7e, 0x01, 0x47, 0xff, 0x45, 0xd3, 0x9d, 0x5f, 0x78, 0x2a, 0x0b,
0x09, 0xf1, 0xb3, 0xcd, 0x62, 0xec, 0xa2, 0x32, 0xf3, 0x0c, 0xa8, 0xbd, 0xb1, 0x72, 0x2c, 0xbc,
0x06, 0xa8, 0x7f, 0xc7, 0xc2, 0x0c, 0x49, 0xce, 0xf0, 0x48, 0x98, 0x21, 0x73, 0x56, 0xed, 0xf8,
0xfc, 0x39, 0xd3, 0xf2, 0x1c, 0xbb, 0x8f, 0xb3, 0xd7, 0xff, 0x3f, 0x19, 0xe7, 0x7c, 0x01, 0x46,
0xb9, 0x90, 0xae, 0x65, 0x8d, 0x95, 0x0f, 0x56, 0xe5, 0x34, 0x3e, 0x28, 0xaf, 0xbf, 0x75, 0xbb,
0x30, 0xf2, 0xfd, 0xdb, 0x85, 0x91, 0x7f, 0xb8, 0x5d, 0x18, 0xf9, 0xe1, 0xed, 0x82, 0xf2, 0xee,
0xed, 0x82, 0xf2, 0xfe, 0xed, 0x82, 0xf2, 0xe3, 0xdb, 0x05, 0xe5, 0xe6, 0x61, 0x41, 0xf9, 0xda,
0x61, 0x41, 0xf9, 0xc6, 0x61, 0x41, 0xf9, 0x9b, 0xc3, 0x82, 0xf2, 0xdd, 0xc3, 0x82, 0xf2, 0xd6,
0x61, 0x61, 0xe4, 0xfb, 0x87, 0x85, 0x91, 0x1f, 0x1e, 0x16, 0x94, 0x77, 0x0f, 0x0b, 0x23, 0xef,
0x1f, 0x16, 0x94, 0x1f, 0x1f, 0x16, 0x94, 0x9b, 0xff, 0x54, 0x18, 0xf9, 0xdf, 0x00, 0x00, 0x00,
0xff, 0xff, 0xeb, 0x34, 0x72, 0x4f, 0xe4, 0x34, 0x00, 0x00,
}
r := bytes.NewReader(gzipped)
gzipr, err := compress_gzip.NewReader(r)
if err != nil {
panic(err)
}
ungzipped, err := io_ioutil.ReadAll(gzipr)
if err != nil {
panic(err)
}
if err := github_com_gogo_protobuf_proto.Unmarshal(ungzipped, d); err != nil {
panic(err)
}
return d
}
func (this *Castaway) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Castaway)
if !ok {
that2, ok := that.(Castaway)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Castaway")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Castaway but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Castaway but is not nil && this == nil")
}
if this.Int32Ptr != nil && that1.Int32Ptr != nil {
if *this.Int32Ptr != *that1.Int32Ptr {
return fmt.Errorf("Int32Ptr this(%v) Not Equal that(%v)", *this.Int32Ptr, *that1.Int32Ptr)
}
} else if this.Int32Ptr != nil {
return fmt.Errorf("this.Int32Ptr == nil && that.Int32Ptr != nil")
} else if that1.Int32Ptr != nil {
return fmt.Errorf("Int32Ptr this(%v) Not Equal that(%v)", this.Int32Ptr, that1.Int32Ptr)
}
if this.Int32 != that1.Int32 {
return fmt.Errorf("Int32 this(%v) Not Equal that(%v)", this.Int32, that1.Int32)
}
if this.MyUint64Ptr != nil && that1.MyUint64Ptr != nil {
if *this.MyUint64Ptr != *that1.MyUint64Ptr {
return fmt.Errorf("MyUint64Ptr this(%v) Not Equal that(%v)", *this.MyUint64Ptr, *that1.MyUint64Ptr)
}
} else if this.MyUint64Ptr != nil {
return fmt.Errorf("this.MyUint64Ptr == nil && that.MyUint64Ptr != nil")
} else if that1.MyUint64Ptr != nil {
return fmt.Errorf("MyUint64Ptr this(%v) Not Equal that(%v)", this.MyUint64Ptr, that1.MyUint64Ptr)
}
if this.MyUint64 != that1.MyUint64 {
return fmt.Errorf("MyUint64 this(%v) Not Equal that(%v)", this.MyUint64, that1.MyUint64)
}
if this.MyFloat32Ptr != nil && that1.MyFloat32Ptr != nil {
if *this.MyFloat32Ptr != *that1.MyFloat32Ptr {
return fmt.Errorf("MyFloat32Ptr this(%v) Not Equal that(%v)", *this.MyFloat32Ptr, *that1.MyFloat32Ptr)
}
} else if this.MyFloat32Ptr != nil {
return fmt.Errorf("this.MyFloat32Ptr == nil && that.MyFloat32Ptr != nil")
} else if that1.MyFloat32Ptr != nil {
return fmt.Errorf("MyFloat32Ptr this(%v) Not Equal that(%v)", this.MyFloat32Ptr, that1.MyFloat32Ptr)
}
if this.MyFloat32 != that1.MyFloat32 {
return fmt.Errorf("MyFloat32 this(%v) Not Equal that(%v)", this.MyFloat32, that1.MyFloat32)
}
if this.MyFloat64Ptr != nil && that1.MyFloat64Ptr != nil {
if *this.MyFloat64Ptr != *that1.MyFloat64Ptr {
return fmt.Errorf("MyFloat64Ptr this(%v) Not Equal that(%v)", *this.MyFloat64Ptr, *that1.MyFloat64Ptr)
}
} else if this.MyFloat64Ptr != nil {
return fmt.Errorf("this.MyFloat64Ptr == nil && that.MyFloat64Ptr != nil")
} else if that1.MyFloat64Ptr != nil {
return fmt.Errorf("MyFloat64Ptr this(%v) Not Equal that(%v)", this.MyFloat64Ptr, that1.MyFloat64Ptr)
}
if this.MyFloat64 != that1.MyFloat64 {
return fmt.Errorf("MyFloat64 this(%v) Not Equal that(%v)", this.MyFloat64, that1.MyFloat64)
}
if !bytes.Equal(this.MyBytes, that1.MyBytes) {
return fmt.Errorf("MyBytes this(%v) Not Equal that(%v)", this.MyBytes, that1.MyBytes)
}
if !bytes.Equal(this.NormalBytes, that1.NormalBytes) {
return fmt.Errorf("NormalBytes this(%v) Not Equal that(%v)", this.NormalBytes, that1.NormalBytes)
}
if len(this.MyUint64S) != len(that1.MyUint64S) {
return fmt.Errorf("MyUint64S this(%v) Not Equal that(%v)", len(this.MyUint64S), len(that1.MyUint64S))
}
for i := range this.MyUint64S {
if this.MyUint64S[i] != that1.MyUint64S[i] {
return fmt.Errorf("MyUint64S this[%v](%v) Not Equal that[%v](%v)", i, this.MyUint64S[i], i, that1.MyUint64S[i])
}
}
if len(this.MyMap) != len(that1.MyMap) {
return fmt.Errorf("MyMap this(%v) Not Equal that(%v)", len(this.MyMap), len(that1.MyMap))
}
for i := range this.MyMap {
if this.MyMap[i] != that1.MyMap[i] {
return fmt.Errorf("MyMap this[%v](%v) Not Equal that[%v](%v)", i, this.MyMap[i], i, that1.MyMap[i])
}
}
if len(this.MyCustomMap) != len(that1.MyCustomMap) {
return fmt.Errorf("MyCustomMap this(%v) Not Equal that(%v)", len(this.MyCustomMap), len(that1.MyCustomMap))
}
for i := range this.MyCustomMap {
if this.MyCustomMap[i] != that1.MyCustomMap[i] {
return fmt.Errorf("MyCustomMap this[%v](%v) Not Equal that[%v](%v)", i, this.MyCustomMap[i], i, that1.MyCustomMap[i])
}
}
if len(this.MyNullableMap) != len(that1.MyNullableMap) {
return fmt.Errorf("MyNullableMap this(%v) Not Equal that(%v)", len(this.MyNullableMap), len(that1.MyNullableMap))
}
for i := range this.MyNullableMap {
if !this.MyNullableMap[i].Equal(that1.MyNullableMap[i]) {
return fmt.Errorf("MyNullableMap this[%v](%v) Not Equal that[%v](%v)", i, this.MyNullableMap[i], i, that1.MyNullableMap[i])
}
}
if len(this.MyEmbeddedMap) != len(that1.MyEmbeddedMap) {
return fmt.Errorf("MyEmbeddedMap this(%v) Not Equal that(%v)", len(this.MyEmbeddedMap), len(that1.MyEmbeddedMap))
}
for i := range this.MyEmbeddedMap {
a := this.MyEmbeddedMap[i]
b := that1.MyEmbeddedMap[i]
if !(&a).Equal(&b) {
return fmt.Errorf("MyEmbeddedMap this[%v](%v) Not Equal that[%v](%v)", i, this.MyEmbeddedMap[i], i, that1.MyEmbeddedMap[i])
}
}
if this.String_ != nil && that1.String_ != nil {
if *this.String_ != *that1.String_ {
return fmt.Errorf("String_ this(%v) Not Equal that(%v)", *this.String_, *that1.String_)
}
} else if this.String_ != nil {
return fmt.Errorf("this.String_ == nil && that.String_ != nil")
} else if that1.String_ != nil {
return fmt.Errorf("String_ this(%v) Not Equal that(%v)", this.String_, that1.String_)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *Castaway) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Castaway)
if !ok {
that2, ok := that.(Castaway)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Int32Ptr != nil && that1.Int32Ptr != nil {
if *this.Int32Ptr != *that1.Int32Ptr {
return false
}
} else if this.Int32Ptr != nil {
return false
} else if that1.Int32Ptr != nil {
return false
}
if this.Int32 != that1.Int32 {
return false
}
if this.MyUint64Ptr != nil && that1.MyUint64Ptr != nil {
if *this.MyUint64Ptr != *that1.MyUint64Ptr {
return false
}
} else if this.MyUint64Ptr != nil {
return false
} else if that1.MyUint64Ptr != nil {
return false
}
if this.MyUint64 != that1.MyUint64 {
return false
}
if this.MyFloat32Ptr != nil && that1.MyFloat32Ptr != nil {
if *this.MyFloat32Ptr != *that1.MyFloat32Ptr {
return false
}
} else if this.MyFloat32Ptr != nil {
return false
} else if that1.MyFloat32Ptr != nil {
return false
}
if this.MyFloat32 != that1.MyFloat32 {
return false
}
if this.MyFloat64Ptr != nil && that1.MyFloat64Ptr != nil {
if *this.MyFloat64Ptr != *that1.MyFloat64Ptr {
return false
}
} else if this.MyFloat64Ptr != nil {
return false
} else if that1.MyFloat64Ptr != nil {
return false
}
if this.MyFloat64 != that1.MyFloat64 {
return false
}
if !bytes.Equal(this.MyBytes, that1.MyBytes) {
return false
}
if !bytes.Equal(this.NormalBytes, that1.NormalBytes) {
return false
}
if len(this.MyUint64S) != len(that1.MyUint64S) {
return false
}
for i := range this.MyUint64S {
if this.MyUint64S[i] != that1.MyUint64S[i] {
return false
}
}
if len(this.MyMap) != len(that1.MyMap) {
return false
}
for i := range this.MyMap {
if this.MyMap[i] != that1.MyMap[i] {
return false
}
}
if len(this.MyCustomMap) != len(that1.MyCustomMap) {
return false
}
for i := range this.MyCustomMap {
if this.MyCustomMap[i] != that1.MyCustomMap[i] {
return false
}
}
if len(this.MyNullableMap) != len(that1.MyNullableMap) {
return false
}
for i := range this.MyNullableMap {
if !this.MyNullableMap[i].Equal(that1.MyNullableMap[i]) {
return false
}
}
if len(this.MyEmbeddedMap) != len(that1.MyEmbeddedMap) {
return false
}
for i := range this.MyEmbeddedMap {
a := this.MyEmbeddedMap[i]
b := that1.MyEmbeddedMap[i]
if !(&a).Equal(&b) {
return false
}
}
if this.String_ != nil && that1.String_ != nil {
if *this.String_ != *that1.String_ {
return false
}
} else if this.String_ != nil {
return false
} else if that1.String_ != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *Wilson) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*Wilson)
if !ok {
that2, ok := that.(Wilson)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *Wilson")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *Wilson but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *Wilson but is not nil && this == nil")
}
if this.Int64 != nil && that1.Int64 != nil {
if *this.Int64 != *that1.Int64 {
return fmt.Errorf("Int64 this(%v) Not Equal that(%v)", *this.Int64, *that1.Int64)
}
} else if this.Int64 != nil {
return fmt.Errorf("this.Int64 == nil && that.Int64 != nil")
} else if that1.Int64 != nil {
return fmt.Errorf("Int64 this(%v) Not Equal that(%v)", this.Int64, that1.Int64)
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *Wilson) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*Wilson)
if !ok {
that2, ok := that.(Wilson)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Int64 != nil && that1.Int64 != nil {
if *this.Int64 != *that1.Int64 {
return false
}
} else if this.Int64 != nil {
return false
} else if that1.Int64 != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
type CastawayFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetInt32Ptr() *int32
GetInt32() int32
GetMyUint64Ptr() *github_com_gogo_protobuf_test_casttype.MyUint64Type
GetMyUint64() github_com_gogo_protobuf_test_casttype.MyUint64Type
GetMyFloat32Ptr() *github_com_gogo_protobuf_test_casttype.MyFloat32Type
GetMyFloat32() github_com_gogo_protobuf_test_casttype.MyFloat32Type
GetMyFloat64Ptr() *github_com_gogo_protobuf_test_casttype.MyFloat64Type
GetMyFloat64() github_com_gogo_protobuf_test_casttype.MyFloat64Type
GetMyBytes() github_com_gogo_protobuf_test_casttype.Bytes
GetNormalBytes() []byte
GetMyUint64S() []github_com_gogo_protobuf_test_casttype.MyUint64Type
GetMyMap() github_com_gogo_protobuf_test_casttype.MyMapType
GetMyCustomMap() map[github_com_gogo_protobuf_test_casttype.MyStringType]github_com_gogo_protobuf_test_casttype.MyUint64Type
GetMyNullableMap() map[github_com_gogo_protobuf_test_casttype.MyInt32Type]*Wilson
GetMyEmbeddedMap() map[github_com_gogo_protobuf_test_casttype.MyInt32Type]Wilson
GetString_() *github_com_gogo_protobuf_test_casttype.MyStringType
}
func (this *Castaway) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Castaway) TestProto() github_com_gogo_protobuf_proto.Message {
return NewCastawayFromFace(this)
}
func (this *Castaway) GetInt32Ptr() *int32 {
return this.Int32Ptr
}
func (this *Castaway) GetInt32() int32 {
return this.Int32
}
func (this *Castaway) GetMyUint64Ptr() *github_com_gogo_protobuf_test_casttype.MyUint64Type {
return this.MyUint64Ptr
}
func (this *Castaway) GetMyUint64() github_com_gogo_protobuf_test_casttype.MyUint64Type {
return this.MyUint64
}
func (this *Castaway) GetMyFloat32Ptr() *github_com_gogo_protobuf_test_casttype.MyFloat32Type {
return this.MyFloat32Ptr
}
func (this *Castaway) GetMyFloat32() github_com_gogo_protobuf_test_casttype.MyFloat32Type {
return this.MyFloat32
}
func (this *Castaway) GetMyFloat64Ptr() *github_com_gogo_protobuf_test_casttype.MyFloat64Type {
return this.MyFloat64Ptr
}
func (this *Castaway) GetMyFloat64() github_com_gogo_protobuf_test_casttype.MyFloat64Type {
return this.MyFloat64
}
func (this *Castaway) GetMyBytes() github_com_gogo_protobuf_test_casttype.Bytes {
return this.MyBytes
}
func (this *Castaway) GetNormalBytes() []byte {
return this.NormalBytes
}
func (this *Castaway) GetMyUint64S() []github_com_gogo_protobuf_test_casttype.MyUint64Type {
return this.MyUint64S
}
func (this *Castaway) GetMyMap() github_com_gogo_protobuf_test_casttype.MyMapType {
return this.MyMap
}
func (this *Castaway) GetMyCustomMap() map[github_com_gogo_protobuf_test_casttype.MyStringType]github_com_gogo_protobuf_test_casttype.MyUint64Type {
return this.MyCustomMap
}
func (this *Castaway) GetMyNullableMap() map[github_com_gogo_protobuf_test_casttype.MyInt32Type]*Wilson {
return this.MyNullableMap
}
func (this *Castaway) GetMyEmbeddedMap() map[github_com_gogo_protobuf_test_casttype.MyInt32Type]Wilson {
return this.MyEmbeddedMap
}
func (this *Castaway) GetString_() *github_com_gogo_protobuf_test_casttype.MyStringType {
return this.String_
}
func NewCastawayFromFace(that CastawayFace) *Castaway {
this := &Castaway{}
this.Int32Ptr = that.GetInt32Ptr()
this.Int32 = that.GetInt32()
this.MyUint64Ptr = that.GetMyUint64Ptr()
this.MyUint64 = that.GetMyUint64()
this.MyFloat32Ptr = that.GetMyFloat32Ptr()
this.MyFloat32 = that.GetMyFloat32()
this.MyFloat64Ptr = that.GetMyFloat64Ptr()
this.MyFloat64 = that.GetMyFloat64()
this.MyBytes = that.GetMyBytes()
this.NormalBytes = that.GetNormalBytes()
this.MyUint64S = that.GetMyUint64S()
this.MyMap = that.GetMyMap()
this.MyCustomMap = that.GetMyCustomMap()
this.MyNullableMap = that.GetMyNullableMap()
this.MyEmbeddedMap = that.GetMyEmbeddedMap()
this.String_ = that.GetString_()
return this
}
type WilsonFace interface {
Proto() github_com_gogo_protobuf_proto.Message
GetInt64() *int64
}
func (this *Wilson) Proto() github_com_gogo_protobuf_proto.Message {
return this
}
func (this *Wilson) TestProto() github_com_gogo_protobuf_proto.Message {
return NewWilsonFromFace(this)
}
func (this *Wilson) GetInt64() *int64 {
return this.Int64
}
func NewWilsonFromFace(that WilsonFace) *Wilson {
this := &Wilson{}
this.Int64 = that.GetInt64()
return this
}
func (this *Castaway) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 20)
s = append(s, "&casttype.Castaway{")
if this.Int32Ptr != nil {
s = append(s, "Int32Ptr: "+valueToGoStringCasttype(this.Int32Ptr, "int32")+",\n")
}
s = append(s, "Int32: "+fmt.Sprintf("%#v", this.Int32)+",\n")
if this.MyUint64Ptr != nil {
s = append(s, "MyUint64Ptr: "+valueToGoStringCasttype(this.MyUint64Ptr, "github_com_gogo_protobuf_test_casttype.MyUint64Type")+",\n")
}
s = append(s, "MyUint64: "+fmt.Sprintf("%#v", this.MyUint64)+",\n")
if this.MyFloat32Ptr != nil {
s = append(s, "MyFloat32Ptr: "+valueToGoStringCasttype(this.MyFloat32Ptr, "github_com_gogo_protobuf_test_casttype.MyFloat32Type")+",\n")
}
s = append(s, "MyFloat32: "+fmt.Sprintf("%#v", this.MyFloat32)+",\n")
if this.MyFloat64Ptr != nil {
s = append(s, "MyFloat64Ptr: "+valueToGoStringCasttype(this.MyFloat64Ptr, "github_com_gogo_protobuf_test_casttype.MyFloat64Type")+",\n")
}
s = append(s, "MyFloat64: "+fmt.Sprintf("%#v", this.MyFloat64)+",\n")
if this.MyBytes != nil {
s = append(s, "MyBytes: "+valueToGoStringCasttype(this.MyBytes, "github_com_gogo_protobuf_test_casttype.Bytes")+",\n")
}
if this.NormalBytes != nil {
s = append(s, "NormalBytes: "+valueToGoStringCasttype(this.NormalBytes, "byte")+",\n")
}
if this.MyUint64S != nil {
s = append(s, "MyUint64S: "+fmt.Sprintf("%#v", this.MyUint64S)+",\n")
}
keysForMyMap := make([]string, 0, len(this.MyMap))
for k := range this.MyMap {
keysForMyMap = append(keysForMyMap, k)
}
github_com_gogo_protobuf_sortkeys.Strings(keysForMyMap)
mapStringForMyMap := "github_com_gogo_protobuf_test_casttype.MyMapType{"
for _, k := range keysForMyMap {
mapStringForMyMap += fmt.Sprintf("%#v: %#v,", k, this.MyMap[k])
}
mapStringForMyMap += "}"
if this.MyMap != nil {
s = append(s, "MyMap: "+mapStringForMyMap+",\n")
}
keysForMyCustomMap := make([]string, 0, len(this.MyCustomMap))
for k := range this.MyCustomMap {
keysForMyCustomMap = append(keysForMyCustomMap, string(k))
}
github_com_gogo_protobuf_sortkeys.Strings(keysForMyCustomMap)
mapStringForMyCustomMap := "map[github_com_gogo_protobuf_test_casttype.MyStringType]github_com_gogo_protobuf_test_casttype.MyUint64Type{"
for _, k := range keysForMyCustomMap {
mapStringForMyCustomMap += fmt.Sprintf("%#v: %#v,", k, this.MyCustomMap[github_com_gogo_protobuf_test_casttype.MyStringType(k)])
}
mapStringForMyCustomMap += "}"
if this.MyCustomMap != nil {
s = append(s, "MyCustomMap: "+mapStringForMyCustomMap+",\n")
}
keysForMyNullableMap := make([]int32, 0, len(this.MyNullableMap))
for k := range this.MyNullableMap {
keysForMyNullableMap = append(keysForMyNullableMap, int32(k))
}
github_com_gogo_protobuf_sortkeys.Int32s(keysForMyNullableMap)
mapStringForMyNullableMap := "map[github_com_gogo_protobuf_test_casttype.MyInt32Type]*Wilson{"
for _, k := range keysForMyNullableMap {
mapStringForMyNullableMap += fmt.Sprintf("%#v: %#v,", k, this.MyNullableMap[github_com_gogo_protobuf_test_casttype.MyInt32Type(k)])
}
mapStringForMyNullableMap += "}"
if this.MyNullableMap != nil {
s = append(s, "MyNullableMap: "+mapStringForMyNullableMap+",\n")
}
keysForMyEmbeddedMap := make([]int32, 0, len(this.MyEmbeddedMap))
for k := range this.MyEmbeddedMap {
keysForMyEmbeddedMap = append(keysForMyEmbeddedMap, int32(k))
}
github_com_gogo_protobuf_sortkeys.Int32s(keysForMyEmbeddedMap)
mapStringForMyEmbeddedMap := "map[github_com_gogo_protobuf_test_casttype.MyInt32Type]Wilson{"
for _, k := range keysForMyEmbeddedMap {
mapStringForMyEmbeddedMap += fmt.Sprintf("%#v: %#v,", k, this.MyEmbeddedMap[github_com_gogo_protobuf_test_casttype.MyInt32Type(k)])
}
mapStringForMyEmbeddedMap += "}"
if this.MyEmbeddedMap != nil {
s = append(s, "MyEmbeddedMap: "+mapStringForMyEmbeddedMap+",\n")
}
if this.String_ != nil {
s = append(s, "String_: "+valueToGoStringCasttype(this.String_, "github_com_gogo_protobuf_test_casttype.MyStringType")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func (this *Wilson) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 5)
s = append(s, "&casttype.Wilson{")
if this.Int64 != nil {
s = append(s, "Int64: "+valueToGoStringCasttype(this.Int64, "int64")+",\n")
}
if this.XXX_unrecognized != nil {
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringCasttype(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func NewPopulatedCastaway(r randyCasttype, easy bool) *Castaway {
this := &Castaway{}
if r.Intn(10) != 0 {
v1 := int32(r.Int63())
if r.Intn(2) == 0 {
v1 *= -1
}
this.Int32Ptr = &v1
}
this.Int32 = int32(r.Int63())
if r.Intn(2) == 0 {
this.Int32 *= -1
}
if r.Intn(10) != 0 {
v2 := github_com_gogo_protobuf_test_casttype.MyUint64Type(uint64(r.Uint32()))
this.MyUint64Ptr = &v2
}
this.MyUint64 = github_com_gogo_protobuf_test_casttype.MyUint64Type(uint64(r.Uint32()))
if r.Intn(10) != 0 {
v3 := github_com_gogo_protobuf_test_casttype.MyFloat32Type(r.Float32())
if r.Intn(2) == 0 {
v3 *= -1
}
this.MyFloat32Ptr = &v3
}
this.MyFloat32 = github_com_gogo_protobuf_test_casttype.MyFloat32Type(r.Float32())
if r.Intn(2) == 0 {
this.MyFloat32 *= -1
}
if r.Intn(10) != 0 {
v4 := github_com_gogo_protobuf_test_casttype.MyFloat64Type(r.Float64())
if r.Intn(2) == 0 {
v4 *= -1
}
this.MyFloat64Ptr = &v4
}
this.MyFloat64 = github_com_gogo_protobuf_test_casttype.MyFloat64Type(r.Float64())
if r.Intn(2) == 0 {
this.MyFloat64 *= -1
}
if r.Intn(10) != 0 {
v5 := r.Intn(100)
this.MyBytes = make(github_com_gogo_protobuf_test_casttype.Bytes, v5)
for i := 0; i < v5; i++ {
this.MyBytes[i] = byte(r.Intn(256))
}
}
if r.Intn(10) != 0 {
v6 := r.Intn(100)
this.NormalBytes = make([]byte, v6)
for i := 0; i < v6; i++ {
this.NormalBytes[i] = byte(r.Intn(256))
}
}
if r.Intn(10) != 0 {
v7 := r.Intn(10)
this.MyUint64S = make([]github_com_gogo_protobuf_test_casttype.MyUint64Type, v7)
for i := 0; i < v7; i++ {
this.MyUint64S[i] = github_com_gogo_protobuf_test_casttype.MyUint64Type(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v8 := r.Intn(10)
this.MyMap = make(github_com_gogo_protobuf_test_casttype.MyMapType)
for i := 0; i < v8; i++ {
v9 := randStringCasttype(r)
this.MyMap[v9] = uint64(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v10 := r.Intn(10)
this.MyCustomMap = make(map[github_com_gogo_protobuf_test_casttype.MyStringType]github_com_gogo_protobuf_test_casttype.MyUint64Type)
for i := 0; i < v10; i++ {
v11 := github_com_gogo_protobuf_test_casttype.MyStringType(randStringCasttype(r))
this.MyCustomMap[v11] = github_com_gogo_protobuf_test_casttype.MyUint64Type(uint64(r.Uint32()))
}
}
if r.Intn(10) != 0 {
v12 := r.Intn(10)
this.MyNullableMap = make(map[github_com_gogo_protobuf_test_casttype.MyInt32Type]*Wilson)
for i := 0; i < v12; i++ {
this.MyNullableMap[github_com_gogo_protobuf_test_casttype.MyInt32Type(int32(r.Int31()))] = NewPopulatedWilson(r, easy)
}
}
if r.Intn(10) != 0 {
v13 := r.Intn(10)
this.MyEmbeddedMap = make(map[github_com_gogo_protobuf_test_casttype.MyInt32Type]Wilson)
for i := 0; i < v13; i++ {
this.MyEmbeddedMap[github_com_gogo_protobuf_test_casttype.MyInt32Type(int32(r.Int31()))] = *NewPopulatedWilson(r, easy)
}
}
if r.Intn(10) != 0 {
v14 := github_com_gogo_protobuf_test_casttype.MyStringType(randStringCasttype(r))
this.String_ = &v14
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedCasttype(r, 17)
}
return this
}
func NewPopulatedWilson(r randyCasttype, easy bool) *Wilson {
this := &Wilson{}
if r.Intn(10) != 0 {
v15 := int64(r.Int63())
if r.Intn(2) == 0 {
v15 *= -1
}
this.Int64 = &v15
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedCasttype(r, 2)
}
return this
}
type randyCasttype interface {
Float32() float32
Float64() float64
Int63() int64
Int31() int32
Uint32() uint32
Intn(n int) int
}
func randUTF8RuneCasttype(r randyCasttype) rune {
ru := r.Intn(62)
if ru < 10 {
return rune(ru + 48)
} else if ru < 36 {
return rune(ru + 55)
}
return rune(ru + 61)
}
func randStringCasttype(r randyCasttype) string {
v16 := r.Intn(100)
tmps := make([]rune, v16)
for i := 0; i < v16; i++ {
tmps[i] = randUTF8RuneCasttype(r)
}
return string(tmps)
}
func randUnrecognizedCasttype(r randyCasttype, maxFieldNumber int) (dAtA []byte) {
l := r.Intn(5)
for i := 0; i < l; i++ {
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
fieldNumber := maxFieldNumber + r.Intn(100)
dAtA = randFieldCasttype(dAtA, r, fieldNumber, wire)
}
return dAtA
}
func randFieldCasttype(dAtA []byte, r randyCasttype, fieldNumber int, wire int) []byte {
key := uint32(fieldNumber)<<3 | uint32(wire)
switch wire {
case 0:
dAtA = encodeVarintPopulateCasttype(dAtA, uint64(key))
v17 := r.Int63()
if r.Intn(2) == 0 {
v17 *= -1
}
dAtA = encodeVarintPopulateCasttype(dAtA, uint64(v17))
case 1:
dAtA = encodeVarintPopulateCasttype(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
case 2:
dAtA = encodeVarintPopulateCasttype(dAtA, uint64(key))
ll := r.Intn(100)
dAtA = encodeVarintPopulateCasttype(dAtA, uint64(ll))
for j := 0; j < ll; j++ {
dAtA = append(dAtA, byte(r.Intn(256)))
}
default:
dAtA = encodeVarintPopulateCasttype(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return dAtA
}
func encodeVarintPopulateCasttype(dAtA []byte, v uint64) []byte {
for v >= 1<<7 {
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
v >>= 7
}
dAtA = append(dAtA, uint8(v))
return dAtA
}
func (m *Castaway) Size() (n int) {
var l int
_ = l
if m.Int32Ptr != nil {
n += 1 + sovCasttype(uint64(*m.Int32Ptr))
}
n += 1 + sovCasttype(uint64(m.Int32))
if m.MyUint64Ptr != nil {
n += 1 + sovCasttype(uint64(*m.MyUint64Ptr))
}
n += 1 + sovCasttype(uint64(m.MyUint64))
if m.MyFloat32Ptr != nil {
n += 5
}
n += 5
if m.MyFloat64Ptr != nil {
n += 9
}
n += 9
if m.MyBytes != nil {
l = len(m.MyBytes)
n += 1 + l + sovCasttype(uint64(l))
}
if m.NormalBytes != nil {
l = len(m.NormalBytes)
n += 1 + l + sovCasttype(uint64(l))
}
if len(m.MyUint64S) > 0 {
for _, e := range m.MyUint64S {
n += 1 + sovCasttype(uint64(e))
}
}
if len(m.MyMap) > 0 {
for k, v := range m.MyMap {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovCasttype(uint64(len(k))) + 1 + sovCasttype(uint64(v))
n += mapEntrySize + 1 + sovCasttype(uint64(mapEntrySize))
}
}
if len(m.MyCustomMap) > 0 {
for k, v := range m.MyCustomMap {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovCasttype(uint64(len(k))) + 1 + sovCasttype(uint64(v))
n += mapEntrySize + 1 + sovCasttype(uint64(mapEntrySize))
}
}
if len(m.MyNullableMap) > 0 {
for k, v := range m.MyNullableMap {
_ = k
_ = v
l = 0
if v != nil {
l = v.Size()
l += 1 + sovCasttype(uint64(l))
}
mapEntrySize := 1 + sovCasttype(uint64(k)) + l
n += mapEntrySize + 1 + sovCasttype(uint64(mapEntrySize))
}
}
if len(m.MyEmbeddedMap) > 0 {
for k, v := range m.MyEmbeddedMap {
_ = k
_ = v
l = v.Size()
mapEntrySize := 1 + sovCasttype(uint64(k)) + 1 + l + sovCasttype(uint64(l))
n += mapEntrySize + 1 + sovCasttype(uint64(mapEntrySize))
}
}
if m.String_ != nil {
l = len(*m.String_)
n += 2 + l + sovCasttype(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Wilson) Size() (n int) {
var l int
_ = l
if m.Int64 != nil {
n += 1 + sovCasttype(uint64(*m.Int64))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovCasttype(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozCasttype(x uint64) (n int) {
return sovCasttype(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *Castaway) String() string {
if this == nil {
return "nil"
}
keysForMyMap := make([]string, 0, len(this.MyMap))
for k := range this.MyMap {
keysForMyMap = append(keysForMyMap, k)
}
github_com_gogo_protobuf_sortkeys.Strings(keysForMyMap)
mapStringForMyMap := "github_com_gogo_protobuf_test_casttype.MyMapType{"
for _, k := range keysForMyMap {
mapStringForMyMap += fmt.Sprintf("%v: %v,", k, this.MyMap[k])
}
mapStringForMyMap += "}"
keysForMyCustomMap := make([]string, 0, len(this.MyCustomMap))
for k := range this.MyCustomMap {
keysForMyCustomMap = append(keysForMyCustomMap, string(k))
}
github_com_gogo_protobuf_sortkeys.Strings(keysForMyCustomMap)
mapStringForMyCustomMap := "map[github_com_gogo_protobuf_test_casttype.MyStringType]github_com_gogo_protobuf_test_casttype.MyUint64Type{"
for _, k := range keysForMyCustomMap {
mapStringForMyCustomMap += fmt.Sprintf("%v: %v,", k, this.MyCustomMap[github_com_gogo_protobuf_test_casttype.MyStringType(k)])
}
mapStringForMyCustomMap += "}"
keysForMyNullableMap := make([]int32, 0, len(this.MyNullableMap))
for k := range this.MyNullableMap {
keysForMyNullableMap = append(keysForMyNullableMap, int32(k))
}
github_com_gogo_protobuf_sortkeys.Int32s(keysForMyNullableMap)
mapStringForMyNullableMap := "map[github_com_gogo_protobuf_test_casttype.MyInt32Type]*Wilson{"
for _, k := range keysForMyNullableMap {
mapStringForMyNullableMap += fmt.Sprintf("%v: %v,", k, this.MyNullableMap[github_com_gogo_protobuf_test_casttype.MyInt32Type(k)])
}
mapStringForMyNullableMap += "}"
keysForMyEmbeddedMap := make([]int32, 0, len(this.MyEmbeddedMap))
for k := range this.MyEmbeddedMap {
keysForMyEmbeddedMap = append(keysForMyEmbeddedMap, int32(k))
}
github_com_gogo_protobuf_sortkeys.Int32s(keysForMyEmbeddedMap)
mapStringForMyEmbeddedMap := "map[github_com_gogo_protobuf_test_casttype.MyInt32Type]Wilson{"
for _, k := range keysForMyEmbeddedMap {
mapStringForMyEmbeddedMap += fmt.Sprintf("%v: %v,", k, this.MyEmbeddedMap[github_com_gogo_protobuf_test_casttype.MyInt32Type(k)])
}
mapStringForMyEmbeddedMap += "}"
s := strings.Join([]string{`&Castaway{`,
`Int32Ptr:` + valueToStringCasttype(this.Int32Ptr) + `,`,
`Int32:` + fmt.Sprintf("%v", this.Int32) + `,`,
`MyUint64Ptr:` + valueToStringCasttype(this.MyUint64Ptr) + `,`,
`MyUint64:` + fmt.Sprintf("%v", this.MyUint64) + `,`,
`MyFloat32Ptr:` + valueToStringCasttype(this.MyFloat32Ptr) + `,`,
`MyFloat32:` + fmt.Sprintf("%v", this.MyFloat32) + `,`,
`MyFloat64Ptr:` + valueToStringCasttype(this.MyFloat64Ptr) + `,`,
`MyFloat64:` + fmt.Sprintf("%v", this.MyFloat64) + `,`,
`MyBytes:` + valueToStringCasttype(this.MyBytes) + `,`,
`NormalBytes:` + valueToStringCasttype(this.NormalBytes) + `,`,
`MyUint64S:` + fmt.Sprintf("%v", this.MyUint64S) + `,`,
`MyMap:` + mapStringForMyMap + `,`,
`MyCustomMap:` + mapStringForMyCustomMap + `,`,
`MyNullableMap:` + mapStringForMyNullableMap + `,`,
`MyEmbeddedMap:` + mapStringForMyEmbeddedMap + `,`,
`String_:` + valueToStringCasttype(this.String_) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func (this *Wilson) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Wilson{`,
`Int64:` + valueToStringCasttype(this.Int64) + `,`,
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func valueToStringCasttype(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *Castaway) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Castaway) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Int32Ptr != nil {
dAtA[i] = 0x8
i++
i = encodeVarintCasttype(dAtA, i, uint64(*m.Int32Ptr))
}
dAtA[i] = 0x10
i++
i = encodeVarintCasttype(dAtA, i, uint64(m.Int32))
if m.MyUint64Ptr != nil {
dAtA[i] = 0x18
i++
i = encodeVarintCasttype(dAtA, i, uint64(*m.MyUint64Ptr))
}
dAtA[i] = 0x20
i++
i = encodeVarintCasttype(dAtA, i, uint64(m.MyUint64))
if m.MyFloat32Ptr != nil {
dAtA[i] = 0x2d
i++
i = encodeFixed32Casttype(dAtA, i, uint32(math.Float32bits(float32(*m.MyFloat32Ptr))))
}
dAtA[i] = 0x35
i++
i = encodeFixed32Casttype(dAtA, i, uint32(math.Float32bits(float32(m.MyFloat32))))
if m.MyFloat64Ptr != nil {
dAtA[i] = 0x39
i++
i = encodeFixed64Casttype(dAtA, i, uint64(math.Float64bits(float64(*m.MyFloat64Ptr))))
}
dAtA[i] = 0x41
i++
i = encodeFixed64Casttype(dAtA, i, uint64(math.Float64bits(float64(m.MyFloat64))))
if m.MyBytes != nil {
dAtA[i] = 0x4a
i++
i = encodeVarintCasttype(dAtA, i, uint64(len(m.MyBytes)))
i += copy(dAtA[i:], m.MyBytes)
}
if m.NormalBytes != nil {
dAtA[i] = 0x52
i++
i = encodeVarintCasttype(dAtA, i, uint64(len(m.NormalBytes)))
i += copy(dAtA[i:], m.NormalBytes)
}
if len(m.MyUint64S) > 0 {
for _, num := range m.MyUint64S {
dAtA[i] = 0x58
i++
i = encodeVarintCasttype(dAtA, i, uint64(num))
}
}
if len(m.MyMap) > 0 {
for k := range m.MyMap {
dAtA[i] = 0x62
i++
v := m.MyMap[k]
mapSize := 1 + len(k) + sovCasttype(uint64(len(k))) + 1 + sovCasttype(uint64(v))
i = encodeVarintCasttype(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintCasttype(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x10
i++
i = encodeVarintCasttype(dAtA, i, uint64(v))
}
}
if len(m.MyCustomMap) > 0 {
for k := range m.MyCustomMap {
dAtA[i] = 0x6a
i++
v := m.MyCustomMap[k]
mapSize := 1 + len(k) + sovCasttype(uint64(len(k))) + 1 + sovCasttype(uint64(v))
i = encodeVarintCasttype(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintCasttype(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x10
i++
i = encodeVarintCasttype(dAtA, i, uint64(v))
}
}
if len(m.MyNullableMap) > 0 {
for k := range m.MyNullableMap {
dAtA[i] = 0x72
i++
v := m.MyNullableMap[k]
msgSize := 0
if v != nil {
msgSize = v.Size()
msgSize += 1 + sovCasttype(uint64(msgSize))
}
mapSize := 1 + sovCasttype(uint64(k)) + msgSize
i = encodeVarintCasttype(dAtA, i, uint64(mapSize))
dAtA[i] = 0x8
i++
i = encodeVarintCasttype(dAtA, i, uint64(k))
if v != nil {
dAtA[i] = 0x12
i++
i = encodeVarintCasttype(dAtA, i, uint64(v.Size()))
n1, err := v.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
}
}
if len(m.MyEmbeddedMap) > 0 {
for k := range m.MyEmbeddedMap {
dAtA[i] = 0x7a
i++
v := m.MyEmbeddedMap[k]
msgSize := 0
if (&v) != nil {
msgSize = (&v).Size()
msgSize += 1 + sovCasttype(uint64(msgSize))
}
mapSize := 1 + sovCasttype(uint64(k)) + msgSize
i = encodeVarintCasttype(dAtA, i, uint64(mapSize))
dAtA[i] = 0x8
i++
i = encodeVarintCasttype(dAtA, i, uint64(k))
dAtA[i] = 0x12
i++
i = encodeVarintCasttype(dAtA, i, uint64((&v).Size()))
n2, err := (&v).MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
}
if m.String_ != nil {
dAtA[i] = 0x82
i++
dAtA[i] = 0x1
i++
i = encodeVarintCasttype(dAtA, i, uint64(len(*m.String_)))
i += copy(dAtA[i:], *m.String_)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func (m *Wilson) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Wilson) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Int64 != nil {
dAtA[i] = 0x8
i++
i = encodeVarintCasttype(dAtA, i, uint64(*m.Int64))
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeFixed64Casttype(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Casttype(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintCasttype(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func init() { proto.RegisterFile("combos/unsafemarshaler/casttype.proto", fileDescriptorCasttype) }
var fileDescriptorCasttype = []byte{
// 701 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x95, 0xbf, 0x6f, 0xd3, 0x40,
0x14, 0xc7, 0x7d, 0x4d, 0xd3, 0x26, 0x97, 0x06, 0xa2, 0x13, 0x83, 0x55, 0x89, 0xb3, 0xd5, 0xaa,
0xc8, 0x03, 0x24, 0x55, 0x1a, 0x95, 0xaa, 0x20, 0x06, 0x57, 0x45, 0x2a, 0xc2, 0x05, 0x19, 0xaa,
0x0a, 0xc4, 0x72, 0x69, 0xdd, 0x34, 0xc2, 0xb1, 0x23, 0xfb, 0x02, 0xf2, 0x56, 0x95, 0x01, 0x89,
0xbf, 0x84, 0x91, 0x05, 0x89, 0x91, 0xb1, 0x63, 0x47, 0xa6, 0xb4, 0x36, 0x4b, 0xd9, 0x3a, 0x56,
0x99, 0xd0, 0xdd, 0x39, 0xb1, 0xfb, 0x03, 0x94, 0xa6, 0xdb, 0xbd, 0xbb, 0xf7, 0x3e, 0xef, 0x7b,
0xef, 0xde, 0xdd, 0xc1, 0xb9, 0x2d, 0xb7, 0x55, 0x77, 0xfd, 0x4a, 0xc7, 0xf1, 0xc9, 0x8e, 0xd5,
0x22, 0x9e, 0xbf, 0x4b, 0x6c, 0xcb, 0xab, 0x6c, 0x11, 0x9f, 0xd2, 0xa0, 0x6d, 0x95, 0xdb, 0x9e,
0x4b, 0x5d, 0x94, 0xeb, 0xdb, 0xd3, 0x0f, 0x1a, 0x4d, 0xba, 0xdb, 0xa9, 0x97, 0xb7, 0xdc, 0x56,
0xa5, 0xe1, 0x36, 0xdc, 0x0a, 0x77, 0xa8, 0x77, 0x76, 0xb8, 0xc5, 0x0d, 0x3e, 0x12, 0x81, 0x33,
0x7f, 0x8a, 0x30, 0xb7, 0x42, 0x7c, 0x4a, 0x3e, 0x92, 0x00, 0xcd, 0xc1, 0xdc, 0x9a, 0x43, 0x17,
0xaa, 0x2f, 0xa9, 0x27, 0x03, 0x15, 0x68, 0x19, 0x3d, 0xdf, 0xeb, 0x2a, 0xd9, 0x26, 0x9b, 0x33,
0x07, 0x4b, 0x68, 0x16, 0x66, 0xf9, 0x58, 0x1e, 0xe3, 0x3e, 0xc5, 0x83, 0xae, 0x22, 0x25, 0x7e,
0x62, 0x0d, 0xbd, 0x81, 0x05, 0x23, 0xd8, 0x68, 0x3a, 0x74, 0xb1, 0xc6, 0x70, 0x19, 0x15, 0x68,
0xe3, 0xfa, 0xc3, 0x5e, 0x57, 0x59, 0xf8, 0xa7, 0x40, 0x6a, 0xf9, 0x34, 0xd9, 0x58, 0x3f, 0xfa,
0x75, 0xd0, 0xb6, 0xcc, 0x34, 0x0b, 0x6d, 0xc2, 0x5c, 0xdf, 0x94, 0xc7, 0x39, 0xf7, 0x51, 0x2c,
0x61, 0x24, 0xf6, 0x00, 0x86, 0xde, 0xc1, 0x29, 0x23, 0x78, 0x6a, 0xbb, 0x24, 0xae, 0x41, 0x56,
0x05, 0xda, 0x98, 0xbe, 0xd4, 0xeb, 0x2a, 0xb5, 0xa1, 0xc1, 0x71, 0x38, 0x27, 0x9f, 0xa3, 0xa1,
0xb7, 0x30, 0x3f, 0xb0, 0xe5, 0x09, 0x8e, 0x7e, 0x1c, 0xeb, 0x1e, 0x0d, 0x9f, 0xe0, 0x52, 0xca,
0x45, 0xb9, 0x27, 0x55, 0xa0, 0x81, 0x51, 0x94, 0xc7, 0x35, 0x39, 0x47, 0x4b, 0x29, 0x5f, 0xac,
0xc9, 0x39, 0x8e, 0x1e, 0x51, 0x79, 0x8c, 0x4f, 0x70, 0xe8, 0x19, 0x9c, 0x34, 0x02, 0x3d, 0xa0,
0x96, 0x2f, 0xe7, 0x55, 0xa0, 0x4d, 0xe9, 0xf3, 0xbd, 0xae, 0x72, 0x7f, 0x48, 0x2a, 0x8f, 0x33,
0xfb, 0x00, 0xa4, 0xc2, 0xc2, 0xba, 0xeb, 0xb5, 0x88, 0x2d, 0x78, 0x90, 0xf1, 0xcc, 0xf4, 0x14,
0xda, 0x60, 0x3b, 0x11, 0xa7, 0xed, 0xcb, 0x05, 0x35, 0x73, 0x93, 0x9e, 0x4c, 0x48, 0xa8, 0x09,
0xb3, 0x46, 0x60, 0x90, 0xb6, 0x3c, 0xa5, 0x66, 0xb4, 0x42, 0xf5, 0x6e, 0x79, 0x10, 0xd1, 0xbf,
0x5b, 0x65, 0xbe, 0xbe, 0xea, 0x50, 0x2f, 0xd0, 0x6b, 0xbd, 0xae, 0x32, 0x3f, 0x74, 0x46, 0x83,
0xb4, 0x79, 0x3a, 0x91, 0x01, 0x7d, 0x07, 0xec, 0x62, 0xad, 0x74, 0x7c, 0xea, 0xb6, 0x58, 0xc6,
0x22, 0xcf, 0x38, 0x7b, 0x65, 0xc6, 0x81, 0x97, 0xc8, 0xeb, 0xec, 0x1f, 0x5d, 0x63, 0xa7, 0xaf,
0xa8, 0xd7, 0x74, 0x1a, 0x2c, 0xf5, 0x97, 0xa3, 0x91, 0x2f, 0xed, 0x40, 0x01, 0xfa, 0x04, 0x60,
0xd1, 0x08, 0xd6, 0x3b, 0xb6, 0x4d, 0xea, 0xb6, 0xc5, 0x94, 0xdf, 0xe2, 0xca, 0xe7, 0xae, 0x54,
0x9e, 0xf2, 0x13, 0xda, 0x17, 0xf7, 0x8f, 0x94, 0xea, 0xd0, 0x22, 0xf8, 0x13, 0xc4, 0x35, 0x9c,
0xcf, 0x89, 0x3e, 0x73, 0x15, 0xab, 0xad, 0xba, 0xb5, 0xbd, 0x6d, 0x6d, 0x33, 0x15, 0xb7, 0xff,
0xa3, 0x22, 0xe5, 0x27, 0x54, 0x2c, 0xb3, 0xae, 0x1f, 0x5d, 0x49, 0x8a, 0x87, 0x5e, 0xc0, 0x09,
0x51, 0x61, 0xb9, 0xa4, 0x02, 0x2d, 0x7f, 0xcd, 0x36, 0x4c, 0x0e, 0xc7, 0x8c, 0x31, 0xd3, 0x4b,
0x10, 0x26, 0x3d, 0x86, 0x4a, 0x30, 0xf3, 0xde, 0x0a, 0xf8, 0x2b, 0x9e, 0x37, 0xd9, 0x10, 0xdd,
0x81, 0xd9, 0x0f, 0xc4, 0xee, 0x58, 0xfc, 0xd5, 0x1e, 0x37, 0x85, 0xb1, 0x3c, 0xb6, 0x04, 0xa6,
0x9f, 0xc0, 0xd2, 0xc5, 0x5e, 0xb9, 0x56, 0xbc, 0x09, 0xd1, 0xe5, 0x13, 0x4b, 0x13, 0xb2, 0x82,
0x70, 0x2f, 0x4d, 0x28, 0x54, 0x4b, 0x49, 0xcd, 0x37, 0x9b, 0xb6, 0xef, 0x3a, 0x97, 0x98, 0x17,
0xeb, 0x7f, 0x33, 0xe6, 0x0c, 0x86, 0x13, 0x62, 0x92, 0xed, 0x65, 0x8d, 0x7f, 0x1f, 0xfc, 0x97,
0x33, 0x85, 0xa1, 0x3f, 0x3f, 0x08, 0xb1, 0x74, 0x18, 0x62, 0xe9, 0x57, 0x88, 0xa5, 0xe3, 0x10,
0x83, 0x93, 0x10, 0x83, 0xd3, 0x10, 0x83, 0xb3, 0x10, 0x83, 0xbd, 0x08, 0x83, 0xaf, 0x11, 0x06,
0xdf, 0x22, 0x0c, 0x7e, 0x44, 0x18, 0xfc, 0x8c, 0x30, 0x38, 0x88, 0xb0, 0x74, 0x18, 0x61, 0xe9,
0x38, 0xc2, 0xe0, 0x24, 0xc2, 0xd2, 0x69, 0x84, 0xc1, 0x59, 0x84, 0xc1, 0xde, 0x6f, 0x2c, 0xfd,
0x0d, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x47, 0x3b, 0xeb, 0xba, 0x07, 0x00, 0x00,
}
|
Java
|
package ru.job4j.polymorphism;
/**
* Created on 01.09.2017.
*
* @author Aleks Sidorenko (alek.sidorenko1979@gmail.com).
* @version $Id$.
* @since 0.1.
*/
public class StubInput implements Input {
/**
* @param answers - array's param.
*/
private String[] answers;
/**
* @param position - param count position.
*/
private int position = 0;
/**
* Constructor.
* @param answers - array's param.
*/
public StubInput(String[] answers) {
this.answers = answers;
}
/**
* Method from interface.
* @param question - param of method interface.
* @return - string.
*/
public String ask(String question) {
return answers[position++];
}
}
|
Java
|
<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<title>StringMatchFilter.m_stringRegexToMatch Field</title>
<xml>
</xml>
<link rel="stylesheet" type="text/css" href="MSDN.css" />
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
<tr id="hdr">
<td class="runninghead">log4net SDK Reference</td>
<td class="product">
</td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1">StringMatchFilter.m_stringRegexToMatch Field
</h1>
</div>
</div>
<div id="nstext">
<p> A string regex to match </p>
<div class="syntax">
<span class="lang">[Visual Basic]</span>
<br />Protected m_stringRegexToMatch As <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemStringClassTopic.asp">String</a></div>
<div class="syntax">
<span class="lang">[C#]</span>
<br />protected <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemStringClassTopic.asp">string</a> m_stringRegexToMatch;</div>
<p>
</p>
<h4 class="dtH4">Remarks</h4>
<p>
<span class="missing">Missing <remarks> documentation for F:log4net.Filter.StringMatchFilter.m_stringRegexToMatch</span>
</p>
<h4 class="dtH4">See Also</h4>
<p>
<a href="log4net.Filter.StringMatchFilter.html">StringMatchFilter Class</a> | <a href="log4net.Filter.html">log4net.Filter Namespace</a></p>
<hr />
<div id="footer">
<p>
<a href="http://logging.apache.org/log4net">Copyright 2001-2006 The Apache Software Foundation.</a>
</p>
<p>Generated from assembly log4net [1.2.10.0]</p>
</div>
</div>
</body>
</html>
|
Java
|
import { Component } from '@angular/core';
@Component({
selector: 'uxd-landing-page-feature-list',
template: '<ng-content></ng-content>',
styles: [':host { display: block; }'],
host: {
'class': 'row'
}
})
export class LandingPageFeatureListComponent {
}
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Jul 17 13:50:51 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer (BOM: * : All 2.5.0.Final API)</title>
<meta name="date" content="2019-07-17">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer (BOM: * : All 2.5.0.Final API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/infinispan/cache_container/class-use/BackupForComponentConsumer.html" target="_top">Frames</a></li>
<li><a href="BackupForComponentConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.infinispan.cache_container">org.wildfly.swarm.config.infinispan.cache_container</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.infinispan.cache_container">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a> in <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/package-summary.html">org.wildfly.swarm.config.infinispan.cache_container</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/package-summary.html">org.wildfly.swarm.config.infinispan.cache_container</a> that return <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a><<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="type parameter in BackupForComponentConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">BackupForComponentConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html#andThen-org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer-">andThen</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a><<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="type parameter in BackupForComponentConsumer">T</a>> after)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/package-summary.html">org.wildfly.swarm.config.infinispan.cache_container</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a><<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="type parameter in BackupForComponentConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">BackupForComponentConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html#andThen-org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer-">andThen</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a><<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="type parameter in BackupForComponentConsumer">T</a>> after)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ScatteredCache.html" title="type parameter in ScatteredCache">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ScatteredCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ScatteredCache.html#backupForComponent-org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer-">backupForComponent</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a> consumer)</code>
<div class="block">A cache for which this cache acts as a backup (for use with cross site
replication).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/DistributedCache.html" title="type parameter in DistributedCache">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">DistributedCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/DistributedCache.html#backupForComponent-org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer-">backupForComponent</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a> consumer)</code>
<div class="block">A cache for which this cache acts as a backup (for use with cross site
replication).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ReplicatedCache.html" title="type parameter in ReplicatedCache">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">ReplicatedCache.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/ReplicatedCache.html#backupForComponent-org.wildfly.swarm.config.infinispan.cache_container.BackupForComponentConsumer-">backupForComponent</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">BackupForComponentConsumer</a> consumer)</code>
<div class="block">A cache for which this cache acts as a backup (for use with cross site
replication).</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/infinispan/cache_container/BackupForComponentConsumer.html" title="interface in org.wildfly.swarm.config.infinispan.cache_container">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/infinispan/cache_container/class-use/BackupForComponentConsumer.html" target="_top">Frames</a></li>
<li><a href="BackupForComponentConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
|
Java
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_60-ea) on Wed Jan 04 17:08:18 EST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.wildfly.swarm.config.NamingConsumer (Public javadocs 2017.1.1 API)</title>
<meta name="date" content="2017-01-04">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface org.wildfly.swarm.config.NamingConsumer (Public javadocs 2017.1.1 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.1.1</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/config/class-use/NamingConsumer.html" target="_top">Frames</a></li>
<li><a href="NamingConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface org.wildfly.swarm.config.NamingConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.NamingConsumer</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config">org.wildfly.swarm.config</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a> in <a href="../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> that return <a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a><<a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="type parameter in NamingConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">NamingConsumer.</span><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html#andThen-org.wildfly.swarm.config.NamingConsumer-">andThen</a></span>(<a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a><<a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="type parameter in NamingConsumer">T</a>> after)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> with parameters of type <a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>default <a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a><<a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="type parameter in NamingConsumer">T</a>></code></td>
<td class="colLast"><span class="typeNameLabel">NamingConsumer.</span><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html#andThen-org.wildfly.swarm.config.NamingConsumer-">andThen</a></span>(<a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">NamingConsumer</a><<a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="type parameter in NamingConsumer">T</a>> after)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/wildfly/swarm/config/NamingConsumer.html" title="interface in org.wildfly.swarm.config">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.1.1</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/config/class-use/NamingConsumer.html" target="_top">Frames</a></li>
<li><a href="NamingConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2017 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
|
Java
|
// Copyright 2015 The oauth2 Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package odnoklassniki provides constants for using OAuth2 to access Odnoklassniki.
package odnoklassniki
import (
"github.com/coreos/mantle/Godeps/_workspace/src/golang.org/x/oauth2"
)
// Endpoint is Odnoklassniki's OAuth 2.0 endpoint.
var Endpoint = oauth2.Endpoint{
AuthURL: "https://www.odnoklassniki.ru/oauth/authorize",
TokenURL: "https://api.odnoklassniki.ru/oauth/token.do",
}
|
Java
|
/*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.undertow.attribute;
import io.undertow.server.HttpServerExchange;
/**
* The thread name
*
* @author Stuart Douglas
*/
public class ThreadNameAttribute implements ExchangeAttribute {
public static final String THREAD_NAME_SHORT = "%I";
public static final String THREAD_NAME = "%{THREAD_NAME}";
public static final ExchangeAttribute INSTANCE = new ThreadNameAttribute();
private ThreadNameAttribute() {
}
@Override
public String readAttribute(final HttpServerExchange exchange) {
return Thread.currentThread().getName();
}
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Thread name", newValue);
}
public static final class Builder implements ExchangeAttributeBuilder {
@Override
public String name() {
return "Thread name";
}
@Override
public ExchangeAttribute build(final String token) {
if (token.equals(THREAD_NAME) || token.equals(THREAD_NAME_SHORT)) {
return ThreadNameAttribute.INSTANCE;
}
return null;
}
}
}
|
Java
|
/**
* Copyright [2013-2014] [OHsystem]
*
* We spent a lot of time writing this code, so show some respect:
* - Do not remove this copyright notice anywhere (bot, website etc.)
* - We do not provide support to those who removed copyright notice
*
* OHSystem is free software: You can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* You can contact the developers on: admin@ohsystem.net
* or join us directly here: http://forum.ohsystem.net/
*
* Visit us also on http://ohsystem.net/ and keep track always of the latest
* features and changes.
*
*
* This is modified from GHOST++: http://ohbotplusplus.googlecode.com/
*/
#include "../ohbot.h"
#include "stats.h"
//
// CStats
//
CStats :: CStats( CBaseGame *nGame ) : m_Game( nGame ), m_Locked( false )
{
}
CStats :: ~CStats( )
{
}
bool CStats :: ProcessAction( CIncomingAction *Action )
{
return false;
}
void CStats :: Save( COHBot *GHost, COHBotDB *DB, uint32_t GameID )
{
}
|
Java
|
package org.techniche.technothlon.katana.tcd;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Looper;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.techniche.technothlon.katana.R;
import org.techniche.technothlon.katana.db.TCDDatabase;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Helper class for providing sample content for user interfaces created by
* Android template wizards.
* <p/>
* TODO: Replace all uses of this class before publishing your app.
*/
public class TCDContent {
/**
* An array of sample (dummy) items.
*/
public static List<TCDQuestionMini> ITEMS = new ArrayList<TCDQuestionMini>();
/**
* A map of sample (dummy) items, by ID.
*/
public static Map<String, TCDQuestion> ITEM_MAP = new HashMap<String, TCDQuestion>();
private static String url = "http://localhost/technothlon/technocoupdoeil_app_gateway/android/?technocoupdoeil=fjalkfq2045rudacnavsofu0aswd988q29ra&lastFetchId=";
private static int download(Context context) {
SharedPreferences sharedPref = context.getSharedPreferences(
context.getString(R.string.preference_file_key), Context.MODE_PRIVATE);
long lastFetchID = sharedPref.getLong(context.getString(R.string.tcd_fetch_id), 0);
Log.d("Pref - log", lastFetchID + " from shared pref");
ConnectivityManager connMgr = (ConnectivityManager)
context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
try {
JSONObject json = new JSONObject(downloadUrl(url + lastFetchID));
if (json.getString("status").equals("success")) {
TCDDatabase db = new TCDDatabase(context);
JSONArray questions = json.getJSONArray("questions");
lastFetchID = json.getLong("lastFetchId");
int count = json.getInt("questions_count"), lastID;
for (int i = 0; i < count; i++) {
JSONObject q = questions.getJSONObject(i);
JSONObject links = q.getJSONObject("links");
lastID = q.getInt("uniqueId");
db.insert(
lastID,
q.getString("id"),
q.getString("color"),
q.getString("title"),
q.getString("question"),
links.getString("facebook"),
links.getString("google"),
links.getString("tumblr"),
links.getString("answer"),
q.getString("by"),
q.getString("time"),
q.getString("answer")
);
Log.d("Database - log", lastID + " loaded in database");
}
db.close();
SharedPreferences.Editor edit = sharedPref.edit();
edit.putLong(context.getString(R.string.tcd_fetch_id), lastFetchID);
edit.commit();
} else if (json.getString("status").equals("reset")) {
TCDDatabase db = new TCDDatabase(context);
db.reset();
db.close();
SharedPreferences.Editor edit = sharedPref.edit();
edit.putLong(context.getString(R.string.tcd_fetch_id), 0);
edit.commit();
download(context);
}
final Context ct = context;
new Thread() {
@Override
public void run() {
Looper.prepare();
Toast.makeText(ct, "Sync Completed.", Toast.LENGTH_SHORT).show();
Looper.loop();
}
}.start();
return 0;
} catch (JSONException e) {
e.printStackTrace();
final Context ct = context;
new Thread() {
@Override
public void run() {
Looper.prepare();
Toast.makeText(ct, "Sync Failed.", Toast.LENGTH_SHORT).show();
Looper.loop();
}
}.start();
return 3;
} catch (IOException e) {
e.printStackTrace();
final Context ct = context;
new Thread() {
@Override
public void run() {
Looper.prepare();
Toast.makeText(ct, "Sync Failed.", Toast.LENGTH_SHORT).show();
Looper.loop();
}
}.start();
return 2;
}
} else {
final Context ct = context;
new Thread() {
@Override
public void run() {
Looper.prepare();
Toast.makeText(ct, "No network connection available.", Toast.LENGTH_SHORT).show();
Looper.loop();
}
}.start();
return 1;
}
}
private static String downloadUrl(String myurl) throws IOException {
InputStream is = null;
// Only display the first 500 characters of the retrieved
// web page content.
try {
URL url = new URL(myurl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setReadTimeout(10000 /* milliseconds */);
conn.setConnectTimeout(15000 /* milliseconds */);
conn.setRequestMethod("GET");
conn.setDoInput(true);
// Starts the query
conn.connect();
int response = conn.getResponseCode();
Log.d("TCD latest downloads", "The response is: " + response);
int size = conn.getContentLength();
Log.d("TCD latest downloads", "The content-length is: " + size);
is = conn.getInputStream();
// Convert the InputStream into a string
return readTextResponse(is);
// Makes sure that the InputStream is closed after the app is
// finished using it.
} finally {
if (is != null) {
is.close();
}
}
}
private static String readTextResponse(InputStream inputStream) throws IOException {
Reader in = new InputStreamReader(inputStream);
BufferedReader bufferedreader = new BufferedReader(in);
StringBuilder stringBuilder = new StringBuilder();
String stringReadLine;
while ((stringReadLine = bufferedreader.readLine()) != null) {
stringBuilder.append(stringReadLine);
}
return stringBuilder.toString();
}
public static void load(Context context) {
boolean update = ITEMS.isEmpty() ? false : true;
TCDDatabase helper = new TCDDatabase(context);
SQLiteDatabase db = helper.getReadableDatabase();
assert db != null;
Cursor c = db.rawQuery("SELECT * FROM " + TCDDatabase.Contracts.NAME + " ORDER BY " + TCDDatabase.Contracts.FIELD_TIME + " DESC, " + TCDDatabase.Contracts.FIELD_ID + " DESC", null);
Log.d("DB", c.getCount() + " object in database");
c.moveToFirst();
while (!c.isAfterLast()) {
addItem(new TCDQuestion(
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_ID)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_DISPLAY_ID)),
c.getInt(c.getColumnIndex(TCDDatabase.Contracts.FIELD_COLOR)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_TITLE)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_QUESTION)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_FACEBOOK)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_GOOGLE)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_TUMBLR)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_ANSWER_URL)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_BY)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_ANSWER)),
c.getString(c.getColumnIndex(TCDDatabase.Contracts.FIELD_TIME))
), update);
c.moveToNext();
}
c.close();
db.close();
}
private static void addItem(TCDQuestion item, boolean update) {
if (!ITEM_MAP.containsKey(item.uniqueId)) {
if (update) ITEMS.add(0, (new TCDQuestionMini(item.uniqueId)));
else ITEMS.add((new TCDQuestionMini(item.uniqueId)));
ITEM_MAP.put(item.uniqueId, item);
}
}
public abstract static class TCDLoader extends AsyncTask<Object, Integer, Integer> {
@Override
protected Integer doInBackground(Object[] params) {
int d = 4;
try {
d = download((Context) params[0]);
} catch (Exception e) {
e.printStackTrace();
} finally {
load((Context) params[0]);
}
return d;
}
@Override
protected void onPostExecute(Integer o) {
finished(o);
}
public abstract void finished(int result);
}
/**
* A dummy item representing a piece of content.
*/
public static class TCDQuestion {
public String id;
public String question;
public String facebook;
public String google;
public String tumblr;
public String answer_url;
public String by;
public String answer;
public String title;
public java.util.Date date = null;
public String dateString = "";
public int color = R.drawable.tcd_background_1;
public String uniqueId;
private String status;
private boolean ret = false;
public TCDQuestion(String uniqueId, String id, int color, String title, String question, String facebook, String google, String tumblr,
String answer_url, String by, String answer, String status) {
this.uniqueId = uniqueId;
this.id = id;
this.title = title;
this.question = question;
this.facebook = facebook;
this.google = google;
this.tumblr = tumblr;
this.answer_url = answer_url;
this.by = by;
this.color = getBackground(color);
this.answer = answer;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
this.date = sdf.parse(status);
} catch (ParseException e) {
e.printStackTrace();
}
sdf = new SimpleDateFormat("yyyy-MM-dd");
assert this.date != null;
this.dateString = sdf.format(this.date);
this.status = getStatus();
}
private int getBackground(int color) {
switch (color) {
case 10:
return R.drawable.tcd_background_2;
case 20:
return R.drawable.tcd_background_3;
case 30:
return R.drawable.tcd_background_4;
case 40:
return R.drawable.tcd_background_5;
case 50:
return R.drawable.tcd_background_6;
default:
return R.drawable.tcd_background_1;
}
}
public String getStatus() {
if (ret) return status;
long seconds = Math.abs(((new Date()).getTime() - date.getTime()) / 1000);
if (seconds < 60) status = "about " + seconds + " seconds ago";
else if (seconds < 3600) status = "about " + (seconds / 60) + " minutes ago";
else if (seconds < 86400) status = "about " + (seconds / 3600) + " hours ago";
else if (seconds < 172800) status = "yesterday";
else if (seconds < 345600) status = (seconds / 86400) + " days ago";
else {
ret = true;
status = dateString;
}
return status;
}
}
public static class TCDHolder {
public TextView id, title, question, status;
}
public static class TCDQuestionMini {
public String id;
public TCDQuestionMini(String id) {
this.id = id;
}
}
}
|
Java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.spring.scan;
import java.lang.annotation.Annotation;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashSet;
import java.util.Set;
import org.apache.camel.impl.DefaultPackageScanClassResolver;
import org.apache.camel.spring.scan.a.ScanTargetOne;
import org.apache.camel.spring.scan.b.ScanTargetTwo;
import org.apache.camel.spring.scan.c.ScanTargetThree;
import org.junit.Before;
import org.junit.Test;
public class DefaultPackageScanClassResolverTest extends org.apache.camel.spring.scan.ScanTestSupport {
private DefaultPackageScanClassResolver resolver;
private Set<Class<? extends Annotation>> annotations = new HashSet<>();
private String scanPackage = "org.apache.camel.spring.scan";
@Before
public void setUp() throws Exception {
super.setUp();
resolver = new DefaultPackageScanClassResolver();
annotations.add(org.apache.camel.spring.scan.ScannableOne.class);
annotations.add(org.apache.camel.spring.scan.ScannableTwo.class);
}
@Test
public void testAccepableSchema() {
assertFalse("We should not accept the test by default!", resolver.isAcceptableScheme("test://test"));
resolver.setAcceptableSchemes("test:;test2:");
assertTrue("We should accept the test:!", resolver.isAcceptableScheme("test://test"));
assertTrue("We should accept the test2:!", resolver.isAcceptableScheme("test2://test"));
}
@Test
public void testFindByAnnotationWithoutExtraFilters() {
Set<Class<?>> scanned = resolver.findAnnotated(org.apache.camel.spring.scan.ScannableOne.class, scanPackage);
validateMatchingSetContains(scanned, ScanTargetOne.class, ScanTargetTwo.class);
scanned = resolver.findAnnotated(org.apache.camel.spring.scan.ScannableTwo.class, scanPackage);
validateMatchingSetContains(scanned, ScanTargetThree.class);
}
@Test
public void testFindByAnnotationsWithoutExtraFilters() {
Set<Class<?>> scanned = resolver.findAnnotated(annotations, scanPackage);
validateMatchingSetContains(scanned, ScanTargetOne.class, ScanTargetTwo.class, ScanTargetThree.class);
}
@Test
public void testFindImplementationsWithoutExtraFilters() {
Set<Class<?>> scanned = resolver.findImplementations(ScanTargetOne.class, scanPackage);
validateMatchingSetContains(scanned, ScanTargetOne.class, ScanTargetTwo.class);
}
@Test
public void testFindByAnnotationWithIncludePackageFilter() {
filter.addIncludePattern(scanPackage + ".b.*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findAnnotated(org.apache.camel.spring.scan.ScannableOne.class, scanPackage);
validateMatchingSetContains(scanned, ScanTargetTwo.class);
scanned = resolver.findAnnotated(ScannableTwo.class, scanPackage);
validateMatchingSetContains(scanned);
}
@Test
public void testFindByAnnotationsWithIncludePackageFilter() {
filter.addIncludePattern(scanPackage + ".b.*");
filter.addIncludePattern(scanPackage + ".c.*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findAnnotated(annotations, "org.apache.camel.spring.scan");
validateMatchingSetContains(scanned, ScanTargetTwo.class, ScanTargetThree.class);
}
@Test
public void testFindByAnnotationWithExcludePackageFilter() {
filter.addExcludePattern(scanPackage + ".b.*");
filter.addExcludePattern(scanPackage + ".c.*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findAnnotated(ScannableOne.class, scanPackage);
validateMatchingSetContains(scanned, ScanTargetOne.class);
scanned = resolver.findAnnotated(org.apache.camel.spring.scan.ScannableTwo.class, scanPackage);
validateMatchingSetContains(scanned);
}
@Test
public void testFindByAnnotationsWithExcludePackageFilter() {
filter.addExcludePattern(scanPackage + ".a.*");
Set<Class<?>> scanned = resolver.findAnnotated(annotations, "org.apache.camel.spring.scan");
validateMatchingSetContains(scanned, ScanTargetTwo.class, ScanTargetThree.class);
}
@Test
public void testFindByFilterWithIncludePackageFilter() {
filter.addIncludePattern(scanPackage + ".**.ScanTarget*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findByFilter(filter, "org.apache.camel.spring.scan");
validateMatchingSetContains(scanned, ScanTargetOne.class, ScanTargetTwo.class, ScanTargetThree.class);
}
@Test
public void testFindImplementationsWithIncludePackageFilter() {
filter.addIncludePattern(scanPackage + ".b.*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findImplementations(ScanTargetOne.class, scanPackage);
validateMatchingSetContains(scanned, ScanTargetTwo.class);
}
@Test
public void testFindImplementationsWithExcludePackageFilter() {
filter.addExcludePattern(scanPackage + ".a.*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findImplementations(ScanTargetOne.class, scanPackage);
validateMatchingSetContains(scanned, ScanTargetTwo.class);
}
@Test
// Need to run the mvn clean install to create the jar file when running it from IDE
public void testFindByFilterPackageInJarUrl() throws Exception {
ClassLoader savedClassLoader = null;
try {
savedClassLoader = Thread.currentThread().getContextClassLoader();
// build a mock URLClassLoader
URL url = getClass().getResource("/package_scan_test.jar");
URL urls[] = {new URL("jar:" + url.toString() + "!/")};
URLClassLoader classLoader = new URLClassLoader(urls, savedClassLoader);
Thread.currentThread().setContextClassLoader(classLoader);
// recreate resolver since we mess with context class loader
resolver = new DefaultPackageScanClassResolver();
filter.addIncludePattern("a.*.c.*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findByFilter(filter, "a.b.c");
assertEquals(1, scanned.size());
assertEquals("class a.b.c.Test", scanned.iterator().next().toString());
} finally {
if (savedClassLoader != null) {
Thread.currentThread().setContextClassLoader(savedClassLoader);
}
}
}
@Test
// Need to run the mvn clean install to create the test jar file when running it from IDE
public void testFindByFilterPackageInJarUrlWithPlusChars() throws Exception {
ClassLoader savedClassLoader = null;
try {
savedClassLoader = Thread.currentThread().getContextClassLoader();
URL url = getClass().getResource("/package+scan+test.jar");
URL urls[] = {new URL("jar:" + url.toString() + "!/")};
URLClassLoader classLoader = new URLClassLoader(urls, savedClassLoader);
Thread.currentThread().setContextClassLoader(classLoader);
// recreate resolver since we mess with context class loader
resolver = new DefaultPackageScanClassResolver();
filter.addIncludePattern("a.*.c.*");
resolver.addFilter(filter);
Set<Class<?>> scanned = resolver.findByFilter(filter, "a.b.c");
assertEquals(1, scanned.size());
assertEquals("class a.b.c.Test", scanned.iterator().next().toString());
} finally {
if (savedClassLoader != null) {
Thread.currentThread().setContextClassLoader(savedClassLoader);
}
}
}
}
|
Java
|
import {Component} from '@angular/core';
import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
import {Category} from 'idai-field-core';
import {ProjectConfiguration} from '../../../core/configuration/project-configuration';
@Component({
selector: 'link-modal',
templateUrl: './link-modal.html',
host: {
'(window:keydown)': 'onKeyDown($event)'
}
})
export class LinkModalComponent {
public filterOptions: Array<Category> = [];
constructor(public activeModal: NgbActiveModal,
private projectConfiguration: ProjectConfiguration) {}
public onKeyDown(event: KeyboardEvent) {
if (event.key === 'Escape') this.activeModal.dismiss('cancel');
}
public initializeFilterOptions() {
this.filterOptions = this.projectConfiguration.getAllowedRelationDomainCategories(
'isDepictedIn', 'Image'
);
}
}
|
Java
|
Get up to speed on [pandas](http://pandas.pydata.org/) and
[TensorFlow](https://www.tensorflow.org/) basics with these Datalab notebooks
(click [here](https://github.com/google/eng-edu/blob/master/ml/cc/README.md) for
installation instructions):
* **Hello World:** An introduction to the Datalab notebook environment that
shows how to code ["Hello
World"](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program) in
TensorFlow.
* **TensorFlow Programming Concepts:** A walkthrough of the fundamental
components of a TensorFlow application: tensors, operations, graphs, and
sessions.
* **Creating and Manipulating Tensors:** A quick primer on tensors: the
central abstraction in TensorFlow programming. Also provides a refresher on
matrix addition and multiplication in linear algebra.
* **Quick Introduction to pandas:** A tutorial on basic data manipulation with
pandas.
|
Java
|
---
name: (Maintainers Only) Good First Issue
about: For maintainers to create an issue that is good for new contributors
---
<!-- Issue text below -->
<!-- End issue text, leave the following intact -->
---
**Good First Issue**: This issue is good for first time contributors. If you've already contributed to Warehouse, work on [another issue without this label](https://github.com/pypa/warehouse/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+-label%3A%22good+first+issue%22) instead. If there is not a corresponding pull request for this issue, it is up for grabs. For directions for getting set up, see our [Getting Started Guide](https://warehouse.pypa.io/development/getting-started/). If you are working on this issue and have questions, feel free to ask them here, [`#pypa-dev` on Freenode](https://webchat.freenode.net/?channels=%23pypa-dev), or the [pypa-dev mailing list](https://groups.google.com/forum/#!forum/pypa-dev).
**Screenshot Required**: *If your pull request makes a visual change*, include a screenshot of your update. This helps our team give you feedback faster.
|
Java
|
/*
* Copyright 2016-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.snmp.ctl;
import com.btisystems.pronx.ems.core.snmp.ISnmpConfiguration;
import com.btisystems.pronx.ems.core.snmp.ISnmpConfigurationFactory;
import com.btisystems.pronx.ems.core.snmp.ISnmpSession;
import com.btisystems.pronx.ems.core.snmp.ISnmpSessionFactory;
import com.google.common.collect.Maps;
import org.junit.Before;
import org.junit.Test;
import org.onosproject.alarm.Alarm;
import org.onosproject.alarm.AlarmId;
import org.onosproject.alarm.DefaultAlarm;
import java.io.IOException;
import static org.junit.Assert.*;
/**
* DefaultSnmpController test class.
*/
public class DefaultSnmpControllerTest {
ISnmpSessionFactory mockSnmpSessionFactory = new MockISnmpSessionFactory();
DefaultSnmpController snmpController = new DefaultSnmpController();
DefaultSnmpDevice device = new DefaultSnmpDevice("1.1.1.1", 1, "test", "test");
ISnmpSession snmpSession = new ISnmpSessionAdapter();
long time = System.currentTimeMillis();
DefaultAlarm alarm = new DefaultAlarm.Builder(
AlarmId.alarmId(device.deviceId(), Long.toString(time)),
device.deviceId(), "SNMP alarm retrieval failed",
Alarm.SeverityLevel.CRITICAL,
time).build();
@Before
public void setUp() {
snmpController.factoryMap = Maps.newHashMap();
snmpController.factoryMap.put(1, mockSnmpSessionFactory);
}
@Test
public void testActivate() {
snmpController.activate(null);
assertTrue("Snmp session factory map should contain atleast one factory object",
snmpController.factoryMap.size() > 0);
}
@Test
public void testDeactivate() {
snmpController.deactivate();
assertEquals("Device map should be clear", 0, snmpController.getDevices().size());
assertEquals("Session map should be clear", 0, snmpController.sessionMap.size());
}
@Test
public void addDevice() {
snmpController.addDevice(device);
assertEquals("Controller should contain device", device, snmpController.getDevice(device.deviceId()));
}
/**
* tests session creation and get from map if already exists.
*/
@Test
public void getNotExistingSession() throws Exception {
addDevice();
assertEquals("Session should be created", snmpSession, snmpController.getSession(device.deviceId()));
assertEquals("Map should contain session", 1, snmpController.snmpDeviceMap.size());
assertEquals("Session should be fetched from map", snmpSession, snmpController.getSession(device.deviceId()));
}
@Test
public void removeDevice() {
addDevice();
snmpController.removeDevice(device.deviceId());
assertNull("Device shoudl not be present", snmpController.getDevice(device.deviceId()));
}
@Test
public void walkFailedAlarm() {
assertEquals("Alarms should be equals", alarm, snmpController.buildWalkFailedAlarm(device.deviceId()));
}
public class MockISnmpSessionFactory implements ISnmpSessionFactory {
@Override
public ISnmpSession createSession(ISnmpConfiguration configuration, String ipAddress) throws IOException {
new ISnmpSessionAdapter();
return snmpSession;
}
@Override
public ISnmpSession createSession(String ipAddress, String community)
throws IOException {
return snmpSession;
}
@Override
public ISnmpSession createSession(String ipAddress, String community,
String factoryName,
ISnmpConfigurationFactory.AccessType accessType)
throws IOException {
return snmpSession;
}
}
}
|
Java
|
# Neonaviculopsis spinosa (D. Bukry) P. Prema & T. V. Desikachary SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
package com.zaaach.citypicker.db;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Environment;
import com.zaaach.citypicker.model.City;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* author Bro0cL on 2016/1/26.
*/
public class DBManager {
private static final String ASSETS_NAME = "china_cities.db";
private static final String DB_NAME = "china_cities.db";
private static final String TABLE_NAME = "city";
private static final String NAME = "name";
private static final String PINYIN = "pinyin";
private static final int BUFFER_SIZE = 1024;
private String DB_PATH;
private Context mContext;
public DBManager(Context context) {
this.mContext = context;
DB_PATH = File.separator + "data"
+ Environment.getDataDirectory().getAbsolutePath() + File.separator
+ context.getPackageName() + File.separator + "databases" + File.separator;
}
@SuppressWarnings("ResultOfMethodCallIgnored")
public void copyDBFile(){
File dir = new File(DB_PATH);
if (!dir.exists()){
dir.mkdirs();
}
File dbFile = new File(DB_PATH + DB_NAME);
if (!dbFile.exists()){
InputStream is;
OutputStream os;
try {
is = mContext.getResources().getAssets().open(ASSETS_NAME);
os = new FileOutputStream(dbFile);
byte[] buffer = new byte[BUFFER_SIZE];
int length;
while ((length = is.read(buffer, 0, buffer.length)) > 0){
os.write(buffer, 0, length);
}
os.flush();
os.close();
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public List<City> getAllCities(){
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + DB_NAME, null);
Cursor cursor = db.rawQuery("select * from " + TABLE_NAME, null);
List<City> result = new ArrayList<>();
City city;
while (cursor.moveToNext()){
String name = cursor.getString(cursor.getColumnIndex(NAME));
String pinyin = cursor.getString(cursor.getColumnIndex(PINYIN));
city = new City(name, pinyin);
result.add(city);
}
cursor.close();
db.close();
Collections.sort(result, new CityComparator());
return result;
}
public List<City> searchCity(final String keyword){
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + DB_NAME, null);
Cursor cursor = db.rawQuery("select * from " + TABLE_NAME +" where name like \"%" + keyword
+ "%\" or pinyin like \"%" + keyword + "%\"", null);
List<City> result = new ArrayList<>();
City city;
while (cursor.moveToNext()){
String name = cursor.getString(cursor.getColumnIndex(NAME));
String pinyin = cursor.getString(cursor.getColumnIndex(PINYIN));
city = new City(name, pinyin);
result.add(city);
}
cursor.close();
db.close();
Collections.sort(result, new CityComparator());
return result;
}
/**
* sort by a-z
*/
private class CityComparator implements Comparator<City>{
@Override
public int compare(City lhs, City rhs) {
String a = lhs.getPinyin().substring(0, 1);
String b = rhs.getPinyin().substring(0, 1);
return a.compareTo(b);
}
}
}
|
Java
|
// Copyright (C) 2012-2018 Leap Motion, Inc. All rights reserved.
#pragma once
#include "AutoFilterDescriptor.h"
namespace autowiring {
/// <summary>
/// A single subscription counter entry
/// </summary>
struct SatCounter:
AutoFilterDescriptor
{
SatCounter(void) = default;
SatCounter(const AutoFilterDescriptor& source):
AutoFilterDescriptor(source),
remaining(m_requiredCount)
{}
SatCounter(const SatCounter& source):
AutoFilterDescriptor(static_cast<const AutoFilterDescriptor&>(source)),
remaining(source.remaining)
{}
// Forward and backward linked list pointers
SatCounter* flink = nullptr;
SatCounter* blink = nullptr;
// The number of inputs remaining to this counter:
size_t remaining = 0;
/// <summary>
/// Conditionally decrements AutoFilter argument satisfaction.
/// </summary>
/// <returns>True if this decrement yielded satisfaction of all arguments</returns>
bool Decrement(void) {
return remaining && !--remaining;
}
/// <summary>
/// Conditionally increments AutoFilter argument satisfaction.
/// </summary>
void Increment(void) {
++remaining;
}
};
}
namespace std {
template<>
struct hash<autowiring::SatCounter>
{
size_t operator()(const autowiring::SatCounter& satCounter) const {
return (size_t)satCounter.GetAutoFilter().ptr();
}
};
}
|
Java
|
using Hyperstore.CodeAnalysis.Syntax;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hyperstore.CodeAnalysis.Compilation
{
public class HyperstoreCompiler
{
private readonly string _basePath;
private readonly string _outputDirectory;
private HyperstoreCompilation _compilation;
private const string OutputFileName = "Domains.g.cs";
public IEnumerable<Diagnostic> Diagnostics
{
get
{
return _compilation.GetDiagnostics();
}
}
public HyperstoreCompiler(string outputDirectory, string basePath = null)
{
_basePath = basePath;
_outputDirectory = outputDirectory;
}
public bool Run(string[] inputFiles)
{
if (inputFiles == null || inputFiles.Length == 0)
{
ClearOutputFile();
return false;
}
try
{
var trees = new HyperstoreSyntaxTree[inputFiles.Count()];
//if (trees.Length > 1)
//{
// Parallel.For(0, trees.Length, ix =>
// {
// var inputFile = inputFiles[ix];
// string content;
// string normalizedPath;
// if (OpenFile(inputFile, out content, out normalizedPath))
// {
// trees[ix] = HyperstoreSyntaxTree.ParseText(content, normalizedPath);
// }
// });
//}
//else
var i = 0;
foreach (var inputFile in inputFiles)
{
string content;
string normalizedPath;
if (OpenFile(inputFile, out content, out normalizedPath))
{
trees[i++] = HyperstoreSyntaxTree.ParseText(content, normalizedPath);
}
}
_compilation = HyperstoreCompilation.Create("C#", trees.Where(t => t != null));
if (_compilation.HasErrors)
{
ClearOutputFile();
return false;
}
var output = _compilation.Generate();
WriteOutputFile(output);
return true;
}
catch (Exception ex)
{
ClearOutputFile();
throw ex;
}
}
private void ClearOutputFile()
{
var tmp = MakeOutputFilePath();
OutputFilePath = null;
if (File.Exists(tmp))
File.Delete(tmp);
}
private void WriteOutputFile(string output)
{
OutputFilePath = MakeOutputFilePath();
Directory.CreateDirectory(Path.GetDirectoryName(OutputFilePath));
File.WriteAllText(OutputFilePath, output);
OutputFilePath = new FileInfo(OutputFilePath).FullName;
}
private string MakeOutputFilePath()
{
return Path.Combine(_outputDirectory, OutputFileName);
}
public bool OpenFile(string inputFile, out string content, out string normalizedPath)
{
content = null;
normalizedPath = _basePath != null ? Path.Combine(_basePath, inputFile) : inputFile;
if (!File.Exists(normalizedPath))
{
AddDiagnostic("File {0} not found.", normalizedPath);
return false;
}
using (var stream = File.OpenRead(normalizedPath))
{
using (var reader = new StreamReader(stream))
{
content = reader.ReadToEnd();
normalizedPath = stream.Name;
}
}
return true;
}
private void AddDiagnostic(string msg, params string[] args)
{
var diag = Diagnostic.Create(
args.Length == 0 ? msg : String.Format(msg, args),
DiagnosticSeverity.Error);
}
public string OutputFilePath { get; private set; }
}
}
|
Java
|
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import automl from '@google-cloud/automl';
import * as dayjs from 'dayjs';
import * as express from 'express';
import { auth } from 'google-auth-library';
import * as morgan from 'morgan';
import {
AUTOML_API_SCOPE,
AUTOML_API_URL,
AUTOML_BUCKET_URL,
LOCATION,
PROJECT_ID,
} from './constants';
import { OperationMetadata } from './types';
export const app = express();
app.use(express.json());
app.use(morgan('combined'));
const client = new automl.v1beta1.AutoMlClient();
// Controls model type. For more options, see:
// https://cloud.google.com/vision/automl/alpha/docs/reference/rest/v1beta1/projects.locations.models#imageclassificationmodelmetadata
const DEFAULT_MODEL_TYPE = 'mobile-high-accuracy-1';
const DEFAULT_TRAIN_BUDGET = 1;
const DATASET_NAME_REGEX = new RegExp('^[a-zA-Z_0-9]+$');
const MODEL_VERSION_FORMAT = 'vYYYYMMDDHHmmss';
const parent = client.locationPath(PROJECT_ID, LOCATION);
// A model as returned by AutoML /models response
interface Model {
name: string;
datasetId: string;
displayName: string;
createTime: string;
updateTime: string;
imageClassificationModelMetadata: {
trainBudget: string;
trainCost: string;
stopReason: string;
modelType: string;
};
}
interface ModelResp {
model: Model[];
}
/// create a new dataset
function createDataset(displayName: String): Promise<any> {
const dataset = {
name: displayName,
displayName,
imageClassificationDatasetMetadata: {
classificationType: 'MULTICLASS',
},
};
return client.createDataset({ parent, dataset });
}
const extractIdFromName = (datasetName: string): string => {
const parts = datasetName.split('/');
return parts[parts.length - 1];
};
/// returns the ID of a dataset of the format ICN** or null if not found
function getDatasetName(automlId: string): Promise<string | null> {
return client.listDatasets({ parent }).then((responses: any[]) => {
const datasets = responses[0];
for (const dataset of datasets) {
if (extractIdFromName(dataset['name']) === automlId) {
return dataset['name'];
}
}
return null;
});
}
/// initiates an operation on automl to start importing data for a dataset
async function importDataset(
name: string,
displayName: string,
labels: string
): Promise<OperationMetadata> {
const inputConfig = {
gcsSource: {
inputUris: [`${AUTOML_BUCKET_URL}/${displayName}/${labels}`],
},
};
return client
.importData({ name, inputConfig })
.then((responses: any[]) => responses[1]); // initial api response with operation metadata
}
/**
* List all datasets
*/
app.get('/datasets', async (req, res, next) => {
try {
const authClient = await auth.getClient({ scopes: [AUTOML_API_SCOPE] });
const url = `${AUTOML_API_URL}/datasets`;
const resp = await authClient.request({ url });
res.json(resp.data);
} catch (err) {
console.error(err);
next(err);
}
});
/**
* Endpoint to create a new dataset in automl. Requires a name parameter
*/
app.post('/datasets', async (req, res, next) => {
try {
const { displayName } = req.body;
if (displayName === undefined) {
res.status(400).send('Expected a dataset `displayName`');
return;
}
if (!displayName.match(DATASET_NAME_REGEX)) {
res
.status(400)
.send(
'The displayName contains a not allowed character, the' +
' only allowed ones are ASCII Latin letters A-Z and a-z, an underscore (_),' +
' and ASCII digits 0-9'
);
return;
}
console.info(`Attempting to create dataset: ${displayName}`);
const [response] = await createDataset(displayName);
res.json(response);
} catch (err) {
res.status(500);
res.json({message: err.message});
console.error(err);
}
});
/**
* Endpoint to delete dataset from automl
*/
app.delete('/datasets/:datasetId', async (req, res, next) => {
try {
const { datasetId } = req.params;
if (!datasetId) {
res.status(400).send(`Expected datasetId: ${datasetId}`);
return;
}
const name = await getDatasetName(datasetId);
if (name === null) {
res.status(404).send(`No dataset found for id: ${datasetId}`);
return;
}
const resp = await client.deleteDataset({ name });
console.log(resp);
res.json();
} catch (err) {
console.error(err);
res.status(500);
res.json({message: err.message});
}
});
/**
* Endpoint to initiate importing data for a dataset in automl.
*
* Inputs:
* - datasetId: string - automl ID of the dataset
* - name: string - display name of the dataset
* - labels: string - file name containing the labels information. e.g
* labels.csv
*/
app.post('/import', async (req, res, next) => {
const { name, labels, datasetId } = req.body;
if (!name) {
res.status(400).json({ error: 'Need a dataset name' });
return;
}
if (!datasetId) {
res.status(400).json({ error: 'Need a dataset Id' });
return;
}
if (!labels) {
res.status(400).json({ error: 'Need a path for labels file' });
return;
}
try {
const datasetName = await getDatasetName(datasetId);
if (datasetName === null) {
res.status(400).json({ error: 'Dataset not found' });
return;
}
const operationMetadata = await importDataset(datasetName, name, labels);
res.json(operationMetadata);
} catch (err) {
console.error(err);
res.status(500);
res.json({message: err.message});
}
});
/**
* Endpoint to initiate creation of a new model for the provided dataset
*
* Inputs
* - datasetId: string - automl ID of the dataset
* - trainBudget (optional)
* - modelType (optional)
* Calls the create model api on AutoML
* https://cloud.google.com/vision/automl/alpha/docs/reference/rest/v1beta1/projects.locations.models/create
*
* Uses the rest API
*/
app.post('/train', async (req, res, next) => {
const { datasetId } = req.body;
if (!datasetId) {
res.status(400).json({ error: 'Need a dataset Id' });
return;
}
let { trainBudget, modelType } = req.body;
trainBudget = trainBudget === undefined ? DEFAULT_TRAIN_BUDGET : trainBudget;
modelType = modelType === undefined ? DEFAULT_MODEL_TYPE : modelType;
console.log(
`Using train budget: ${trainBudget}, and model type: ${modelType}`
);
try {
const datasetName = await getDatasetName(datasetId);
if (datasetName === null) {
res.status(400).json({ error: 'Dataset not found' });
return;
}
const authClient = await auth.getClient({ scopes: [AUTOML_API_SCOPE] });
const url = `${AUTOML_API_URL}/models`;
const resp = await authClient.request({
method: 'POST',
data: {
displayName: `${dayjs().format(MODEL_VERSION_FORMAT)}`,
dataset_id: datasetId,
imageClassificationModelMetadata: { trainBudget, modelType },
},
url,
});
const operationMetadata = resp.data as OperationMetadata;
res.json(operationMetadata);
} catch (err) {
console.error(err);
res.status(500);
res.json({message: err.message});
}
});
/**
* Exports a model in tflite format to a gcspath
*
* modelId - AutoML model ID: "ICN1119584480450950787",
* gcsPath - Path to which model is exported
* "gs://${AUTOML_BUCKET}/models/on-device/<folder_name>"
*
* Note the model will be generated in a folder with timestamp as name. For
* more, refer to
* https://cloud.google.com/vision/automl/alpha/docs/deploy#deployment_on_mobile_models_not_core_ml
*/
app.post('/export', async (req, res, next) => {
const { modelId, gcsPath } = req.body;
if (!modelId) {
res.status(400).send('need a model id: modelId');
return;
}
if (!gcsPath) {
res.status(400).send('need a gcs path: gcsPath');
return;
}
const authClient = await auth.getClient({ scopes: [AUTOML_API_SCOPE] });
const url = `${AUTOML_API_URL}/models/${modelId}:export`;
try {
const operationMetadata = await authClient
.request({
method: 'POST',
url,
data: {
output_config: {
model_format: 'tflite',
gcs_destination: {
output_uri_prefix: gcsPath,
},
},
},
})
.then(resp => resp.data as OperationMetadata);
res.json(operationMetadata);
} catch (err) {
console.error(err);
res.status(500);
res.json({message: err.message});
}
});
/**
* Exports the latest generated model for the dataset
*/
app.post('/exportlatestmodel', async (req, res, next) => {
const { datasetId, gcsPath } = req.body;
if (!datasetId) {
res.status(400).send('need a dataset id: datasetId');
return;
}
if (!gcsPath) {
res.status(400).send('need a gcs path: gcsPath');
return;
}
try {
// 1. Get all the models
const modelsResp = (await getAllModels()).data as ModelResp;
// 2. Filter the models for the provided dataset and get the latest model
const datasetModels = modelsResp.model.filter(
m =>
m.datasetId === datasetId &&
m.imageClassificationModelMetadata.modelType.startsWith('mobile-')
);
if (datasetModels === undefined) {
throw new Error('No models found for this dataset');
}
// 3. Find the latest (based on createTime) model
const latestModel = datasetModels.sort(
(m1, m2) =>
new Date(m2.createTime).getTime() - new Date(m1.createTime).getTime()
)[0];
// 3. Initiate its export
console.log('Initiating export for the latest model', latestModel);
const modelId = extractIdFromName(latestModel.name);
const authClient = await auth.getClient({ scopes: [AUTOML_API_SCOPE] });
const url = `${AUTOML_API_URL}/models/${modelId}:export`;
const operationMetadata = await authClient
.request({
method: 'POST',
url,
data: {
output_config: {
model_format: 'tflite',
gcs_destination: {
output_uri_prefix: gcsPath,
},
},
},
})
.then(resp => resp.data as OperationMetadata);
res.json(operationMetadata);
} catch (err) {
console.error(err);
res.status(500);
res.json({message: err.message});
}
});
/**
* List all models - trying out the REST API
*/
app.get('/models', async (req, res, next) => {
try {
const resp = await getAllModels();
res.json(resp.data);
} catch (err) {
console.error(err);
res.status(500);
res.json({message: err.message});
}
});
/** Queries all models from AutoML */
async function getAllModels() {
const authClient = await auth.getClient({ scopes: [AUTOML_API_SCOPE] });
const url = `${AUTOML_API_URL}/models`;
return authClient.request({ url });
}
|
Java
|
//===-- ARMISelDAGToDAG.cpp - A dag to dag inst selector for ARM ----------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines an instruction selector for the ARM target.
//
//===----------------------------------------------------------------------===//
#include "ARM.h"
#include "ARMBaseInstrInfo.h"
#include "ARMTargetMachine.h"
#include "MCTargetDesc/ARMAddressingModes.h"
#include "Utils/ARMBaseInfo.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
#define DEBUG_TYPE "arm-isel"
static cl::opt<bool>
DisableShifterOp("disable-shifter-op", cl::Hidden,
cl::desc("Disable isel of shifter-op"),
cl::init(false));
//===--------------------------------------------------------------------===//
/// ARMDAGToDAGISel - ARM specific code to select ARM machine
/// instructions for SelectionDAG operations.
///
namespace {
class ARMDAGToDAGISel : public SelectionDAGISel {
/// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
/// make the right decision when generating code for different targets.
const ARMSubtarget *Subtarget;
public:
explicit ARMDAGToDAGISel(ARMBaseTargetMachine &tm, CodeGenOpt::Level OptLevel)
: SelectionDAGISel(tm, OptLevel) {}
bool runOnMachineFunction(MachineFunction &MF) override {
// Reset the subtarget each time through.
Subtarget = &MF.getSubtarget<ARMSubtarget>();
SelectionDAGISel::runOnMachineFunction(MF);
return true;
}
StringRef getPassName() const override { return "ARM Instruction Selection"; }
void PreprocessISelDAG() override;
/// getI32Imm - Return a target constant of type i32 with the specified
/// value.
inline SDValue getI32Imm(unsigned Imm, const SDLoc &dl) {
return CurDAG->getTargetConstant(Imm, dl, MVT::i32);
}
void Select(SDNode *N) override;
bool hasNoVMLxHazardUse(SDNode *N) const;
bool isShifterOpProfitable(const SDValue &Shift,
ARM_AM::ShiftOpc ShOpcVal, unsigned ShAmt);
bool SelectRegShifterOperand(SDValue N, SDValue &A,
SDValue &B, SDValue &C,
bool CheckProfitability = true);
bool SelectImmShifterOperand(SDValue N, SDValue &A,
SDValue &B, bool CheckProfitability = true);
bool SelectShiftRegShifterOperand(SDValue N, SDValue &A,
SDValue &B, SDValue &C) {
// Don't apply the profitability check
return SelectRegShifterOperand(N, A, B, C, false);
}
bool SelectShiftImmShifterOperand(SDValue N, SDValue &A,
SDValue &B) {
// Don't apply the profitability check
return SelectImmShifterOperand(N, A, B, false);
}
bool SelectAddLikeOr(SDNode *Parent, SDValue N, SDValue &Out);
bool SelectAddrModeImm12(SDValue N, SDValue &Base, SDValue &OffImm);
bool SelectLdStSOReg(SDValue N, SDValue &Base, SDValue &Offset, SDValue &Opc);
bool SelectCMOVPred(SDValue N, SDValue &Pred, SDValue &Reg) {
const ConstantSDNode *CN = cast<ConstantSDNode>(N);
Pred = CurDAG->getTargetConstant(CN->getZExtValue(), SDLoc(N), MVT::i32);
Reg = CurDAG->getRegister(ARM::CPSR, MVT::i32);
return true;
}
bool SelectAddrMode2OffsetReg(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc);
bool SelectAddrMode2OffsetImm(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc);
bool SelectAddrMode2OffsetImmPre(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc);
bool SelectAddrOffsetNone(SDValue N, SDValue &Base);
bool SelectAddrMode3(SDValue N, SDValue &Base,
SDValue &Offset, SDValue &Opc);
bool SelectAddrMode3Offset(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc);
bool IsAddressingMode5(SDValue N, SDValue &Base, SDValue &Offset, bool FP16);
bool SelectAddrMode5(SDValue N, SDValue &Base, SDValue &Offset);
bool SelectAddrMode5FP16(SDValue N, SDValue &Base, SDValue &Offset);
bool SelectAddrMode6(SDNode *Parent, SDValue N, SDValue &Addr,SDValue &Align);
bool SelectAddrMode6Offset(SDNode *Op, SDValue N, SDValue &Offset);
bool SelectAddrModePC(SDValue N, SDValue &Offset, SDValue &Label);
// Thumb Addressing Modes:
bool SelectThumbAddrModeRR(SDValue N, SDValue &Base, SDValue &Offset);
bool SelectThumbAddrModeRRSext(SDValue N, SDValue &Base, SDValue &Offset);
bool SelectThumbAddrModeImm5S(SDValue N, unsigned Scale, SDValue &Base,
SDValue &OffImm);
bool SelectThumbAddrModeImm5S1(SDValue N, SDValue &Base,
SDValue &OffImm);
bool SelectThumbAddrModeImm5S2(SDValue N, SDValue &Base,
SDValue &OffImm);
bool SelectThumbAddrModeImm5S4(SDValue N, SDValue &Base,
SDValue &OffImm);
bool SelectThumbAddrModeSP(SDValue N, SDValue &Base, SDValue &OffImm);
// Thumb 2 Addressing Modes:
bool SelectT2AddrModeImm12(SDValue N, SDValue &Base, SDValue &OffImm);
bool SelectT2AddrModeImm8(SDValue N, SDValue &Base,
SDValue &OffImm);
bool SelectT2AddrModeImm8Offset(SDNode *Op, SDValue N,
SDValue &OffImm);
bool SelectT2AddrModeSoReg(SDValue N, SDValue &Base,
SDValue &OffReg, SDValue &ShImm);
bool SelectT2AddrModeExclusive(SDValue N, SDValue &Base, SDValue &OffImm);
inline bool is_so_imm(unsigned Imm) const {
return ARM_AM::getSOImmVal(Imm) != -1;
}
inline bool is_so_imm_not(unsigned Imm) const {
return ARM_AM::getSOImmVal(~Imm) != -1;
}
inline bool is_t2_so_imm(unsigned Imm) const {
return ARM_AM::getT2SOImmVal(Imm) != -1;
}
inline bool is_t2_so_imm_not(unsigned Imm) const {
return ARM_AM::getT2SOImmVal(~Imm) != -1;
}
// Include the pieces autogenerated from the target description.
#include "ARMGenDAGISel.inc"
private:
void transferMemOperands(SDNode *Src, SDNode *Dst);
/// Indexed (pre/post inc/dec) load matching code for ARM.
bool tryARMIndexedLoad(SDNode *N);
bool tryT1IndexedLoad(SDNode *N);
bool tryT2IndexedLoad(SDNode *N);
/// SelectVLD - Select NEON load intrinsics. NumVecs should be
/// 1, 2, 3 or 4. The opcode arrays specify the instructions used for
/// loads of D registers and even subregs and odd subregs of Q registers.
/// For NumVecs <= 2, QOpcodes1 is not used.
void SelectVLD(SDNode *N, bool isUpdating, unsigned NumVecs,
const uint16_t *DOpcodes, const uint16_t *QOpcodes0,
const uint16_t *QOpcodes1);
/// SelectVST - Select NEON store intrinsics. NumVecs should
/// be 1, 2, 3 or 4. The opcode arrays specify the instructions used for
/// stores of D registers and even subregs and odd subregs of Q registers.
/// For NumVecs <= 2, QOpcodes1 is not used.
void SelectVST(SDNode *N, bool isUpdating, unsigned NumVecs,
const uint16_t *DOpcodes, const uint16_t *QOpcodes0,
const uint16_t *QOpcodes1);
/// SelectVLDSTLane - Select NEON load/store lane intrinsics. NumVecs should
/// be 2, 3 or 4. The opcode arrays specify the instructions used for
/// load/store of D registers and Q registers.
void SelectVLDSTLane(SDNode *N, bool IsLoad, bool isUpdating,
unsigned NumVecs, const uint16_t *DOpcodes,
const uint16_t *QOpcodes);
/// SelectVLDDup - Select NEON load-duplicate intrinsics. NumVecs
/// should be 1, 2, 3 or 4. The opcode array specifies the instructions used
/// for loading D registers.
void SelectVLDDup(SDNode *N, bool IsIntrinsic, bool isUpdating,
unsigned NumVecs, const uint16_t *DOpcodes,
const uint16_t *QOpcodes0 = nullptr,
const uint16_t *QOpcodes1 = nullptr);
/// Try to select SBFX/UBFX instructions for ARM.
bool tryV6T2BitfieldExtractOp(SDNode *N, bool isSigned);
// Select special operations if node forms integer ABS pattern
bool tryABSOp(SDNode *N);
bool tryReadRegister(SDNode *N);
bool tryWriteRegister(SDNode *N);
bool tryInlineAsm(SDNode *N);
void SelectCMPZ(SDNode *N, bool &SwitchEQNEToPLMI);
void SelectCMP_SWAP(SDNode *N);
/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
/// inline asm expressions.
bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
std::vector<SDValue> &OutOps) override;
// Form pairs of consecutive R, S, D, or Q registers.
SDNode *createGPRPairNode(EVT VT, SDValue V0, SDValue V1);
SDNode *createSRegPairNode(EVT VT, SDValue V0, SDValue V1);
SDNode *createDRegPairNode(EVT VT, SDValue V0, SDValue V1);
SDNode *createQRegPairNode(EVT VT, SDValue V0, SDValue V1);
// Form sequences of 4 consecutive S, D, or Q registers.
SDNode *createQuadSRegsNode(EVT VT, SDValue V0, SDValue V1, SDValue V2, SDValue V3);
SDNode *createQuadDRegsNode(EVT VT, SDValue V0, SDValue V1, SDValue V2, SDValue V3);
SDNode *createQuadQRegsNode(EVT VT, SDValue V0, SDValue V1, SDValue V2, SDValue V3);
// Get the alignment operand for a NEON VLD or VST instruction.
SDValue GetVLDSTAlign(SDValue Align, const SDLoc &dl, unsigned NumVecs,
bool is64BitVector);
/// Returns the number of instructions required to materialize the given
/// constant in a register, or 3 if a literal pool load is needed.
unsigned ConstantMaterializationCost(unsigned Val) const;
/// Checks if N is a multiplication by a constant where we can extract out a
/// power of two from the constant so that it can be used in a shift, but only
/// if it simplifies the materialization of the constant. Returns true if it
/// is, and assigns to PowerOfTwo the power of two that should be extracted
/// out and to NewMulConst the new constant to be multiplied by.
bool canExtractShiftFromMul(const SDValue &N, unsigned MaxShift,
unsigned &PowerOfTwo, SDValue &NewMulConst) const;
/// Replace N with M in CurDAG, in a way that also ensures that M gets
/// selected when N would have been selected.
void replaceDAGValue(const SDValue &N, SDValue M);
};
}
/// isInt32Immediate - This method tests to see if the node is a 32-bit constant
/// operand. If so Imm will receive the 32-bit value.
static bool isInt32Immediate(SDNode *N, unsigned &Imm) {
if (N->getOpcode() == ISD::Constant && N->getValueType(0) == MVT::i32) {
Imm = cast<ConstantSDNode>(N)->getZExtValue();
return true;
}
return false;
}
// isInt32Immediate - This method tests to see if a constant operand.
// If so Imm will receive the 32 bit value.
static bool isInt32Immediate(SDValue N, unsigned &Imm) {
return isInt32Immediate(N.getNode(), Imm);
}
// isOpcWithIntImmediate - This method tests to see if the node is a specific
// opcode and that it has a immediate integer right operand.
// If so Imm will receive the 32 bit value.
static bool isOpcWithIntImmediate(SDNode *N, unsigned Opc, unsigned& Imm) {
return N->getOpcode() == Opc &&
isInt32Immediate(N->getOperand(1).getNode(), Imm);
}
/// Check whether a particular node is a constant value representable as
/// (N * Scale) where (N in [\p RangeMin, \p RangeMax).
///
/// \param ScaledConstant [out] - On success, the pre-scaled constant value.
static bool isScaledConstantInRange(SDValue Node, int Scale,
int RangeMin, int RangeMax,
int &ScaledConstant) {
assert(Scale > 0 && "Invalid scale!");
// Check that this is a constant.
const ConstantSDNode *C = dyn_cast<ConstantSDNode>(Node);
if (!C)
return false;
ScaledConstant = (int) C->getZExtValue();
if ((ScaledConstant % Scale) != 0)
return false;
ScaledConstant /= Scale;
return ScaledConstant >= RangeMin && ScaledConstant < RangeMax;
}
void ARMDAGToDAGISel::PreprocessISelDAG() {
if (!Subtarget->hasV6T2Ops())
return;
bool isThumb2 = Subtarget->isThumb();
for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(),
E = CurDAG->allnodes_end(); I != E; ) {
SDNode *N = &*I++; // Preincrement iterator to avoid invalidation issues.
if (N->getOpcode() != ISD::ADD)
continue;
// Look for (add X1, (and (srl X2, c1), c2)) where c2 is constant with
// leading zeros, followed by consecutive set bits, followed by 1 or 2
// trailing zeros, e.g. 1020.
// Transform the expression to
// (add X1, (shl (and (srl X2, c1), (c2>>tz)), tz)) where tz is the number
// of trailing zeros of c2. The left shift would be folded as an shifter
// operand of 'add' and the 'and' and 'srl' would become a bits extraction
// node (UBFX).
SDValue N0 = N->getOperand(0);
SDValue N1 = N->getOperand(1);
unsigned And_imm = 0;
if (!isOpcWithIntImmediate(N1.getNode(), ISD::AND, And_imm)) {
if (isOpcWithIntImmediate(N0.getNode(), ISD::AND, And_imm))
std::swap(N0, N1);
}
if (!And_imm)
continue;
// Check if the AND mask is an immediate of the form: 000.....1111111100
unsigned TZ = countTrailingZeros(And_imm);
if (TZ != 1 && TZ != 2)
// Be conservative here. Shifter operands aren't always free. e.g. On
// Swift, left shifter operand of 1 / 2 for free but others are not.
// e.g.
// ubfx r3, r1, #16, #8
// ldr.w r3, [r0, r3, lsl #2]
// vs.
// mov.w r9, #1020
// and.w r2, r9, r1, lsr #14
// ldr r2, [r0, r2]
continue;
And_imm >>= TZ;
if (And_imm & (And_imm + 1))
continue;
// Look for (and (srl X, c1), c2).
SDValue Srl = N1.getOperand(0);
unsigned Srl_imm = 0;
if (!isOpcWithIntImmediate(Srl.getNode(), ISD::SRL, Srl_imm) ||
(Srl_imm <= 2))
continue;
// Make sure first operand is not a shifter operand which would prevent
// folding of the left shift.
SDValue CPTmp0;
SDValue CPTmp1;
SDValue CPTmp2;
if (isThumb2) {
if (SelectImmShifterOperand(N0, CPTmp0, CPTmp1))
continue;
} else {
if (SelectImmShifterOperand(N0, CPTmp0, CPTmp1) ||
SelectRegShifterOperand(N0, CPTmp0, CPTmp1, CPTmp2))
continue;
}
// Now make the transformation.
Srl = CurDAG->getNode(ISD::SRL, SDLoc(Srl), MVT::i32,
Srl.getOperand(0),
CurDAG->getConstant(Srl_imm + TZ, SDLoc(Srl),
MVT::i32));
N1 = CurDAG->getNode(ISD::AND, SDLoc(N1), MVT::i32,
Srl,
CurDAG->getConstant(And_imm, SDLoc(Srl), MVT::i32));
N1 = CurDAG->getNode(ISD::SHL, SDLoc(N1), MVT::i32,
N1, CurDAG->getConstant(TZ, SDLoc(Srl), MVT::i32));
CurDAG->UpdateNodeOperands(N, N0, N1);
}
}
/// hasNoVMLxHazardUse - Return true if it's desirable to select a FP MLA / MLS
/// node. VFP / NEON fp VMLA / VMLS instructions have special RAW hazards (at
/// least on current ARM implementations) which should be avoidded.
bool ARMDAGToDAGISel::hasNoVMLxHazardUse(SDNode *N) const {
if (OptLevel == CodeGenOpt::None)
return true;
if (!Subtarget->hasVMLxHazards())
return true;
if (!N->hasOneUse())
return false;
SDNode *Use = *N->use_begin();
if (Use->getOpcode() == ISD::CopyToReg)
return true;
if (Use->isMachineOpcode()) {
const ARMBaseInstrInfo *TII = static_cast<const ARMBaseInstrInfo *>(
CurDAG->getSubtarget().getInstrInfo());
const MCInstrDesc &MCID = TII->get(Use->getMachineOpcode());
if (MCID.mayStore())
return true;
unsigned Opcode = MCID.getOpcode();
if (Opcode == ARM::VMOVRS || Opcode == ARM::VMOVRRD)
return true;
// vmlx feeding into another vmlx. We actually want to unfold
// the use later in the MLxExpansion pass. e.g.
// vmla
// vmla (stall 8 cycles)
//
// vmul (5 cycles)
// vadd (5 cycles)
// vmla
// This adds up to about 18 - 19 cycles.
//
// vmla
// vmul (stall 4 cycles)
// vadd adds up to about 14 cycles.
return TII->isFpMLxInstruction(Opcode);
}
return false;
}
bool ARMDAGToDAGISel::isShifterOpProfitable(const SDValue &Shift,
ARM_AM::ShiftOpc ShOpcVal,
unsigned ShAmt) {
if (!Subtarget->isLikeA9() && !Subtarget->isSwift())
return true;
if (Shift.hasOneUse())
return true;
// R << 2 is free.
return ShOpcVal == ARM_AM::lsl &&
(ShAmt == 2 || (Subtarget->isSwift() && ShAmt == 1));
}
unsigned ARMDAGToDAGISel::ConstantMaterializationCost(unsigned Val) const {
if (Subtarget->isThumb()) {
if (Val <= 255) return 1; // MOV
if (Subtarget->hasV6T2Ops() &&
(Val <= 0xffff || // MOV
ARM_AM::getT2SOImmVal(Val) != -1 || // MOVW
ARM_AM::getT2SOImmVal(~Val) != -1)) // MVN
return 1;
if (Val <= 510) return 2; // MOV + ADDi8
if (~Val <= 255) return 2; // MOV + MVN
if (ARM_AM::isThumbImmShiftedVal(Val)) return 2; // MOV + LSL
} else {
if (ARM_AM::getSOImmVal(Val) != -1) return 1; // MOV
if (ARM_AM::getSOImmVal(~Val) != -1) return 1; // MVN
if (Subtarget->hasV6T2Ops() && Val <= 0xffff) return 1; // MOVW
if (ARM_AM::isSOImmTwoPartVal(Val)) return 2; // two instrs
}
if (Subtarget->useMovt()) return 2; // MOVW + MOVT
return 3; // Literal pool load
}
bool ARMDAGToDAGISel::canExtractShiftFromMul(const SDValue &N,
unsigned MaxShift,
unsigned &PowerOfTwo,
SDValue &NewMulConst) const {
assert(N.getOpcode() == ISD::MUL);
assert(MaxShift > 0);
// If the multiply is used in more than one place then changing the constant
// will make other uses incorrect, so don't.
if (!N.hasOneUse()) return false;
// Check if the multiply is by a constant
ConstantSDNode *MulConst = dyn_cast<ConstantSDNode>(N.getOperand(1));
if (!MulConst) return false;
// If the constant is used in more than one place then modifying it will mean
// we need to materialize two constants instead of one, which is a bad idea.
if (!MulConst->hasOneUse()) return false;
unsigned MulConstVal = MulConst->getZExtValue();
if (MulConstVal == 0) return false;
// Find the largest power of 2 that MulConstVal is a multiple of
PowerOfTwo = MaxShift;
while ((MulConstVal % (1 << PowerOfTwo)) != 0) {
--PowerOfTwo;
if (PowerOfTwo == 0) return false;
}
// Only optimise if the new cost is better
unsigned NewMulConstVal = MulConstVal / (1 << PowerOfTwo);
NewMulConst = CurDAG->getConstant(NewMulConstVal, SDLoc(N), MVT::i32);
unsigned OldCost = ConstantMaterializationCost(MulConstVal);
unsigned NewCost = ConstantMaterializationCost(NewMulConstVal);
return NewCost < OldCost;
}
void ARMDAGToDAGISel::replaceDAGValue(const SDValue &N, SDValue M) {
CurDAG->RepositionNode(N.getNode()->getIterator(), M.getNode());
ReplaceUses(N, M);
}
bool ARMDAGToDAGISel::SelectImmShifterOperand(SDValue N,
SDValue &BaseReg,
SDValue &Opc,
bool CheckProfitability) {
if (DisableShifterOp)
return false;
// If N is a multiply-by-constant and it's profitable to extract a shift and
// use it in a shifted operand do so.
if (N.getOpcode() == ISD::MUL) {
unsigned PowerOfTwo = 0;
SDValue NewMulConst;
if (canExtractShiftFromMul(N, 31, PowerOfTwo, NewMulConst)) {
HandleSDNode Handle(N);
SDLoc Loc(N);
replaceDAGValue(N.getOperand(1), NewMulConst);
BaseReg = Handle.getValue();
Opc = CurDAG->getTargetConstant(
ARM_AM::getSORegOpc(ARM_AM::lsl, PowerOfTwo), Loc, MVT::i32);
return true;
}
}
ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(N.getOpcode());
// Don't match base register only case. That is matched to a separate
// lower complexity pattern with explicit register operand.
if (ShOpcVal == ARM_AM::no_shift) return false;
BaseReg = N.getOperand(0);
unsigned ShImmVal = 0;
ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1));
if (!RHS) return false;
ShImmVal = RHS->getZExtValue() & 31;
Opc = CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ShOpcVal, ShImmVal),
SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectRegShifterOperand(SDValue N,
SDValue &BaseReg,
SDValue &ShReg,
SDValue &Opc,
bool CheckProfitability) {
if (DisableShifterOp)
return false;
ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(N.getOpcode());
// Don't match base register only case. That is matched to a separate
// lower complexity pattern with explicit register operand.
if (ShOpcVal == ARM_AM::no_shift) return false;
BaseReg = N.getOperand(0);
unsigned ShImmVal = 0;
ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1));
if (RHS) return false;
ShReg = N.getOperand(1);
if (CheckProfitability && !isShifterOpProfitable(N, ShOpcVal, ShImmVal))
return false;
Opc = CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ShOpcVal, ShImmVal),
SDLoc(N), MVT::i32);
return true;
}
// Determine whether an ISD::OR's operands are suitable to turn the operation
// into an addition, which often has more compact encodings.
bool ARMDAGToDAGISel::SelectAddLikeOr(SDNode *Parent, SDValue N, SDValue &Out) {
assert(Parent->getOpcode() == ISD::OR && "unexpected parent");
Out = N;
return CurDAG->haveNoCommonBitsSet(N, Parent->getOperand(1));
}
bool ARMDAGToDAGISel::SelectAddrModeImm12(SDValue N,
SDValue &Base,
SDValue &OffImm) {
// Match simple R + imm12 operands.
// Base only.
if (N.getOpcode() != ISD::ADD && N.getOpcode() != ISD::SUB &&
!CurDAG->isBaseWithConstantOffset(N)) {
if (N.getOpcode() == ISD::FrameIndex) {
// Match frame index.
int FI = cast<FrameIndexSDNode>(N)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
if (N.getOpcode() == ARMISD::Wrapper &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalAddress &&
N.getOperand(0).getOpcode() != ISD::TargetExternalSymbol &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalTLSAddress) {
Base = N.getOperand(0);
} else
Base = N;
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
int RHSC = (int)RHS->getSExtValue();
if (N.getOpcode() == ISD::SUB)
RHSC = -RHSC;
if (RHSC > -0x1000 && RHSC < 0x1000) { // 12 bits
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
}
OffImm = CurDAG->getTargetConstant(RHSC, SDLoc(N), MVT::i32);
return true;
}
}
// Base only.
Base = N;
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectLdStSOReg(SDValue N, SDValue &Base, SDValue &Offset,
SDValue &Opc) {
if (N.getOpcode() == ISD::MUL &&
((!Subtarget->isLikeA9() && !Subtarget->isSwift()) || N.hasOneUse())) {
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
// X * [3,5,9] -> X + X * [2,4,8] etc.
int RHSC = (int)RHS->getZExtValue();
if (RHSC & 1) {
RHSC = RHSC & ~1;
ARM_AM::AddrOpc AddSub = ARM_AM::add;
if (RHSC < 0) {
AddSub = ARM_AM::sub;
RHSC = - RHSC;
}
if (isPowerOf2_32(RHSC)) {
unsigned ShAmt = Log2_32(RHSC);
Base = Offset = N.getOperand(0);
Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, ShAmt,
ARM_AM::lsl),
SDLoc(N), MVT::i32);
return true;
}
}
}
}
if (N.getOpcode() != ISD::ADD && N.getOpcode() != ISD::SUB &&
// ISD::OR that is equivalent to an ISD::ADD.
!CurDAG->isBaseWithConstantOffset(N))
return false;
// Leave simple R +/- imm12 operands for LDRi12
if (N.getOpcode() == ISD::ADD || N.getOpcode() == ISD::OR) {
int RHSC;
if (isScaledConstantInRange(N.getOperand(1), /*Scale=*/1,
-0x1000+1, 0x1000, RHSC)) // 12 bits.
return false;
}
// Otherwise this is R +/- [possibly shifted] R.
ARM_AM::AddrOpc AddSub = N.getOpcode() == ISD::SUB ? ARM_AM::sub:ARM_AM::add;
ARM_AM::ShiftOpc ShOpcVal =
ARM_AM::getShiftOpcForNode(N.getOperand(1).getOpcode());
unsigned ShAmt = 0;
Base = N.getOperand(0);
Offset = N.getOperand(1);
if (ShOpcVal != ARM_AM::no_shift) {
// Check to see if the RHS of the shift is a constant, if not, we can't fold
// it.
if (ConstantSDNode *Sh =
dyn_cast<ConstantSDNode>(N.getOperand(1).getOperand(1))) {
ShAmt = Sh->getZExtValue();
if (isShifterOpProfitable(Offset, ShOpcVal, ShAmt))
Offset = N.getOperand(1).getOperand(0);
else {
ShAmt = 0;
ShOpcVal = ARM_AM::no_shift;
}
} else {
ShOpcVal = ARM_AM::no_shift;
}
}
// Try matching (R shl C) + (R).
if (N.getOpcode() != ISD::SUB && ShOpcVal == ARM_AM::no_shift &&
!(Subtarget->isLikeA9() || Subtarget->isSwift() ||
N.getOperand(0).hasOneUse())) {
ShOpcVal = ARM_AM::getShiftOpcForNode(N.getOperand(0).getOpcode());
if (ShOpcVal != ARM_AM::no_shift) {
// Check to see if the RHS of the shift is a constant, if not, we can't
// fold it.
if (ConstantSDNode *Sh =
dyn_cast<ConstantSDNode>(N.getOperand(0).getOperand(1))) {
ShAmt = Sh->getZExtValue();
if (isShifterOpProfitable(N.getOperand(0), ShOpcVal, ShAmt)) {
Offset = N.getOperand(0).getOperand(0);
Base = N.getOperand(1);
} else {
ShAmt = 0;
ShOpcVal = ARM_AM::no_shift;
}
} else {
ShOpcVal = ARM_AM::no_shift;
}
}
}
// If Offset is a multiply-by-constant and it's profitable to extract a shift
// and use it in a shifted operand do so.
if (Offset.getOpcode() == ISD::MUL && N.hasOneUse()) {
unsigned PowerOfTwo = 0;
SDValue NewMulConst;
if (canExtractShiftFromMul(Offset, 31, PowerOfTwo, NewMulConst)) {
HandleSDNode Handle(Offset);
replaceDAGValue(Offset.getOperand(1), NewMulConst);
Offset = Handle.getValue();
ShAmt = PowerOfTwo;
ShOpcVal = ARM_AM::lsl;
}
}
Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, ShAmt, ShOpcVal),
SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectAddrMode2OffsetReg(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc) {
unsigned Opcode = Op->getOpcode();
ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
? cast<LoadSDNode>(Op)->getAddressingMode()
: cast<StoreSDNode>(Op)->getAddressingMode();
ARM_AM::AddrOpc AddSub = (AM == ISD::PRE_INC || AM == ISD::POST_INC)
? ARM_AM::add : ARM_AM::sub;
int Val;
if (isScaledConstantInRange(N, /*Scale=*/1, 0, 0x1000, Val))
return false;
Offset = N;
ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(N.getOpcode());
unsigned ShAmt = 0;
if (ShOpcVal != ARM_AM::no_shift) {
// Check to see if the RHS of the shift is a constant, if not, we can't fold
// it.
if (ConstantSDNode *Sh = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
ShAmt = Sh->getZExtValue();
if (isShifterOpProfitable(N, ShOpcVal, ShAmt))
Offset = N.getOperand(0);
else {
ShAmt = 0;
ShOpcVal = ARM_AM::no_shift;
}
} else {
ShOpcVal = ARM_AM::no_shift;
}
}
Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, ShAmt, ShOpcVal),
SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectAddrMode2OffsetImmPre(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc) {
unsigned Opcode = Op->getOpcode();
ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
? cast<LoadSDNode>(Op)->getAddressingMode()
: cast<StoreSDNode>(Op)->getAddressingMode();
ARM_AM::AddrOpc AddSub = (AM == ISD::PRE_INC || AM == ISD::POST_INC)
? ARM_AM::add : ARM_AM::sub;
int Val;
if (isScaledConstantInRange(N, /*Scale=*/1, 0, 0x1000, Val)) { // 12 bits.
if (AddSub == ARM_AM::sub) Val *= -1;
Offset = CurDAG->getRegister(0, MVT::i32);
Opc = CurDAG->getTargetConstant(Val, SDLoc(Op), MVT::i32);
return true;
}
return false;
}
bool ARMDAGToDAGISel::SelectAddrMode2OffsetImm(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc) {
unsigned Opcode = Op->getOpcode();
ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
? cast<LoadSDNode>(Op)->getAddressingMode()
: cast<StoreSDNode>(Op)->getAddressingMode();
ARM_AM::AddrOpc AddSub = (AM == ISD::PRE_INC || AM == ISD::POST_INC)
? ARM_AM::add : ARM_AM::sub;
int Val;
if (isScaledConstantInRange(N, /*Scale=*/1, 0, 0x1000, Val)) { // 12 bits.
Offset = CurDAG->getRegister(0, MVT::i32);
Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, Val,
ARM_AM::no_shift),
SDLoc(Op), MVT::i32);
return true;
}
return false;
}
bool ARMDAGToDAGISel::SelectAddrOffsetNone(SDValue N, SDValue &Base) {
Base = N;
return true;
}
bool ARMDAGToDAGISel::SelectAddrMode3(SDValue N,
SDValue &Base, SDValue &Offset,
SDValue &Opc) {
if (N.getOpcode() == ISD::SUB) {
// X - C is canonicalize to X + -C, no need to handle it here.
Base = N.getOperand(0);
Offset = N.getOperand(1);
Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::sub, 0), SDLoc(N),
MVT::i32);
return true;
}
if (!CurDAG->isBaseWithConstantOffset(N)) {
Base = N;
if (N.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(N)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
}
Offset = CurDAG->getRegister(0, MVT::i32);
Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::add, 0), SDLoc(N),
MVT::i32);
return true;
}
// If the RHS is +/- imm8, fold into addr mode.
int RHSC;
if (isScaledConstantInRange(N.getOperand(1), /*Scale=*/1,
-256 + 1, 256, RHSC)) { // 8 bits.
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
}
Offset = CurDAG->getRegister(0, MVT::i32);
ARM_AM::AddrOpc AddSub = ARM_AM::add;
if (RHSC < 0) {
AddSub = ARM_AM::sub;
RHSC = -RHSC;
}
Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(AddSub, RHSC), SDLoc(N),
MVT::i32);
return true;
}
Base = N.getOperand(0);
Offset = N.getOperand(1);
Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::add, 0), SDLoc(N),
MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectAddrMode3Offset(SDNode *Op, SDValue N,
SDValue &Offset, SDValue &Opc) {
unsigned Opcode = Op->getOpcode();
ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
? cast<LoadSDNode>(Op)->getAddressingMode()
: cast<StoreSDNode>(Op)->getAddressingMode();
ARM_AM::AddrOpc AddSub = (AM == ISD::PRE_INC || AM == ISD::POST_INC)
? ARM_AM::add : ARM_AM::sub;
int Val;
if (isScaledConstantInRange(N, /*Scale=*/1, 0, 256, Val)) { // 12 bits.
Offset = CurDAG->getRegister(0, MVT::i32);
Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(AddSub, Val), SDLoc(Op),
MVT::i32);
return true;
}
Offset = N;
Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(AddSub, 0), SDLoc(Op),
MVT::i32);
return true;
}
bool ARMDAGToDAGISel::IsAddressingMode5(SDValue N, SDValue &Base, SDValue &Offset,
bool FP16) {
if (!CurDAG->isBaseWithConstantOffset(N)) {
Base = N;
if (N.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(N)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
} else if (N.getOpcode() == ARMISD::Wrapper &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalAddress &&
N.getOperand(0).getOpcode() != ISD::TargetExternalSymbol &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalTLSAddress) {
Base = N.getOperand(0);
}
Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(ARM_AM::add, 0),
SDLoc(N), MVT::i32);
return true;
}
// If the RHS is +/- imm8, fold into addr mode.
int RHSC;
const int Scale = FP16 ? 2 : 4;
if (isScaledConstantInRange(N.getOperand(1), Scale, -255, 256, RHSC)) {
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
}
ARM_AM::AddrOpc AddSub = ARM_AM::add;
if (RHSC < 0) {
AddSub = ARM_AM::sub;
RHSC = -RHSC;
}
if (FP16)
Offset = CurDAG->getTargetConstant(ARM_AM::getAM5FP16Opc(AddSub, RHSC),
SDLoc(N), MVT::i32);
else
Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(AddSub, RHSC),
SDLoc(N), MVT::i32);
return true;
}
Base = N;
if (FP16)
Offset = CurDAG->getTargetConstant(ARM_AM::getAM5FP16Opc(ARM_AM::add, 0),
SDLoc(N), MVT::i32);
else
Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(ARM_AM::add, 0),
SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectAddrMode5(SDValue N,
SDValue &Base, SDValue &Offset) {
return IsAddressingMode5(N, Base, Offset, /*FP16=*/ false);
}
bool ARMDAGToDAGISel::SelectAddrMode5FP16(SDValue N,
SDValue &Base, SDValue &Offset) {
return IsAddressingMode5(N, Base, Offset, /*FP16=*/ true);
}
bool ARMDAGToDAGISel::SelectAddrMode6(SDNode *Parent, SDValue N, SDValue &Addr,
SDValue &Align) {
Addr = N;
unsigned Alignment = 0;
MemSDNode *MemN = cast<MemSDNode>(Parent);
if (isa<LSBaseSDNode>(MemN) ||
((MemN->getOpcode() == ARMISD::VST1_UPD ||
MemN->getOpcode() == ARMISD::VLD1_UPD) &&
MemN->getConstantOperandVal(MemN->getNumOperands() - 1) == 1)) {
// This case occurs only for VLD1-lane/dup and VST1-lane instructions.
// The maximum alignment is equal to the memory size being referenced.
unsigned MMOAlign = MemN->getAlignment();
unsigned MemSize = MemN->getMemoryVT().getSizeInBits() / 8;
if (MMOAlign >= MemSize && MemSize > 1)
Alignment = MemSize;
} else {
// All other uses of addrmode6 are for intrinsics. For now just record
// the raw alignment value; it will be refined later based on the legal
// alignment operands for the intrinsic.
Alignment = MemN->getAlignment();
}
Align = CurDAG->getTargetConstant(Alignment, SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectAddrMode6Offset(SDNode *Op, SDValue N,
SDValue &Offset) {
LSBaseSDNode *LdSt = cast<LSBaseSDNode>(Op);
ISD::MemIndexedMode AM = LdSt->getAddressingMode();
if (AM != ISD::POST_INC)
return false;
Offset = N;
if (ConstantSDNode *NC = dyn_cast<ConstantSDNode>(N)) {
if (NC->getZExtValue() * 8 == LdSt->getMemoryVT().getSizeInBits())
Offset = CurDAG->getRegister(0, MVT::i32);
}
return true;
}
bool ARMDAGToDAGISel::SelectAddrModePC(SDValue N,
SDValue &Offset, SDValue &Label) {
if (N.getOpcode() == ARMISD::PIC_ADD && N.hasOneUse()) {
Offset = N.getOperand(0);
SDValue N1 = N.getOperand(1);
Label = CurDAG->getTargetConstant(cast<ConstantSDNode>(N1)->getZExtValue(),
SDLoc(N), MVT::i32);
return true;
}
return false;
}
//===----------------------------------------------------------------------===//
// Thumb Addressing Modes
//===----------------------------------------------------------------------===//
static bool shouldUseZeroOffsetLdSt(SDValue N) {
// Negative numbers are difficult to materialise in thumb1. If we are
// selecting the add of a negative, instead try to select ri with a zero
// offset, so create the add node directly which will become a sub.
if (N.getOpcode() != ISD::ADD)
return false;
// Look for an imm which is not legal for ld/st, but is legal for sub.
if (auto C = dyn_cast<ConstantSDNode>(N.getOperand(1)))
return C->getSExtValue() < 0 && C->getSExtValue() >= -255;
return false;
}
bool ARMDAGToDAGISel::SelectThumbAddrModeRRSext(SDValue N, SDValue &Base,
SDValue &Offset) {
if (N.getOpcode() != ISD::ADD && !CurDAG->isBaseWithConstantOffset(N)) {
ConstantSDNode *NC = dyn_cast<ConstantSDNode>(N);
if (!NC || !NC->isNullValue())
return false;
Base = Offset = N;
return true;
}
Base = N.getOperand(0);
Offset = N.getOperand(1);
return true;
}
bool ARMDAGToDAGISel::SelectThumbAddrModeRR(SDValue N, SDValue &Base,
SDValue &Offset) {
if (shouldUseZeroOffsetLdSt(N))
return false; // Select ri instead
return SelectThumbAddrModeRRSext(N, Base, Offset);
}
bool
ARMDAGToDAGISel::SelectThumbAddrModeImm5S(SDValue N, unsigned Scale,
SDValue &Base, SDValue &OffImm) {
if (shouldUseZeroOffsetLdSt(N)) {
Base = N;
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
if (!CurDAG->isBaseWithConstantOffset(N)) {
if (N.getOpcode() == ISD::ADD) {
return false; // We want to select register offset instead
} else if (N.getOpcode() == ARMISD::Wrapper &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalAddress &&
N.getOperand(0).getOpcode() != ISD::TargetExternalSymbol &&
N.getOperand(0).getOpcode() != ISD::TargetConstantPool &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalTLSAddress) {
Base = N.getOperand(0);
} else {
Base = N;
}
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
// If the RHS is + imm5 * scale, fold into addr mode.
int RHSC;
if (isScaledConstantInRange(N.getOperand(1), Scale, 0, 32, RHSC)) {
Base = N.getOperand(0);
OffImm = CurDAG->getTargetConstant(RHSC, SDLoc(N), MVT::i32);
return true;
}
// Offset is too large, so use register offset instead.
return false;
}
bool
ARMDAGToDAGISel::SelectThumbAddrModeImm5S4(SDValue N, SDValue &Base,
SDValue &OffImm) {
return SelectThumbAddrModeImm5S(N, 4, Base, OffImm);
}
bool
ARMDAGToDAGISel::SelectThumbAddrModeImm5S2(SDValue N, SDValue &Base,
SDValue &OffImm) {
return SelectThumbAddrModeImm5S(N, 2, Base, OffImm);
}
bool
ARMDAGToDAGISel::SelectThumbAddrModeImm5S1(SDValue N, SDValue &Base,
SDValue &OffImm) {
return SelectThumbAddrModeImm5S(N, 1, Base, OffImm);
}
bool ARMDAGToDAGISel::SelectThumbAddrModeSP(SDValue N,
SDValue &Base, SDValue &OffImm) {
if (N.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(N)->getIndex();
// Only multiples of 4 are allowed for the offset, so the frame object
// alignment must be at least 4.
MachineFrameInfo &MFI = MF->getFrameInfo();
if (MFI.getObjectAlignment(FI) < 4)
MFI.setObjectAlignment(FI, 4);
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
if (!CurDAG->isBaseWithConstantOffset(N))
return false;
if (N.getOperand(0).getOpcode() == ISD::FrameIndex) {
// If the RHS is + imm8 * scale, fold into addr mode.
int RHSC;
if (isScaledConstantInRange(N.getOperand(1), /*Scale=*/4, 0, 256, RHSC)) {
Base = N.getOperand(0);
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
// For LHS+RHS to result in an offset that's a multiple of 4 the object
// indexed by the LHS must be 4-byte aligned.
MachineFrameInfo &MFI = MF->getFrameInfo();
if (MFI.getObjectAlignment(FI) < 4)
MFI.setObjectAlignment(FI, 4);
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
OffImm = CurDAG->getTargetConstant(RHSC, SDLoc(N), MVT::i32);
return true;
}
}
return false;
}
//===----------------------------------------------------------------------===//
// Thumb 2 Addressing Modes
//===----------------------------------------------------------------------===//
bool ARMDAGToDAGISel::SelectT2AddrModeImm12(SDValue N,
SDValue &Base, SDValue &OffImm) {
// Match simple R + imm12 operands.
// Base only.
if (N.getOpcode() != ISD::ADD && N.getOpcode() != ISD::SUB &&
!CurDAG->isBaseWithConstantOffset(N)) {
if (N.getOpcode() == ISD::FrameIndex) {
// Match frame index.
int FI = cast<FrameIndexSDNode>(N)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
if (N.getOpcode() == ARMISD::Wrapper &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalAddress &&
N.getOperand(0).getOpcode() != ISD::TargetExternalSymbol &&
N.getOperand(0).getOpcode() != ISD::TargetGlobalTLSAddress) {
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::TargetConstantPool)
return false; // We want to select t2LDRpci instead.
} else
Base = N;
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
if (SelectT2AddrModeImm8(N, Base, OffImm))
// Let t2LDRi8 handle (R - imm8).
return false;
int RHSC = (int)RHS->getZExtValue();
if (N.getOpcode() == ISD::SUB)
RHSC = -RHSC;
if (RHSC >= 0 && RHSC < 0x1000) { // 12 bits (unsigned)
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
}
OffImm = CurDAG->getTargetConstant(RHSC, SDLoc(N), MVT::i32);
return true;
}
}
// Base only.
Base = N;
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectT2AddrModeImm8(SDValue N,
SDValue &Base, SDValue &OffImm) {
// Match simple R - imm8 operands.
if (N.getOpcode() != ISD::ADD && N.getOpcode() != ISD::SUB &&
!CurDAG->isBaseWithConstantOffset(N))
return false;
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
int RHSC = (int)RHS->getSExtValue();
if (N.getOpcode() == ISD::SUB)
RHSC = -RHSC;
if ((RHSC >= -255) && (RHSC < 0)) { // 8 bits (always negative)
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
}
OffImm = CurDAG->getTargetConstant(RHSC, SDLoc(N), MVT::i32);
return true;
}
}
return false;
}
bool ARMDAGToDAGISel::SelectT2AddrModeImm8Offset(SDNode *Op, SDValue N,
SDValue &OffImm){
unsigned Opcode = Op->getOpcode();
ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
? cast<LoadSDNode>(Op)->getAddressingMode()
: cast<StoreSDNode>(Op)->getAddressingMode();
int RHSC;
if (isScaledConstantInRange(N, /*Scale=*/1, 0, 0x100, RHSC)) { // 8 bits.
OffImm = ((AM == ISD::PRE_INC) || (AM == ISD::POST_INC))
? CurDAG->getTargetConstant(RHSC, SDLoc(N), MVT::i32)
: CurDAG->getTargetConstant(-RHSC, SDLoc(N), MVT::i32);
return true;
}
return false;
}
bool ARMDAGToDAGISel::SelectT2AddrModeSoReg(SDValue N,
SDValue &Base,
SDValue &OffReg, SDValue &ShImm) {
// (R - imm8) should be handled by t2LDRi8. The rest are handled by t2LDRi12.
if (N.getOpcode() != ISD::ADD && !CurDAG->isBaseWithConstantOffset(N))
return false;
// Leave (R + imm12) for t2LDRi12, (R - imm8) for t2LDRi8.
if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
int RHSC = (int)RHS->getZExtValue();
if (RHSC >= 0 && RHSC < 0x1000) // 12 bits (unsigned)
return false;
else if (RHSC < 0 && RHSC >= -255) // 8 bits
return false;
}
// Look for (R + R) or (R + (R << [1,2,3])).
unsigned ShAmt = 0;
Base = N.getOperand(0);
OffReg = N.getOperand(1);
// Swap if it is ((R << c) + R).
ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(OffReg.getOpcode());
if (ShOpcVal != ARM_AM::lsl) {
ShOpcVal = ARM_AM::getShiftOpcForNode(Base.getOpcode());
if (ShOpcVal == ARM_AM::lsl)
std::swap(Base, OffReg);
}
if (ShOpcVal == ARM_AM::lsl) {
// Check to see if the RHS of the shift is a constant, if not, we can't fold
// it.
if (ConstantSDNode *Sh = dyn_cast<ConstantSDNode>(OffReg.getOperand(1))) {
ShAmt = Sh->getZExtValue();
if (ShAmt < 4 && isShifterOpProfitable(OffReg, ShOpcVal, ShAmt))
OffReg = OffReg.getOperand(0);
else {
ShAmt = 0;
}
}
}
// If OffReg is a multiply-by-constant and it's profitable to extract a shift
// and use it in a shifted operand do so.
if (OffReg.getOpcode() == ISD::MUL && N.hasOneUse()) {
unsigned PowerOfTwo = 0;
SDValue NewMulConst;
if (canExtractShiftFromMul(OffReg, 3, PowerOfTwo, NewMulConst)) {
HandleSDNode Handle(OffReg);
replaceDAGValue(OffReg.getOperand(1), NewMulConst);
OffReg = Handle.getValue();
ShAmt = PowerOfTwo;
}
}
ShImm = CurDAG->getTargetConstant(ShAmt, SDLoc(N), MVT::i32);
return true;
}
bool ARMDAGToDAGISel::SelectT2AddrModeExclusive(SDValue N, SDValue &Base,
SDValue &OffImm) {
// This *must* succeed since it's used for the irreplaceable ldrex and strex
// instructions.
Base = N;
OffImm = CurDAG->getTargetConstant(0, SDLoc(N), MVT::i32);
if (N.getOpcode() != ISD::ADD || !CurDAG->isBaseWithConstantOffset(N))
return true;
ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1));
if (!RHS)
return true;
uint32_t RHSC = (int)RHS->getZExtValue();
if (RHSC > 1020 || RHSC % 4 != 0)
return true;
Base = N.getOperand(0);
if (Base.getOpcode() == ISD::FrameIndex) {
int FI = cast<FrameIndexSDNode>(Base)->getIndex();
Base = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
}
OffImm = CurDAG->getTargetConstant(RHSC/4, SDLoc(N), MVT::i32);
return true;
}
//===--------------------------------------------------------------------===//
/// getAL - Returns a ARMCC::AL immediate node.
static inline SDValue getAL(SelectionDAG *CurDAG, const SDLoc &dl) {
return CurDAG->getTargetConstant((uint64_t)ARMCC::AL, dl, MVT::i32);
}
void ARMDAGToDAGISel::transferMemOperands(SDNode *N, SDNode *Result) {
MachineMemOperand *MemOp = cast<MemSDNode>(N)->getMemOperand();
CurDAG->setNodeMemRefs(cast<MachineSDNode>(Result), {MemOp});
}
bool ARMDAGToDAGISel::tryARMIndexedLoad(SDNode *N) {
LoadSDNode *LD = cast<LoadSDNode>(N);
ISD::MemIndexedMode AM = LD->getAddressingMode();
if (AM == ISD::UNINDEXED)
return false;
EVT LoadedVT = LD->getMemoryVT();
SDValue Offset, AMOpc;
bool isPre = (AM == ISD::PRE_INC) || (AM == ISD::PRE_DEC);
unsigned Opcode = 0;
bool Match = false;
if (LoadedVT == MVT::i32 && isPre &&
SelectAddrMode2OffsetImmPre(N, LD->getOffset(), Offset, AMOpc)) {
Opcode = ARM::LDR_PRE_IMM;
Match = true;
} else if (LoadedVT == MVT::i32 && !isPre &&
SelectAddrMode2OffsetImm(N, LD->getOffset(), Offset, AMOpc)) {
Opcode = ARM::LDR_POST_IMM;
Match = true;
} else if (LoadedVT == MVT::i32 &&
SelectAddrMode2OffsetReg(N, LD->getOffset(), Offset, AMOpc)) {
Opcode = isPre ? ARM::LDR_PRE_REG : ARM::LDR_POST_REG;
Match = true;
} else if (LoadedVT == MVT::i16 &&
SelectAddrMode3Offset(N, LD->getOffset(), Offset, AMOpc)) {
Match = true;
Opcode = (LD->getExtensionType() == ISD::SEXTLOAD)
? (isPre ? ARM::LDRSH_PRE : ARM::LDRSH_POST)
: (isPre ? ARM::LDRH_PRE : ARM::LDRH_POST);
} else if (LoadedVT == MVT::i8 || LoadedVT == MVT::i1) {
if (LD->getExtensionType() == ISD::SEXTLOAD) {
if (SelectAddrMode3Offset(N, LD->getOffset(), Offset, AMOpc)) {
Match = true;
Opcode = isPre ? ARM::LDRSB_PRE : ARM::LDRSB_POST;
}
} else {
if (isPre &&
SelectAddrMode2OffsetImmPre(N, LD->getOffset(), Offset, AMOpc)) {
Match = true;
Opcode = ARM::LDRB_PRE_IMM;
} else if (!isPre &&
SelectAddrMode2OffsetImm(N, LD->getOffset(), Offset, AMOpc)) {
Match = true;
Opcode = ARM::LDRB_POST_IMM;
} else if (SelectAddrMode2OffsetReg(N, LD->getOffset(), Offset, AMOpc)) {
Match = true;
Opcode = isPre ? ARM::LDRB_PRE_REG : ARM::LDRB_POST_REG;
}
}
}
if (Match) {
if (Opcode == ARM::LDR_PRE_IMM || Opcode == ARM::LDRB_PRE_IMM) {
SDValue Chain = LD->getChain();
SDValue Base = LD->getBasePtr();
SDValue Ops[]= { Base, AMOpc, getAL(CurDAG, SDLoc(N)),
CurDAG->getRegister(0, MVT::i32), Chain };
SDNode *New = CurDAG->getMachineNode(Opcode, SDLoc(N), MVT::i32, MVT::i32,
MVT::Other, Ops);
transferMemOperands(N, New);
ReplaceNode(N, New);
return true;
} else {
SDValue Chain = LD->getChain();
SDValue Base = LD->getBasePtr();
SDValue Ops[]= { Base, Offset, AMOpc, getAL(CurDAG, SDLoc(N)),
CurDAG->getRegister(0, MVT::i32), Chain };
SDNode *New = CurDAG->getMachineNode(Opcode, SDLoc(N), MVT::i32, MVT::i32,
MVT::Other, Ops);
transferMemOperands(N, New);
ReplaceNode(N, New);
return true;
}
}
return false;
}
bool ARMDAGToDAGISel::tryT1IndexedLoad(SDNode *N) {
LoadSDNode *LD = cast<LoadSDNode>(N);
EVT LoadedVT = LD->getMemoryVT();
ISD::MemIndexedMode AM = LD->getAddressingMode();
if (AM != ISD::POST_INC || LD->getExtensionType() != ISD::NON_EXTLOAD ||
LoadedVT.getSimpleVT().SimpleTy != MVT::i32)
return false;
auto *COffs = dyn_cast<ConstantSDNode>(LD->getOffset());
if (!COffs || COffs->getZExtValue() != 4)
return false;
// A T1 post-indexed load is just a single register LDM: LDM r0!, {r1}.
// The encoding of LDM is not how the rest of ISel expects a post-inc load to
// look however, so we use a pseudo here and switch it for a tLDMIA_UPD after
// ISel.
SDValue Chain = LD->getChain();
SDValue Base = LD->getBasePtr();
SDValue Ops[]= { Base, getAL(CurDAG, SDLoc(N)),
CurDAG->getRegister(0, MVT::i32), Chain };
SDNode *New = CurDAG->getMachineNode(ARM::tLDR_postidx, SDLoc(N), MVT::i32,
MVT::i32, MVT::Other, Ops);
transferMemOperands(N, New);
ReplaceNode(N, New);
return true;
}
bool ARMDAGToDAGISel::tryT2IndexedLoad(SDNode *N) {
LoadSDNode *LD = cast<LoadSDNode>(N);
ISD::MemIndexedMode AM = LD->getAddressingMode();
if (AM == ISD::UNINDEXED)
return false;
EVT LoadedVT = LD->getMemoryVT();
bool isSExtLd = LD->getExtensionType() == ISD::SEXTLOAD;
SDValue Offset;
bool isPre = (AM == ISD::PRE_INC) || (AM == ISD::PRE_DEC);
unsigned Opcode = 0;
bool Match = false;
if (SelectT2AddrModeImm8Offset(N, LD->getOffset(), Offset)) {
switch (LoadedVT.getSimpleVT().SimpleTy) {
case MVT::i32:
Opcode = isPre ? ARM::t2LDR_PRE : ARM::t2LDR_POST;
break;
case MVT::i16:
if (isSExtLd)
Opcode = isPre ? ARM::t2LDRSH_PRE : ARM::t2LDRSH_POST;
else
Opcode = isPre ? ARM::t2LDRH_PRE : ARM::t2LDRH_POST;
break;
case MVT::i8:
case MVT::i1:
if (isSExtLd)
Opcode = isPre ? ARM::t2LDRSB_PRE : ARM::t2LDRSB_POST;
else
Opcode = isPre ? ARM::t2LDRB_PRE : ARM::t2LDRB_POST;
break;
default:
return false;
}
Match = true;
}
if (Match) {
SDValue Chain = LD->getChain();
SDValue Base = LD->getBasePtr();
SDValue Ops[]= { Base, Offset, getAL(CurDAG, SDLoc(N)),
CurDAG->getRegister(0, MVT::i32), Chain };
SDNode *New = CurDAG->getMachineNode(Opcode, SDLoc(N), MVT::i32, MVT::i32,
MVT::Other, Ops);
transferMemOperands(N, New);
ReplaceNode(N, New);
return true;
}
return false;
}
/// Form a GPRPair pseudo register from a pair of GPR regs.
SDNode *ARMDAGToDAGISel::createGPRPairNode(EVT VT, SDValue V0, SDValue V1) {
SDLoc dl(V0.getNode());
SDValue RegClass =
CurDAG->getTargetConstant(ARM::GPRPairRegClassID, dl, MVT::i32);
SDValue SubReg0 = CurDAG->getTargetConstant(ARM::gsub_0, dl, MVT::i32);
SDValue SubReg1 = CurDAG->getTargetConstant(ARM::gsub_1, dl, MVT::i32);
const SDValue Ops[] = { RegClass, V0, SubReg0, V1, SubReg1 };
return CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, dl, VT, Ops);
}
/// Form a D register from a pair of S registers.
SDNode *ARMDAGToDAGISel::createSRegPairNode(EVT VT, SDValue V0, SDValue V1) {
SDLoc dl(V0.getNode());
SDValue RegClass =
CurDAG->getTargetConstant(ARM::DPR_VFP2RegClassID, dl, MVT::i32);
SDValue SubReg0 = CurDAG->getTargetConstant(ARM::ssub_0, dl, MVT::i32);
SDValue SubReg1 = CurDAG->getTargetConstant(ARM::ssub_1, dl, MVT::i32);
const SDValue Ops[] = { RegClass, V0, SubReg0, V1, SubReg1 };
return CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, dl, VT, Ops);
}
/// Form a quad register from a pair of D registers.
SDNode *ARMDAGToDAGISel::createDRegPairNode(EVT VT, SDValue V0, SDValue V1) {
SDLoc dl(V0.getNode());
SDValue RegClass = CurDAG->getTargetConstant(ARM::QPRRegClassID, dl,
MVT::i32);
SDValue SubReg0 = CurDAG->getTargetConstant(ARM::dsub_0, dl, MVT::i32);
SDValue SubReg1 = CurDAG->getTargetConstant(ARM::dsub_1, dl, MVT::i32);
const SDValue Ops[] = { RegClass, V0, SubReg0, V1, SubReg1 };
return CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, dl, VT, Ops);
}
/// Form 4 consecutive D registers from a pair of Q registers.
SDNode *ARMDAGToDAGISel::createQRegPairNode(EVT VT, SDValue V0, SDValue V1) {
SDLoc dl(V0.getNode());
SDValue RegClass = CurDAG->getTargetConstant(ARM::QQPRRegClassID, dl,
MVT::i32);
SDValue SubReg0 = CurDAG->getTargetConstant(ARM::qsub_0, dl, MVT::i32);
SDValue SubReg1 = CurDAG->getTargetConstant(ARM::qsub_1, dl, MVT::i32);
const SDValue Ops[] = { RegClass, V0, SubReg0, V1, SubReg1 };
return CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, dl, VT, Ops);
}
/// Form 4 consecutive S registers.
SDNode *ARMDAGToDAGISel::createQuadSRegsNode(EVT VT, SDValue V0, SDValue V1,
SDValue V2, SDValue V3) {
SDLoc dl(V0.getNode());
SDValue RegClass =
CurDAG->getTargetConstant(ARM::QPR_VFP2RegClassID, dl, MVT::i32);
SDValue SubReg0 = CurDAG->getTargetConstant(ARM::ssub_0, dl, MVT::i32);
SDValue SubReg1 = CurDAG->getTargetConstant(ARM::ssub_1, dl, MVT::i32);
SDValue SubReg2 = CurDAG->getTargetConstant(ARM::ssub_2, dl, MVT::i32);
SDValue SubReg3 = CurDAG->getTargetConstant(ARM::ssub_3, dl, MVT::i32);
const SDValue Ops[] = { RegClass, V0, SubReg0, V1, SubReg1,
V2, SubReg2, V3, SubReg3 };
return CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, dl, VT, Ops);
}
/// Form 4 consecutive D registers.
SDNode *ARMDAGToDAGISel::createQuadDRegsNode(EVT VT, SDValue V0, SDValue V1,
SDValue V2, SDValue V3) {
SDLoc dl(V0.getNode());
SDValue RegClass = CurDAG->getTargetConstant(ARM::QQPRRegClassID, dl,
MVT::i32);
SDValue SubReg0 = CurDAG->getTargetConstant(ARM::dsub_0, dl, MVT::i32);
SDValue SubReg1 = CurDAG->getTargetConstant(ARM::dsub_1, dl, MVT::i32);
SDValue SubReg2 = CurDAG->getTargetConstant(ARM::dsub_2, dl, MVT::i32);
SDValue SubReg3 = CurDAG->getTargetConstant(ARM::dsub_3, dl, MVT::i32);
const SDValue Ops[] = { RegClass, V0, SubReg0, V1, SubReg1,
V2, SubReg2, V3, SubReg3 };
return CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, dl, VT, Ops);
}
/// Form 4 consecutive Q registers.
SDNode *ARMDAGToDAGISel::createQuadQRegsNode(EVT VT, SDValue V0, SDValue V1,
SDValue V2, SDValue V3) {
SDLoc dl(V0.getNode());
SDValue RegClass = CurDAG->getTargetConstant(ARM::QQQQPRRegClassID, dl,
MVT::i32);
SDValue SubReg0 = CurDAG->getTargetConstant(ARM::qsub_0, dl, MVT::i32);
SDValue SubReg1 = CurDAG->getTargetConstant(ARM::qsub_1, dl, MVT::i32);
SDValue SubReg2 = CurDAG->getTargetConstant(ARM::qsub_2, dl, MVT::i32);
SDValue SubReg3 = CurDAG->getTargetConstant(ARM::qsub_3, dl, MVT::i32);
const SDValue Ops[] = { RegClass, V0, SubReg0, V1, SubReg1,
V2, SubReg2, V3, SubReg3 };
return CurDAG->getMachineNode(TargetOpcode::REG_SEQUENCE, dl, VT, Ops);
}
/// GetVLDSTAlign - Get the alignment (in bytes) for the alignment operand
/// of a NEON VLD or VST instruction. The supported values depend on the
/// number of registers being loaded.
SDValue ARMDAGToDAGISel::GetVLDSTAlign(SDValue Align, const SDLoc &dl,
unsigned NumVecs, bool is64BitVector) {
unsigned NumRegs = NumVecs;
if (!is64BitVector && NumVecs < 3)
NumRegs *= 2;
unsigned Alignment = cast<ConstantSDNode>(Align)->getZExtValue();
if (Alignment >= 32 && NumRegs == 4)
Alignment = 32;
else if (Alignment >= 16 && (NumRegs == 2 || NumRegs == 4))
Alignment = 16;
else if (Alignment >= 8)
Alignment = 8;
else
Alignment = 0;
return CurDAG->getTargetConstant(Alignment, dl, MVT::i32);
}
static bool isVLDfixed(unsigned Opc)
{
switch (Opc) {
default: return false;
case ARM::VLD1d8wb_fixed : return true;
case ARM::VLD1d16wb_fixed : return true;
case ARM::VLD1d64Qwb_fixed : return true;
case ARM::VLD1d32wb_fixed : return true;
case ARM::VLD1d64wb_fixed : return true;
case ARM::VLD1d64TPseudoWB_fixed : return true;
case ARM::VLD1d64QPseudoWB_fixed : return true;
case ARM::VLD1q8wb_fixed : return true;
case ARM::VLD1q16wb_fixed : return true;
case ARM::VLD1q32wb_fixed : return true;
case ARM::VLD1q64wb_fixed : return true;
case ARM::VLD1DUPd8wb_fixed : return true;
case ARM::VLD1DUPd16wb_fixed : return true;
case ARM::VLD1DUPd32wb_fixed : return true;
case ARM::VLD1DUPq8wb_fixed : return true;
case ARM::VLD1DUPq16wb_fixed : return true;
case ARM::VLD1DUPq32wb_fixed : return true;
case ARM::VLD2d8wb_fixed : return true;
case ARM::VLD2d16wb_fixed : return true;
case ARM::VLD2d32wb_fixed : return true;
case ARM::VLD2q8PseudoWB_fixed : return true;
case ARM::VLD2q16PseudoWB_fixed : return true;
case ARM::VLD2q32PseudoWB_fixed : return true;
case ARM::VLD2DUPd8wb_fixed : return true;
case ARM::VLD2DUPd16wb_fixed : return true;
case ARM::VLD2DUPd32wb_fixed : return true;
}
}
static bool isVSTfixed(unsigned Opc)
{
switch (Opc) {
default: return false;
case ARM::VST1d8wb_fixed : return true;
case ARM::VST1d16wb_fixed : return true;
case ARM::VST1d32wb_fixed : return true;
case ARM::VST1d64wb_fixed : return true;
case ARM::VST1q8wb_fixed : return true;
case ARM::VST1q16wb_fixed : return true;
case ARM::VST1q32wb_fixed : return true;
case ARM::VST1q64wb_fixed : return true;
case ARM::VST1d64TPseudoWB_fixed : return true;
case ARM::VST1d64QPseudoWB_fixed : return true;
case ARM::VST2d8wb_fixed : return true;
case ARM::VST2d16wb_fixed : return true;
case ARM::VST2d32wb_fixed : return true;
case ARM::VST2q8PseudoWB_fixed : return true;
case ARM::VST2q16PseudoWB_fixed : return true;
case ARM::VST2q32PseudoWB_fixed : return true;
}
}
// Get the register stride update opcode of a VLD/VST instruction that
// is otherwise equivalent to the given fixed stride updating instruction.
static unsigned getVLDSTRegisterUpdateOpcode(unsigned Opc) {
assert((isVLDfixed(Opc) || isVSTfixed(Opc))
&& "Incorrect fixed stride updating instruction.");
switch (Opc) {
default: break;
case ARM::VLD1d8wb_fixed: return ARM::VLD1d8wb_register;
case ARM::VLD1d16wb_fixed: return ARM::VLD1d16wb_register;
case ARM::VLD1d32wb_fixed: return ARM::VLD1d32wb_register;
case ARM::VLD1d64wb_fixed: return ARM::VLD1d64wb_register;
case ARM::VLD1q8wb_fixed: return ARM::VLD1q8wb_register;
case ARM::VLD1q16wb_fixed: return ARM::VLD1q16wb_register;
case ARM::VLD1q32wb_fixed: return ARM::VLD1q32wb_register;
case ARM::VLD1q64wb_fixed: return ARM::VLD1q64wb_register;
case ARM::VLD1d64Twb_fixed: return ARM::VLD1d64Twb_register;
case ARM::VLD1d64Qwb_fixed: return ARM::VLD1d64Qwb_register;
case ARM::VLD1d64TPseudoWB_fixed: return ARM::VLD1d64TPseudoWB_register;
case ARM::VLD1d64QPseudoWB_fixed: return ARM::VLD1d64QPseudoWB_register;
case ARM::VLD1DUPd8wb_fixed : return ARM::VLD1DUPd8wb_register;
case ARM::VLD1DUPd16wb_fixed : return ARM::VLD1DUPd16wb_register;
case ARM::VLD1DUPd32wb_fixed : return ARM::VLD1DUPd32wb_register;
case ARM::VLD1DUPq8wb_fixed : return ARM::VLD1DUPq8wb_register;
case ARM::VLD1DUPq16wb_fixed : return ARM::VLD1DUPq16wb_register;
case ARM::VLD1DUPq32wb_fixed : return ARM::VLD1DUPq32wb_register;
case ARM::VST1d8wb_fixed: return ARM::VST1d8wb_register;
case ARM::VST1d16wb_fixed: return ARM::VST1d16wb_register;
case ARM::VST1d32wb_fixed: return ARM::VST1d32wb_register;
case ARM::VST1d64wb_fixed: return ARM::VST1d64wb_register;
case ARM::VST1q8wb_fixed: return ARM::VST1q8wb_register;
case ARM::VST1q16wb_fixed: return ARM::VST1q16wb_register;
case ARM::VST1q32wb_fixed: return ARM::VST1q32wb_register;
case ARM::VST1q64wb_fixed: return ARM::VST1q64wb_register;
case ARM::VST1d64TPseudoWB_fixed: return ARM::VST1d64TPseudoWB_register;
case ARM::VST1d64QPseudoWB_fixed: return ARM::VST1d64QPseudoWB_register;
case ARM::VLD2d8wb_fixed: return ARM::VLD2d8wb_register;
case ARM::VLD2d16wb_fixed: return ARM::VLD2d16wb_register;
case ARM::VLD2d32wb_fixed: return ARM::VLD2d32wb_register;
case ARM::VLD2q8PseudoWB_fixed: return ARM::VLD2q8PseudoWB_register;
case ARM::VLD2q16PseudoWB_fixed: return ARM::VLD2q16PseudoWB_register;
case ARM::VLD2q32PseudoWB_fixed: return ARM::VLD2q32PseudoWB_register;
case ARM::VST2d8wb_fixed: return ARM::VST2d8wb_register;
case ARM::VST2d16wb_fixed: return ARM::VST2d16wb_register;
case ARM::VST2d32wb_fixed: return ARM::VST2d32wb_register;
case ARM::VST2q8PseudoWB_fixed: return ARM::VST2q8PseudoWB_register;
case ARM::VST2q16PseudoWB_fixed: return ARM::VST2q16PseudoWB_register;
case ARM::VST2q32PseudoWB_fixed: return ARM::VST2q32PseudoWB_register;
case ARM::VLD2DUPd8wb_fixed: return ARM::VLD2DUPd8wb_register;
case ARM::VLD2DUPd16wb_fixed: return ARM::VLD2DUPd16wb_register;
case ARM::VLD2DUPd32wb_fixed: return ARM::VLD2DUPd32wb_register;
}
return Opc; // If not one we handle, return it unchanged.
}
/// Returns true if the given increment is a Constant known to be equal to the
/// access size performed by a NEON load/store. This means the "[rN]!" form can
/// be used.
static bool isPerfectIncrement(SDValue Inc, EVT VecTy, unsigned NumVecs) {
auto C = dyn_cast<ConstantSDNode>(Inc);
return C && C->getZExtValue() == VecTy.getSizeInBits() / 8 * NumVecs;
}
void ARMDAGToDAGISel::SelectVLD(SDNode *N, bool isUpdating, unsigned NumVecs,
const uint16_t *DOpcodes,
const uint16_t *QOpcodes0,
const uint16_t *QOpcodes1) {
assert(NumVecs >= 1 && NumVecs <= 4 && "VLD NumVecs out-of-range");
SDLoc dl(N);
SDValue MemAddr, Align;
bool IsIntrinsic = !isUpdating; // By coincidence, all supported updating
// nodes are not intrinsics.
unsigned AddrOpIdx = IsIntrinsic ? 2 : 1;
if (!SelectAddrMode6(N, N->getOperand(AddrOpIdx), MemAddr, Align))
return;
SDValue Chain = N->getOperand(0);
EVT VT = N->getValueType(0);
bool is64BitVector = VT.is64BitVector();
Align = GetVLDSTAlign(Align, dl, NumVecs, is64BitVector);
unsigned OpcodeIndex;
switch (VT.getSimpleVT().SimpleTy) {
default: llvm_unreachable("unhandled vld type");
// Double-register operations:
case MVT::v8i8: OpcodeIndex = 0; break;
case MVT::v4f16:
case MVT::v4i16: OpcodeIndex = 1; break;
case MVT::v2f32:
case MVT::v2i32: OpcodeIndex = 2; break;
case MVT::v1i64: OpcodeIndex = 3; break;
// Quad-register operations:
case MVT::v16i8: OpcodeIndex = 0; break;
case MVT::v8f16:
case MVT::v8i16: OpcodeIndex = 1; break;
case MVT::v4f32:
case MVT::v4i32: OpcodeIndex = 2; break;
case MVT::v2f64:
case MVT::v2i64: OpcodeIndex = 3; break;
}
EVT ResTy;
if (NumVecs == 1)
ResTy = VT;
else {
unsigned ResTyElts = (NumVecs == 3) ? 4 : NumVecs;
if (!is64BitVector)
ResTyElts *= 2;
ResTy = EVT::getVectorVT(*CurDAG->getContext(), MVT::i64, ResTyElts);
}
std::vector<EVT> ResTys;
ResTys.push_back(ResTy);
if (isUpdating)
ResTys.push_back(MVT::i32);
ResTys.push_back(MVT::Other);
SDValue Pred = getAL(CurDAG, dl);
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
SDNode *VLd;
SmallVector<SDValue, 7> Ops;
// Double registers and VLD1/VLD2 quad registers are directly supported.
if (is64BitVector || NumVecs <= 2) {
unsigned Opc = (is64BitVector ? DOpcodes[OpcodeIndex] :
QOpcodes0[OpcodeIndex]);
Ops.push_back(MemAddr);
Ops.push_back(Align);
if (isUpdating) {
SDValue Inc = N->getOperand(AddrOpIdx + 1);
bool IsImmUpdate = isPerfectIncrement(Inc, VT, NumVecs);
if (!IsImmUpdate) {
// We use a VLD1 for v1i64 even if the pseudo says vld2/3/4, so
// check for the opcode rather than the number of vector elements.
if (isVLDfixed(Opc))
Opc = getVLDSTRegisterUpdateOpcode(Opc);
Ops.push_back(Inc);
// VLD1/VLD2 fixed increment does not need Reg0 so only include it in
// the operands if not such an opcode.
} else if (!isVLDfixed(Opc))
Ops.push_back(Reg0);
}
Ops.push_back(Pred);
Ops.push_back(Reg0);
Ops.push_back(Chain);
VLd = CurDAG->getMachineNode(Opc, dl, ResTys, Ops);
} else {
// Otherwise, quad registers are loaded with two separate instructions,
// where one loads the even registers and the other loads the odd registers.
EVT AddrTy = MemAddr.getValueType();
// Load the even subregs. This is always an updating load, so that it
// provides the address to the second load for the odd subregs.
SDValue ImplDef =
SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, ResTy), 0);
const SDValue OpsA[] = { MemAddr, Align, Reg0, ImplDef, Pred, Reg0, Chain };
SDNode *VLdA = CurDAG->getMachineNode(QOpcodes0[OpcodeIndex], dl,
ResTy, AddrTy, MVT::Other, OpsA);
Chain = SDValue(VLdA, 2);
// Load the odd subregs.
Ops.push_back(SDValue(VLdA, 1));
Ops.push_back(Align);
if (isUpdating) {
SDValue Inc = N->getOperand(AddrOpIdx + 1);
assert(isa<ConstantSDNode>(Inc.getNode()) &&
"only constant post-increment update allowed for VLD3/4");
(void)Inc;
Ops.push_back(Reg0);
}
Ops.push_back(SDValue(VLdA, 0));
Ops.push_back(Pred);
Ops.push_back(Reg0);
Ops.push_back(Chain);
VLd = CurDAG->getMachineNode(QOpcodes1[OpcodeIndex], dl, ResTys, Ops);
}
// Transfer memoperands.
MachineMemOperand *MemOp = cast<MemIntrinsicSDNode>(N)->getMemOperand();
CurDAG->setNodeMemRefs(cast<MachineSDNode>(VLd), {MemOp});
if (NumVecs == 1) {
ReplaceNode(N, VLd);
return;
}
// Extract out the subregisters.
SDValue SuperReg = SDValue(VLd, 0);
static_assert(ARM::dsub_7 == ARM::dsub_0 + 7 &&
ARM::qsub_3 == ARM::qsub_0 + 3,
"Unexpected subreg numbering");
unsigned Sub0 = (is64BitVector ? ARM::dsub_0 : ARM::qsub_0);
for (unsigned Vec = 0; Vec < NumVecs; ++Vec)
ReplaceUses(SDValue(N, Vec),
CurDAG->getTargetExtractSubreg(Sub0 + Vec, dl, VT, SuperReg));
ReplaceUses(SDValue(N, NumVecs), SDValue(VLd, 1));
if (isUpdating)
ReplaceUses(SDValue(N, NumVecs + 1), SDValue(VLd, 2));
CurDAG->RemoveDeadNode(N);
}
void ARMDAGToDAGISel::SelectVST(SDNode *N, bool isUpdating, unsigned NumVecs,
const uint16_t *DOpcodes,
const uint16_t *QOpcodes0,
const uint16_t *QOpcodes1) {
assert(NumVecs >= 1 && NumVecs <= 4 && "VST NumVecs out-of-range");
SDLoc dl(N);
SDValue MemAddr, Align;
bool IsIntrinsic = !isUpdating; // By coincidence, all supported updating
// nodes are not intrinsics.
unsigned AddrOpIdx = IsIntrinsic ? 2 : 1;
unsigned Vec0Idx = 3; // AddrOpIdx + (isUpdating ? 2 : 1)
if (!SelectAddrMode6(N, N->getOperand(AddrOpIdx), MemAddr, Align))
return;
MachineMemOperand *MemOp = cast<MemIntrinsicSDNode>(N)->getMemOperand();
SDValue Chain = N->getOperand(0);
EVT VT = N->getOperand(Vec0Idx).getValueType();
bool is64BitVector = VT.is64BitVector();
Align = GetVLDSTAlign(Align, dl, NumVecs, is64BitVector);
unsigned OpcodeIndex;
switch (VT.getSimpleVT().SimpleTy) {
default: llvm_unreachable("unhandled vst type");
// Double-register operations:
case MVT::v8i8: OpcodeIndex = 0; break;
case MVT::v4f16:
case MVT::v4i16: OpcodeIndex = 1; break;
case MVT::v2f32:
case MVT::v2i32: OpcodeIndex = 2; break;
case MVT::v1i64: OpcodeIndex = 3; break;
// Quad-register operations:
case MVT::v16i8: OpcodeIndex = 0; break;
case MVT::v8f16:
case MVT::v8i16: OpcodeIndex = 1; break;
case MVT::v4f32:
case MVT::v4i32: OpcodeIndex = 2; break;
case MVT::v2f64:
case MVT::v2i64: OpcodeIndex = 3; break;
}
std::vector<EVT> ResTys;
if (isUpdating)
ResTys.push_back(MVT::i32);
ResTys.push_back(MVT::Other);
SDValue Pred = getAL(CurDAG, dl);
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
SmallVector<SDValue, 7> Ops;
// Double registers and VST1/VST2 quad registers are directly supported.
if (is64BitVector || NumVecs <= 2) {
SDValue SrcReg;
if (NumVecs == 1) {
SrcReg = N->getOperand(Vec0Idx);
} else if (is64BitVector) {
// Form a REG_SEQUENCE to force register allocation.
SDValue V0 = N->getOperand(Vec0Idx + 0);
SDValue V1 = N->getOperand(Vec0Idx + 1);
if (NumVecs == 2)
SrcReg = SDValue(createDRegPairNode(MVT::v2i64, V0, V1), 0);
else {
SDValue V2 = N->getOperand(Vec0Idx + 2);
// If it's a vst3, form a quad D-register and leave the last part as
// an undef.
SDValue V3 = (NumVecs == 3)
? SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF,dl,VT), 0)
: N->getOperand(Vec0Idx + 3);
SrcReg = SDValue(createQuadDRegsNode(MVT::v4i64, V0, V1, V2, V3), 0);
}
} else {
// Form a QQ register.
SDValue Q0 = N->getOperand(Vec0Idx);
SDValue Q1 = N->getOperand(Vec0Idx + 1);
SrcReg = SDValue(createQRegPairNode(MVT::v4i64, Q0, Q1), 0);
}
unsigned Opc = (is64BitVector ? DOpcodes[OpcodeIndex] :
QOpcodes0[OpcodeIndex]);
Ops.push_back(MemAddr);
Ops.push_back(Align);
if (isUpdating) {
SDValue Inc = N->getOperand(AddrOpIdx + 1);
bool IsImmUpdate = isPerfectIncrement(Inc, VT, NumVecs);
if (!IsImmUpdate) {
// We use a VST1 for v1i64 even if the pseudo says VST2/3/4, so
// check for the opcode rather than the number of vector elements.
if (isVSTfixed(Opc))
Opc = getVLDSTRegisterUpdateOpcode(Opc);
Ops.push_back(Inc);
}
// VST1/VST2 fixed increment does not need Reg0 so only include it in
// the operands if not such an opcode.
else if (!isVSTfixed(Opc))
Ops.push_back(Reg0);
}
Ops.push_back(SrcReg);
Ops.push_back(Pred);
Ops.push_back(Reg0);
Ops.push_back(Chain);
SDNode *VSt = CurDAG->getMachineNode(Opc, dl, ResTys, Ops);
// Transfer memoperands.
CurDAG->setNodeMemRefs(cast<MachineSDNode>(VSt), {MemOp});
ReplaceNode(N, VSt);
return;
}
// Otherwise, quad registers are stored with two separate instructions,
// where one stores the even registers and the other stores the odd registers.
// Form the QQQQ REG_SEQUENCE.
SDValue V0 = N->getOperand(Vec0Idx + 0);
SDValue V1 = N->getOperand(Vec0Idx + 1);
SDValue V2 = N->getOperand(Vec0Idx + 2);
SDValue V3 = (NumVecs == 3)
? SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, VT), 0)
: N->getOperand(Vec0Idx + 3);
SDValue RegSeq = SDValue(createQuadQRegsNode(MVT::v8i64, V0, V1, V2, V3), 0);
// Store the even D registers. This is always an updating store, so that it
// provides the address to the second store for the odd subregs.
const SDValue OpsA[] = { MemAddr, Align, Reg0, RegSeq, Pred, Reg0, Chain };
SDNode *VStA = CurDAG->getMachineNode(QOpcodes0[OpcodeIndex], dl,
MemAddr.getValueType(),
MVT::Other, OpsA);
CurDAG->setNodeMemRefs(cast<MachineSDNode>(VStA), {MemOp});
Chain = SDValue(VStA, 1);
// Store the odd D registers.
Ops.push_back(SDValue(VStA, 0));
Ops.push_back(Align);
if (isUpdating) {
SDValue Inc = N->getOperand(AddrOpIdx + 1);
assert(isa<ConstantSDNode>(Inc.getNode()) &&
"only constant post-increment update allowed for VST3/4");
(void)Inc;
Ops.push_back(Reg0);
}
Ops.push_back(RegSeq);
Ops.push_back(Pred);
Ops.push_back(Reg0);
Ops.push_back(Chain);
SDNode *VStB = CurDAG->getMachineNode(QOpcodes1[OpcodeIndex], dl, ResTys,
Ops);
CurDAG->setNodeMemRefs(cast<MachineSDNode>(VStB), {MemOp});
ReplaceNode(N, VStB);
}
void ARMDAGToDAGISel::SelectVLDSTLane(SDNode *N, bool IsLoad, bool isUpdating,
unsigned NumVecs,
const uint16_t *DOpcodes,
const uint16_t *QOpcodes) {
assert(NumVecs >=2 && NumVecs <= 4 && "VLDSTLane NumVecs out-of-range");
SDLoc dl(N);
SDValue MemAddr, Align;
bool IsIntrinsic = !isUpdating; // By coincidence, all supported updating
// nodes are not intrinsics.
unsigned AddrOpIdx = IsIntrinsic ? 2 : 1;
unsigned Vec0Idx = 3; // AddrOpIdx + (isUpdating ? 2 : 1)
if (!SelectAddrMode6(N, N->getOperand(AddrOpIdx), MemAddr, Align))
return;
MachineMemOperand *MemOp = cast<MemIntrinsicSDNode>(N)->getMemOperand();
SDValue Chain = N->getOperand(0);
unsigned Lane =
cast<ConstantSDNode>(N->getOperand(Vec0Idx + NumVecs))->getZExtValue();
EVT VT = N->getOperand(Vec0Idx).getValueType();
bool is64BitVector = VT.is64BitVector();
unsigned Alignment = 0;
if (NumVecs != 3) {
Alignment = cast<ConstantSDNode>(Align)->getZExtValue();
unsigned NumBytes = NumVecs * VT.getScalarSizeInBits() / 8;
if (Alignment > NumBytes)
Alignment = NumBytes;
if (Alignment < 8 && Alignment < NumBytes)
Alignment = 0;
// Alignment must be a power of two; make sure of that.
Alignment = (Alignment & -Alignment);
if (Alignment == 1)
Alignment = 0;
}
Align = CurDAG->getTargetConstant(Alignment, dl, MVT::i32);
unsigned OpcodeIndex;
switch (VT.getSimpleVT().SimpleTy) {
default: llvm_unreachable("unhandled vld/vst lane type");
// Double-register operations:
case MVT::v8i8: OpcodeIndex = 0; break;
case MVT::v4f16:
case MVT::v4i16: OpcodeIndex = 1; break;
case MVT::v2f32:
case MVT::v2i32: OpcodeIndex = 2; break;
// Quad-register operations:
case MVT::v8f16:
case MVT::v8i16: OpcodeIndex = 0; break;
case MVT::v4f32:
case MVT::v4i32: OpcodeIndex = 1; break;
}
std::vector<EVT> ResTys;
if (IsLoad) {
unsigned ResTyElts = (NumVecs == 3) ? 4 : NumVecs;
if (!is64BitVector)
ResTyElts *= 2;
ResTys.push_back(EVT::getVectorVT(*CurDAG->getContext(),
MVT::i64, ResTyElts));
}
if (isUpdating)
ResTys.push_back(MVT::i32);
ResTys.push_back(MVT::Other);
SDValue Pred = getAL(CurDAG, dl);
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
SmallVector<SDValue, 8> Ops;
Ops.push_back(MemAddr);
Ops.push_back(Align);
if (isUpdating) {
SDValue Inc = N->getOperand(AddrOpIdx + 1);
bool IsImmUpdate =
isPerfectIncrement(Inc, VT.getVectorElementType(), NumVecs);
Ops.push_back(IsImmUpdate ? Reg0 : Inc);
}
SDValue SuperReg;
SDValue V0 = N->getOperand(Vec0Idx + 0);
SDValue V1 = N->getOperand(Vec0Idx + 1);
if (NumVecs == 2) {
if (is64BitVector)
SuperReg = SDValue(createDRegPairNode(MVT::v2i64, V0, V1), 0);
else
SuperReg = SDValue(createQRegPairNode(MVT::v4i64, V0, V1), 0);
} else {
SDValue V2 = N->getOperand(Vec0Idx + 2);
SDValue V3 = (NumVecs == 3)
? SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, VT), 0)
: N->getOperand(Vec0Idx + 3);
if (is64BitVector)
SuperReg = SDValue(createQuadDRegsNode(MVT::v4i64, V0, V1, V2, V3), 0);
else
SuperReg = SDValue(createQuadQRegsNode(MVT::v8i64, V0, V1, V2, V3), 0);
}
Ops.push_back(SuperReg);
Ops.push_back(getI32Imm(Lane, dl));
Ops.push_back(Pred);
Ops.push_back(Reg0);
Ops.push_back(Chain);
unsigned Opc = (is64BitVector ? DOpcodes[OpcodeIndex] :
QOpcodes[OpcodeIndex]);
SDNode *VLdLn = CurDAG->getMachineNode(Opc, dl, ResTys, Ops);
CurDAG->setNodeMemRefs(cast<MachineSDNode>(VLdLn), {MemOp});
if (!IsLoad) {
ReplaceNode(N, VLdLn);
return;
}
// Extract the subregisters.
SuperReg = SDValue(VLdLn, 0);
static_assert(ARM::dsub_7 == ARM::dsub_0 + 7 &&
ARM::qsub_3 == ARM::qsub_0 + 3,
"Unexpected subreg numbering");
unsigned Sub0 = is64BitVector ? ARM::dsub_0 : ARM::qsub_0;
for (unsigned Vec = 0; Vec < NumVecs; ++Vec)
ReplaceUses(SDValue(N, Vec),
CurDAG->getTargetExtractSubreg(Sub0 + Vec, dl, VT, SuperReg));
ReplaceUses(SDValue(N, NumVecs), SDValue(VLdLn, 1));
if (isUpdating)
ReplaceUses(SDValue(N, NumVecs + 1), SDValue(VLdLn, 2));
CurDAG->RemoveDeadNode(N);
}
void ARMDAGToDAGISel::SelectVLDDup(SDNode *N, bool IsIntrinsic,
bool isUpdating, unsigned NumVecs,
const uint16_t *DOpcodes,
const uint16_t *QOpcodes0,
const uint16_t *QOpcodes1) {
assert(NumVecs >= 1 && NumVecs <= 4 && "VLDDup NumVecs out-of-range");
SDLoc dl(N);
SDValue MemAddr, Align;
unsigned AddrOpIdx = IsIntrinsic ? 2 : 1;
if (!SelectAddrMode6(N, N->getOperand(AddrOpIdx), MemAddr, Align))
return;
SDValue Chain = N->getOperand(0);
EVT VT = N->getValueType(0);
bool is64BitVector = VT.is64BitVector();
unsigned Alignment = 0;
if (NumVecs != 3) {
Alignment = cast<ConstantSDNode>(Align)->getZExtValue();
unsigned NumBytes = NumVecs * VT.getScalarSizeInBits() / 8;
if (Alignment > NumBytes)
Alignment = NumBytes;
if (Alignment < 8 && Alignment < NumBytes)
Alignment = 0;
// Alignment must be a power of two; make sure of that.
Alignment = (Alignment & -Alignment);
if (Alignment == 1)
Alignment = 0;
}
Align = CurDAG->getTargetConstant(Alignment, dl, MVT::i32);
unsigned OpcodeIndex;
switch (VT.getSimpleVT().SimpleTy) {
default: llvm_unreachable("unhandled vld-dup type");
case MVT::v8i8:
case MVT::v16i8: OpcodeIndex = 0; break;
case MVT::v4i16:
case MVT::v8i16:
case MVT::v4f16:
case MVT::v8f16:
OpcodeIndex = 1; break;
case MVT::v2f32:
case MVT::v2i32:
case MVT::v4f32:
case MVT::v4i32: OpcodeIndex = 2; break;
case MVT::v1f64:
case MVT::v1i64: OpcodeIndex = 3; break;
}
unsigned ResTyElts = (NumVecs == 3) ? 4 : NumVecs;
if (!is64BitVector)
ResTyElts *= 2;
EVT ResTy = EVT::getVectorVT(*CurDAG->getContext(), MVT::i64, ResTyElts);
std::vector<EVT> ResTys;
ResTys.push_back(ResTy);
if (isUpdating)
ResTys.push_back(MVT::i32);
ResTys.push_back(MVT::Other);
SDValue Pred = getAL(CurDAG, dl);
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
SDNode *VLdDup;
if (is64BitVector || NumVecs == 1) {
SmallVector<SDValue, 6> Ops;
Ops.push_back(MemAddr);
Ops.push_back(Align);
unsigned Opc = is64BitVector ? DOpcodes[OpcodeIndex] :
QOpcodes0[OpcodeIndex];
if (isUpdating) {
// fixed-stride update instructions don't have an explicit writeback
// operand. It's implicit in the opcode itself.
SDValue Inc = N->getOperand(2);
bool IsImmUpdate =
isPerfectIncrement(Inc, VT.getVectorElementType(), NumVecs);
if (NumVecs <= 2 && !IsImmUpdate)
Opc = getVLDSTRegisterUpdateOpcode(Opc);
if (!IsImmUpdate)
Ops.push_back(Inc);
// FIXME: VLD3 and VLD4 haven't been updated to that form yet.
else if (NumVecs > 2)
Ops.push_back(Reg0);
}
Ops.push_back(Pred);
Ops.push_back(Reg0);
Ops.push_back(Chain);
VLdDup = CurDAG->getMachineNode(Opc, dl, ResTys, Ops);
} else if (NumVecs == 2) {
const SDValue OpsA[] = { MemAddr, Align, Pred, Reg0, Chain };
SDNode *VLdA = CurDAG->getMachineNode(QOpcodes0[OpcodeIndex],
dl, ResTys, OpsA);
Chain = SDValue(VLdA, 1);
const SDValue OpsB[] = { MemAddr, Align, Pred, Reg0, Chain };
VLdDup = CurDAG->getMachineNode(QOpcodes1[OpcodeIndex], dl, ResTys, OpsB);
} else {
SDValue ImplDef =
SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, ResTy), 0);
const SDValue OpsA[] = { MemAddr, Align, ImplDef, Pred, Reg0, Chain };
SDNode *VLdA = CurDAG->getMachineNode(QOpcodes0[OpcodeIndex],
dl, ResTys, OpsA);
SDValue SuperReg = SDValue(VLdA, 0);
Chain = SDValue(VLdA, 1);
const SDValue OpsB[] = { MemAddr, Align, SuperReg, Pred, Reg0, Chain };
VLdDup = CurDAG->getMachineNode(QOpcodes1[OpcodeIndex], dl, ResTys, OpsB);
}
// Transfer memoperands.
MachineMemOperand *MemOp = cast<MemIntrinsicSDNode>(N)->getMemOperand();
CurDAG->setNodeMemRefs(cast<MachineSDNode>(VLdDup), {MemOp});
// Extract the subregisters.
if (NumVecs == 1) {
ReplaceUses(SDValue(N, 0), SDValue(VLdDup, 0));
} else {
SDValue SuperReg = SDValue(VLdDup, 0);
static_assert(ARM::dsub_7 == ARM::dsub_0 + 7, "Unexpected subreg numbering");
unsigned SubIdx = is64BitVector ? ARM::dsub_0 : ARM::qsub_0;
for (unsigned Vec = 0; Vec != NumVecs; ++Vec) {
ReplaceUses(SDValue(N, Vec),
CurDAG->getTargetExtractSubreg(SubIdx+Vec, dl, VT, SuperReg));
}
}
ReplaceUses(SDValue(N, NumVecs), SDValue(VLdDup, 1));
if (isUpdating)
ReplaceUses(SDValue(N, NumVecs + 1), SDValue(VLdDup, 2));
CurDAG->RemoveDeadNode(N);
}
bool ARMDAGToDAGISel::tryV6T2BitfieldExtractOp(SDNode *N, bool isSigned) {
if (!Subtarget->hasV6T2Ops())
return false;
unsigned Opc = isSigned
? (Subtarget->isThumb() ? ARM::t2SBFX : ARM::SBFX)
: (Subtarget->isThumb() ? ARM::t2UBFX : ARM::UBFX);
SDLoc dl(N);
// For unsigned extracts, check for a shift right and mask
unsigned And_imm = 0;
if (N->getOpcode() == ISD::AND) {
if (isOpcWithIntImmediate(N, ISD::AND, And_imm)) {
// The immediate is a mask of the low bits iff imm & (imm+1) == 0
if (And_imm & (And_imm + 1))
return false;
unsigned Srl_imm = 0;
if (isOpcWithIntImmediate(N->getOperand(0).getNode(), ISD::SRL,
Srl_imm)) {
assert(Srl_imm > 0 && Srl_imm < 32 && "bad amount in shift node!");
// Mask off the unnecessary bits of the AND immediate; normally
// DAGCombine will do this, but that might not happen if
// targetShrinkDemandedConstant chooses a different immediate.
And_imm &= -1U >> Srl_imm;
// Note: The width operand is encoded as width-1.
unsigned Width = countTrailingOnes(And_imm) - 1;
unsigned LSB = Srl_imm;
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
if ((LSB + Width + 1) == N->getValueType(0).getSizeInBits()) {
// It's cheaper to use a right shift to extract the top bits.
if (Subtarget->isThumb()) {
Opc = isSigned ? ARM::t2ASRri : ARM::t2LSRri;
SDValue Ops[] = { N->getOperand(0).getOperand(0),
CurDAG->getTargetConstant(LSB, dl, MVT::i32),
getAL(CurDAG, dl), Reg0, Reg0 };
CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
return true;
}
// ARM models shift instructions as MOVsi with shifter operand.
ARM_AM::ShiftOpc ShOpcVal = ARM_AM::getShiftOpcForNode(ISD::SRL);
SDValue ShOpc =
CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ShOpcVal, LSB), dl,
MVT::i32);
SDValue Ops[] = { N->getOperand(0).getOperand(0), ShOpc,
getAL(CurDAG, dl), Reg0, Reg0 };
CurDAG->SelectNodeTo(N, ARM::MOVsi, MVT::i32, Ops);
return true;
}
assert(LSB + Width + 1 <= 32 && "Shouldn't create an invalid ubfx");
SDValue Ops[] = { N->getOperand(0).getOperand(0),
CurDAG->getTargetConstant(LSB, dl, MVT::i32),
CurDAG->getTargetConstant(Width, dl, MVT::i32),
getAL(CurDAG, dl), Reg0 };
CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
return true;
}
}
return false;
}
// Otherwise, we're looking for a shift of a shift
unsigned Shl_imm = 0;
if (isOpcWithIntImmediate(N->getOperand(0).getNode(), ISD::SHL, Shl_imm)) {
assert(Shl_imm > 0 && Shl_imm < 32 && "bad amount in shift node!");
unsigned Srl_imm = 0;
if (isInt32Immediate(N->getOperand(1), Srl_imm)) {
assert(Srl_imm > 0 && Srl_imm < 32 && "bad amount in shift node!");
// Note: The width operand is encoded as width-1.
unsigned Width = 32 - Srl_imm - 1;
int LSB = Srl_imm - Shl_imm;
if (LSB < 0)
return false;
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
assert(LSB + Width + 1 <= 32 && "Shouldn't create an invalid ubfx");
SDValue Ops[] = { N->getOperand(0).getOperand(0),
CurDAG->getTargetConstant(LSB, dl, MVT::i32),
CurDAG->getTargetConstant(Width, dl, MVT::i32),
getAL(CurDAG, dl), Reg0 };
CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
return true;
}
}
// Or we are looking for a shift of an and, with a mask operand
if (isOpcWithIntImmediate(N->getOperand(0).getNode(), ISD::AND, And_imm) &&
isShiftedMask_32(And_imm)) {
unsigned Srl_imm = 0;
unsigned LSB = countTrailingZeros(And_imm);
// Shift must be the same as the ands lsb
if (isInt32Immediate(N->getOperand(1), Srl_imm) && Srl_imm == LSB) {
assert(Srl_imm > 0 && Srl_imm < 32 && "bad amount in shift node!");
unsigned MSB = 31 - countLeadingZeros(And_imm);
// Note: The width operand is encoded as width-1.
unsigned Width = MSB - LSB;
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
assert(Srl_imm + Width + 1 <= 32 && "Shouldn't create an invalid ubfx");
SDValue Ops[] = { N->getOperand(0).getOperand(0),
CurDAG->getTargetConstant(Srl_imm, dl, MVT::i32),
CurDAG->getTargetConstant(Width, dl, MVT::i32),
getAL(CurDAG, dl), Reg0 };
CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
return true;
}
}
if (N->getOpcode() == ISD::SIGN_EXTEND_INREG) {
unsigned Width = cast<VTSDNode>(N->getOperand(1))->getVT().getSizeInBits();
unsigned LSB = 0;
if (!isOpcWithIntImmediate(N->getOperand(0).getNode(), ISD::SRL, LSB) &&
!isOpcWithIntImmediate(N->getOperand(0).getNode(), ISD::SRA, LSB))
return false;
if (LSB + Width > 32)
return false;
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
assert(LSB + Width <= 32 && "Shouldn't create an invalid ubfx");
SDValue Ops[] = { N->getOperand(0).getOperand(0),
CurDAG->getTargetConstant(LSB, dl, MVT::i32),
CurDAG->getTargetConstant(Width - 1, dl, MVT::i32),
getAL(CurDAG, dl), Reg0 };
CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
return true;
}
return false;
}
/// Target-specific DAG combining for ISD::XOR.
/// Target-independent combining lowers SELECT_CC nodes of the form
/// select_cc setg[ge] X, 0, X, -X
/// select_cc setgt X, -1, X, -X
/// select_cc setl[te] X, 0, -X, X
/// select_cc setlt X, 1, -X, X
/// which represent Integer ABS into:
/// Y = sra (X, size(X)-1); xor (add (X, Y), Y)
/// ARM instruction selection detects the latter and matches it to
/// ARM::ABS or ARM::t2ABS machine node.
bool ARMDAGToDAGISel::tryABSOp(SDNode *N){
SDValue XORSrc0 = N->getOperand(0);
SDValue XORSrc1 = N->getOperand(1);
EVT VT = N->getValueType(0);
if (Subtarget->isThumb1Only())
return false;
if (XORSrc0.getOpcode() != ISD::ADD || XORSrc1.getOpcode() != ISD::SRA)
return false;
SDValue ADDSrc0 = XORSrc0.getOperand(0);
SDValue ADDSrc1 = XORSrc0.getOperand(1);
SDValue SRASrc0 = XORSrc1.getOperand(0);
SDValue SRASrc1 = XORSrc1.getOperand(1);
ConstantSDNode *SRAConstant = dyn_cast<ConstantSDNode>(SRASrc1);
EVT XType = SRASrc0.getValueType();
unsigned Size = XType.getSizeInBits() - 1;
if (ADDSrc1 == XORSrc1 && ADDSrc0 == SRASrc0 &&
XType.isInteger() && SRAConstant != nullptr &&
Size == SRAConstant->getZExtValue()) {
unsigned Opcode = Subtarget->isThumb2() ? ARM::t2ABS : ARM::ABS;
CurDAG->SelectNodeTo(N, Opcode, VT, ADDSrc0);
return true;
}
return false;
}
/// We've got special pseudo-instructions for these
void ARMDAGToDAGISel::SelectCMP_SWAP(SDNode *N) {
unsigned Opcode;
EVT MemTy = cast<MemSDNode>(N)->getMemoryVT();
if (MemTy == MVT::i8)
Opcode = ARM::CMP_SWAP_8;
else if (MemTy == MVT::i16)
Opcode = ARM::CMP_SWAP_16;
else if (MemTy == MVT::i32)
Opcode = ARM::CMP_SWAP_32;
else
llvm_unreachable("Unknown AtomicCmpSwap type");
SDValue Ops[] = {N->getOperand(1), N->getOperand(2), N->getOperand(3),
N->getOperand(0)};
SDNode *CmpSwap = CurDAG->getMachineNode(
Opcode, SDLoc(N),
CurDAG->getVTList(MVT::i32, MVT::i32, MVT::Other), Ops);
MachineMemOperand *MemOp = cast<MemSDNode>(N)->getMemOperand();
CurDAG->setNodeMemRefs(cast<MachineSDNode>(CmpSwap), {MemOp});
ReplaceUses(SDValue(N, 0), SDValue(CmpSwap, 0));
ReplaceUses(SDValue(N, 1), SDValue(CmpSwap, 2));
CurDAG->RemoveDeadNode(N);
}
static Optional<std::pair<unsigned, unsigned>>
getContiguousRangeOfSetBits(const APInt &A) {
unsigned FirstOne = A.getBitWidth() - A.countLeadingZeros() - 1;
unsigned LastOne = A.countTrailingZeros();
if (A.countPopulation() != (FirstOne - LastOne + 1))
return Optional<std::pair<unsigned,unsigned>>();
return std::make_pair(FirstOne, LastOne);
}
void ARMDAGToDAGISel::SelectCMPZ(SDNode *N, bool &SwitchEQNEToPLMI) {
assert(N->getOpcode() == ARMISD::CMPZ);
SwitchEQNEToPLMI = false;
if (!Subtarget->isThumb())
// FIXME: Work out whether it is profitable to do this in A32 mode - LSL and
// LSR don't exist as standalone instructions - they need the barrel shifter.
return;
// select (cmpz (and X, C), #0) -> (LSLS X) or (LSRS X) or (LSRS (LSLS X))
SDValue And = N->getOperand(0);
if (!And->hasOneUse())
return;
SDValue Zero = N->getOperand(1);
if (!isa<ConstantSDNode>(Zero) || !cast<ConstantSDNode>(Zero)->isNullValue() ||
And->getOpcode() != ISD::AND)
return;
SDValue X = And.getOperand(0);
auto C = dyn_cast<ConstantSDNode>(And.getOperand(1));
if (!C)
return;
auto Range = getContiguousRangeOfSetBits(C->getAPIntValue());
if (!Range)
return;
// There are several ways to lower this:
SDNode *NewN;
SDLoc dl(N);
auto EmitShift = [&](unsigned Opc, SDValue Src, unsigned Imm) -> SDNode* {
if (Subtarget->isThumb2()) {
Opc = (Opc == ARM::tLSLri) ? ARM::t2LSLri : ARM::t2LSRri;
SDValue Ops[] = { Src, CurDAG->getTargetConstant(Imm, dl, MVT::i32),
getAL(CurDAG, dl), CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
return CurDAG->getMachineNode(Opc, dl, MVT::i32, Ops);
} else {
SDValue Ops[] = {CurDAG->getRegister(ARM::CPSR, MVT::i32), Src,
CurDAG->getTargetConstant(Imm, dl, MVT::i32),
getAL(CurDAG, dl), CurDAG->getRegister(0, MVT::i32)};
return CurDAG->getMachineNode(Opc, dl, MVT::i32, Ops);
}
};
if (Range->second == 0) {
// 1. Mask includes the LSB -> Simply shift the top N bits off
NewN = EmitShift(ARM::tLSLri, X, 31 - Range->first);
ReplaceNode(And.getNode(), NewN);
} else if (Range->first == 31) {
// 2. Mask includes the MSB -> Simply shift the bottom N bits off
NewN = EmitShift(ARM::tLSRri, X, Range->second);
ReplaceNode(And.getNode(), NewN);
} else if (Range->first == Range->second) {
// 3. Only one bit is set. We can shift this into the sign bit and use a
// PL/MI comparison.
NewN = EmitShift(ARM::tLSLri, X, 31 - Range->first);
ReplaceNode(And.getNode(), NewN);
SwitchEQNEToPLMI = true;
} else if (!Subtarget->hasV6T2Ops()) {
// 4. Do a double shift to clear bottom and top bits, but only in
// thumb-1 mode as in thumb-2 we can use UBFX.
NewN = EmitShift(ARM::tLSLri, X, 31 - Range->first);
NewN = EmitShift(ARM::tLSRri, SDValue(NewN, 0),
Range->second + (31 - Range->first));
ReplaceNode(And.getNode(), NewN);
}
}
void ARMDAGToDAGISel::Select(SDNode *N) {
SDLoc dl(N);
if (N->isMachineOpcode()) {
N->setNodeId(-1);
return; // Already selected.
}
switch (N->getOpcode()) {
default: break;
case ISD::STORE: {
// For Thumb1, match an sp-relative store in C++. This is a little
// unfortunate, but I don't think I can make the chain check work
// otherwise. (The chain of the store has to be the same as the chain
// of the CopyFromReg, or else we can't replace the CopyFromReg with
// a direct reference to "SP".)
//
// This is only necessary on Thumb1 because Thumb1 sp-relative stores use
// a different addressing mode from other four-byte stores.
//
// This pattern usually comes up with call arguments.
StoreSDNode *ST = cast<StoreSDNode>(N);
SDValue Ptr = ST->getBasePtr();
if (Subtarget->isThumb1Only() && ST->isUnindexed()) {
int RHSC = 0;
if (Ptr.getOpcode() == ISD::ADD &&
isScaledConstantInRange(Ptr.getOperand(1), /*Scale=*/4, 0, 256, RHSC))
Ptr = Ptr.getOperand(0);
if (Ptr.getOpcode() == ISD::CopyFromReg &&
cast<RegisterSDNode>(Ptr.getOperand(1))->getReg() == ARM::SP &&
Ptr.getOperand(0) == ST->getChain()) {
SDValue Ops[] = {ST->getValue(),
CurDAG->getRegister(ARM::SP, MVT::i32),
CurDAG->getTargetConstant(RHSC, dl, MVT::i32),
getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32),
ST->getChain()};
MachineSDNode *ResNode =
CurDAG->getMachineNode(ARM::tSTRspi, dl, MVT::Other, Ops);
MachineMemOperand *MemOp = ST->getMemOperand();
CurDAG->setNodeMemRefs(cast<MachineSDNode>(ResNode), {MemOp});
ReplaceNode(N, ResNode);
return;
}
}
break;
}
case ISD::WRITE_REGISTER:
if (tryWriteRegister(N))
return;
break;
case ISD::READ_REGISTER:
if (tryReadRegister(N))
return;
break;
case ISD::INLINEASM:
case ISD::INLINEASM_BR:
if (tryInlineAsm(N))
return;
break;
case ISD::XOR:
// Select special operations if XOR node forms integer ABS pattern
if (tryABSOp(N))
return;
// Other cases are autogenerated.
break;
case ISD::Constant: {
unsigned Val = cast<ConstantSDNode>(N)->getZExtValue();
// If we can't materialize the constant we need to use a literal pool
if (ConstantMaterializationCost(Val) > 2) {
SDValue CPIdx = CurDAG->getTargetConstantPool(
ConstantInt::get(Type::getInt32Ty(*CurDAG->getContext()), Val),
TLI->getPointerTy(CurDAG->getDataLayout()));
SDNode *ResNode;
if (Subtarget->isThumb()) {
SDValue Ops[] = {
CPIdx,
getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32),
CurDAG->getEntryNode()
};
ResNode = CurDAG->getMachineNode(ARM::tLDRpci, dl, MVT::i32, MVT::Other,
Ops);
} else {
SDValue Ops[] = {
CPIdx,
CurDAG->getTargetConstant(0, dl, MVT::i32),
getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32),
CurDAG->getEntryNode()
};
ResNode = CurDAG->getMachineNode(ARM::LDRcp, dl, MVT::i32, MVT::Other,
Ops);
}
// Annotate the Node with memory operand information so that MachineInstr
// queries work properly. This e.g. gives the register allocation the
// required information for rematerialization.
MachineFunction& MF = CurDAG->getMachineFunction();
MachineMemOperand *MemOp =
MF.getMachineMemOperand(MachinePointerInfo::getConstantPool(MF),
MachineMemOperand::MOLoad, 4, 4);
CurDAG->setNodeMemRefs(cast<MachineSDNode>(ResNode), {MemOp});
ReplaceNode(N, ResNode);
return;
}
// Other cases are autogenerated.
break;
}
case ISD::FrameIndex: {
// Selects to ADDri FI, 0 which in turn will become ADDri SP, imm.
int FI = cast<FrameIndexSDNode>(N)->getIndex();
SDValue TFI = CurDAG->getTargetFrameIndex(
FI, TLI->getPointerTy(CurDAG->getDataLayout()));
if (Subtarget->isThumb1Only()) {
// Set the alignment of the frame object to 4, to avoid having to generate
// more than one ADD
MachineFrameInfo &MFI = MF->getFrameInfo();
if (MFI.getObjectAlignment(FI) < 4)
MFI.setObjectAlignment(FI, 4);
CurDAG->SelectNodeTo(N, ARM::tADDframe, MVT::i32, TFI,
CurDAG->getTargetConstant(0, dl, MVT::i32));
return;
} else {
unsigned Opc = ((Subtarget->isThumb() && Subtarget->hasThumb2()) ?
ARM::t2ADDri : ARM::ADDri);
SDValue Ops[] = { TFI, CurDAG->getTargetConstant(0, dl, MVT::i32),
getAL(CurDAG, dl), CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
return;
}
}
case ISD::SRL:
if (tryV6T2BitfieldExtractOp(N, false))
return;
break;
case ISD::SIGN_EXTEND_INREG:
case ISD::SRA:
if (tryV6T2BitfieldExtractOp(N, true))
return;
break;
case ISD::MUL:
if (Subtarget->isThumb1Only())
break;
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N->getOperand(1))) {
unsigned RHSV = C->getZExtValue();
if (!RHSV) break;
if (isPowerOf2_32(RHSV-1)) { // 2^n+1?
unsigned ShImm = Log2_32(RHSV-1);
if (ShImm >= 32)
break;
SDValue V = N->getOperand(0);
ShImm = ARM_AM::getSORegOpc(ARM_AM::lsl, ShImm);
SDValue ShImmOp = CurDAG->getTargetConstant(ShImm, dl, MVT::i32);
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
if (Subtarget->isThumb()) {
SDValue Ops[] = { V, V, ShImmOp, getAL(CurDAG, dl), Reg0, Reg0 };
CurDAG->SelectNodeTo(N, ARM::t2ADDrs, MVT::i32, Ops);
return;
} else {
SDValue Ops[] = { V, V, Reg0, ShImmOp, getAL(CurDAG, dl), Reg0,
Reg0 };
CurDAG->SelectNodeTo(N, ARM::ADDrsi, MVT::i32, Ops);
return;
}
}
if (isPowerOf2_32(RHSV+1)) { // 2^n-1?
unsigned ShImm = Log2_32(RHSV+1);
if (ShImm >= 32)
break;
SDValue V = N->getOperand(0);
ShImm = ARM_AM::getSORegOpc(ARM_AM::lsl, ShImm);
SDValue ShImmOp = CurDAG->getTargetConstant(ShImm, dl, MVT::i32);
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
if (Subtarget->isThumb()) {
SDValue Ops[] = { V, V, ShImmOp, getAL(CurDAG, dl), Reg0, Reg0 };
CurDAG->SelectNodeTo(N, ARM::t2RSBrs, MVT::i32, Ops);
return;
} else {
SDValue Ops[] = { V, V, Reg0, ShImmOp, getAL(CurDAG, dl), Reg0,
Reg0 };
CurDAG->SelectNodeTo(N, ARM::RSBrsi, MVT::i32, Ops);
return;
}
}
}
break;
case ISD::AND: {
// Check for unsigned bitfield extract
if (tryV6T2BitfieldExtractOp(N, false))
return;
// If an immediate is used in an AND node, it is possible that the immediate
// can be more optimally materialized when negated. If this is the case we
// can negate the immediate and use a BIC instead.
auto *N1C = dyn_cast<ConstantSDNode>(N->getOperand(1));
if (N1C && N1C->hasOneUse() && Subtarget->isThumb()) {
uint32_t Imm = (uint32_t) N1C->getZExtValue();
// In Thumb2 mode, an AND can take a 12-bit immediate. If this
// immediate can be negated and fit in the immediate operand of
// a t2BIC, don't do any manual transform here as this can be
// handled by the generic ISel machinery.
bool PreferImmediateEncoding =
Subtarget->hasThumb2() && (is_t2_so_imm(Imm) || is_t2_so_imm_not(Imm));
if (!PreferImmediateEncoding &&
ConstantMaterializationCost(Imm) >
ConstantMaterializationCost(~Imm)) {
// The current immediate costs more to materialize than a negated
// immediate, so negate the immediate and use a BIC.
SDValue NewImm =
CurDAG->getConstant(~N1C->getZExtValue(), dl, MVT::i32);
// If the new constant didn't exist before, reposition it in the topological
// ordering so it is just before N. Otherwise, don't touch its location.
if (NewImm->getNodeId() == -1)
CurDAG->RepositionNode(N->getIterator(), NewImm.getNode());
if (!Subtarget->hasThumb2()) {
SDValue Ops[] = {CurDAG->getRegister(ARM::CPSR, MVT::i32),
N->getOperand(0), NewImm, getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32)};
ReplaceNode(N, CurDAG->getMachineNode(ARM::tBIC, dl, MVT::i32, Ops));
return;
} else {
SDValue Ops[] = {N->getOperand(0), NewImm, getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32)};
ReplaceNode(N,
CurDAG->getMachineNode(ARM::t2BICrr, dl, MVT::i32, Ops));
return;
}
}
}
// (and (or x, c2), c1) and top 16-bits of c1 and c2 match, lower 16-bits
// of c1 are 0xffff, and lower 16-bit of c2 are 0. That is, the top 16-bits
// are entirely contributed by c2 and lower 16-bits are entirely contributed
// by x. That's equal to (or (and x, 0xffff), (and c1, 0xffff0000)).
// Select it to: "movt x, ((c1 & 0xffff) >> 16)
EVT VT = N->getValueType(0);
if (VT != MVT::i32)
break;
unsigned Opc = (Subtarget->isThumb() && Subtarget->hasThumb2())
? ARM::t2MOVTi16
: (Subtarget->hasV6T2Ops() ? ARM::MOVTi16 : 0);
if (!Opc)
break;
SDValue N0 = N->getOperand(0), N1 = N->getOperand(1);
N1C = dyn_cast<ConstantSDNode>(N1);
if (!N1C)
break;
if (N0.getOpcode() == ISD::OR && N0.getNode()->hasOneUse()) {
SDValue N2 = N0.getOperand(1);
ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N2);
if (!N2C)
break;
unsigned N1CVal = N1C->getZExtValue();
unsigned N2CVal = N2C->getZExtValue();
if ((N1CVal & 0xffff0000U) == (N2CVal & 0xffff0000U) &&
(N1CVal & 0xffffU) == 0xffffU &&
(N2CVal & 0xffffU) == 0x0U) {
SDValue Imm16 = CurDAG->getTargetConstant((N2CVal & 0xFFFF0000U) >> 16,
dl, MVT::i32);
SDValue Ops[] = { N0.getOperand(0), Imm16,
getAL(CurDAG, dl), CurDAG->getRegister(0, MVT::i32) };
ReplaceNode(N, CurDAG->getMachineNode(Opc, dl, VT, Ops));
return;
}
}
break;
}
case ARMISD::UMAAL: {
unsigned Opc = Subtarget->isThumb() ? ARM::t2UMAAL : ARM::UMAAL;
SDValue Ops[] = { N->getOperand(0), N->getOperand(1),
N->getOperand(2), N->getOperand(3),
getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32) };
ReplaceNode(N, CurDAG->getMachineNode(Opc, dl, MVT::i32, MVT::i32, Ops));
return;
}
case ARMISD::UMLAL:{
if (Subtarget->isThumb()) {
SDValue Ops[] = { N->getOperand(0), N->getOperand(1), N->getOperand(2),
N->getOperand(3), getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32)};
ReplaceNode(
N, CurDAG->getMachineNode(ARM::t2UMLAL, dl, MVT::i32, MVT::i32, Ops));
return;
}else{
SDValue Ops[] = { N->getOperand(0), N->getOperand(1), N->getOperand(2),
N->getOperand(3), getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
ReplaceNode(N, CurDAG->getMachineNode(
Subtarget->hasV6Ops() ? ARM::UMLAL : ARM::UMLALv5, dl,
MVT::i32, MVT::i32, Ops));
return;
}
}
case ARMISD::SMLAL:{
if (Subtarget->isThumb()) {
SDValue Ops[] = { N->getOperand(0), N->getOperand(1), N->getOperand(2),
N->getOperand(3), getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32)};
ReplaceNode(
N, CurDAG->getMachineNode(ARM::t2SMLAL, dl, MVT::i32, MVT::i32, Ops));
return;
}else{
SDValue Ops[] = { N->getOperand(0), N->getOperand(1), N->getOperand(2),
N->getOperand(3), getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
ReplaceNode(N, CurDAG->getMachineNode(
Subtarget->hasV6Ops() ? ARM::SMLAL : ARM::SMLALv5, dl,
MVT::i32, MVT::i32, Ops));
return;
}
}
case ARMISD::SUBE: {
if (!Subtarget->hasV6Ops() || !Subtarget->hasDSP())
break;
// Look for a pattern to match SMMLS
// (sube a, (smul_loHi a, b), (subc 0, (smul_LOhi(a, b))))
if (N->getOperand(1).getOpcode() != ISD::SMUL_LOHI ||
N->getOperand(2).getOpcode() != ARMISD::SUBC ||
!SDValue(N, 1).use_empty())
break;
if (Subtarget->isThumb())
assert(Subtarget->hasThumb2() &&
"This pattern should not be generated for Thumb");
SDValue SmulLoHi = N->getOperand(1);
SDValue Subc = N->getOperand(2);
auto *Zero = dyn_cast<ConstantSDNode>(Subc.getOperand(0));
if (!Zero || Zero->getZExtValue() != 0 ||
Subc.getOperand(1) != SmulLoHi.getValue(0) ||
N->getOperand(1) != SmulLoHi.getValue(1) ||
N->getOperand(2) != Subc.getValue(1))
break;
unsigned Opc = Subtarget->isThumb2() ? ARM::t2SMMLS : ARM::SMMLS;
SDValue Ops[] = { SmulLoHi.getOperand(0), SmulLoHi.getOperand(1),
N->getOperand(0), getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32) };
ReplaceNode(N, CurDAG->getMachineNode(Opc, dl, MVT::i32, Ops));
return;
}
case ISD::LOAD: {
if (Subtarget->isThumb() && Subtarget->hasThumb2()) {
if (tryT2IndexedLoad(N))
return;
} else if (Subtarget->isThumb()) {
if (tryT1IndexedLoad(N))
return;
} else if (tryARMIndexedLoad(N))
return;
// Other cases are autogenerated.
break;
}
case ARMISD::BRCOND: {
// Pattern: (ARMbrcond:void (bb:Other):$dst, (imm:i32):$cc)
// Emits: (Bcc:void (bb:Other):$dst, (imm:i32):$cc)
// Pattern complexity = 6 cost = 1 size = 0
// Pattern: (ARMbrcond:void (bb:Other):$dst, (imm:i32):$cc)
// Emits: (tBcc:void (bb:Other):$dst, (imm:i32):$cc)
// Pattern complexity = 6 cost = 1 size = 0
// Pattern: (ARMbrcond:void (bb:Other):$dst, (imm:i32):$cc)
// Emits: (t2Bcc:void (bb:Other):$dst, (imm:i32):$cc)
// Pattern complexity = 6 cost = 1 size = 0
unsigned Opc = Subtarget->isThumb() ?
((Subtarget->hasThumb2()) ? ARM::t2Bcc : ARM::tBcc) : ARM::Bcc;
SDValue Chain = N->getOperand(0);
SDValue N1 = N->getOperand(1);
SDValue N2 = N->getOperand(2);
SDValue N3 = N->getOperand(3);
SDValue InFlag = N->getOperand(4);
assert(N1.getOpcode() == ISD::BasicBlock);
assert(N2.getOpcode() == ISD::Constant);
assert(N3.getOpcode() == ISD::Register);
unsigned CC = (unsigned) cast<ConstantSDNode>(N2)->getZExtValue();
if (InFlag.getOpcode() == ARMISD::CMPZ) {
bool SwitchEQNEToPLMI;
SelectCMPZ(InFlag.getNode(), SwitchEQNEToPLMI);
InFlag = N->getOperand(4);
if (SwitchEQNEToPLMI) {
switch ((ARMCC::CondCodes)CC) {
default: llvm_unreachable("CMPZ must be either NE or EQ!");
case ARMCC::NE:
CC = (unsigned)ARMCC::MI;
break;
case ARMCC::EQ:
CC = (unsigned)ARMCC::PL;
break;
}
}
}
SDValue Tmp2 = CurDAG->getTargetConstant(CC, dl, MVT::i32);
SDValue Ops[] = { N1, Tmp2, N3, Chain, InFlag };
SDNode *ResNode = CurDAG->getMachineNode(Opc, dl, MVT::Other,
MVT::Glue, Ops);
Chain = SDValue(ResNode, 0);
if (N->getNumValues() == 2) {
InFlag = SDValue(ResNode, 1);
ReplaceUses(SDValue(N, 1), InFlag);
}
ReplaceUses(SDValue(N, 0),
SDValue(Chain.getNode(), Chain.getResNo()));
CurDAG->RemoveDeadNode(N);
return;
}
case ARMISD::CMPZ: {
// select (CMPZ X, #-C) -> (CMPZ (ADDS X, #C), #0)
// This allows us to avoid materializing the expensive negative constant.
// The CMPZ #0 is useless and will be peepholed away but we need to keep it
// for its glue output.
SDValue X = N->getOperand(0);
auto *C = dyn_cast<ConstantSDNode>(N->getOperand(1).getNode());
if (C && C->getSExtValue() < 0 && Subtarget->isThumb()) {
int64_t Addend = -C->getSExtValue();
SDNode *Add = nullptr;
// ADDS can be better than CMN if the immediate fits in a
// 16-bit ADDS, which means either [0,256) for tADDi8 or [0,8) for tADDi3.
// Outside that range we can just use a CMN which is 32-bit but has a
// 12-bit immediate range.
if (Addend < 1<<8) {
if (Subtarget->isThumb2()) {
SDValue Ops[] = { X, CurDAG->getTargetConstant(Addend, dl, MVT::i32),
getAL(CurDAG, dl), CurDAG->getRegister(0, MVT::i32),
CurDAG->getRegister(0, MVT::i32) };
Add = CurDAG->getMachineNode(ARM::t2ADDri, dl, MVT::i32, Ops);
} else {
unsigned Opc = (Addend < 1<<3) ? ARM::tADDi3 : ARM::tADDi8;
SDValue Ops[] = {CurDAG->getRegister(ARM::CPSR, MVT::i32), X,
CurDAG->getTargetConstant(Addend, dl, MVT::i32),
getAL(CurDAG, dl), CurDAG->getRegister(0, MVT::i32)};
Add = CurDAG->getMachineNode(Opc, dl, MVT::i32, Ops);
}
}
if (Add) {
SDValue Ops2[] = {SDValue(Add, 0), CurDAG->getConstant(0, dl, MVT::i32)};
CurDAG->MorphNodeTo(N, ARMISD::CMPZ, CurDAG->getVTList(MVT::Glue), Ops2);
}
}
// Other cases are autogenerated.
break;
}
case ARMISD::CMOV: {
SDValue InFlag = N->getOperand(4);
if (InFlag.getOpcode() == ARMISD::CMPZ) {
bool SwitchEQNEToPLMI;
SelectCMPZ(InFlag.getNode(), SwitchEQNEToPLMI);
if (SwitchEQNEToPLMI) {
SDValue ARMcc = N->getOperand(2);
ARMCC::CondCodes CC =
(ARMCC::CondCodes)cast<ConstantSDNode>(ARMcc)->getZExtValue();
switch (CC) {
default: llvm_unreachable("CMPZ must be either NE or EQ!");
case ARMCC::NE:
CC = ARMCC::MI;
break;
case ARMCC::EQ:
CC = ARMCC::PL;
break;
}
SDValue NewARMcc = CurDAG->getConstant((unsigned)CC, dl, MVT::i32);
SDValue Ops[] = {N->getOperand(0), N->getOperand(1), NewARMcc,
N->getOperand(3), N->getOperand(4)};
CurDAG->MorphNodeTo(N, ARMISD::CMOV, N->getVTList(), Ops);
}
}
// Other cases are autogenerated.
break;
}
case ARMISD::VZIP: {
unsigned Opc = 0;
EVT VT = N->getValueType(0);
switch (VT.getSimpleVT().SimpleTy) {
default: return;
case MVT::v8i8: Opc = ARM::VZIPd8; break;
case MVT::v4f16:
case MVT::v4i16: Opc = ARM::VZIPd16; break;
case MVT::v2f32:
// vzip.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
case MVT::v2i32: Opc = ARM::VTRNd32; break;
case MVT::v16i8: Opc = ARM::VZIPq8; break;
case MVT::v8f16:
case MVT::v8i16: Opc = ARM::VZIPq16; break;
case MVT::v4f32:
case MVT::v4i32: Opc = ARM::VZIPq32; break;
}
SDValue Pred = getAL(CurDAG, dl);
SDValue PredReg = CurDAG->getRegister(0, MVT::i32);
SDValue Ops[] = { N->getOperand(0), N->getOperand(1), Pred, PredReg };
ReplaceNode(N, CurDAG->getMachineNode(Opc, dl, VT, VT, Ops));
return;
}
case ARMISD::VUZP: {
unsigned Opc = 0;
EVT VT = N->getValueType(0);
switch (VT.getSimpleVT().SimpleTy) {
default: return;
case MVT::v8i8: Opc = ARM::VUZPd8; break;
case MVT::v4f16:
case MVT::v4i16: Opc = ARM::VUZPd16; break;
case MVT::v2f32:
// vuzp.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
case MVT::v2i32: Opc = ARM::VTRNd32; break;
case MVT::v16i8: Opc = ARM::VUZPq8; break;
case MVT::v8f16:
case MVT::v8i16: Opc = ARM::VUZPq16; break;
case MVT::v4f32:
case MVT::v4i32: Opc = ARM::VUZPq32; break;
}
SDValue Pred = getAL(CurDAG, dl);
SDValue PredReg = CurDAG->getRegister(0, MVT::i32);
SDValue Ops[] = { N->getOperand(0), N->getOperand(1), Pred, PredReg };
ReplaceNode(N, CurDAG->getMachineNode(Opc, dl, VT, VT, Ops));
return;
}
case ARMISD::VTRN: {
unsigned Opc = 0;
EVT VT = N->getValueType(0);
switch (VT.getSimpleVT().SimpleTy) {
default: return;
case MVT::v8i8: Opc = ARM::VTRNd8; break;
case MVT::v4f16:
case MVT::v4i16: Opc = ARM::VTRNd16; break;
case MVT::v2f32:
case MVT::v2i32: Opc = ARM::VTRNd32; break;
case MVT::v16i8: Opc = ARM::VTRNq8; break;
case MVT::v8f16:
case MVT::v8i16: Opc = ARM::VTRNq16; break;
case MVT::v4f32:
case MVT::v4i32: Opc = ARM::VTRNq32; break;
}
SDValue Pred = getAL(CurDAG, dl);
SDValue PredReg = CurDAG->getRegister(0, MVT::i32);
SDValue Ops[] = { N->getOperand(0), N->getOperand(1), Pred, PredReg };
ReplaceNode(N, CurDAG->getMachineNode(Opc, dl, VT, VT, Ops));
return;
}
case ARMISD::BUILD_VECTOR: {
EVT VecVT = N->getValueType(0);
EVT EltVT = VecVT.getVectorElementType();
unsigned NumElts = VecVT.getVectorNumElements();
if (EltVT == MVT::f64) {
assert(NumElts == 2 && "unexpected type for BUILD_VECTOR");
ReplaceNode(
N, createDRegPairNode(VecVT, N->getOperand(0), N->getOperand(1)));
return;
}
assert(EltVT == MVT::f32 && "unexpected type for BUILD_VECTOR");
if (NumElts == 2) {
ReplaceNode(
N, createSRegPairNode(VecVT, N->getOperand(0), N->getOperand(1)));
return;
}
assert(NumElts == 4 && "unexpected type for BUILD_VECTOR");
ReplaceNode(N,
createQuadSRegsNode(VecVT, N->getOperand(0), N->getOperand(1),
N->getOperand(2), N->getOperand(3)));
return;
}
case ARMISD::VLD1DUP: {
static const uint16_t DOpcodes[] = { ARM::VLD1DUPd8, ARM::VLD1DUPd16,
ARM::VLD1DUPd32 };
static const uint16_t QOpcodes[] = { ARM::VLD1DUPq8, ARM::VLD1DUPq16,
ARM::VLD1DUPq32 };
SelectVLDDup(N, /* IsIntrinsic= */ false, false, 1, DOpcodes, QOpcodes);
return;
}
case ARMISD::VLD2DUP: {
static const uint16_t Opcodes[] = { ARM::VLD2DUPd8, ARM::VLD2DUPd16,
ARM::VLD2DUPd32 };
SelectVLDDup(N, /* IsIntrinsic= */ false, false, 2, Opcodes);
return;
}
case ARMISD::VLD3DUP: {
static const uint16_t Opcodes[] = { ARM::VLD3DUPd8Pseudo,
ARM::VLD3DUPd16Pseudo,
ARM::VLD3DUPd32Pseudo };
SelectVLDDup(N, /* IsIntrinsic= */ false, false, 3, Opcodes);
return;
}
case ARMISD::VLD4DUP: {
static const uint16_t Opcodes[] = { ARM::VLD4DUPd8Pseudo,
ARM::VLD4DUPd16Pseudo,
ARM::VLD4DUPd32Pseudo };
SelectVLDDup(N, /* IsIntrinsic= */ false, false, 4, Opcodes);
return;
}
case ARMISD::VLD1DUP_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD1DUPd8wb_fixed,
ARM::VLD1DUPd16wb_fixed,
ARM::VLD1DUPd32wb_fixed };
static const uint16_t QOpcodes[] = { ARM::VLD1DUPq8wb_fixed,
ARM::VLD1DUPq16wb_fixed,
ARM::VLD1DUPq32wb_fixed };
SelectVLDDup(N, /* IsIntrinsic= */ false, true, 1, DOpcodes, QOpcodes);
return;
}
case ARMISD::VLD2DUP_UPD: {
static const uint16_t Opcodes[] = { ARM::VLD2DUPd8wb_fixed,
ARM::VLD2DUPd16wb_fixed,
ARM::VLD2DUPd32wb_fixed };
SelectVLDDup(N, /* IsIntrinsic= */ false, true, 2, Opcodes);
return;
}
case ARMISD::VLD3DUP_UPD: {
static const uint16_t Opcodes[] = { ARM::VLD3DUPd8Pseudo_UPD,
ARM::VLD3DUPd16Pseudo_UPD,
ARM::VLD3DUPd32Pseudo_UPD };
SelectVLDDup(N, /* IsIntrinsic= */ false, true, 3, Opcodes);
return;
}
case ARMISD::VLD4DUP_UPD: {
static const uint16_t Opcodes[] = { ARM::VLD4DUPd8Pseudo_UPD,
ARM::VLD4DUPd16Pseudo_UPD,
ARM::VLD4DUPd32Pseudo_UPD };
SelectVLDDup(N, /* IsIntrinsic= */ false, true, 4, Opcodes);
return;
}
case ARMISD::VLD1_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD1d8wb_fixed,
ARM::VLD1d16wb_fixed,
ARM::VLD1d32wb_fixed,
ARM::VLD1d64wb_fixed };
static const uint16_t QOpcodes[] = { ARM::VLD1q8wb_fixed,
ARM::VLD1q16wb_fixed,
ARM::VLD1q32wb_fixed,
ARM::VLD1q64wb_fixed };
SelectVLD(N, true, 1, DOpcodes, QOpcodes, nullptr);
return;
}
case ARMISD::VLD2_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD2d8wb_fixed,
ARM::VLD2d16wb_fixed,
ARM::VLD2d32wb_fixed,
ARM::VLD1q64wb_fixed};
static const uint16_t QOpcodes[] = { ARM::VLD2q8PseudoWB_fixed,
ARM::VLD2q16PseudoWB_fixed,
ARM::VLD2q32PseudoWB_fixed };
SelectVLD(N, true, 2, DOpcodes, QOpcodes, nullptr);
return;
}
case ARMISD::VLD3_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD3d8Pseudo_UPD,
ARM::VLD3d16Pseudo_UPD,
ARM::VLD3d32Pseudo_UPD,
ARM::VLD1d64TPseudoWB_fixed};
static const uint16_t QOpcodes0[] = { ARM::VLD3q8Pseudo_UPD,
ARM::VLD3q16Pseudo_UPD,
ARM::VLD3q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VLD3q8oddPseudo_UPD,
ARM::VLD3q16oddPseudo_UPD,
ARM::VLD3q32oddPseudo_UPD };
SelectVLD(N, true, 3, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case ARMISD::VLD4_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD4d8Pseudo_UPD,
ARM::VLD4d16Pseudo_UPD,
ARM::VLD4d32Pseudo_UPD,
ARM::VLD1d64QPseudoWB_fixed};
static const uint16_t QOpcodes0[] = { ARM::VLD4q8Pseudo_UPD,
ARM::VLD4q16Pseudo_UPD,
ARM::VLD4q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VLD4q8oddPseudo_UPD,
ARM::VLD4q16oddPseudo_UPD,
ARM::VLD4q32oddPseudo_UPD };
SelectVLD(N, true, 4, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case ARMISD::VLD2LN_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD2LNd8Pseudo_UPD,
ARM::VLD2LNd16Pseudo_UPD,
ARM::VLD2LNd32Pseudo_UPD };
static const uint16_t QOpcodes[] = { ARM::VLD2LNq16Pseudo_UPD,
ARM::VLD2LNq32Pseudo_UPD };
SelectVLDSTLane(N, true, true, 2, DOpcodes, QOpcodes);
return;
}
case ARMISD::VLD3LN_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD3LNd8Pseudo_UPD,
ARM::VLD3LNd16Pseudo_UPD,
ARM::VLD3LNd32Pseudo_UPD };
static const uint16_t QOpcodes[] = { ARM::VLD3LNq16Pseudo_UPD,
ARM::VLD3LNq32Pseudo_UPD };
SelectVLDSTLane(N, true, true, 3, DOpcodes, QOpcodes);
return;
}
case ARMISD::VLD4LN_UPD: {
static const uint16_t DOpcodes[] = { ARM::VLD4LNd8Pseudo_UPD,
ARM::VLD4LNd16Pseudo_UPD,
ARM::VLD4LNd32Pseudo_UPD };
static const uint16_t QOpcodes[] = { ARM::VLD4LNq16Pseudo_UPD,
ARM::VLD4LNq32Pseudo_UPD };
SelectVLDSTLane(N, true, true, 4, DOpcodes, QOpcodes);
return;
}
case ARMISD::VST1_UPD: {
static const uint16_t DOpcodes[] = { ARM::VST1d8wb_fixed,
ARM::VST1d16wb_fixed,
ARM::VST1d32wb_fixed,
ARM::VST1d64wb_fixed };
static const uint16_t QOpcodes[] = { ARM::VST1q8wb_fixed,
ARM::VST1q16wb_fixed,
ARM::VST1q32wb_fixed,
ARM::VST1q64wb_fixed };
SelectVST(N, true, 1, DOpcodes, QOpcodes, nullptr);
return;
}
case ARMISD::VST2_UPD: {
static const uint16_t DOpcodes[] = { ARM::VST2d8wb_fixed,
ARM::VST2d16wb_fixed,
ARM::VST2d32wb_fixed,
ARM::VST1q64wb_fixed};
static const uint16_t QOpcodes[] = { ARM::VST2q8PseudoWB_fixed,
ARM::VST2q16PseudoWB_fixed,
ARM::VST2q32PseudoWB_fixed };
SelectVST(N, true, 2, DOpcodes, QOpcodes, nullptr);
return;
}
case ARMISD::VST3_UPD: {
static const uint16_t DOpcodes[] = { ARM::VST3d8Pseudo_UPD,
ARM::VST3d16Pseudo_UPD,
ARM::VST3d32Pseudo_UPD,
ARM::VST1d64TPseudoWB_fixed};
static const uint16_t QOpcodes0[] = { ARM::VST3q8Pseudo_UPD,
ARM::VST3q16Pseudo_UPD,
ARM::VST3q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VST3q8oddPseudo_UPD,
ARM::VST3q16oddPseudo_UPD,
ARM::VST3q32oddPseudo_UPD };
SelectVST(N, true, 3, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case ARMISD::VST4_UPD: {
static const uint16_t DOpcodes[] = { ARM::VST4d8Pseudo_UPD,
ARM::VST4d16Pseudo_UPD,
ARM::VST4d32Pseudo_UPD,
ARM::VST1d64QPseudoWB_fixed};
static const uint16_t QOpcodes0[] = { ARM::VST4q8Pseudo_UPD,
ARM::VST4q16Pseudo_UPD,
ARM::VST4q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VST4q8oddPseudo_UPD,
ARM::VST4q16oddPseudo_UPD,
ARM::VST4q32oddPseudo_UPD };
SelectVST(N, true, 4, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case ARMISD::VST2LN_UPD: {
static const uint16_t DOpcodes[] = { ARM::VST2LNd8Pseudo_UPD,
ARM::VST2LNd16Pseudo_UPD,
ARM::VST2LNd32Pseudo_UPD };
static const uint16_t QOpcodes[] = { ARM::VST2LNq16Pseudo_UPD,
ARM::VST2LNq32Pseudo_UPD };
SelectVLDSTLane(N, false, true, 2, DOpcodes, QOpcodes);
return;
}
case ARMISD::VST3LN_UPD: {
static const uint16_t DOpcodes[] = { ARM::VST3LNd8Pseudo_UPD,
ARM::VST3LNd16Pseudo_UPD,
ARM::VST3LNd32Pseudo_UPD };
static const uint16_t QOpcodes[] = { ARM::VST3LNq16Pseudo_UPD,
ARM::VST3LNq32Pseudo_UPD };
SelectVLDSTLane(N, false, true, 3, DOpcodes, QOpcodes);
return;
}
case ARMISD::VST4LN_UPD: {
static const uint16_t DOpcodes[] = { ARM::VST4LNd8Pseudo_UPD,
ARM::VST4LNd16Pseudo_UPD,
ARM::VST4LNd32Pseudo_UPD };
static const uint16_t QOpcodes[] = { ARM::VST4LNq16Pseudo_UPD,
ARM::VST4LNq32Pseudo_UPD };
SelectVLDSTLane(N, false, true, 4, DOpcodes, QOpcodes);
return;
}
case ISD::INTRINSIC_VOID:
case ISD::INTRINSIC_W_CHAIN: {
unsigned IntNo = cast<ConstantSDNode>(N->getOperand(1))->getZExtValue();
switch (IntNo) {
default:
break;
case Intrinsic::arm_mrrc:
case Intrinsic::arm_mrrc2: {
SDLoc dl(N);
SDValue Chain = N->getOperand(0);
unsigned Opc;
if (Subtarget->isThumb())
Opc = (IntNo == Intrinsic::arm_mrrc ? ARM::t2MRRC : ARM::t2MRRC2);
else
Opc = (IntNo == Intrinsic::arm_mrrc ? ARM::MRRC : ARM::MRRC2);
SmallVector<SDValue, 5> Ops;
Ops.push_back(getI32Imm(cast<ConstantSDNode>(N->getOperand(2))->getZExtValue(), dl)); /* coproc */
Ops.push_back(getI32Imm(cast<ConstantSDNode>(N->getOperand(3))->getZExtValue(), dl)); /* opc */
Ops.push_back(getI32Imm(cast<ConstantSDNode>(N->getOperand(4))->getZExtValue(), dl)); /* CRm */
// The mrrc2 instruction in ARM doesn't allow predicates, the top 4 bits of the encoded
// instruction will always be '1111' but it is possible in assembly language to specify
// AL as a predicate to mrrc2 but it doesn't make any difference to the encoded instruction.
if (Opc != ARM::MRRC2) {
Ops.push_back(getAL(CurDAG, dl));
Ops.push_back(CurDAG->getRegister(0, MVT::i32));
}
Ops.push_back(Chain);
// Writes to two registers.
const EVT RetType[] = {MVT::i32, MVT::i32, MVT::Other};
ReplaceNode(N, CurDAG->getMachineNode(Opc, dl, RetType, Ops));
return;
}
case Intrinsic::arm_ldaexd:
case Intrinsic::arm_ldrexd: {
SDLoc dl(N);
SDValue Chain = N->getOperand(0);
SDValue MemAddr = N->getOperand(2);
bool isThumb = Subtarget->isThumb() && Subtarget->hasV8MBaselineOps();
bool IsAcquire = IntNo == Intrinsic::arm_ldaexd;
unsigned NewOpc = isThumb ? (IsAcquire ? ARM::t2LDAEXD : ARM::t2LDREXD)
: (IsAcquire ? ARM::LDAEXD : ARM::LDREXD);
// arm_ldrexd returns a i64 value in {i32, i32}
std::vector<EVT> ResTys;
if (isThumb) {
ResTys.push_back(MVT::i32);
ResTys.push_back(MVT::i32);
} else
ResTys.push_back(MVT::Untyped);
ResTys.push_back(MVT::Other);
// Place arguments in the right order.
SDValue Ops[] = {MemAddr, getAL(CurDAG, dl),
CurDAG->getRegister(0, MVT::i32), Chain};
SDNode *Ld = CurDAG->getMachineNode(NewOpc, dl, ResTys, Ops);
// Transfer memoperands.
MachineMemOperand *MemOp = cast<MemIntrinsicSDNode>(N)->getMemOperand();
CurDAG->setNodeMemRefs(cast<MachineSDNode>(Ld), {MemOp});
// Remap uses.
SDValue OutChain = isThumb ? SDValue(Ld, 2) : SDValue(Ld, 1);
if (!SDValue(N, 0).use_empty()) {
SDValue Result;
if (isThumb)
Result = SDValue(Ld, 0);
else {
SDValue SubRegIdx =
CurDAG->getTargetConstant(ARM::gsub_0, dl, MVT::i32);
SDNode *ResNode = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
dl, MVT::i32, SDValue(Ld, 0), SubRegIdx);
Result = SDValue(ResNode,0);
}
ReplaceUses(SDValue(N, 0), Result);
}
if (!SDValue(N, 1).use_empty()) {
SDValue Result;
if (isThumb)
Result = SDValue(Ld, 1);
else {
SDValue SubRegIdx =
CurDAG->getTargetConstant(ARM::gsub_1, dl, MVT::i32);
SDNode *ResNode = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
dl, MVT::i32, SDValue(Ld, 0), SubRegIdx);
Result = SDValue(ResNode,0);
}
ReplaceUses(SDValue(N, 1), Result);
}
ReplaceUses(SDValue(N, 2), OutChain);
CurDAG->RemoveDeadNode(N);
return;
}
case Intrinsic::arm_stlexd:
case Intrinsic::arm_strexd: {
SDLoc dl(N);
SDValue Chain = N->getOperand(0);
SDValue Val0 = N->getOperand(2);
SDValue Val1 = N->getOperand(3);
SDValue MemAddr = N->getOperand(4);
// Store exclusive double return a i32 value which is the return status
// of the issued store.
const EVT ResTys[] = {MVT::i32, MVT::Other};
bool isThumb = Subtarget->isThumb() && Subtarget->hasThumb2();
// Place arguments in the right order.
SmallVector<SDValue, 7> Ops;
if (isThumb) {
Ops.push_back(Val0);
Ops.push_back(Val1);
} else
// arm_strexd uses GPRPair.
Ops.push_back(SDValue(createGPRPairNode(MVT::Untyped, Val0, Val1), 0));
Ops.push_back(MemAddr);
Ops.push_back(getAL(CurDAG, dl));
Ops.push_back(CurDAG->getRegister(0, MVT::i32));
Ops.push_back(Chain);
bool IsRelease = IntNo == Intrinsic::arm_stlexd;
unsigned NewOpc = isThumb ? (IsRelease ? ARM::t2STLEXD : ARM::t2STREXD)
: (IsRelease ? ARM::STLEXD : ARM::STREXD);
SDNode *St = CurDAG->getMachineNode(NewOpc, dl, ResTys, Ops);
// Transfer memoperands.
MachineMemOperand *MemOp = cast<MemIntrinsicSDNode>(N)->getMemOperand();
CurDAG->setNodeMemRefs(cast<MachineSDNode>(St), {MemOp});
ReplaceNode(N, St);
return;
}
case Intrinsic::arm_neon_vld1: {
static const uint16_t DOpcodes[] = { ARM::VLD1d8, ARM::VLD1d16,
ARM::VLD1d32, ARM::VLD1d64 };
static const uint16_t QOpcodes[] = { ARM::VLD1q8, ARM::VLD1q16,
ARM::VLD1q32, ARM::VLD1q64};
SelectVLD(N, false, 1, DOpcodes, QOpcodes, nullptr);
return;
}
case Intrinsic::arm_neon_vld1x2: {
static const uint16_t DOpcodes[] = { ARM::VLD1q8, ARM::VLD1q16,
ARM::VLD1q32, ARM::VLD1q64 };
static const uint16_t QOpcodes[] = { ARM::VLD1d8QPseudo,
ARM::VLD1d16QPseudo,
ARM::VLD1d32QPseudo,
ARM::VLD1d64QPseudo };
SelectVLD(N, false, 2, DOpcodes, QOpcodes, nullptr);
return;
}
case Intrinsic::arm_neon_vld1x3: {
static const uint16_t DOpcodes[] = { ARM::VLD1d8TPseudo,
ARM::VLD1d16TPseudo,
ARM::VLD1d32TPseudo,
ARM::VLD1d64TPseudo };
static const uint16_t QOpcodes0[] = { ARM::VLD1q8LowTPseudo_UPD,
ARM::VLD1q16LowTPseudo_UPD,
ARM::VLD1q32LowTPseudo_UPD,
ARM::VLD1q64LowTPseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VLD1q8HighTPseudo,
ARM::VLD1q16HighTPseudo,
ARM::VLD1q32HighTPseudo,
ARM::VLD1q64HighTPseudo };
SelectVLD(N, false, 3, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vld1x4: {
static const uint16_t DOpcodes[] = { ARM::VLD1d8QPseudo,
ARM::VLD1d16QPseudo,
ARM::VLD1d32QPseudo,
ARM::VLD1d64QPseudo };
static const uint16_t QOpcodes0[] = { ARM::VLD1q8LowQPseudo_UPD,
ARM::VLD1q16LowQPseudo_UPD,
ARM::VLD1q32LowQPseudo_UPD,
ARM::VLD1q64LowQPseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VLD1q8HighQPseudo,
ARM::VLD1q16HighQPseudo,
ARM::VLD1q32HighQPseudo,
ARM::VLD1q64HighQPseudo };
SelectVLD(N, false, 4, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vld2: {
static const uint16_t DOpcodes[] = { ARM::VLD2d8, ARM::VLD2d16,
ARM::VLD2d32, ARM::VLD1q64 };
static const uint16_t QOpcodes[] = { ARM::VLD2q8Pseudo, ARM::VLD2q16Pseudo,
ARM::VLD2q32Pseudo };
SelectVLD(N, false, 2, DOpcodes, QOpcodes, nullptr);
return;
}
case Intrinsic::arm_neon_vld3: {
static const uint16_t DOpcodes[] = { ARM::VLD3d8Pseudo,
ARM::VLD3d16Pseudo,
ARM::VLD3d32Pseudo,
ARM::VLD1d64TPseudo };
static const uint16_t QOpcodes0[] = { ARM::VLD3q8Pseudo_UPD,
ARM::VLD3q16Pseudo_UPD,
ARM::VLD3q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VLD3q8oddPseudo,
ARM::VLD3q16oddPseudo,
ARM::VLD3q32oddPseudo };
SelectVLD(N, false, 3, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vld4: {
static const uint16_t DOpcodes[] = { ARM::VLD4d8Pseudo,
ARM::VLD4d16Pseudo,
ARM::VLD4d32Pseudo,
ARM::VLD1d64QPseudo };
static const uint16_t QOpcodes0[] = { ARM::VLD4q8Pseudo_UPD,
ARM::VLD4q16Pseudo_UPD,
ARM::VLD4q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VLD4q8oddPseudo,
ARM::VLD4q16oddPseudo,
ARM::VLD4q32oddPseudo };
SelectVLD(N, false, 4, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vld2dup: {
static const uint16_t DOpcodes[] = { ARM::VLD2DUPd8, ARM::VLD2DUPd16,
ARM::VLD2DUPd32, ARM::VLD1q64 };
static const uint16_t QOpcodes0[] = { ARM::VLD2DUPq8EvenPseudo,
ARM::VLD2DUPq16EvenPseudo,
ARM::VLD2DUPq32EvenPseudo };
static const uint16_t QOpcodes1[] = { ARM::VLD2DUPq8OddPseudo,
ARM::VLD2DUPq16OddPseudo,
ARM::VLD2DUPq32OddPseudo };
SelectVLDDup(N, /* IsIntrinsic= */ true, false, 2,
DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vld3dup: {
static const uint16_t DOpcodes[] = { ARM::VLD3DUPd8Pseudo,
ARM::VLD3DUPd16Pseudo,
ARM::VLD3DUPd32Pseudo,
ARM::VLD1d64TPseudo };
static const uint16_t QOpcodes0[] = { ARM::VLD3DUPq8EvenPseudo,
ARM::VLD3DUPq16EvenPseudo,
ARM::VLD3DUPq32EvenPseudo };
static const uint16_t QOpcodes1[] = { ARM::VLD3DUPq8OddPseudo,
ARM::VLD3DUPq16OddPseudo,
ARM::VLD3DUPq32OddPseudo };
SelectVLDDup(N, /* IsIntrinsic= */ true, false, 3,
DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vld4dup: {
static const uint16_t DOpcodes[] = { ARM::VLD4DUPd8Pseudo,
ARM::VLD4DUPd16Pseudo,
ARM::VLD4DUPd32Pseudo,
ARM::VLD1d64QPseudo };
static const uint16_t QOpcodes0[] = { ARM::VLD4DUPq8EvenPseudo,
ARM::VLD4DUPq16EvenPseudo,
ARM::VLD4DUPq32EvenPseudo };
static const uint16_t QOpcodes1[] = { ARM::VLD4DUPq8OddPseudo,
ARM::VLD4DUPq16OddPseudo,
ARM::VLD4DUPq32OddPseudo };
SelectVLDDup(N, /* IsIntrinsic= */ true, false, 4,
DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vld2lane: {
static const uint16_t DOpcodes[] = { ARM::VLD2LNd8Pseudo,
ARM::VLD2LNd16Pseudo,
ARM::VLD2LNd32Pseudo };
static const uint16_t QOpcodes[] = { ARM::VLD2LNq16Pseudo,
ARM::VLD2LNq32Pseudo };
SelectVLDSTLane(N, true, false, 2, DOpcodes, QOpcodes);
return;
}
case Intrinsic::arm_neon_vld3lane: {
static const uint16_t DOpcodes[] = { ARM::VLD3LNd8Pseudo,
ARM::VLD3LNd16Pseudo,
ARM::VLD3LNd32Pseudo };
static const uint16_t QOpcodes[] = { ARM::VLD3LNq16Pseudo,
ARM::VLD3LNq32Pseudo };
SelectVLDSTLane(N, true, false, 3, DOpcodes, QOpcodes);
return;
}
case Intrinsic::arm_neon_vld4lane: {
static const uint16_t DOpcodes[] = { ARM::VLD4LNd8Pseudo,
ARM::VLD4LNd16Pseudo,
ARM::VLD4LNd32Pseudo };
static const uint16_t QOpcodes[] = { ARM::VLD4LNq16Pseudo,
ARM::VLD4LNq32Pseudo };
SelectVLDSTLane(N, true, false, 4, DOpcodes, QOpcodes);
return;
}
case Intrinsic::arm_neon_vst1: {
static const uint16_t DOpcodes[] = { ARM::VST1d8, ARM::VST1d16,
ARM::VST1d32, ARM::VST1d64 };
static const uint16_t QOpcodes[] = { ARM::VST1q8, ARM::VST1q16,
ARM::VST1q32, ARM::VST1q64 };
SelectVST(N, false, 1, DOpcodes, QOpcodes, nullptr);
return;
}
case Intrinsic::arm_neon_vst1x2: {
static const uint16_t DOpcodes[] = { ARM::VST1q8, ARM::VST1q16,
ARM::VST1q32, ARM::VST1q64 };
static const uint16_t QOpcodes[] = { ARM::VST1d8QPseudo,
ARM::VST1d16QPseudo,
ARM::VST1d32QPseudo,
ARM::VST1d64QPseudo };
SelectVST(N, false, 2, DOpcodes, QOpcodes, nullptr);
return;
}
case Intrinsic::arm_neon_vst1x3: {
static const uint16_t DOpcodes[] = { ARM::VST1d8TPseudo,
ARM::VST1d16TPseudo,
ARM::VST1d32TPseudo,
ARM::VST1d64TPseudo };
static const uint16_t QOpcodes0[] = { ARM::VST1q8LowTPseudo_UPD,
ARM::VST1q16LowTPseudo_UPD,
ARM::VST1q32LowTPseudo_UPD,
ARM::VST1q64LowTPseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VST1q8HighTPseudo,
ARM::VST1q16HighTPseudo,
ARM::VST1q32HighTPseudo,
ARM::VST1q64HighTPseudo };
SelectVST(N, false, 3, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vst1x4: {
static const uint16_t DOpcodes[] = { ARM::VST1d8QPseudo,
ARM::VST1d16QPseudo,
ARM::VST1d32QPseudo,
ARM::VST1d64QPseudo };
static const uint16_t QOpcodes0[] = { ARM::VST1q8LowQPseudo_UPD,
ARM::VST1q16LowQPseudo_UPD,
ARM::VST1q32LowQPseudo_UPD,
ARM::VST1q64LowQPseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VST1q8HighQPseudo,
ARM::VST1q16HighQPseudo,
ARM::VST1q32HighQPseudo,
ARM::VST1q64HighQPseudo };
SelectVST(N, false, 4, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vst2: {
static const uint16_t DOpcodes[] = { ARM::VST2d8, ARM::VST2d16,
ARM::VST2d32, ARM::VST1q64 };
static const uint16_t QOpcodes[] = { ARM::VST2q8Pseudo, ARM::VST2q16Pseudo,
ARM::VST2q32Pseudo };
SelectVST(N, false, 2, DOpcodes, QOpcodes, nullptr);
return;
}
case Intrinsic::arm_neon_vst3: {
static const uint16_t DOpcodes[] = { ARM::VST3d8Pseudo,
ARM::VST3d16Pseudo,
ARM::VST3d32Pseudo,
ARM::VST1d64TPseudo };
static const uint16_t QOpcodes0[] = { ARM::VST3q8Pseudo_UPD,
ARM::VST3q16Pseudo_UPD,
ARM::VST3q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VST3q8oddPseudo,
ARM::VST3q16oddPseudo,
ARM::VST3q32oddPseudo };
SelectVST(N, false, 3, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vst4: {
static const uint16_t DOpcodes[] = { ARM::VST4d8Pseudo,
ARM::VST4d16Pseudo,
ARM::VST4d32Pseudo,
ARM::VST1d64QPseudo };
static const uint16_t QOpcodes0[] = { ARM::VST4q8Pseudo_UPD,
ARM::VST4q16Pseudo_UPD,
ARM::VST4q32Pseudo_UPD };
static const uint16_t QOpcodes1[] = { ARM::VST4q8oddPseudo,
ARM::VST4q16oddPseudo,
ARM::VST4q32oddPseudo };
SelectVST(N, false, 4, DOpcodes, QOpcodes0, QOpcodes1);
return;
}
case Intrinsic::arm_neon_vst2lane: {
static const uint16_t DOpcodes[] = { ARM::VST2LNd8Pseudo,
ARM::VST2LNd16Pseudo,
ARM::VST2LNd32Pseudo };
static const uint16_t QOpcodes[] = { ARM::VST2LNq16Pseudo,
ARM::VST2LNq32Pseudo };
SelectVLDSTLane(N, false, false, 2, DOpcodes, QOpcodes);
return;
}
case Intrinsic::arm_neon_vst3lane: {
static const uint16_t DOpcodes[] = { ARM::VST3LNd8Pseudo,
ARM::VST3LNd16Pseudo,
ARM::VST3LNd32Pseudo };
static const uint16_t QOpcodes[] = { ARM::VST3LNq16Pseudo,
ARM::VST3LNq32Pseudo };
SelectVLDSTLane(N, false, false, 3, DOpcodes, QOpcodes);
return;
}
case Intrinsic::arm_neon_vst4lane: {
static const uint16_t DOpcodes[] = { ARM::VST4LNd8Pseudo,
ARM::VST4LNd16Pseudo,
ARM::VST4LNd32Pseudo };
static const uint16_t QOpcodes[] = { ARM::VST4LNq16Pseudo,
ARM::VST4LNq32Pseudo };
SelectVLDSTLane(N, false, false, 4, DOpcodes, QOpcodes);
return;
}
}
break;
}
case ISD::ATOMIC_CMP_SWAP:
SelectCMP_SWAP(N);
return;
}
SelectCode(N);
}
// Inspect a register string of the form
// cp<coprocessor>:<opc1>:c<CRn>:c<CRm>:<opc2> (32bit) or
// cp<coprocessor>:<opc1>:c<CRm> (64bit) inspect the fields of the string
// and obtain the integer operands from them, adding these operands to the
// provided vector.
static void getIntOperandsFromRegisterString(StringRef RegString,
SelectionDAG *CurDAG,
const SDLoc &DL,
std::vector<SDValue> &Ops) {
SmallVector<StringRef, 5> Fields;
RegString.split(Fields, ':');
if (Fields.size() > 1) {
bool AllIntFields = true;
for (StringRef Field : Fields) {
// Need to trim out leading 'cp' characters and get the integer field.
unsigned IntField;
AllIntFields &= !Field.trim("CPcp").getAsInteger(10, IntField);
Ops.push_back(CurDAG->getTargetConstant(IntField, DL, MVT::i32));
}
assert(AllIntFields &&
"Unexpected non-integer value in special register string.");
}
}
// Maps a Banked Register string to its mask value. The mask value returned is
// for use in the MRSbanked / MSRbanked instruction nodes as the Banked Register
// mask operand, which expresses which register is to be used, e.g. r8, and in
// which mode it is to be used, e.g. usr. Returns -1 to signify that the string
// was invalid.
static inline int getBankedRegisterMask(StringRef RegString) {
auto TheReg = ARMBankedReg::lookupBankedRegByName(RegString.lower());
if (!TheReg)
return -1;
return TheReg->Encoding;
}
// The flags here are common to those allowed for apsr in the A class cores and
// those allowed for the special registers in the M class cores. Returns a
// value representing which flags were present, -1 if invalid.
static inline int getMClassFlagsMask(StringRef Flags) {
return StringSwitch<int>(Flags)
.Case("", 0x2) // no flags means nzcvq for psr registers, and 0x2 is
// correct when flags are not permitted
.Case("g", 0x1)
.Case("nzcvq", 0x2)
.Case("nzcvqg", 0x3)
.Default(-1);
}
// Maps MClass special registers string to its value for use in the
// t2MRS_M/t2MSR_M instruction nodes as the SYSm value operand.
// Returns -1 to signify that the string was invalid.
static int getMClassRegisterMask(StringRef Reg, const ARMSubtarget *Subtarget) {
auto TheReg = ARMSysReg::lookupMClassSysRegByName(Reg);
const FeatureBitset &FeatureBits = Subtarget->getFeatureBits();
if (!TheReg || !TheReg->hasRequiredFeatures(FeatureBits))
return -1;
return (int)(TheReg->Encoding & 0xFFF); // SYSm value
}
static int getARClassRegisterMask(StringRef Reg, StringRef Flags) {
// The mask operand contains the special register (R Bit) in bit 4, whether
// the register is spsr (R bit is 1) or one of cpsr/apsr (R bit is 0), and
// bits 3-0 contains the fields to be accessed in the special register, set by
// the flags provided with the register.
int Mask = 0;
if (Reg == "apsr") {
// The flags permitted for apsr are the same flags that are allowed in
// M class registers. We get the flag value and then shift the flags into
// the correct place to combine with the mask.
Mask = getMClassFlagsMask(Flags);
if (Mask == -1)
return -1;
return Mask << 2;
}
if (Reg != "cpsr" && Reg != "spsr") {
return -1;
}
// This is the same as if the flags were "fc"
if (Flags.empty() || Flags == "all")
return Mask | 0x9;
// Inspect the supplied flags string and set the bits in the mask for
// the relevant and valid flags allowed for cpsr and spsr.
for (char Flag : Flags) {
int FlagVal;
switch (Flag) {
case 'c':
FlagVal = 0x1;
break;
case 'x':
FlagVal = 0x2;
break;
case 's':
FlagVal = 0x4;
break;
case 'f':
FlagVal = 0x8;
break;
default:
FlagVal = 0;
}
// This avoids allowing strings where the same flag bit appears twice.
if (!FlagVal || (Mask & FlagVal))
return -1;
Mask |= FlagVal;
}
// If the register is spsr then we need to set the R bit.
if (Reg == "spsr")
Mask |= 0x10;
return Mask;
}
// Lower the read_register intrinsic to ARM specific DAG nodes
// using the supplied metadata string to select the instruction node to use
// and the registers/masks to construct as operands for the node.
bool ARMDAGToDAGISel::tryReadRegister(SDNode *N){
const MDNodeSDNode *MD = dyn_cast<MDNodeSDNode>(N->getOperand(1));
const MDString *RegString = dyn_cast<MDString>(MD->getMD()->getOperand(0));
bool IsThumb2 = Subtarget->isThumb2();
SDLoc DL(N);
std::vector<SDValue> Ops;
getIntOperandsFromRegisterString(RegString->getString(), CurDAG, DL, Ops);
if (!Ops.empty()) {
// If the special register string was constructed of fields (as defined
// in the ACLE) then need to lower to MRC node (32 bit) or
// MRRC node(64 bit), we can make the distinction based on the number of
// operands we have.
unsigned Opcode;
SmallVector<EVT, 3> ResTypes;
if (Ops.size() == 5){
Opcode = IsThumb2 ? ARM::t2MRC : ARM::MRC;
ResTypes.append({ MVT::i32, MVT::Other });
} else {
assert(Ops.size() == 3 &&
"Invalid number of fields in special register string.");
Opcode = IsThumb2 ? ARM::t2MRRC : ARM::MRRC;
ResTypes.append({ MVT::i32, MVT::i32, MVT::Other });
}
Ops.push_back(getAL(CurDAG, DL));
Ops.push_back(CurDAG->getRegister(0, MVT::i32));
Ops.push_back(N->getOperand(0));
ReplaceNode(N, CurDAG->getMachineNode(Opcode, DL, ResTypes, Ops));
return true;
}
std::string SpecialReg = RegString->getString().lower();
int BankedReg = getBankedRegisterMask(SpecialReg);
if (BankedReg != -1) {
Ops = { CurDAG->getTargetConstant(BankedReg, DL, MVT::i32),
getAL(CurDAG, DL), CurDAG->getRegister(0, MVT::i32),
N->getOperand(0) };
ReplaceNode(
N, CurDAG->getMachineNode(IsThumb2 ? ARM::t2MRSbanked : ARM::MRSbanked,
DL, MVT::i32, MVT::Other, Ops));
return true;
}
// The VFP registers are read by creating SelectionDAG nodes with opcodes
// corresponding to the register that is being read from. So we switch on the
// string to find which opcode we need to use.
unsigned Opcode = StringSwitch<unsigned>(SpecialReg)
.Case("fpscr", ARM::VMRS)
.Case("fpexc", ARM::VMRS_FPEXC)
.Case("fpsid", ARM::VMRS_FPSID)
.Case("mvfr0", ARM::VMRS_MVFR0)
.Case("mvfr1", ARM::VMRS_MVFR1)
.Case("mvfr2", ARM::VMRS_MVFR2)
.Case("fpinst", ARM::VMRS_FPINST)
.Case("fpinst2", ARM::VMRS_FPINST2)
.Default(0);
// If an opcode was found then we can lower the read to a VFP instruction.
if (Opcode) {
if (!Subtarget->hasVFP2Base())
return false;
if (Opcode == ARM::VMRS_MVFR2 && !Subtarget->hasFPARMv8Base())
return false;
Ops = { getAL(CurDAG, DL), CurDAG->getRegister(0, MVT::i32),
N->getOperand(0) };
ReplaceNode(N,
CurDAG->getMachineNode(Opcode, DL, MVT::i32, MVT::Other, Ops));
return true;
}
// If the target is M Class then need to validate that the register string
// is an acceptable value, so check that a mask can be constructed from the
// string.
if (Subtarget->isMClass()) {
int SYSmValue = getMClassRegisterMask(SpecialReg, Subtarget);
if (SYSmValue == -1)
return false;
SDValue Ops[] = { CurDAG->getTargetConstant(SYSmValue, DL, MVT::i32),
getAL(CurDAG, DL), CurDAG->getRegister(0, MVT::i32),
N->getOperand(0) };
ReplaceNode(
N, CurDAG->getMachineNode(ARM::t2MRS_M, DL, MVT::i32, MVT::Other, Ops));
return true;
}
// Here we know the target is not M Class so we need to check if it is one
// of the remaining possible values which are apsr, cpsr or spsr.
if (SpecialReg == "apsr" || SpecialReg == "cpsr") {
Ops = { getAL(CurDAG, DL), CurDAG->getRegister(0, MVT::i32),
N->getOperand(0) };
ReplaceNode(N, CurDAG->getMachineNode(IsThumb2 ? ARM::t2MRS_AR : ARM::MRS,
DL, MVT::i32, MVT::Other, Ops));
return true;
}
if (SpecialReg == "spsr") {
Ops = { getAL(CurDAG, DL), CurDAG->getRegister(0, MVT::i32),
N->getOperand(0) };
ReplaceNode(
N, CurDAG->getMachineNode(IsThumb2 ? ARM::t2MRSsys_AR : ARM::MRSsys, DL,
MVT::i32, MVT::Other, Ops));
return true;
}
return false;
}
// Lower the write_register intrinsic to ARM specific DAG nodes
// using the supplied metadata string to select the instruction node to use
// and the registers/masks to use in the nodes
bool ARMDAGToDAGISel::tryWriteRegister(SDNode *N){
const MDNodeSDNode *MD = dyn_cast<MDNodeSDNode>(N->getOperand(1));
const MDString *RegString = dyn_cast<MDString>(MD->getMD()->getOperand(0));
bool IsThumb2 = Subtarget->isThumb2();
SDLoc DL(N);
std::vector<SDValue> Ops;
getIntOperandsFromRegisterString(RegString->getString(), CurDAG, DL, Ops);
if (!Ops.empty()) {
// If the special register string was constructed of fields (as defined
// in the ACLE) then need to lower to MCR node (32 bit) or
// MCRR node(64 bit), we can make the distinction based on the number of
// operands we have.
unsigned Opcode;
if (Ops.size() == 5) {
Opcode = IsThumb2 ? ARM::t2MCR : ARM::MCR;
Ops.insert(Ops.begin()+2, N->getOperand(2));
} else {
assert(Ops.size() == 3 &&
"Invalid number of fields in special register string.");
Opcode = IsThumb2 ? ARM::t2MCRR : ARM::MCRR;
SDValue WriteValue[] = { N->getOperand(2), N->getOperand(3) };
Ops.insert(Ops.begin()+2, WriteValue, WriteValue+2);
}
Ops.push_back(getAL(CurDAG, DL));
Ops.push_back(CurDAG->getRegister(0, MVT::i32));
Ops.push_back(N->getOperand(0));
ReplaceNode(N, CurDAG->getMachineNode(Opcode, DL, MVT::Other, Ops));
return true;
}
std::string SpecialReg = RegString->getString().lower();
int BankedReg = getBankedRegisterMask(SpecialReg);
if (BankedReg != -1) {
Ops = { CurDAG->getTargetConstant(BankedReg, DL, MVT::i32), N->getOperand(2),
getAL(CurDAG, DL), CurDAG->getRegister(0, MVT::i32),
N->getOperand(0) };
ReplaceNode(
N, CurDAG->getMachineNode(IsThumb2 ? ARM::t2MSRbanked : ARM::MSRbanked,
DL, MVT::Other, Ops));
return true;
}
// The VFP registers are written to by creating SelectionDAG nodes with
// opcodes corresponding to the register that is being written. So we switch
// on the string to find which opcode we need to use.
unsigned Opcode = StringSwitch<unsigned>(SpecialReg)
.Case("fpscr", ARM::VMSR)
.Case("fpexc", ARM::VMSR_FPEXC)
.Case("fpsid", ARM::VMSR_FPSID)
.Case("fpinst", ARM::VMSR_FPINST)
.Case("fpinst2", ARM::VMSR_FPINST2)
.Default(0);
if (Opcode) {
if (!Subtarget->hasVFP2Base())
return false;
Ops = { N->getOperand(2), getAL(CurDAG, DL),
CurDAG->getRegister(0, MVT::i32), N->getOperand(0) };
ReplaceNode(N, CurDAG->getMachineNode(Opcode, DL, MVT::Other, Ops));
return true;
}
std::pair<StringRef, StringRef> Fields;
Fields = StringRef(SpecialReg).rsplit('_');
std::string Reg = Fields.first.str();
StringRef Flags = Fields.second;
// If the target was M Class then need to validate the special register value
// and retrieve the mask for use in the instruction node.
if (Subtarget->isMClass()) {
int SYSmValue = getMClassRegisterMask(SpecialReg, Subtarget);
if (SYSmValue == -1)
return false;
SDValue Ops[] = { CurDAG->getTargetConstant(SYSmValue, DL, MVT::i32),
N->getOperand(2), getAL(CurDAG, DL),
CurDAG->getRegister(0, MVT::i32), N->getOperand(0) };
ReplaceNode(N, CurDAG->getMachineNode(ARM::t2MSR_M, DL, MVT::Other, Ops));
return true;
}
// We then check to see if a valid mask can be constructed for one of the
// register string values permitted for the A and R class cores. These values
// are apsr, spsr and cpsr; these are also valid on older cores.
int Mask = getARClassRegisterMask(Reg, Flags);
if (Mask != -1) {
Ops = { CurDAG->getTargetConstant(Mask, DL, MVT::i32), N->getOperand(2),
getAL(CurDAG, DL), CurDAG->getRegister(0, MVT::i32),
N->getOperand(0) };
ReplaceNode(N, CurDAG->getMachineNode(IsThumb2 ? ARM::t2MSR_AR : ARM::MSR,
DL, MVT::Other, Ops));
return true;
}
return false;
}
bool ARMDAGToDAGISel::tryInlineAsm(SDNode *N){
std::vector<SDValue> AsmNodeOperands;
unsigned Flag, Kind;
bool Changed = false;
unsigned NumOps = N->getNumOperands();
// Normally, i64 data is bounded to two arbitrary GRPs for "%r" constraint.
// However, some instrstions (e.g. ldrexd/strexd in ARM mode) require
// (even/even+1) GPRs and use %n and %Hn to refer to the individual regs
// respectively. Since there is no constraint to explicitly specify a
// reg pair, we use GPRPair reg class for "%r" for 64-bit data. For Thumb,
// the 64-bit data may be referred by H, Q, R modifiers, so we still pack
// them into a GPRPair.
SDLoc dl(N);
SDValue Glue = N->getGluedNode() ? N->getOperand(NumOps-1)
: SDValue(nullptr,0);
SmallVector<bool, 8> OpChanged;
// Glue node will be appended late.
for(unsigned i = 0, e = N->getGluedNode() ? NumOps - 1 : NumOps; i < e; ++i) {
SDValue op = N->getOperand(i);
AsmNodeOperands.push_back(op);
if (i < InlineAsm::Op_FirstOperand)
continue;
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(N->getOperand(i))) {
Flag = C->getZExtValue();
Kind = InlineAsm::getKind(Flag);
}
else
continue;
// Immediate operands to inline asm in the SelectionDAG are modeled with
// two operands. The first is a constant of value InlineAsm::Kind_Imm, and
// the second is a constant with the value of the immediate. If we get here
// and we have a Kind_Imm, skip the next operand, and continue.
if (Kind == InlineAsm::Kind_Imm) {
SDValue op = N->getOperand(++i);
AsmNodeOperands.push_back(op);
continue;
}
unsigned NumRegs = InlineAsm::getNumOperandRegisters(Flag);
if (NumRegs)
OpChanged.push_back(false);
unsigned DefIdx = 0;
bool IsTiedToChangedOp = false;
// If it's a use that is tied with a previous def, it has no
// reg class constraint.
if (Changed && InlineAsm::isUseOperandTiedToDef(Flag, DefIdx))
IsTiedToChangedOp = OpChanged[DefIdx];
// Memory operands to inline asm in the SelectionDAG are modeled with two
// operands: a constant of value InlineAsm::Kind_Mem followed by the input
// operand. If we get here and we have a Kind_Mem, skip the next operand (so
// it doesn't get misinterpreted), and continue. We do this here because
// it's important to update the OpChanged array correctly before moving on.
if (Kind == InlineAsm::Kind_Mem) {
SDValue op = N->getOperand(++i);
AsmNodeOperands.push_back(op);
continue;
}
if (Kind != InlineAsm::Kind_RegUse && Kind != InlineAsm::Kind_RegDef
&& Kind != InlineAsm::Kind_RegDefEarlyClobber)
continue;
unsigned RC;
bool HasRC = InlineAsm::hasRegClassConstraint(Flag, RC);
if ((!IsTiedToChangedOp && (!HasRC || RC != ARM::GPRRegClassID))
|| NumRegs != 2)
continue;
assert((i+2 < NumOps) && "Invalid number of operands in inline asm");
SDValue V0 = N->getOperand(i+1);
SDValue V1 = N->getOperand(i+2);
unsigned Reg0 = cast<RegisterSDNode>(V0)->getReg();
unsigned Reg1 = cast<RegisterSDNode>(V1)->getReg();
SDValue PairedReg;
MachineRegisterInfo &MRI = MF->getRegInfo();
if (Kind == InlineAsm::Kind_RegDef ||
Kind == InlineAsm::Kind_RegDefEarlyClobber) {
// Replace the two GPRs with 1 GPRPair and copy values from GPRPair to
// the original GPRs.
unsigned GPVR = MRI.createVirtualRegister(&ARM::GPRPairRegClass);
PairedReg = CurDAG->getRegister(GPVR, MVT::Untyped);
SDValue Chain = SDValue(N,0);
SDNode *GU = N->getGluedUser();
SDValue RegCopy = CurDAG->getCopyFromReg(Chain, dl, GPVR, MVT::Untyped,
Chain.getValue(1));
// Extract values from a GPRPair reg and copy to the original GPR reg.
SDValue Sub0 = CurDAG->getTargetExtractSubreg(ARM::gsub_0, dl, MVT::i32,
RegCopy);
SDValue Sub1 = CurDAG->getTargetExtractSubreg(ARM::gsub_1, dl, MVT::i32,
RegCopy);
SDValue T0 = CurDAG->getCopyToReg(Sub0, dl, Reg0, Sub0,
RegCopy.getValue(1));
SDValue T1 = CurDAG->getCopyToReg(Sub1, dl, Reg1, Sub1, T0.getValue(1));
// Update the original glue user.
std::vector<SDValue> Ops(GU->op_begin(), GU->op_end()-1);
Ops.push_back(T1.getValue(1));
CurDAG->UpdateNodeOperands(GU, Ops);
}
else {
// For Kind == InlineAsm::Kind_RegUse, we first copy two GPRs into a
// GPRPair and then pass the GPRPair to the inline asm.
SDValue Chain = AsmNodeOperands[InlineAsm::Op_InputChain];
// As REG_SEQ doesn't take RegisterSDNode, we copy them first.
SDValue T0 = CurDAG->getCopyFromReg(Chain, dl, Reg0, MVT::i32,
Chain.getValue(1));
SDValue T1 = CurDAG->getCopyFromReg(Chain, dl, Reg1, MVT::i32,
T0.getValue(1));
SDValue Pair = SDValue(createGPRPairNode(MVT::Untyped, T0, T1), 0);
// Copy REG_SEQ into a GPRPair-typed VR and replace the original two
// i32 VRs of inline asm with it.
unsigned GPVR = MRI.createVirtualRegister(&ARM::GPRPairRegClass);
PairedReg = CurDAG->getRegister(GPVR, MVT::Untyped);
Chain = CurDAG->getCopyToReg(T1, dl, GPVR, Pair, T1.getValue(1));
AsmNodeOperands[InlineAsm::Op_InputChain] = Chain;
Glue = Chain.getValue(1);
}
Changed = true;
if(PairedReg.getNode()) {
OpChanged[OpChanged.size() -1 ] = true;
Flag = InlineAsm::getFlagWord(Kind, 1 /* RegNum*/);
if (IsTiedToChangedOp)
Flag = InlineAsm::getFlagWordForMatchingOp(Flag, DefIdx);
else
Flag = InlineAsm::getFlagWordForRegClass(Flag, ARM::GPRPairRegClassID);
// Replace the current flag.
AsmNodeOperands[AsmNodeOperands.size() -1] = CurDAG->getTargetConstant(
Flag, dl, MVT::i32);
// Add the new register node and skip the original two GPRs.
AsmNodeOperands.push_back(PairedReg);
// Skip the next two GPRs.
i += 2;
}
}
if (Glue.getNode())
AsmNodeOperands.push_back(Glue);
if (!Changed)
return false;
SDValue New = CurDAG->getNode(N->getOpcode(), SDLoc(N),
CurDAG->getVTList(MVT::Other, MVT::Glue), AsmNodeOperands);
New->setNodeId(-1);
ReplaceNode(N, New.getNode());
return true;
}
bool ARMDAGToDAGISel::
SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
std::vector<SDValue> &OutOps) {
switch(ConstraintID) {
default:
llvm_unreachable("Unexpected asm memory constraint");
case InlineAsm::Constraint_i:
// FIXME: It seems strange that 'i' is needed here since it's supposed to
// be an immediate and not a memory constraint.
LLVM_FALLTHROUGH;
case InlineAsm::Constraint_m:
case InlineAsm::Constraint_o:
case InlineAsm::Constraint_Q:
case InlineAsm::Constraint_Um:
case InlineAsm::Constraint_Un:
case InlineAsm::Constraint_Uq:
case InlineAsm::Constraint_Us:
case InlineAsm::Constraint_Ut:
case InlineAsm::Constraint_Uv:
case InlineAsm::Constraint_Uy:
// Require the address to be in a register. That is safe for all ARM
// variants and it is hard to do anything much smarter without knowing
// how the operand is used.
OutOps.push_back(Op);
return false;
}
return true;
}
/// createARMISelDag - This pass converts a legalized DAG into a
/// ARM-specific DAG, ready for instruction scheduling.
///
FunctionPass *llvm::createARMISelDag(ARMBaseTargetMachine &TM,
CodeGenOpt::Level OptLevel) {
return new ARMDAGToDAGISel(TM, OptLevel);
}
|
Java
|
package com.huawei.esdk.sms.north.http.common;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.huawei.esdk.platform.common.utils.ESDKIOUtils;
import com.huawei.esdk.platform.common.utils.help.DocumentBuilderFactories;
import com.huawei.esdk.sms.north.http.bean.PlaceHolderBean;
public abstract class AbstractXMLProcessor implements IXMLProcessor
{
private static Logger LOGGER = Logger.getLogger(AbstractXMLProcessor.class);
@Override
public List<PlaceHolderBean> processClasspathXMLFile(String fileName)
throws ParserConfigurationException, SAXException, IOException
{
String xmlContent = ESDKIOUtils.getClasspathFileContent(fileName);
return parseXML(xmlContent);
}
@Override
public List<PlaceHolderBean> processXML(String xmlContent)
throws ParserConfigurationException, SAXException, IOException
{
return parseXML(xmlContent);
}
protected List<PlaceHolderBean> parseXML(String xmlAsString)
throws ParserConfigurationException, SAXException, IOException
{
DocumentBuilderFactory dbFactory = DocumentBuilderFactories.newSecurityInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(new InputSource(new ByteArrayInputStream(xmlAsString.getBytes("utf-8"))));
doc.getDocumentElement().normalize();
Element rootElement = doc.getDocumentElement();
List<PlaceHolderBean> result = new ArrayList<PlaceHolderBean>();
return parseNode(rootElement, result);
}
protected List<PlaceHolderBean> parseNode(Node nNode, List<PlaceHolderBean> placerHolders)
{
StringBuilder sb = new StringBuilder();
if (LOGGER.isDebugEnabled())
{
sb.append("Current Node :").append(nNode.getNodeName());
sb.append("|Node Type:").append(nNode.getNodeType());
sb.append("|Node Value:").append(nNode.getNodeValue());
sb.append("|Text Value:" + nNode.getTextContent());
LOGGER.debug(sb.toString());
}
if (nNode.getNodeType() == Node.ELEMENT_NODE)
{
Element eElement = (Element)nNode;
if (hasSubElement(nNode))
{
NodeList nList = nNode.getChildNodes();
Node nodeItem;
for (int temp = 0; temp < nList.getLength(); temp++)
{
nodeItem = nList.item(temp);
parseNode(nodeItem, placerHolders);
}
}
else
{
if (LOGGER.isDebugEnabled())
{
sb.delete(0, sb.length());
sb.append("Tag Name:").append(eElement.getTagName());
sb.append("|Node Name:").append(eElement.getNodeName());
sb.append("|Node Value:").append(eElement.getNodeValue());
sb.append("|Text Content:").append(eElement.getTextContent());
LOGGER.debug(sb.toString());
}
//It's the element which hasn't child element and should be processed
PlaceHolderBean placeHolder = processElement(eElement);
if (null != placeHolder)
{
placerHolders.add(placeHolder);
}
}
}
return placerHolders;
}
private boolean hasSubElement(Node node)
{
if (null == node || Node.ELEMENT_NODE != node.getNodeType())
{
return false;
}
NodeList nList = node.getChildNodes();
Node nodeItem;
for (int temp = 0; temp < nList.getLength(); temp++)
{
nodeItem = nList.item(temp);
if (Node.ELEMENT_NODE == nodeItem.getNodeType())
{
return true;
}
}
return false;
}
protected abstract PlaceHolderBean processElement(Element element);
}
|
Java
|
<!DOCTYPE html >
<html >
<head>
<title> {gooraye:$f_siteTitle} {gooraye:$f_siteName}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="{gooraye:$f_metaKeyword}" />
<meta name="description" content="{gooraye:$f_metaDes}" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<!-- <link rel="stylesheet" type="text/css" href="{gooraye::RES}/css/style_2_common.css" /> -->
<link href="{gooraye::STATICS}/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<script>var SITEURL='';</script>
<!-- <script src="{gooraye::RES}/js/common.js" type="text/javascript"></script> -->
<script src="{gooraye::STATICS}/jquery-1.9.1.js" type="text/javascript"></script>
<script src="{gooraye::RES}/js/index.js" type="text/javascript"></script>
<link href="{gooraye::RES}/css/style.css" rel="stylesheet" type="text/css" />
<link href="{gooraye::RES}/css/user.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function(){
initComponent();
})
</script>
<style type="text/css">
.mask{
width: 99999px;
height: 99999px;
background: rgba(85, 85, 85, 0.55);
position: absolute;
z-index: 10;
top: 0px;
}
.goorayealert{
display: none;
background: #f8f8f8;
padding: 15px;
top:100px;
width:460px;
position: absolute;
left: 50%;
z-index: 15;
margin-left: -230px;
}
.alertcontent{
background-color: #fff;
}
.close:hover{
color:#000;
}
.close{
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000;
top:-6px;
text-shadow: 0 1px 0 #fff;
opacity: .2;
filter: alpha(opacity=20);
cursor: pointer;
position: relative;
}
</style>
</head>
<body id="nv_member" class="pg_CURMODULE">
<div class="topbg">
<!-- top START -->
<div class="top">
<!-- toplink START -->
<div class="toplink">
<div class="memberinfo" id="destoon_member">
<a href="{gooraye::U('User/Index/index')}">
<img class="logo" src="{gooraye::RES}/images/logo.png">
</a>
<!-- <img src="{gooraye:$wecha.headerpic}" width="60" height="60">
<strong>{gooraye:$wecha.wxname}</strong><a href="#" target="_blank" class="vipimg vip-icon<php>echo $userinfo['taxisid']-1;</php>" title=""></a> -->
<if condition="$_SESSION[uid]==false">
<else/>
你好,<a href="{gooraye::U('User/Index/index')}" hidefocus="true" ><span style="color:#f40">{gooraye:$Think.session.uname}</span></a>(uid:{gooraye:$Think.session.uid})
<a class="btn btn-small btn-inverse" href="{gooraye::U('System/Admin/logout')}" ><i class="fa fa-power-off " title="退出系统"></i></a>
</if>
</div>
<!-- memberinfo END -->
</div>
<!-- toplink END -->
</div>
<!-- top END -->
<!-- wp 块 START -->
<div id="wp" class="wp">
<!-- contentmanage 块 START -->
<div class="contentmanage">
<!-- developer 块 START -->
<div class="developer">
|
Java
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_03.html">Class Test_AbaRouteValidator_03</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_4359_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_03.html?line=44681#src-44681" >testAbaNumberCheck_4359_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:33:07
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_4359_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=40441#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html>
|
Java
|
/*
* Copyright [1999-2017] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __INTRONSUPPORTINGEVIDENCE_H__
#define __INTRONSUPPORTINGEVIDENCE_H__
#include "DataModelTypes.h"
#include "SeqFeature.h"
#define INTRONSUPPORTINGEVIDENCEFUNCS_DATA(CLASSTYPE) \
SEQFEATUREFUNCS_DATA(CLASSTYPE)
SEQFEATUREFUNC_TYPES(IntronSupportingEvidence)
typedef struct IntronSupportingEvidenceFuncsStruct {
INTRONSUPPORTINGEVIDENCEFUNCS_DATA(IntronSupportingEvidence)
} IntronSupportingEvidenceFuncs;
#define INTRONSUPPORTINGEVIDENCE_DATA \
SEQFEATURE_DATA \
char isSpliceCanonical; \
char * hitName; \
ECOSTRING scoreType;
#define FUNCSTRUCTTYPE IntronSupportingEvidenceFuncs
struct IntronSupportingEvidenceStruct {
INTRONSUPPORTINGEVIDENCE_DATA
};
#undef FUNCSTRUCTTYPE
IntronSupportingEvidence *IntronSupportingEvidence_new(void);
Intron *IntronSupportingEvidence_getIntron(IntronSupportingEvidence *ise, Transcript *transcript);
void IntronSupportingEvidence_setValuesFromIntron(IntronSupportingEvidence *ise, Intron *intron);
int IntronSupportingEvidence_hasLinkedTranscripts(IntronSupportingEvidence *ise);
Exon *IntronSupportingEvidence_findPreviousExon(IntronSupportingEvidence *ise, Transcript *transcript);
Exon *IntronSupportingEvidence_findNextExon(IntronSupportingEvidence *ise, Transcript *transcript);
#define IntronSupportingEvidence_isStored(ise, db) Storable_isStored(&((ise)->st), (db))
ECOSTRING IntronSupportingEvidence_setScoreType(IntronSupportingEvidence *ise, char *scoreType);
#define IntronSupportingEvidence_getScoreType(ise) (ise)->scoreType
char *IntronSupportingEvidence_setHitName(IntronSupportingEvidence *ise, char *str);
#define IntronSupportingEvidence_getHitName(ise) (ise)->hitName
#define IntronSupportingEvidence_setIsSpliceCanonical(ise,flag) (ise)->isSpliceCanonical = (flag)
#define IntronSupportingEvidence_getIsSpliceCanonical(ise) (ise)->isSpliceCanonical
#define IntronSupportingEvidence_setStart(ise,start) SeqFeature_setStart((ise),(start))
#define IntronSupportingEvidence_getStart(ise) SeqFeature_getStart((ise))
#define IntronSupportingEvidence_setEnd(ise,end) SeqFeature_setEnd((ise),(end))
#define IntronSupportingEvidence_getEnd(ise) SeqFeature_getEnd((ise))
#define IntronSupportingEvidence_setStrand(ise,strand) SeqFeature_setStrand((ise),(strand))
#define IntronSupportingEvidence_getStrand(ise) SeqFeature_getStrand((ise))
#define IntronSupportingEvidence_setDbID(ise,dbID) SeqFeature_setDbID((ise),(dbID))
#define IntronSupportingEvidence_getDbID(ise) SeqFeature_getDbID((ise))
#define IntronSupportingEvidence_setAnalysis(ise,anal) SeqFeature_setAnalysis((ise),(anal))
#define IntronSupportingEvidence_getAnalysis(ise) SeqFeature_getAnalysis((ise))
#define IntronSupportingEvidence_setAdaptor(ise,adaptor) SeqFeature_setAdaptor((ise),(adaptor))
#define IntronSupportingEvidence_getAdaptor(ise) SeqFeature_getAdaptor((ise))
#define IntronSupportingEvidence_setSlice(ise,contig) SeqFeature_setSlice((ise),(contig))
#define IntronSupportingEvidence_getSlice(ise) SeqFeature_getSlice((ise))
#define IntronSupportingEvidence_setScore(ise,score) SeqFeature_setScore((ise),(score))
#define IntronSupportingEvidence_getScore(ise) SeqFeature_getScore((ise))
#define IntronSupportingEvidence_free(ise) SeqFeature_free((ise))
void IntronSupportingEvidence_freeImpl(IntronSupportingEvidence *ise);
#define IntronSupportingEvidence_getSeqRegionStart(ise) SeqFeature_getSeqRegionStart((SeqFeature *)(ise))
#define IntronSupportingEvidence_getSeqRegionEnd(ise) SeqFeature_getSeqRegionEnd((SeqFeature *)(ise))
#define IntronSupportingEvidence_getSeqRegionStrand(ise) SeqFeature_getSeqRegionStrand((SeqFeature *)(ise))
IntronSupportingEvidence *IntronSupportingEvidence_shallowCopyImpl(IntronSupportingEvidence *ise);
#define IntronSupportingEvidence_shallowCopy(ise) SeqFeature_shallowCopy((ise))
#ifdef __INTRONSUPPORTINGEVIDENCE_MAIN__
IntronSupportingEvidenceFuncs
intronSupportingEvidenceFuncs = {
IntronSupportingEvidence_freeImpl, // free
IntronSupportingEvidence_shallowCopyImpl, // shallowCopy
NULL, // deepCopy
NULL, // getStart
NULL, // setStart
NULL, // getEnd
NULL // setEnd
};
#else
extern IntronSupportingEvidenceFuncs intronSupportingEvidenceFuncs;
#endif
#endif
|
Java
|
# Copyright © 2014, Microsoft Corporation. All rights reserved.
@{
# Version number of this module.
ModuleVersion = '0.3.0.0'
# ID used to uniquely identify this module
GUID = '1088cfb5-36e8-4e9f-b7e4-d49e8032dde6'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement for this module
Copyright = '(c) 2014 Microsoft Corporation. All rights reserved.'
# Description of the functionality provided by this module
Description = 'Module with DSC Resources for Just Enough Admin (JEA). Jea makes it simple to create custom RBAC solutions using PowerShell.'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '4.0'
NestedModules = ".\xjea.psm1"
# Minimum version of the common language runtime (CLR) required by this module
CLRVersion = '4.0'
# Functions to export from this module
FunctionsToExport = '*'
# Cmdlets to export from this module
CmdletsToExport = '*'
}
|
Java
|
package com.example;
/**
* Created by Nish on 2/21/15.
*/
public interface Movable {
public void moveLeft();
public void moveRight();
}
|
Java
|
# AUTOGENERATED FILE
FROM balenalib/orange-pi-zero-alpine:3.13-run
ENV GO_VERSION 1.16.14
# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
# gcc for cgo
RUN apk add --no-cache git gcc ca-certificates
RUN fetchDeps='curl' \
&& set -x \
&& apk add --no-cache $fetchDeps \
&& mkdir -p /usr/local/go \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-alpine-armv7hf.tar.gz" \
&& echo "39f009c69b763f83d7e885f305d3f505710fc9bee56ffc29cc6472d05bbbcbe0 go$GO_VERSION.linux-alpine-armv7hf.tar.gz" | sha256sum -c - \
&& tar -xzf "go$GO_VERSION.linux-alpine-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \
&& rm -f go$GO_VERSION.linux-alpine-armv7hf.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/613d8e9ca8540f29a43fddf658db56a8d826fffe/scripts/assets/tests/test-stack@golang.sh" \
&& echo "Running test-stack@golang" \
&& chmod +x test-stack@golang.sh \
&& bash test-stack@golang.sh \
&& rm -rf test-stack@golang.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux 3.13 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.16.14 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh
|
Java
|
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
"""Python front-end supports for functions.
NOTE: functions are currently experimental and subject to change!
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import hashlib
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import function_pb2
from tensorflow.python import pywrap_tensorflow as c_api
from tensorflow.python.eager import context
from tensorflow.python.framework import c_api_util
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import graph_to_function_def
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import resource_variable_ops
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.util import compat
from tensorflow.python.util import function_utils
from tensorflow.python.util import tf_contextlib
from tensorflow.python.util import tf_inspect
class Defun(object):
"""Decorator used to define TensorFlow functions.
Use this decorator to make a Python function usable directly as a TensorFlow
function.
The decorated function must add ops to the default graph and return zero or
more `Tensor` objects. Call the decorator with named arguments, one for each
argument of the function to decorate, with the expected type of the argument
as value.
For example if the function to decorate accepts two `tf.float32` arguments
named `x` and `y`, call the decorator with:
@Defun(tf.float32, tf.float32)
def foo(x, y):
...
When you call the decorated function it will add `call` ops to the
default graph and adds the definition of the function into the
default graph. Because the addition of the function into the graph
is deferred, the decorator can be used anywhere in the program.
Any variables created inside of the function are hoisted into the outer graph.
Note that the variables are created in the variable scope that was active
during the first call to the function. Subsequent function calls will refer to
the same set of variables.
Definitions of functions in a graph are frozen as soon as the graph is used to
create a session. However, new functions and new calls to existing functions
may be added to the graph, with the new functions themselves becoming
immediately frozen.
Example, but also see the [How To on functions](link_needed).
```python
# Defining the function.
@tf.Defun(tf.float32, tf.float32)
def MyFunc(x, y):
return x + y, x - y
# Building the graph.
a = tf.constant([1.0])
b = tf.constant([2.0])
c, d = MyFunc(a, b, name='mycall')
```
"""
def __init__(self, *input_types, **kwargs):
"""Create a `Defun` decorator.
Args:
*input_types: A list of `tf.DType`
**kwargs: Optional keyword arguments, including
func_name - (optional). A python string, the name to use to
declare this `Function` in the graph.
grad_func - (optional). A function implementing the gradient
of the function-to-register. This is must be a
`_DefinedFunction` object. The gradient
function must satisfy the criterion defined in
function.proto:GradientDef.
python_grad_func - (optional). A function implementing the
gradient of the function python-side. This function must
take the current op and the gradients w.r.t. its outputs,
and return the gradients w.r.t. the inputs. That is it must
implement the interface expected by `tf.RegisterGradient`).
This will be called by tf.gradients to add the gradient ops
to the graph. At most one of grad_func and python_grad_func
can be specified.
out_names = (optional). A list of strings, one per output
tensor.
shape_func - (optional). A function taking the op and returning a list
of static shapes to set for the function's outputs.
"""
self._input_types = input_types
self._func_name = kwargs.pop("func_name", None)
self._grad_func = kwargs.pop("grad_func", None)
self._python_grad_func = kwargs.pop("python_grad_func", None)
self._out_names = kwargs.pop("out_names", None)
self._extra_kwargs = kwargs
def __call__(self, func):
# Various sanity checks on the callable func.
if not callable(func):
raise ValueError("func %s must be callable" % func)
# Func should not use kwargs and defaults.
argspec = tf_inspect.getargspec(func)
if argspec.keywords or argspec.defaults:
raise ValueError("Functions with argument defaults or keyword "
"arguments are not supported.")
# Computes how many arguments 'func' has.
min_args = len(argspec.args)
max_args = min_args
if argspec.varargs:
max_args = 1000000
argnames = argspec.args
if tf_inspect.ismethod(func):
# 1st argument is the "class" type.
min_args -= 1
argnames = argnames[1:]
if self._input_types:
# If Defun is given a list of types for the inputs, the number
# of input types should be compatible with 'func'.
num = len(self._input_types)
if num < min_args or num > max_args:
raise ValueError(
"The function has fewer arguments than the number of specified "
"input types.")
return _DefinedFunction(
func,
argnames,
self._input_types,
self._func_name,
self._grad_func,
self._python_grad_func,
out_names=self._out_names,
**self._extra_kwargs)
# 'func' expects no arguments and input types is an empty list.
if min_args == 0 and max_args == 0:
return _DefinedFunction(
func, [], [],
self._func_name,
self._grad_func,
self._python_grad_func,
out_names=self._out_names,
**self._extra_kwargs)
# Input types are unknown. It's an overloaded function and hence
# its definition needs to be deferred until it's called.
return _OverloadedFunction(
func,
argnames,
self._func_name,
self._grad_func,
self._python_grad_func,
out_names=self._out_names,
**self._extra_kwargs)
class _DefinedFunction(object):
"""_DefinedFunction encapsulates a function definition and its properties.
Attributes:
name: The function name.
definition: The definition of this function. A FunctionDef proto.
grad_func_name: If not None, the name of this function's gradient function.
python_grad_func: A python callable implementing the gradient of
the function python-side.
"""
def __init__(self,
func,
argnames,
input_types,
func_name=None,
grad_func=None,
python_grad_func=None,
out_names=None,
shape_func=None,
capture_by_value=False,
**kwargs):
"""Creates _DefinedFunction.
Args:
func: A python callable which constructs a tf function body.
argnames: A list of strings for function argument names.
input_types: The function's argument types. Can be a tuple, list of
tf data types.
func_name: The function name. Defaults to None, in which derives from
'func'.
grad_func: This function's gradient function, if not None. Defaults
to None.
python_grad_func: A python callable implementing the gradient of
the function python-side.
out_names: An optional list of strings for the function return value
names.
shape_func: An optional function mapping an op to a list of static
output shapes.
capture_by_value: Boolean (defaults to False). If True, captured values
will be copied into the function body.
**kwargs: The keyword arguments. **kwargs is passed to every call
site of this function.
Raises:
ValueError: The function definition is invalid.
"""
self._func = func
self._input_types = input_types
self._func_name = func_name
self._grad_func = grad_func
self._python_grad_func = python_grad_func
self._out_names = out_names
self._shape_func = shape_func
self._capture_by_value = capture_by_value
self._extra_kwargs = kwargs
# Constructed only when C API is disabled, lazily
self._definition = None
# Constructed only when C API is enabled, lazily
self._c_func = None
self._sub_functions = dict() # Constructed with _definition or _c_func
# pylint: disable=protected-access
device_funcs = ops.get_default_graph()._device_functions_outer_to_inner
# pylint: enable=protected-access
# Get the innermost device if possbile.
self._caller_device = device_funcs[-1] if device_funcs else None
# Cached OpDef for this function. When C API is enabled, this is
# the only part of FunctionDef that we cache in Python. When C API
# is disabled the whole _definition is available and this is simply
# another reference to _definition.signature
self._op_def = None
assert isinstance(input_types, (list, tuple))
self._arg_types = input_types
self._arg_names = [argnames[i] if i < len(argnames) else ("arg%d" % i)
for i in range(len(input_types))]
@property
def name(self):
"""Function name."""
self._create_definition_if_needed()
return self._func_name
@property
def definition(self):
"""Function definition proto."""
self._create_definition_if_needed()
if self._c_func:
with c_api_util.tf_buffer() as buf:
c_api.TF_FunctionToFunctionDef(self._c_func.func, buf)
fdef = function_pb2.FunctionDef()
proto_data = c_api.TF_GetBuffer(buf)
fdef.ParseFromString(compat.as_bytes(proto_data))
return fdef
return self._definition
@property
def _signature(self):
self._create_definition_if_needed()
return self._op_def
def set_grad_func(self, grad_func):
"""Specifies the gradient function of this function."""
assert not self._grad_func
assert isinstance(grad_func, _DefinedFunction)
self._grad_func = grad_func
@property
def grad_func_name(self):
"""Its gradient function's name."""
return self._grad_func.name if self._grad_func else None
@property
def python_grad_func(self):
"""Python gradient function callable."""
return self._python_grad_func
@property
def declared_input_types(self):
"""Returns the list of data types of explicit declared inputs."""
return self._input_types
@property
def captured_inputs(self):
"""Returns the list of implicitly captured inputs."""
self._create_definition_if_needed()
return self._extra_inputs
@property
def stateful_ops(self):
"""Returns the list of stateful ops in function definition.
Returns:
A list of (op.name, op.type) pairs.
"""
self._create_definition_if_needed()
return self._stateful_ops
def _create_definition_if_needed(self):
"""Creates the function definition if it's not created yet."""
with context.graph_mode():
self._create_definition_if_needed_impl()
def _create_definition_if_needed_impl(self):
"""This is not what you want, see _create_definition_if_needed."""
if self._definition is not None or self._c_func is not None:
return
temp_graph = func_graph_from_py_func(
self._func, self._arg_names, self._arg_types, self._func_name,
self._capture_by_value, self._caller_device)
self._extra_inputs = temp_graph.extra_inputs
# pylint: disable=protected-access
self._sub_functions = temp_graph._functions
# pylint: enable=protected-access
# Extra kwargs are treated as attrs on the function def.
if self._func_name:
base_func_name = self._func_name
else:
base_func_name = function_utils.get_func_name(self._func)
if self._grad_func:
base_func_name += ("_%s" % self._grad_func.name)
kwargs_attr = _parse_kwargs_as_attrs(base_func_name, **self._extra_kwargs)
if not temp_graph._c_graph: # pylint: disable=protected-access
# Build the FunctionDef
self._definition = graph_to_function_def.graph_to_function_def(
temp_graph,
temp_graph.get_operations(),
temp_graph.inputs,
temp_graph.outputs,
out_names=self._out_names)
for k in kwargs_attr:
self._definition.attr[k].CopyFrom(kwargs_attr[k])
# Hash the definition and its dependencies.
self._hash_str = self._create_hash_str(
self._definition.signature.input_arg,
self._definition.signature.output_arg, self._definition.node_def)
# Finally, we decide the function name to use. If not specified,
# make up something which is almost certainly unique (but deterministic).
if not self._func_name:
self._func_name = "_".join([base_func_name, self._hash_str])
self._definition.signature.name = self._func_name
if self._func.__doc__:
self._definition.signature.description = self._func.__doc__
self._op_def = self._definition.signature
else: # C API is enabled
output_names = ([compat.as_bytes(x) for x in self._out_names]
if self._out_names else [])
description = self._func.__doc__ or None
# pylint: disable=protected-access
c_func = c_api.TF_GraphToFunction_wrapper(
temp_graph._c_graph,
base_func_name,
self._func_name is None, # append_hash_to_fn_name
None, # opers
[t._as_tf_output() for t in temp_graph.inputs],
[t._as_tf_output() for t in temp_graph.outputs],
output_names,
None, # opts
description)
self._c_func = c_api_util.ScopedTFFunction(c_func)
# pylint: enable=protected-access
self._set_c_attrs(kwargs_attr)
# Set cached fields: _op_def and _func_name (if not already set)
self._op_def = self.definition.signature
if self._func_name:
assert self._func_name == self._op_def.name
else:
self._func_name = compat.as_str(self._op_def.name)
self._stateful_ops = [(op.name, op.type)
for op in temp_graph.get_operations()
if op.op_def.is_stateful]
def _set_c_attrs(self, attrs):
"""Sets `attrs` as attributes of self._c_func.
Requires that self._c_func is not None.
Args:
attrs: a dictionary from attribute name to attribute proto value
"""
for name, attr_value in attrs.items():
serialized = attr_value.SerializeToString()
# TODO(skyewm): this creates and deletes a new TF_Status for every attr.
# It might be worth creating a convenient way to re-use the same status.
c_api.TF_FunctionSetAttrValueProto(self._c_func.func, compat.as_str(name),
serialized)
def _create_hash_str(self, input_arg, output_arg, node_def):
"""Creates an 8-character string unique to this input.
Args:
input_arg: the input_arg field of an OpDef
(e.g. self._definition.signature.input_arg)
output_arg: the output_arg field of an OpDef
(e.g. self._definition.signature.output_arg)
node_def: the node_def field of a FunctionDef
(e.g. self._definition.node_def)
Returns:
The unique string for this input
"""
hasher = hashlib.sha1()
def update_num(n):
hasher.update(compat.as_bytes("%x" % n))
def update_str(s):
update_num(len(s))
hasher.update(compat.as_bytes(s))
def update_strs(slist):
update_num(len(slist))
for s in slist:
update_str(s)
for adef in input_arg:
update_str(adef.SerializeToString())
for adef in output_arg:
update_str(adef.SerializeToString())
for n in sorted(node_def, key=lambda n: n.name):
update_str(n.name)
update_str(n.op)
update_strs(n.input)
update_num(len(n.attr))
# NOTE: protobuf map serialization does not guarantee ordering.
for k in sorted(n.attr):
update_str(k)
update_str(n.attr[k].SerializeToString())
return hasher.hexdigest()[:8]
def add_to_graph(self, g):
"""Adds this function into the graph g."""
self._create_definition_if_needed()
# Adds this function into 'g'.
# pylint: disable=protected-access
if context.executing_eagerly():
context.context().add_function_def(self.definition)
else:
g._add_function(self)
# pylint: enable=protected-access
# Ensures related sub-routines are defined in 'g', too.
for f in self._sub_functions.values():
f.add_to_graph(g)
# Adds its gradient function, too.
if self._grad_func:
self._grad_func.add_to_graph(g)
def __call__(self, *args, **kwargs):
self.add_to_graph(ops.get_default_graph())
args = [ops.convert_to_tensor(_) for _ in args] + self._extra_inputs
ret, op = _call(self._signature, *args, **kwargs)
# Set a hidden attr in 'op' so that gradients_impl can refer back
# to this _DefinedFunction instance to access python_grad_func.
assert isinstance(op, ops.Operation)
setattr(op, "__defun", self)
if self._shape_func is not None:
shapes = self._shape_func(op)
if len(shapes) != len(op.outputs):
raise ValueError("shape_func produced %d shapes for %d outputs" %
(len(shapes), len(op.outputs)))
for (t, shape) in zip(op.outputs, shapes):
t.set_shape(shape)
return ret
class _OverloadedFunction(object):
"""_OverloadedFunction encapsulates an overloaded function.
_OverloadedFunction maintains a mapping from input types to
instantiated _DefinedFunction in self._overload.
"""
def __init__(self,
func,
argnames,
func_name=None,
grad_func=None,
python_grad_func=None,
out_names=None,
**kwargs):
"""Creates _DefinedFunction.
Args:
func: A python callable which constructs a tf function body.
argnames: A list of strings for function argument names.
func_name: The function name. Defaults to None, in which derives from
'func'.
grad_func: This function's gradient function, if not None. Defaults
to None.
python_grad_func: A python callable implementing the gradient of
the function python-side.
out_names: A list of strings for the function return value names.
**kwargs: The keyword arguments. **kwargs is passed to every call
site of this function.
Raises:
ValueError: The function definition is invalid.
"""
self._func = func
self._argnames = argnames
self._func_name = func_name
assert grad_func is None or isinstance(grad_func, _OverloadedFunction)
self._grad_func = grad_func
self._python_grad_func = python_grad_func
self._out_names = out_names
self._extra_kwargs = kwargs
self._overload = {}
def instantiate(self, input_types):
"""Instantiate this function given input argument types.
Args:
input_types: A list of data types for the inputs.
Returns:
_DefinedFunction for the given input types.
"""
# Stringify the type list.
key = _type_list_to_str(input_types)
defined = self._overload.get(key)
if not defined:
# If not defined yet, define the function given the input types.
name = self._func_name
if name is not None:
name = "_".join([name, key])
defined = _DefinedFunction(
self._func,
self._argnames,
input_types,
name,
None,
self._python_grad_func,
out_names=self._out_names,
**self._extra_kwargs)
_ = defined.name # Fully instantiate the function definition.
if self._grad_func:
# If _grad_func is given, it is another
# _OverloadedFunction. We need to instantiate it with the
# right input types.
output_types = [
dtypes.DType(_.type) for _ in defined._signature.output_arg # pylint: disable=protected-access
]
# pylint: disable=protected-access
defined._grad_func = self._grad_func.instantiate(input_types +
output_types)
# pylint: enable=protected-access
self._overload[key] = defined
return defined
def __call__(self, *args, **kwargs):
input_types = []
args = list(args)
for (i, x) in enumerate(args):
x = ops.convert_to_tensor(x)
if not isinstance(x, ops.Tensor):
raise ValueError("Expect a Tensor but get ", x)
input_types.append(x.dtype)
args[i] = x
return self.instantiate(input_types)(*args, **kwargs)
class _FuncGraph(ops.Graph):
"""A helper for constructing a function.
_FuncGraph overrides ops.Graph's create_op() so that we can keep
track of all inputs into every op created inside the function. If
any input is from other graphs, we keep track of it in self.capture
and substitute the input with a place holder.
Each captured input's corresponding place holder is converted into a
function argument and the caller passes in the captured tensor.
"""
def __init__(self, name, capture_by_value, *args, **kwargs):
super(_FuncGraph, self).__init__(*args, **kwargs)
self._capture_by_value = capture_by_value
self._building_function = True
self._outer_graph = ops.get_default_graph()
self._vscope = vs.get_variable_scope()
self._old_custom_getter = self._vscope.custom_getter
# The name of the function.
self.name = name
# Placeholder tensors representing the inputs to this function. The tensors
# are in this _FuncGraph.
self.inputs = []
# Tensors that will be returned this function. The tensors are in this
# _FuncGraph.
self.outputs = []
# Maps external tensor -> internal tensor (e.g. input placeholder).
self._captured = {}
# The external tensors that have been captured as inputs and must be passed
# to this function (empty if capturing by value, otherwise these are the
# keys of _captured).
self.extra_inputs = []
# Input placeholders that been added for captured values (empty if capturing
# by value).
self.extra_args = []
# Captured variables.
# TODO(skyewm): is this needed?
self.extra_vars = []
# pylint: disable=g-doc-return-or-yield
@tf_contextlib.contextmanager
def container(self, container_name):
"""Returns a context manager that specifies the resource container to use.
Overridden from `tf.Graph` to update both the init_scope container
and the present inner container. This is necessary to make sure setting
containers applies correctly both to created variables and to stateful
ops.
Args:
container_name: container name string.
Returns:
A context manager for defining resource containers for stateful ops,
yields the container name.
"""
original_container = self._container
# pylint: disable=protected-access
with ops.init_scope():
original_init_container = ops.get_default_graph()._container
try:
self._container = container_name
with ops.init_scope():
ops.get_default_graph()._container = container_name
yield self._container
finally:
self._container = original_container
with ops.init_scope():
ops.get_default_graph()._container = original_init_container
# pylint: enable=protected-access
# pylint: enable=g-doc-return-or-yield
def getvar(
self,
getter,
name,
shape=None,
dtype=None,
initializer=None,
reuse=None,
trainable=True,
collections=None, # pylint: disable=redefined-outer-name
use_resource=None,
**kwargs):
"""A custom variable getter."""
# Here, we switch the default graph to the outer graph and ask the
# variable scope in which the function is defined to give us the
# variable. The variable is stashed in extra_vars and returned to
# the caller.
#
# We capture these variables so that the variable definition is
# hoisted upward to the outer most graph.
with self._outer_graph.as_default():
# pylint: disable=protected-access
var = self._vscope.get_variable(
vs._get_default_variable_store(),
name,
shape=shape,
dtype=dtype,
initializer=initializer,
reuse=reuse,
trainable=trainable,
collections=collections,
use_resource=use_resource)
self.extra_vars.append(var)
if isinstance(var, resource_variable_ops.ResourceVariable):
# For resource-based variables read the variable outside the function
# and pass in the value. This ensures that the function is pure and
# differentiable. TODO(apassos) this may have performance problems if
# the function will only do embedding lookups on the variable.
return var.value()
return var
def create_op(self, op_type, inputs, data_types, **kwargs):
for i, x in enumerate(inputs):
if isinstance(x, ops.EagerTensor) or x.graph is not self:
inputs[i] = self.capture(x)
return super(_FuncGraph, self).create_op(op_type, inputs, data_types,
**kwargs)
def capture(self, tensor, name=None):
"""Adds the given tensor to this graph and returns the captured tensor."""
if tensor in self._captured:
# Captured already.
return self._captured[tensor]
elif self._capture_by_value:
return self._add_tensor_and_parents(tensor)
else:
return self._capture_tensor_as_extra_input(tensor, name)
def _capture_tensor_as_extra_input(self, tensor, name=None):
# Substitute with a placeholder.
self.extra_inputs.append(tensor)
# Hoist the new input placeholder out of any control flow context
# we're currently in.
with ops.control_dependencies(None):
ph = array_ops.placeholder(
tensor.dtype, shape=tensor.get_shape(), name=name)
# pylint: disable=protected-access
if ops._USE_C_SHAPES:
if isinstance(tensor, ops.EagerTensor):
handle_data = tensor._handle_data
if handle_data:
handle_data = handle_data.SerializeToString()
else:
handle_data = c_api.GetHandleShapeAndType(tensor.graph._c_graph,
tensor._as_tf_output())
if handle_data:
c_api.SetHandleShapeAndType(ph.graph._c_graph, ph._as_tf_output(),
compat.as_bytes(handle_data))
else:
ph._handle_data = tensor._handle_data
# pylint: enable=protected-access
self.inputs.append(ph)
self._captured[tensor] = ph
self.extra_args.append(ph)
if _is_guaranteed_const(tensor):
with ops.control_dependencies(None):
return array_ops.guarantee_const(ph)
else:
return ph
def _add_tensor_and_parents(self, tensor):
op = self._add_op_and_parents(tensor.op)
return op.outputs[tensor.value_index]
def _add_op_and_parents(self, op):
# pylint: disable=protected-access
op_def = graph_to_function_def._get_op_def(op)
# pylint: enable=protected-access
if op_def.is_stateful:
raise ValueError("Cannot capture a stateful node (name:%s, type:%s) "
"by value." % (op.name, op.type))
elif op.type in ("Placeholder", "PlaceholderV2"):
raise ValueError("Cannot capture a placeholder (name:%s, type:%s) "
"by value." % (op.name, op.type))
captured_inputs = [self._add_tensor_and_parents(x) for x in op.inputs]
captured_op = self.create_op(
op.type,
captured_inputs, [o.dtype for o in op.outputs],
name=op.name,
attrs=op.node_def.attr,
op_def=op_def)
for t, captured_t in zip(op.outputs, captured_op.outputs):
self._captured[t] = captured_t
return captured_op
def func_graph_from_py_func(func, arg_names, arg_types, name=None,
capture_by_value=False, device=None,
colocation_stack=None, container=None,
collections_ref=None, arg_shapes=None):
"""Returns a _FuncGraph generated from `func`.
Args:
func: A Python callable which constructs a TF function body. The arguments
must correspond to `arg_types`. Returns a value or list/tuple of values.
No returned value can be None.
arg_names: A sequence of strings for the function argument names.
arg_types: A sequence of the function's argument types.
name: The function name. If None, the name is derived from `func`.
capture_by_value: boolean. If True, captured values will be copied into the
function body.
device: device name or function.
colocation_stack: A colocation stack (list) the _FuncGraph should use.
container: A container name the _FuncGraph should start with.
collections_ref: A reference to a collections dict the _FuncGraph should
use internally.
arg_shapes: A sequence of the function's argument shapes.
Returns:
A _FuncGraph.
Raises:
ValueError: if func returns None.
"""
if not name:
name = function_utils.get_func_name(func)
func_graph = _FuncGraph(name, capture_by_value)
with func_graph.as_default(), ops.device(device):
# pylint: disable=protected-access
if collections_ref is not None:
func_graph._collections = collections_ref
if container is not None:
func_graph._container = container
if colocation_stack is not None:
func_graph._colocation_stack = colocation_stack
# pylint: enable=protected-access
if arg_shapes is None:
arg_shapes = [None] * len(arg_types)
# Create placeholders for the function arguments.
for (argname, argtype, argshape) in zip(arg_names, arg_types, arg_shapes):
argholder = array_ops.placeholder(argtype, shape=argshape, name=argname)
func_graph.inputs.append(argholder)
# Call func and gather the output tensors.
with vs.variable_scope("", custom_getter=func_graph.getvar):
outputs = func(*func_graph.inputs)
# There is no way of distinguishing between a function not returning
# anything and a function returning None in Python.
# We need to allow the former and ideally want to forbid the latter as
# it is most likely user error.
# TODO(iga): Consider adding a @NoOutput decorator on top of @Defun to
# allow users to explicitly mark the function as not returning anything.
# For now, we allow a single None return and interpret it as a function
# with no output.
if outputs is None:
outputs = []
else:
# If func only returned one value, make it a tuple.
if not isinstance(outputs, (list, tuple)):
outputs = (outputs,)
if any([_ is None for _ in outputs]):
raise ValueError("Function can not return None.")
# Ensures each output is a Tensor in the function graph.
outputs = [ops.convert_to_tensor(t) for t in outputs]
outputs = [func_graph.capture(t) if t.graph is not func_graph else t
for t in outputs]
func_graph.outputs = outputs
return func_graph
def _is_guaranteed_const(tensor):
"""Determines whether `tensor` is guaranteed to be a constant.
A tensor is guaranteed to be a constant if either it was produced by
a `GuaranteeConst` op or if all of its children are guaranteed to be
constants.
Args:
tensor: The tensor for which to determine const-ness.
Returns:
True if `tensor` is guaranteed to be a constant, False otherwise.
"""
if isinstance(tensor, ops.EagerTensor):
return False
class Work(object):
def __init__(self, op, leaving):
self.op = op
self.leaving = leaving
is_guaranteed_const = lambda op: op.node_def.op == "GuaranteeConst"
constants = set([])
def all_inputs_const(op):
# If all inputs of an op are guaranteed constants, then we can infer that
# the op produces a constant as well.
return op.inputs and all(inp.op in constants for inp in op.inputs)
visited = set([])
stack = [Work(tensor.op, leaving=False)]
while stack:
work = stack.pop()
if work.leaving:
if all_inputs_const(work.op):
constants.add(work.op)
continue
visited.add(work.op)
if is_guaranteed_const(work.op):
constants.add(work.op)
continue
# This op will be revisited after all its inputs are checked for const-ness.
stack.append(Work(work.op, leaving=True))
for inp in work.op.inputs:
if inp.op not in visited:
stack.append(Work(inp.op, leaving=False))
return tensor.op in constants
def _call(sig, *inputs, **kwargs):
"""Adds a node calling a function.
This adds a `call` op to the default graph that calls the function
of signature `sig`, passing the tensors in `inputs` as arguments.
It returns the outputs of the call, which are one or more tensors.
`sig` is OpDefArg.a `_DefinedFunction` object.
You can pass an optional keyword parameter `name=string` to name the
added operation.
You can pass an optional keyword parameter `noinline=True|False` to
instruct the runtime not to inline the function body into the call
site.
Args:
sig: OpDefArg. The signature of the function.
*inputs: arguments to the function.
**kwargs: Optional keyword arguments. Can only contain 'name' or
'noinline'.
Returns:
A 2-element tuple. First element: a Tensor if the function returns a single
value; a list of Tensors if the function returns multiple value; the
Operation if the function returns no values. Second element: the Operation.
Raises:
ValueError: if the arguments are invalid.
"""
if len(inputs) != len(sig.input_arg):
raise ValueError("Expected number of arguments: %d, received: %d" % (len(
sig.input_arg), len(inputs)))
name = kwargs.pop("name", None)
g = ops.get_default_graph()
func_name = sig.name
attrs = _parse_kwargs_as_attrs(func_name, **kwargs)
output_types = [dtypes.DType(x.type) for x in sig.output_arg]
with ops.name_scope(name, func_name, inputs) as name:
op = g.create_op(
func_name,
list(inputs),
output_types,
name=name,
attrs=attrs,
op_def=sig,
compute_shapes=False)
if op.outputs:
if len(op.outputs) == 1:
ret = op.outputs[0]
else:
ret = tuple(op.outputs)
else:
ret = op
return ret, op
def _from_definition(fdef, grad_func=None):
"""Creates a _DefinedFunction initialized from a FunctionDef proto.
Args:
fdef: a FunctionDef
grad_func: a _DefinedFunction or None
Returns:
A _DefinedFunction representing fdef
"""
# TODO(iga): This method does major surgery on _DefinedFunction.
# Make it a named constructor using @classmethod of _DefinedFunction.
# The Python callable is only needed to create a FunctionDef. Since we have
# the FunctionDef here, we don't need to set _DefinedFunction._func (nor do we
# have access to such a callable here).
func = None
argnames = [arg.name for arg in fdef.signature.input_arg]
input_types = tuple(
dtypes.as_dtype(arg.type) for arg in fdef.signature.input_arg)
func_name = fdef.signature.name
# Note: FunctionDefs do not include python gradient functions, so if the
# original _DefinedFunction included one it will not be reflected here.
python_grad_func = None
out_names = [arg.name for arg in fdef.signature.output_arg]
result = _DefinedFunction(func, argnames, input_types, func_name, grad_func,
python_grad_func, out_names)
# pylint: disable=protected-access
serialized = fdef.SerializeToString()
c_func = c_api.TF_FunctionImportFunctionDef(serialized)
result._c_func = c_api_util.ScopedTFFunction(c_func)
result._extra_inputs = []
# pylint: enable=protected-access
return result
def _from_library(lib):
"""Creates _DefinedFunctions initialized from a FunctionDefLibrary proto.
This method handles assigning the correct gradient functions to each
function.
Args:
lib: a FunctionDefLibrary
Returns:
A list of _DefinedFunctions
Raises:
ValueError: `lib` is invalid
"""
if not lib.function and not lib.gradient:
return []
# function name -> FunctionDef proto
funcs = {fdef.signature.name: fdef for fdef in lib.function}
# Validate that all references function names have function defs
for g in lib.gradient:
if g.function_name not in funcs:
raise ValueError("FunctionDefLibrary missing '%s' FunctionDef\n%s" %
(g.function_name, str(lib)))
if g.gradient_func not in funcs:
raise ValueError("FunctionDefLibrary missing '%s' FunctionDef\n%s" %
(g.gradient_func, str(lib)))
# function name -> gradient function name
func_to_grad = collections.defaultdict(lambda: None)
# gradient function name -> names of functions having that grad function
grad_to_funcs = collections.defaultdict(list)
for gdef in lib.gradient:
func_to_grad[gdef.function_name] = gdef.gradient_func
grad_to_funcs[gdef.gradient_func].append(gdef.function_name)
# Start with functions without gradients
ready = [
fdef for fdef in lib.function if func_to_grad[fdef.signature.name] is None
]
if not ready:
raise ValueError(
"FunctionDefLibrary contains cyclic gradient functions!\n" + str(lib))
# function name -> _DefinedFunction
initialized = {}
while ready:
fdef = ready.pop()
name = fdef.signature.name
grad = initialized.get(func_to_grad[name])
if func_to_grad[name]:
assert grad
defined_func = _from_definition(fdef, grad_func=grad)
initialized[name] = defined_func
ready.extend(funcs[f] for f in grad_to_funcs[name])
return initialized.values()
def _get_experimental_kwarg_as_attr(attr_name, value):
"""Creates an AttrValue for a python object."""
if isinstance(value, bool):
return attr_value_pb2.AttrValue(b=value)
elif isinstance(value, int):
return attr_value_pb2.AttrValue(i=value)
elif isinstance(value, float):
return attr_value_pb2.AttrValue(f=value)
elif isinstance(value, str):
return attr_value_pb2.AttrValue(s=compat.as_bytes(value))
else:
raise ValueError("Unsupported attribute type for %s with type %s" %
(attr_name, type(value)))
def _parse_kwargs_as_attrs(func_name, **kwargs):
"""Parses **kwargs into a node's attributes."""
attrs = {}
noinline = kwargs.pop("noinline", None)
if noinline is not None:
attrs["_noinline"] = attr_value_pb2.AttrValue(b=bool(noinline))
compiled = kwargs.pop("compiled", None)
separate_compiled_gradients = kwargs.pop("separate_compiled_gradients", None)
if compiled is not None:
attrs["_XlaCompile"] = attr_value_pb2.AttrValue(b=bool(compiled))
attrs["_XlaSeparateCompiledGradients"] = attr_value_pb2.AttrValue(
b=bool(separate_compiled_gradients))
# Forward _XlaScope from enclosing context (if set), otherwise create new.
# pylint: disable=protected-access
if "_XlaScope" in ops.get_default_graph()._attr_scope_map:
attrs["_XlaScope"] = ops.get_default_graph()._attr_scope_map["_XlaScope"]
else:
attrs["_XlaScope"] = attr_value_pb2.AttrValue(
s=("function_%s" % func_name).encode())
# pylint: enable=protected-access
kwargs_keys = list(kwargs.keys())
for key in kwargs_keys:
if key.startswith("experimental_"):
attrs[key] = _get_experimental_kwarg_as_attr(key, kwargs[key])
del kwargs[key]
if kwargs:
raise ValueError("Unknown keyword arguments: %s" % kwargs.keys())
return attrs
def get_extra_vars():
"""Returns the captured variables by the function.
Returns:
If the default graph is being used to define a function, the
returned list of variables are those created inside the function
body so far. Otherwise, returns an empty list.
"""
g = ops.get_default_graph()
if isinstance(g, _FuncGraph):
return g.extra_vars
else:
return []
def get_extra_inputs():
"""Returns the captured input tensors by the function.
Returns:
If the default graph is being used to define a function, the
returned list of tensors are those accessed inside the function body
but defined outside the function body so far. Otherwise, returns an
empty list.
"""
g = ops.get_default_graph()
if isinstance(g, _FuncGraph):
return g.extra_inputs
else:
return []
def get_extra_args():
"""Returns the corresponding function arguments for the captured inputs.
Returns:
If the default graph is being used to define a function, the
returned list of place holders are those used inside the function
body corresponding those returned by get_extra_inputs(). Otherwise,
returns an empty list.
"""
g = ops.get_default_graph()
if isinstance(g, _FuncGraph):
return g.extra_args
else:
return []
def _type_list_to_str(types):
if any([_ not in _DTYPE_TO_STR for _ in types]):
raise ValueError("Unsupported dtypes: %s" % types)
return "".join([_DTYPE_TO_STR[_] for _ in types])
# NOTE: The list needs to be extended when more data types are added.
_DTYPE_TO_STR = {
dtypes.float16: "f16",
dtypes.float32: "f32",
dtypes.float64: "f64",
dtypes.int32: "i32",
dtypes.uint8: "i8",
dtypes.uint16: "u16",
dtypes.uint32: "u32",
dtypes.uint64: "u64",
dtypes.int16: "i16",
dtypes.int8: "i8",
dtypes.string: "s",
dtypes.complex64: "c64",
dtypes.complex128: "c128",
dtypes.int64: "i64",
dtypes.bool: "b",
dtypes.qint8: "qi8",
dtypes.quint8: "qu8",
dtypes.qint16: "qi16",
dtypes.quint16: "qu16",
dtypes.qint32: "qi32",
dtypes.bfloat16: "b16"
}
def function_def_from_tf_function(c_func):
"""Converts a SWIG-wrapped TF_Function* to a FunctionDef proto."""
with c_api_util.tf_buffer() as buf:
c_api.TF_FunctionToFunctionDef(c_func, buf)
data = c_api.TF_GetBuffer(buf)
fdef = function_pb2.FunctionDef()
fdef.ParseFromString(compat.as_bytes(data))
return fdef
|
Java
|
//*************************************************************
// Filename: socket.js
//
// Author: Jake Higgins <jth7036@rit.edu>
//*************************************************************
var Socket;
function addSocketListeners() {
Socket = new io();
Socket.on('sync objects', function(objects, room, caller) {
console.log(objects);
if(CallerID == caller) {
console.log(objects);
$.each(objects, function(key, object) {
createStroke(object);
});
CanvasManager.render();
}
});
Socket.on('add object', function(object, room, caller) {
if(CallerID != caller && RoomID == room) {
createStroke(object);
CanvasManager.clearCanvas();
}
});
Socket.on('move object', function(object, room, caller) {
console.log('move object');
if(CallerID != caller && RoomID == room) {
var targetObj = ObjectManager.findObject(object.objectID);
console.log(targetObj);
if(targetObj != null) {
targetObj.max = object.max;
targetObj.min = object.min;
$(targetObj.container).css({
top: targetObj.min.y,
left: targetObj.min.x
});
}
}
});
Socket.on('delete object', function(object, room, caller) {
if(CallerID != caller && RoomID == room)
{
ObjectManager.deleteObject(object.objectID);
}
});
Socket.on('clear objects', function(room, caller) {
console.log('clear');
if(CallerID != caller && RoomID == room) {
CanvasManager.clear(true);
}
});
Socket.on('draw', function(drawData, room, caller) {
if(CallerID != caller && RoomID == room) {
Drawing.draw(drawData, true);
}
});
// ======== Chat =============/
// Comes in the format message/roomID/caller
// if(roomID == this.roomID) // pseudocode for now
// add chat to chat thingy
Socket.on('receiveMessage', function(message, room, caller)
{
if ( RoomID == room )
{
// Proceed
Chat.write(message, caller);
}
});
}
function createStroke(stroke) {
console.log(stroke);
var obj = new object("stroke");
obj.initialize();
obj.imageData = stroke.imageData;
obj.layer = stroke.layer;
obj.max = stroke.max;
obj.min = stroke.min;
obj.objectID = stroke.objectID;
obj.type = "stroke";
obj.objectData = {
imageData: obj.imageData,
layer: obj.layer,
max: obj.max,
min: obj.min,
objectID: obj.objectID,
objectType: obj.type,
};
obj.createImage();
ObjectManager.addObject(obj);
}
|
Java
|
package ch.unibe.scg.regex;
import static java.util.Collections.singleton;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
import ch.unibe.scg.regex.ParserProvider.Node;
import ch.unibe.scg.regex.ParserProvider.Node.Basic;
import ch.unibe.scg.regex.ParserProvider.Node.Group;
import ch.unibe.scg.regex.ParserProvider.Node.NonGreedyStar;
import ch.unibe.scg.regex.ParserProvider.Node.Optional;
import ch.unibe.scg.regex.ParserProvider.Node.Plus;
import ch.unibe.scg.regex.ParserProvider.Node.PositiveSet;
import ch.unibe.scg.regex.ParserProvider.Node.SetItem;
import ch.unibe.scg.regex.ParserProvider.Node.Simple;
import ch.unibe.scg.regex.ParserProvider.Node.Star;
import ch.unibe.scg.regex.ParserProvider.Node.Union;
import ch.unibe.scg.regex.TNFA.Builder;
import ch.unibe.scg.regex.Transition.Priority;
/**
* Not thread-safe! Use only from one thread at a time!
*
* @author nes
*/
class RegexToNFA {
final InputRangeCleanup inputRangeCleanup = new InputRangeCleanup();
TNFA convert(final Node node) {
Collection<InputRange> allInputRanges = new ArrayList<>();
allInputRanges.add(InputRange.ANY); // All regexes contain this implicitly.
findRanges(node, allInputRanges);
final Builder builder = Builder.make(allInputRanges);
builder.registerCaptureGroup(builder.captureGroupMaker.entireMatch);
final MiniAutomaton m =
makeInitialMiniAutomaton(builder, builder.captureGroupMaker.entireMatch);
final MiniAutomaton a = make(m, builder, node, builder.captureGroupMaker.entireMatch);
final State endTagger = builder.makeState();
builder.addEndTagTransition(a.finishing, endTagger, builder.captureGroupMaker.entireMatch,
Priority.NORMAL);
builder.setAsAccepting(endTagger);
return builder.build();
}
private void findRanges(Node n, Collection<InputRange> out) {
if (n instanceof Node.SetItem) {
out.add(((SetItem) n).inputRange);
}
for (Node c : n.getChildren()) {
findRanges(c, out);
}
}
static class MiniAutomaton {
final Collection<State> finishing;
final Collection<State> initial;
MiniAutomaton(final Collection<State> initial, final Collection<State> finishing) {
if (initial.iterator().next() == null) {
assert false;
}
this.initial = initial;
this.finishing = finishing;
}
MiniAutomaton(final Collection<State> initial, final State finishing) {
this(initial, singleton(finishing));
}
@Override
public String toString() {
return "" + initial + " -> " + finishing;
}
}
MiniAutomaton make(final MiniAutomaton last, final Builder builder, final Node node,
CaptureGroup captureGroup) {
MiniAutomaton ret;
if (node instanceof Node.Any) {
ret = makeAny(last, builder);
} else if (node instanceof Node.Char) {
ret = makeChar(last, builder, (Node.Char) node);
} else if (node instanceof Node.Simple) {
ret = makeSimple(last, builder, (Node.Simple) node, captureGroup);
} else if (node instanceof Node.Optional) {
ret = makeOptional(last, builder, (Node.Optional) node, captureGroup);
} else if (node instanceof Node.NonGreedyStar) {
ret = makeNonGreedyStar(last, builder, (Node.NonGreedyStar) node, captureGroup);
} else if (node instanceof Node.Star) {
ret = makeStar(last, builder, (Star) node, captureGroup);
} else if (node instanceof Node.Plus) {
ret = makePlus(last, builder, (Node.Plus) node, captureGroup);
} else if (node instanceof Node.Group) {
ret = makeGroup(last, builder, (Node.Group) node, captureGroup);
} else if (node instanceof Node.Eos) {
ret = makeEos(last, builder);
} else if (node instanceof Node.Char) {
ret = makeChar(last, builder, (Node.Char) node);
} else if (node instanceof Node.PositiveSet) {
ret = makePositiveSet(last, builder, (Node.PositiveSet) node);
} else if (node instanceof Node.Union) {
ret = makeUnion(last, builder, (Node.Union) node, captureGroup);
} else {
throw new AssertionError("Unknown node type: " + node);
}
assert !ret.initial.contains(null);
assert !ret.finishing.contains(null);
return ret;
}
MiniAutomaton makeAny(final MiniAutomaton last, final Builder builder) {
final State a = builder.makeState();
builder.addUntaggedTransition(InputRange.ANY, last.finishing, a);
return new MiniAutomaton(last.finishing, a);
}
MiniAutomaton makeChar(final MiniAutomaton last, final Builder b, final Node.Char character) {
final State a = b.makeState();
final MiniAutomaton ret = new MiniAutomaton(last.finishing, a);
b.addUntaggedTransition(character.inputRange, ret.initial, a);
return ret;
}
MiniAutomaton makeEos(final MiniAutomaton last, final Builder builder) {
final State a = builder.makeState();
builder.addUntaggedTransition(InputRange.EOS, last.finishing, a);
return new MiniAutomaton(last.finishing, a);
}
MiniAutomaton makeGroup(final MiniAutomaton last, final Builder builder, final Group group,
CaptureGroup parentCaptureGroup) {
final CaptureGroup cg = builder.makeCaptureGroup(parentCaptureGroup);
builder.registerCaptureGroup(cg);
final State startGroup = builder.makeState();
builder.addStartTagTransition(last.finishing, startGroup, cg, Priority.NORMAL);
final MiniAutomaton startGroupAutomaton = new MiniAutomaton(singleton(startGroup), singleton(startGroup));
final MiniAutomaton body = make(startGroupAutomaton, builder, group.body, cg);
final State endTag = builder.makeState();
builder.addEndTagTransition(body.finishing, endTag, cg, Priority.NORMAL);
return new MiniAutomaton(last.finishing, endTag);
}
MiniAutomaton makeInitialMiniAutomaton(final Builder builder, CaptureGroup entireMatch) {
final State init = builder.makeInitialState();
final State startTagger = builder.makeState();
builder.addStartTagTransition(singleton(init), startTagger, entireMatch, Priority.NORMAL);
return new MiniAutomaton(singleton(init), singleton(startTagger));
}
MiniAutomaton makeOptional(final MiniAutomaton last, final Builder builder,
final Optional optional, CaptureGroup captureGroup) {
final MiniAutomaton ma = make(last, builder, optional.elementary, captureGroup);
final List<State> f = new ArrayList<>(last.finishing);
f.addAll(ma.finishing);
return new MiniAutomaton(last.finishing, f);
}
MiniAutomaton makePlus(final MiniAutomaton last, final Builder builder, final Plus plus,
CaptureGroup captureGroup) {
final MiniAutomaton inner = make(last, builder, plus.elementary, captureGroup);
Collection<State> out = singleton(builder.makeState());
builder.makeUntaggedEpsilonTransitionFromTo(inner.finishing, out, Priority.LOW);
final MiniAutomaton ret = new MiniAutomaton(last.finishing, out);
builder.makeUntaggedEpsilonTransitionFromTo(inner.finishing,
inner.initial, Priority.NORMAL);
return ret;
}
MiniAutomaton makeUnion(MiniAutomaton last, Builder builder, Union union,
CaptureGroup captureGroup) {
MiniAutomaton left = make(last, builder, union.left, captureGroup);
MiniAutomaton right = make(last, builder, union.right, captureGroup);
Collection<State> out = singleton(builder.makeState());
builder.makeUntaggedEpsilonTransitionFromTo(left.finishing, out, Priority.NORMAL);
builder.makeUntaggedEpsilonTransitionFromTo(right.finishing, out, Priority.LOW);
return new MiniAutomaton(last.finishing, out);
}
MiniAutomaton makePositiveSet(final MiniAutomaton last, final Builder builder,
final PositiveSet set) {
final List<SetItem> is = set.items;
final SortedSet<InputRange> ranges = new TreeSet<>();
for (final SetItem i : is) {
ranges.add(i.inputRange);
}
final List<InputRange> rangesList = new ArrayList<>(ranges);
final List<InputRange> cleanedRanges = inputRangeCleanup.cleanUp(rangesList);
final State a = builder.makeState();
for (InputRange range : cleanedRanges) {
builder.addUntaggedTransition(range, last.finishing, a);
}
return new MiniAutomaton(last.finishing, a);
}
MiniAutomaton makeSimple(final MiniAutomaton last, final Builder b, final Simple simple,
CaptureGroup captureGroup) {
final List<? extends Basic> bs = simple.basics;
MiniAutomaton lm = last;
for (final Basic e : bs) {
lm = make(lm, b, e, captureGroup);
}
return new MiniAutomaton(last.finishing, lm.finishing);
}
MiniAutomaton makeNonGreedyStar(MiniAutomaton last, Builder builder, NonGreedyStar nonGreedyStar,
CaptureGroup captureGroup) {
// Make start state and connect.
State start = builder.makeState();
builder.makeUntaggedEpsilonTransitionFromTo(last.finishing, singleton(start), Priority.NORMAL);
// Make inner machine.
MiniAutomaton innerLast = new MiniAutomaton(last.finishing, start);
final MiniAutomaton inner = make(innerLast, builder, nonGreedyStar.elementary, captureGroup);
// Connect inner machine back to start.
builder.makeUntaggedEpsilonTransitionFromTo(inner.finishing, singleton(start), Priority.LOW);
// Make and connect `out` state.
State out = builder.makeState();
builder.makeUntaggedEpsilonTransitionFromTo(singleton(start), singleton(out), Priority.NORMAL);
return new MiniAutomaton(last.finishing, out);
}
MiniAutomaton makeStar(final MiniAutomaton last, final Builder builder, final Star star,
CaptureGroup captureGroup) {
// Make start state and connect.
State start = builder.makeState();
builder.makeUntaggedEpsilonTransitionFromTo(last.finishing, singleton(start), Priority.NORMAL);
// Make inner machine.
MiniAutomaton innerLast = new MiniAutomaton(singleton(start), start);
final MiniAutomaton inner = make(innerLast, builder, star.elementary, captureGroup);
// Connect inner machine back to start.
builder.makeUntaggedEpsilonTransitionFromTo(inner.finishing, singleton(start), Priority.NORMAL);
// Make and connect `out` state.
State out = builder.makeState();
builder.makeUntaggedEpsilonTransitionFromTo(singleton(start), singleton(out), Priority.LOW);
return new MiniAutomaton(last.finishing, out);
}
}
|
Java
|
/*
* Copyright (c) 2015 TextGlass
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
public class TransformerIsNumber implements Transformer {
@Override
public String transform(String input) throws Exception {
try {
Double.parseDouble(input);
} catch(NumberFormatException nfe) {
throw new Exception(nfe.toString());
}
return input;
}
@Override
public String toString() {
return "TransformerIsNumber";
}
}
|
Java
|
/*
* Copyright (c) 2017 Martin Pfeffer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.pepperonas.materialdialog.adapter;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.Typeface;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.pepperonas.materialdialog.R;
import com.pepperonas.materialdialog.utils.Utils;
import java.util.List;
/**
* @author Martin Pfeffer (pepperonas)
*/
public class ShareAdapter extends BaseAdapter {
private Object[] items;
private LayoutInflater mInflater;
private Context mCtx;
private Typeface mTypeface;
public ShareAdapter(@NonNull Context context) {
this.mInflater = LayoutInflater.from(context);
Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.setType("text/plain");
List activities = context.getPackageManager().queryIntentActivities(sendIntent, 0);
items = activities.toArray();
mCtx = context;
}
public ShareAdapter(@NonNull Context context, Typeface typeface) {
this.mInflater = LayoutInflater.from(context);
Intent sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.setType("text/plain");
List activities = context.getPackageManager().queryIntentActivities(sendIntent, 0);
items = activities.toArray();
mCtx = context;
mTypeface = typeface;
}
public int getCount() {
return items.length;
}
public Object getItem(int position) {
return items[position];
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.custom_list_item_share_app, null);
holder = new ViewHolder();
holder.logo = (ImageView) convertView.findViewById(R.id.iv_simple_list_item_share_app);
holder.name = (TextView) convertView.findViewById(R.id.tv_simple_list_item_share_app);
if (mTypeface != null) {
holder.name.setTypeface(mTypeface);
}
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.name.setText(((ResolveInfo) items[position]).activityInfo
.applicationInfo.loadLabel(mCtx.getPackageManager()).toString());
holder.logo.setImageDrawable(((ResolveInfo) items[position]).activityInfo
.applicationInfo.loadIcon(mCtx.getPackageManager()));
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(
Utils.dp2px(mCtx, 16),
Utils.dp2px(mCtx, 4),
Utils.dp2px(mCtx, 4),
Utils.dp2px(mCtx, 4));
holder.logo.setLayoutParams(layoutParams);
return convertView;
}
static class ViewHolder {
TextView name;
ImageView logo;
}
}
|
Java
|
# Rhexia reticulata Humb. & Bonpl. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
// Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package forwarder
import (
"bytes"
"fmt"
"net/http"
"istio.io/pkg/log"
)
const (
hostHeader = "Host"
)
var fwLog = log.RegisterScope("forwarder", "echo clientside", 0)
func writeHeaders(requestID int, header http.Header, outBuffer bytes.Buffer, addFn func(string, string)) {
for key, values := range header {
for _, v := range values {
addFn(key, v)
if key == hostHeader {
outBuffer.WriteString(fmt.Sprintf("[%d] Host=%s\n", requestID, v))
} else {
outBuffer.WriteString(fmt.Sprintf("[%d] Header=%s:%s\n", requestID, key, v))
}
}
}
}
|
Java
|
package com.siqisoft.stone.admin.dict.controller;
import java.util.List;
import org.siqisource.stone.dict.model.Dict;
import org.siqisource.stone.dict.service.DictService;
import org.siqisource.stone.orm.condition.Condition;
import org.siqisource.stone.ui.AjaxResponse;
import org.siqisource.stone.ui.Notify;
import org.siqisource.stone.ui.easyui.PagedRows;
import org.siqisource.stone.ui.easyui.Paging;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.siqisoft.stone.admin.dict.service.DictConditionBuilder;
@Controller
public class DictController {
@Autowired
DictService service;
@RequestMapping("/dict/DictList.do")
public String list(Model model) {
return "dict/DictList";
}
@RequestMapping("/dict/dictListData.do")
@ResponseBody
public PagedRows<Dict> listData(DictQueryForm dictQueryForm, Paging paging) {
Condition condition = DictConditionBuilder.listCondition(dictQueryForm);
int count = service.count(condition);
List<Dict> dictList = service.list(condition, paging.getRowBounds());
return new PagedRows<Dict>(count, dictList);
}
@RequestMapping("/dict/DictRead.do")
public String read(String code, Model model) {
Dict dict = service.read(code);
model.addAttribute("dict", dict);
return "dict/DictRead";
}
@RequestMapping("/dict/DictAddInit.do")
public String addInit(Dict dict, Model model) {
return "dict/DictAdd";
}
@RequestMapping("/dict/DictAdd.do")
public String add(Dict dict, Model model) {
service.insert(dict);
return this.read(dict.getCode(), model);
}
@RequestMapping("/dict/dictDelete.do")
@ResponseBody
public AjaxResponse delete(String[] codeList, Model model) {
// 判断是否被关联
if (codeList != null) {
service.deleteBatch(codeList);
}
return new Notify("成功删除"+codeList.length+"条记录");
}
@RequestMapping("/dict/DictEditInit.do")
public String editInit(String code, Model model) {
Dict dict = service.read(code);
model.addAttribute("dict", dict);
return "dict/DictEdit";
}
@RequestMapping("/dict/DictEdit.do")
public String edit(Dict dict, Model model) {
service.update(dict);
return this.read(dict.getCode(), model);
}
}
|
Java
|
# Schizaea palmata Hombr. & Jacq. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
Java
|
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.refactoring.listeners;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.PsiElement;
/**
* Refactorings invoke {@link #getListener(com.intellij.psi.PsiElement)} of registered
* {@linkplain RefactoringElementListenerProvider} before particular element is subjected to refactoring.
* @author dsl
*/
public interface RefactoringElementListenerProvider {
ExtensionPointName<RefactoringElementListenerProvider> EP_NAME = ExtensionPointName.create("com.intellij.refactoring.elementListenerProvider");
/**
*
* Should return a listener for particular element. Invoked in read action.
*/
@javax.annotation.Nullable
RefactoringElementListener getListener(PsiElement element);
}
|
Java
|
/*
* Copyright 2016 Shredder121.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.shredder121.gh_event_api.handler.pull_request;
/**
* The handler interface for receiving {@code pull_request} events.
*
* @author Shredder121
*/
@FunctionalInterface
public interface PullRequestHandler {
void handle(PullRequestPayload payload);
}
|
Java
|
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Model extends CI_Model {
// Variável que define o nome da tabela
var $table = "";
/**
* Método Construtor
*/
function __construct() {
parent::__construct();
}
/**
* Insere um registro na tabela
*
* @param array $data Dados a serem inseridos
*
* @return boolean
*/
function Inserir($data) {
if(!isset($data))
return false;
return $this->db->insert($this->table, $data);
}
/**
* Recupera um registro a partir de um ID
*
* @param integer $id ID do registro a ser recuperado
*
* @return array
*/
function GetById($id) {
if(is_null($id))
return false;
$this->db->where('id', $id);
$query = $this->db->get($this->table);
if ($query->num_rows() > 0) {
return $query->row_array();
} else {
return null;
}
}
/**
* Lista todos os registros da tabela
*
* @param string $sort Campo para ordenação dos registros
*
* @param string $order Tipo de ordenação: ASC ou DESC
*
* @return array
*/
function GetAll($sort = 'id', $order = 'asc') {
// $this->db->where('servico', 'Website');
$this->db->order_by($sort, $order);
$query = $this->db->get($this->table);
if ($query->num_rows() > 0) {
return $query->result_array();
} else {
return null;
}
}
function GetAllFace($sort = 'id', $order = 'asc') {
$this->db->where("servico like '%Facebook%'");
$this->db->order_by($sort, $order);
$query = $this->db->get($this->table);
if ($query->num_rows() > 0) {
return $query->result_array();
} else {
return null;
}
}
function GetAllSite($sort = 'id', $order = 'asc') {
$this->db->where("servico like '%Website%'");
$this->db->order_by($sort, $order);
$query = $this->db->get($this->table);
if ($query->num_rows() > 0) {
return $query->result_array();
} else {
return null;
}
}
function GetAllMail($sort = 'id', $order = 'asc') {
$this->db->where("servico like '%Mail%'");
$this->db->order_by($sort, $order);
$query = $this->db->get($this->table);
if ($query->num_rows() > 0) {
return $query->result_array();
} else {
return null;
}
}
/**
* Atualiza um registro na tabela
*
* @param integer $int ID do registro a ser atualizado
*
* @param array $data Dados a serem inseridos
*
* @return boolean
*/
function Atualizar($id, $data) {
if(is_null($id) || !isset($data))
return false;
$this->db->where('id', $id);
return $this->db->update($this->table, $data);
}
/**
* Remove um registro na tabela
*
* @param integer $int ID do registro a ser removido
*
*
* @return boolean
*/
function Excluir($id) {
if(is_null($id))
return false;
$this->db->where('id', $id);
return $this->db->delete($this->table);
}
}
/* End of file */
|
Java
|
package com.nguyenmanhtuan.benhandientu;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.HashMap;
import java.util.Locale;
import com.nguyenmanhtuan.utils.DatabaseHandler;
public class RegisteredActivity extends Activity {
private Locale myLocale;
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registered);
DatabaseHandler db = new DatabaseHandler(getApplicationContext());
HashMap<String, String> user = new HashMap<String, String>();
user = db.getUserDetails();
/**
* Displays the registration details in Text view
**/
final TextView fname = (TextView) findViewById(R.id.fname);
final TextView lname = (TextView) findViewById(R.id.lname);
final TextView uname = (TextView) findViewById(R.id.uname);
final TextView email = (TextView) findViewById(R.id.email);
final TextView address = (TextView) findViewById(R.id.tvadd);
final TextView phonenumber = (TextView) findViewById(R.id.tvphone);
final TextView birthyear = (TextView) findViewById(R.id.tvBirthyear);
final TextView created_at = (TextView) findViewById(R.id.regat);
fname.setText(user.get("fname"));
lname.setText(user.get("lname"));
uname.setText(user.get("uname"));
email.setText(user.get("email"));
address.setText(user.get("address"));
phonenumber.setText(user.get("phonenumber"));
birthyear.setText(user.get("birthyear"));
created_at.setText(user.get("created_at"));
Button login = (Button) findViewById(R.id.login);
login.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(view.getContext(), LoginActivity.class);
startActivityForResult(myIntent, 0);
finish();
}
});
}
public void setLocale(String lang) {
myLocale = new Locale(lang);
Resources res = getResources();
DisplayMetrics dm = res.getDisplayMetrics();
Configuration conf = res.getConfiguration();
conf.locale = myLocale;
res.updateConfiguration(conf, dm);
Intent refresh = new Intent(this, RegisteredActivity.class);
startActivity(refresh);
}
}
|
Java
|
package com.vertabelo.mobileorm.myplaces.orm.gen;
public class AddressViewDAOImpl
extends com.vertabelo.mobileorm.myplaces.orm.runtime.dao.BaseDAO<AddressView>
implements AddressViewDAO {
public AddressViewDAOImpl(com.vertabelo.mobileorm.myplaces.orm.runtime.util.SQLiteDataSource dataSource) {
super(dataSource);
}
public AddressViewDAOImpl(com.vertabelo.mobileorm.myplaces.orm.runtime.util.SQLiteDataSource dataSource,
com.vertabelo.mobileorm.myplaces.orm.runtime.util.DAOMonitor daoMonitor) {
super(dataSource, daoMonitor);
}
@Override
public Class<AddressView> getPojoClass() {
return POJO_CLASS;
}
@Override
public com.vertabelo.mobileorm.myplaces.orm.runtime.query.TableExpression getTableExpression() {
return TABLE_EXPRESSION;
}
@Override
public com.vertabelo.mobileorm.myplaces.orm.runtime.util.ResultSetHandler getResultSetHandler() {
return RESULT_SET_HANDLER;
}
@Override
public java.util.List<AddressView> getAddressViewList() {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION);
com.vertabelo.mobileorm.myplaces.orm.runtime.dao.SelectObjectListResult<AddressView>
selectObjectListResult = select(query, RESULT_SET_HANDLER);
return selectObjectListResult.getObjectList();
}
@Override
public java.util.List<AddressView> getAddressViewList(com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp orderBy) {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION);
query.orderBy(orderBy);
com.vertabelo.mobileorm.myplaces.orm.runtime.dao.SelectObjectListResult<AddressView>
selectObjectListResult = select(query, RESULT_SET_HANDLER);
return selectObjectListResult.getObjectList();
}
@Override
public java.util.List<AddressView> getAddressViewList(com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp orderBy, com.vertabelo.mobileorm.myplaces.orm.runtime.query.OrderByDirection asc) {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION);
query.orderBy(orderBy, asc);
com.vertabelo.mobileorm.myplaces.orm.runtime.dao.SelectObjectListResult<AddressView>
selectObjectListResult = select(query, RESULT_SET_HANDLER);
return selectObjectListResult.getObjectList();
}
@Override
public java.util.List<AddressView> getAddressViewList(com.vertabelo.mobileorm.myplaces.orm.runtime.query.LExp where) {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION);
query.setWhere(where);
com.vertabelo.mobileorm.myplaces.orm.runtime.dao.SelectObjectListResult<AddressView>
selectObjectListResult = select(query, RESULT_SET_HANDLER);
return selectObjectListResult.getObjectList();
}
@Override
public java.util.List<AddressView> getAddressViewList(com.vertabelo.mobileorm.myplaces.orm.runtime.query.LExp where,
com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp orderBy) {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION);
query.setWhere(where);
query.orderBy(orderBy);
com.vertabelo.mobileorm.myplaces.orm.runtime.dao.SelectObjectListResult<AddressView>
selectObjectListResult = select(query, RESULT_SET_HANDLER);
return selectObjectListResult.getObjectList();
}
@Override
public java.util.List<AddressView> getAddressViewList(com.vertabelo.mobileorm.myplaces.orm.runtime.query.LExp where,
com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp orderBy, com.vertabelo.mobileorm.myplaces.orm.runtime.query.OrderByDirection asc) {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION);
query.setWhere(where);
query.orderBy(orderBy, asc);
com.vertabelo.mobileorm.myplaces.orm.runtime.dao.SelectObjectListResult<AddressView>
selectObjectListResult = select(query, RESULT_SET_HANDLER);
return selectObjectListResult.getObjectList();
}
@Override
public Long getCount() {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION,
com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp.fun("COUNT",
com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp.ASTERISK));
java.util.List<Long> list = select(query, new com.vertabelo.mobileorm.myplaces.orm.runtime.util.handlers.LongResultSetHandler()).getObjectList();
if (list.size() > 1) {
throw new RuntimeException("More than one object returned");
} else if (list.size() == 1) {
return list.get(0);
} else {
throw new RuntimeException("Cannot retrieve count() method result");
}
}
@Override
public Long getCount(com.vertabelo.mobileorm.myplaces.orm.runtime.query.LExp where) {
com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery query =
new com.vertabelo.mobileorm.myplaces.orm.runtime.query.SelectQuery(TABLE_EXPRESSION,
com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp.fun("COUNT",
com.vertabelo.mobileorm.myplaces.orm.runtime.query.AExp.ASTERISK));
query.setWhere(where);
java.util.List<Long> list = select(query, new com.vertabelo.mobileorm.myplaces.orm.runtime.util.handlers.LongResultSetHandler()).getObjectList();
if (list.size() > 1) {
throw new RuntimeException("More than one object returned");
} else if (list.size() == 1) {
return list.get(0);
} else {
throw new RuntimeException("Cannot retrieve count() method result");
}
}
}
|
Java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.cep.operator;
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.cep.Event;
import org.apache.flink.cep.SubEvent;
import org.apache.flink.cep.nfa.NFA;
import org.apache.flink.cep.nfa.compiler.NFACompiler;
import org.apache.flink.cep.pattern.Pattern;
import org.apache.flink.cep.pattern.conditions.SimpleCondition;
import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
import org.apache.flink.streaming.api.watermark.Watermark;
import org.apache.flink.streaming.api.windowing.time.Time;
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
import org.apache.flink.streaming.util.KeyedOneInputStreamOperatorTestHarness;
import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
import org.apache.flink.streaming.util.OperatorSnapshotUtil;
import org.apache.flink.streaming.util.migration.MigrationTestUtil;
import org.apache.flink.streaming.util.migration.MigrationVersion;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue;
import static org.apache.flink.cep.operator.CepOperatorTestUtilities.getKeyedCepOpearator;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Tests for checking whether CEP operator can restore from snapshots that were done
* using previous Flink versions.
*
* <p>For regenerating the binary snapshot file of previous versions you have to run the
* {@code write*()} method on the corresponding Flink release-* branch.
*/
@RunWith(Parameterized.class)
public class CEPMigrationTest {
/**
* TODO change this to the corresponding savepoint version to be written (e.g. {@link MigrationVersion#v1_3} for 1.3)
* TODO and remove all @Ignore annotations on write*Snapshot() methods to generate savepoints
*/
private final MigrationVersion flinkGenerateSavepointVersion = null;
private final MigrationVersion migrateVersion;
@Parameterized.Parameters(name = "Migration Savepoint: {0}")
public static Collection<MigrationVersion> parameters () {
return Arrays.asList(MigrationVersion.v1_3, MigrationVersion.v1_4, MigrationVersion.v1_5);
}
public CEPMigrationTest(MigrationVersion migrateVersion) {
this.migrateVersion = migrateVersion;
}
/**
* Manually run this to write binary snapshot data.
*/
@Ignore
@Test
public void writeAfterBranchingPatternSnapshot() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent = new Event(42, "start", 1.0);
final SubEvent middleEvent1 = new SubEvent(42, "foo1", 1.0, 10.0);
final SubEvent middleEvent2 = new SubEvent(42, "foo2", 2.0, 10.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
harness.open();
harness.processElement(new StreamRecord<Event>(startEvent, 1));
harness.processElement(new StreamRecord<Event>(new Event(42, "foobar", 1.0), 2));
harness
.processElement(new StreamRecord<Event>(new SubEvent(42, "barfoo", 1.0, 5.0), 3));
harness.processElement(new StreamRecord<Event>(middleEvent1, 2));
harness.processElement(new StreamRecord<Event>(middleEvent2, 3));
harness.processWatermark(new Watermark(5));
// do snapshot and save to file
OperatorSubtaskState snapshot = harness.snapshot(0L, 0L);
OperatorSnapshotUtil.writeStateHandle(snapshot,
"src/test/resources/cep-migration-after-branching-flink" + flinkGenerateSavepointVersion + "-snapshot");
} finally {
harness.close();
}
}
@Test
public void testRestoreAfterBranchingPattern() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent = new Event(42, "start", 1.0);
final SubEvent middleEvent1 = new SubEvent(42, "foo1", 1.0, 10.0);
final SubEvent middleEvent2 = new SubEvent(42, "foo2", 2.0, 10.0);
final Event endEvent = new Event(42, "end", 1.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
MigrationTestUtil.restoreFromSnapshot(
harness,
OperatorSnapshotUtil.getResourceFilename("cep-migration-after-branching-flink" + migrateVersion + "-snapshot"),
migrateVersion);
harness.open();
harness.processElement(new StreamRecord<>(new Event(42, "start", 1.0), 4));
harness.processElement(new StreamRecord<>(endEvent, 5));
harness.processWatermark(new Watermark(20));
ConcurrentLinkedQueue<Object> result = harness.getOutput();
// watermark and 2 results
assertEquals(3, result.size());
Object resultObject1 = result.poll();
assertTrue(resultObject1 instanceof StreamRecord);
StreamRecord<?> resultRecord1 = (StreamRecord<?>) resultObject1;
assertTrue(resultRecord1.getValue() instanceof Map);
Object resultObject2 = result.poll();
assertTrue(resultObject2 instanceof StreamRecord);
StreamRecord<?> resultRecord2 = (StreamRecord<?>) resultObject2;
assertTrue(resultRecord2.getValue() instanceof Map);
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap1 =
(Map<String, List<Event>>) resultRecord1.getValue();
assertEquals(startEvent, patternMap1.get("start").get(0));
assertEquals(middleEvent1, patternMap1.get("middle").get(0));
assertEquals(endEvent, patternMap1.get("end").get(0));
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap2 =
(Map<String, List<Event>>) resultRecord2.getValue();
assertEquals(startEvent, patternMap2.get("start").get(0));
assertEquals(middleEvent2, patternMap2.get("middle").get(0));
assertEquals(endEvent, patternMap2.get("end").get(0));
// and now go for a checkpoint with the new serializers
final Event startEvent1 = new Event(42, "start", 2.0);
final SubEvent middleEvent3 = new SubEvent(42, "foo", 1.0, 11.0);
final Event endEvent1 = new Event(42, "end", 2.0);
harness.processElement(new StreamRecord<Event>(startEvent1, 21));
harness.processElement(new StreamRecord<Event>(middleEvent3, 23));
// simulate snapshot/restore with some elements in internal sorting queue
OperatorSubtaskState snapshot = harness.snapshot(1L, 1L);
harness.close();
harness = new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
harness.setup();
harness.initializeState(snapshot);
harness.open();
harness.processElement(new StreamRecord<>(endEvent1, 25));
harness.processWatermark(new Watermark(50));
result = harness.getOutput();
// watermark and the result
assertEquals(2, result.size());
Object resultObject3 = result.poll();
assertTrue(resultObject3 instanceof StreamRecord);
StreamRecord<?> resultRecord3 = (StreamRecord<?>) resultObject3;
assertTrue(resultRecord3.getValue() instanceof Map);
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap3 =
(Map<String, List<Event>>) resultRecord3.getValue();
assertEquals(startEvent1, patternMap3.get("start").get(0));
assertEquals(middleEvent3, patternMap3.get("middle").get(0));
assertEquals(endEvent1, patternMap3.get("end").get(0));
} finally {
harness.close();
}
}
/**
* Manually run this to write binary snapshot data.
*/
@Ignore
@Test
public void writeStartingNewPatternAfterMigrationSnapshot() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent1 = new Event(42, "start", 1.0);
final SubEvent middleEvent1 = new SubEvent(42, "foo1", 1.0, 10.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
harness.open();
harness.processElement(new StreamRecord<Event>(startEvent1, 1));
harness.processElement(new StreamRecord<Event>(new Event(42, "foobar", 1.0), 2));
harness
.processElement(new StreamRecord<Event>(new SubEvent(42, "barfoo", 1.0, 5.0), 3));
harness.processElement(new StreamRecord<Event>(middleEvent1, 2));
harness.processWatermark(new Watermark(5));
// do snapshot and save to file
OperatorSubtaskState snapshot = harness.snapshot(0L, 0L);
OperatorSnapshotUtil.writeStateHandle(snapshot,
"src/test/resources/cep-migration-starting-new-pattern-flink" + flinkGenerateSavepointVersion + "-snapshot");
} finally {
harness.close();
}
}
@Test
public void testRestoreStartingNewPatternAfterMigration() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent1 = new Event(42, "start", 1.0);
final SubEvent middleEvent1 = new SubEvent(42, "foo1", 1.0, 10.0);
final Event startEvent2 = new Event(42, "start", 5.0);
final SubEvent middleEvent2 = new SubEvent(42, "foo2", 2.0, 10.0);
final Event endEvent = new Event(42, "end", 1.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
MigrationTestUtil.restoreFromSnapshot(
harness,
OperatorSnapshotUtil.getResourceFilename("cep-migration-starting-new-pattern-flink" + migrateVersion + "-snapshot"),
migrateVersion);
harness.open();
harness.processElement(new StreamRecord<>(startEvent2, 5));
harness.processElement(new StreamRecord<Event>(middleEvent2, 6));
harness.processElement(new StreamRecord<>(endEvent, 7));
harness.processWatermark(new Watermark(20));
ConcurrentLinkedQueue<Object> result = harness.getOutput();
// watermark and 3 results
assertEquals(4, result.size());
Object resultObject1 = result.poll();
assertTrue(resultObject1 instanceof StreamRecord);
StreamRecord<?> resultRecord1 = (StreamRecord<?>) resultObject1;
assertTrue(resultRecord1.getValue() instanceof Map);
Object resultObject2 = result.poll();
assertTrue(resultObject2 instanceof StreamRecord);
StreamRecord<?> resultRecord2 = (StreamRecord<?>) resultObject2;
assertTrue(resultRecord2.getValue() instanceof Map);
Object resultObject3 = result.poll();
assertTrue(resultObject3 instanceof StreamRecord);
StreamRecord<?> resultRecord3 = (StreamRecord<?>) resultObject3;
assertTrue(resultRecord3.getValue() instanceof Map);
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap1 =
(Map<String, List<Event>>) resultRecord1.getValue();
assertEquals(startEvent1, patternMap1.get("start").get(0));
assertEquals(middleEvent1, patternMap1.get("middle").get(0));
assertEquals(endEvent, patternMap1.get("end").get(0));
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap2 =
(Map<String, List<Event>>) resultRecord2.getValue();
assertEquals(startEvent1, patternMap2.get("start").get(0));
assertEquals(middleEvent2, patternMap2.get("middle").get(0));
assertEquals(endEvent, patternMap2.get("end").get(0));
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap3 =
(Map<String, List<Event>>) resultRecord3.getValue();
assertEquals(startEvent2, patternMap3.get("start").get(0));
assertEquals(middleEvent2, patternMap3.get("middle").get(0));
assertEquals(endEvent, patternMap3.get("end").get(0));
// and now go for a checkpoint with the new serializers
final Event startEvent3 = new Event(42, "start", 2.0);
final SubEvent middleEvent3 = new SubEvent(42, "foo", 1.0, 11.0);
final Event endEvent1 = new Event(42, "end", 2.0);
harness.processElement(new StreamRecord<Event>(startEvent3, 21));
harness.processElement(new StreamRecord<Event>(middleEvent3, 23));
// simulate snapshot/restore with some elements in internal sorting queue
OperatorSubtaskState snapshot = harness.snapshot(1L, 1L);
harness.close();
harness = new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
harness.setup();
harness.initializeState(snapshot);
harness.open();
harness.processElement(new StreamRecord<>(endEvent1, 25));
harness.processWatermark(new Watermark(50));
result = harness.getOutput();
// watermark and the result
assertEquals(2, result.size());
Object resultObject4 = result.poll();
assertTrue(resultObject4 instanceof StreamRecord);
StreamRecord<?> resultRecord4 = (StreamRecord<?>) resultObject4;
assertTrue(resultRecord4.getValue() instanceof Map);
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap4 =
(Map<String, List<Event>>) resultRecord4.getValue();
assertEquals(startEvent3, patternMap4.get("start").get(0));
assertEquals(middleEvent3, patternMap4.get("middle").get(0));
assertEquals(endEvent1, patternMap4.get("end").get(0));
} finally {
harness.close();
}
}
/**
* Manually run this to write binary snapshot data.
*/
@Ignore
@Test
public void writeSinglePatternAfterMigrationSnapshot() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent1 = new Event(42, "start", 1.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new SinglePatternNFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
harness.open();
harness.processWatermark(new Watermark(5));
// do snapshot and save to file
OperatorSubtaskState snapshot = harness.snapshot(0L, 0L);
OperatorSnapshotUtil.writeStateHandle(snapshot,
"src/test/resources/cep-migration-single-pattern-afterwards-flink" + flinkGenerateSavepointVersion + "-snapshot");
} finally {
harness.close();
}
}
@Test
public void testSinglePatternAfterMigration() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent1 = new Event(42, "start", 1.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new SinglePatternNFAFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
MigrationTestUtil.restoreFromSnapshot(
harness,
OperatorSnapshotUtil.getResourceFilename("cep-migration-single-pattern-afterwards-flink" + migrateVersion + "-snapshot"),
migrateVersion);
harness.open();
harness.processElement(new StreamRecord<>(startEvent1, 5));
harness.processWatermark(new Watermark(20));
ConcurrentLinkedQueue<Object> result = harness.getOutput();
// watermark and the result
assertEquals(2, result.size());
Object resultObject = result.poll();
assertTrue(resultObject instanceof StreamRecord);
StreamRecord<?> resultRecord = (StreamRecord<?>) resultObject;
assertTrue(resultRecord.getValue() instanceof Map);
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap =
(Map<String, List<Event>>) resultRecord.getValue();
assertEquals(startEvent1, patternMap.get("start").get(0));
} finally {
harness.close();
}
}
/**
* Manually run this to write binary snapshot data.
*/
@Ignore
@Test
public void writeAndOrSubtypConditionsPatternAfterMigrationSnapshot() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent1 = new SubEvent(42, "start", 1.0, 6.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAComplexConditionsFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
harness.open();
harness.processElement(new StreamRecord<>(startEvent1, 5));
harness.processWatermark(new Watermark(6));
// do snapshot and save to file
OperatorSubtaskState snapshot = harness.snapshot(0L, 0L);
OperatorSnapshotUtil.writeStateHandle(snapshot,
"src/test/resources/cep-migration-conditions-flink" + flinkGenerateSavepointVersion + "-snapshot");
} finally {
harness.close();
}
}
@Test
public void testAndOrSubtypeConditionsAfterMigration() throws Exception {
KeySelector<Event, Integer> keySelector = new KeySelector<Event, Integer>() {
private static final long serialVersionUID = -4873366487571254798L;
@Override
public Integer getKey(Event value) throws Exception {
return value.getId();
}
};
final Event startEvent1 = new SubEvent(42, "start", 1.0, 6.0);
OneInputStreamOperatorTestHarness<Event, Map<String, List<Event>>> harness =
new KeyedOneInputStreamOperatorTestHarness<>(
getKeyedCepOpearator(false, new NFAComplexConditionsFactory()),
keySelector,
BasicTypeInfo.INT_TYPE_INFO);
try {
harness.setup();
MigrationTestUtil.restoreFromSnapshot(
harness,
OperatorSnapshotUtil.getResourceFilename("cep-migration-conditions-flink" + migrateVersion + "-snapshot"),
migrateVersion);
harness.open();
final Event endEvent = new SubEvent(42, "end", 1.0, 2.0);
harness.processElement(new StreamRecord<>(endEvent, 9));
harness.processWatermark(new Watermark(20));
ConcurrentLinkedQueue<Object> result = harness.getOutput();
// watermark and the result
assertEquals(2, result.size());
Object resultObject = result.poll();
assertTrue(resultObject instanceof StreamRecord);
StreamRecord<?> resultRecord = (StreamRecord<?>) resultObject;
assertTrue(resultRecord.getValue() instanceof Map);
@SuppressWarnings("unchecked")
Map<String, List<Event>> patternMap =
(Map<String, List<Event>>) resultRecord.getValue();
assertEquals(startEvent1, patternMap.get("start").get(0));
assertEquals(endEvent, patternMap.get("start").get(1));
} finally {
harness.close();
}
}
private static class SinglePatternNFAFactory implements NFACompiler.NFAFactory<Event> {
private static final long serialVersionUID = 1173020762472766713L;
private final boolean handleTimeout;
private SinglePatternNFAFactory() {
this(false);
}
private SinglePatternNFAFactory(boolean handleTimeout) {
this.handleTimeout = handleTimeout;
}
@Override
public NFA<Event> createNFA() {
Pattern<Event, ?> pattern = Pattern.<Event>begin("start").where(new StartFilter())
.within(Time.milliseconds(10L));
return NFACompiler.compileFactory(pattern, handleTimeout).createNFA();
}
}
private static class NFAComplexConditionsFactory implements NFACompiler.NFAFactory<Event> {
private static final long serialVersionUID = 1173020762472766713L;
private final boolean handleTimeout;
private NFAComplexConditionsFactory() {
this(false);
}
private NFAComplexConditionsFactory(boolean handleTimeout) {
this.handleTimeout = handleTimeout;
}
@Override
public NFA<Event> createNFA() {
Pattern<Event, ?> pattern = Pattern.<Event>begin("start")
.subtype(SubEvent.class)
.where(new MiddleFilter())
.or(new SubEventEndFilter())
.times(2)
.within(Time.milliseconds(10L));
return NFACompiler.compileFactory(pattern, handleTimeout).createNFA();
}
}
private static class NFAFactory implements NFACompiler.NFAFactory<Event> {
private static final long serialVersionUID = 1173020762472766713L;
private final boolean handleTimeout;
private NFAFactory() {
this(false);
}
private NFAFactory(boolean handleTimeout) {
this.handleTimeout = handleTimeout;
}
@Override
public NFA<Event> createNFA() {
Pattern<Event, ?> pattern = Pattern.<Event>begin("start").where(new StartFilter())
.followedByAny("middle")
.subtype(SubEvent.class)
.where(new MiddleFilter())
.followedByAny("end")
.where(new EndFilter())
// add a window timeout to test whether timestamps of elements in the
// priority queue in CEP operator are correctly checkpointed/restored
.within(Time.milliseconds(10L));
return NFACompiler.compileFactory(pattern, handleTimeout).createNFA();
}
}
private static class StartFilter extends SimpleCondition<Event> {
private static final long serialVersionUID = 5726188262756267490L;
@Override
public boolean filter(Event value) throws Exception {
return value.getName().equals("start");
}
}
private static class MiddleFilter extends SimpleCondition<SubEvent> {
private static final long serialVersionUID = 6215754202506583964L;
@Override
public boolean filter(SubEvent value) throws Exception {
return value.getVolume() > 5.0;
}
}
private static class EndFilter extends SimpleCondition<Event> {
private static final long serialVersionUID = 7056763917392056548L;
@Override
public boolean filter(Event value) throws Exception {
return value.getName().equals("end");
}
}
private static class SubEventEndFilter extends SimpleCondition<SubEvent> {
private static final long serialVersionUID = 7056763917392056548L;
@Override
public boolean filter(SubEvent value) throws Exception {
return value.getName().equals("end");
}
}
}
|
Java
|
package misc
// TrackedRepo identifies a git remote repository.
type TrackedRepo string
|
Java
|
# -*- coding: utf-8 -*-
#
# Armstrong Platform Documentation documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 26 13:38:48 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Armstrong Platform'
copyright = u'2011, Bay Citizen and Texas Tribune'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '12.03.1'
# The full version, including alpha/beta/rc tags.
release = '12.03.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'armstrong'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['_themes', ]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
html_additional_pages = {
'index': 'index.html',
}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'ArmstrongPlatformDocumentationdoc'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'ArmstrongPlatformDocumentation.tex', u'Armstrong Platform Documentation Documentation',
u'Bay Citizen and Texas Tribune', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'armstrongplatformdocumentation', u'Armstrong Platform Documentation Documentation',
[u'Bay Citizen and Texas Tribune'], 1)
]
# -- Options for Epub output ---------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = u'Armstrong Platform Documentation'
epub_author = u'Bay Citizen and Texas Tribune'
epub_publisher = u'Bay Citizen and Texas Tribune'
epub_copyright = u'2011, Bay Citizen and Texas Tribune'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# A list of files that should not be packed into the epub file.
#epub_exclude_files = []
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# Allow duplicate toc entries.
#epub_tocdup = True
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
|
Java
|
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.generation;
import com.intellij.codeInsight.AnnotationUtil;
import com.intellij.codeInsight.intention.AddAnnotationPsiFix;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static com.intellij.codeInsight.AnnotationUtil.CHECK_EXTERNAL;
import static com.intellij.codeInsight.AnnotationUtil.CHECK_TYPE;
/**
* @author anna
*/
public interface OverrideImplementsAnnotationsHandler {
ExtensionPointName<OverrideImplementsAnnotationsHandler> EP_NAME = ExtensionPointName.create("com.intellij.overrideImplementsAnnotationsHandler");
/**
* Returns annotations which should be copied from a source to an implementation (by default, no annotations are copied).
*/
default String[] getAnnotations(@NotNull PsiFile file) {
//noinspection deprecation
return getAnnotations(file.getProject());
}
/**
* @deprecated Use {@link #getAnnotations(PsiFile)}
*/
@Deprecated
String[] getAnnotations(Project project);
@Deprecated
@NotNull
default String[] annotationsToRemove(Project project, @NotNull String fqName) {
return ArrayUtil.EMPTY_STRING_ARRAY;
}
/** Perform post processing on the annotations, such as deleting or renaming or otherwise updating annotations in the override */
default void cleanup(PsiModifierListOwner source, @Nullable PsiElement targetClass, PsiModifierListOwner target) {
}
static void repeatAnnotationsFromSource(PsiModifierListOwner source, @Nullable PsiElement targetClass, PsiModifierListOwner target) {
Module module = ModuleUtilCore.findModuleForPsiElement(targetClass != null ? targetClass : target);
GlobalSearchScope moduleScope = module != null ? GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module) : null;
Project project = target.getProject();
JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
for (OverrideImplementsAnnotationsHandler each : EP_NAME.getExtensionList()) {
for (String annotation : each.getAnnotations(target.getContainingFile())) {
if (moduleScope != null && facade.findClass(annotation, moduleScope) == null) continue;
int flags = CHECK_EXTERNAL | CHECK_TYPE;
if (AnnotationUtil.isAnnotated(source, annotation, flags) && !AnnotationUtil.isAnnotated(target, annotation, flags)) {
each.transferToTarget(annotation, source, target);
}
}
}
for (OverrideImplementsAnnotationsHandler each : EP_NAME.getExtensionList()) {
each.cleanup(source, targetClass, target);
}
}
default void transferToTarget(String annotation, PsiModifierListOwner source, PsiModifierListOwner target) {
PsiModifierList modifierList = target.getModifierList();
assert modifierList != null : target;
PsiAnnotation srcAnnotation = AnnotationUtil.findAnnotation(source, annotation);
PsiNameValuePair[] valuePairs = srcAnnotation != null ? srcAnnotation.getParameterList().getAttributes() : PsiNameValuePair.EMPTY_ARRAY;
AddAnnotationPsiFix.addPhysicalAnnotation(annotation, valuePairs, modifierList);
}
}
|
Java
|
package com.chisw.work.addressbook.test;
import com.chisw.work.addressbook.Data.GroupData;
import com.chisw.work.addressbook.Data.Groups;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
public class TestGroupModification extends TestBase {
@BeforeMethod
public void checkPreconditions() {
if (app.db().groups().size() == 0) {
app.goTo().groupPage();
app.groups().createGroupInBeforeMethod();
}
}
@Test
public void checkGroupModification() {
Groups before = app.db().groups();
GroupData modifiedGroup = before.iterator().next();
GroupData group = new GroupData()
.withId(modifiedGroup.getId()).withGroupName("test 258").withGroupLogo("Logo 123").withGroupComment("Comment 12345");
app.goTo().groupPage();
app.groups().modifyGroup(group);
assertThat(app.groups().count(),equalTo(before.size()));
Groups after = app.db().groups();
assertThat(after, equalTo(before.withoutAdded(modifiedGroup).withAdded(group)));
verifyGroupsListInUi();
}
}
|
Java
|
package io.omengye.common.utils.constants;
public class Constants {
private Constants(){}
public static final String RESULT_FLAG = "flag";
}
|
Java
|
/*
* Created on Mar 29, 2009
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright @2013 the original author or authors.
*/
package org.fest.assertions.api;
import static org.fest.test.ExpectedException.none;
import org.fest.test.ExpectedException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
/**
* Tests for {@link LongAssert#isNull()}.
*
* @author Yvonne Wang
*/
public class LongAssert_isNull_Test {
@Rule
public ExpectedException thrown = none();
private LongAssert assertions;
private Long actual;
@Before
public void setUp() {
actual = null;
assertions = new LongAssert(actual);
}
@Test
public void should_pass_if_actual_is_null() {
assertions.isNull();
}
@Test
public void should_fail_if_actual_is_not_null() {
thrown.expect(AssertionError.class);
actual = new Long(6l);
assertions = new LongAssert(actual);
assertions.isNull();
}
}
|
Java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.