code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
jsonp({"cep":"57312650","logradouro":"Rua Andr\u00e9 F\u00e9lix da Silva","bairro":"Novo Horizonte","cidade":"Arapiraca","uf":"AL","estado":"Alagoas"});
lfreneda/cepdb
api/v1/57312650.jsonp.js
JavaScript
cc0-1.0
153
jsonp({"cep":"13051407","logradouro":"Avenida Jos\u00e9 Christov\u00e3o Gon\u00e7alves","bairro":"Jardim Stella","cidade":"Campinas","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/13051407.jsonp.js
JavaScript
cc0-1.0
172
#!/bin/sh # Hinomoto Installation Script # Written in 2012 by 伴上段 # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public domain # worldwide. This software is distributed without any warranty. # # You should have received a copy of the CC0 Public Domain Dedication along # with this software. If not, see # <http://creativecommons.org/publicdomain/zero/1.0/>. if [ -z "$CC" ]; then echo "ERROR: The environment CC is not defined. Please define it before running this installation script." >&2 exit 1 fi if [ $# -eq 0 ]; then echo "ERROR: No installation directory specified. Please specify it as the first command-line argument for this script." >&2 exit 1 fi if [ ! -d "$1" ]; then echo "ERROR: $1 is not a directory." >&2 exit 1 fi set -x $CC $CFLAGS -o $1/eadate eadate.c $CC $CFLAGS -o $1/dunicode dunicode.c $CC $CFLAGS -o $1/eunicode eunicode.c cp taguranges $1 cp taguhan $1 cp filteruhan $1 cp uniquhan $1 cp annouhan $1
jtvaughan/hinomoto
install.sh
Shell
cc0-1.0
1,047
#include "pch.h" /********************************************************************** <BR> This file is part of Crack dot Com's free source code release of Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for information about compiling & licensing issues visit this URL</a> <PRE> If that doesn't help, contact Jonathan Clark at golgotha_source@usa.net (Subject should have "GOLG" in it) ***********************************************************************/ #include "sound_man.h" #include "objs/model_id.h" #include "objs/model_draw.h" #include "objs/rocktank.h" #include "objs/base_launcher.h" #include "input.h" #include "math/pi.h" #include "math/angle.h" #include "math/trig.h" #include "objs/buster_rocket.h" #include "resources.h" #include "saver.h" #include "object_definer.h" #include "objs/fire.h" #include "lisp/lisp.h" static g1_object_type stank; void g1_base_launcher_init() { //buster = g1_get_object_type("buster_rocket"); stank = g1_get_object_type("stank"); } g1_object_definer<g1_base_launcher_class> g1_base_launcher_def("base_launcher", g1_object_definition_class::EDITOR_SELECTABLE, g1_base_launcher_init); g1_base_launcher_class::g1_base_launcher_class(g1_object_type id, g1_loader_class * fp) : g1_map_piece_class(id,fp) { defaults = g1_base_launcher_def.defaults; draw_params.setup("rocket_truck_top","rocket_truck_shadow"); first_time=i4_F; w16 ver,data_size; if (fp) { fp->get_version(ver,data_size); if (ver==DATA_VERSION) { fp->end_version(I4_LF); } else { fp->seek(fp->tell() + data_size); } } else { first_time=i4_T; } fire_delay = defaults->fire_delay; health = 1000; //no sound for now radar_type=G1_RADAR_WEAPON; set_flag(AERIAL | HIT_GROUND | SHADOWED | DANGEROUS, 1); } i4_bool g1_base_launcher_class::can_attack(g1_object_class * who) { //bad: was attacking ANY stank. return (who->id == stank && who->player_num!=player_num); } void g1_base_launcher_class::save(g1_saver_class * fp) { g1_map_piece_class::save(fp); fp->start_version(DATA_VERSION); fp->end_version(); } void g1_base_launcher_class::fire() { if (attack_target.valid()) { i4_transform_class o2w; calc_world_transform(1,&o2w); i4_3d_vector local_fire_point; i4_3d_vector world_fire_point, world_fire_dir; o2w.transform(i4_3d_vector(0.4f, 0, 0.2f), world_fire_point); o2w.transform(i4_3d_vector(1,0,0.2f), world_fire_dir); world_fire_dir-=world_fire_point; fire_delay=defaults->fire_delay; //g1_fire(li_get_symbol("buster_rocket"), this, attack_target.get(), // world_fire_point, world_fire_dir); g1_fire(defaults->fire_type,this,attack_target.get(), world_fire_point,world_fire_dir); } } i4_bool g1_base_launcher_class::occupy_location() { if (first_time) { h += 0.9f; //this alone is dangerous: moving the object in //the editor would increase its height beyond limit without //the user actually dragging anything. lh = h; } first_time=i4_F; return g1_map_piece_class::occupy_location(); } void g1_base_launcher_class::think() { find_target(); // can't hurt me.... I'm invincible! (no more) //health = 1000; pitch = 0; //groundpitch;//*cos(theta) - groundroll *sin(theta); roll = 0; //groundroll;// *cos(theta) + groundpitch*sin(theta); if (fire_delay) { fire_delay--; } request_think(); //aim the turet if (attack_target.valid()) { i4_float dx,dy,angle,dangle; //this will obviously only be true if attack_target.ref != NULL dx = (attack_target->x - x); dy = (attack_target->y - y); //aim the turet angle = i4_atan2(dy,dx); //snap it i4_normalize_angle(angle); dangle = i4_rotate_to(theta,angle,defaults->turn_speed); if (dangle<defaults->turn_speed && dangle>-defaults->turn_speed) { if (!fire_delay) { fire(); } } } }
pgrawehr/golgotha
objs__base_launcher.cpp
C++
cc0-1.0
4,079
jsonp({"cep":"18611271","logradouro":"Pra\u00e7a Jo\u00e3o Batista de Camargo","bairro":"Jardim Dona Nicota de Barros","cidade":"Botucatu","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/18611271.jsonp.js
JavaScript
cc0-1.0
178
jsonp({"cep":"86078664","logradouro":"Rua Dagoberto Ferraz dos Santos","bairro":"Parque Residencial Michael Licha","cidade":"Londrina","uf":"PR","estado":"Paran\u00e1"});
lfreneda/cepdb
api/v1/86078664.jsonp.js
JavaScript
cc0-1.0
171
jsonp({"cep":"73751087","logradouro":"Quadra 5 MR 12","bairro":"Setor Norte","cidade":"Planaltina de Goi\u00e1s","uf":"GO","estado":"Goi\u00e1s"});
lfreneda/cepdb
api/v1/73751087.jsonp.js
JavaScript
cc0-1.0
148
jsonp({"cep":"39406122","logradouro":"Rua Cinco","bairro":"Colorado","cidade":"Montes Claros","uf":"MG","estado":"Minas Gerais"});
lfreneda/cepdb
api/v1/39406122.jsonp.js
JavaScript
cc0-1.0
131
import OOMP newPart = OOMP.oompItem(9185) newPart.addTag("oompType", "POTE") newPart.addTag("oompSize", "07") newPart.addTag("oompColor", "X") newPart.addTag("oompDesc", "O102") newPart.addTag("oompIndex", "01") OOMP.parts.append(newPart)
oomlout/oomlout-OOMP
old/OOMPpart_POTE_07_X_O102_01.py
Python
cc0-1.0
241
# MODEL1012090005: Kim2011_Oscillator_ExtendedI ## Installation Download this repository, and install with distutils `python setup.py install` Or, install using pip `pip install git+https://github.com/biomodels/MODEL1012090005.git` To install a specific version (in this example, from the 2014-09-16 BioModels release) `pip install git+https://github.com/biomodels/MODEL1012090005.git@20140916` ## Usage Importing the model package. `import MODEL1012090005 as model` Get the SBML string from the model `print model.sbmlString` If [python-libsbml](https://pypi.python.org/pypi/python-libsbml) bindings are installed, the libsbml.SBMLDocument object is also accessible `model.sbml` # Model Notes This model originates from BioModels Database: A Database of Annotated Published Models (http://www.ebi.ac.uk/biomodels/). It is copyright (c) 2005-2011 The BioModels.net Team. To the extent possible under law, all copyright and related or neighbouring rights to this encoded model have been dedicated to the public domain worldwide. Please refer to [CC0 Public Domain Dedication](http://creativecommons.org/publicdomain/zero/1.0/) for more information. In summary, you are entitled to use this encoded model in absolutely any manner you deem suitable, verbatim, or with modification, alone or embedded it in a larger context, redistribute it, commercially or not, in a restricted way or not.. To cite BioModels Database, please use: [Li C, Donizelli M, Rodriguez N, Dharuri H, Endler L, Chelliah V, Li L, He E, Henry A, Stefan MI, Snoep JL, Hucka M, Le Novère N, Laibe C (2010) BioModels Database: An enhanced, curated and annotated resource for published quantitative kinetic models. BMC Syst Biol., 4:92.](http://www.ncbi.nlm.nih.gov/pubmed/20587024)
biomodels/MODEL1012090005
README.md
Markdown
cc0-1.0
1,777
# Configuration file structure Entity browsers are configuration entities that can be created [either by the site builder on the UI](creating_browser_through_ui.md) or imported from YAML configuration files. If you are using a module that provides default or example configuration, these will be in the .yml files and will have the following structure (example ``` entity_browser.browser.field_files.yml``` from the example sub-module): ```yaml name: test_files label: 'Test entity browser for files' display: iframe display_configuration: width: 650 height: 500 link_text: 'Select entities' selection_display: no_display selection_display_configuration: { } widget_selector: tabs widget_selector_configuration: { } widgets: a4ad947c-9669-497c-9988-24351955a02f: settings: view: files_entity_browser view_display: entity_browser_1 uuid: a4ad947c-9669-497c-9988-24351955a02f weight: 1 label: 'Files listing' id: view 735d146c-a4b2-4327-a057-d109e0905e05: settings: upload_location: 'public://' uuid: 735d146c-a4b2-4327-a057-d109e0905e05 weight: 0 label: 'Upload files' id: upload ``` The above configuration defines an entity browser that: - is displayed in an iFrame 650px by 500px in size, - is displayed when the user clicks on "Select entities" link, - has no selection display, - displays widgets as tabs, - comes with two widgets: - a "file upload" widget that uploads files in the public:// directory, - a "view" browsing/selection widget that uses the display "entity_browser_1" of the view "files_entity_browser". - **name:** Unique machine name. - **label:** Human readable name. - **display:** ID of display plugin to be used. - **display_configuration:** Display specific configuration. Depends on the display plugin used. See schema definitions provided by individual plugins (grep for "entity_browser.browser.display.*" in configuration schema yaml files). - **selection_display:** ID of selection display plugin to be used. - **selection_display_configuration:** Selection display specific configuration. Depends on the selection display plugin used. See schema definitions provided by individual plugins (grep for "entity_browser.browser.selection_display.*" in configuration schema yaml files). - **widget_selector:** ID of widget selector plugin to be used. - **widget_selector_configuration:** Widget selector specific configuration. Depends on the widget selector plugin used. See schema definitions provided by individual plugins (grep for "entity_browser.browser.widget_selector.*" in configuration schema yaml files). - **widgets**: List of widgets to be used (keyed by UUID). Structure of individual entry: - **id:** ID of widget plugin. - **label:** Human readable name. - **weight:** Weight. Widgets are ordered ascending by wight. - **uuid:** Unique widget UUID. Must match the key. - **settings:** Widget specific configuration. Depends on the widget plugin used. See schema definitions provided by individual plugins (grep for "entity_browser.browser.widget.*" in configuration schema yaml files).
drupal-media/d8-guide
modules/entity_browser/configuration.md
Markdown
cc0-1.0
3,122
jsonp({"cep":"26225450","logradouro":"Travessa Rosa","bairro":"Centro","cidade":"Nova Igua\u00e7u","uf":"RJ","estado":"Rio de Janeiro"});
lfreneda/cepdb
api/v1/26225450.jsonp.js
JavaScript
cc0-1.0
138
module(..., package.seeall) require("lua_tda") require "lpeg" require "core" require "dialog_utilities" joProfile = require "OWLGrEd_UserFields.Profile" syncProfile = require "OWLGrEd_UserFields.syncProfile" styleMechanism = require "OWLGrEd_UserFields.styleMechanism" owl_fields_specific = require "OWLGrEd_UserFields.owl_fields_specific" profileMechanism = require "OWLGrEd_UserFields.profileMechanism" serialize = require "serialize" local configurator = require("configurator.configurator") require("graph_diagram_style_utils") --atver formu ar skatijumu sarakstu un navigaciju function viewMechanism() local selectedItem = lQuery("D#ListBox[id='ListWithProfiles']/selected") if selectedItem:is_not_empty() then local profileName = selectedItem:attr("value") local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end local close_button = lQuery.create("D#Button", { caption = "Close" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.close()") }) local path if tda.isWeb then path = tda.FindPath(tda.GetToolPath() .. "/AllPlugins", "OWLGrEd_UserFields") .. "/" else path = tda.GetProjectPath() .. "\\Plugins\\OWLGrEd_UserFields\\" end local form = lQuery.create("D#Form", { id = "viewsInProfile" ,caption = "Views in Profile" ,buttonClickOnClose = false ,cancelButton = close_button ,defaultButton = close_button ,eventHandler = utilities.d_handler("Close", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.close()") ,component = { lQuery.create("D#VerticalBox",{ component = { lQuery.create("D#HorizontalBox" ,{ minimumWidth = 350 ,minimumHeight = 250 ,component = { lQuery.create("D#VerticalBox", { id = "VerticalBoxWithListBoxView" ,component = { lQuery.create("D#ListBox", { id = "ListWithViews" ,item = collectViews(profileName) }) } }) ,lQuery.create("D#VerticalBox", { component = { lQuery.create("D#ImageButton",{ fileName = path .. "up.bmp" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.upView()") }) ,lQuery.create("D#ImageButton",{ fileName = path .. "down.bmp" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.downView()") }) } }) ,lQuery.create("D#VerticalBox", { component = { lQuery.create("D#Button", { caption = "Properties" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.openViewProperties()") }) ,lQuery.create("D#Button", { caption = "Apply by default" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setDefault()") }) ,lQuery.create("D#Button", { caption = "New view" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.newView()") }) ,lQuery.create("D#Button", { caption = "Delete" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.deleteView()") }) } }) } }) } }) ,lQuery.create("D#HorizontalBox", { id = "closeButton" ,horizontalAlignment = 1 ,component = {close_button}}) } }) dialog_utilities.show_form(form) end end --atlasa visus profila skatijumus function collectViews(profile) if profile~=nil then local values = lQuery("AA#Profile[name='" .. profile .. "']"):find("/view"):map( function(obj) return {lQuery(obj):attr("name"), lQuery(obj):attr("isDefault")} end) return lQuery.map(values, function(view) local value = view[1] if view[2]=="true" then value = value .. " (Default)" end return lQuery.create("D#Item", { value = value }) end) end end --uzstada/nonem pazimi, ka skatijums ir noklusets function setDefault() local selectedItem = lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected") if selectedItem:is_empty() then selectedItem=lQuery("D#ListBox[id='ListWithProfiles']/selected") end local selectedItem = lQuery("D#ListBox[id='ListWithViews']/selected") if selectedItem:is_not_empty() then local viewSize = string.find(selectedItem:attr("value"), " ") local viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end local default = lQuery("AA#View[name='" .. viewName .. "']"):attr("isDefault") if default=="true" then lQuery("AA#View[name='" .. viewName .. "']"):attr("isDefault", "false") lQuery("GraphDiagramType[id='OWL']/graphDiagram"):each(function(diagram) --nomem view local view=lQuery("Extension[type='aa#View'][id='" .. viewName .. "']") if view~=nil and view:find("/elementStyleSetting"):is_not_empty() then local el = lQuery(diagram):find("/element:has(/elemType/elementStyleSetting)"):filter(function(obj) local l = 0 local ex = obj:find("/elemType/elementStyleSetting/extension"):each(function(ext) if ext:id() == view:id() then l =1 end end) return l == 1 end) el:each(function(obj) owl_fields_specific.ElemStyleBySettings(obj, "ViewRemove", view) end) end if view~=nil and view:find("/compartmentStyleSetting"):is_not_empty() then local values = lQuery(diagram):find("/element/compartment:has(/compartType/compartmentStyleSetting)") values = values:add(lQuery(diagram):find("/element/compartment/subCompartment:has(/compartType/compartmentStyleSetting)")) values = values:filter(function(obj) local l = 0 local ex = obj:find("/compartType/compartmentStyleSetting/extension"):each(function(ext) if ext:id() == view:id() then l =1 end end) return l == 1 end) values:each(function(obj) owl_fields_specific.CompartStyleBySetting(obj,"ViewRemove", view) end) end --atjaunojam tos elementus, kur bija stila izmaina local elem = lQuery(diagram):find("/element:has(/compartment/compartType/compartmentStyleSetting)") elem:add(lQuery(diagram):find("/element:has(/compartment/subCompartment/compartType/compartmentStyleSetting)")) lQuery("Compartment:has(/compartType/compartmentStyleSetting[procCondition='setTextStyle'])"):each(function(obj) core.set_parent_value(obj) end) utilities.refresh_element(elem, diagram) local cmd = lQuery.create("OkCmd") cmd:link("graphDiagram", diagram) utilities.execute_cmd_obj(cmd) graph_diagram_style_utils.save_diagram_element_and_compartment_styles(diagram) end) else lQuery("AA#View[name='" .. viewName .. "']"):attr("isDefault", "true") local view=lQuery("Extension[type='aa#View'][id='" .. viewName .. "']") --neuzstadit noklusetos skatijumus jau izveidotajam diagrammam lQuery("GraphDiagramType[id='OWL']/graphDiagram"):link("aa#notDefault", view) end refreshListBox() end end --atver formu ar skatijuma configuracijas iespejam function openViewProperties() local selectedItem = lQuery("D#ListBox[id='ListWithViews']/selected") if selectedItem:is_not_empty() then local viewSize = string.find(selectedItem:attr("value"), " ") local viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end View(viewName) else pleseSelectView() end end function pleseSelectView() local close_button = lQuery.create("D#Button", { caption = "Ok" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.profileMechanism.closeContextTypesMissing()") }) local form = lQuery.create("D#Form", { id = "contextTypesMissing" ,buttonClickOnClose = false ,cancelButton = close_button ,defaultButton = create_button ,eventHandler = utilities.d_handler("Close", "lua_engine", "lua.OWLGrEd_UserFields.profileMechanism.closeContextTypesMissing()") ,component = { lQuery.create("D#VerticalBox",{ component = { lQuery.create("D#Label", {caption = "Please select a view"}) } }) ,lQuery.create("D#HorizontalBox", { id = "closeButton" --,horizontalAlignment = 1 ,component = {close_button}}) } }) dialog_utilities.show_form(form) end --izdzes visus skatijumus no profila (profileName - profila vards) function deleteViewFromProfile(profileName) local changeElemStyle = 0 local changeCompartStyle = 0 local profile = lQuery("AA#Profile[name='" .. profileName .. "']") local view = profile:find("/view"):each(function(objV) lQuery(objV):each(function(obj) obj:find("/styleSetting/customStyleSetting"):delete() obj:find("/styleSetting"):delete() end) local extension = lQuery("Extension[id='" .. objV:attr("name") .. "'][type='aa#View']") local changeElemStyleTemp = styleMechanism.syncViewStyleSettingElement(objV, extension) if changeElemStyleTemp~=nil then changeElemStyle = changeElemStyle + changeElemStyleTemp end local changeCompartStyleTemp = styleMechanism.syncViewStyleSettingCompartment(objV, extension) if changeCompartStyleTemp~=nil then changeCompartStyle = changeCompartStyle + changeCompartStyleTemp end end) --izdzest AA# Dalu lQuery("GraphDiagram:has(/graphDiagramType[id='OWL'])"):each(function(diagram) utilities.execute_cmd("SaveDgrCmd", {graphDiagram = diagram}) if changeElemStyle > 0 then lQuery(diagram):find("/element:has(/elemType/elementStyleSetting)"):each(function(obj) owl_fields_specific.ElemStyleBySettings(obj, "Change") end) end if changeCompartStyle > 0 then lQuery(diagram):find("/element/compartment:has(/compartType/compartmentStyleSetting)"):each(function(obj) owl_fields_specific.CompartStyleBySetting(obj, "Change") end) end local cmd = lQuery.create("OkCmd") cmd:link("graphDiagram", diagram) utilities.execute_cmd_obj(cmd) graph_diagram_style_utils.save_diagram_element_and_compartment_styles(diagram) end) if changeElemStyle > 0 or changeCompartStyle > 0 then --jaatjauno visi elementi local elem = lQuery("Element:has(/elemType/elementStyleSetting)"):each(function(obj) utilities.refresh_element(obj, obj:find("/graphDiagram")) end) end styleMechanism.deleteIsDeletedStyleSetting() profile:find("/view"):each(function(objV) local extension = lQuery("Extension[id='" .. objV:attr("name") .. "'][type='aa#View']") lQuery(extension):delete() end) profile:find("/view"):delete() end --izdzes skatijumu function deleteView() local selectedItem = lQuery("D#ListBox[id='ListWithViews']/selected") if selectedItem:is_not_empty() then local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end local profile = lQuery("AA#Profile[name='" .. profileName .. "']") viewSize = string.find(selectedItem:attr("value"), " ") local viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end local view = profile:find("/view[name='" .. viewName .. "']") lQuery(view):each(function(obj) obj:find("/styleSetting/customStyleSetting"):delete() obj:find("/styleSetting"):delete() end) --izdzest AA# Dalu local extension = lQuery("Extension[id='" .. viewName .. "'][type='aa#View']") local changeCompartStyle = styleMechanism.syncViewStyleSettingCompartment(view, extension) local changeElemStyle = styleMechanism.syncViewStyleSettingElement(view, extension) lQuery("GraphDiagram:has(/graphDiagramType[id='OWL'])"):each(function(diagram) utilities.execute_cmd("SaveDgrCmd", {graphDiagram = diagram}) if changeElemStyle > 0 then lQuery(diagram):find("/element:has(/elemType/elementStyleSetting)"):each(function(obj) owl_fields_specific.ElemStyleBySettings(obj, "Change") end) end if changeCompartStyle > 0 then lQuery(diagram):find("/element/compartment:has(/compartType/compartmentStyleSetting)"):each(function(obj) owl_fields_specific.CompartStyleBySetting(obj, "Change") end) end local cmd = lQuery.create("OkCmd") cmd:link("graphDiagram", diagram) utilities.execute_cmd_obj(cmd) graph_diagram_style_utils.save_diagram_element_and_compartment_styles(diagram) end) if view:attr("showInPalette")=="true" then --jaatjauno palleteStyle forma lQuery("D#HorizontalBox[id='HorFormStylePalette']/component[id='" .. view:id() .. "']"):delete() end if view:attr("showInToolBar")=="true" then --jaatjauno palleteStyle forma lQuery("ToolbarElementType[id='" .. view:id() .. "']"):delete() -- refresh project diagram configurator.make_toolbar(lQuery("GraphDiagramType[id=projectDiagram]")) configurator.make_toolbar(lQuery("GraphDiagramType[id=OWL]")) end view:delete() lQuery(extension):delete() --atjaunot listBox refreshListBox() lQuery("D#HorizontalBox[id='HorFormStylePalette']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) if changeElemStyle > 0 or changeCompartStyle > 0 then --jaatjauno visi elementi local elem = lQuery("Element:has(/elemType/elementStyleSetting)"):each(function(obj) utilities.refresh_element(obj, obj:find("/graphDiagram")) end) end end styleMechanism.deleteIsDeletedStyleSetting() end --atver formu jauna skatijuma veidosanai function newView() local close_button = lQuery.create("D#Button", { caption = "Close" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeNewViewForm()") }) local create_button = lQuery.create("D#Button", { caption = "Create" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.createNewView()") }) local form = lQuery.create("D#Form", { id = "newView" ,caption = "Create new view" ,buttonClickOnClose = false ,cancelButton = close_button ,defaultButton = create_button ,eventHandler = utilities.d_handler("Close", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeNewViewForm()") ,component = { lQuery.create("D#VerticalBox",{ component = { lQuery.create("D#InputField", { id = "InputFieldForNewView" ,text = "" }) } }) ,lQuery.create("D#HorizontalBox", { id = "closeButton" ,horizontalAlignment = 1 ,component = {create_button, close_button}}) } }) dialog_utilities.show_form(form) end --izveido jaunu skatijumu function createNewView() --atrast profilu local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end local profile = lQuery("AA#Profile[name='" .. profileName .. "']") local newViewValue = lQuery("D#InputField[id='InputFieldForNewView']"):attr("text") if newViewValue ~="" then if lQuery("Extension[type = 'aa#View'][id = '" .. newViewValue .. "']"):is_empty() then local selectedItem = lQuery("D#ListBox[id='ListWithViews']/selected") lQuery("D#ListBox[id='ListWithViews']"):remove_link("selected", selectedItem) --izveidot jaunu AA#View instanci --piesaistit to profile AA#Profile instancei lQuery.create("AA#View", {name = newViewValue}):link("profile", profile) lQuery.create("Extension", {id = newViewValue, type = "aa#View"}):link("aa#owner", lQuery("Extension[id = '" .. profileName .. "'][type='aa#Profile']")) --atjaunot listBox refreshListBox() View(newViewValue) closeNewViewForm() else --print("The view with this name already exists") --!!!!!!!!!!!!!!! end end end --atjauno skatijumu sarakstu function refreshListBox() local profileName = lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected") if profileName:is_empty() then profileName=lQuery("D#ListBox[id='ListWithProfiles']/selected") end profileName = profileName:attr("value") local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end lQuery("D#ListBox[id='ListWithViews']"):delete() lQuery.create("D#ListBox", { id = "ListWithViews" ,item = collectViews(profileName) }):link("container", lQuery("D#VerticalBox[id='VerticalBoxWithListBoxView']")) lQuery("D#VerticalBox[id='VerticalBoxWithListBoxView']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) end --nolasa pazimi vai skatijums ir noklusets function getViewDefault(viewName) return lQuery("AA#View[name='" ..viewName .. "']"):attr("isDefault") end function getShowInPalette(viewName) return lQuery("AA#View[name='" ..viewName .. "']"):attr("showInPalette") end function getShowInToolBar(viewName) return lQuery("AA#View[name='" ..viewName .. "']"):attr("showInToolBar") end function setShowInToolBar() local focus = lQuery("D#CheckBox[id='setShowInToolBar']"):attr("checked") local selectedItem=lQuery("D#ListBox[id='ListWithViews']/selected") local viewName if selectedItem:attr("value") == nil then viewName = lQuery("D#InputField[id='InputFieldForNewView']"):attr("text") else local viewSize = string.find(selectedItem:attr("value"), " ") viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end end local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']"):attr("showInToolBar", focus) local view = lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']") --japarveido attiecigas toolbar pogas if focus == "true" then --izveidojam jaunu pogu local owl_dgr_type = lQuery("GraphDiagramType[id=OWL]") local toolbarTypeOwl = owl_dgr_type:find("/toolbarType") if toolbarTypeOwl:is_empty() then toolbarTypeOwl = lQuery.create("ToolbarType", {graphDiagramType = owl_dgr_type}) end local view_manager_toolbar_el = lQuery.create("ToolbarElementType", { toolbarType = toolbarTypeOwl, id = view:id(), caption = view:attr("name"), picture = view:attr("inActiveIcon"), procedureName = "OWLGrEd_UserFields.styleMechanism.applyViewFromToolBar" }) else --dzesam pogu lQuery("ToolbarElementType[id='" .. view:id() .. "']"):delete() end -- refresh project diagram configurator.make_toolbar(lQuery("GraphDiagramType[id=projectDiagram]")) configurator.make_toolbar(lQuery("GraphDiagramType[id=OWL]")) end function setShowInPalette() local focus = lQuery("D#CheckBox[id='setShowInPalette']"):attr("checked") local selectedItem=lQuery("D#ListBox[id='ListWithViews']/selected") local viewName if selectedItem:attr("value") == nil then viewName = lQuery("D#InputField[id='InputFieldForNewView']"):attr("text") else local viewSize = string.find(selectedItem:attr("value"), " ") viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end end local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']"):attr("showInPalette", focus) local view = lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']") if focus == "true" then local picturePath if tda.isWeb then picturePath = tda.GetToolPath().. "/web-root/Pictures/" else picturePath = tda.GetProjectPath() .. "\\Pictures\\" end --jaatjauno palleteStyle forma lQuery.create("D#Row", {id = view:id(),component={ lQuery.create("D#Label", {caption=view:attr("name")}) ,lQuery.create("D#ImageButton", {fileName = picturePath .. view:attr("inActiveIcon")}) ,lQuery.create("D#Label", {caption="Default"}) ,lQuery.create("D#CheckBox", { id=view:id() ,editable = "true" ,checked = view:attr("isDefault") ,eventHandler = {utilities.d_handler("Change", "lua_engine", "lua.OWLGrEd_UserFields.stylePalette.setAsDefault()")}}) }}):link("container", lQuery("D#HorizontalBox[id='HorFormStylePalette']")) else --jaatjauno palleteStyle forma lQuery("D#HorizontalBox[id='HorFormStylePalette']/component[id='" .. view:id() .. "']"):delete() end lQuery("D#HorizontalBox[id='HorFormStylePalette']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) end --uzstada/nomem pazimi vai skatijums ir noklusets function setViewDefault() local focus = lQuery("D#CheckBox[id='setViewDefault']"):attr("checked") local selectedItem=lQuery("D#ListBox[id='ListWithViews']/selected") local viewName if selectedItem:attr("value") == nil then viewName = lQuery("D#InputField[id='InputFieldForNewView']"):attr("text") else local viewSize = string.find(selectedItem:attr("value"), " ") viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end end local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']"):attr("isDefault", focus) --nonemt linkus uz diagramam local view = lQuery("Extension[type='aa#View'][id='" .. viewName .. "']") local dia = view:find("/graphDiagram") view:remove_link("graphDiagram", dia) --neuzstadit noklusetos skatijumus jau izveidotajam diagrammam lQuery("GraphDiagramType[id='OWL']/graphDiagram"):link("aa#notDefault", view) end --pacel skatijumu augstak function upView() --profils local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end if profileName~=nil then local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end local profile = lQuery("Extension[type='aa#Profile'][id='" .. profileName .. "']") local profileA = lQuery("AA#Profile[name='" .. profileName .. "']") --izveletais skatijums local selectedItem = lQuery("D#ListBox[id='ListWithViews']/selected") if selectedItem:is_not_empty() then local viewSize = string.find(selectedItem:attr("value"), " ") local viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end local view = profile:find("/aa#subExtension[type='aa#View'][id='" .. viewName .. "']") local viewA = profileA:find("/view[name='" .. viewName .. "']") --ja skatijums ir pirmais neko nedarit if profile:find("/aa#subExtension[type='aa#View']"):first():id()~=view:id() then --atrast visus skatijumus, kas pielikti dotajam profilam, ielikt tabulaa local viewTable = profile:find("/aa#subExtension[type='aa#View']"):map(function(obj) return obj end) local viewTableA = profileA:find("/view"):map(function(obj) return obj end) --nonemt saites no profila uz skatijumiem profile:remove_link("aa#subExtension", profile:find("/aa#subExtension[type='aa#View']")) profileA:remove_link("view", profileA:find("/view")) for i,v in pairs(viewTable) do --ja nakosais skatijums ir izveletais, tad mainit vietam if i~=1 and v:id() == view:id() then local temp = viewTable[i-1] local tempA = viewTableA[i-1] viewTable[i-1]=v viewTableA[i-1]=viewTableA[i] viewTable[i]=temp viewTableA[i]=tempA break end end --atjaunot saites for i,v in pairs(viewTable) do v:link("aa#owner", profile) end for i,v in pairs(viewTableA) do v:link("profile", profileA) end lQuery("GraphDiagram:has(/graphDiagramType[id='OWL'])"):each(function(diagram) utilities.execute_cmd("SaveDgrCmd", {graphDiagram = diagram}) local extension = lQuery("Extension[id='" .. viewName .. "'][type='aa#View']") local l = 0 diagram:find("/activeExtension"):each(function(d) if d:id() == extension:id() then l = 1 end end) --ja noklusetais if viewA:attr("isDefault") == "true" then l = 1 end if l==1 then lQuery(diagram):find("/element:has(/elemType/elementStyleSetting)"):each(function(obj) owl_fields_specific.ElemStyleBySettings(obj, "ViewApply") end) local a = lQuery(diagram):find("/element/compartment:has(/compartType/compartmentStyleSetting)"):map(function(obj) return obj end) local b = lQuery(diagram):find("/element/compartment/subCompartment:has(/compartType/compartmentStyleSetting)"):map(function(obj) return obj end) local values = lQuery.merge(a, b) for i,v in pairs(values) do owl_fields_specific.CompartStyleBySetting(v, "ViewApply") end --atjaunojam tos elementus, kur bija compartmentu stila izmaina local elem = lQuery(diagram):find("/element:has(/compartment/compartType/compartmentStyleSetting)") elem:add(lQuery(diagram):find("/element:has(/compartment/subCompartment/compartType/compartmentStyleSetting)")) utilities.refresh_element(elem, diagram) local cmd = lQuery.create("OkCmd") cmd:link("graphDiagram", diagram) utilities.execute_cmd_obj(cmd) graph_diagram_style_utils.save_diagram_element_and_compartment_styles(diagram) end end) end end styleMechanism.deleteIsDeletedStyleSetting() refreshListBox() end end --noved skatijumu zemak function downView() --profils local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end if profileName~=nil then local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end local profile = lQuery("Extension[type='aa#Profile'][id='" .. profileName .. "']") local profileA = lQuery("AA#Profile[name='" .. profileName .. "']") --izveletais skatijums local selectedItem = lQuery("D#ListBox[id='ListWithViews']/selected") if selectedItem:is_not_empty() then local viewSize = string.find(selectedItem:attr("value"), " ") local viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end local view = profile:find("/aa#subExtension[type='aa#View'][id='" .. viewName .. "']") local viewA = profileA:find("/view[name='" .. viewName .. "']") --ja skatijums ir pirmais neko nedarit if profile:find("/aa#subExtension[type='aa#View']"):last():id()~=view:id() then --atrast visus skatijumus, kas pielikti dotajam profilam, ielikt tabulaa local viewTable = profile:find("/aa#subExtension[type='aa#View']"):map(function(obj) return obj end) local viewTableA = profileA:find("/view"):map(function(obj) return obj end) --nonemt saites no profila uz skatijumiem profile:remove_link("aa#subExtension", profile:find("/aa#subExtension[type='aa#View']")) profileA:remove_link("view", profileA:find("/view")) for i,v in pairs(viewTable) do --ja nakosais skatijums ir izveletais, tad mainit vietam if i~=#viewTable and v:id() == view:id() then local temp = viewTable[i+1] local tempA = viewTableA[i+1] viewTable[i+1]=v viewTableA[i+1]=viewTableA[i] viewTable[i]=temp viewTableA[i]=tempA break end end --atjaunot saites for i,v in pairs(viewTable) do v:link("aa#owner", profile) end for i,v in pairs(viewTableA) do v:link("profile", profileA) end lQuery("GraphDiagram:has(/graphDiagramType[id='OWL'])"):each(function(diagram) utilities.execute_cmd("SaveDgrCmd", {graphDiagram = diagram}) local extension = lQuery("Extension[id='" .. viewName .. "'][type='aa#View']") local l = 0 diagram:find("/activeExtension"):each(function(d) if d:id() == extension:id() then l = 1 end end) --ja noklusetais if viewA:attr("isDefault") == "true" then l = 1 end if l==1 then lQuery(diagram):find("/element:has(/elemType/elementStyleSetting)"):each(function(obj) owl_fields_specific.ElemStyleBySettings(obj, "ViewApply") end) local a = lQuery(diagram):find("/element/compartment:has(/compartType/compartmentStyleSetting)"):map(function(obj) return obj end) local b = lQuery(diagram):find("/element/compartment/subCompartment:has(/compartType/compartmentStyleSetting)"):map(function(obj) return obj end) local values = lQuery.merge(a, b) for i,v in pairs(values) do owl_fields_specific.CompartStyleBySetting(v, "ViewApply") end --atjaunojam tos elementus, kur bija compartmentu stila izmaina local elem = lQuery(diagram):find("/element:has(/compartment/compartType/compartmentStyleSetting)") elem:add(lQuery(diagram):find("/element:has(/compartment/subCompartment/compartType/compartmentStyleSetting)")) utilities.refresh_element(elem, diagram) local cmd = lQuery.create("OkCmd") cmd:link("graphDiagram", diagram) utilities.execute_cmd_obj(cmd) graph_diagram_style_utils.save_diagram_element_and_compartment_styles(diagram) end end) end end refreshListBox() end end --atver formu ar skatijuma konfiguraciju function View(viewName) --atrast vajadzigo skatijumu local view = lQuery("AA#View[name='" .. viewName .. "']") local close_button = lQuery.create("D#Button", { caption = "Close" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeView()") }) local picturePath if tda.isWeb then picturePath = tda.GetToolPath().. "/web-root/Pictures/" else picturePath = tda.GetProjectPath() .. "\\Pictures\\" end local form = lQuery.create("D#Form", { id = "viewProperty" ,caption = "View style setting" ,buttonClickOnClose = false ,cancelButton = close_button ,defaultButton = close_button ,eventHandler = utilities.d_handler("Close", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeView()") ,component = { lQuery.create("D#VerticalBox", { id = "TableViewStyleVerBox" ,minimumHeight = 250 ,component = { lQuery.create("D#Row", { horizontalAlignment = -1 ,component = { lQuery.create("D#Label", {caption = 'Apply by default (for new diagrams)'}) ,lQuery.create("D#CheckBox", { id = "setViewDefault" ,checked=getViewDefault(viewName) ,eventHandler = utilities.d_handler("Change", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setViewDefault()") }) } }) ,lQuery.create("D#Row", { id = "RowForPalette" ,horizontalAlignment = -1 ,component = { lQuery.create("D#Label", {caption = 'Show in toolbar'}) ,lQuery.create("D#CheckBox", { id = "setShowInToolBar" ,checked=getShowInToolBar(viewName) ,eventHandler = utilities.d_handler("Change", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setShowInToolBar()") }) ,lQuery.create("D#Label", {caption = 'Show in palette'}) ,lQuery.create("D#CheckBox", { id = "setShowInPalette" ,checked=getShowInPalette(viewName) ,eventHandler = utilities.d_handler("Change", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setShowInPalette()") }) ,lQuery.create("D#Label", {caption = 'Active icon'}) ,lQuery.create("D#ImageButton", { id = "activeIcon" ,fileName = picturePath .. view:attr("activeIcon") ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setActiveIcon()") }) ,lQuery.create("D#Label", {caption = 'Inactive icon'}) ,lQuery.create("D#ImageButton", { id = "inactiveIcon" ,fileName = picturePath .. view:attr("inActiveIcon") ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setInactiveIcon()") }) } }) ,lQuery.create("D#VTable", { id = "TableViewStyle" ,column = { lQuery.create("D#VTableColumnType", { caption = "ElementType",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "Path",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "CompartType",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "StyleItem",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "Value",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "ConditionCompartType",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "ConditionChoiceItem",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "AddMirror",editable = true,width = 100 }) ,lQuery.create("D#VTableColumnType", { caption = "Extra",editable = true,width = 100 }) } ,vTableRow = { styleMechanism.getViewStyle(view) } }) ,lQuery.create("D#HorizontalBox", { component={ lQuery.create("D#Button", { caption = "Create New Style" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.createNewStyle()") }) ,lQuery.create("D#Button", { caption = "Delete View Style" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.styleMechanism.deleteOneViewStyle()") }) }}) }}) ,lQuery.create("D#HorizontalBox", { id = "closeButton" ,horizontalAlignment = 1 ,component = {close_button}}) } }) dialog_utilities.show_form(form) end function setActiveIcon() local caption = "Select active icon" local filter = "Pictures(*.bmp)" local start_folder if tda.isWeb then start_folder = "$WEBAPPOS_ROOT/apps/OWLGrEd.webapp/web-root/Pictures/" else start_folder = tda.GetProjectPath() .. "\\Pictures\\" end start_file = "" save = false local path = tda.BrowseForFile(caption, filter, start_folder, start_file, save) if path ~= "" then local startS, endS if tda.isWeb then startS, endS = string.find(path, "/Pictures/") else startS, endS = string.find(path, "\\Pictures\\") end path = string.sub(path, endS+1) local selectedItem=lQuery("D#ListBox[id='ListWithViews']/selected") local viewName if selectedItem:attr("value") == nil then viewName = lQuery("D#InputField[id='InputFieldForNewView']"):attr("text") else local viewSize = string.find(selectedItem:attr("value"), " ") viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end end local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']"):attr("activeIcon", path) local view = lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']") refreshIconButton(view) end end function refreshIconButton(view) local picturePath if tda.isWeb then picturePath = tda.GetToolPath().. "/web-root/Pictures/" else picturePath = tda.GetProjectPath() .. "\\Pictures\\" end lQuery("D#Row[id='RowForPalette']/component"):delete() lQuery.create("D#Label", {caption = 'Show in palette'}):link("container", lQuery("D#Row[id='RowForPalette']")) lQuery.create("D#CheckBox", { id = "setShowInPalette" ,checked=getShowInPalette(view:attr("name")) ,eventHandler = utilities.d_handler("Change", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setShowInPalette()") }):link("container", lQuery("D#Row[id='RowForPalette']")) lQuery.create("D#Label", {caption = 'Active icon'}):link("container", lQuery("D#Row[id='RowForPalette']")) lQuery.create("D#ImageButton", { id = "activeIcon" ,fileName = picturePath .. view:attr("activeIcon") ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setActiveIcon()") }):link("container", lQuery("D#Row[id='RowForPalette']")) lQuery.create("D#Label", {caption = 'Inactive icon'}):link("container", lQuery("D#Row[id='RowForPalette']")) lQuery.create("D#ImageButton", { id = "inactiveIcon" ,fileName = picturePath .. view:attr("inActiveIcon") ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setInactiveIcon()") }):link("container", lQuery("D#Row[id='RowForPalette']")) lQuery("D#Form[id = 'viewProperty']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) end function setInactiveIcon() local caption = "Select inactive icon" local filter = "Pictures(*.bmp)" local start_folder if tda.isWeb then start_folder = "$WEBAPPOS_ROOT/apps/OWLGrEd.webapp/web-root/Pictures/" else start_folder = tda.GetProjectPath() .. "\\Pictures\\" end start_file = "" save = false local path = tda.BrowseForFile(caption, filter, start_folder, start_file, save) if path ~= "" then local startS, endS if tda.isWeb then startS, endS = string.find(path, "/Pictures/") else startS, endS = string.find(path, "\\Pictures\\") end path = string.sub(path, endS+1) local selectedItem=lQuery("D#ListBox[id='ListWithViews']/selected") local viewName if selectedItem:attr("value") == nil then viewName = lQuery("D#InputField[id='InputFieldForNewView']"):attr("text") else local viewSize = string.find(selectedItem:attr("value"), " ") viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end end local profileName = lQuery("D#ListBox[id='ListWithProfiles']/selected"):attr("value") if profileName==nil then profileName=lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") end local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']"):attr("inActiveIcon", path) local view = lQuery("AA#Profile[name='" .. profileName .. "']/view[name='" .. viewName .. "']") refreshIconButton(view) end end function createNewStyle() --pievieno tukso rindu lQuery.create("D#VTableRow", { vTableCell = { lQuery.create("D#VTableCell", { vTableColumnType = lQuery("D#VTableColumnType[caption = 'ElementType']") ,component = lQuery.create("D#ComboBox", { item = {styleMechanism.getElementType()} ,eventHandler = {utilities.d_handler("Change", "lua_engine", "lua.OWLGrEd_UserFields.styleMechanism.selectElementType()")} }) }) ,styleMechanism.createVTableTextBox("", "Path") ,styleMechanism.createVTableTextBox("", "CompartType") ,styleMechanism.createVTableTextBox("", "StyleItem") ,styleMechanism.createVTableTextBox("", "Value") ,styleMechanism.createVTableTextBox("", "ConditionCompartType") ,styleMechanism.createVTableTextBox("", "ConditionChoiceItem") ,styleMechanism.createVTableTextBox("", "AddMirror") ,styleMechanism.createVTableTextBox("", "Extra") } }):link("vTable", lQuery("D#VTable[id = 'TableViewStyle']")) lQuery("D#VTable[id = 'TableViewStyle']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) end function viewsForToolBar() if lQuery("AA#Profile[isDefaultForViews='true']"):is_empty() then askLoadDefaultProfile() else viewsInProfiles() end end function askLoadDefaultProfile() local close_button = lQuery.create("D#Button", { caption = "Close" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeAskLoadDefaultProfile()") }) local form = lQuery.create("D#Form", { id = "askLoadDefaultProfile" -- ,caption = "Views in profiles" ,buttonClickOnClose = false ,cancelButton = close_button ,defaultButton = ok_button ,eventHandler = utilities.d_handler("Close", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeAskLoadDefaultProfile()") ,component = { lQuery.create("D#VerticalBox", { id = "WouldYouLike" ,component = { lQuery.create("D#HorizontalBox", { component = { lQuery.create("D#Label", {caption = "Would you like to import profile with example view definitions?"}) } }) ,lQuery.create("D#HorizontalBox", { component = { lQuery.create("D#Button", {caption = "Yes" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.yesDefaultProfile()") }) ,lQuery.create("D#Button", {caption = "No" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.noDefaultProfile()") }) } }) } }) ,lQuery.create("D#HorizontalBox", { horizontalAlignment = 1 ,id = "closeForm" ,component = { lQuery.create("D#VerticalBox", { id = "closeButton" ,horizontalAlignment = 1 ,component = {close_button}}) } }) } }) dialog_utilities.show_form(form) end function anywhere (p) return lpeg.P{ p + 1 * lpeg.V(1) } end function yesDefaultProfile() caption = "Select text file" filter = "text file(*.txt)" local start_folder if tda.isWeb then start_folder = tda.FindPath(tda.GetToolPath() .. "/AllPlugins", "OWLGrEd_UserFields") else start_folder = tda.GetProjectPath() .. "\\Plugins\\OWLGrEd_UserFields" end start_file = "viewCollection.txt" save = false local path = tda.BrowseForFile(caption, filter, start_folder, start_file, save) if path ~= "" then f = assert(io.open(path, "r")) local t = f:read("*all") f:close() local Letter = lpeg.R("az") + lpeg.R("AZ") + lpeg.R("09") + lpeg.S("_/:#.<>='(){}?!@$%^&*-+|") local String = lpeg.C(Letter * (Letter) ^ 0) local profileName local pat = lpeg.P([["AA#Profile", ["properties"] = { ["name"] = "]]) local p = pat * String * '"' p = anywhere (p) profileName = lpeg.match(p, t) or "" local fieldPattern = lpeg.P("AA#Field") fieldPattern = anywhere (fieldPattern) if profileName == "" then showError("Selected file does not contains any profile definition. Please select another file") elseif lpeg.match(fieldPattern, t) then showError("Selected profile file contains field definition. Please select another file") elseif lQuery("Extension[id='" .. profileName .. "'][type='aa#Profile']"):is_empty() then serialize.import_from_file(path) --izveidojam profilu if profileName == "" then lQuery("AA#Profile"):each(function(obj) if lQuery("Extension[id='" .. obj:attr("name") .. "'][type='aa#Profile']"):is_empty() then profileName = obj:attr("name") end end) end local ext = lQuery.create("Extension", {id = profileName, type = "aa#Profile"})--:link("aa#owner", lQuery("Extension[id = 'OWL_Fields']")) lQuery("Extension[id = 'OWL_Fields']"):link("aa#subExtension", ext) --izveidojam profila skatijumus lQuery("AA#Profile[name='" .. profileName .. "']/view"):each(function(obj) lQuery.create("Extension", {id = obj:attr("name"), type = "aa#View"}):link("aa#owner", ext) :link("aa#graphDiagram", lQuery("GraphDiagram:has(/graphDiagramType[id='OWL'])")) end) lQuery("AA#Profile[name='" .. profileName .. "']"):attr("isDefaultForViews", true) --saglabajam izmainas lQuery("GraphDiagram:has(/graphDiagramType[id='OWL'])"):each(function(diagram) utilities.execute_cmd("SaveDgrCmd", {graphDiagram = diagram}) end) --sinhronizejam profilu syncProfile.syncProfile(profileName) --sinhronizejam skatijumus styleMechanism.syncExtensionViews() closeAskLoadDefaultProfile() --atvert formu viewsInProfiles(profileName) else showError("Import was canceled. Profile with this name already exists") end else --print("Import was canceled") end end function showError(massage) local close_button = lQuery.create("D#Button", { caption = "Close" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeAskLoadDefaultProfile()") }) lQuery("D#VerticalBox[id='WouldYouLike']"):delete() lQuery.create("D#VerticalBox", { id = "WouldYouLike" ,component = { lQuery.create("D#Label", {caption = massage}) } }):link("container", lQuery("D#Form[id = 'askLoadDefaultProfile']")) lQuery("D#HorizontalBox[id='closeForm']"):delete() lQuery.create("D#HorizontalBox", { horizontalAlignment = 1 ,id = "closeForm" ,component = { lQuery.create("D#VerticalBox", { id = "closeButton" ,horizontalAlignment = 1 ,component = {close_button}}) } }):link("container", lQuery("D#Form[id = 'askLoadDefaultProfile']")) lQuery("D#Form[id = 'askLoadDefaultProfile']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) end function noDefaultProfile() local close_button = lQuery.create("D#Button", { caption = "Close" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeAskLoadDefaultProfile()") }) lQuery("D#VerticalBox[id='WouldYouLike']"):delete() lQuery.create("D#VerticalBox", { id = "WouldYouLike" ,component = { lQuery.create("D#Label", {caption = "Please go to profile dialogue 'P' to set up a default profile for views"}) } }):link("container", lQuery("D#Form[id = 'askLoadDefaultProfile']")) lQuery("D#HorizontalBox[id='closeForm']"):delete() lQuery.create("D#HorizontalBox", { horizontalAlignment = 1 ,id = "closeForm" ,component = { lQuery.create("D#VerticalBox", { id = "closeButton" ,horizontalAlignment = 1 ,component = {close_button}}) } }):link("container", lQuery("D#Form[id = 'askLoadDefaultProfile']")) lQuery("D#Form[id = 'askLoadDefaultProfile']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) end --atlasa skatijumus, kas ir pieejami profilos function viewsInProfiles(profileName) local text = "" if profileName~=nil then text = profileName .. " (Default for views)" end local close_button = lQuery.create("D#Button", { caption = "Close" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeViewsInProfiles()") }) local path if tda.isWeb then path = tda.FindPath(tda.GetToolPath() .. "/AllPlugins", "OWLGrEd_UserFields") .."/" else path = tda.GetProjectPath() .. "\\Plugins\\OWLGrEd_UserFields\\" end local form = lQuery.create("D#Form", { id = "ViewsInProfiles" ,caption = "Views in profiles" ,buttonClickOnClose = false ,cancelButton = close_button ,defaultButton = ok_button ,eventHandler = utilities.d_handler("Close", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.closeViewsInProfiles()") ,component = { lQuery.create("D#HorizontalBox", { id = "HorForm" ,minimumWidth = 350 ,minimumHeight = 250 ,component = { lQuery.create("D#HorizontalBox", { id = "HorizontalBoxWithViewsInDiagram" ,component = { lQuery.create("D#VerticalBox",{ id = "VerticalBoxWithListBoxView" ,component = { lQuery.create("D#ComboBox", { id = "ListWithProfilesForViews" ,text = text ,item = profileMechanism.collectProfiles() ,eventHandler = utilities.d_handler("Change", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.selectView()") }) ,lQuery.create("D#ListBox", { id = "ListWithViews" ,item = collectViews(profileName) }) } }) ,lQuery.create("D#VerticalBox",{ component = { lQuery.create("D#ImageButton",{ fileName = path .. "up.bmp" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.upView()") }) ,lQuery.create("D#ImageButton",{ fileName = path .. "down.bmp" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.downView()") }) } }) ,lQuery.create("D#VerticalBox",{ component = { lQuery.create("D#Button",{ caption = "Style setting" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.openViewProperties()") }) ,lQuery.create("D#Button",{ caption = "Default" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.setDefault()") }) ,lQuery.create("D#Button",{ caption = "New view" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.newViewInProfile()") }) ,lQuery.create("D#Button",{ caption = "Delete view" ,eventHandler = utilities.d_handler("Click", "lua_engine", "lua.OWLGrEd_UserFields.viewMechanism.deleteView()") }) } }) } }) } }) ,lQuery.create("D#HorizontalBox", { horizontalAlignment = 1 ,id = "closeForm" ,component = { lQuery.create("D#VerticalBox", { id = "closeButton" ,horizontalAlignment = 1 ,component = {close_button}}) } }) } }) dialog_utilities.show_form(form) end --atlasa skatijumus, kas ir piesaistiti izveletajam profilam function selectView() local profileName = lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):attr("value") local viewSize = string.find(profileName, " ") if viewSize~=nil then profileName = string.sub(profileName, 1, viewSize-1) end lQuery("D#ListBox[id='ListWithViews']"):delete() lQuery.create("D#ListBox", { id = "ListWithViews" ,item = collectViews(profileName) }):link("container", lQuery("D#VerticalBox[id='VerticalBoxWithListBoxView']")) lQuery("D#VerticalBox[id='VerticalBoxWithListBoxView']"):link("command", utilities.enqued_cmd("D#Command", {info = "Refresh"})) end --veido jauno skatijumu tikai ja ir izvelets profils function newViewInProfile() if lQuery("D#ComboBox[id='ListWithProfilesForViews']/selected"):is_not_empty() then newView() end end function close() lQuery("D#Event"):delete() utilities.close_form("viewsInProfile") end function closeNewViewForm() lQuery("D#Event"):delete() utilities.close_form("newView") end function closeViewsInProfiles() lQuery("D#Event"):delete() utilities.close_form("ViewsInProfiles") end function closeAskLoadDefaultProfile() lQuery("D#Event"):delete() utilities.close_form("askLoadDefaultProfile") end function closeView() --print(os.date("%m_%d_%Y_%H_%M_%S")) local selectedItem = lQuery("D#ListBox[id='ListWithViews']/selected") local viewName if selectedItem:attr("value") == nil then viewName = lQuery("D#InputField[id='InputFieldForNewView']"):attr("text") else local viewSize = string.find(selectedItem:attr("value"), " ") viewName = selectedItem:attr("value") if viewSize~=nil then viewName = string.sub(viewName, 1, viewSize-1) end end lQuery("D#Event"):delete() utilities.close_form("viewProperty") local view = lQuery("AA#View[name='" .. viewName .. "']") local extension = lQuery("Extension[id='" .. viewName .. "'][type='aa#View']") local changeElemStyle = styleMechanism.syncViewStyleSettingElement(view, extension) local changeCompartStyle = styleMechanism.syncViewStyleSettingCompartment(view, extension) lQuery("GraphDiagram:has(/graphDiagramType[id='OWL'])"):each(function(diagram) utilities.execute_cmd("SaveDgrCmd", {graphDiagram = diagram}) local l = 0 diagram:find("/activeExtension"):each(function(d) if d:id() == extension:id() then l = 1 end end) --ja noklusetais if view:attr("isDefault") == "true" then l = 1 end if l==1 then if changeElemStyle > 0 then lQuery(diagram):find("/element:has(/elemType/elementStyleSetting)"):each(function(obj) owl_fields_specific.ElemStyleBySettings(obj, "Change") end) end if changeCompartStyle > 0 then local a = lQuery(diagram):find("/element/compartment:has(/compartType/compartmentStyleSetting)"):map(function(obj) return obj end) local b = lQuery(diagram):find("/element/compartment/subCompartment:has(/compartType/compartmentStyleSetting)"):map(function(obj) return obj end) local values = lQuery.merge(a, b) for i,v in pairs(values) do owl_fields_specific.CompartStyleBySetting(v, "Change") end end if changeCompartStyle > 0 or changeElemStyle > 0 then --atjaunojam tos elementus, kur bija compartmentu stila izmaina local elem = lQuery(diagram):find("/element:has(/compartment/compartType/compartmentStyleSetting)") elem:add(lQuery(diagram):find("/element:has(/compartment/subCompartment/compartType/compartmentStyleSetting)")) utilities.refresh_element(elem, diagram) local cmd = lQuery.create("OkCmd") cmd:link("graphDiagram", diagram) utilities.execute_cmd_obj(cmd) graph_diagram_style_utils.save_diagram_element_and_compartment_styles(diagram) end end end) styleMechanism.deleteIsDeletedStyleSetting() refreshListBox() --print(os.date("%m_%d_%Y_%H_%M_%S")) end
hmis-interop/logical-model
src/class-diagram-files/Plugins/OWLGrEd_UserFields/viewMechanism.lua
Lua
cc0-1.0
56,338
jsonp({"cep":"96200520","logradouro":"Rua Capit\u00e3o Andrino","bairro":"Centro","cidade":"Rio Grande","uf":"RS","estado":"Rio Grande do Sul"});
lfreneda/cepdb
api/v1/96200520.jsonp.js
JavaScript
cc0-1.0
146
jsonp({"cep":"13216200","logradouro":"Rua Jos\u00e9 Belesso","bairro":"Vila Caod\u00e1glio","cidade":"Jundia\u00ed","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/13216200.jsonp.js
JavaScript
cc0-1.0
155
jsonp({"cep":"12245908","logradouro":"Rua Inconfid\u00eancia","bairro":"Jardim S\u00e3o Dimas","cidade":"S\u00e3o Jos\u00e9 dos Campos","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/12245908.jsonp.js
JavaScript
cc0-1.0
175
jsonp({"cep":"09510102","logradouro":"Rua Manoel Coelho","bairro":"Santo Ant\u00f4nio","cidade":"S\u00e3o Caetano do Sul","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/09510102.jsonp.js
JavaScript
cc0-1.0
161
#include<iostream> #include<string> #include<cctype> using std::string; using std::cin; using std::cout; using std::endl; int main(void) { string s("It's a string"); for (auto &c : s) { c = 'x'; } cout << s << endl; return 0; }
akanezorap/CppPrimer
ch03/ex3_06.cpp
C++
cc0-1.0
237
'use strict' /* eslint-env browser, webextensions */ // check if URL includes autoplay token if (decodeURIComponent(window.location.href).includes('autoplay=true')) { console.log('[Google Music Hotkeys] Autoplay token detected') const autoplay = setInterval(async () => { const playbutton = document.getElementById('player-bar-play-pause') // press button only if there is no playback if (playbutton && playbutton.title === 'Play') { clearInterval(autoplay) await browser.runtime.sendMessage({ command: 'toggle-playback' }) console.log('[Google Music Hotkeys] Toggled playback') } }, 1000) }
lidel/google-music-hotkeys
add-on/autoplay.js
JavaScript
cc0-1.0
634
jsonp({"cep":"13254715","logradouro":"Rua Daniel Aparecido Moreira","bairro":"Loteamento Parque da Colina II","cidade":"Itatiba","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/13254715.jsonp.js
JavaScript
cc0-1.0
168
jsonp({"cep":"12301170","logradouro":"Rua \u00c1lvaro de Barros Lins","bairro":"Loteamento Villa Branca","cidade":"Jacare\u00ed","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/12301170.jsonp.js
JavaScript
cc0-1.0
168
jsonp({"cep":"85070165","logradouro":"Rua Afonso Botelho","bairro":"Santana","cidade":"Guarapuava","uf":"PR","estado":"Paran\u00e1"});
lfreneda/cepdb
api/v1/85070165.jsonp.js
JavaScript
cc0-1.0
135
package es.thesinsprods.zagastales.juegozagas.creadornpcs; import java.awt.Color; import java.awt.EventQueue; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.border.BevelBorder; import es.thesinsprods.resources.font.MorpheusFont; public class InfoAcc3NPC { private JFrame frame; public JFrame getFrame() { return frame; } public void setFrame(JFrame frame) { this.frame = frame; } private final JPanel contentPanel = new JPanel(); private JTextField txtDescripcin; private JTextField txtTipoDeAccesorio; private JTextField textField; MorpheusFont mf = new MorpheusFont(); private JTextField txtposesin; private JTextField textField_4; private JLabel label; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { InfoAcc3NPC window = new InfoAcc3NPC(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public InfoAcc3NPC() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.setIconImage(Toolkit.getDefaultToolkit().getImage( ArmasNPC.class .getResource("/images/Historias de Zagas, logo.png"))); frame.setTitle("Historias de Zagas"); frame.setBounds(100, 100, 380, 301); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); frame.setResizable(false); frame.getContentPane().setLayout(null); txtDescripcin = new JTextField(); txtDescripcin.setOpaque(false); txtDescripcin.setForeground(Color.WHITE); txtDescripcin.setBackground(new Color(205, 133, 63)); txtDescripcin.setText("Descripci\u00F3n:"); txtDescripcin.setFont(mf.MyFont(0, 13)); txtDescripcin.setEditable(false); txtDescripcin.setColumns(10); txtDescripcin.setBorder(null); txtDescripcin.setBounds(135, 20, 90, 20); frame.getContentPane().add(txtDescripcin); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(135, 51, 221, 99); frame.getContentPane().add(scrollPane); JTextArea textArea = new JTextArea(); textArea.setBackground(Color.WHITE); textArea.setForeground(new Color(0, 0, 0)); textArea.setFont(mf.MyFont(0, 13)); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); textArea.setEditable(false); scrollPane.setViewportView(textArea); JScrollPane scrollPane_1 = new JScrollPane(); scrollPane_1.setBounds(135, 153, 221, 99); frame.getContentPane().add(scrollPane_1); JTextArea textArea_1 = new JTextArea(); textArea_1.setBackground(Color.WHITE); textArea_1.setForeground(new Color(0, 0, 0)); textArea_1.setWrapStyleWord(true); textArea_1.setText(""); textArea_1.setLineWrap(true); textArea_1.setFont(mf.MyFont(0, 13)); textArea_1.setEditable(false); scrollPane_1.setViewportView(textArea_1); if (EquipoNPC.accesories3.isPosesion() == true || EquipoNPC.accesories3.isLegendaria() == true) { ArrayList<String> pos = EquipoNPC.accesories3.getPossesion() .getPos(); for (int i = 0; i < pos.size(); i++) { if (pos.get(i) != ("-Propiedad-")) { textArea_1.append(pos.get(i) + "\n"); } } } txtTipoDeAccesorio = new JTextField(); txtTipoDeAccesorio.setOpaque(false); txtTipoDeAccesorio.setForeground(Color.WHITE); txtTipoDeAccesorio.setBackground(new Color(205, 133, 63)); txtTipoDeAccesorio.setText("Tipo de Accesorio:"); txtTipoDeAccesorio.setFont(mf.MyFont(0, 13)); txtTipoDeAccesorio.setEditable(false); txtTipoDeAccesorio.setColumns(10); txtTipoDeAccesorio.setBorder(null); txtTipoDeAccesorio.setBounds(10, 20, 115, 20); frame.getContentPane().add(txtTipoDeAccesorio); textField = new JTextField(); textField.setForeground(new Color(0, 0, 0)); textField.setBackground(Color.WHITE); textField.setEditable(false); textField.setFont(mf.MyFont(0, 11)); textField.setColumns(10); textField.setBounds(10, 51, 115, 20); frame.getContentPane().add(textField); final JButton btnVolver = new JButton(""); btnVolver.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { btnVolver.setIcon(new ImageIcon(InfoAcc3NPC.class .getResource("/images/boton atras2.png"))); } public void mouseReleased(MouseEvent e) { btnVolver.setIcon(new ImageIcon(InfoAcc3NPC.class .getResource("/images/boton atras.png"))); } }); btnVolver.setIcon(new ImageIcon(InfoAcc3NPC.class .getResource("/images/boton atras.png"))); btnVolver.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null)); btnVolver.setForeground(new Color(255, 255, 255)); btnVolver.setBackground(new Color(139, 69, 19)); btnVolver.setBorderPainted(false); btnVolver.setContentAreaFilled(false); btnVolver.setFocusPainted(false); btnVolver.setOpaque(false); btnVolver.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { frame.dispose(); } }); btnVolver.setFont(mf.MyFont(0, 15)); btnVolver.setBounds(10, 206, 99, 45); frame.getContentPane().add(btnVolver); if (EquipoNPC.accesories3.getClass().getSimpleName().equals("Cloak")) { textField.setText("Capa"); } if (EquipoNPC.accesories3.getClass().getSimpleName().equals("Earrings")) { textField.setText("Pendientes"); } if (EquipoNPC.accesories3.getClass().getSimpleName().equals("Necklace")) { textField.setText("Colgante"); } if (EquipoNPC.accesories3.getClass().getSimpleName().equals("Rings")) { textField.setText("Anillos"); } textArea.setText(EquipoNPC.accesories3.getDescription()); txtposesin = new JTextField(); txtposesin.setOpaque(false); txtposesin.setForeground(Color.WHITE); txtposesin.setBackground(new Color(205, 133, 63)); txtposesin.setText("\u00BFPosesi\u00F3n?"); txtposesin.setFont(mf.MyFont(0, 13)); txtposesin.setEditable(false); txtposesin.setColumns(10); txtposesin.setBorder(null); txtposesin.setBounds(10, 82, 90, 20); frame.getContentPane().add(txtposesin); textField_4 = new JTextField(); textField_4.setForeground(new Color(0, 0, 0)); textField_4.setBackground(Color.WHITE); textField_4.setFont(mf.MyFont(0, 11)); if (EquipoNPC.accesories3.isPosesion() == true) { textField_4.setText("Posesión"); } if (EquipoNPC.accesories3.isPosesion() == false) { textField_4.setText("Normal"); } if (EquipoNPC.accesories3.isLegendaria() == true) { textField_4.setText("Legendario"); } textField_4.setEditable(false); textField_4.setColumns(10); textField_4.setBounds(10, 113, 115, 20); frame.getContentPane().add(textField_4); label = new JLabel(""); label.setIcon(new ImageIcon(InfoAcc3NPC.class .getResource("/images/background-infos.jpg"))); label.setBounds(0, 0, 374, 273); frame.getContentPane().add(label); } }
ZagasTales/HistoriasdeZagas
src Graf/es/thesinsprods/zagastales/juegozagas/creadornpcs/InfoAcc3NPC.java
Java
cc0-1.0
7,548
jsonp({"cep":"40713125","logradouro":"Travessa Ant\u00f4nio Hungar","bairro":"Itacaranha","cidade":"Salvador","uf":"BA","estado":"Bahia"});
lfreneda/cepdb
api/v1/40713125.jsonp.js
JavaScript
cc0-1.0
140
jsonp({"cep":"18201561","logradouro":"Travessa Pl\u00ednio Salgado","bairro":"Vila Monteiro","cidade":"Itapetininga","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/18201561.jsonp.js
JavaScript
cc0-1.0
156
jsonp({"cep":"75903510","logradouro":"Rua 20","bairro":"Popular","cidade":"Rio Verde","uf":"GO","estado":"Goi\u00e1s"});
lfreneda/cepdb
api/v1/75903510.jsonp.js
JavaScript
cc0-1.0
121
# Professional Single Page Website ## Tech JQuery, JavaScript, HTML, CSS ## Created By Koly Sengupta ## Contains Recent professional and personal Web Development projects. <!-- ## Open Source Template Theme Wagon ## Reference http://www.themewagon.com -->
kolysg/kolysg.github.io
README.md
Markdown
cc0-1.0
267
body{ background-color: #ECE5DD; color: #333; font-family: Ubuntu; overflow: hidden; } .display img{ display: none; } .div_input{ padding: 0px; z-index: 2; position: fixed; top: 6; left: 0; width: 100%; padding-right: : 120px; height: auto; background-color: #ECE5DD; border-bottom: 1px solid #ccc; -webkit-box-shadow: 0px 4px 10px rgba(50, 50, 50, 0.20); -moz-box-shadow: 0px 4px 10px rgba(50, 50, 50, 0.20); box-shadow: 0px 4px 10px rgba(50, 50, 50, 0.20); } .div_input input{ font-size:22px; font-family: Ubuntu; position: relative; left: 0px; width: 100%; height: 48px; text-align: center; padding:6px 6px; margin: 0px; border: 0; background-color: #ECE5DD; border-bottom:0px solid #ccc; color:#555; border-radius:0; transition:border-color .25s ease, box-shadow .25s ease; } .div_input input:focus{ border-bottom: 1px solid #ccc; -webkit-box-shadow: 0px 4px 12px rgba(50, 50, 50, 0.20); -moz-box-shadow: 0px 4px 12px rgba(50, 50, 50, 0.20); box-shadow: 0px 4px 12px rgba(50, 50, 50, 0.20); outline: 0; } hr{ border-style: dashed; border-color: #AAA; height: 0px; } a{ text-decoration: none; color: #128C7E; } ol{ padding: 20px; padding-left: 60px padding-right: : 60px; margin-left: 40px; margin-right: 40px; border-left: 3px solid #e69138; margin-bottom: 46px; } ol li{ padding: 10px; border: 1px dashed #AAA; margin: 10px; padding-left: 30px; padding-right: 30px; font-size: 18px; cursor: default; color: #333; display: inline-block; list-style-type: none; } h1{ color: #e69138; } .pos{ margin-top: 40px; font-size: 32px; text-decoration: italic; text-align: left; margin-left: 40px; margin-right: 40px; opacity: 0.4; -webkit-user-select: none; } #pageTitle{ margin-left: 20px; margin-top: 26px; font-size: 38px; } .suggestions{ color: #999; width: auto; height: auto; text-transform: lowercase; overflow-x: hidden; margin: 20px; padding:20px; display: none; } .suggestion{ color: #777; height: auto; display: inline-block; text-transform: lowercase; overflow-x: hidden; margin: 10px; padding: 14px ; font-size: 16px; border: 1px dashed #AAA; cursor: default; transition: background 1.0s ease, color 0.2s ease; } .suggestion:hover{ color: #fff; background: #e69138; border: 1px solid #e69138; cursor: pointer; } .display{ overflow-y: scroll; overflow-x: hidden; box-sizing: border-box; /*required for scrollbar along with height*/ height: 100%; } .div_wiki{ position: absolute; z-index: 1; top: 30px; width: 100%; left: 0; } ::selection{ background: #555; color: #eee; } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.0); background-color: rgba(0,0,0,0); } ::-webkit-scrollbar { width: 6px; background-color: rgba(0,0,0,0); } ::-webkit-scrollbar-thumb { background-color: #e69138; background-image: -webkit-gradient(linear, 0 0, 0 100%), color-stop(.5, rgba(255, 255, 255, 0)), color-stop(.5, transparent), to(transparent)); } #pagetitle{ -webkit-user-select: none; } .footmark{ font-size: 10px; color: #aaa; position: absolute; bottom: 10px; left: 42%; opacity: 0.8; z-index: 4; -webkit-user-select: none; } .intro_img{ position: absolute; float: left; height: 40%; width: auto; opacity: 0.04; top: 50%; left: 50%; transform: translate(-50%, -50%); -webkit-user-select: none; }
piyushagade/Psyc
widgets/dictionary/dictionary.css
CSS
cc0-1.0
3,437
jsonp({"cep":"93226290","logradouro":"Rua Cristiano Otoni","bairro":"Nova Sapucaia","cidade":"Sapucaia do Sul","uf":"RS","estado":"Rio Grande do Sul"});
lfreneda/cepdb
api/v1/93226290.jsonp.js
JavaScript
cc0-1.0
153
jsonp({"cep":"02670020","logradouro":"Rua Diogo Bernardes","bairro":"Vila Dionisia","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/02670020.jsonp.js
JavaScript
cc0-1.0
149
jsonp({"cep":"70335900","logradouro":"Setor SMHS","bairro":"Asa Sul","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
lfreneda/cepdb
api/v1/70335900.jsonp.js
JavaScript
cc0-1.0
135
jsonp({"cep":"96060186","logradouro":"Passeio Um","bairro":"Tr\u00eas Vendas","cidade":"Pelotas","uf":"RS","estado":"Rio Grande do Sul"});
lfreneda/cepdb
api/v1/96060186.jsonp.js
JavaScript
cc0-1.0
139
jsonp({"cep":"60541220","logradouro":"Vila Sousa Carvalho","bairro":"Granja Portugal","cidade":"Fortaleza","uf":"CE","estado":"Cear\u00e1"});
lfreneda/cepdb
api/v1/60541220.jsonp.js
JavaScript
cc0-1.0
142
jsonp({"cep":"68505050","logradouro":"Quadra Tr\u00eas","bairro":"Nova Marab\u00e1","cidade":"Marab\u00e1","uf":"PA","estado":"Par\u00e1"});
lfreneda/cepdb
api/v1/68505050.jsonp.js
JavaScript
cc0-1.0
141
jsonp({"cep":"29211140","logradouro":"Rua Manten\u00f3polis","bairro":"Bela Vista","cidade":"Guarapari","uf":"ES","estado":"Esp\u00edrito Santo"});
lfreneda/cepdb
api/v1/29211140.jsonp.js
JavaScript
cc0-1.0
148
jsonp({"cep":"14801279","logradouro":"Pra\u00e7a Newton Prado","bairro":"Centro","cidade":"Araraquara","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/14801279.jsonp.js
JavaScript
cc0-1.0
142
jsonp({"cep":"87450000","cidade":"Tuneiras do Oeste","uf":"PR","estado":"Paran\u00e1"});
lfreneda/cepdb
api/v1/87450000.jsonp.js
JavaScript
cc0-1.0
89
jsonp({"cep":"27265100","logradouro":"Avenida Madri","bairro":"Jardim Europa","cidade":"Volta Redonda","uf":"RJ","estado":"Rio de Janeiro"});
lfreneda/cepdb
api/v1/27265100.jsonp.js
JavaScript
cc0-1.0
142
jsonp({"cep":"18085610","logradouro":"Rua Maria Terci","bairro":"Jardim Morumbi","cidade":"Sorocaba","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/18085610.jsonp.js
JavaScript
cc0-1.0
140
# Tehnici de Compilare - Georgescu Geanina ## Examen ### 2021 - Seria 33 & 34: [varianta 2](https://drive.google.com/file/d/1QUltwqORD_KRlS-tG1xubXLYsEVmIYwg/view?usp=sharing) ### 2018 #### Seria 34 - [Subiect](https://www.dropbox.com/s/27xbqi1chyp5ao1/subiect_tc.png?dl=0) #### Seria 33 1. Construiti un automat translator cu stiva, care sa primeasca un w <- {0, 1, 2, 3, 4, 5, 6, 7}\*, unde w nu incepe cu 0. Acest w este un numar scris in baza 8. Automatul trebuie sa afiseze zz^R, unde z <- {0, 1}\* este conversia lui w in baza 2, iar z^R este z reversed. 2. Fie gramatica G: S -> aAbS S -> b A -> aA A -> aBb B -> \lambda Aratati ca G este LL(2) tare, si parsati sirul "abbba" prin parserul LL(2). 3. Verificati daca gramatica G de la punctul 2) este SLR(1). ### Older - subiect din [2016](https://www.dropbox.com/s/wsgtk9lprj4qnye/subiect_examen_2016.jpg?dl=0) grupa - subiecte din [2009](http://fmi.is-a-geek.net/index.php/Tehnici_de_compilare_(Georgescu_Gianina)) ## Materiale - [Stanford CS143](https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/): un curs de la Stanford pe aceeasi tema, unde totul este explicat excelent. Recomandat de Eric! - [seminarii 2018](https://www.dropbox.com/s/3kvbx9iaqgdcuho/Seminar%20tc-20180517T173353Z-001.zip?dl=0) - [pregatire de examen 2016](https://www.dropbox.com/s/w5gjsywdz7vqpsu/pregatire_examen.zip?dl=0) via Vlasceanu Silviu - [seminarii 2016](https://www.dropbox.com/sh/no15qka1oqnmzmz/AACDWzCIyM0KQqnqW7Fh10Xca?dl=0) via Karina Nazare - [cursuri 2016](https://www.dropbox.com/sh/5v941i2r6ils2cm/AAAhabJDdUSNvN9q7K1d-Q-Ka?dl=0) via Karina Nazare
palcu/fmi
tc.md
Markdown
cc0-1.0
1,629
jsonp({"cep":"24430020","logradouro":"Rua Ant\u00f4nio Costa","bairro":"Porto Velho","cidade":"S\u00e3o Gon\u00e7alo","uf":"RJ","estado":"Rio de Janeiro"});
lfreneda/cepdb
api/v1/24430020.jsonp.js
JavaScript
cc0-1.0
157
jsonp({"cep":"32657418","logradouro":"Rua S\u00e3o Camilo de Lelis","bairro":"Bandeirinhas","cidade":"Betim","uf":"MG","estado":"Minas Gerais"});
lfreneda/cepdb
api/v1/32657418.jsonp.js
JavaScript
cc0-1.0
146
jsonp({"cep":"89214701","logradouro":"Rua Jativoca","bairro":"Nova Bras\u00edlia","cidade":"Joinville","uf":"SC","estado":"Santa Catarina"});
lfreneda/cepdb
api/v1/89214701.jsonp.js
JavaScript
cc0-1.0
142
package org.usfirst.frc.team1977.robot.commands.drive; import org.usfirst.frc.team1977.robot.commands.CommandBase; /** * A simple, non-actuator related command to be mapped to a controller button. * Toggles the speed coefficient for the drive subsystem between high and low * values. * * @author Loveland High Robotics 1977 * @author Evan Stewart */ public class SpeedToggle extends CommandBase { public SpeedToggle() { requires(drive); } // Called just before this Command runs the first time protected void initialize() { drive.setSpeedToggle(!drive.isSpeedToggle()); } // Called repeatedly when this Command is scheduled to run protected void execute() { //Do nothing } // Make this return true when this Command no longer needs to run execute() protected boolean isFinished() { return true; } // Called once after isFinished returns true protected void end() { } // Called when another command which requires one or more of the same // subsystems is scheduled to run protected void interrupted() { } }
LovelandHighRobotics1977/FRC2015
FRC2015/src/org/usfirst/frc/team1977/robot/commands/drive/SpeedToggle.java
Java
cc0-1.0
1,048
jsonp({"cep":"13052113","logradouro":"Rua St\u00e9fano Pavan","bairro":"Jardim Morumbi","cidade":"Campinas","uf":"SP","estado":"S\u00e3o Paulo"});
lfreneda/cepdb
api/v1/13052113.jsonp.js
JavaScript
cc0-1.0
147
using System; using System.Collections.Generic; using System.Reflection; using MSTD; using MSTD.ShBase; namespace CFL_1.CFL_System.MSTD.ShBase { public enum RelationKind { ISMEMBEROF, ISINLIST, HASMEMBER, HASINLIST } public struct BaseRelation { public BaseRelation(Type type, RelationKind kind, Type relationWith) { Type = type; Kind = kind; RelationWith = relationWith; } /// <summary> /// Le type de la class qui déclare cette relation. /// </summary> public Type Type { get; set; } public RelationKind Kind { get; set; } public Type RelationWith { get; set; } } /// <summary> /// <see cref="BaseRelations"/> définit les relations entre un type /// dérivées de <see cref="Base"/> et d'autres types dérivés de <see cref="Base"/>. /// </summary> public class BaseRelations { /// <summary> /// Le type de la classe qui déclare ces relations. /// </summary> public Type Type { get; set; } /// <summary> /// type est le type de la classe qui déclare les relations /// avec les autres types connus par le <see cref="ShContext"/> context. /// </summary> public BaseRelations(Type type) { Type = type; } /// <summary> /// Trouve ou ajoute une liste de <see cref="BaseRelation"/> pour le type /// <see cref="BaseRelation.RelationWith"/> et lui ajoute la relation. /// </summary> public void AddRelation(BaseRelation relation) { List<BaseRelation> _relations = null; if(!__relations.TryGetValue(relation.RelationWith, out _relations)) { _relations = new List<BaseRelation>(); __relations[relation.RelationWith] = _relations; } _relations.Add(relation); } private Dictionary<Type, List<BaseRelation>> __relations = new Dictionary<Type, List<BaseRelation>>(); } /// <summary> /// <see cref="ContextRelations"/> identifie toutes les relations /// entre tous les types connus d'un <see cref="ShContext"/>. /// </summary> public class ContextRelations { /// <summary> /// Se construit en identifiant toutes les relations entre tous les types /// représentés dans le <see cref="ShContext"/> context. /// </summary> public ContextRelations(ShContext context) { Init(context); } /// <summary> /// Trouve ou ajoute la <see cref="BaseRelations"/> pour le Type type /// et lui ajoute la <see cref="BaseRelation"/> relation. /// </summary> public void AddRelation(Type type, BaseRelation relation) { BaseRelations _relations = null; if(!__relations.TryGetValue(type, out _relations)) { _relations = new BaseRelations(type); __relations[type] = _relations; } _relations.AddRelation(relation); } private void Init(ShContext context) { int _i = 1; foreach(Set _set in context.GetSets()) { if(_i < context.SetsCount) { foreach(Set _other in context.GetSets(_i++)) { FindRelationsFromT1ToT2(_set.Type, _other.Type); FindRelationsFromT1ToT2(_other.Type, _set.Type); } } } } private void FindRelationsFromT1ToT2(Type t1, Type t2) { foreach(PropertyInfo _prInfo in t1.GetProperties()) { if(PropertyHelper.IsMappableProperty(_prInfo)) { if(_prInfo.PropertyType == t2) { AddRelation(t1, new BaseRelation(t1, RelationKind.HASMEMBER, t2)); AddRelation(t2, new BaseRelation(t2, RelationKind.ISMEMBEROF, t1)); } else { if(TypeHelper.IsListOf(_prInfo.PropertyType, t2)) { AddRelation(t1, new BaseRelation(t1, RelationKind.HASINLIST, t2)); AddRelation(t2, new BaseRelation(t2, RelationKind.ISINLIST, t1)); } } } } } private Dictionary<Type, BaseRelations> __relations = new Dictionary<Type, BaseRelations>(); } }
CFLShine/CFL
CFLServerData/CFL_System/MSTD/ShBase/BaseRelations.cs
C#
cc0-1.0
4,744
// Filename: WaveFileReader.ava // Reference: http://www.cnblogs.com/liyiwen/archive/2010/04/19/1715715.html // Creator: RobinTang // Time: 2012-09-02 package com.sin.java.media; import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.IOException; public class WaveFileReader { private String filename = null; private int[][] data = null; private int len = 0; private String chunkdescriptor = null; static private int lenchunkdescriptor = 4; private long chunksize = 0; static private int lenchunksize = 4; private String waveflag = null; static private int lenwaveflag = 4; private String fmtsubchunk = null; static private int lenfmtsubchunk = 4; private long subchunk1size = 0; static private int lensubchunk1size = 4; private int audioformat = 0; static private int lenaudioformat = 2; private int numchannels = 0; static private int lennumchannels = 2; private long samplerate = 0; static private int lensamplerate = 2; private long byterate = 0; static private int lenbyterate = 4; private int blockalign = 0; static private int lenblockling = 2; private int bitspersample = 0; static private int lenbitspersample = 2; private String datasubchunk = null; static private int lendatasubchunk = 4; private long subchunk2size = 0; static private int lensubchunk2size = 4; private FileInputStream fis = null; private BufferedInputStream bis = null; private boolean issuccess = false; public WaveFileReader(String filename) { this.initReader(filename); } // 判断是否创建wav读取器成功 public boolean isSuccess() { return issuccess; } // 获取每个采样的编码长度,8bit或者16bit public int getBitPerSample(){ return this.bitspersample; } // 获取采样率 public long getSampleRate(){ return this.samplerate; } // 获取声道个数,1代表单声道 2代表立体声 public int getNumChannels(){ return this.numchannels; } // 获取数据长度,也就是一共采样多少个 public int getDataLen(){ return this.len; } // 获取数据 // 数据是一个二维数组,[n][m]代表第n个声道的第m个采样值 public int[][] getData(){ return this.data; } private void initReader(String filename){ this.filename = filename; try { fis = new FileInputStream(this.filename); bis = new BufferedInputStream(fis); this.chunkdescriptor = readString(lenchunkdescriptor); if(!chunkdescriptor.endsWith("RIFF")) throw new IllegalArgumentException("RIFF miss, " + filename + " is not a wave file."); this.chunksize = readLong(); this.waveflag = readString(lenwaveflag); if(!waveflag.endsWith("WAVE")) throw new IllegalArgumentException("WAVE miss, " + filename + " is not a wave file."); this.fmtsubchunk = readString(lenfmtsubchunk); if(!fmtsubchunk.endsWith("fmt ")) throw new IllegalArgumentException("fmt miss, " + filename + " is not a wave file."); this.subchunk1size = readLong(); this.audioformat = readInt(); this.numchannels = readInt(); this.samplerate = readLong(); this.byterate = readLong(); this.blockalign = readInt(); this.bitspersample = readInt(); this.datasubchunk = readString(lendatasubchunk); if(!datasubchunk.endsWith("data")) throw new IllegalArgumentException("data miss, " + filename + " is not a wave file."); this.subchunk2size = readLong(); this.len = (int)(this.subchunk2size/(this.bitspersample/8)/this.numchannels); this.data = new int[this.numchannels][this.len]; for(int i=0; i<this.len; ++i){ for(int n=0; n<this.numchannels; ++n){ if(this.bitspersample == 8){ this.data[n][i] = bis.read(); } else if(this.bitspersample == 16){ this.data[n][i] = this.readInt(); } } } issuccess = true; } catch (Exception e) { e.printStackTrace(); } finally{ try{ if(bis != null) bis.close(); if(fis != null) fis.close(); } catch(Exception e1){ e1.printStackTrace(); } } } private String readString(int len){ byte[] buf = new byte[len]; try { if(bis.read(buf)!=len) throw new IOException("no more data!!!"); } catch (IOException e) { e.printStackTrace(); } return new String(buf); } private int readInt(){ byte[] buf = new byte[2]; int res = 0; try { if(bis.read(buf)!=2) throw new IOException("no more data!!!"); res = (buf[0]&0x000000FF) | (((int)buf[1])<<8); } catch (IOException e) { e.printStackTrace(); } return res; } private long readLong(){ long res = 0; try { long[] l = new long[4]; for(int i=0; i<4; ++i){ l[i] = bis.read(); if(l[i]==-1){ throw new IOException("no more data!!!"); } } res = l[0] | (l[1]<<8) | (l[2]<<16) | (l[3]<<24); } catch (IOException e) { e.printStackTrace(); } return res; } private byte[] readBytes(int len){ byte[] buf = new byte[len]; try { if(bis.read(buf)!=len) throw new IOException("no more data!!!"); } catch (IOException e) { e.printStackTrace(); } return buf; } public static int[] readSingleChannel(String filename){ if(filename==null || filename.length()==0){ return null; } try{ WaveFileReader reader = new WaveFileReader(filename); int[] res = reader.getData()[0]; return res; } catch (Exception e){ e.printStackTrace(); } return null; } }
SoLoHiC/chddt
CHDDiagnosticTool/src/com/sin/java/media/WaveFileReader.java
Java
epl-1.0
5,668
''' This is an example how to use PyScanClient library to connect a scan server. It assumes the server running on localhost at port 4810. The scan server is a RESTful based web service, which was developed at SNS. Its binary nightly build could be found at: https://ics-web.sns.ornl.gov/css/nightly/ and source code is managed at github: https://github.com/ControlSystemStudio/cs-studio/tree/master/applications/plugins/org.csstudio.scan The PyScanClient source code is managed at github: https://github.com/PythonScanClient/PyScanClient Created on Apr 17, 2015 @author: shen ''' from scan import ScanClient if __name__ == '__main__': client = ScanClient('localhost') print client # show server information, which is in XML format. print client.serverInfo()
PythonScanClient/PyScanClient
tutorial/1_start.py
Python
epl-1.0
787
/** * <copyright> * </copyright> * * $Id$ */ package gbind.dsl.impl; import gbind.dsl.ConceptFeatureRef; import gbind.dsl.ConceptMetaclass; import gbind.dsl.DslPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Concept Feature Ref</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link gbind.dsl.impl.ConceptFeatureRefImpl#getConceptClass <em>Concept Class</em>}</li> * <li>{@link gbind.dsl.impl.ConceptFeatureRefImpl#getFeatureName <em>Feature Name</em>}</li> * </ul> * * @generated */ public class ConceptFeatureRefImpl extends EObjectImpl implements ConceptFeatureRef { /** * The cached value of the '{@link #getConceptClass() <em>Concept Class</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getConceptClass() * @generated * @ordered */ protected ConceptMetaclass conceptClass; /** * The default value of the '{@link #getFeatureName() <em>Feature Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFeatureName() * @generated * @ordered */ protected static final String FEATURE_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getFeatureName() <em>Feature Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFeatureName() * @generated * @ordered */ protected String featureName = FEATURE_NAME_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ConceptFeatureRefImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DslPackage.Literals.CONCEPT_FEATURE_REF; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ConceptMetaclass getConceptClass() { if (conceptClass != null && conceptClass.eIsProxy()) { InternalEObject oldConceptClass = (InternalEObject)conceptClass; conceptClass = (ConceptMetaclass)eResolveProxy(oldConceptClass); if (conceptClass != oldConceptClass) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, DslPackage.CONCEPT_FEATURE_REF__CONCEPT_CLASS, oldConceptClass, conceptClass)); } } return conceptClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ConceptMetaclass basicGetConceptClass() { return conceptClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setConceptClass(ConceptMetaclass newConceptClass) { ConceptMetaclass oldConceptClass = conceptClass; conceptClass = newConceptClass; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.CONCEPT_FEATURE_REF__CONCEPT_CLASS, oldConceptClass, conceptClass)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getFeatureName() { return featureName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFeatureName(String newFeatureName) { String oldFeatureName = featureName; featureName = newFeatureName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.CONCEPT_FEATURE_REF__FEATURE_NAME, oldFeatureName, featureName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DslPackage.CONCEPT_FEATURE_REF__CONCEPT_CLASS: if (resolve) return getConceptClass(); return basicGetConceptClass(); case DslPackage.CONCEPT_FEATURE_REF__FEATURE_NAME: return getFeatureName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DslPackage.CONCEPT_FEATURE_REF__CONCEPT_CLASS: setConceptClass((ConceptMetaclass)newValue); return; case DslPackage.CONCEPT_FEATURE_REF__FEATURE_NAME: setFeatureName((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DslPackage.CONCEPT_FEATURE_REF__CONCEPT_CLASS: setConceptClass((ConceptMetaclass)null); return; case DslPackage.CONCEPT_FEATURE_REF__FEATURE_NAME: setFeatureName(FEATURE_NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DslPackage.CONCEPT_FEATURE_REF__CONCEPT_CLASS: return conceptClass != null; case DslPackage.CONCEPT_FEATURE_REF__FEATURE_NAME: return FEATURE_NAME_EDEFAULT == null ? featureName != null : !FEATURE_NAME_EDEFAULT.equals(featureName); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (featureName: "); result.append(featureName); result.append(')'); return result.toString(); } } //ConceptFeatureRefImpl
jesusc/bento
plugins/genericity.language.gbind/src-gen/gbind/dsl/impl/ConceptFeatureRefImpl.java
Java
epl-1.0
5,771
/** * Copyright (c) 2014-2015 TELECOM ParisTech and AdaCore. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Elie Richa - initial implementation */ package fr.tpt.atlanalyser.atl.ATL.impl; import fr.tpt.atlanalyser.atl.ATL.ATLPackage; import fr.tpt.atlanalyser.atl.ATL.LocatedElement; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EDataTypeEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Located Element</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link fr.tpt.atlanalyser.atl.ATL.impl.LocatedElementImpl#getLocation <em>Location</em>}</li> * <li>{@link fr.tpt.atlanalyser.atl.ATL.impl.LocatedElementImpl#getCommentsBefore <em>Comments Before</em>}</li> * <li>{@link fr.tpt.atlanalyser.atl.ATL.impl.LocatedElementImpl#getCommentsAfter <em>Comments After</em>}</li> * </ul> * </p> * * @generated */ public abstract class LocatedElementImpl extends MinimalEObjectImpl.Container implements LocatedElement { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final String copyright = "Copyright (c) 2014-2015 TELECOM ParisTech and AdaCore.\nAll rights reserved. This program and the accompanying materials\nare made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp://www.eclipse.org/legal/epl-v10.html\n\nContributors:\n Elie Richa - initial implementation"; /** * The default value of the '{@link #getLocation() <em>Location</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLocation() * @generated * @ordered */ protected static final String LOCATION_EDEFAULT = null; /** * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLocation() * @generated * @ordered */ protected String location = LOCATION_EDEFAULT; /** * The cached value of the '{@link #getCommentsBefore() <em>Comments Before</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getCommentsBefore() * @generated * @ordered */ protected EList<String> commentsBefore; /** * The cached value of the '{@link #getCommentsAfter() <em>Comments After</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getCommentsAfter() * @generated * @ordered */ protected EList<String> commentsAfter; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected LocatedElementImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ATLPackage.Literals.LOCATED_ELEMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLocation() { return location; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLocation(String newLocation) { String oldLocation = location; location = newLocation; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ATLPackage.LOCATED_ELEMENT__LOCATION, oldLocation, location)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<String> getCommentsBefore() { if (commentsBefore == null) { commentsBefore = new EDataTypeEList<String>(String.class, this, ATLPackage.LOCATED_ELEMENT__COMMENTS_BEFORE); } return commentsBefore; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<String> getCommentsAfter() { if (commentsAfter == null) { commentsAfter = new EDataTypeEList<String>(String.class, this, ATLPackage.LOCATED_ELEMENT__COMMENTS_AFTER); } return commentsAfter; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ATLPackage.LOCATED_ELEMENT__LOCATION: return getLocation(); case ATLPackage.LOCATED_ELEMENT__COMMENTS_BEFORE: return getCommentsBefore(); case ATLPackage.LOCATED_ELEMENT__COMMENTS_AFTER: return getCommentsAfter(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ATLPackage.LOCATED_ELEMENT__LOCATION: setLocation((String)newValue); return; case ATLPackage.LOCATED_ELEMENT__COMMENTS_BEFORE: getCommentsBefore().clear(); getCommentsBefore().addAll((Collection<? extends String>)newValue); return; case ATLPackage.LOCATED_ELEMENT__COMMENTS_AFTER: getCommentsAfter().clear(); getCommentsAfter().addAll((Collection<? extends String>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ATLPackage.LOCATED_ELEMENT__LOCATION: setLocation(LOCATION_EDEFAULT); return; case ATLPackage.LOCATED_ELEMENT__COMMENTS_BEFORE: getCommentsBefore().clear(); return; case ATLPackage.LOCATED_ELEMENT__COMMENTS_AFTER: getCommentsAfter().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ATLPackage.LOCATED_ELEMENT__LOCATION: return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); case ATLPackage.LOCATED_ELEMENT__COMMENTS_BEFORE: return commentsBefore != null && !commentsBefore.isEmpty(); case ATLPackage.LOCATED_ELEMENT__COMMENTS_AFTER: return commentsAfter != null && !commentsAfter.isEmpty(); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (location: "); result.append(location); result.append(", commentsBefore: "); result.append(commentsBefore); result.append(", commentsAfter: "); result.append(commentsAfter); result.append(')'); return result.toString(); } } //LocatedElementImpl
eliericha/atlanalyser
fr.tpt.atlanalyser.atl/src/fr/tpt/atlanalyser/atl/ATL/impl/LocatedElementImpl.java
Java
epl-1.0
8,031
package nju.software.sjy.dao; import java.util.List; import nju.software.sjy.model.xy.TOperation; import nju.software.sjy.model.xy.TResource; import nju.software.sjy.model.xy.TRole; import nju.software.sjy.model.xy.TRoleoperation; import nju.software.sjy.model.xy.TRoleres; public interface RoleDao { List<TRole> getAllRoles(); List<TResource> getResByRole(TRole role); TRole getRoleByRolename(String rolename); List<TOperation> getOperationByRole(TRole role); Integer getMaxRoleBh(); void saveRole(TRole role); void updateRole(TRole role); void deleteRole(TRole role); Integer getMaxRoleoperationBh(); void saveRoleoperation(TRoleoperation ro); void updateRoleoperation(TRoleoperation ro); void deleteRoleoperation(TRoleoperation ro); List<TOperation> getAllOperation(); TOperation getOperationByName(String name); TRole getRoleByRolebh(int rolebh); TRoleoperation getRoByRoleOperation(TRole role, TOperation operation); List<TRoleoperation> getRoByRole(TRole role); TResource getResByName(String resName); List<TRole> getRoleByResource(TResource res); TOperation getOperationByNameRange(String name, String range); List<TResource> getResByType(String type); List<TResource> getAllResource(); TRoleres getRrByRoleRes(TRole role, TResource res); Integer getMaxRoleResBh(); void saveRoleRes(TRoleres roleRes); List<TRoleres> getRrByRole(TRole role); void deleteRoleRes(TRoleres roleRes); List<TOperation> getActiveOperation(); List<TOperation> getOperationByRoleOperationname(TRole role, String operationname); List<TRole> getRoleByRolenamelist(List<String> rolenameList); }
SongyuCHen/SJY
src/nju/software/sjy/dao/RoleDao.java
Java
epl-1.0
1,665
package br.com.exception; public class FoneInvalidoException extends Exception{ /** * */ private static final long serialVersionUID = 1L; public FoneInvalidoException(String msg) { super(msg); } }
yuri4br/Clinica_Vet_POO
src/br/com/exception/FoneInvalidoException.java
Java
epl-1.0
220
/* * Sonatype Nexus (TM) Open Source Version * Copyright (c) 2008-present Sonatype, Inc. * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. * * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. * * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the * Eclipse Foundation. All other trademarks are the property of their respective owners. */ @FeatureFlag(name = ORIENT_ENABLED) package org.sonatype.nexus.blobstore.restore.raw.internal.orient; import org.sonatype.nexus.common.app.FeatureFlag; import static org.sonatype.nexus.common.app.FeatureFlags.ORIENT_ENABLED;
sonatype/nexus-public
plugins/nexus-restore-raw/src/main/java/org/sonatype/nexus/blobstore/restore/raw/internal/orient/package-info.java
Java
epl-1.0
1,007
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <title>org.eclipse.oomph.setup.git.impl (Oomph Setup Documentation)</title> <meta name="date" content=""> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.eclipse.oomph.setup.git.impl (Oomph Setup Documentation)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</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> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/eclipse/oomph/setup/git/package-summary.html">Prev Package</a></li> <li><a href="../../../../../../org/eclipse/oomph/setup/git/util/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/eclipse/oomph/setup/git/impl/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.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"> <h1 title="Package" class="title">Package&nbsp;org.eclipse.oomph.setup.git.impl</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../../../org/eclipse/oomph/setup/git/impl/GitCloneTaskImpl.html" title="class in org.eclipse.oomph.setup.git.impl">GitCloneTaskImpl</a></td> <td class="colLast"> <div class="block">An implementation of the model object '<em><b>Git Clone Task</b></em>'.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../../../org/eclipse/oomph/setup/git/impl/GitFactoryImpl.html" title="class in org.eclipse.oomph.setup.git.impl">GitFactoryImpl</a></td> <td class="colLast"> <div class="block">An implementation of the model <b>Factory</b>.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../../../../../../org/eclipse/oomph/setup/git/impl/GitPackageImpl.html" title="class in org.eclipse.oomph.setup.git.impl">GitPackageImpl</a></td> <td class="colLast"> <div class="block">An implementation of the model <b>Package</b>.</div> </td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</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> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/eclipse/oomph/setup/git/package-summary.html">Prev Package</a></li> <li><a href="../../../../../../org/eclipse/oomph/setup/git/util/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/eclipse/oomph/setup/git/impl/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.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><i class="copyright">Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.<br>All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html</i></small></p> </body> </html>
peterkir/org.eclipse.oomph
plugins/org.eclipse.oomph.setup.doc/javadoc/org/eclipse/oomph/setup/git/impl/package-summary.html
HTML
epl-1.0
5,742
/** * Copyright (c) 2010-2021 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 */ package org.openhab.binding.etherrain.internal.api; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.HttpURLConnection; import java.net.InetAddress; import java.net.SocketTimeoutException; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.openhab.binding.etherrain.internal.EtherRainException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The {@link EtherRainCommunication} handles communication with EtherRain * controllers so that the API is all in one place * * @author Joe Inkenbrandt - Initial contribution */ @NonNullByDefault public class EtherRainCommunication { private static final String BROADCAST_DISCOVERY_MESSAGE = "eviro_id_request1"; private static final int BROADCAST_DISCOVERY_PORT = 8089; private static final String ETHERRAIN_USERNAME = "admin"; private static final int HTTP_TIMEOUT = 3; private static final int BROADCAST_TIMEOUT = 80; private static final String RESPONSE_STATUS_PATTERN = "^\\s*(un|ma|ac|os|cs|rz|ri|rn):\\s*([a-zA-Z0-9\\.]*)(\\s*<br>)?"; private static final String BROADCAST_RESPONSE_DISCOVER_PATTERN = "eviro t=(\\S*) n=(\\S*) p=(\\S*) a=(\\S*)"; private static final Pattern broadcastResponseDiscoverPattern = Pattern .compile(BROADCAST_RESPONSE_DISCOVER_PATTERN); private static final Pattern responseStatusPattern = Pattern.compile(RESPONSE_STATUS_PATTERN); private final Logger logger = LoggerFactory.getLogger(EtherRainCommunication.class); private final HttpClient httpClient; private final String address; private final int port; private final String password; public EtherRainCommunication(String address, int port, String password, HttpClient httpClient) { this.address = address; this.port = port; this.password = password; this.httpClient = httpClient; } public static List<EtherRainUdpResponse> autoDiscover() { return updBroadcast(); } public EtherRainStatusResponse commandStatus() throws EtherRainException, IOException { commandLogin(); List<String> responseList = sendGet("result.cgi?xs"); if (responseList.isEmpty()) { throw new EtherRainException("Empty Response"); } EtherRainStatusResponse response = new EtherRainStatusResponse(); for (String line : responseList) { Matcher m = responseStatusPattern.matcher(line); if (m.matches()) { String command = m.replaceAll("$1"); String status = m.replaceAll("$2"); switch (command) { case "un": response.setUniqueName(status); break; case "ma": response.setMacAddress(status); break; case "ac": response.setServiceAccount(status); break; case "os": response.setOperatingStatus(EtherRainOperatingStatus.valueOf(status.toUpperCase())); break; case "cs": response.setLastCommandStatus(EtherRainCommandStatus.valueOf(status.toUpperCase())); break; case "rz": response.setLastCommandResult(EtherRainCommandResult.valueOf(status.toUpperCase())); break; case "ri": response.setLastActiveValue(Integer.parseInt(status)); break; case "rn": response.setRainSensor(Integer.parseInt(status) == 1); break; default: logger.debug("Unknown response: {}", command); } } } return response; } public synchronized boolean commandIrrigate(int delay, int zone1, int zone2, int zone3, int zone4, int zone5, int zone6, int zone7, int zone8) { try { sendGet("result.cgi?xi=" + delay + ":" + zone1 + ":" + zone2 + ":" + zone3 + ":" + zone4 + ":" + zone5 + ":" + zone6 + ":" + zone7 + ":" + zone8); } catch (IOException e) { logger.warn("Could not send irrigate command to etherrain: {}", e.getMessage()); return false; } return true; } public synchronized boolean commandClear() { try { sendGet("/result.cgi?xr"); } catch (IOException e) { logger.warn("Could not send clear command to etherrain: {}", e.getMessage()); return false; } return true; } public synchronized boolean commandLogin() throws EtherRainException { try { sendGet("/ergetcfg.cgi?lu=" + ETHERRAIN_USERNAME + "&lp=" + password); } catch (IOException e) { logger.warn("Could not send clear command to etherrain: {}", e.getMessage()); return false; } return true; } public synchronized boolean commandLogout() { try { sendGet("/ergetcfg.cgi?m=o"); } catch (IOException e) { logger.warn("Could not send logout command to etherrain: {}", e.getMessage()); return false; } return true; } private synchronized List<String> sendGet(String command) throws IOException { String url = "http://" + address + ":" + port + "/" + command; ContentResponse response; try { response = httpClient.newRequest(url).timeout(HTTP_TIMEOUT, TimeUnit.SECONDS).send(); if (response.getStatus() != HttpURLConnection.HTTP_OK) { logger.warn("Etherrain return status other than HTTP_OK : {}", response.getStatus()); return Collections.emptyList(); } } catch (TimeoutException | ExecutionException e) { logger.warn("Could not connect to Etherrain with exception: {}", e.getMessage()); return Collections.emptyList(); } catch (InterruptedException e) { logger.warn("Connect to Etherrain interrupted: {}", e.getMessage()); Thread.currentThread().interrupt(); return Collections.emptyList(); } return new BufferedReader(new StringReader(response.getContentAsString())).lines().collect(Collectors.toList()); } private static List<EtherRainUdpResponse> updBroadcast() { List<EtherRainUdpResponse> rList = new LinkedList<>(); // Find the server using UDP broadcast try (DatagramSocket c = new DatagramSocket()) { c.setSoTimeout(BROADCAST_TIMEOUT); c.setBroadcast(true); byte[] sendData = BROADCAST_DISCOVERY_MESSAGE.getBytes("UTF-8"); // Try the 255.255.255.255 first DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, InetAddress.getByName("255.255.255.255"), BROADCAST_DISCOVERY_PORT); c.send(sendPacket); while (true) { // Wait for a response byte[] recvBuf = new byte[15000]; DatagramPacket receivePacket; try { receivePacket = new DatagramPacket(recvBuf, recvBuf.length); c.receive(receivePacket); } catch (SocketTimeoutException e) { return rList; } // Check if the message is correct String message = new String(receivePacket.getData(), "UTF-8").trim(); if (message.length() == 0) { return rList; } String addressBC = receivePacket.getAddress().getHostAddress(); Matcher matcher = broadcastResponseDiscoverPattern.matcher(message); String deviceTypeBC = matcher.replaceAll("$1"); String unqiueNameBC = matcher.replaceAll("$2"); int portBC = Integer.parseInt(matcher.replaceAll("$3")); // NOTE: Version 3.77 of API states that Additional Parameters (a=) are not used // on EtherRain rList.add(new EtherRainUdpResponse(deviceTypeBC, addressBC, portBC, unqiueNameBC, "")); } } catch (IOException ex) { return rList; } } }
paulianttila/openhab2
bundles/org.openhab.binding.etherrain/src/main/java/org/openhab/binding/etherrain/internal/api/EtherRainCommunication.java
Java
epl-1.0
9,421
/* * Sonatype Nexus (TM) Open Source Version * Copyright (c) 2008-present Sonatype, Inc. * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. * * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. * * Sonatype Nexus (TM) Open Source Version is distributed with Sencha Ext JS pursuant to a FLOSS Exception agreed upon * between Sonatype, Inc. and Sencha Inc. Sencha Ext JS is licensed under GPL v3 and cannot be redistributed as part of a * closed source work. * * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the * Eclipse Foundation. All other trademarks are the property of their respective owners. */ /*global Ext, NX*/ /** * Maven plugin configuration * * @since 3.15 */ Ext.define('NX.maven.app.PluginConfig', { '@aggregate_priority': 100, controllers: [ { id: 'NX.maven.controller.MavenDependencySnippetController', active: true } ] });
sonatype/nexus-public
plugins/nexus-repository-maven/src/main/resources/static/rapture/NX/maven/app/PluginConfig.js
JavaScript
epl-1.0
1,318
// /******************************************************************************* // * Copyright (c) 2016 by RF77 (https://github.com/RF77) // * All rights reserved. This program and the accompanying materials // * are made available under the terms of the Eclipse Public License v1.0 // * which accompanies this distribution, and is available at // * http://www.eclipse.org/legal/epl-v10.html // * // * Contributors: // * RF77 - initial API and implementation and/or initial documentation // *******************************************************************************/ using System; using System.Threading; namespace FileDb.Impl { public class ReadWritLockable { private readonly TimeSpan _readWriteTimeOut; private readonly ReaderWriterLock _rwl = new ReaderWriterLock(); public ReadWritLockable(TimeSpan readWriteLockTimeOut) { _readWriteTimeOut = readWriteLockTimeOut; } public void WriterLock(Action action) { try { _rwl.AcquireWriterLock(_readWriteTimeOut); action(); } finally { _rwl.ReleaseWriterLock(); } } public T ReaderLock<T>(Func<T> action) { try { _rwl.AcquireReaderLock(_readWriteTimeOut); return action(); } finally { _rwl.ReleaseReaderLock(); } } public T WriterLock<T>(Func<T> action) { try { _rwl.AcquireWriterLock(_readWriteTimeOut); return action(); } finally { _rwl.ReleaseWriterLock(); } } } }
RF77/sharp-tsdb
src/FileDb/Impl/ReadWritLockable.cs
C#
epl-1.0
1,841
using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("CJO-WK_SikuliUI_IDE__Package")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Christopher Olson")] [assembly: AssemblyProduct("CJO-WK_SikuliUI_IDE__Package")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: NeutralResourcesLanguage("en-US")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("0.2.0.0")] [assembly: AssemblyFileVersion("0.2.0.0")]
ChristopherOlson-WK/SikuliUI-IDE
SikuliUI-IDE_Package/Properties/AssemblyInfo.cs
C#
epl-1.0
1,160
/******************************************************************************* * Copyright (c) 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package com.ibm.ws.jpa.tests.spec10.entity.tests; import java.util.HashSet; import java.util.Set; import org.jboss.shrinkwrap.api.ArchivePath; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.runner.RunWith; import org.testcontainers.containers.JdbcDatabaseContainer; import com.ibm.websphere.simplicity.ShrinkHelper; import com.ibm.websphere.simplicity.config.Application; import com.ibm.websphere.simplicity.config.ClassloaderElement; import com.ibm.websphere.simplicity.config.ConfigElementList; import com.ibm.websphere.simplicity.config.ServerConfiguration; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.BasicAnnotation_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.DatatypeSupport_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.EmbeddableID_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.Embeddable_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.IDClass_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.MultiTable_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.PKEntity_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.PKGenerator_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.ReadOnly_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.Serializable_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sf.Versioning_EJB_SF_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.BasicAnnotation_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.DatatypeSupport_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.EmbeddableID_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.Embeddable_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.IDClass_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.MultiTable_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.PKEntity_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.PKGenerator_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.ReadOnly_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.Serializable_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sfex.Versioning_EJB_SFEX_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.BasicAnnotation_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.DatatypeSupport_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.EmbeddableID_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.Embeddable_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.IDClass_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.MultiTable_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.PKEntity_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.PKGenerator_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.ReadOnly_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.Serializable_EJB_SL_TestServlet; import com.ibm.ws.jpa.fvt.entity.tests.ejb.sl.Versioning_EJB_SL_TestServlet; import com.ibm.ws.testtooling.database.DatabaseVendor; import com.ibm.ws.testtooling.jpaprovider.JPAPersistenceProvider; import componenttest.annotation.Server; import componenttest.annotation.TestServlet; import componenttest.annotation.TestServlets; import componenttest.custom.junit.runner.FATRunner; import componenttest.custom.junit.runner.Mode; import componenttest.custom.junit.runner.Mode.TestMode; import componenttest.topology.database.container.DatabaseContainerType; import componenttest.topology.database.container.DatabaseContainerUtil; import componenttest.topology.impl.LibertyServer; import componenttest.topology.utils.PrivHelper; @RunWith(FATRunner.class) @Mode(TestMode.FULL) public class Entity_EJB extends JPAFATServletClient { @Rule public static SkipRule skipRule = new SkipRule(); private final static String CONTEXT_ROOT = "Entity10EJB"; private final static String RESOURCE_ROOT = "test-applications/entity/"; private final static String appFolder = "ejb"; private final static String appName = "EntityEJB10"; private final static String appNameEar = appName + ".ear"; private final static Set<String> dropSet = new HashSet<String>(); private final static Set<String> createSet = new HashSet<String>(); private static long timestart = 0; static { dropSet.add("JPA10_ENTITY_${provider}_DROP_${dbvendor}.ddl"); createSet.add("JPA10_ENTITY_${provider}_CREATE_${dbvendor}.ddl"); } @Server("JPA10EJBEntityServer") @TestServlets({ @TestServlet(servlet = BasicAnnotation_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "BasicAnnotation_EJB_SL_TestServlet"), @TestServlet(servlet = DatatypeSupport_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "DatatypeSupport_EJB_SL_TestServlet"), @TestServlet(servlet = EmbeddableID_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "EmbeddableID_EJB_SL_TestServlet"), @TestServlet(servlet = Embeddable_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "Embeddable_EJB_SL_TestServlet"), @TestServlet(servlet = IDClass_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "IDClass_EJB_SL_TestServlet"), @TestServlet(servlet = MultiTable_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "MultiTable_EJB_SL_TestServlet"), @TestServlet(servlet = PKEntity_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "PKEntity_EJB_SL_TestServlet"), @TestServlet(servlet = PKGenerator_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "PKGenerator_EJB_SL_TestServlet"), @TestServlet(servlet = ReadOnly_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "ReadOnly_EJB_SL_TestServlet"), @TestServlet(servlet = Serializable_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "Serializable_EJB_SL_TestServlet"), @TestServlet(servlet = Versioning_EJB_SL_TestServlet.class, path = CONTEXT_ROOT + "/" + "Versioning_EJB_SL_TestServlet"), @TestServlet(servlet = BasicAnnotation_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "BasicAnnotation_EJB_SF_TestServlet"), @TestServlet(servlet = DatatypeSupport_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "DatatypeSupport_EJB_SF_TestServlet"), @TestServlet(servlet = EmbeddableID_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "EmbeddableID_EJB_SF_TestServlet"), @TestServlet(servlet = Embeddable_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "Embeddable_EJB_SF_TestServlet"), @TestServlet(servlet = IDClass_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "IDClass_EJB_SF_TestServlet"), @TestServlet(servlet = MultiTable_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "MultiTable_EJB_SF_TestServlet"), @TestServlet(servlet = PKEntity_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "PKEntity_EJB_SF_TestServlet"), @TestServlet(servlet = PKGenerator_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "PKGenerator_EJB_SF_TestServlet"), @TestServlet(servlet = ReadOnly_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "ReadOnly_EJB_SF_TestServlet"), @TestServlet(servlet = Serializable_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "Serializable_EJB_SF_TestServlet"), @TestServlet(servlet = Versioning_EJB_SF_TestServlet.class, path = CONTEXT_ROOT + "/" + "Versioning_EJB_SF_TestServlet"), @TestServlet(servlet = BasicAnnotation_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "BasicAnnotation_EJB_SFEX_TestServlet"), @TestServlet(servlet = DatatypeSupport_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "DatatypeSupport_EJB_SFEX_TestServlet"), @TestServlet(servlet = EmbeddableID_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "EmbeddableID_EJB_SFEX_TestServlet"), @TestServlet(servlet = Embeddable_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "Embeddable_EJB_SFEX_TestServlet"), @TestServlet(servlet = IDClass_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "IDClass_EJB_SFEX_TestServlet"), @TestServlet(servlet = MultiTable_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "MultiTable_EJB_SFEX_TestServlet"), @TestServlet(servlet = PKEntity_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "PKEntity_EJB_SFEX_TestServlet"), @TestServlet(servlet = PKGenerator_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "PKGenerator_EJB_SFEX_TestServlet"), @TestServlet(servlet = ReadOnly_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "ReadOnly_EJB_SFEX_TestServlet"), @TestServlet(servlet = Serializable_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "Serializable_EJB_SFEX_TestServlet"), @TestServlet(servlet = Versioning_EJB_SFEX_TestServlet.class, path = CONTEXT_ROOT + "/" + "Versioning_EJB_SFEX_TestServlet") }) public static LibertyServer server; public static final JdbcDatabaseContainer<?> testContainer = AbstractFATSuite.testContainer; @BeforeClass public static void setUp() throws Exception { PrivHelper.generateCustomPolicy(server, AbstractFATSuite.JAXB_PERMS); bannerStart(Entity_Web.class); timestart = System.currentTimeMillis(); int appStartTimeout = server.getAppStartTimeout(); if (appStartTimeout < (120 * 1000)) { server.setAppStartTimeout(120 * 1000); } int configUpdateTimeout = server.getConfigUpdateTimeout(); if (configUpdateTimeout < (120 * 1000)) { server.setConfigUpdateTimeout(120 * 1000); } server.addEnvVar("repeat_phase", AbstractFATSuite.repeatPhase); //Get driver name server.addEnvVar("DB_DRIVER", DatabaseContainerType.valueOf(testContainer).getDriverName()); //Setup server DataSource properties DatabaseContainerUtil.setupDataSourceProperties(server, testContainer); server.startServer(); setupDatabaseApplication(server, RESOURCE_ROOT + "ddl/"); final Set<String> ddlSet = new HashSet<String>(); System.out.println(Entity_Web.class.getName() + " Setting up database tables..."); DatabaseVendor database = getDbVendor(); JPAPersistenceProvider provider = AbstractFATSuite.provider; ddlSet.clear(); for (String ddlName : dropSet) { ddlSet.add(ddlName.replace("${provider}", provider.name()).replace("${dbvendor}", database.name())); } executeDDL(server, ddlSet, true); ddlSet.clear(); for (String ddlName : createSet) { ddlSet.add(ddlName.replace("${provider}", provider.name()).replace("${dbvendor}", database.name())); } executeDDL(server, ddlSet, false); setupTestApplication(); skipRule.setDatabase(database); skipRule.setProvider(provider); } private static void setupTestApplication() throws Exception { JavaArchive ejbApp = ShrinkWrap.create(JavaArchive.class, appName + ".jar"); ejbApp.addPackages(true, "com.ibm.ws.jpa.fvt.entity.ejblocal"); ejbApp.addPackages(true, "com.ibm.ws.jpa.fvt.entity.entities"); ejbApp.addPackages(true, "com.ibm.ws.jpa.fvt.entity.support"); ejbApp.addPackages(true, "com.ibm.ws.jpa.fvt.entity.testlogic"); ShrinkHelper.addDirectory(ejbApp, RESOURCE_ROOT + appFolder + "/" + appName + ".jar"); WebArchive webApp = ShrinkWrap.create(WebArchive.class, appName + ".war"); webApp.addPackages(true, "com.ibm.ws.jpa.fvt.entity.tests.ejb"); ShrinkHelper.addDirectory(webApp, RESOURCE_ROOT + appFolder + "/" + appName + ".war"); final JavaArchive testApiJar = buildTestAPIJar(); /* * Hibernate 5.2 (JPA 2.1) contains a bug that requires a dialect property to be set * for Oracle platform detection: https://hibernate.atlassian.net/browse/HHH-13184 */ if (AbstractFATSuite.repeatPhase != null && AbstractFATSuite.repeatPhase.contains("21") && DatabaseVendor.ORACLE.equals(getDbVendor())) { ejbApp.move("/META-INF/persistence-oracle-21.xml", "/META-INF/persistence.xml"); } final EnterpriseArchive app = ShrinkWrap.create(EnterpriseArchive.class, appNameEar); app.addAsModule(ejbApp); app.addAsModule(webApp); app.addAsLibrary(testApiJar); ShrinkHelper.addDirectory(app, RESOURCE_ROOT + appFolder, new org.jboss.shrinkwrap.api.Filter<ArchivePath>() { @Override public boolean include(ArchivePath arg0) { if (arg0.get().startsWith("/META-INF/")) { return true; } return false; } }); ShrinkHelper.exportToServer(server, "apps", app); Application appRecord = new Application(); appRecord.setLocation(appNameEar); appRecord.setName(appName); // setup the thirdparty classloader for Hibernate and OpenJPA if (AbstractFATSuite.repeatPhase != null && AbstractFATSuite.repeatPhase.contains("hibernate")) { ConfigElementList<ClassloaderElement> cel = appRecord.getClassloaders(); ClassloaderElement loader = new ClassloaderElement(); loader.getCommonLibraryRefs().add("HibernateLib"); cel.add(loader); } else if (AbstractFATSuite.repeatPhase != null && AbstractFATSuite.repeatPhase.contains("openjpa")) { ConfigElementList<ClassloaderElement> cel = appRecord.getClassloaders(); ClassloaderElement loader = new ClassloaderElement(); loader.getCommonLibraryRefs().add("OpenJPALib"); cel.add(loader); } else if (AbstractFATSuite.repeatPhase != null && AbstractFATSuite.repeatPhase.contains("20") && DatabaseVendor.ORACLE.equals(getDbVendor())) { /* * TODO: OpenJPA 2.2.x (JPA 2.0) has hard dependencies on the Oracle JDBC driver classes and * therefore requires the driver be added to the application classloader * * https://issues.apache.org/jira/projects/OPENJPA/issues/OPENJPA-2602 * https://issues.apache.org/jira/projects/OPENJPA/issues/OPENJPA-2690 */ ConfigElementList<ClassloaderElement> cel = appRecord.getClassloaders(); ClassloaderElement loader = new ClassloaderElement(); loader.getCommonLibraryRefs().add("AnonymousJDBCLib"); cel.add(loader); } server.setMarkToEndOfLog(); ServerConfiguration sc = server.getServerConfiguration(); sc.getApplications().add(appRecord); server.updateServerConfiguration(sc); server.saveServerConfiguration(); HashSet<String> appNamesSet = new HashSet<String>(); appNamesSet.add(appName); server.waitForConfigUpdateInLogUsingMark(appNamesSet, ""); } @AfterClass public static void tearDown() throws Exception { try { // Clean up database try { JPAPersistenceProvider provider = AbstractFATSuite.provider; final Set<String> ddlSet = new HashSet<String>(); for (String ddlName : dropSet) { ddlSet.add(ddlName.replace("${provider}", provider.name()).replace("${dbvendor}", getDbVendor().name())); } executeDDL(server, ddlSet, true); } catch (Throwable t) { t.printStackTrace(); } server.stopServer("CWWJP9991W", // From Eclipselink drop-and-create tables option "WTRN0074E: Exception caught from before_completion synchronization operation" // RuntimeException test, expected ); } finally { try { ServerConfiguration sc = server.getServerConfiguration(); sc.getApplications().clear(); server.updateServerConfiguration(sc); server.saveServerConfiguration(); server.deleteFileFromLibertyServerRoot("apps/" + appNameEar); server.deleteFileFromLibertyServerRoot("apps/DatabaseManagement.war"); } catch (Throwable t) { t.printStackTrace(); } bannerEnd(Entity_Web.class, timestart); } } }
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.tests.spec10.entity_fat.common/fat/src/com/ibm/ws/jpa/tests/spec10/entity/tests/Entity_EJB.java
Java
epl-1.0
17,783
#Nuxeo Codenvy Docker ## General information and motivation The **Nuxeo** _codenvy-docker_ image is used by Codenvy Runner to accelerates Nuxeo distribution execution. ##About ###Nuxeo [Nuxeo](http://www.nuxeo.com) provides a modular, extensible Java-based [open source software platform for enterprise content management](http://www.nuxeo.com/en/products/content-management-platform), and packaged applications for [document management](http://www.nuxeo.com/en/products/document-management), [digital asset management](http://www.nuxeo.com/en/products/digital-asset-management), [social collaboration](http://www.nuxeo.com/en/products/social-collaboration) and [case management](http://www.nuxeo.com/en/products/case-management). Designed by developers for developers, the Nuxeo platform offers a modern architecture, a powerful plug-in model and extensive packaging capabilities for building content applications. More information on: <http://www.nuxeo.com/>
nuxeo/nuxeo-codenvy-docker
README.md
Markdown
epl-1.0
967
#******************************************************************************* # Copyright (c) 2010-2014, Gabor Szarnyas, Istvan Rath and Daniel Varro # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # Gabor Szarnyas - initial API and implementation #******************************************************************************* #!/bin/bash HOSTS=`avahi-browse -at | grep IPv4 | grep _4store | cut -d " " -f 6 | cut -d "-" -f 1` while read -r HOSTS; do hostToIP="$HOSTS"; avahi-browse -atr 2> /dev/null | sed -n '/Workstation/,+2p' | sed -n '/IPv4/,+2p' | sed -n '/'$hostToIP'/,+2p' | grep 'address' | cut -d "[" -f 2 | cut -d "]" -f 1 done <<< "$HOSTS"
FTSRG-archive/4store-graph-driver
scripts/4s-discover.sh
Shell
epl-1.0
872
# Introduction to flatpack TODO: write [great documentation](http://jacobian.org/writing/what-to-write/)
attentive/flatpack
doc/intro.md
Markdown
epl-1.0
106
/** */ package metamodel_bdsl.util; import metamodel_bdsl.BatchProcess; import metamodel_bdsl.BindingAttribute; import metamodel_bdsl.BindingElement; import metamodel_bdsl.Component; import metamodel_bdsl.ConveyorBelt; import metamodel_bdsl.Distribution; import metamodel_bdsl.Flow; import metamodel_bdsl.Gaussian; import metamodel_bdsl.IntermediateElement; import metamodel_bdsl.MetamodelElement; import metamodel_bdsl.MetamodelElementFeature; import metamodel_bdsl.Metamodel_bdslPackage; import metamodel_bdsl.Model; import metamodel_bdsl.NoneElement; import metamodel_bdsl.OrderOnStockThreshold; import metamodel_bdsl.Output; import metamodel_bdsl.Poisson; import metamodel_bdsl.Probability; import metamodel_bdsl.ProcessOutputFlow; import metamodel_bdsl.Query; import metamodel_bdsl.Scalar; import metamodel_bdsl.SiriusTag; import metamodel_bdsl.Storage; import metamodel_bdsl.StorageOutputFlow; import metamodel_bdsl.Supplier; import metamodel_bdsl.Uniform; import metamodel_bdsl.VirtualAttribute; import metamodel_bdsl.deliveredPercentageSupplier; import metamodel_bdsl.descriptionOutput; import metamodel_bdsl.destinationProcessOutputFlow74; import metamodel_bdsl.destinationStorageOutputFlow63; import metamodel_bdsl.durationBatchProcess42; import metamodel_bdsl.durationConveyorBelt132; import metamodel_bdsl.errorQuery; import metamodel_bdsl.initialContentStorage; import metamodel_bdsl.intervalPoisson; import metamodel_bdsl.locationGaussian; import metamodel_bdsl.maximumUniform; import metamodel_bdsl.minimalSeparationBetweenBatchesConveyorBelt; import metamodel_bdsl.minimumUniform; import metamodel_bdsl.nameBatchProcess; import metamodel_bdsl.nameConveyorBelt; import metamodel_bdsl.nameOrderOnStockThreshold; import metamodel_bdsl.nameQuery; import metamodel_bdsl.nameStorage; import metamodel_bdsl.nameSupplier; import metamodel_bdsl.numberOfChainsBatchProcess; import metamodel_bdsl.orderOnStockThresholdStorage22; import metamodel_bdsl.orderQuantityOrderOnStockThreshold; import metamodel_bdsl.orderTypeOrderOnStockThreshold; import metamodel_bdsl.outputConveyorBelt133; import metamodel_bdsl.outputsBatchProcess43; import metamodel_bdsl.overflowStorage; import metamodel_bdsl.percentageOfSuccessBatchProcess; import metamodel_bdsl.periodOrderOnStockThreshold; import metamodel_bdsl.processOutputFlowDelayProcessOutputFlow73; import metamodel_bdsl.processOutputFlowOutput51; import metamodel_bdsl.processOutputFlowStorage23; import metamodel_bdsl.quantityProcessOutputFlow71; import metamodel_bdsl.quantityStorageOutputFlow61; import metamodel_bdsl.refillPolicySupplier31; import metamodel_bdsl.scaleGaussian; import metamodel_bdsl.sizeStorage; import metamodel_bdsl.sourceProcessOutputFlow72; import metamodel_bdsl.sourceStorageOutputFlow62; import metamodel_bdsl.storageOrderOnStockThreshold82; import metamodel_bdsl.storageOutputFlowBatchProcess41; import metamodel_bdsl.storageOutputFlowConveyorBelt131; import metamodel_bdsl.storageOutputFlowStorage21; import metamodel_bdsl.supplierDelaySupplier32; import metamodel_bdsl.supplierOrderOnStockThreshold81; import metamodel_bdsl.systemQuery; import metamodel_bdsl.thresholdOrderOnStockThreshold; import metamodel_bdsl.typeOutput; import metamodel_bdsl.typeQuery; import metamodel_bdsl.valueQuery; import metamodel_bdsl.valueScalar; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; /** * <!-- begin-user-doc --> * The <b>Switch</b> for the model's inheritance hierarchy. * It supports the call {@link #doSwitch(EObject) doSwitch(object)} * to invoke the <code>caseXXX</code> method for each class of the model, * starting with the actual class of the object * and proceeding up the inheritance hierarchy * until a non-null result is returned, * which is the result of the switch. * <!-- end-user-doc --> * @see metamodel_bdsl.Metamodel_bdslPackage * @generated */ public class Metamodel_bdslSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static Metamodel_bdslPackage modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Metamodel_bdslSwitch() { if (modelPackage == null) { modelPackage = Metamodel_bdslPackage.eINSTANCE; } } /** * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param ePackage the package in question. * @return whether this is a switch for the given package. * @generated */ @Override protected boolean isSwitchFor(EPackage ePackage) { return ePackage == modelPackage; } /** * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case Metamodel_bdslPackage.MODEL: { Model model = (Model)theEObject; T result = caseModel(model); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.QUERY: { Query query = (Query)theEObject; T result = caseQuery(query); if (result == null) result = caseBindingElement(query); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.STORAGE: { Storage storage = (Storage)theEObject; T result = caseStorage(storage); if (result == null) result = caseComponent(storage); if (result == null) result = caseBindingElement(storage); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SUPPLIER: { Supplier supplier = (Supplier)theEObject; T result = caseSupplier(supplier); if (result == null) result = caseComponent(supplier); if (result == null) result = caseBindingElement(supplier); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.BATCH_PROCESS: { BatchProcess batchProcess = (BatchProcess)theEObject; T result = caseBatchProcess(batchProcess); if (result == null) result = caseProcess(batchProcess); if (result == null) result = caseBindingElement(batchProcess); if (result == null) result = caseComponent(batchProcess); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.OUTPUT: { Output output = (Output)theEObject; T result = caseOutput(output); if (result == null) result = caseBindingElement(output); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.STORAGE_OUTPUT_FLOW: { StorageOutputFlow storageOutputFlow = (StorageOutputFlow)theEObject; T result = caseStorageOutputFlow(storageOutputFlow); if (result == null) result = caseFlow(storageOutputFlow); if (result == null) result = caseBindingElement(storageOutputFlow); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PROCESS_OUTPUT_FLOW: { ProcessOutputFlow processOutputFlow = (ProcessOutputFlow)theEObject; T result = caseProcessOutputFlow(processOutputFlow); if (result == null) result = caseFlow(processOutputFlow); if (result == null) result = caseBindingElement(processOutputFlow); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PROCESS: { metamodel_bdsl.Process process = (metamodel_bdsl.Process)theEObject; T result = caseProcess(process); if (result == null) result = caseComponent(process); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.ORDER_ON_STOCK_THRESHOLD: { OrderOnStockThreshold orderOnStockThreshold = (OrderOnStockThreshold)theEObject; T result = caseOrderOnStockThreshold(orderOnStockThreshold); if (result == null) result = caseBindingElement(orderOnStockThreshold); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.COMPONENT: { Component component = (Component)theEObject; T result = caseComponent(component); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.FLOW: { Flow flow = (Flow)theEObject; T result = caseFlow(flow); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PROBABILITY: { Probability probability = (Probability)theEObject; T result = caseProbability(probability); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.DISTRIBUTION: { Distribution distribution = (Distribution)theEObject; T result = caseDistribution(distribution); if (result == null) result = caseProbability(distribution); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SCALAR: { Scalar scalar = (Scalar)theEObject; T result = caseScalar(scalar); if (result == null) result = caseProbability(scalar); if (result == null) result = caseBindingElement(scalar); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.GAUSSIAN: { Gaussian gaussian = (Gaussian)theEObject; T result = caseGaussian(gaussian); if (result == null) result = caseDistribution(gaussian); if (result == null) result = caseBindingElement(gaussian); if (result == null) result = caseProbability(gaussian); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.POISSON: { Poisson poisson = (Poisson)theEObject; T result = casePoisson(poisson); if (result == null) result = caseDistribution(poisson); if (result == null) result = caseBindingElement(poisson); if (result == null) result = caseProbability(poisson); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.UNIFORM: { Uniform uniform = (Uniform)theEObject; T result = caseUniform(uniform); if (result == null) result = caseDistribution(uniform); if (result == null) result = caseBindingElement(uniform); if (result == null) result = caseProbability(uniform); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.CONVEYOR_BELT: { ConveyorBelt conveyorBelt = (ConveyorBelt)theEObject; T result = caseConveyorBelt(conveyorBelt); if (result == null) result = caseProcess(conveyorBelt); if (result == null) result = caseBindingElement(conveyorBelt); if (result == null) result = caseComponent(conveyorBelt); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.STORAGE_OUTPUT_FLOW_STORAGE21: { storageOutputFlowStorage21 storageOutputFlowStorage21 = (storageOutputFlowStorage21)theEObject; T result = casestorageOutputFlowStorage21(storageOutputFlowStorage21); if (result == null) result = caseBindingAttribute(storageOutputFlowStorage21); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.ORDER_ON_STOCK_THRESHOLD_STORAGE22: { orderOnStockThresholdStorage22 orderOnStockThresholdStorage22 = (orderOnStockThresholdStorage22)theEObject; T result = caseorderOnStockThresholdStorage22(orderOnStockThresholdStorage22); if (result == null) result = caseBindingAttribute(orderOnStockThresholdStorage22); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PROCESS_OUTPUT_FLOW_STORAGE23: { processOutputFlowStorage23 processOutputFlowStorage23 = (processOutputFlowStorage23)theEObject; T result = caseprocessOutputFlowStorage23(processOutputFlowStorage23); if (result == null) result = caseBindingAttribute(processOutputFlowStorage23); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.REFILL_POLICY_SUPPLIER31: { refillPolicySupplier31 refillPolicySupplier31 = (refillPolicySupplier31)theEObject; T result = caserefillPolicySupplier31(refillPolicySupplier31); if (result == null) result = caseBindingAttribute(refillPolicySupplier31); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SUPPLIER_DELAY_SUPPLIER32: { supplierDelaySupplier32 supplierDelaySupplier32 = (supplierDelaySupplier32)theEObject; T result = casesupplierDelaySupplier32(supplierDelaySupplier32); if (result == null) result = caseBindingAttribute(supplierDelaySupplier32); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.STORAGE_OUTPUT_FLOW_BATCH_PROCESS41: { storageOutputFlowBatchProcess41 storageOutputFlowBatchProcess41 = (storageOutputFlowBatchProcess41)theEObject; T result = casestorageOutputFlowBatchProcess41(storageOutputFlowBatchProcess41); if (result == null) result = caseBindingAttribute(storageOutputFlowBatchProcess41); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.DURATION_BATCH_PROCESS42: { durationBatchProcess42 durationBatchProcess42 = (durationBatchProcess42)theEObject; T result = casedurationBatchProcess42(durationBatchProcess42); if (result == null) result = caseBindingAttribute(durationBatchProcess42); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.OUTPUTS_BATCH_PROCESS43: { outputsBatchProcess43 outputsBatchProcess43 = (outputsBatchProcess43)theEObject; T result = caseoutputsBatchProcess43(outputsBatchProcess43); if (result == null) result = caseBindingAttribute(outputsBatchProcess43); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PROCESS_OUTPUT_FLOW_OUTPUT51: { processOutputFlowOutput51 processOutputFlowOutput51 = (processOutputFlowOutput51)theEObject; T result = caseprocessOutputFlowOutput51(processOutputFlowOutput51); if (result == null) result = caseBindingAttribute(processOutputFlowOutput51); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.QUANTITY_STORAGE_OUTPUT_FLOW61: { quantityStorageOutputFlow61 quantityStorageOutputFlow61 = (quantityStorageOutputFlow61)theEObject; T result = casequantityStorageOutputFlow61(quantityStorageOutputFlow61); if (result == null) result = caseBindingAttribute(quantityStorageOutputFlow61); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SOURCE_STORAGE_OUTPUT_FLOW62: { sourceStorageOutputFlow62 sourceStorageOutputFlow62 = (sourceStorageOutputFlow62)theEObject; T result = casesourceStorageOutputFlow62(sourceStorageOutputFlow62); if (result == null) result = caseBindingAttribute(sourceStorageOutputFlow62); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.DESTINATION_STORAGE_OUTPUT_FLOW63: { destinationStorageOutputFlow63 destinationStorageOutputFlow63 = (destinationStorageOutputFlow63)theEObject; T result = casedestinationStorageOutputFlow63(destinationStorageOutputFlow63); if (result == null) result = caseBindingAttribute(destinationStorageOutputFlow63); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.QUANTITY_PROCESS_OUTPUT_FLOW71: { quantityProcessOutputFlow71 quantityProcessOutputFlow71 = (quantityProcessOutputFlow71)theEObject; T result = casequantityProcessOutputFlow71(quantityProcessOutputFlow71); if (result == null) result = caseBindingAttribute(quantityProcessOutputFlow71); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SOURCE_PROCESS_OUTPUT_FLOW72: { sourceProcessOutputFlow72 sourceProcessOutputFlow72 = (sourceProcessOutputFlow72)theEObject; T result = casesourceProcessOutputFlow72(sourceProcessOutputFlow72); if (result == null) result = caseBindingAttribute(sourceProcessOutputFlow72); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PROCESS_OUTPUT_FLOW_DELAY_PROCESS_OUTPUT_FLOW73: { processOutputFlowDelayProcessOutputFlow73 processOutputFlowDelayProcessOutputFlow73 = (processOutputFlowDelayProcessOutputFlow73)theEObject; T result = caseprocessOutputFlowDelayProcessOutputFlow73(processOutputFlowDelayProcessOutputFlow73); if (result == null) result = caseBindingAttribute(processOutputFlowDelayProcessOutputFlow73); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.DESTINATION_PROCESS_OUTPUT_FLOW74: { destinationProcessOutputFlow74 destinationProcessOutputFlow74 = (destinationProcessOutputFlow74)theEObject; T result = casedestinationProcessOutputFlow74(destinationProcessOutputFlow74); if (result == null) result = caseBindingAttribute(destinationProcessOutputFlow74); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SUPPLIER_ORDER_ON_STOCK_THRESHOLD81: { supplierOrderOnStockThreshold81 supplierOrderOnStockThreshold81 = (supplierOrderOnStockThreshold81)theEObject; T result = casesupplierOrderOnStockThreshold81(supplierOrderOnStockThreshold81); if (result == null) result = caseBindingAttribute(supplierOrderOnStockThreshold81); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.STORAGE_ORDER_ON_STOCK_THRESHOLD82: { storageOrderOnStockThreshold82 storageOrderOnStockThreshold82 = (storageOrderOnStockThreshold82)theEObject; T result = casestorageOrderOnStockThreshold82(storageOrderOnStockThreshold82); if (result == null) result = caseBindingAttribute(storageOrderOnStockThreshold82); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.STORAGE_OUTPUT_FLOW_CONVEYOR_BELT131: { storageOutputFlowConveyorBelt131 storageOutputFlowConveyorBelt131 = (storageOutputFlowConveyorBelt131)theEObject; T result = casestorageOutputFlowConveyorBelt131(storageOutputFlowConveyorBelt131); if (result == null) result = caseBindingAttribute(storageOutputFlowConveyorBelt131); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.DURATION_CONVEYOR_BELT132: { durationConveyorBelt132 durationConveyorBelt132 = (durationConveyorBelt132)theEObject; T result = casedurationConveyorBelt132(durationConveyorBelt132); if (result == null) result = caseBindingAttribute(durationConveyorBelt132); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.OUTPUT_CONVEYOR_BELT133: { outputConveyorBelt133 outputConveyorBelt133 = (outputConveyorBelt133)theEObject; T result = caseoutputConveyorBelt133(outputConveyorBelt133); if (result == null) result = caseBindingAttribute(outputConveyorBelt133); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NAME_QUERY: { nameQuery nameQuery = (nameQuery)theEObject; T result = casenameQuery(nameQuery); if (result == null) result = caseBindingAttribute(nameQuery); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.VALUE_QUERY: { valueQuery valueQuery = (valueQuery)theEObject; T result = casevalueQuery(valueQuery); if (result == null) result = caseBindingAttribute(valueQuery); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.ERROR_QUERY: { errorQuery errorQuery = (errorQuery)theEObject; T result = caseerrorQuery(errorQuery); if (result == null) result = caseBindingAttribute(errorQuery); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.TYPE_QUERY: { typeQuery typeQuery = (typeQuery)theEObject; T result = casetypeQuery(typeQuery); if (result == null) result = caseBindingAttribute(typeQuery); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SYSTEM_QUERY: { systemQuery systemQuery = (systemQuery)theEObject; T result = casesystemQuery(systemQuery); if (result == null) result = caseBindingAttribute(systemQuery); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NAME_STORAGE: { nameStorage nameStorage = (nameStorage)theEObject; T result = casenameStorage(nameStorage); if (result == null) result = caseBindingAttribute(nameStorage); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SIZE_STORAGE: { sizeStorage sizeStorage = (sizeStorage)theEObject; T result = casesizeStorage(sizeStorage); if (result == null) result = caseBindingAttribute(sizeStorage); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.INITIAL_CONTENT_STORAGE: { initialContentStorage initialContentStorage = (initialContentStorage)theEObject; T result = caseinitialContentStorage(initialContentStorage); if (result == null) result = caseBindingAttribute(initialContentStorage); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.OVERFLOW_STORAGE: { overflowStorage overflowStorage = (overflowStorage)theEObject; T result = caseoverflowStorage(overflowStorage); if (result == null) result = caseBindingAttribute(overflowStorage); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NAME_SUPPLIER: { nameSupplier nameSupplier = (nameSupplier)theEObject; T result = casenameSupplier(nameSupplier); if (result == null) result = caseBindingAttribute(nameSupplier); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.DELIVERED_PERCENTAGE_SUPPLIER: { deliveredPercentageSupplier deliveredPercentageSupplier = (deliveredPercentageSupplier)theEObject; T result = casedeliveredPercentageSupplier(deliveredPercentageSupplier); if (result == null) result = caseBindingAttribute(deliveredPercentageSupplier); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NAME_BATCH_PROCESS: { nameBatchProcess nameBatchProcess = (nameBatchProcess)theEObject; T result = casenameBatchProcess(nameBatchProcess); if (result == null) result = caseBindingAttribute(nameBatchProcess); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PERCENTAGE_OF_SUCCESS_BATCH_PROCESS: { percentageOfSuccessBatchProcess percentageOfSuccessBatchProcess = (percentageOfSuccessBatchProcess)theEObject; T result = casepercentageOfSuccessBatchProcess(percentageOfSuccessBatchProcess); if (result == null) result = caseBindingAttribute(percentageOfSuccessBatchProcess); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NUMBER_OF_CHAINS_BATCH_PROCESS: { numberOfChainsBatchProcess numberOfChainsBatchProcess = (numberOfChainsBatchProcess)theEObject; T result = casenumberOfChainsBatchProcess(numberOfChainsBatchProcess); if (result == null) result = caseBindingAttribute(numberOfChainsBatchProcess); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.TYPE_OUTPUT: { typeOutput typeOutput = (typeOutput)theEObject; T result = casetypeOutput(typeOutput); if (result == null) result = caseBindingAttribute(typeOutput); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.DESCRIPTION_OUTPUT: { descriptionOutput descriptionOutput = (descriptionOutput)theEObject; T result = casedescriptionOutput(descriptionOutput); if (result == null) result = caseBindingAttribute(descriptionOutput); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.PERIOD_ORDER_ON_STOCK_THRESHOLD: { periodOrderOnStockThreshold periodOrderOnStockThreshold = (periodOrderOnStockThreshold)theEObject; T result = caseperiodOrderOnStockThreshold(periodOrderOnStockThreshold); if (result == null) result = caseBindingAttribute(periodOrderOnStockThreshold); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.THRESHOLD_ORDER_ON_STOCK_THRESHOLD: { thresholdOrderOnStockThreshold thresholdOrderOnStockThreshold = (thresholdOrderOnStockThreshold)theEObject; T result = casethresholdOrderOnStockThreshold(thresholdOrderOnStockThreshold); if (result == null) result = caseBindingAttribute(thresholdOrderOnStockThreshold); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NAME_ORDER_ON_STOCK_THRESHOLD: { nameOrderOnStockThreshold nameOrderOnStockThreshold = (nameOrderOnStockThreshold)theEObject; T result = casenameOrderOnStockThreshold(nameOrderOnStockThreshold); if (result == null) result = caseBindingAttribute(nameOrderOnStockThreshold); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.ORDER_QUANTITY_ORDER_ON_STOCK_THRESHOLD: { orderQuantityOrderOnStockThreshold orderQuantityOrderOnStockThreshold = (orderQuantityOrderOnStockThreshold)theEObject; T result = caseorderQuantityOrderOnStockThreshold(orderQuantityOrderOnStockThreshold); if (result == null) result = caseBindingAttribute(orderQuantityOrderOnStockThreshold); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.ORDER_TYPE_ORDER_ON_STOCK_THRESHOLD: { orderTypeOrderOnStockThreshold orderTypeOrderOnStockThreshold = (orderTypeOrderOnStockThreshold)theEObject; T result = caseorderTypeOrderOnStockThreshold(orderTypeOrderOnStockThreshold); if (result == null) result = caseBindingAttribute(orderTypeOrderOnStockThreshold); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.VALUE_SCALAR: { valueScalar valueScalar = (valueScalar)theEObject; T result = casevalueScalar(valueScalar); if (result == null) result = caseBindingAttribute(valueScalar); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.LOCATION_GAUSSIAN: { locationGaussian locationGaussian = (locationGaussian)theEObject; T result = caselocationGaussian(locationGaussian); if (result == null) result = caseBindingAttribute(locationGaussian); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SCALE_GAUSSIAN: { scaleGaussian scaleGaussian = (scaleGaussian)theEObject; T result = casescaleGaussian(scaleGaussian); if (result == null) result = caseBindingAttribute(scaleGaussian); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.INTERVAL_POISSON: { intervalPoisson intervalPoisson = (intervalPoisson)theEObject; T result = caseintervalPoisson(intervalPoisson); if (result == null) result = caseBindingAttribute(intervalPoisson); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.MINIMUM_UNIFORM: { minimumUniform minimumUniform = (minimumUniform)theEObject; T result = caseminimumUniform(minimumUniform); if (result == null) result = caseBindingAttribute(minimumUniform); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.MAXIMUM_UNIFORM: { maximumUniform maximumUniform = (maximumUniform)theEObject; T result = casemaximumUniform(maximumUniform); if (result == null) result = caseBindingAttribute(maximumUniform); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NAME_CONVEYOR_BELT: { nameConveyorBelt nameConveyorBelt = (nameConveyorBelt)theEObject; T result = casenameConveyorBelt(nameConveyorBelt); if (result == null) result = caseBindingAttribute(nameConveyorBelt); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.MINIMAL_SEPARATION_BETWEEN_BATCHES_CONVEYOR_BELT: { minimalSeparationBetweenBatchesConveyorBelt minimalSeparationBetweenBatchesConveyorBelt = (minimalSeparationBetweenBatchesConveyorBelt)theEObject; T result = caseminimalSeparationBetweenBatchesConveyorBelt(minimalSeparationBetweenBatchesConveyorBelt); if (result == null) result = caseBindingAttribute(minimalSeparationBetweenBatchesConveyorBelt); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.NONE_ELEMENT: { NoneElement noneElement = (NoneElement)theEObject; T result = caseNoneElement(noneElement); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.BINDING_ELEMENT: { BindingElement bindingElement = (BindingElement)theEObject; T result = caseBindingElement(bindingElement); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.INTERMEDIATE_ELEMENT: { IntermediateElement intermediateElement = (IntermediateElement)theEObject; T result = caseIntermediateElement(intermediateElement); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.METAMODEL_ELEMENT: { MetamodelElement metamodelElement = (MetamodelElement)theEObject; T result = caseMetamodelElement(metamodelElement); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.METAMODEL_ELEMENT_FEATURE: { MetamodelElementFeature metamodelElementFeature = (MetamodelElementFeature)theEObject; T result = caseMetamodelElementFeature(metamodelElementFeature); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.BINDING_ATTRIBUTE: { BindingAttribute bindingAttribute = (BindingAttribute)theEObject; T result = caseBindingAttribute(bindingAttribute); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.VIRTUAL_ATTRIBUTE: { VirtualAttribute virtualAttribute = (VirtualAttribute)theEObject; T result = caseVirtualAttribute(virtualAttribute); if (result == null) result = defaultCase(theEObject); return result; } case Metamodel_bdslPackage.SIRIUS_TAG: { SiriusTag siriusTag = (SiriusTag)theEObject; T result = caseSiriusTag(siriusTag); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Model</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Model</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseModel(Model object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Query</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseQuery(Query object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Storage</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Storage</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseStorage(Storage object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Supplier</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Supplier</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSupplier(Supplier object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Batch Process</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Batch Process</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBatchProcess(BatchProcess object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Output</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Output</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseOutput(Output object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Storage Output Flow</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Storage Output Flow</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseStorageOutputFlow(StorageOutputFlow object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Process Output Flow</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Process Output Flow</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseProcessOutputFlow(ProcessOutputFlow object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Process</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Process</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseProcess(metamodel_bdsl.Process object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Order On Stock Threshold</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Order On Stock Threshold</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseOrderOnStockThreshold(OrderOnStockThreshold object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Component</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Component</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseComponent(Component object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Flow</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Flow</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseFlow(Flow object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Probability</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Probability</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseProbability(Probability object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Distribution</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Distribution</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseDistribution(Distribution object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Scalar</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Scalar</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseScalar(Scalar object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Gaussian</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Gaussian</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseGaussian(Gaussian object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Poisson</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Poisson</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casePoisson(Poisson object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Uniform</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Uniform</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseUniform(Uniform object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Conveyor Belt</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Conveyor Belt</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseConveyorBelt(ConveyorBelt object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>storage Output Flow Storage21</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>storage Output Flow Storage21</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casestorageOutputFlowStorage21(storageOutputFlowStorage21 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>order On Stock Threshold Storage22</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>order On Stock Threshold Storage22</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseorderOnStockThresholdStorage22(orderOnStockThresholdStorage22 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>process Output Flow Storage23</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>process Output Flow Storage23</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseprocessOutputFlowStorage23(processOutputFlowStorage23 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>refill Policy Supplier31</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>refill Policy Supplier31</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caserefillPolicySupplier31(refillPolicySupplier31 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>supplier Delay Supplier32</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>supplier Delay Supplier32</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casesupplierDelaySupplier32(supplierDelaySupplier32 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>storage Output Flow Batch Process41</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>storage Output Flow Batch Process41</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casestorageOutputFlowBatchProcess41(storageOutputFlowBatchProcess41 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>duration Batch Process42</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>duration Batch Process42</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casedurationBatchProcess42(durationBatchProcess42 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>outputs Batch Process43</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>outputs Batch Process43</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseoutputsBatchProcess43(outputsBatchProcess43 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>process Output Flow Output51</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>process Output Flow Output51</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseprocessOutputFlowOutput51(processOutputFlowOutput51 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>quantity Storage Output Flow61</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>quantity Storage Output Flow61</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casequantityStorageOutputFlow61(quantityStorageOutputFlow61 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>source Storage Output Flow62</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>source Storage Output Flow62</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casesourceStorageOutputFlow62(sourceStorageOutputFlow62 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>destination Storage Output Flow63</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>destination Storage Output Flow63</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casedestinationStorageOutputFlow63(destinationStorageOutputFlow63 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>quantity Process Output Flow71</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>quantity Process Output Flow71</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casequantityProcessOutputFlow71(quantityProcessOutputFlow71 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>source Process Output Flow72</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>source Process Output Flow72</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casesourceProcessOutputFlow72(sourceProcessOutputFlow72 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>process Output Flow Delay Process Output Flow73</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>process Output Flow Delay Process Output Flow73</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseprocessOutputFlowDelayProcessOutputFlow73(processOutputFlowDelayProcessOutputFlow73 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>destination Process Output Flow74</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>destination Process Output Flow74</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casedestinationProcessOutputFlow74(destinationProcessOutputFlow74 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>supplier Order On Stock Threshold81</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>supplier Order On Stock Threshold81</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casesupplierOrderOnStockThreshold81(supplierOrderOnStockThreshold81 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>storage Order On Stock Threshold82</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>storage Order On Stock Threshold82</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casestorageOrderOnStockThreshold82(storageOrderOnStockThreshold82 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>storage Output Flow Conveyor Belt131</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>storage Output Flow Conveyor Belt131</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casestorageOutputFlowConveyorBelt131(storageOutputFlowConveyorBelt131 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>duration Conveyor Belt132</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>duration Conveyor Belt132</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casedurationConveyorBelt132(durationConveyorBelt132 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>output Conveyor Belt133</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>output Conveyor Belt133</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseoutputConveyorBelt133(outputConveyorBelt133 object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>name Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>name Query</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casenameQuery(nameQuery object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>value Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>value Query</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casevalueQuery(valueQuery object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>error Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>error Query</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseerrorQuery(errorQuery object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>type Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>type Query</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casetypeQuery(typeQuery object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>system Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>system Query</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casesystemQuery(systemQuery object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>name Storage</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>name Storage</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casenameStorage(nameStorage object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>size Storage</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>size Storage</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casesizeStorage(sizeStorage object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>initial Content Storage</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>initial Content Storage</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseinitialContentStorage(initialContentStorage object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>overflow Storage</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>overflow Storage</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseoverflowStorage(overflowStorage object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>name Supplier</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>name Supplier</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casenameSupplier(nameSupplier object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>delivered Percentage Supplier</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>delivered Percentage Supplier</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casedeliveredPercentageSupplier(deliveredPercentageSupplier object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>name Batch Process</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>name Batch Process</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casenameBatchProcess(nameBatchProcess object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>percentage Of Success Batch Process</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>percentage Of Success Batch Process</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casepercentageOfSuccessBatchProcess(percentageOfSuccessBatchProcess object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>number Of Chains Batch Process</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>number Of Chains Batch Process</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casenumberOfChainsBatchProcess(numberOfChainsBatchProcess object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>type Output</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>type Output</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casetypeOutput(typeOutput object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>description Output</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>description Output</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casedescriptionOutput(descriptionOutput object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>period Order On Stock Threshold</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>period Order On Stock Threshold</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseperiodOrderOnStockThreshold(periodOrderOnStockThreshold object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>threshold Order On Stock Threshold</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>threshold Order On Stock Threshold</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casethresholdOrderOnStockThreshold(thresholdOrderOnStockThreshold object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>name Order On Stock Threshold</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>name Order On Stock Threshold</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casenameOrderOnStockThreshold(nameOrderOnStockThreshold object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>order Quantity Order On Stock Threshold</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>order Quantity Order On Stock Threshold</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseorderQuantityOrderOnStockThreshold(orderQuantityOrderOnStockThreshold object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>order Type Order On Stock Threshold</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>order Type Order On Stock Threshold</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseorderTypeOrderOnStockThreshold(orderTypeOrderOnStockThreshold object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>value Scalar</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>value Scalar</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casevalueScalar(valueScalar object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>location Gaussian</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>location Gaussian</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caselocationGaussian(locationGaussian object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>scale Gaussian</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>scale Gaussian</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casescaleGaussian(scaleGaussian object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>interval Poisson</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>interval Poisson</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseintervalPoisson(intervalPoisson object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>minimum Uniform</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>minimum Uniform</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseminimumUniform(minimumUniform object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>maximum Uniform</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>maximum Uniform</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casemaximumUniform(maximumUniform object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>name Conveyor Belt</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>name Conveyor Belt</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T casenameConveyorBelt(nameConveyorBelt object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>minimal Separation Between Batches Conveyor Belt</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>minimal Separation Between Batches Conveyor Belt</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseminimalSeparationBetweenBatchesConveyorBelt(minimalSeparationBetweenBatchesConveyorBelt object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>None Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>None Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseNoneElement(NoneElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Binding Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Binding Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindingElement(BindingElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Intermediate Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Intermediate Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseIntermediateElement(IntermediateElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Metamodel Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Metamodel Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMetamodelElement(MetamodelElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Metamodel Element Feature</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Metamodel Element Feature</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseMetamodelElementFeature(MetamodelElementFeature object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Binding Attribute</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Binding Attribute</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindingAttribute(BindingAttribute object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Virtual Attribute</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Virtual Attribute</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseVirtualAttribute(VirtualAttribute object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Sirius Tag</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Sirius Tag</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseSiriusTag(SiriusTag object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch, but this is the last case anyway. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>EObject</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ @Override public T defaultCase(EObject object) { return null; } } //Metamodel_bdslSwitch
jesusc/bento
tests/test-outputs/bento.sirius.tests.metamodels.output/src/metamodel_bdsl/util/Metamodel_bdslSwitch.java
Java
epl-1.0
76,608
/* * Copyright 2012 PRODYNA AG * * Licensed under the Eclipse Public License (EPL), Version 1.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.opensource.org/licenses/eclipse-1.0.php or * http://www.nabucco.org/License.html * * 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.nabucco.business.address.facade.message; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.nabucco.business.address.facade.datatype.PhoneAddress; import org.nabucco.framework.base.facade.datatype.collection.NabuccoCollectionState; import org.nabucco.framework.base.facade.datatype.collection.NabuccoList; import org.nabucco.framework.base.facade.datatype.collection.NabuccoListImpl; import org.nabucco.framework.base.facade.datatype.property.NabuccoProperty; import org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyContainer; import org.nabucco.framework.base.facade.datatype.property.NabuccoPropertyDescriptor; import org.nabucco.framework.base.facade.datatype.property.PropertyAssociationType; import org.nabucco.framework.base.facade.datatype.property.PropertyCache; import org.nabucco.framework.base.facade.datatype.property.PropertyDescriptorSupport; import org.nabucco.framework.base.facade.message.ServiceMessage; import org.nabucco.framework.base.facade.message.ServiceMessageSupport; /** * PhoneAddressListMsg<p/>Default message for list of PhoneAddress datatype<p/> * * @version 1.0 * @author Dominic Trumpfheller, PRODYNA AG, 2010-12-20 */ public class PhoneAddressListMsg extends ServiceMessageSupport implements ServiceMessage { private static final long serialVersionUID = 1L; private static final String[] PROPERTY_CONSTRAINTS = { "m0,n;" }; public static final String PHONEADDRESSLIST = "phoneAddressList"; private NabuccoList<PhoneAddress> phoneAddressList; /** Constructs a new PhoneAddressListMsg instance. */ public PhoneAddressListMsg() { super(); this.initDefaults(); } /** InitDefaults. */ private void initDefaults() { } /** * CreatePropertyContainer. * * @return the NabuccoPropertyContainer. */ protected static NabuccoPropertyContainer createPropertyContainer() { Map<String, NabuccoPropertyDescriptor> propertyMap = new HashMap<String, NabuccoPropertyDescriptor>(); propertyMap.put(PHONEADDRESSLIST, PropertyDescriptorSupport.createCollection(PHONEADDRESSLIST, PhoneAddress.class, 0, PROPERTY_CONSTRAINTS[0], false, PropertyAssociationType.COMPOSITION)); return new NabuccoPropertyContainer(propertyMap); } /** Init. */ public void init() { this.initDefaults(); } @Override public Set<NabuccoProperty> getProperties() { Set<NabuccoProperty> properties = super.getProperties(); properties.add(super.createProperty(PhoneAddressListMsg.getPropertyDescriptor(PHONEADDRESSLIST), this.phoneAddressList)); return properties; } @Override @SuppressWarnings("unchecked") public boolean setProperty(NabuccoProperty property) { if (super.setProperty(property)) { return true; } if ((property.getName().equals(PHONEADDRESSLIST) && (property.getType() == PhoneAddress.class))) { this.phoneAddressList = ((NabuccoList<PhoneAddress>) property.getInstance()); return true; } return false; } @Override public boolean equals(Object obj) { if ((this == obj)) { return true; } if ((obj == null)) { return false; } if ((this.getClass() != obj.getClass())) { return false; } if ((!super.equals(obj))) { return false; } final PhoneAddressListMsg other = ((PhoneAddressListMsg) obj); if ((this.phoneAddressList == null)) { if ((other.phoneAddressList != null)) return false; } else if ((!this.phoneAddressList.equals(other.phoneAddressList))) return false; return true; } @Override public int hashCode() { final int PRIME = 31; int result = super.hashCode(); result = ((PRIME * result) + ((this.phoneAddressList == null) ? 0 : this.phoneAddressList.hashCode())); return result; } @Override public ServiceMessage cloneObject() { return this; } /** * Missing description at method getPhoneAddressList. * * @return the NabuccoList<PhoneAddress>. */ public NabuccoList<PhoneAddress> getPhoneAddressList() { if ((this.phoneAddressList == null)) { this.phoneAddressList = new NabuccoListImpl<PhoneAddress>(NabuccoCollectionState.INITIALIZED); } return this.phoneAddressList; } /** * Getter for the PropertyDescriptor. * * @param propertyName the String. * @return the NabuccoPropertyDescriptor. */ public static NabuccoPropertyDescriptor getPropertyDescriptor(String propertyName) { return PropertyCache.getInstance().retrieve(PhoneAddressListMsg.class).getProperty(propertyName); } /** * Getter for the PropertyDescriptorList. * * @return the List<NabuccoPropertyDescriptor>. */ public static List<NabuccoPropertyDescriptor> getPropertyDescriptorList() { return PropertyCache.getInstance().retrieve(PhoneAddressListMsg.class).getAllProperties(); } }
NABUCCO/org.nabucco.business.address
org.nabucco.business.address.facade.message/src/main/gen/org/nabucco/business/address/facade/message/PhoneAddressListMsg.java
Java
epl-1.0
6,075
/******************************************************************************* * Copyright (c) 1997, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package com.ibm.ws.threading.internal; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import com.ibm.ejs.ras.Tr; import com.ibm.ejs.ras.TraceComponent; import com.ibm.ws.kernel.service.util.CpuInfo; /** * A fixed size FIFO (with expedited) of Objects. Null objects are not allowed in * the buffer. The buffer contains a expedited FIFO buffer, whose objects * will be removed before objects in the main buffer. */ public class BoundedBuffer<T> implements BlockingQueue<T> { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Implementation Note: the buffer is implemented using a circular // array. Both a "head" and "tail" pointer (array index) are // maintained as well as an overall count of used/empty // slots: // // [TEM]: I do not know why both used and empty slot counts are // maintained given that one can be derived from the other // and the capacity. I suspect it is so that the two // values can vary on independent threads. // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // BoundedBuffer's locking model is a little more complicated than it // appears at first glance and the reasons for this are somewhat subtle. // // There are two 'locks' involved: the BoundedBuffer instance itself // and the Object instance named lock. Synchronizing on this i.e. the // BoundedBuffer instance is used to single thread take operations and // the used slots counter. Synchronizing on lock is used to single // thread put operations and the empty slots counter. // // It's easiest to explain the need for two separate locks by explaining // a problem that can arise by only using a single lock. Consider a buffer // with a capacity of two that is currently full - two consecutive put // calls have been made and all threads attempting puts are now in a wait() // call until some space is freed up in the buffer by a take. Another thread // calls the buffer and performs a take which will trigger a notify. If the // thread that is notified is a taking thread another take will occur. This // take will empty the buffer and triggering another notify. If the thread // that is notified here is another taking thread a hang will occur - the // buffer is empty so it and any subsequent take calls will drop into a // wait() until a put occurs. No more notify() calls will be made leaving // the taking threads stuck in wait() awaiting a put and the putting threads // stuck in wait() awaiting a notify from a successful take which can never // occur as the buffer's empty. // // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // D638088.2 private static TraceComponent tc = Tr.register(BoundedBuffer.class); /* * Maged: * These modifications are for the purpose of: * - increasing concurrency * - reduce latency * - fix a race condition between the expand and put functions * Outline: * - The buffer size is disassociated from the locks * - numberOfUsedSlots is declared AtomicInteger and updated atomically * without locking * - numberOfEmptySlots is not needed * - Wait-notify is replaced with polling * - Lock holding periods are minimized * - Put/Take operations acquire one lock and update numberOfUsedSlots * atomically instead of acquiring two locks * - The expand operation acquires both locks * Christoph: * - queueing putters and getters separately on locks that are different * from 'this' and 'lock' * - benign races on XXQueueLen_ at notify * - spinning with backoff */ // D312598 - begin private static final int SPINS_TAKE_; private static final int SPINS_PUT_; private static final boolean YIELD_TAKE_; private static final boolean YIELD_PUT_; //D638088 - modified the set of WAIT_SLICE parameters private static final long WAIT_SHORT_SLICE_; static { //D638088 - modified spinning defaults to adjust to the number //of physical processors on host system. SPINS_TAKE_ = Integer.getInteger("com.ibm.ws.util.BoundedBuffer.spins_take", CpuInfo.getAvailableProcessors() - 1).intValue(); // D371967 SPINS_PUT_ = Integer.getInteger("com.ibm.ws.util.BoundedBuffer.spins_put", SPINS_TAKE_ / 4).intValue(); // D371967 YIELD_TAKE_ = Boolean.getBoolean("com.ibm.ws.util.BoundedBuffer.yield_take"); YIELD_PUT_ = Boolean.getBoolean("com.ibm.ws.util.BoundedBuffer.yield_put"); //D638088 - created short/long wait periods, based on a multiplication factor. Keeping //default behavior the same. WAIT_SHORT_SLICE_ = Long.getLong("com.ibm.ws.util.BoundedBuffer.wait", 1000).longValue(); // D371967 } private static ConcurrentLinkedQueue<GetQueueLock> waitingThreadLocks = new ConcurrentLinkedQueue<GetQueueLock>(); private static final ThreadLocal<GetQueueLock> threadLocalGetLock = new ThreadLocal<GetQueueLock>() { @Override protected GetQueueLock initialValue() { return new GetQueueLock(); } }; // D371967: An easily-identified marker class used for locking private static class PutQueueLock extends Object {} private final PutQueueLock putQueue_ = new PutQueueLock(); private int putQueueLen_ = 0; // D638088: Added two fields to the getQueueLock for book keeping // D371967: An easily-identified marker class used for locking private static class GetQueueLock extends Object { private boolean notified; public boolean isNotified() { return notified; } public void setNotified(boolean notified) { this.notified = notified; } } private void notifyGet_() { // Notify a waiting thread that work has arrived on the queue. A notification may be lost in some cases - however as none of the // threads wait endlessly, a waiting thread will either be notified, or will eventually wake up. If there are no waiting threads, // the new work will be picked up when an active thread completes its task. GetQueueLock lock = waitingThreadLocks.poll(); if (lock != null) { synchronized (lock) { lock.setNotified(true); lock.notify(); } } } private void waitGet_(long timeout) throws InterruptedException { GetQueueLock getQueueLock = threadLocalGetLock.get(); try { synchronized (getQueueLock) { getQueueLock.setNotified(false); waitingThreadLocks.add(getQueueLock); getQueueLock.wait(timeout == -1 ? 0 : timeout); } } finally { if (!getQueueLock.isNotified()) { // we either timed out or were interrupted, so remove ourselves from the queue... it's okay if a producer already has the // lock because we're going to exit and go try to get more work anyway, so it's okay if we don't get the signal waitingThreadLocks.remove(getQueueLock); } } } private void notifyPut_() { // As in notifyGet_, this notification might be lost. if (putQueueLen_ > 0) { synchronized (putQueue_) { putQueue_.notify(); } } } private void waitPut_(long timeout) throws InterruptedException { synchronized (putQueue_) { try { putQueueLen_++; // D497382 - As in waitGet_, try to avoid lost notifications. if (numberOfUsedSlots.get() >= buffer.length) { // notification through notifyPut_ may be lost here putQueue_.wait(timeout); } // } catch (InterruptedException ex) { // putQueue_.notify(); // throw ex; } finally { putQueueLen_--; } } } // D312598 - end private T[] buffer; // the circular array (buffer) private T[] expeditedBuffer; // the circular expedited array (expedited buffer) private int takeIndex = 0; // the beginning of the buffer private int expeditedTakeIndex = 0; // the beginning of the expedited buffer private int putIndex = 0; // the end of the buffer private int expeditedPutIndex = 0; // the end of the expedited buffer private final AtomicInteger numberOfUsedSlots = new AtomicInteger(0); // D312598 D638088 private final AtomicInteger numberOfUsedExpeditedSlots = new AtomicInteger(0); /** * Helper monitor to handle puts. */ private final BoundedBufferLock lock = new BoundedBufferLock(); //@awisniew DELETED //private ThreadPool threadPool_ = null; // this can be null, only non null when this threadpool supports thread renewal /** * Create a BoundedBuffer with the given capacity. * * @exception IllegalArgumentException if the requested capacity * is less or equal to zero. */ @SuppressWarnings("unchecked") public BoundedBuffer(Class<T> c, int capacity, int expeditedCapacity) throws IllegalArgumentException { if (capacity <= 0 || expeditedCapacity <= 0) { throw new IllegalArgumentException(); } //Initialize buffer array final T[] buffer = (T[]) Array.newInstance(c, capacity); this.buffer = buffer; //Initialize expedited buffer array final T[] expeditedBuffer = (T[]) Array.newInstance(c, expeditedCapacity); this.expeditedBuffer = expeditedBuffer; //enable debug output if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Created bounded buffer: capacity=" + capacity + " expedited capacity=" + expeditedCapacity); } } /** * Return the number of elements in the buffer. * This is only a snapshot value, that may change * immediately after returning. */ // D312598 - remove synchronization and use .get @Override public int size() { return numberOfUsedSlots.get() + numberOfUsedExpeditedSlots.get(); } /** * Returns the overall capacity of the buffer. * Note that this is how much the buffer can hold, * not how much space is unused. */ public int capacity() { return buffer.length + expeditedBuffer.length; } /* * @awisniew - ADDED * * The number of unused slots. * * @see java.util.concurrent.BlockingQueue#remainingCapacity() */ @Override public int remainingCapacity() { return capacity() - size(); } /* * @awisniew - ADDED * * @see java.util.Collection#isEmpty() */ @Override public boolean isEmpty() { if (size() == 0) { return true; } return false; } /** * Peeks at the head of the buffer and returns the first * object (or null if empty). The object remains in the * buffer. */ @Override public T peek() { synchronized (this) { if (numberOfUsedExpeditedSlots.get() > 0) { return expeditedBuffer[expeditedTakeIndex]; } else if (numberOfUsedSlots.get() > 0) { return buffer[takeIndex]; } else { return null; } } } /* * @awisniew - ADDED * * Same as peek, only throws exception if queue is empty * * @see java.util.Queue#element() */ @Override public T element() { T retrievedElement = peek(); if (retrievedElement == null) { throw new NoSuchElementException(); } return retrievedElement; } /** * Puts an object into the buffer. If the buffer is full, * the call will block indefinitely until space is freed up. * * @param x the object being placed in the buffer. * @exception IllegalArgumentException if the object is null. */ @Override public void put(T t) throws InterruptedException { if (t == null) { throw new IllegalArgumentException(); } // D186845 if (Thread.interrupted()) // D186845 throw new InterruptedException(); // D312598 - begin //TODO: Add expedited put/fix waiting logic boolean ret = false; while (true) { synchronized (lock) { if (numberOfUsedSlots.get() < buffer.length) { insert(t); numberOfUsedSlots.getAndIncrement(); ret = true; } } if (ret) { notifyGet_(); return; } int spinctr = SPINS_PUT_; while (numberOfUsedSlots.get() >= buffer.length) { // busy wait if (spinctr > 0) { if (YIELD_PUT_) Thread.yield(); spinctr--; } else { // block on lock waitPut_(WAIT_SHORT_SLICE_); } } } // D312598 - end } /** * Puts an object into the buffer. If the buffer is full, * the call will block for up to the specified timeout * period. * * @param x the object being placed in the buffer. * @param timeoutInMillis the timeout period in milliseconds. * @return the object that was put into the buffer (t) or * null in the event that the request timed out. * @exception IllegalArgumentException if the object is null. */ public T put(T t, long timeoutInMillis) throws InterruptedException { if (t == null) { throw new IllegalArgumentException(); } //TODO: Add expedited put/fix waiting logic long start = (timeoutInMillis <= 0) ? 0 : -1; long waitTime = timeoutInMillis; // D312598 - begin T ret = null; while (true) { synchronized (lock) { if (numberOfUsedSlots.get() < buffer.length) { insert(t); numberOfUsedSlots.getAndIncrement(); ret = t; } } if (ret != null) { notifyGet_(); return ret; } if (start == -1) start = System.currentTimeMillis(); int spinctr = SPINS_PUT_; while (numberOfUsedSlots.get() >= buffer.length) { if (waitTime <= 0) { return null; } // busy wait if (spinctr > 0) { if (YIELD_PUT_) Thread.yield(); spinctr--; } else { // block on lock waitPut_(timeoutInMillis); } waitTime = timeoutInMillis - (System.currentTimeMillis() - start); } } // D312598 - end } /** * Puts an object into the buffer. If the buffer is at or above the * specified maximum capacity, the call will block for up to the * specified timeout period. * * @param x the object being placed in the buffer. * @param timeoutInMillis the timeout period in milliseconds. * @param maximumCapacity the desired maximum capacity of the buffer * @return the object that was put into the buffer (x) or * null in the event that the request timed out. * @exception IllegalArgumentException if the object is null or if the * supplied maximum capacity exceeds the buffer's size. */ public T put(T t, long timeoutInMillis, int maximumCapacity) throws InterruptedException { if ((t == null) || (maximumCapacity > buffer.length)) { throw new IllegalArgumentException(); } long start = (timeoutInMillis <= 0) ? 0 : -1; long waitTime = timeoutInMillis; //TODO: Add expedited put/fix waiting logic // D312598 - begin T ret = null; while (true) { synchronized (lock) { if (numberOfUsedSlots.get() < maximumCapacity) { insert(t); numberOfUsedSlots.getAndIncrement(); ret = t; } } if (ret != null) { notifyGet_(); return ret; } if (start == -1) start = System.currentTimeMillis(); int spinctr = SPINS_PUT_; while (numberOfUsedSlots.get() >= buffer.length) { if (waitTime <= 0) { return null; } // busy wait if (spinctr > 0) { if (YIELD_PUT_) Thread.yield(); spinctr--; } else { // block on lock waitPut_(timeoutInMillis); } waitTime = timeoutInMillis - (System.currentTimeMillis() - start); } } // D312598 - end } /** * Puts an object into the buffer. If the buffer is full, * the call will block for up to the specified amount of * time, waiting for space to be freed up. * * @param x the object being placed into the buffer. * @param timeout the maximum amount of time * that the caller is willing to wait if the buffer is full. * @return true if the object was added to the buffer; false if * it was not added before the timeout expired. */ @Override public boolean offer(T t, long timeout, TimeUnit unit) throws InterruptedException { if (t == null) { throw new IllegalArgumentException(); } //TODO: Add expedited offer/fix waiting logic // D220640: Next two lines pulled out of synchronization block: long timeoutMS = unit.toMillis(timeout); long start = (timeoutMS <= 0) ? 0 : -1; long waitTime = timeoutMS; // D312598 - begin boolean ret = false; while (true) { synchronized (lock) { if (numberOfUsedSlots.get() < buffer.length) { insert(t); numberOfUsedSlots.getAndIncrement(); ret = true; } } if (ret) { notifyGet_(); return true; } if (start == -1) start = System.currentTimeMillis(); int spinctr = SPINS_PUT_; while (numberOfUsedSlots.get() >= buffer.length) { if (waitTime <= 0) { return false; } // busy wait if (spinctr > 0) { if (YIELD_PUT_) Thread.yield(); spinctr--; } else { // block on lock waitPut_(waitTime); } waitTime = timeoutMS - (System.currentTimeMillis() - start); } } // D312598 - end } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.concurrent.BlockingQueue#offer(java.lang.Object) */ @Override public boolean offer(T t) { if (t == null) { throw new IllegalArgumentException(); } boolean ret = false; synchronized (lock) { if (t instanceof QueueItem && ((QueueItem) t).isExpedited()) { if (numberOfUsedExpeditedSlots.get() < expeditedBuffer.length) { expeditedInsert(t); numberOfUsedExpeditedSlots.getAndIncrement(); ret = true; } } else { if (numberOfUsedSlots.get() < buffer.length) { insert(t); numberOfUsedSlots.getAndIncrement(); ret = true; } } } if (ret) { notifyGet_(); return true; } return false; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.concurrent.BlockingQueue#add(java.lang.Object) */ @Override public boolean add(T t) { if (offer(t)) return true; else throw new IllegalStateException("Queue full"); } /** * Removes an object from the buffer. If the buffer is * empty, then the call blocks until something becomes * available. * * @return Object the next object from the buffer. */ @Override public T take() throws InterruptedException { T old = poll(); while (old == null) { waitGet_(-1); old = poll(); } return old; } /** * Removes an object from the buffer. If the buffer is empty, the call blocks for up to * a specified amount of time before it gives up. * * @param timeout - * the amount of time, that the caller is willing to wait * in the event of an empty buffer. * @param unit - * the unit of time */ @Override public T poll(long timeout, TimeUnit unit) throws InterruptedException { T old = poll(); long endTimeMillis = System.currentTimeMillis() + unit.toMillis(timeout); long timeLeftMillis = endTimeMillis - System.currentTimeMillis(); int spinctr = SPINS_TAKE_; while (old == null && timeLeftMillis > 0) { while (size() <= 0 && timeLeftMillis > 0) { if (spinctr > 0) { // busy wait if (YIELD_TAKE_) Thread.yield(); spinctr--; } else { // block on lock waitGet_(timeLeftMillis); } timeLeftMillis = endTimeMillis - System.currentTimeMillis(); } old = poll(); timeLeftMillis = endTimeMillis - System.currentTimeMillis(); } return old; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Queue#poll() */ @Override public T poll() { T old = null; boolean expedited = false; synchronized (this) { if (numberOfUsedExpeditedSlots.get() > 0) { old = expeditedExtract(); numberOfUsedExpeditedSlots.getAndDecrement(); expedited = true; } else if (numberOfUsedSlots.get() > 0) { old = extract(); numberOfUsedSlots.getAndDecrement(); } } if (old != null) { //TODO if expedited is added for put or offer with timeout add notification here if (!expedited) notifyPut_(); } return old; } /* * @awisniew - ADDED * * Same as poll, only throws exception if queue is empty * * @see java.util.Queue#remove() */ @Override public T remove() { T retrievedElement = poll(); if (retrievedElement == null) { throw new NoSuchElementException(); } return retrievedElement; } /** * Inserts an object into the buffer. Note that * since there is no synchronization, it is assumed * that this is done outside the scope of this call. */ private final void insert(T t) { buffer[putIndex] = t; if (++putIndex >= buffer.length) { putIndex = 0; } } /** * Inserts an object into the expeditedBuffer. Note that * since there is no synchronization, it is assumed * that this is done outside the scope of this call. */ private final void expeditedInsert(T t) { expeditedBuffer[expeditedPutIndex] = t; if (++expeditedPutIndex >= expeditedBuffer.length) { expeditedPutIndex = 0; } } /** * Removes an object from the buffer. Note that * since there is no synchronization, it is assumed * that this is done outside the scope of this call. */ private final T extract() { T old = buffer[takeIndex]; buffer[takeIndex] = null; if (++takeIndex >= buffer.length) takeIndex = 0; return old; } /** * Removes an object from the expeditedBuffer. Note that * since there is no synchronization, it is assumed * that this is done outside the scope of this call. */ private final T expeditedExtract() { T old = expeditedBuffer[expeditedTakeIndex]; expeditedBuffer[expeditedTakeIndex] = null; if (++expeditedTakeIndex >= expeditedBuffer.length) expeditedTakeIndex = 0; return old; } /** * Increases the buffer's capacity by the given amount. * * @param additionalCapacity * The amount by which the buffer's capacity should be increased. */ @SuppressWarnings("unchecked") public synchronized void expand(int additionalCapacity) { if (additionalCapacity <= 0) { throw new IllegalArgumentException(); } int capacityBefore = buffer.length; synchronized (lock) { // D312598 int capacityAfter = buffer.length; //Check that no one was expanding while we waited on this lock if (capacityAfter == capacityBefore) { final Object[] newBuffer = new Object[buffer.length + additionalCapacity]; // PK53203 - put() acquires two locks in sequence. First, it acquires // the insert lock to update putIndex. Then, it drops the insert lock // and acquires the extract lock to update numberOfUsedSlots. As a // result, there is a window where putIndex has been updated, but // numberOfUsedSlots has not. Consequently, even though we have // acquired both locks in this method, we cannot rely on the values in // numberOfUsedSlots; we can only rely on putIndex and takeIndex. if (putIndex > takeIndex) { // The contents of the buffer do not wrap round // the end of the array. We can move its contents // into the new expanded buffer in one go. int used = putIndex - takeIndex; System.arraycopy(buffer, takeIndex, newBuffer, 0, used); putIndex = used; // PK53203.1 - If putIndex == takeIndex, then the buffer is either // completely full or completely empty. If it is completely full, then // we need to copy and adjust putIndex. Otherwise, we need to set // putIndex to 0. } else if (putIndex != takeIndex || buffer[takeIndex] != null) { // The contents of the buffer wrap round the end // of the array. We have to perform two copies to // move its contents into the new buffer. int used = buffer.length - takeIndex; System.arraycopy(buffer, takeIndex, newBuffer, 0, used); System.arraycopy(buffer, 0, newBuffer, used, putIndex); putIndex += used; } else { putIndex = 0; } // The contents of the buffer now begin at 0 - update the head pointer. takeIndex = 0; // The buffer's capacity has been increased so update the count of the // empty slots to reflect this. buffer = (T[]) newBuffer; } } // D312598 } /** * Increases the expedited buffer's capacity by the given amount. * * @param additionalCapacity * The amount by which the expedited buffer's capacity should be increased. */ @SuppressWarnings("unchecked") public synchronized void expandExpedited(int additionalCapacity) { if (additionalCapacity <= 0) { throw new IllegalArgumentException(); } int capacityBefore = expeditedBuffer.length; synchronized (lock) { // D312598 int capacityAfter = expeditedBuffer.length; //Check that no one was expanding while we waited on this lock if (capacityAfter == capacityBefore) { final Object[] newBuffer = new Object[expeditedBuffer.length + additionalCapacity]; // PK53203 - put() acquires two locks in sequence. First, it acquires // the insert lock to update putIndex. Then, it drops the insert lock // and acquires the extract lock to update numberOfUsedSlots. As a // result, there is a window where putIndex has been updated, but // numberOfUsedSlots has not. Consequently, even though we have // acquired both locks in this method, we cannot rely on the values in // numberOfUsedSlots; we can only rely on putIndex and takeIndex. if (expeditedPutIndex > expeditedTakeIndex) { // The contents of the buffer do not wrap round // the end of the array. We can move its contents // into the new expanded buffer in one go. int used = expeditedPutIndex - expeditedTakeIndex; System.arraycopy(expeditedBuffer, expeditedTakeIndex, newBuffer, 0, used); expeditedPutIndex = used; // PK53203.1 - If putIndex == takeIndex, then the buffer is either // completely full or completely empty. If it is completely full, then // we need to copy and adjust putIndex. Otherwise, we need to set // putIndex to 0. } else if (expeditedPutIndex != expeditedTakeIndex || expeditedBuffer[expeditedTakeIndex] != null) { // The contents of the buffer wrap round the end // of the array. We have to perform two copies to // move its contents into the new buffer. int used = expeditedBuffer.length - expeditedTakeIndex; System.arraycopy(expeditedBuffer, expeditedTakeIndex, newBuffer, 0, used); System.arraycopy(expeditedBuffer, 0, newBuffer, used, expeditedPutIndex); expeditedPutIndex += used; } else { expeditedPutIndex = 0; } // The contents of the buffer now begin at 0 - update the head pointer. expeditedTakeIndex = 0; // The buffer's capacity has been increased so update the count of the // empty slots to reflect this. expeditedBuffer = (T[]) newBuffer; } } // D312598 } private static class BoundedBufferLock extends Object { // An easily-identified marker class used for locking } // F743-11444 - New method // F743-12896 - Start protected synchronized boolean cancel(Object x) { // First check the expedited buffer synchronized (lock) { if (expeditedPutIndex > expeditedTakeIndex) { for (int i = expeditedTakeIndex; i < expeditedPutIndex; i++) { if (expeditedBuffer[i] == x) { System.arraycopy(expeditedBuffer, i + 1, expeditedBuffer, i, expeditedPutIndex - i - 1); expeditedPutIndex--; expeditedBuffer[expeditedPutIndex] = null; numberOfUsedExpeditedSlots.getAndDecrement(); // D615053 return true; } } } else if (expeditedPutIndex != expeditedTakeIndex || expeditedBuffer[expeditedTakeIndex] != null) { for (int i = expeditedTakeIndex; i < buffer.length; i++) { if (expeditedBuffer[i] == x) { if (i != expeditedBuffer.length - 1) { System.arraycopy(expeditedBuffer, i + 1, expeditedBuffer, i, expeditedBuffer.length - i - 1); } if (expeditedPutIndex != 0) { expeditedBuffer[expeditedBuffer.length - 1] = expeditedBuffer[0]; System.arraycopy(expeditedBuffer, 1, expeditedBuffer, 0, expeditedPutIndex - 1); expeditedPutIndex--; } else { expeditedPutIndex = expeditedBuffer.length - 1; } expeditedBuffer[expeditedPutIndex] = null; numberOfUsedExpeditedSlots.getAndDecrement(); // D615053 return true; } } // D610567 - Scan first section of expedited BoundedBuffer for (int i = 0; i < expeditedPutIndex; i++) { if (expeditedBuffer[i] == x) { System.arraycopy(expeditedBuffer, i + 1, expeditedBuffer, i, expeditedPutIndex - i - 1); expeditedPutIndex--; expeditedBuffer[expeditedPutIndex] = null; numberOfUsedExpeditedSlots.getAndDecrement(); // D615053 return true; } } } // Next check the main buffer if (putIndex > takeIndex) { for (int i = takeIndex; i < putIndex; i++) { if (buffer[i] == x) { System.arraycopy(buffer, i + 1, buffer, i, putIndex - i - 1); putIndex--; buffer[putIndex] = null; numberOfUsedSlots.getAndDecrement(); // D615053 return true; } } } else if (putIndex != takeIndex || buffer[takeIndex] != null) { for (int i = takeIndex; i < buffer.length; i++) { if (buffer[i] == x) { if (i != buffer.length - 1) { System.arraycopy(buffer, i + 1, buffer, i, buffer.length - i - 1); } if (putIndex != 0) { buffer[buffer.length - 1] = buffer[0]; System.arraycopy(buffer, 1, buffer, 0, putIndex - 1); putIndex--; } else { putIndex = buffer.length - 1; } buffer[putIndex] = null; numberOfUsedSlots.getAndDecrement(); // D615053 return true; } } // D610567 - Scan first section of BoundedBuffer for (int i = 0; i < putIndex; i++) { if (buffer[i] == x) { System.arraycopy(buffer, i + 1, buffer, i, putIndex - i - 1); putIndex--; buffer[putIndex] = null; numberOfUsedSlots.getAndDecrement(); // D615053 return true; } } } } return false; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#iterator() */ @Override public Iterator<T> iterator() { List<T> bufferAsList = new ArrayList<T>(); synchronized (this) { synchronized (lock) { //First add the items in the expedited buffer //Check if we wrap around the end of the array before iterating if (expeditedPutIndex > expeditedTakeIndex) { for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) { bufferAsList.add(expeditedBuffer[i]); } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) { bufferAsList.add(expeditedBuffer[i]); } for (int i = 0; i < expeditedPutIndex; i++) { bufferAsList.add(expeditedBuffer[i]); } } //Next add the items in the main buffer //Check if we wrap around the end of the array before iterating if (putIndex > takeIndex) { for (int i = takeIndex; i <= putIndex; i++) { bufferAsList.add(buffer[i]); } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = takeIndex; i < buffer.length; i++) { bufferAsList.add(buffer[i]); } for (int i = 0; i < putIndex; i++) { bufferAsList.add(buffer[i]); } } } } return bufferAsList.iterator(); } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#toArray() */ @Override public Object[] toArray() { int size = size(); Object[] retArray; if (size < 1) { retArray = new Object[] {}; } else { retArray = new Object[size]; int retArrayIndex = 0; synchronized (this) { synchronized (lock) { //Add the items in the expedited buffer first //Check if we wrap around the end of the array before iterating if (expeditedPutIndex > expeditedTakeIndex) { for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) { retArray[retArrayIndex] = expeditedBuffer[i]; retArrayIndex++; } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) { retArray[retArrayIndex] = expeditedBuffer[i]; retArrayIndex++; } for (int i = 0; i < expeditedPutIndex; i++) { retArray[retArrayIndex] = expeditedBuffer[i]; retArrayIndex++; } } //Next add the items in the main buffer //Check if we wrap around the end of the array before iterating if (putIndex > takeIndex) { for (int i = takeIndex; i <= putIndex; i++) { retArray[retArrayIndex] = buffer[i]; retArrayIndex++; } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = takeIndex; i < buffer.length; i++) { retArray[retArrayIndex] = buffer[i]; retArrayIndex++; } for (int i = 0; i < putIndex; i++) { retArray[retArrayIndex] = buffer[i]; retArrayIndex++; } } } } } return retArray; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#toArray(T[]) */ @Override @SuppressWarnings("unchecked") public <E> E[] toArray(E[] a) { if (a.length < size()) { a = (E[]) Array.newInstance(a.getClass().getComponentType(), size()); } int aIndex = 0; synchronized (this) { synchronized (lock) { //First add anything in the expedited buffer //Check if we wrap around the end of the array before iterating if (expeditedPutIndex > expeditedTakeIndex) { for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) { a[aIndex] = (E) expeditedBuffer[i]; aIndex++; } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) { a[aIndex] = (E) expeditedBuffer[i]; aIndex++; } for (int i = 0; i < expeditedPutIndex; i++) { a[aIndex] = (E) expeditedBuffer[i]; aIndex++; } } //Now add the items in the main buffer //Check if we wrap around the end of the array before iterating if (putIndex > takeIndex) { for (int i = takeIndex; i <= putIndex; i++) { a[aIndex] = (E) buffer[i]; aIndex++; } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = takeIndex; i < buffer.length; i++) { a[aIndex] = (E) buffer[i]; aIndex++; } for (int i = 0; i < putIndex; i++) { a[aIndex] = (E) buffer[i]; aIndex++; } } } } if (a.length > size()) { a[size()] = null; } return a; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.concurrent.BlockingQueue#contains(java.lang.Object) */ @Override public boolean contains(Object o) { synchronized (this) { synchronized (lock) { //First check the expedited buffer //Check if we wrap around the end of the array before iterating if (expeditedPutIndex > expeditedTakeIndex) { for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) { if (o.equals(expeditedBuffer[i])) { return true; } } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) { if (o.equals(expeditedBuffer[i])) { return true; } } for (int i = 0; i < expeditedPutIndex; i++) { if (o.equals(expeditedBuffer[i])) { return true; } } } //Next check the main buffer //Check if we wrap around the end of the array before iterating if (putIndex > takeIndex) { for (int i = takeIndex; i <= putIndex; i++) { if (o.equals(buffer[i])) { return true; } } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = takeIndex; i < buffer.length; i++) { if (o.equals(buffer[i])) { return true; } } for (int i = 0; i < putIndex; i++) { if (o.equals(buffer[i])) { return true; } } } } } return false; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#containsAll(java.util.Collection) */ @Override public boolean containsAll(Collection<?> c) { for (Object e : c) if (!contains(e)) return false; return true; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.concurrent.BlockingQueue#remove(java.lang.Object) */ @Override public boolean remove(Object o) { if (o == null) { return false; } if (size() == 0) { return false; } synchronized (this) { //First check the expedited buffer synchronized (lock) { //Check if we wrap around the end of the array before iterating if (expeditedPutIndex > expeditedTakeIndex) { for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) { if (o.equals(expeditedBuffer[i])) { //Remove element and shift all remaining elements for (int j = i; j < expeditedPutIndex; j++) { expeditedBuffer[j] = expeditedBuffer[j + 1]; } //Null the putIndex expeditedBuffer[expeditedPutIndex] = null; expeditedPutIndex--; //Decrement used slots counter numberOfUsedExpeditedSlots.getAndDecrement(); //TODO if expedited is added for put or offer with timeout add notification here return true; } } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) { if (o.equals(expeditedBuffer[i])) { //Remove element and shift all remaining elements up for (int j = i; j > expeditedTakeIndex; j--) { expeditedBuffer[j] = expeditedBuffer[j - 1]; } //Null the putIndex expeditedBuffer[expeditedTakeIndex] = null; if (expeditedTakeIndex == expeditedBuffer.length - 1) { expeditedTakeIndex = 0; } else { expeditedTakeIndex++; } //Decrement used slots counter numberOfUsedExpeditedSlots.getAndDecrement(); //TODO if expedited is added for put or offer with timeout add notification here return true; } } for (int i = 0; i < expeditedPutIndex; i++) { if (o.equals(expeditedBuffer[i])) { //Remove element and shift all remaining elements down for (int j = i; j < expeditedPutIndex; j++) { expeditedBuffer[j] = expeditedBuffer[j + 1]; } //Null the putIndex expeditedBuffer[expeditedPutIndex] = null; expeditedPutIndex--; //Decrement used slots counter numberOfUsedExpeditedSlots.getAndDecrement(); //TODO if expedited is added for put or offer with timeout add notification here return true; } } } //Next check the main buffer //Check if we wrap around the end of the array before iterating if (putIndex > takeIndex) { for (int i = takeIndex; i <= putIndex; i++) { if (o.equals(buffer[i])) { //Remove element and shift all remaining elements for (int j = i; j < putIndex; j++) { buffer[j] = buffer[j + 1]; } //Null the putIndex buffer[putIndex] = null; putIndex--; //Decrement used slots counter numberOfUsedSlots.getAndDecrement(); //Notify a waiting put thread that space has cleared notifyPut_(); return true; } } } else { //We wrap around the array. Loop through in two passes(upper and lower) for (int i = takeIndex; i < buffer.length; i++) { if (o.equals(buffer[i])) { //Remove element and shift all remaining elements up for (int j = i; j > takeIndex; j--) { buffer[j] = buffer[j - 1]; } //Null the putIndex buffer[takeIndex] = null; if (takeIndex == buffer.length - 1) { takeIndex = 0; } else { takeIndex++; } //Decrement used slots counter numberOfUsedSlots.getAndDecrement(); //Notify a waiting put thread that space has cleared notifyPut_(); return true; } } for (int i = 0; i < putIndex; i++) { if (o.equals(buffer[i])) { //Remove element and shift all remaining elements down for (int j = i; j < putIndex; j++) { buffer[j] = buffer[j + 1]; } //Null the putIndex buffer[putIndex] = null; putIndex--; //Decrement used slots counter numberOfUsedSlots.getAndDecrement(); //Notify a waiting put thread that space has cleared notifyPut_(); return true; } } } } } return false; } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.concurrent.BlockingQueue#drainTo(java.util.Collection) */ @Override public int drainTo(Collection<? super T> c) { return drainTo(c, Integer.MAX_VALUE); } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.concurrent.BlockingQueue#drainTo(java.util.Collection, int) */ @Override public int drainTo(Collection<? super T> c, int maxElements) { //TODO- The elements aren't added to the given collection... if (c == null) throw new NullPointerException(); if (c == this) throw new IllegalArgumentException(); int n = Math.min(maxElements, size()); int numRemaining = n; synchronized (this) { synchronized (lock) { //Retrieve and remove at most n elements from the expedited buffer and add them to the passed collection for (int i = 0; i < n; i++) { T retrieved = expeditedExtract(); numRemaining = n - i; if (retrieved != null) { numberOfUsedExpeditedSlots.getAndDecrement(); //TODO if expedited is added for put or offer with timeout add notification here } else { break; //retrieved is null so nothing left in the expedited buffer, move on to the main buffer } } //Retrieve and remove at most numRemaining elements and add them to the passed collection for (int i = 0; i < numRemaining; i++) { T retrieved = extract(); numberOfUsedSlots.getAndDecrement(); if (retrieved != null) { notifyPut_(); } } } } return n; } //---------------------- // Unsupported methods //---------------------- /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#addAll(java.util.Collection) */ @Override public boolean addAll(Collection<? extends T> c) { //Optional Collection method throw new UnsupportedOperationException(); } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#removeAll(java.util.Collection) */ @Override public boolean removeAll(Collection<?> c) { //Optional Collection method throw new UnsupportedOperationException(); } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#retainAll(java.util.Collection) */ @Override public boolean retainAll(Collection<?> c) { //Optional Collection method throw new UnsupportedOperationException(); } /* * @awisniew - ADDED * * (non-Javadoc) * * @see java.util.Collection#clear() */ @Override public void clear() { //Optional Collection method throw new UnsupportedOperationException(); } //@awisniew - DELETED //public void setThreadPool(ThreadPool threadPool) { // threadPool_ = threadPool; //} }
kgibm/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/BoundedBuffer.java
Java
epl-1.0
56,371
import React from 'react'; import PropTypes from 'prop-types'; import {Button, Modal} from 'react-bootstrap'; import FontAwesome from 'react-fontawesome'; import axios from 'axios'; import Server from '../helpers/Server'; import CompareDocs from './CompareDocs'; import {get} from "lodash"; import TreeViewUtils from "../helpers/TreeViewUtils"; /** * Display modal content. */ export class ModalCompareDocs extends React.Component { constructor(props) { super(props); this.state = { showSearchResults: false , message: this.props.labels.msg1 , messageIcon: this.messageIcons.info , data: {values: [{"id": "", "value:": ""}]} , options: { sizePerPage: 30 , sizePerPageList: [5, 15, 30] , onSizePerPageList: this.onSizePerPageList , hideSizePerPage: true , paginationShowsTotal: true } , selectRow: { mode: 'radio' // or checkbox , hideSelectColumn: (this.props.hasCallback ? false : true) , clickToSelect: false , onSelect: this.handleRowSelect , className: "App-row-select" , selected: [] } , showSelectionButtons: false , selectedId: "" , selectedValue: "" , selectedSeq: "" , selectedIdPartsPrompt: "Select one or more ID parts, then click on the search icon:" , selectedIdParts: [ {key: "domain", label: ""}, {key: "topic", label: ""}, {key: "key", label: ""} ] , showIdPartSelector: false , showModalCompareDocs: false , idColumnSize: "80px" , _isMounted: get(this.state,"_isMounted", false) , _requestTokens: get(this.state,"_requestTokens", new Map()) }; this.close = this.close.bind(this); this.open = this.open.bind(this); this.fetchData = this.fetchData.bind(this); this.handleFetchCallback = this.handleFetchCallback.bind(this); this.oldFetchData = this.oldFetchData.bind(this); this.setMessage = this.setMessage.bind(this); this.handleRowSelect = this.handleRowSelect.bind(this); }; componentDidMount = () => { this.setState({_isMounted: true}); }; componentWillUnmount = () => { if (this.state && this.state._requestTokens) { for (let token of this.state._requestTokens.keys()) { try { Server.cancelRequest(token); } catch (error) { // ignore } } } this.setState({_isMounted: false}); }; componentWillMount = () => { this.setState({ showModal: this.props.showModal , domain: "*" , selectedBook: "*" , selectedChapter: "*" , docProp: "id" , matcher: "rx" , query: ".*~" + this.props.selectedIdParts[1].label + "~" + this.props.selectedIdParts[2].label + "$" } , function () { this.fetchData(); } ); }; /** * font-awesome icons for messages * @type {{info: string, warning: string, error: string}} */ messageIcons = { info: "info-circle" , warning: "lightbulb-o" , error: "exclamation-triangle" // , toggleOn: "eye" // , toggleOff: "eye-slash" , toggleOn: "toggle-on" , toggleOff: "toggle-off" , simpleSearch: "minus" , advancedSearch: "bars" , idPatternSearch: "key" }; setMessage(message) { this.setState({ message: message }); } fetchData = () => { let requestTokens = this.state._requestTokens; const requestToken = Server.getRequestToken(); requestTokens.set(requestToken,"live"); this.setState({ message: this.props.labels.msg2 , messageIcon: this.messageIcons.info , _requestTokens: requestTokens }); let parms = "?t=" + encodeURIComponent(this.props.docType) + "&d=" + encodeURIComponent(this.state.domain) + "&b=" + encodeURIComponent(this.state.selectedBook) + "&c=" + encodeURIComponent(this.state.selectedChapter) + "&q=" + encodeURIComponent(this.state.query) + "&p=" + encodeURIComponent(this.state.docProp) + "&m=" + encodeURIComponent(this.state.matcher) ; Server.getTextComparison( this.props.session.restServer , this.props.session.userInfo.username , this.props.session.userInfo.password , parms , this.handleFetchCallback , requestToken ); this.setState({_requestTokens: requestTokens}); }; handleFetchCallback = (response) => { if (this.state._isMounted && response && response.data && response.data.values) { this.state._requestTokens.delete(requestToken); // if one of the values is greek, then make it the selected row let selectedId = ""; let selectedValue = ""; let selectRow = this.state.selectRow; if (response.data.values) { // select the Greek value. If not, if there is only one item, select it let theItem = response.data.values.find(o => o.id.startsWith("gr_")); if (theItem) { selectedId = theItem.id; selectedValue = theItem.value; selectRow.selected = [selectedId]; } else { if (response.data.values.length === 1) { theItem = response.data.values[0]; selectedId = theItem.id; selectedValue = theItem.value; selectRow.selected = [selectedId]; } } } this.setState({ selectRow: selectRow , selectedId: selectedId , selectedValue: selectedValue , data: response.data } ); let resultCount = 0; let message = this.props.labels.foundNone; let found = this.props.labels.foundMany; if (response.data.valueCount) { resultCount = response.data.valueCount; if (resultCount === 0) { message = this.props.labels.foundNone; } else if (resultCount === 1) { message = this.props.labels.foundOne; } else { message = found + " " + resultCount + "."; } } this.setState({ message: message , messageIcon: this.messageIcons.info , showSearchResults: true } ); }; }; oldFetchData() { let requestTokens = this.state._requestTokens; const requestToken = Server.getRequestToken(); requestTokens.set(requestToken,"live"); this.setState({ message: this.props.labels.msg2 , messageIcon: this.messageIcons.info , _requestTokens: requestTokens }); let config = { auth: { username: this.props.session.userInfo.username , password: this.props.session.userInfo.password } }; let parms = "?t=" + encodeURIComponent(this.props.docType) + "&d=" + encodeURIComponent(this.state.domain) + "&b=" + encodeURIComponent(this.state.selectedBook) + "&c=" + encodeURIComponent(this.state.selectedChapter) + "&q=" + encodeURIComponent(this.state.query) + "&p=" + encodeURIComponent(this.state.docProp) + "&m=" + encodeURIComponent(this.state.matcher) ; let path = this.props.session.restServer + Server.getWsServerDbApi() + 'docs' + parms; axios.get(path, config) .then(response => { if (this.state._requestTokens.has(requestToken)) { this.state._requestTokens.delete(requestToken); // if one of the values is greek, then make it the selected row let selectedId = ""; let selectedValue = ""; let selectRow = this.state.selectRow; if (response.data.values) { // select the Greek value. If not, if there is only one item, select it let theItem = response.data.values.find(o => o.id.startsWith("gr_")); if (theItem) { selectedId = theItem.id; selectedValue = theItem.value; selectRow.selected = [selectedId]; } else { if (response.data.values.length === 1) { theItem = response.data.values[0]; selectedId = theItem.id; selectedValue = theItem.value; selectRow.selected = [selectedId]; } } } this.setState({ selectRow: selectRow , selectedId: selectedId , selectedValue: selectedValue , data: response.data } ); let resultCount = 0; let message = this.props.labels.foundNone; let found = this.props.labels.foundMany; if (response.data.valueCount) { resultCount = response.data.valueCount; if (resultCount === 0) { message = this.props.labels.foundNone; } else if (resultCount === 1) { message = this.props.labels.foundOne; } else { message = found + " " + resultCount + "."; } } this.setState({ message: message , messageIcon: this.messageIcons.info , showSearchResults: true } ); } }) .catch((error) => { if (this.state._requestTokens.has(requestToken)) { this.state._requestTokens.delete(requestToken); let message = error.message; let messageIcon = this.messageIcons.error; if (error && error.response && error.response.status === 404) { message = this.props.labels.foundNone; messageIcon = this.messageIcons.warning; this.setState({data: message, message: message, messageIcon: messageIcon}); } } }); } close() { this.setState({showModal: false}); if (this.props.onClose) { this.props.onClose( this.state.selectedId , this.state.selectedValue , this.state.selectedSeq ); } }; open() { this.setState({showModal: true}); }; handleRowSelect = (row, isSelected, e) => { let selectRow = this.state.selectRow; selectRow.selected = [row["id"]]; let idParts = row["id"].split("~"); this.setState({ selectRow: selectRow , selectedId: row["id"] , selectedIdParts: [ {key: "domain", label: idParts[0]}, {key: "topic", label: idParts[1]}, {key: "key", label: idParts[2]} ] , selectedValue: row["value"] , selectedSeq: row["seq"] }); }; render() { return ( <div> <Modal backdrop={"static"} show={this.state.showModal} onHide={this.close}> <Modal.Header closeButton> <Modal.Title>{this.props.title}</Modal.Title> </Modal.Header> <Modal.Body> {this.props.hasCallback && <div className="control-label">{this.props.labels.selectVersion}</div> } <div>{this.props.labels.resultLabel}: <span className="App App-message"><FontAwesome name={this.state.messageIcon}/>{this.state.message}</span> </div> <CompareDocs session={this.props.session} handleRowSelect={this.handleRowSelect} title={this.props.title} docType={this.props.docType} selectedIdParts={this.props.selectedIdParts} labels={this.props.labels} /> </Modal.Body> <Modal.Footer> <Button onClick={this.close}>{this.props.labels.close}</Button> </Modal.Footer> </Modal> </div> ); } } ModalCompareDocs.propTypes = { session: PropTypes.object.isRequired , onClose: PropTypes.func , showModal: PropTypes.bool.isRequired , hasCallback: PropTypes.func , title: PropTypes.string.isRequired , docType: PropTypes.string.isRequired , selectedIdParts: PropTypes.array.isRequired , labels: PropTypes.object.isRequired , instructions: PropTypes.string }; ModalCompareDocs.defaultProps = { }; export default ModalCompareDocs;
OCMC-Translation-Projects/ioc-liturgical-react
src/modules/ModalCompareDocs.js
JavaScript
epl-1.0
12,601
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="copyright" content="(C) Copyright 2010"/> <meta name="DC.rights.owner" content="(C) Copyright 2010"/> <meta name="DC.Type" content="concept"/> <meta name="DC.Title" content="LBS Integration and Configuration Guide Overview"/> <meta name="abstract" content="This document gives an overview of how device creators integrate the LBS subsystem into their products."/> <meta name="description" content="This document gives an overview of how device creators integrate the LBS subsystem into their products."/> <meta name="DC.Relation" scheme="URI" content="GUID-D18B4715-3942-52EA-9D2F-E145037FA47A.html"/> <meta name="DC.Relation" scheme="URI" content="index.html"/> <meta name="DC.Relation" scheme="URI" content="GUID-32E29020-1956-461A-B79A-1492E06049E7.html"/> <meta name="DC.Relation" scheme="URI" content="GUID-7F476137-5E7F-5288-9F4A-6C20F0A1AD9B.html"/> <meta name="DC.Relation" scheme="URI" content="GUID-D18B4715-3942-52EA-9D2F-E145037FA47A.html"/> <meta name="DC.Relation" scheme="URI" content="GUID-7233BC33-6060-5D6B-A5D2-01135F059337.html"/> <meta name="DC.Format" content="XHTML"/> <meta name="DC.Identifier" content="GUID-A25FE08D-F91E-5C77-969D-569941974E6E"/> <meta name="DC.Language" content="en"/> <link rel="stylesheet" type="text/css" href="commonltr.css"/> <title>LBS Integration and Configuration Guide Overview</title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <link rel="stylesheet" type="text/css" href="nokiacxxref.css"/></head> <body id="GUID-A25FE08D-F91E-5C77-969D-569941974E6E"><a name="GUID-A25FE08D-F91E-5C77-969D-569941974E6E"><!-- --></a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()">Collapse all</a> <a id="index" href="index.html">Symbian^3 Product Developer Library</a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1">&#160;</div> <script type="text/javascript"> var currentIconMode = 0; window.name="id2563754 id2402590 id2402636 "; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"><a href="index.html" title="Symbian^3 Product Developer Library">Symbian^3 Product Developer Library</a> &gt; <a href="GUID-32E29020-1956-461A-B79A-1492E06049E7.html" title="The Symbian Guide describes the architecture and functionality of the platform, and provides guides on using its APIs.">Symbian Guide</a> &gt; <a href="GUID-7F476137-5E7F-5288-9F4A-6C20F0A1AD9B.html">Location Based Services (LBS) Guide</a> &gt; <a href="GUID-D18B4715-3942-52EA-9D2F-E145037FA47A.html" title="The documents in this section describe the tasks necessary to build and configure the LBS subsystem. These documents are for device creators.">LBS Integration and Configuration Guide</a> &gt; </div> <h1 class="topictitle1">LBS Integration and Configuration Guide Overview</h1> <div><p>This document gives an overview of how device creators integrate the LBS subsystem into their products. </p> <div class="section" id="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-DBF1C87D-7360-54B7-8658-B6659BF77F06-GENID-1-12-1-19-1-1-6-1-4-1-3-1"><a name="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-DBF1C87D-7360-54B7-8658-B6659BF77F06-GENID-1-12-1-19-1-1-6-1-4-1-3-1"><!-- --></a><h2 class="sectiontitle">Introduction</h2> <p>A device creator must complete a set of tasks to create a working LBS subsystem that can be used in a product. The precise configuration of the LBS subsystem depends on which features of LBS are required. </p> <p>The documents in this section provide guidance to help device creators understand which LBS components must be included in their LBS subsystem based on their requirements. </p> </div> <div class="section"><h2 class="sectiontitle">Required background</h2> <p>Read <a href="GUID-7233BC33-6060-5D6B-A5D2-01135F059337.html" title="This document describes the major components and interfaces of the Symbian platform Location Based Services (LBS) subsystem. It is intended to give device creators an appreciation of the LBS subsystem architecture. It also provides links to other documentation that provides more detailed information about the LBS components and APIs.">LBS Architecture Overview</a> for background information on the components of LBS on the Symbian platform. </p> </div> <div class="section" id="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-939FFCE6-1155-5539-8B04-8DB2A0980514-GENID-1-12-1-19-1-1-6-1-4-1-3-3"><a name="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-939FFCE6-1155-5539-8B04-8DB2A0980514-GENID-1-12-1-19-1-1-6-1-4-1-3-3"><!-- --></a><h2 class="sectiontitle">LBS configurations</h2> <p>There are two main LBS subsystem configurations that a device creator can build. Follow the links for more information on each of these. </p> <a name="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-22BEA62D-8B74-5574-A40F-4CC256A46D9D"><!-- --></a><ol id="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-22BEA62D-8B74-5574-A40F-4CC256A46D9D"> <li id="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-C06B3933-B761-548A-97F2-3484A31274C2"><a name="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-C06B3933-B761-548A-97F2-3484A31274C2"><!-- --></a><p><a href="GUID-A898867E-0C50-583E-979F-132504C24C9A.html" title="This topic describes the steps necessary to configure the LBS subsystem on the Symbian platform.">Full LBS on the Symbian Platform</a> </p> <p>A device creator can configure the LBS subsystem to handle location requests from installed applications and from the network. </p> </li> <li id="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-C3FEFBF8-DB4F-579D-9CC4-6306D1F5B033"><a name="GUID-A25FE08D-F91E-5C77-969D-569941974E6E__GUID-C3FEFBF8-DB4F-579D-9CC4-6306D1F5B033"><!-- --></a><p><a href="GUID-3618ECE9-C22B-5AE2-837E-FEBC55D42330.html" title="This document describes the steps necessary to configure the LBS subsystem with the Privacy Protocol Module.">LBS in Standalone Privacy Mode</a> </p> <p>A device creator can configure the LBS subsystem to handle location requests from installed applications and <em>privacy requests</em> from the network. </p> <p>Device creators must create and use components in the device domestic OS to handle <em>location requests</em> from the network. Creating these components is outside of the scope of this Symbian platform documentation, but the LBS APIs that they must use are described. </p> </li> </ol> </div> <div class="section"><h2 class="sectiontitle">LBS ROM macros</h2> <p>The Symbian platform contains several ROM macros that are used to build the LBS configurations described above. </p> <p>See <a href="GUID-5B39D732-7252-57EB-BA74-FC8718ED45E4.html" title="This section describes the ROM build macros that allow you to included or exclude LBS components from ROM.">LBS ROM Macros</a> for more information. </p> </div> </div> <div> <div class="familylinks"> <div class="parentlink"><strong>Parent topic:</strong> <a href="GUID-D18B4715-3942-52EA-9D2F-E145037FA47A.html" title="The documents in this section describe the tasks necessary to build and configure the LBS subsystem. These documents are for device creators.">LBS Integration and Configuration Guide</a></div> </div> <div class="relinfo relconcepts"><strong>Related concepts</strong><br/> <div><a href="GUID-7233BC33-6060-5D6B-A5D2-01135F059337.html" title="This document describes the major components and interfaces of the Symbian platform Location Based Services (LBS) subsystem. It is intended to give device creators an appreciation of the LBS subsystem architecture. It also provides links to other documentation that provides more detailed information about the LBS components and APIs.">LBS Architecture Overview</a></div> </div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/GUID-A25FE08D-F91E-5C77-969D-569941974E6E.html
HTML
epl-1.0
8,764
package org.eclipse.graphiti.fx.ga; import java.util.ArrayList; import org.eclipse.emf.common.util.EList; import org.eclipse.graphiti.mm.algorithms.Polyline; import org.eclipse.graphiti.mm.algorithms.styles.Point; public class FxPolyline extends FxGraphicsAlgorithm<javafx.scene.shape.Polyline> { private Polyline polyline; private javafx.scene.shape.Polyline fxPolyline; public FxPolyline(Polyline polyline) { super(polyline, new javafx.scene.shape.Polyline()); this.polyline = polyline; this.fxPolyline = getShape(); initialize(); } @Override protected void initialize() { super.initialize(); // Points EList<Point> points = polyline.getPoints(); ArrayList<Double> list = new ArrayList<>(points.size()); for (Point point : points) { list.add(new Double(point.getX())); list.add(new Double(point.getY())); } fxPolyline.getPoints().addAll(list); } @Override protected void setX(double x) { // Nothing to do } @Override protected void setY(double y) { // Nothing to do } @Override protected void setWidth(double width) { // Nothing to do } @Override protected void setHeight(double height) { // Nothing to do } }
mwenz/graphitiFX
org.eclipse.graphiti.fx/src/org/eclipse/graphiti/fx/ga/FxPolyline.java
Java
epl-1.0
1,234
/** * generated by Xtext */ package org.eclipse.xtext.xtextTest.impl; import java.util.Collection; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.xtext.xtextTest.AbstractElement; import org.eclipse.xtext.xtextTest.Group; import org.eclipse.xtext.xtextTest.XtextTestPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Group</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.eclipse.xtext.xtextTest.impl.GroupImpl#getElements <em>Elements</em>}</li> * </ul> * * @generated */ public class GroupImpl extends AbstractElementImpl implements Group { /** * The cached value of the '{@link #getElements() <em>Elements</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getElements() * @generated * @ordered */ protected EList<AbstractElement> elements; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GroupImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return XtextTestPackage.Literals.GROUP; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<AbstractElement> getElements() { if (elements == null) { elements = new EObjectContainmentEList<AbstractElement>(AbstractElement.class, this, XtextTestPackage.GROUP__ELEMENTS); } return elements; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case XtextTestPackage.GROUP__ELEMENTS: return ((InternalEList<?>)getElements()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case XtextTestPackage.GROUP__ELEMENTS: return getElements(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case XtextTestPackage.GROUP__ELEMENTS: getElements().clear(); getElements().addAll((Collection<? extends AbstractElement>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case XtextTestPackage.GROUP__ELEMENTS: getElements().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case XtextTestPackage.GROUP__ELEMENTS: return elements != null && !elements.isEmpty(); } return super.eIsSet(featureID); } } //GroupImpl
miklossy/xtext-core
org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/xtextTest/impl/GroupImpl.java
Java
epl-1.0
3,661
/******************************************************************************* * Copyright (c) 2012, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.core.tests.compiler.parser; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.Locale; import org.eclipse.jdt.core.compiler.CategorizedProblem; import org.eclipse.jdt.core.tests.util.AbstractCompilerTest; import org.eclipse.jdt.core.tests.util.Util; import org.eclipse.jdt.internal.codeassist.complete.CompletionParser; import org.eclipse.jdt.internal.codeassist.select.SelectionParser; import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; import org.eclipse.jdt.internal.compiler.DocumentElementParser; import org.eclipse.jdt.internal.compiler.IDocumentElementRequestor; import org.eclipse.jdt.internal.compiler.ISourceElementRequestor; import org.eclipse.jdt.internal.compiler.SourceElementParser; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.ImportReference; import org.eclipse.jdt.internal.compiler.batch.CompilationUnit; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope; import org.eclipse.jdt.internal.compiler.parser.Parser; import org.eclipse.jdt.internal.compiler.problem.DefaultProblem; import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; import org.eclipse.jdt.internal.core.search.indexing.IndexingParser; import org.eclipse.jdt.internal.core.util.CommentRecorderParser; public class AbstractSyntaxTreeTest extends AbstractCompilerTest implements IDocumentElementRequestor, ISourceElementRequestor { protected static final int CHECK_PARSER = 0x1; protected static final int CHECK_COMPLETION_PARSER = 0x2; protected static final int CHECK_SELECTION_PARSER = 0x4; protected static final int CHECK_DOCUMENT_ELEMENT_PARSER = 0x8; protected static final int CHECK_COMMENT_RECORDER_PARSER = 0x10; protected static final int CHECK_SOURCE_ELEMENT_PARSER = 0x20; protected static final int CHECK_INDEXING_PARSER = 0x40; protected static final int CHECK_JAVAC_PARSER = 0x80; protected static int CHECK_ALL = (CHECK_PARSER | CHECK_COMPLETION_PARSER | CHECK_SELECTION_PARSER | CHECK_DOCUMENT_ELEMENT_PARSER | CHECK_COMMENT_RECORDER_PARSER | CHECK_SOURCE_ELEMENT_PARSER | CHECK_INDEXING_PARSER); public static boolean optimizeStringLiterals = false; private String referenceCompiler; private String referenceCompilerTestsScratchArea; public AbstractSyntaxTreeTest(String name, String referenceCompiler, String referenceCompilerTestsScratchArea) { super(name); this.referenceCompiler = referenceCompiler; this.referenceCompilerTestsScratchArea = referenceCompilerTestsScratchArea; } public void checkParse(int parserToCheck, char[] source, String expectedSyntaxErrorDiagnosis, String testName, String expectedUnitToString, ASTVisitor visitor) throws IOException { CompilerOptions options = new CompilerOptions(getCompilerOptions()); options.complianceLevel = ClassFileConstants.JDK1_8; options.sourceLevel = ClassFileConstants.JDK1_8; options.targetJDK = ClassFileConstants.JDK1_8; ICompilationUnit sourceUnit = null; CompilationResult compilationResult = null; CompilationUnitDeclaration unit = null; if (this.referenceCompiler != null && (parserToCheck & CHECK_JAVAC_PARSER) != 0) { String javaFilePath = this.referenceCompilerTestsScratchArea + "\\Xyz.java"; File f = new File(javaFilePath); FileOutputStream o = new FileOutputStream(f); OutputStreamWriter w = new OutputStreamWriter(o); w.write(source); w.close(); Process p = Runtime.getRuntime().exec (new String[] { this.referenceCompiler, "-sourcepath", this.referenceCompilerTestsScratchArea, javaFilePath }, null, new File(this.referenceCompilerTestsScratchArea)); try { BufferedReader stdout = new BufferedReader(new InputStreamReader(p.getInputStream())); BufferedReader stderr = new BufferedReader(new InputStreamReader(p.getErrorStream())); String line; while ((line = stderr.readLine())!= null) System.out.println(line); while ((line = stdout.readLine())!= null) System.out.println(line); assertTrue("javac unhappy", p.waitFor() == 0); } catch (InterruptedException e) { System.err.println("Skipped javac behavior check due to interrupt..."); } } if ((parserToCheck & CHECK_PARSER) != 0) { Parser parser1 = new Parser( new ProblemReporter( DefaultErrorHandlingPolicies.proceedWithAllProblems(), options, new DefaultProblemFactory(Locale.getDefault())), optimizeStringLiterals); sourceUnit = new CompilationUnit(source, testName, null); compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); unit = parser1.parse(sourceUnit, compilationResult); parser1.getMethodBodies(unit); assertDianosticEquals(expectedSyntaxErrorDiagnosis, testName, compilationResult); assertParseTreeEquals(expectedUnitToString, unit.toString()); if (visitor != null) { unit.traverse(visitor, (CompilationUnitScope) null); } parser1 = null; } if ((parserToCheck & CHECK_COMPLETION_PARSER) != 0) { CompletionParser parser2 = new CompletionParser( new ProblemReporter( DefaultErrorHandlingPolicies.proceedWithAllProblems(), options, new DefaultProblemFactory(Locale.getDefault())), false); compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); unit = parser2.parse(sourceUnit, compilationResult, Integer.MAX_VALUE); parser2.getMethodBodies(unit); assertDianosticEquals(expectedSyntaxErrorDiagnosis, testName, compilationResult); assertParseTreeEquals(expectedUnitToString, unit.toString()); parser2 = null; } if ((parserToCheck & CHECK_SELECTION_PARSER) != 0) { SelectionParser parser3 = new SelectionParser( new ProblemReporter( DefaultErrorHandlingPolicies.proceedWithAllProblems(), options, new DefaultProblemFactory(Locale.getDefault()))); compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); unit = parser3.parse(sourceUnit, compilationResult, Integer.MAX_VALUE, Integer.MAX_VALUE); parser3.getMethodBodies(unit); assertDianosticEquals(expectedSyntaxErrorDiagnosis, testName, compilationResult); assertParseTreeEquals(expectedUnitToString, unit.toString()); parser3 = null; } if ((parserToCheck & CHECK_DOCUMENT_ELEMENT_PARSER) != 0) { DocumentElementParser parser4 = new DocumentElementParser( this, new DefaultProblemFactory(Locale.getDefault()), options); compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); unit = parser4.parse(sourceUnit, compilationResult); parser4.getMethodBodies(unit); assertDianosticEquals(expectedSyntaxErrorDiagnosis, testName, compilationResult); assertParseTreeEquals(expectedUnitToString, unit.toString()); parser4 = null; } if ((parserToCheck & CHECK_COMMENT_RECORDER_PARSER) != 0) { CommentRecorderParser parser5 = new CommentRecorderParser( new ProblemReporter( DefaultErrorHandlingPolicies.proceedWithAllProblems(), options, new DefaultProblemFactory(Locale.getDefault())), optimizeStringLiterals); compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); unit = parser5.parse(sourceUnit, compilationResult); parser5.getMethodBodies(unit); assertDianosticEquals(expectedSyntaxErrorDiagnosis, testName, compilationResult); assertParseTreeEquals(expectedUnitToString, unit.toString()); parser5 = null; } if ((parserToCheck & CHECK_SOURCE_ELEMENT_PARSER) != 0) { SourceElementParser parser6 = new SourceElementParser(this, new DefaultProblemFactory(Locale.getDefault()), options, true, optimizeStringLiterals); compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); unit = parser6.parse(sourceUnit, compilationResult); parser6.getMethodBodies(unit); assertDianosticEquals(expectedSyntaxErrorDiagnosis, testName, compilationResult); assertParseTreeEquals(expectedUnitToString, unit.toString()); parser6 = null; } if ((parserToCheck & CHECK_INDEXING_PARSER) != 0) { IndexingParser parser7 = new IndexingParser(this, new DefaultProblemFactory(Locale.getDefault()), options, true, optimizeStringLiterals, false); compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); unit = parser7.parse(sourceUnit, compilationResult); parser7.getMethodBodies(unit); assertDianosticEquals(expectedSyntaxErrorDiagnosis, testName, compilationResult); assertParseTreeEquals(expectedUnitToString, unit.toString()); parser7 = null; } } public void checkParse(int parserToCheck, char[] source, String expectedSyntaxErrorDiagnosis, String testName, String expectedUnitToString) throws IOException { checkParse(parserToCheck, source, expectedSyntaxErrorDiagnosis, testName, expectedUnitToString, null); } public void checkParse(char[] source, String expectedSyntaxErrorDiagnosis, String testName, String expectedUnitToString) throws IOException { checkParse(CHECK_ALL, source, expectedSyntaxErrorDiagnosis, testName, expectedUnitToString); } public void checkParse(char[] source, String expectedSyntaxErrorDiagnosis, String testName, String expectedUnitToString, ASTVisitor visitor) throws IOException { checkParse(CHECK_ALL, source, expectedSyntaxErrorDiagnosis, testName, expectedUnitToString, visitor); } private void assertParseTreeEquals(String expectedUnitToString, String computedUnitToString) { if (expectedUnitToString == null) { // just checking that we are able to digest. return; } if (!expectedUnitToString.equals(computedUnitToString)) { System.out.println(Util.displayString(computedUnitToString)); } assertEquals("Parse Tree is wrong", Util.convertToIndependantLineDelimiter(expectedUnitToString), Util.convertToIndependantLineDelimiter(computedUnitToString)); } private void assertDianosticEquals(String expectedSyntaxErrorDiagnosis, String testName, CompilationResult compilationResult) { String computedSyntaxErrorDiagnosis = getCompilerMessages(compilationResult); assertEquals( "Invalid syntax error diagnosis" + testName, Util.convertToIndependantLineDelimiter(expectedSyntaxErrorDiagnosis), Util.convertToIndependantLineDelimiter(computedSyntaxErrorDiagnosis)); } private String getCompilerMessages(CompilationResult compilationResult) { StringBuffer buffer = new StringBuffer(100); if (compilationResult.hasProblems() || compilationResult.hasTasks()) { CategorizedProblem[] problems = compilationResult.getAllProblems(); int count = problems.length; int problemCount = 0; char[] unitSource = compilationResult.compilationUnit.getContents(); for (int i = 0; i < count; i++) { if (problems[i] != null) { if (problemCount == 0) buffer.append("----------\n"); problemCount++; buffer.append(problemCount + (problems[i].isError() ? ". ERROR" : ". WARNING")); buffer.append(" in " + new String(problems[i].getOriginatingFileName()).replace('/', '\\')); try { buffer.append(((DefaultProblem)problems[i]).errorReportSource(unitSource)); buffer.append("\n"); buffer.append(problems[i].getMessage()); buffer.append("\n"); } catch (Exception e) { } buffer.append("----------\n"); } } } String computedSyntaxErrorDiagnosis = buffer.toString(); return computedSyntaxErrorDiagnosis; } public void acceptImport(int declarationStart, int declarationEnd, int[] javaDocPositions, char[] name, int nameStartPosition, boolean onDemand, int modifiers) { } public void acceptInitializer(int declarationStart, int declarationEnd, int[] javaDocPositions, int modifiers, int modifiersStart, int bodyStart, int bodyEnd) { } public void acceptLineSeparatorPositions(int[] positions) { } public void acceptPackage(int declarationStart, int declarationEnd, int[] javaDocPositions, char[] name, int nameStartPosition) { } public void acceptProblem(CategorizedProblem problem) { } public void enterClass(int declarationStart, int[] javaDocPositions, int modifiers, int modifiersStart, int classStart, char[] name, int nameStart, int nameEnd, char[] superclass, int superclassStart, int superclassEnd, char[][] superinterfaces, int[] superinterfaceStarts, int[] superinterfaceEnds, int bodyStart) { } public void enterCompilationUnit() { } public void enterConstructor(int declarationStart, int[] javaDocPositions, int modifiers, int modifiersStart, char[] name, int nameStart, int nameEnd, char[][] parameterTypes, int[] parameterTypeStarts, int[] parameterTypeEnds, char[][] parameterNames, int[] parameterNameStarts, int[] parameterNameEnds, int parametersEnd, char[][] exceptionTypes, int[] exceptionTypeStarts, int[] exceptionTypeEnds, int bodyStart) { } public void enterField(int declarationStart, int[] javaDocPositions, int modifiers, int modifiersStart, char[] type, int typeStart, int typeEnd, int typeDimensionCount, char[] name, int nameStart, int nameEnd, int extendedTypeDimensionCount, int extendedTypeDimensionEnd) { } public void enterInterface(int declarationStart, int[] javaDocPositions, int modifiers, int modifiersStart, int interfaceStart, char[] name, int nameStart, int nameEnd, char[][] superinterfaces, int[] superinterfaceStarts, int[] superinterfaceEnds, int bodyStart) { } public void enterMethod(int declarationStart, int[] javaDocPositions, int modifiers, int modifiersStart, char[] returnType, int returnTypeStart, int returnTypeEnd, int returnTypeDimensionCount, char[] name, int nameStart, int nameEnd, char[][] parameterTypes, int[] parameterTypeStarts, int[] parameterTypeEnds, char[][] parameterNames, int[] parameterNameStarts, int[] parameterNameEnds, int parametersEnd, int extendedReturnTypeDimensionCount, int extendedReturnTypeDimensionEnd, char[][] exceptionTypes, int[] exceptionTypeStarts, int[] exceptionTypeEnds, int bodyStart) { } public void exitClass(int bodyEnd, int declarationEnd) { } public void exitCompilationUnit(int declarationEnd) { } public void exitConstructor(int bodyEnd, int declarationEnd) { } public void exitField(int bodyEnd, int declarationEnd) { } public void exitInterface(int bodyEnd, int declarationEnd) { } public void exitMethod(int bodyEnd, int declarationEnd) { } public void acceptAnnotationTypeReference(char[][] annotation, int sourceStart, int sourceEnd) { } public void acceptAnnotationTypeReference(char[] annotation, int sourcePosition) { } public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) { } public void acceptFieldReference(char[] fieldName, int sourcePosition) { } public void acceptImport(int declarationStart, int declarationEnd, int nameStart, int nameEnd, char[][] tokens, boolean onDemand, int modifiers) { } public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition) { } public void acceptPackage(ImportReference importReference) { } public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd) { } public void acceptTypeReference(char[] typeName, int sourcePosition) { } public void acceptUnknownReference(char[][] name, int sourceStart, int sourceEnd) { } public void acceptUnknownReference(char[] name, int sourcePosition) { } public void enterConstructor(MethodInfo methodInfo) { } public void enterField(FieldInfo fieldInfo) { } public void enterInitializer(int declarationStart, int modifiers) { } public void enterMethod(MethodInfo methodInfo) { } public void enterType(TypeInfo typeInfo) { } public void exitConstructor(int declarationEnd) { } public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) { } public void exitInitializer(int declarationEnd) { } public void exitMethod(int declarationEnd, Expression defaultValue) { } public void exitType(int declarationEnd) { } }
maxeler/eclipse
eclipse.jdt.core/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/AbstractSyntaxTreeTest.java
Java
epl-1.0
17,569
/* * Copyright (c) 2012-2018 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation */ package org.eclipse.che.ide.editor.preferences.editorproperties.propertiessection; import com.google.gwt.core.client.GWT; import com.google.gwt.json.client.JSONValue; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Inject; import java.util.HashMap; import java.util.Map; import javax.validation.constraints.NotNull; import org.eclipse.che.commons.annotation.Nullable; import org.eclipse.che.ide.editor.preferences.EditorPreferencesManager; import org.eclipse.che.ide.editor.preferences.editorproperties.property.EditorPropertyWidget; import org.eclipse.che.ide.editor.preferences.editorproperties.property.EditorPropertyWidgetFactory; /** * The class provides special panel to store and control editor's properties. * * @author Roman Nikitenko */ public class EditorPropertiesSectionViewImpl extends Composite implements EditorPropertiesSectionView, EditorPropertyWidget.ActionDelegate { private static final EditorPropertiesSectionViewImplUiBinder UI_BINDER = GWT.create(EditorPropertiesSectionViewImplUiBinder.class); @UiField FlowPanel propertiesPanel; @UiField Label sectionTitle; private final EditorPropertyWidgetFactory editorPropertyWidgetFactory; private final EditorPreferencesManager editorPreferencesManager; private ActionDelegate delegate; private Map<String, EditorPropertyWidget> properties = new HashMap<>(); @Inject public EditorPropertiesSectionViewImpl( EditorPropertyWidgetFactory editorPropertyWidgetFactory, EditorPreferencesManager editorPreferencesManager) { this.editorPropertyWidgetFactory = editorPropertyWidgetFactory; this.editorPreferencesManager = editorPreferencesManager; initWidget(UI_BINDER.createAndBindUi(this)); } @Override public void onPropertyChanged() { delegate.onPropertyChanged(); } @Override public void setDelegate(ActionDelegate delegate) { this.delegate = delegate; } @Nullable @Override public JSONValue getPropertyValueById(@NotNull String propertyId) { EditorPropertyWidget propertyWidget = properties.get(propertyId); if (propertyWidget != null) { return propertyWidget.getValue(); } return null; } @Override public void setSectionTitle(String title) { sectionTitle.setText(title); propertiesPanel.ensureDebugId("editorPropertiesSection-" + title); // for selenium tests } @Override public void addProperty(@NotNull String propertyId, JSONValue value) { EditorPropertyWidget propertyWidget = properties.get(propertyId); if (propertyWidget != null) { propertyWidget.setValue(value); return; } String propertyName = editorPreferencesManager.getPropertyNameById(propertyId); if (propertyName == null) { return; } propertyWidget = editorPropertyWidgetFactory.create(propertyName, value); propertyWidget.setDelegate(this); propertiesPanel.add(propertyWidget); properties.put(propertyId, propertyWidget); } interface EditorPropertiesSectionViewImplUiBinder extends UiBinder<Widget, EditorPropertiesSectionViewImpl> {} }
sleshchenko/che
ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/editor/preferences/editorproperties/propertiessection/EditorPropertiesSectionViewImpl.java
Java
epl-1.0
3,701
/** * Copyright (c) 2014-2016 IncQuery Labs Ltd. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Akos Horvath, Abel Hegedus, Tamas Borbas, Zoltan Ujhelyi, Istvan David - initial API and implementation */ package org.eclipse.viatra.examples.cps.deployment.provider; import java.util.Collection; import java.util.List; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.viatra.examples.cps.deployment.DeploymentBehavior; import org.eclipse.viatra.examples.cps.deployment.DeploymentFactory; import org.eclipse.viatra.examples.cps.deployment.DeploymentPackage; /** * This is the item provider adapter for a {@link org.eclipse.viatra.examples.cps.deployment.DeploymentBehavior} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class DeploymentBehaviorItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DeploymentBehaviorItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addDescriptionPropertyDescriptor(object); addCurrentPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the Description feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addDescriptionPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DeploymentElement_description_feature"), getString("_UI_PropertyDescriptor_description", "_UI_DeploymentElement_description_feature", "_UI_DeploymentElement_type"), DeploymentPackage.Literals.DEPLOYMENT_ELEMENT__DESCRIPTION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Current feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addCurrentPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DeploymentBehavior_current_feature"), getString("_UI_PropertyDescriptor_description", "_UI_DeploymentBehavior_current_feature", "_UI_DeploymentBehavior_type"), DeploymentPackage.Literals.DEPLOYMENT_BEHAVIOR__CURRENT, true, false, true, null, null, null)); } /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(DeploymentPackage.Literals.DEPLOYMENT_BEHAVIOR__STATES); childrenFeatures.add(DeploymentPackage.Literals.DEPLOYMENT_BEHAVIOR__TRANSITIONS); } return childrenFeatures; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); } /** * This returns DeploymentBehavior.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/DeploymentBehavior")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { String label = ((DeploymentBehavior)object).getDescription(); return label == null || label.length() == 0 ? getString("_UI_DeploymentBehavior_type") : getString("_UI_DeploymentBehavior_type") + " " + label; } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(DeploymentBehavior.class)) { case DeploymentPackage.DEPLOYMENT_BEHAVIOR__DESCRIPTION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case DeploymentPackage.DEPLOYMENT_BEHAVIOR__STATES: case DeploymentPackage.DEPLOYMENT_BEHAVIOR__TRANSITIONS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (DeploymentPackage.Literals.DEPLOYMENT_BEHAVIOR__STATES, DeploymentFactory.eINSTANCE.createBehaviorState())); newChildDescriptors.add (createChildParameter (DeploymentPackage.Literals.DEPLOYMENT_BEHAVIOR__TRANSITIONS, DeploymentFactory.eINSTANCE.createBehaviorTransition())); } /** * Return the resource locator for this item provider's resources. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public ResourceLocator getResourceLocator() { return DeploymentEditPlugin.INSTANCE; } }
IncQueryLabs/incquery-examples-cps
domains/org.eclipse.viatra.examples.cps.deployment.edit/src/org/eclipse/viatra/examples/cps/deployment/provider/DeploymentBehaviorItemProvider.java
Java
epl-1.0
7,782
/******************************************************************************* * Copyright (c) 2016, 2018 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.hono.service.auth; import static org.eclipse.hono.util.AuthenticationConstants.MECHANISM_EXTERNAL; import static org.eclipse.hono.util.AuthenticationConstants.MECHANISM_PLAIN; import java.util.Objects; import javax.net.ssl.SSLPeerUnverifiedException; import javax.security.cert.X509Certificate; import org.apache.qpid.proton.engine.Sasl; import org.apache.qpid.proton.engine.Sasl.SaslOutcome; import org.apache.qpid.proton.engine.Transport; import org.eclipse.hono.auth.HonoUser; import org.eclipse.hono.util.AuthenticationConstants; import org.eclipse.hono.util.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.vertx.core.AsyncResult; import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; import io.vertx.core.net.NetSocket; import io.vertx.proton.ProtonConnection; import io.vertx.proton.sasl.ProtonSaslAuthenticator; /** * A SASL authenticator that supports the PLAIN and EXTERNAL mechanisms for authenticating clients. * <p> * On successful authentication a {@link HonoUser} reflecting the client's * <em>authorization id</em> and granted authorities is attached to the {@code ProtonConnection} under key * {@link Constants#KEY_CLIENT_PRINCIPAL}. * <p> * Verification of credentials is delegated to the {@code AuthenticationService} by means of sending a * message to {@link AuthenticationConstants#EVENT_BUS_ADDRESS_AUTHENTICATION_IN}. * <p> * Client certificate validation is done by Vert.x' {@code NetServer} during the TLS handshake, * so this class merely extracts the subject <em>Distinguished Name</em> (DN) from the client certificate * and uses it as the authorization id. */ public final class HonoSaslAuthenticator implements ProtonSaslAuthenticator { private static final Logger LOG = LoggerFactory.getLogger(HonoSaslAuthenticator.class); private final AuthenticationService authenticationService; private Sasl sasl; private boolean succeeded; private ProtonConnection protonConnection; private X509Certificate[] peerCertificateChain; /** * Creates a new authenticator. * * @param authService The service to use for authenticating client. * @throws NullPointerException if any of the parameters is {@code null}. */ public HonoSaslAuthenticator(final AuthenticationService authService) { this.authenticationService = Objects.requireNonNull(authService); } @Override public void init(final NetSocket socket, final ProtonConnection protonConnection, final Transport transport) { LOG.debug("initializing SASL authenticator"); this.protonConnection = protonConnection; this.sasl = transport.sasl(); // TODO determine supported mechanisms dynamically based on registered AuthenticationService implementations sasl.server(); sasl.allowSkip(false); sasl.setMechanisms(MECHANISM_EXTERNAL, MECHANISM_PLAIN); if (socket.isSsl()) { LOG.debug("client connected using TLS, extracting client certificate chain"); try { peerCertificateChain = socket.peerCertificateChain(); LOG.debug("found valid client certificate DN [{}]", peerCertificateChain[0].getSubjectDN()); } catch (final SSLPeerUnverifiedException e) { LOG.debug("could not extract client certificate chain, maybe TLS based client auth is not required"); } } } @Override public void process(final Handler<Boolean> completionHandler) { final String[] remoteMechanisms = sasl.getRemoteMechanisms(); if (remoteMechanisms.length == 0) { LOG.debug("client provided an empty list of SASL mechanisms [hostname: {}, state: {}]", sasl.getHostname(), sasl.getState().name()); completionHandler.handle(false); } else { final String chosenMechanism = remoteMechanisms[0]; LOG.debug("client wants to authenticate using SASL [mechanism: {}, host: {}, state: {}]", chosenMechanism, sasl.getHostname(), sasl.getState().name()); final Future<HonoUser> authTracker = Future.future(); authTracker.setHandler(s -> { if (s.succeeded()) { final HonoUser user = s.result(); LOG.debug("authentication of client [authorization ID: {}] succeeded", user.getName()); Constants.setClientPrincipal(protonConnection, user); succeeded = true; sasl.done(SaslOutcome.PN_SASL_OK); } else { LOG.debug("authentication failed: " + s.cause().getMessage()); sasl.done(SaslOutcome.PN_SASL_AUTH); } completionHandler.handle(Boolean.TRUE); }); final byte[] saslResponse = new byte[sasl.pending()]; sasl.recv(saslResponse, 0, saslResponse.length); verify(chosenMechanism, saslResponse, authTracker.completer()); } } @Override public boolean succeeded() { return succeeded; } private void verify(final String mechanism, final byte[] saslResponse, final Handler<AsyncResult<HonoUser>> authResultHandler) { final JsonObject authRequest = AuthenticationConstants.getAuthenticationRequest(mechanism, saslResponse); if (peerCertificateChain != null) { authRequest.put(AuthenticationConstants.FIELD_SUBJECT_DN, peerCertificateChain[0].getSubjectDN().getName()); } authenticationService.authenticate(authRequest, authResultHandler); } }
dejanb/hono
service-base/src/main/java/org/eclipse/hono/service/auth/HonoSaslAuthenticator.java
Java
epl-1.0
6,317
<!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_30) on Tue May 15 00:40:28 CEST 2012 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Serialized Form (javatuples 1.2 API) </TITLE> <META NAME="date" CONTENT="2012-05-15"> <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="Serialized Form (javatuples 1.2 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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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> <H1> Serialized Form</H1> </CENTER> <HR SIZE="4" NOSHADE> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="center"><FONT SIZE="+2"> <B>Package</B> <B>org.javatuples</B></FONT></TH> </TR> </TABLE> <P> <A NAME="org.javatuples.Decade"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Decade.html" title="class in org.javatuples">org.javatuples.Decade</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-1607420937567707033L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val3</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val3</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val4</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val4</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val5</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val5</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val6</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val6</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val7</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val7</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val8</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val8</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val9</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val9</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Ennead"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Ennead.html" title="class in org.javatuples">org.javatuples.Ennead</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-4782141390960730966L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val3</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val3</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val4</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val4</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val5</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val5</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val6</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val6</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val7</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val7</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val8</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val8</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.KeyValue"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/KeyValue.html" title="class in org.javatuples">org.javatuples.KeyValue</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>3460957157833872509L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> key</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>key</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> value</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>value</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.LabelValue"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/LabelValue.html" title="class in org.javatuples">org.javatuples.LabelValue</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>5055574980300695706L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> label</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>label</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> value</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>value</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Octet"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Octet.html" title="class in org.javatuples">org.javatuples.Octet</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-1187955276020306879L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val3</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val3</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val4</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val4</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val5</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val5</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val6</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val6</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val7</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val7</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Pair"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Pair.html" title="class in org.javatuples">org.javatuples.Pair</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>2438099850625502138L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Quartet"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Quartet.html" title="class in org.javatuples">org.javatuples.Quartet</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>2445136048617019549L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val3</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val3</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Quintet"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Quintet.html" title="class in org.javatuples">org.javatuples.Quintet</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-1579008485383872628L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val3</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val3</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val4</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val4</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Septet"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Septet.html" title="class in org.javatuples">org.javatuples.Septet</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-2133846648934305169L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val3</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val3</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val4</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val4</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val5</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val5</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val6</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val6</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Sextet"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Sextet.html" title="class in org.javatuples">org.javatuples.Sextet</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-367678052827219823L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val3</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val3</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val4</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val4</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val5</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val5</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Triplet"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Triplet.html" title="class in org.javatuples">org.javatuples.Triplet</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-1877265551599483740L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val1</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val1</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> val2</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val2</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Tuple"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">org.javatuples.Tuple</A> extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>5431085632328343101L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> valueArray</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] <B>valueArray</B></PRE> <DL> <DL> </DL> </DL> <HR> <H3> valueList</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">E</A>&gt; <B>valueList</B></PRE> <DL> <DL> </DL> </DL> <P> <A NAME="org.javatuples.Unit"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class <A HREF="org/javatuples/Unit.html" title="class in org.javatuples">org.javatuples.Unit</A> extends <A HREF="org/javatuples/Tuple.html" title="class in org.javatuples">Tuple</A> implements Serializable</B></FONT></TH> </TR> </TABLE> <P> <B>serialVersionUID:&nbsp;</B>-9113114724069537096L <P> <A NAME="serializedForm"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Serialized Fields</B></FONT></TH> </TR> </TABLE> <H3> val0</H3> <PRE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>val0</B></PRE> <DL> <DL> </DL> </DL> <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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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 &#169; 2012 <a href="http://www.javatuples.org">The JAVATUPLES team</a>. All Rights Reserved. </BODY> </HTML>
eliericha/atlanalyser
fr.tpt.atlanalyser.lib/lib/javatuples-1.2/apidocs/serialized-form.html
HTML
epl-1.0
29,120
/** * Copyright 2009-2016 Université Paris Ouest and Sorbonne Universités, Univ. Paris 06 - CNRS UMR 7606 (LIP6) * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Project leader / Initial Contributor: * Lom Messan Hillah - <lom-messan.hillah@lip6.fr> * * Contributors: * ${ocontributors} - <$oemails}> * * Mailing list: * lom-messan.hillah@lip6.fr */ /** * (C) Sorbonne Universités, UPMC Univ Paris 06, UMR CNRS 7606 (LIP6/MoVe) * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Lom HILLAH (LIP6) - Initial models and implementation * Rachid Alahyane (UPMC) - Infrastructure and continuous integration * Bastien Bouzerau (UPMC) - Architecture * Guillaume Giffo (UPMC) - Code generation refactoring, High-level API */ package fr.lip6.move.pnml.hlpn.dots.impl; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; import fr.lip6.move.pnml.hlpn.dots.Dot; import fr.lip6.move.pnml.hlpn.dots.DotConstant; import fr.lip6.move.pnml.hlpn.dots.DotsFactory; import fr.lip6.move.pnml.hlpn.dots.DotsPackage; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class DotsFactoryImpl extends EFactoryImpl implements DotsFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static DotsFactory init() { try { DotsFactory theDotsFactory = (DotsFactory) EPackage.Registry.INSTANCE.getEFactory(DotsPackage.eNS_URI); if (theDotsFactory != null) { return theDotsFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new DotsFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DotsFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case DotsPackage.DOT: return createDot(); case DotsPackage.DOT_CONSTANT: return createDotConstant(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Dot createDot() { DotImpl dot = new DotImpl(); return dot; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public DotConstant createDotConstant() { DotConstantImpl dotConstant = new DotConstantImpl(); return dotConstant; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public DotsPackage getDotsPackage() { return (DotsPackage) getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static DotsPackage getPackage() { return DotsPackage.eINSTANCE; } } //DotsFactoryImpl
lhillah/pnmlframework
pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/dots/impl/DotsFactoryImpl.java
Java
epl-1.0
3,619
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <title>Uses of Class org.apache.poi.hwmf.record.HwmfBitmapDib.Compression (POI API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.hwmf.record.HwmfBitmapDib.Compression (POI API Documentation)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><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/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html" title="enum in org.apache.poi.hwmf.record">Class</a></li> <li class="navBarCell1Rev">Use</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> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/poi/hwmf/record/class-use/HwmfBitmapDib.Compression.html" target="_top">Frames</a></li> <li><a href="HwmfBitmapDib.Compression.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 Class org.apache.poi.hwmf.record.HwmfBitmapDib.Compression" class="title">Uses of Class<br>org.apache.poi.hwmf.record.HwmfBitmapDib.Compression</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html" title="enum in org.apache.poi.hwmf.record">HwmfBitmapDib.Compression</a></span><span class="tabEnd">&nbsp;</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.apache.poi.hwmf.record">org.apache.poi.hwmf.record</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.poi.hwmf.record"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html" title="enum in org.apache.poi.hwmf.record">HwmfBitmapDib.Compression</a> in <a href="../../../../../../org/apache/poi/hwmf/record/package-summary.html">org.apache.poi.hwmf.record</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/apache/poi/hwmf/record/package-summary.html">org.apache.poi.hwmf.record</a> that return <a href="../../../../../../org/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html" title="enum in org.apache.poi.hwmf.record">HwmfBitmapDib.Compression</a></span><span class="tabEnd">&nbsp;</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>static <a href="../../../../../../org/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html" title="enum in org.apache.poi.hwmf.record">HwmfBitmapDib.Compression</a></code></td> <td class="colLast"><span class="strong">HwmfBitmapDib.Compression.</span><code><strong><a href="../../../../../../org/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../../org/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html" title="enum in org.apache.poi.hwmf.record">HwmfBitmapDib.Compression</a>[]</code></td> <td class="colLast"><span class="strong">HwmfBitmapDib.Compression.</span><code><strong><a href="../../../../../../org/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html#values()">values</a></strong>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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/apache/poi/hwmf/record/HwmfBitmapDib.Compression.html" title="enum in org.apache.poi.hwmf.record">Class</a></li> <li class="navBarCell1Rev">Use</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> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/poi/hwmf/record/class-use/HwmfBitmapDib.Compression.html" target="_top">Frames</a></li> <li><a href="HwmfBitmapDib.Compression.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> <i>Copyright 2016 The Apache Software Foundation or its licensors, as applicable.</i> </small></p> </body> </html>
tommylsh/test20170719
Desktop/tool/poi-bin-3.15-20160924/poi-3.15/docs/apidocs/org/apache/poi/hwmf/record/class-use/HwmfBitmapDib.Compression.html
HTML
epl-1.0
7,262
/* * This file is part of the Jikes RVM project (http://jikesrvm.org). * * This file is licensed to You under the Eclipse Public License (EPL); * You may not use this file except in compliance with the License. You * may obtain a copy of the License at * * http://www.opensource.org/licenses/eclipse-1.0.php * * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. */ package org.vmmagic.unboxed; import org.vmmagic.pragma.*; import org.jikesrvm.VM; import org.jikesrvm.objectmodel.RuntimeTable; /** * The VM front end is not capable of correct handling an array of Address, Word, .... * In the boot image writer we provide special types to handle these situations. */ @Uninterruptible public final class OffsetArray implements RuntimeTable<Offset> { private final Offset[] data; @Interruptible public static OffsetArray create(int size) { if (VM.runningVM) VM._assert(VM.NOT_REACHED); // should be hijacked return new OffsetArray(size); } private OffsetArray(int size) { data = new Offset[size]; Offset zero = Offset.zero(); for (int i=0; i<size; i++) { data[i] = zero; } } @Inline public Offset get(int index) { if (VM.VerifyAssertions && (VM.runningVM || VM.writingImage)) VM._assert(VM.NOT_REACHED); // should be hijacked return data[index]; } @Inline public void set(int index, Offset v) { if (VM.VerifyAssertions && (VM.runningVM || VM.writingImage)) VM._assert(VM.NOT_REACHED); // should be hijacked data[index] = v; } @Inline public int length() { if (VM.VerifyAssertions && (VM.runningVM || VM.writingImage)) VM._assert(VM.NOT_REACHED); // should be hijacked return data.length; } @Inline public Offset[] getBacking() { if (!VM.writingImage) VM.sysFail("OffsetArray.getBacking called when not writing boot image"); return data; } }
CodeOffloading/JikesRVM-CCO
jikesrvm-3.1.3/tools/bootImageWriter/vmmagic/src/org/vmmagic/unboxed/OffsetArray.java
Java
epl-1.0
1,934
JCrypTool Crypto ======= The **JCrypTool Crypto** repository contains all crypto plug-ins for JCrypTool: **Algorithms** (classic, modern and XML Security), **Analysis**, **Games** and **Visualizations**. Basic crypto features are included in this repository too. These projects require the plug-ins from the [JCrypTool Core](https://github.com/jcryptool/core) repository to compile and to run. ##Contributing Every developer is welcome to join the JCrypTool community. Have a look at our [wiki](https://github.com/jcryptool/core/wiki) to see how you can join our growing community. ## More Information Have a look at our [wiki](https://github.com/jcryptool/core/wiki) for more information, especially the [Getting started as a JCrypTool Developer](https://github.com/jcryptool/core/wiki/Getting-started-as-a-JCrypTool-Developer) page. Feel free to ask any question you might have in our [developers group](http://groups.google.com/group/jcryptool-developers). General information on the CrypTool and JCrypTool projects is available in the [CrypTool](http://www.cryptool.org) portal. ## Downloads JCrypTool downloads are available as [weekly builds](http://www.cryptool.org/en/jct-downloads-en/jct-downloads-weekly-en) (unstable, build automatically every Saturday based on the **develop** branch) and as [release builds](http://www.cryptool.org/en/jct-downloads-en/jct-downloads-stable-en) (stable). ##Meta [![Build Status](https://travis-ci.org/jcryptool/core.svg)](https://travis-ci.org/jcryptool/core) [![Gitter](http://img.shields.io/badge/gitter-join%20chat-1dce73.svg)](https://gitter.im/dschadow/jcryptool)
ChristophSonnberger/crypto
readme.md
Markdown
epl-1.0
1,620
/******************************************************************************* * Copyright (c) 2013 Tasktop Technologies and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * David Green - initial API and implementation *******************************************************************************/ package org.eclipse.mylyn.wikitext.core.parser.builder; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.Arrays; import java.util.List; import org.eclipse.mylyn.wikitext.core.parser.Attributes; import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.BlockType; import org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder.SpanType; import org.eclipse.mylyn.wikitext.core.parser.HeadingAttributes; import org.eclipse.mylyn.wikitext.core.parser.ImageAttributes; import org.eclipse.mylyn.wikitext.core.parser.LinkAttributes; import org.eclipse.mylyn.wikitext.core.parser.builder.event.AcronymEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.BeginBlockEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.BeginDocumentEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.BeginHeadingEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.BeginSpanEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.CharactersEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.CharactersUnescapedEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.DocumentBuilderEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.DocumentBuilderEvents; import org.eclipse.mylyn.wikitext.core.parser.builder.event.EndBlockEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.EndDocumentEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.EndHeadingEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.EndSpanEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.EntityReferenceEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.ImageEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.ImageLinkEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.LineBreakEvent; import org.eclipse.mylyn.wikitext.core.parser.builder.event.LinkEvent; import org.junit.Test; public class EventDocumentBuilderTest { private final EventDocumentBuilder builder = new EventDocumentBuilder(); @Test public void create() { DocumentBuilderEvents events = builder.getDocumentBuilderEvents(); assertNotNull(events); assertTrue(events.getEvents().isEmpty()); } @Test public void beginDocument() { builder.beginDocument(); assertEvents(new BeginDocumentEvent()); } @Test public void endDocument() { builder.endDocument(); assertEvents(new EndDocumentEvent()); } @Test public void beginBlock() { builder.beginBlock(BlockType.PREFORMATTED, new Attributes()); assertEvents(new BeginBlockEvent(BlockType.PREFORMATTED, new Attributes())); } @Test public void endBlock() { builder.endBlock(); assertEvents(new EndBlockEvent()); } @Test public void beginSpan() { builder.beginSpan(SpanType.DELETED, new Attributes()); assertEvents(new BeginSpanEvent(SpanType.DELETED, new Attributes())); } @Test public void endSpan() { builder.endSpan(); assertEvents(new EndSpanEvent()); } @Test public void beginHeading() { builder.beginHeading(3, new HeadingAttributes()); assertEvents(new BeginHeadingEvent(3, new HeadingAttributes())); } @Test public void endHeading() { builder.endHeading(); assertEvents(new EndHeadingEvent()); } @Test public void characters() { builder.characters("test 123"); assertEvents(new CharactersEvent("test 123")); } @Test public void charactersUnescaped() { builder.charactersUnescaped("test 123"); assertEvents(new CharactersUnescapedEvent("test 123")); } @Test public void acronym() { builder.acronym("one", "two"); assertEvents(new AcronymEvent("one", "two")); } @Test public void entityReference() { builder.entityReference("amp"); assertEvents(new EntityReferenceEvent("amp")); } @Test public void image() { builder.image(new ImageAttributes(), "http://example.com/foo.png"); assertEvents(new ImageEvent(new ImageAttributes(), "http://example.com/foo.png")); } @Test public void imageLink() { builder.imageLink(new LinkAttributes(), new ImageAttributes(), "https://example.com", "http://example.com/foo.png"); assertEvents(new ImageLinkEvent(new LinkAttributes(), new ImageAttributes(), "https://example.com", "http://example.com/foo.png")); } @Test public void link() { builder.link(new LinkAttributes(), "https://example.com", "test"); assertEvents(new LinkEvent(new LinkAttributes(), "https://example.com", "test")); } @Test public void lineBreak() { builder.lineBreak(); assertEvents(new LineBreakEvent()); } private void assertEvents(DocumentBuilderEvent... events) { List<DocumentBuilderEvent> expectedEvents = Arrays.asList(events); assertEquals(expectedEvents, builder.getDocumentBuilderEvents().getEvents()); EventDocumentBuilder builder2 = new EventDocumentBuilder(); for (DocumentBuilderEvent event : events) { event.invoke(builder2); } assertEquals(expectedEvents, builder2.getDocumentBuilderEvents().getEvents()); } }
elelpublic/wikitext-all
src/org.eclipse.mylyn.wikitext.core.tests/src/org/eclipse/mylyn/wikitext/core/parser/builder/EventDocumentBuilderTest.java
Java
epl-1.0
5,620
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2010-2014 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * http://glassfish.java.net/public/CDDL+GPL_1_1.html * or packager/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at packager/legal/LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package org.glassfish.jersey.server.model; import java.lang.reflect.Modifier; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; import javax.ws.rs.Path; import org.glassfish.jersey.Severity; import org.glassfish.jersey.internal.Errors; import org.glassfish.jersey.internal.util.collection.Value; import org.glassfish.jersey.internal.util.collection.Values; import org.glassfish.jersey.server.internal.LocalizationMessages; import org.glassfish.jersey.server.model.internal.ModelHelper; import org.glassfish.jersey.uri.PathPattern; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Sets; /** * Model of a single resource component. * <p> * Resource component model represents a collection of {@link ResourceMethod methods} * grouped under the same parent request path template. {@code Resource} class is also * the main entry point to the programmatic resource modeling API that provides ability * to programmatically extend the existing JAX-RS annotated resource classes or build * new resource models that may be utilized by Jersey runtime. * </p> * <p> * For example: * <pre> * &#64;Path("hello") * public class HelloResource { * &#64;GET * &#64;Produces("text/plain") * public String sayHello() { * return "Hello!"; * } * } * * ... * * // Register the annotated resource. * ResourceConfig resourceConfig = new ResourceConfig(HelloResource.class); * * // Add new "hello2" resource using the annotated resource class * // and overriding the resource path. * Resource.Builder resourceBuilder = * Resource.builder(HelloResource.class, new LinkedList&lt;ResourceModelIssue&gt;()) * .path("hello2"); * * // Add a new (virtual) sub-resource method to the "hello2" resource. * resourceBuilder.addChildResource("world").addMethod("GET") * .produces("text/plain") * .handledBy(new Inflector&lt;Request, String&gt;() { * &#64;Override * public String apply(Request request) { * return "Hello World!"; * } * }); * * // Register the new programmatic resource in the application's configuration. * resourceConfig.registerResources(resourceBuilder.build()); * </pre> * The following table illustrates the supported requests and provided responses * for the application configured in the example above. * <table> * <tr> * <th>Request</th><th>Response</th><th>Method invoked</th> * </tr> * <tr> * <td>{@code "GET /hello"}</td><td>{@code "Hello!"}</td><td>{@code HelloResource.sayHello()}</td> * </tr> * <tr> * <td>{@code "GET /hello2"}</td><td>{@code "Hello!"}</td><td>{@code HelloResource.sayHello()}</td> * </tr> * <tr> * <td>{@code "GET /hello2/world"}</td><td>{@code "Hello World!"}</td><td>{@code Inflector.apply()}</td> * </tr> * </table> * </p> * * @author Marek Potociar (marek.potociar at oracle.com) * @author Miroslav Fuksa (miroslav.fuksa at oracle.com) */ public final class Resource implements Routed, ResourceModelComponent { /** * Immutable resource data holder. */ private static class Data { private final List<String> names; private final String path; private final PathPattern pathPattern; private final List<ResourceMethod.Data> resourceMethods; private final ResourceMethod.Data locator; private final List<Resource.Data> childResources; private final Set<Class<?>> handlerClasses; private final Set<Object> handlerInstances; private final boolean extended; /** * Create a new immutable resource data holder from the supplied parameters. * * @param names resource names. * @param path resource path. * @param resourceMethods child resource methods. * @param locator child resource locator. * @param childResources child sub-resources. * @param handlerClasses handler classes handling the resource methods. * @param handlerInstances handler instances handling the resource methods. * @param extended */ private Data( final List<String> names, final String path, final List<ResourceMethod.Data> resourceMethods, final ResourceMethod.Data locator, final List<Data> childResources, final Set<Class<?>> handlerClasses, final Set<Object> handlerInstances, boolean extended) { this.extended = extended; this.names = immutableCopy(names); this.path = path; this.pathPattern = (path == null || path.isEmpty()) ? PathPattern.OPEN_ROOT_PATH_PATTERN : new PathPattern(path, PathPattern.RightHandPath.capturingZeroOrMoreSegments); this.resourceMethods = Resource.immutableCopy(resourceMethods); this.locator = locator; this.childResources = Collections.unmodifiableList(childResources); // no need to deep-copy the list this.handlerClasses = Resource.immutableCopy(handlerClasses); this.handlerInstances = Resource.immutableCopy(handlerInstances); } @Override public String toString() { return "Resource{" + ((path == null) ? "[unbound], " : "\"" + path + "\", ") + childResources.size() + " child resources, " + resourceMethods.size() + " resource methods, " + (locator == null ? "0" : "1") + " sub-resource locator, " + handlerClasses.size() + " method handler classes, " + handlerInstances.size() + " method handler instances" + '}'; } } /** * Resource model component builder. */ public static final class Builder { private List<String> names; private String path; private final Set<ResourceMethod.Builder> methodBuilders; private final Set<Resource.Builder> childResourceBuilders; private final List<Resource.Data> childResources; private final List<ResourceMethod.Data> resourceMethods; private ResourceMethod.Data resourceLocator; private final Set<Class<?>> handlerClasses; private final Set<Object> handlerInstances; private final Resource.Builder parentResource; private boolean extended; private Builder(final Resource.Builder parentResource) { this.methodBuilders = Sets.newIdentityHashSet(); this.childResourceBuilders = Sets.newIdentityHashSet(); this.childResources = Lists.newLinkedList(); this.resourceMethods = Lists.newLinkedList(); this.handlerClasses = Sets.newIdentityHashSet(); this.handlerInstances = Sets.newIdentityHashSet(); this.parentResource = parentResource; name("[unnamed]"); } private Builder(final String path) { this((Resource.Builder) null); path(path); } private Builder(final String path, final Resource.Builder parentResource) { this(parentResource); this.path = path; } private Builder() { this((Resource.Builder) null); } private boolean isEmpty() { return this.path == null && methodBuilders.isEmpty() && childResourceBuilders.isEmpty() && resourceMethods.isEmpty() && childResources.isEmpty() && resourceLocator == null; } /** * Define a new name of the built resource. * <p/> * The resource model name is typically used for reporting * purposes (e.g. validation etc.). * * @param name new name of the resource. * @return updated builder object. * @see org.glassfish.jersey.server.model.Resource#getName() */ public Builder name(final String name) { this.names = Lists.newArrayList(name); return this; } /** * Define a new path for the built resource. * <p/> * NOTE: Invoking this method marks a resource as a root resource. * * @param path new path for the resource. * @return updated builder object. */ public Builder path(final String path) { this.path = path; return this; } /** * Add a new method model to the resource for processing requests of * the specified HTTP method. * <p/> * The returned builder is automatically bound to the the resource. It is * not necessary to invoke the {@link ResourceMethod.Builder#build() build()} * method on the method builder after setting all the data. This will be * done automatically when the resource is built. * * @param httpMethod HTTP method that will be processed by the method. * @return a new resource method builder. */ public ResourceMethod.Builder addMethod(final String httpMethod) { ResourceMethod.Builder builder = new ResourceMethod.Builder(this); methodBuilders.add(builder); return builder.httpMethod(httpMethod); } /** * Add a new arbitrary method model to the resource. * <p/> * The returned builder is automatically bound to the the resource. It is * not necessary to invoke the {@link ResourceMethod.Builder#build() build()} * method on the method builder after setting all the data. This will be * done automatically when the resource is built. * * @return a new resource method builder. */ public ResourceMethod.Builder addMethod() { ResourceMethod.Builder builder = new ResourceMethod.Builder(this); methodBuilders.add(builder); return builder; } /** * Add a new method model that is a copy of the given {@code resourceMethod}. * <p/> * The returned builder is automatically bound to the the resource. It is * not necessary to invoke the {@link ResourceMethod.Builder#build() build()} * method on the method builder after setting all the data. This will be * done automatically when the resource is built. * * @param resourceMethod The resource method based on which the new method builder * should be created. * * @return a new resource method builder. */ public ResourceMethod.Builder addMethod(ResourceMethod resourceMethod) { ResourceMethod.Builder builder = new ResourceMethod.Builder(this, resourceMethod); methodBuilders.add(builder); return builder; } /** * Add a new child resource to the resource. * <p/> * The returned builder is automatically bound to the the resource. It is * not necessary to invoke the {@link Resource.Builder#build() build()} * method on the resource builder after setting all the data. This will be * done automatically when the resource is built. * * @param relativePath The path of the new child resource relative to this resource. * @return child resource builder. */ public Builder addChildResource(String relativePath) { if (this.parentResource != null) { throw new IllegalStateException(LocalizationMessages.RESOURCE_ADD_CHILD_ALREADY_CHILD()); } final Builder resourceBuilder = new Builder(relativePath, this); childResourceBuilders.add(resourceBuilder); return resourceBuilder; } /** * Add an existing Resource as a child resource of current resource. * * @param resource Resource to be added as child resource. */ public void addChildResource(Resource resource) { this.childResources.add(resource.data); } /** * Merge methods from a given resource model into this resource model builder. * * @param resource to be merged into this resource model builder. * @return updated builder object. */ public Builder mergeWith(final Resource resource) { mergeWith(resource.data); return this; } /** * Set the flag indicating whether the resource is extended or is a core of exposed RESTful API. * The method defines the * flag available at {@link org.glassfish.jersey.server.model.Resource#isExtended()}. * <p> * Extended resource model components are helper components that are not considered as a core of a * RESTful API. These can be for example {@code OPTIONS} {@link ResourceMethod resource methods} * added by {@link org.glassfish.jersey.server.model.ModelProcessor model processors} * or {@code application.wadl} resource producing the WADL. Both resource are rather supportive * than the core of RESTful API. * </p> * <p> * If not set the resource will not be defined as extended by default. * </p> * * @param extended If {@code true} then resource is marked as extended. * @return updated builder object. * @see org.glassfish.jersey.server.model.ExtendedResource * * @since 2.5.1 */ public Builder extended(boolean extended) { this.extended = extended; return this; } /** * Get the flag indicating whether the resource method is extended or is a core of exposed RESTful API. * * @return {@code true} if the method is extended. */ /* package */ boolean isExtended() { return extended; } private Builder mergeWith(final Resource.Data resourceData) { this.resourceMethods.addAll(resourceData.resourceMethods); this.childResources.addAll(resourceData.childResources); if (resourceLocator != null && resourceData.locator != null) { Errors.processWithException(new Runnable() { @Override public void run() { Errors.error( this, LocalizationMessages.RESOURCE_MERGE_CONFLICT_LOCATORS(Builder.this, resourceData, path), Severity.FATAL); } }); } else if (resourceData.locator != null) { this.resourceLocator = resourceData.locator; } this.handlerClasses.addAll(resourceData.handlerClasses); this.handlerInstances.addAll(resourceData.handlerInstances); this.names.addAll(resourceData.names); return this; } /** * Merge methods from a given resource model builder into this resource model * builder. * <p> * NOTE: Any "open" method builders in the supplied {@code resourceBuilder} that have * not been {@link org.glassfish.jersey.server.model.ResourceMethod.Builder#build() * explicitly converted to method models} will be closed as part of this merge operation * before merging the resource builder instances. * </p> * * @param resourceBuilder to be merged into this resource model builder. * @return updated builder object. */ public Builder mergeWith(final Builder resourceBuilder) { resourceBuilder.processMethodBuilders(); this.resourceMethods.addAll(resourceBuilder.resourceMethods); this.childResources.addAll(resourceBuilder.childResources); if (Resource.Builder.this.resourceLocator != null && resourceBuilder.resourceLocator != null) { Errors.processWithException(new Runnable() { @Override public void run() { Errors.warning(this, LocalizationMessages.RESOURCE_MERGE_CONFLICT_LOCATORS(Resource.Builder.this, resourceBuilder, path)); } }); } else if (resourceBuilder.resourceLocator != null) { this.resourceLocator = resourceBuilder.resourceLocator; } this.handlerClasses.addAll(resourceBuilder.handlerClasses); this.handlerInstances.addAll(resourceBuilder.handlerInstances); this.names.addAll(resourceBuilder.names); return this; } /** * Called when a new resource, sub-resource and sub-resource locator method * was built and should be registered with the resource builder. * <p> * This is a friend call-back API exposed for a use by a {@link ResourceMethod.Builder * ResourceMethod.Builder}. * </p> * * @param builder builder instance that built the method. * @param methodData new resource, sub-resource or sub-resource locator */ void onBuildMethod(ResourceMethod.Builder builder, ResourceMethod.Data methodData) { Preconditions.checkState(methodBuilders.remove(builder), "Resource.Builder.onBuildMethod() invoked from a resource method builder " + "that is not registered in the resource builder instance."); switch (methodData.getType()) { case RESOURCE_METHOD: resourceMethods.add(methodData); break; case SUB_RESOURCE_LOCATOR: if (resourceLocator != null) { Errors.processWithException(new Runnable() { @Override public void run() { Errors.error( this, LocalizationMessages.AMBIGUOUS_SRLS(this, path), Severity.FATAL); } }); } resourceLocator = methodData; break; } final MethodHandler methodHandler = methodData.getInvocable().getHandler(); if (methodHandler.isClassBased()) { handlerClasses.add(methodHandler.getHandlerClass()); } else { handlerInstances.add(methodHandler.getHandlerInstance()); } } private void onBuildChildResource(Builder childResourceBuilder, Resource.Data childResourceData) { Preconditions.checkState(childResourceBuilders.remove(childResourceBuilder), "Resource.Builder.onBuildChildResource() invoked from a resource builder " + "that is not registered in the resource builder instance as a child resource builder."); childResources.add(childResourceData); } private List<Resource.Data> mergeResources(List<Resource.Data> resources) { List<Resource.Data> mergedResources = Lists.newArrayList(); for (int i = 0; i < resources.size(); i++) { Resource.Data outer = resources.get(i); Resource.Builder builder = null; for (int j = i + 1; j < resources.size(); j++) { Resource.Data inner = resources.get(j); if (outer.path.equals(inner.path)) { if (builder == null) { builder = Resource.builder(outer); } builder.mergeWith(inner); resources.remove(j); j--; } } if (builder == null) { mergedResources.add(outer); } else { mergedResources.add(builder.buildResourceData()); } } return mergedResources; } private Data buildResourceData() { if (parentResource != null && parentResource.isExtended()) { this.extended = true; } processMethodBuilders(); processChildResourceBuilders(); final List<Data> mergedChildResources = mergeResources(childResources); Set<Class<?>> classes = Sets.newHashSet(handlerClasses); Set<Object> instances = Sets.newHashSet(handlerInstances); for (Data childResource : mergedChildResources) { classes.addAll(childResource.handlerClasses); instances.addAll(childResource.handlerInstances); } if (areAllMembersExtended(mergedChildResources)) { extended = true; } final Data resourceData = new Data( names, path, resourceMethods, resourceLocator, mergedChildResources, classes, instances, extended); if (parentResource != null) { parentResource.onBuildChildResource(this, resourceData); } return resourceData; } private boolean areAllMembersExtended(List<Data> mergedChildResources) { boolean allExtended = true; for (ResourceMethod.Data resourceMethod : resourceMethods) { if (!resourceMethod.isExtended()) { allExtended = false; } } if (resourceLocator != null && !resourceLocator.isExtended()) { allExtended = false; } for (Data childResource : mergedChildResources) { if (!childResource.extended) { allExtended = false; } } return allExtended; } /** * Build a new resource model. * * @return new (immutable) resource model. */ public Resource build() { final Data resourceData = buildResourceData(); return new Resource(null, resourceData); } private void processMethodBuilders() { // We have to iterate the set this way to prevent ConcurrentModificationExceptions // caused by the nested invocation of Set.remove(...) in Resource.Builder.onBuildMethod(...). while (!methodBuilders.isEmpty()) { methodBuilders.iterator().next().build(); } } private void processChildResourceBuilders() { // We have to iterate the set this way to prevent ConcurrentModificationExceptions // caused by the nested invocation of Set.remove(...) in Resource.Builder.onBuildChildResource(...). while (!childResourceBuilders.isEmpty()) { childResourceBuilders.iterator().next().build(); } } } /** * Get a new unbound resource model builder. * * @return new unbound resource model builder. * @see Resource.Builder#path(java.lang.String) */ public static Builder builder() { return new Builder(); } /** * Get a new resource model builder for a resource bound to a given path. * * @param path resource path. * @return new resource model builder. * @see Resource.Builder#path(java.lang.String) */ public static Builder builder(final String path) { return new Builder(path); } /** * Creates a {@link Builder resource builder} instance from the list of {@code resource} which can be merged * into a single resource. It must be possible to merge the {@code resources} into a single valid resource. * For example all resources must have the same {@link Resource#getPath() path}, they cannot have ambiguous methods * on the same path, etc. * * @param resources Resources with the same path. * @return Resource builder initialized from merged resources. */ public static Builder builder(List<Resource> resources) { if (resources == null || resources.isEmpty()) { return builder(); } final Iterator<Resource> it = resources.iterator(); Resource.Data resourceData = it.next().data; Builder builder = Resource.builder(resourceData); String path = resourceData.path; while (it.hasNext()) { resourceData = it.next().data; if ((resourceData.path == null && path == null) || (path != null && path.equals(resourceData.path))) { builder.mergeWith(resourceData); } else { throw new IllegalArgumentException(LocalizationMessages.ERROR_RESOURCES_CANNOT_MERGE()); } } return builder; } /** * Create a resource model builder initialized by introspecting an annotated * JAX-RS resource class. * * @param resourceClass resource class to be modelled. * @return resource model builder initialized by the class or {@code null} if the * class does not represent a resource. */ public static Builder builder(Class<?> resourceClass) { return builder(resourceClass, false); } /** * Create a resource model builder initialized by introspecting an annotated * JAX-RS resource class. * * @param resourceClass resource class to be modelled. * @param disableValidation if set to {@code true}, then any model validation checks will be disabled. * @return resource model builder initialized by the class or {@code null} if the * class does not represent a resource. */ public static Builder builder(Class<?> resourceClass, boolean disableValidation) { final Builder builder = new IntrospectionModeller(resourceClass, disableValidation).createResourceBuilder(); return builder.isEmpty() ? null : builder; } /** * Create a resource model initialized by introspecting an annotated * JAX-RS resource class. * * @param resourceClass resource class to be modelled. * @return resource model initialized by the class or {@code null} if the * class does not represent a resource. */ public static Resource from(Class<?> resourceClass) { return from(resourceClass, false); } /** * Create a resource model initialized by introspecting an annotated * JAX-RS resource class. * * @param resourceClass resource class to be modelled. * @param disableValidation if set to {@code true}, then any model validation checks will be disabled. * @return resource model initialized by the class or {@code null} if the * class does not represent a resource. */ public static Resource from(Class<?> resourceClass, boolean disableValidation) { final Builder builder = new IntrospectionModeller(resourceClass, disableValidation).createResourceBuilder(); return builder.isEmpty() ? null : builder.build(); } /** * Check if the class is acceptable as a JAX-RS provider or resource. * <p/> * Method returns {@code false} if the class is either * <ul> * <li>abstract</li> * <li>interface</li> * <li>annotation</li> * <li>primitive</li> * <li>local class</li> * <li>non-static member class</li> * </ul> * * @param c class to be checked. * @return {@code true} if the class is an acceptable JAX-RS provider or * resource, {@code false} otherwise. */ public static boolean isAcceptable(Class<?> c) { return !((c.getModifiers() & Modifier.ABSTRACT) != 0 || c.isPrimitive() || c.isAnnotation() || c.isInterface() || c.isLocalClass() || (c.isMemberClass() && (c.getModifiers() & Modifier.STATIC) == 0)); } /** * Get the resource class {@link Path @Path} annotation. * <p/> * May return {@code null} in case there is no {@code @Path} annotation on the resource. * * @param resourceClass resource class. * @return {@code @Path} annotation instance if present on the resource class (i.e. * the class is a root resource class), or {@code null} otherwise. */ public static Path getPath(Class<?> resourceClass) { return ModelHelper.getAnnotatedResourceClass(resourceClass).getAnnotation(Path.class); } /** * Get a new resource model builder initialized from a given resource model. * * @param resource resource model initializing the resource builder. * @return new resource model builder. */ public static Builder builder(Resource resource) { return builder(resource.data); } private static Builder builder(Resource.Data resourceData) { final Builder b; if (resourceData.path == null) { b = new Builder(); } else { b = new Builder(resourceData.path); } b.resourceMethods.addAll(resourceData.resourceMethods); b.childResources.addAll(resourceData.childResources); b.resourceLocator = resourceData.locator; b.handlerClasses.addAll(resourceData.handlerClasses); b.handlerInstances.addAll(resourceData.handlerInstances); b.names.addAll(resourceData.names); return b; } private static List<Resource> transform(final Resource parent, final List<Data> list) { return Lists.transform(list, new Function<Data, Resource>() { @Override public Resource apply(Data data) { return new Resource(parent, data); } }); } private static <T> List<T> immutableCopy(List<T> list) { return list.isEmpty() ? Collections.<T>emptyList() : Collections.unmodifiableList(Lists.newArrayList(list)); } private static <T> Set<T> immutableCopy(Set<T> set) { if (set.isEmpty()) { return Collections.emptySet(); } final Set<T> result = Sets.newIdentityHashSet(); result.addAll(set); return set; } private final Resource parent; private final Data data; private final Value<String> name; private final List<ResourceMethod> resourceMethods; private final ResourceMethod locator; private final List<Resource> childResources; private Resource(final Resource parent, final Data data) { this.parent = parent; this.data = data; this.name = Values.lazy(new Value<String>() { @Override public String get() { if (data.names.size() == 1) { return data.names.get(0); } else { // return merged name StringBuilder nameBuilder = new StringBuilder("Merge of "); nameBuilder.append(data.names.toString()); return nameBuilder.toString(); } } }); this.resourceMethods = immutableCopy(ResourceMethod.transform(Resource.this, data.resourceMethods)); this.locator = data.locator == null ? null : new ResourceMethod(Resource.this, data.locator); this.childResources = immutableCopy(Resource.transform(Resource.this, data.childResources)); } @Override public String getPath() { return data.path; } @Override public PathPattern getPathPattern() { return data.pathPattern; } /** * Get the parent resource for this resource model or {@code null} in case this * resource is a top-level resource and does not have a parent. * * @return parent resource or {@code null} if the resource does not have a parent. * @since 2.1 */ public Resource getParent() { return parent; } /** * Get the resource name. * <p/> * If the resource was constructed from a JAX-RS annotated resource class, * the resource name will be set to the {@link Class#getName() fully-qualified name} * of the resource class. * * @return reference JAX-RS resource handler class. */ public String getName() { return name.get(); } /** * Return a list of resource names. * * @return a list of resource names. */ public List<String> getNames() { return data.names; } /** * Provides a non-null list of resource methods available on the resource. * * @return non-null abstract resource method list. */ public List<ResourceMethod> getResourceMethods() { return resourceMethods; } /** * Provides a resource locator available on the resource. * * @return Resource locator if it is present, null otherwise. */ public ResourceMethod getResourceLocator() { return locator; } /** * Provides resource methods and resource locator are available on the resource. The list is ordered so that resource * methods are positioned first before resource locator. * * @return List of resource methods and resource locator. */ public List<ResourceMethod> getAllMethods() { final LinkedList<ResourceMethod> methodsAndLocators = Lists.newLinkedList(getResourceMethods()); final ResourceMethod loc = getResourceLocator(); if (loc != null) { methodsAndLocators.add(loc); } return methodsAndLocators; } /** * Returns the list of child resources available on this resource. * * @return Non-null list of child resources (may be empty). */ public List<Resource> getChildResources() { return childResources; } /** * Get the method handler classes for the resource methods registered on the resource. * * @return resource method handler classes. */ public Set<Class<?>> getHandlerClasses() { return data.handlerClasses; } /** * Get the method handler (singleton) instances for the resource methods registered * on the resource. * * @return resource method handler instances. */ public Set<Object> getHandlerInstances() { return data.handlerInstances; } @Override public void accept(ResourceModelVisitor visitor) { if (getParent() == null) { visitor.visitResource(this); } else { visitor.visitChildResource(this); } } /** * Get the flag indicating whether the resource is extended or is a core of exposed RESTful API. * <p> * Extended resource model components are helper components that are not considered as a core of a * RESTful API. These can be for example {@code OPTIONS} {@link ResourceMethod resource methods} * added by {@link org.glassfish.jersey.server.model.ModelProcessor model processors} * or {@code application.wadl} resource producing the WADL. Both resource are rather supportive * than the core of RESTful API. * </p> * * @return {@code true} if the resource is extended. * @see org.glassfish.jersey.server.model.ExtendedResource * * @since 2.5.1 */ public boolean isExtended() { return data.extended; } @Override public String toString() { return data.toString(); } @Override public List<? extends ResourceModelComponent> getComponents() { List<ResourceModelComponent> components = new LinkedList<ResourceModelComponent>(); components.addAll(getChildResources()); components.addAll(getResourceMethods()); final ResourceMethod resourceLocator = getResourceLocator(); if (resourceLocator != null) { components.add(resourceLocator); } return components; } }
agentlab/org.glassfish.jersey
plugins/org.glassfish.jersey.server/src/main/java/org/glassfish/jersey/server/model/Resource.java
Java
epl-1.0
38,723
/******************************************************************************* * Copyright (c) Emil Crumhorn - Hexapixel.com - emil.crumhorn@gmail.com * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * emil.crumhorn@gmail.com - initial API and implementation *******************************************************************************/ package org.eclipse.nebula.widgets.ganttchart; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Monitor; import org.eclipse.swt.widgets.Shell; public class Utils { /** * Takes a font and gives it a bold typeface. * * @param font Font to modify * @return Font with bold typeface */ public static Font applyBoldFont(final Font font) { if (font == null) { return null; } final FontData[] fontDataArray = font.getFontData(); if (fontDataArray == null) { return null; } for (int index = 0; index < fontDataArray.length; index++) { final FontData fData = fontDataArray[index]; fData.setStyle(SWT.BOLD); } return new Font(Display.getDefault(), fontDataArray); } /** * Applies a certain font size to a font. * * @param font Font to modify * @param size New font size * @return Font with new font size */ public static Font applyFontSize(final Font font, final int size) { if (font == null) { return null; } final FontData[] fontDataArray = font.getFontData(); if (fontDataArray == null) { return null; } for (int index = 0; index < fontDataArray.length; index++) { final FontData fData = fontDataArray[index]; fData.setHeight(size); } return new Font(Display.getDefault(), fontDataArray); } /** * Centers a dialog (Shell) on the <b>primary</b> (active) display. * * @param shell Shell to center on screen * @see Shell */ public static void centerDialogOnScreen(final Shell shell) { // do it by monitor to support dual-head cards and still center things correctly onto the screen people are on. final Monitor monitor = Display.getDefault().getPrimaryMonitor(); final Rectangle bounds = monitor.getBounds(); final int screen_x = bounds.width; final int screen_y = bounds.height; shell.setLocation(screen_x / 2 - (shell.getBounds().width / 2), screen_y / 2 - (shell.getBounds().height / 2)); } }
FranColmenero/Nebula
src/org/eclipse/nebula/widgets/ganttchart/Utils.java
Java
epl-1.0
2,667
/* * Copyright (c) 2012-2018 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation */ package org.eclipse.che.api.workspace.server.event; import static org.eclipse.che.api.workspace.shared.Constants.WORKSPACE_STATUS_CHANGED_METHOD; import java.util.Map; import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.inject.Singleton; import org.eclipse.che.api.core.notification.RemoteSubscriptionManager; import org.eclipse.che.api.workspace.shared.dto.event.WorkspaceStatusEvent; /** Send workspace events using JSON RPC to the clients */ @Singleton public class WorkspaceJsonRpcMessenger { private final RemoteSubscriptionManager remoteSubscriptionManager; @Inject public WorkspaceJsonRpcMessenger(RemoteSubscriptionManager remoteSubscriptionManager) { this.remoteSubscriptionManager = remoteSubscriptionManager; } @PostConstruct private void postConstruct() { remoteSubscriptionManager.register( WORKSPACE_STATUS_CHANGED_METHOD, WorkspaceStatusEvent.class, this::predicate); } private boolean predicate(WorkspaceStatusEvent event, Map<String, String> scope) { return event.getWorkspaceId().equals(scope.get("workspaceId")); } }
sleshchenko/che
wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/event/WorkspaceJsonRpcMessenger.java
Java
epl-1.0
1,474
/******************************************************************************* * Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Oracle - initial API and implementation * ******************************************************************************/ package org.eclipse.persistence.jpa.tests.jpql.parser; import org.junit.Test; import static org.eclipse.persistence.jpa.tests.jpql.parser.JPQLParserTester.*; @SuppressWarnings("nls") public final class ObjectExpressionTest extends JPQLParserTest { @Test public void test_JPQLQuery_01() { String query = "SELECT OBJECT(e) FROM Employee e"; SelectStatementTester selectStatement = selectStatement( select(object("e")), from("Employee", "e") ); testQuery(query, selectStatement); } @Test public void test_JPQLQuery_02() { String query = "SELECT OBJECT FROM Employee e"; ObjectExpressionTester objectExpression = object(nullExpression()); objectExpression.hasLeftParenthesis = false; objectExpression.hasRightParenthesis = false; SelectStatementTester selectStatement = selectStatement( select(objectExpression), from("Employee", "e") ); testInvalidQuery(query, selectStatement); } @Test public void test_JPQLQuery_03() { String query = "SELECT OBJECT( FROM Employee e"; ObjectExpressionTester objectExpression = object(nullExpression()); objectExpression.hasLeftParenthesis = true; objectExpression.hasRightParenthesis = false; SelectStatementTester selectStatement = selectStatement( select(objectExpression), from("Employee", "e") ); testInvalidQuery(query, selectStatement); } @Test public void test_JPQLQuery_04() { String query = "SELECT OBJECT() FROM Employee e"; ObjectExpressionTester objectExpression = object(nullExpression()); objectExpression.hasLeftParenthesis = true; objectExpression.hasRightParenthesis = true; SelectStatementTester selectStatement = selectStatement( select(object(nullExpression())), from("Employee", "e") ); testInvalidQuery(query, selectStatement); } @Test public void test_JPQLQuery_05() { String query = "SELECT OBJECT, e FROM Employee e"; ObjectExpressionTester objectExpression = object(nullExpression()); objectExpression.hasLeftParenthesis = false; objectExpression.hasRightParenthesis = false; SelectStatementTester selectStatement = selectStatement( select(objectExpression, variable("e")), from("Employee", "e") ); testInvalidQuery(query, selectStatement); } @Test public void test_JPQLQuery_06() { String query = "SELECT OBJECT(, e FROM Employee e"; ObjectExpressionTester objectExpression = object(nullExpression()); objectExpression.hasLeftParenthesis = true; objectExpression.hasRightParenthesis = false; SelectStatementTester selectStatement = selectStatement( select(objectExpression, variable("e")), from("Employee", "e") ); testInvalidQuery(query, selectStatement); } @Test public void test_JPQLQuery_07() { String query = "SELECT OBJECT), e FROM Employee e"; ObjectExpressionTester objectExpression = object(nullExpression()); objectExpression.hasLeftParenthesis = false; objectExpression.hasRightParenthesis = true; SelectStatementTester selectStatement = selectStatement( select(objectExpression, variable("e")), from("Employee", "e") ); testInvalidQuery(query, selectStatement); } }
bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs
jpa/org.eclipse.persistence.jpa.jpql.test/src/org/eclipse/persistence/jpa/tests/jpql/parser/ObjectExpressionTest.java
Java
epl-1.0
3,976
/* * Copyright (c) 2010-2012 Research In Motion Limited. All rights reserved. * * This program and the accompanying materials are made available * under the terms of the Eclipse Public License, Version 1.0, * which accompanies this distribution and is available at * * http://www.eclipse.org/legal/epl-v10.html * */ package net.rim.ejde.internal.ui.editors.locale; /** * IDisplayable interface * * @author jkeshavarzi * */ interface IDisplayable { public void display(); }
blackberry/Eclipse-JDE
net.rim.ejde/src/net/rim/ejde/internal/ui/editors/locale/IDisplayable.java
Java
epl-1.0
504
<!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_37) on Wed Jan 23 11:07:59 EST 2013 --> <TITLE> Dirichlet.Estimator (Mallet 2 API) </TITLE> <META NAME="date" CONTENT="2013-01-23"> <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="Dirichlet.Estimator (Mallet 2 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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Dirichlet.Estimator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../cc/mallet/types/Dirichlet.html" title="class in cc.mallet.types"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../cc/mallet/types/Dirichlet.MethodOfMomentsEstimator.html" title="class in cc.mallet.types"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?cc/mallet/types/Dirichlet.Estimator.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Dirichlet.Estimator.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> cc.mallet.types</FONT> <BR> Class Dirichlet.Estimator</H2> <PRE> java.lang.Object <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>cc.mallet.types.Dirichlet.Estimator</B> </PRE> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../cc/mallet/types/Dirichlet.MethodOfMomentsEstimator.html" title="class in cc.mallet.types">Dirichlet.MethodOfMomentsEstimator</A></DD> </DL> <DL> <DT><B>Enclosing class:</B><DD><A HREF="../../../cc/mallet/types/Dirichlet.html" title="class in cc.mallet.types">Dirichlet</A></DD> </DL> <HR> <DL> <DT><PRE>public abstract static class <B>Dirichlet.Estimator</B><DT>extends java.lang.Object</DL> </PRE> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../cc/mallet/types/Dirichlet.Estimator.html#Dirichlet.Estimator()">Dirichlet.Estimator</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../cc/mallet/types/Dirichlet.Estimator.html#Dirichlet.Estimator(java.util.Collection)">Dirichlet.Estimator</A></B>(java.util.Collection&lt;<A HREF="../../../cc/mallet/types/Multinomial.html" title="class in cc.mallet.types">Multinomial</A>&gt;&nbsp;multinomialsTraining)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cc/mallet/types/Dirichlet.Estimator.html#addMultinomial(cc.mallet.types.Multinomial)">addMultinomial</A></B>(<A HREF="../../../cc/mallet/types/Multinomial.html" title="class in cc.mallet.types">Multinomial</A>&nbsp;m)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>abstract &nbsp;<A HREF="../../../cc/mallet/types/Dirichlet.html" title="class in cc.mallet.types">Dirichlet</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cc/mallet/types/Dirichlet.Estimator.html#estimate()">estimate</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="Dirichlet.Estimator()"><!-- --></A><H3> Dirichlet.Estimator</H3> <PRE> public <B>Dirichlet.Estimator</B>()</PRE> <DL> </DL> <HR> <A NAME="Dirichlet.Estimator(java.util.Collection)"><!-- --></A><H3> Dirichlet.Estimator</H3> <PRE> public <B>Dirichlet.Estimator</B>(java.util.Collection&lt;<A HREF="../../../cc/mallet/types/Multinomial.html" title="class in cc.mallet.types">Multinomial</A>&gt;&nbsp;multinomialsTraining)</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="addMultinomial(cc.mallet.types.Multinomial)"><!-- --></A><H3> addMultinomial</H3> <PRE> public void <B>addMultinomial</B>(<A HREF="../../../cc/mallet/types/Multinomial.html" title="class in cc.mallet.types">Multinomial</A>&nbsp;m)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="estimate()"><!-- --></A><H3> estimate</H3> <PRE> public abstract <A HREF="../../../cc/mallet/types/Dirichlet.html" title="class in cc.mallet.types">Dirichlet</A> <B>estimate</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Dirichlet.Estimator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../cc/mallet/types/Dirichlet.html" title="class in cc.mallet.types"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../cc/mallet/types/Dirichlet.MethodOfMomentsEstimator.html" title="class in cc.mallet.types"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?cc/mallet/types/Dirichlet.Estimator.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Dirichlet.Estimator.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
burrsettles/mallet
doc/api/cc/mallet/types/Dirichlet.Estimator.html
HTML
epl-1.0
11,798
/******************************************************************************* * Copyright (c) 2012-2015 Codenvy, S.A. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Codenvy, S.A. - initial API and implementation *******************************************************************************/ package org.eclipse.che.ide.ext.github.client; import org.eclipse.che.ide.collections.Array; import org.eclipse.che.ide.collections.StringMap; import org.eclipse.che.ide.ext.github.shared.Collaborators; import org.eclipse.che.ide.ext.github.shared.GitHubIssueComment; import org.eclipse.che.ide.ext.github.shared.GitHubIssueCommentInput; import org.eclipse.che.ide.ext.github.shared.GitHubPullRequest; import org.eclipse.che.ide.ext.github.shared.GitHubPullRequestCreationInput; import org.eclipse.che.ide.ext.github.shared.GitHubPullRequestList; import org.eclipse.che.ide.ext.github.shared.GitHubRepository; import org.eclipse.che.ide.ext.github.shared.GitHubRepositoryList; import org.eclipse.che.ide.ext.github.shared.GitHubUser; import org.eclipse.che.ide.rest.AsyncRequestCallback; import javax.annotation.Nonnull; import java.util.List; /** * Client service for Samples. * * @author Oksana Vereshchaka * @author Kevin Pollet */ public interface GitHubClientService { /** * Get given repository information. * * @param user * the owner of the repository. * @param repository * the repository name. * @param callback * callback called when operation is done. */ void getRepository(@Nonnull String user, @Nonnull String repository, @Nonnull AsyncRequestCallback<GitHubRepository> callback); /** * Get list of available public and private repositories of the authorized user. * * @param callback * callback called when operation is done. */ void getRepositoriesList(@Nonnull AsyncRequestCallback<GitHubRepositoryList> callback); /** * Get list of forks for given repository * * @param user * the owner of the repository. * @param repository * the repository name. * @param callback * callback called when operation is done. */ void getForks(@Nonnull String user, @Nonnull String repository, @Nonnull AsyncRequestCallback<GitHubRepositoryList> callback); /** * Fork the given repository for the authorized user. * * @param user * the owner of the repository to fork. * @param repository * the repository name. * @param callback * callback called when operation is done. */ void fork(@Nonnull String user, @Nonnull String repository, @Nonnull AsyncRequestCallback<GitHubRepository> callback); /** * Add a comment to the issue on the given repository. * * @param user * the owner of the repository. * @param repository * the repository name. * @param issue * the issue number. * @param input * the comment. * @param callback * callback called when operation is done. */ void commentIssue(@Nonnull String user, @Nonnull String repository, @Nonnull String issue, @Nonnull GitHubIssueCommentInput input, @Nonnull AsyncRequestCallback<GitHubIssueComment> callback); /** * Get pull requests for given repository. * * @param owner * the repository owner. * @param repository * the repository name. * @param callback * callback called when operation is done. */ void getPullRequests(@Nonnull String owner, @Nonnull String repository, @Nonnull AsyncRequestCallback<GitHubPullRequestList> callback); /** * Get a pull request by id for a given repository. * * @param owner the owner of the target repository * @param repository the target repository * @param pullRequestId the Id of the pull request * @param callback the callback with either the pull request as argument or null if it doesn't exist */ void getPullRequest(@Nonnull String owner, @Nonnull String repository, @Nonnull String pullRequestId, @Nonnull AsyncRequestCallback<GitHubPullRequest> callback); /** * Create a pull request on origin repository * * @param user * the owner of the repository. * @param repository * the repository name. * @param input * the pull request information. * @param callback * callback called when operation is done. */ void createPullRequest(@Nonnull String user, @Nonnull String repository, @Nonnull GitHubPullRequestCreationInput input, @Nonnull AsyncRequestCallback<GitHubPullRequest> callback); /** * Get the list of available public repositories for a GitHub user. * * @param userName * the name of GitHub User * @param callback * callback called when operation is done. */ void getRepositoriesByUser(String userName, @Nonnull AsyncRequestCallback<GitHubRepositoryList> callback); /** * Get the list of available repositories by GitHub organization. * * @param organization * the name of GitHub organization. * @param callback * callback called when operation is done. */ void getRepositoriesByOrganization(String organization, @Nonnull AsyncRequestCallback<GitHubRepositoryList> callback); /** * Get list of available public repositories for GitHub account. * * @param account * the GitHub account. * @param callback * callback called when operation is done. */ void getRepositoriesByAccount(String account, @Nonnull AsyncRequestCallback<GitHubRepositoryList> callback); /** * Get list of collaborators of GitHub repository. For detail see GitHub REST API http://developer.github.com/v3/repos/collaborators/. * * @param user * the owner of the repository. * @param repository * the repository name. * @param callback * callback called when operation is done. */ void getCollaborators(@Nonnull String user, @Nonnull String repository, @Nonnull AsyncRequestCallback<Collaborators> callback); /** * Get the GitHub oAuth token for the pointed user. * * @param user * user's id * @param callback * callback called when operation is done. */ void getUserToken(@Nonnull String user, @Nonnull AsyncRequestCallback<String> callback); /** * Get the map of available public and private repositories of the authorized user and organizations he exists in. * * @param callback * callback called when operation is done. */ void getAllRepositories(@Nonnull AsyncRequestCallback<StringMap<Array<GitHubRepository>>> callback); /** * Get the list of the organizations, where authorized user is a member. * * @param callback * callback called when operation is done. */ void getOrganizations(@Nonnull AsyncRequestCallback<List<String>> callback); /** * Get authorized user information. * * @param callback * callback called when operation is done. */ void getUserInfo(@Nonnull AsyncRequestCallback<GitHubUser> callback); /** * Generate and upload new public key if not exist on github.com. * * @param callback * callback called when operation is done. */ void updatePublicKey(@Nonnull AsyncRequestCallback<Void> callback); }
sunix/che-plugins
plugin-github/che-plugin-github-ext-github/src/main/java/org/eclipse/che/ide/ext/github/client/GitHubClientService.java
Java
epl-1.0
8,040
/** * Copyright (c) 2012, 2016 Sme.UP and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.smeup.sys.il.expr.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.smeup.sys.il.expr.ExpressionType; import org.smeup.sys.il.expr.QBooleanExpression; import org.smeup.sys.il.expr.QExpression; import org.smeup.sys.il.expr.QExpressionVisitor; import org.smeup.sys.il.expr.QIntegratedLanguageExpressionPackage; /** * <!-- begin-user-doc --> An implementation of the model object ' * <em><b>Boolean Expression</b></em>'. <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.smeup.sys.il.expr.impl.BooleanExpressionImpl#getOperand <em>Operand</em>}</li> * </ul> * * @generated */ public class BooleanExpressionImpl extends PredicateExpressionImpl implements QBooleanExpression { /** * */ private static final long serialVersionUID = 1L; /** * The cached value of the '{@link #getOperand() <em>Operand</em>}' containment reference. * <!-- begin-user-doc --> <!-- end-user-doc --> * @see #getOperand() * @generated * @ordered */ protected QExpression operand; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ protected BooleanExpressionImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return QIntegratedLanguageExpressionPackage.Literals.BOOLEAN_EXPRESSION; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public QExpression getOperand() { return operand; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public NotificationChain basicSetOperand(QExpression newOperand, NotificationChain msgs) { QExpression oldOperand = operand; operand = newOperand; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND, oldOperand, newOperand); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void setOperand(QExpression newOperand) { if (newOperand != operand) { NotificationChain msgs = null; if (operand != null) msgs = ((InternalEObject)operand).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND, null, msgs); if (newOperand != null) msgs = ((InternalEObject)newOperand).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND, null, msgs); msgs = basicSetOperand(newOperand, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND, newOperand, newOperand)); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND: return basicSetOperand(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND: return getOperand(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND: setOperand((QExpression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND: setOperand((QExpression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case QIntegratedLanguageExpressionPackage.BOOLEAN_EXPRESSION__OPERAND: return operand != null; } return super.eIsSet(featureID); } @Override public ExpressionType getExpressionType() { return ExpressionType.BOOLEAN; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */ @Override public void accept(QExpressionVisitor visitor) { if (visitor.visit(this)) if (getOperand() != null) getOperand().accept(visitor); visitor.endVisit(this); } } // BooleanExpressionImpl
smeup/asup
org.smeup.sys.il.expr/src/org/smeup/sys/il/expr/impl/BooleanExpressionImpl.java
Java
epl-1.0
5,458
package gov.nih.nlm.uts.webservice.content; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for getTermStrings complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="getTermStrings"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="ticket" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="termId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="psf" type="{http://webservice.uts.umls.nlm.nih.gov/}psf" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "getTermStrings", propOrder = { "ticket", "version", "termId", "psf" }) public class GetTermStrings { protected String ticket; protected String version; protected String termId; protected Psf psf; /** * Gets the value of the ticket property. * * @return * possible object is * {@link String } * */ public String getTicket() { return ticket; } /** * Sets the value of the ticket property. * * @param value * allowed object is * {@link String } * */ public void setTicket(String value) { this.ticket = value; } /** * Gets the value of the version property. * * @return * possible object is * {@link String } * */ public String getVersion() { return version; } /** * Sets the value of the version property. * * @param value * allowed object is * {@link String } * */ public void setVersion(String value) { this.version = value; } /** * Gets the value of the termId property. * * @return * possible object is * {@link String } * */ public String getTermId() { return termId; } /** * Sets the value of the termId property. * * @param value * allowed object is * {@link String } * */ public void setTermId(String value) { this.termId = value; } /** * Gets the value of the psf property. * * @return * possible object is * {@link Psf } * */ public Psf getPsf() { return psf; } /** * Sets the value of the psf property. * * @param value * allowed object is * {@link Psf } * */ public void setPsf(Psf value) { this.psf = value; } }
dkincaid/clumcl
src/generated/java/gov/nih/nlm/uts/webservice/content/GetTermStrings.java
Java
epl-1.0
3,113
package org.allmyinfo.word.search.impl; import org.allmyinfo.coordinator.Coordinator; import org.allmyinfo.meaning.word.WordMeaning; import org.allmyinfo.meaning.wordparent.WordParentMeaning; import org.allmyinfo.util.osgi.EqFilter; import org.allmyinfo.util.osgi.activator.BaseActivator; import org.allmyinfo.util.osgi.activator.RequiredService; import org.allmyinfo.word.index.cp.WordIndexContextProvider; import org.allmyinfo.word.parser.WordParser; import org.allmyinfo.word.search.WordSearch; import org.eclipse.jdt.annotation.NonNull; import org.osgi.framework.BundleContext; public class Activator extends BaseActivator { public Activator() { final RequiredService wordMeaningRS = addRequiredService(WordMeaning.class.getName(), null); final RequiredService wordParentMeaningRS = addRequiredService( WordParentMeaning.class.getName(), null); final RequiredService coordinatorRS = addRequiredService(Coordinator.class.getName(), null); final RequiredService wicpRS = addRequiredService(WordIndexContextProvider.class.getName(), null); final RequiredService wpRS = addRequiredService(WordParser.class.getName(), new EqFilter( "mime-type", "text/plain")); addListener(new Listener() { @Override public void startService(final @NonNull BundleContext context) { final WordSearch service = new WordSearchImpl( context, // new WordMeaning.Reactor(context, (WordMeaning) wordMeaningRS.getInstance()), // new WordParentMeaning.Reactor(context, (WordParentMeaning) wordParentMeaningRS.getInstance()), // new Coordinator.Reactor(context, (Coordinator) coordinatorRS.getInstance()), // new WordIndexContextProvider.Reactor(context, (WordIndexContextProvider) wicpRS.getInstance()), new WordParser.Reactor(context, (WordParser) wpRS.getInstance())); Activator.this.addRegistration(context.registerService(WordSearch.class, service, null)); } @Override public void stopService(final @NonNull BundleContext context) { } @Override public String getName() { return Activator.class.getPackage().getName(); } }); } }
sschafer/atomic
org.allmyinfo.word.search.impl/src/org/allmyinfo/word/search/impl/Activator.java
Java
epl-1.0
2,131
/************************************************************ * <bsn.cl fy=2014 v=onl> * * Copyright 2014, 2015 Big Switch Networks, Inc. * * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html * * 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. * * </bsn.cl> ************************************************************ * * * ***********************************************************/ #ifndef __SFF_SFF_H__ #define __SFF_SFF_H__ #include <sff/sff_config.h> #include <AIM/aim_pvs.h> /* <auto.start.enum(ALL).header> */ /** sff_media_type */ typedef enum sff_media_type_e { SFF_MEDIA_TYPE_COPPER, SFF_MEDIA_TYPE_FIBER, SFF_MEDIA_TYPE_LAST = SFF_MEDIA_TYPE_FIBER, SFF_MEDIA_TYPE_COUNT, SFF_MEDIA_TYPE_INVALID = -1, } sff_media_type_t; /** Strings macro. */ #define SFF_MEDIA_TYPE_STRINGS \ {\ "COPPER", \ "FIBER", \ } /** Enum names. */ const char* sff_media_type_name(sff_media_type_t e); /** Enum values. */ int sff_media_type_value(const char* str, sff_media_type_t* e, int substr); /** Enum descriptions. */ const char* sff_media_type_desc(sff_media_type_t e); /** validator */ #define SFF_MEDIA_TYPE_VALID(_e) \ ( (0 <= (_e)) && ((_e) <= SFF_MEDIA_TYPE_FIBER)) /** sff_media_type_map table. */ extern aim_map_si_t sff_media_type_map[]; /** sff_media_type_desc_map table. */ extern aim_map_si_t sff_media_type_desc_map[]; /** sff_module_caps */ typedef enum sff_module_caps_e { SFF_MODULE_CAPS_F_100 = 1, SFF_MODULE_CAPS_F_1G = 2, SFF_MODULE_CAPS_F_10G = 4, SFF_MODULE_CAPS_F_40G = 8, SFF_MODULE_CAPS_F_100G = 16, } sff_module_caps_t; /** Enum names. */ const char* sff_module_caps_name(sff_module_caps_t e); /** Enum values. */ int sff_module_caps_value(const char* str, sff_module_caps_t* e, int substr); /** Enum descriptions. */ const char* sff_module_caps_desc(sff_module_caps_t e); /** Enum validator. */ int sff_module_caps_valid(sff_module_caps_t e); /** validator */ #define SFF_MODULE_CAPS_VALID(_e) \ (sff_module_caps_valid((_e))) /** sff_module_caps_map table. */ extern aim_map_si_t sff_module_caps_map[]; /** sff_module_caps_desc_map table. */ extern aim_map_si_t sff_module_caps_desc_map[]; /** sff_module_type */ typedef enum sff_module_type_e { SFF_MODULE_TYPE_100G_AOC, SFF_MODULE_TYPE_100G_BASE_CR4, SFF_MODULE_TYPE_100G_BASE_SR4, SFF_MODULE_TYPE_100G_BASE_LR4, SFF_MODULE_TYPE_100G_CWDM4, SFF_MODULE_TYPE_40G_BASE_CR4, SFF_MODULE_TYPE_40G_BASE_SR4, SFF_MODULE_TYPE_40G_BASE_LR4, SFF_MODULE_TYPE_40G_BASE_LM4, SFF_MODULE_TYPE_40G_BASE_ACTIVE, SFF_MODULE_TYPE_40G_BASE_CR, SFF_MODULE_TYPE_40G_BASE_SR2, SFF_MODULE_TYPE_10G_BASE_SR, SFF_MODULE_TYPE_10G_BASE_LR, SFF_MODULE_TYPE_10G_BASE_LRM, SFF_MODULE_TYPE_10G_BASE_ER, SFF_MODULE_TYPE_10G_BASE_CR, SFF_MODULE_TYPE_10G_BASE_SX, SFF_MODULE_TYPE_10G_BASE_LX, SFF_MODULE_TYPE_10G_BASE_ZR, SFF_MODULE_TYPE_10G_BASE_SRL, SFF_MODULE_TYPE_1G_BASE_SX, SFF_MODULE_TYPE_1G_BASE_LX, SFF_MODULE_TYPE_1G_BASE_CX, SFF_MODULE_TYPE_1G_BASE_T, SFF_MODULE_TYPE_100_BASE_LX, SFF_MODULE_TYPE_100_BASE_FX, SFF_MODULE_TYPE_LAST = SFF_MODULE_TYPE_100_BASE_FX, SFF_MODULE_TYPE_COUNT, SFF_MODULE_TYPE_INVALID = -1, } sff_module_type_t; /** Strings macro. */ #define SFF_MODULE_TYPE_STRINGS \ {\ "100G_AOC", \ "100G_BASE_CR4", \ "100G_BASE_SR4", \ "100G_BASE_LR4", \ "100G_CWDM4", \ "40G_BASE_CR4", \ "40G_BASE_SR4", \ "40G_BASE_LR4", \ "40G_BASE_LM4", \ "40G_BASE_ACTIVE", \ "40G_BASE_CR", \ "40G_BASE_SR2", \ "10G_BASE_SR", \ "10G_BASE_LR", \ "10G_BASE_LRM", \ "10G_BASE_ER", \ "10G_BASE_CR", \ "10G_BASE_SX", \ "10G_BASE_LX", \ "10G_BASE_ZR", \ "10G_BASE_SRL", \ "1G_BASE_SX", \ "1G_BASE_LX", \ "1G_BASE_CX", \ "1G_BASE_T", \ "100_BASE_LX", \ "100_BASE_FX", \ } /** Enum names. */ const char* sff_module_type_name(sff_module_type_t e); /** Enum values. */ int sff_module_type_value(const char* str, sff_module_type_t* e, int substr); /** Enum descriptions. */ const char* sff_module_type_desc(sff_module_type_t e); /** validator */ #define SFF_MODULE_TYPE_VALID(_e) \ ( (0 <= (_e)) && ((_e) <= SFF_MODULE_TYPE_100_BASE_FX)) /** sff_module_type_map table. */ extern aim_map_si_t sff_module_type_map[]; /** sff_module_type_desc_map table. */ extern aim_map_si_t sff_module_type_desc_map[]; /** sff_sfp_type */ typedef enum sff_sfp_type_e { SFF_SFP_TYPE_SFP, SFF_SFP_TYPE_QSFP, SFF_SFP_TYPE_QSFP_PLUS, SFF_SFP_TYPE_QSFP28, SFF_SFP_TYPE_LAST = SFF_SFP_TYPE_QSFP28, SFF_SFP_TYPE_COUNT, SFF_SFP_TYPE_INVALID = -1, } sff_sfp_type_t; /** Strings macro. */ #define SFF_SFP_TYPE_STRINGS \ {\ "SFP", \ "QSFP", \ "QSFP_PLUS", \ "QSFP28", \ } /** Enum names. */ const char* sff_sfp_type_name(sff_sfp_type_t e); /** Enum values. */ int sff_sfp_type_value(const char* str, sff_sfp_type_t* e, int substr); /** Enum descriptions. */ const char* sff_sfp_type_desc(sff_sfp_type_t e); /** validator */ #define SFF_SFP_TYPE_VALID(_e) \ ( (0 <= (_e)) && ((_e) <= SFF_SFP_TYPE_QSFP28)) /** sff_sfp_type_map table. */ extern aim_map_si_t sff_sfp_type_map[]; /** sff_sfp_type_desc_map table. */ extern aim_map_si_t sff_sfp_type_desc_map[]; /* <auto.end.enum(ALL).header> */ /** * @brief Determine the SFP type (from the idprom data). * @param idprom The SFF idprom. */ sff_sfp_type_t sff_sfp_type_get(const uint8_t* idprom); /** * @brief Determine the SFF module type (from the idprom data). * @param idprom The SFF idprom. */ sff_module_type_t sff_module_type_get(const uint8_t* idprom); /** * @brief Determine the SFF Media type (from the idprom data)./ * @param idprom The SFF idprom. */ sff_media_type_t sff_media_type_get(sff_module_type_t mt); /** * @brief Determine the SFF module capabilities (from the idprom data). * @param idprom The SFF idprom. * @param caps [out] Receives the capabilities. * @returns 0 on successful parse. * @returns < 0 on error. */ int sff_module_caps_get(sff_module_type_t mt, uint32_t* caps); typedef struct sff_info_s { /** Vendor Name */ char vendor[17]; /** Model Number */ char model[17]; /** Serial Number */ char serial[17]; /** SFP Type */ sff_sfp_type_t sfp_type; /** SFP Type Name */ const char* sfp_type_name; /** Module Type */ sff_module_type_t module_type; /** Module Type Name */ const char* module_type_name; /** Media Type */ sff_media_type_t media_type; /** Media Type Name */ const char* media_type_name; /** Capabilities */ sff_module_caps_t caps; /** Cable length, if available */ int length; char length_desc[16]; } sff_info_t; /** * SFF Module Information Structure */ typedef struct sff_eeprom_s { /** Raw eeprom data */ uint8_t eeprom[256]; /** computed checksums for eeprom contents */ uint8_t cc_base; uint8_t cc_ext; /** Whether this EEPROM was successfully parsed and identified. */ int identified; /** Parsed SFF Information */ sff_info_t info; } sff_eeprom_t; /** * @brief Initialize an SFF module information structure. * @param rv [out] Receives the data. * @param eeprom Raw EEPROM data. * @note if eeprom is != NULL it will be copied into rv->eeprom first. * @note if eeprom is NULL it is assumed the rv->eeprom buffer * has already been initialized. */ int sff_eeprom_parse(sff_eeprom_t* rv, uint8_t* eeprom); /** * @brief Initialize an SFF module information structure from a file. * @param rv [out] Receives thh data. * @param fname The filename. */ int sff_eeprom_parse_file(sff_eeprom_t* rv, const char* fname); /** * @brief Clear an sff_eeprom_t structure. * @param eeprom The eeprom structure. */ void sff_eeprom_invalidate(sff_eeprom_t *info); /** * @brief Determine if this is a valid SFP * (whether or not we can parse it) * @param info The info structure. * @param verbose Whether to report errors on invalid contents. */ int sff_eeprom_validate(sff_eeprom_t *info, int verbose); /** * @brief Show an sff info structure. * @param info The info structure. * @param pvs The output pvs. */ void sff_info_show(sff_info_t* info, aim_pvs_t* pvs); /** * @brief Populate an SFF info structure from a module type. */ int sff_info_from_module_type(sff_info_t* info, sff_sfp_type_t st, sff_module_type_t mt); #endif /* __SFF_SFF_H__ */
opennetworklinux/ONLP
modules/sff/module/inc/sff/sff.h
C
epl-1.0
9,042
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="copyright" content="(C) Copyright 2010"/> <meta name="DC.rights.owner" content="(C) Copyright 2010"/> <meta name="DC.Type" content="cxxClass"/> <meta name="DC.Title" content="MWindowVisibilityObserver"/> <meta name="DC.Format" content="XHTML"/> <meta name="DC.Identifier" content="GUID-A2E9D0D2-49EB-3FE0-93BA-AA9B8E60495E"/> <title>MWindowVisibilityObserver</title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <meta name="keywords" content="api"/><link rel="stylesheet" type="text/css" href="cxxref.css"/></head> <body class="cxxref" id="GUID-A2E9D0D2-49EB-3FE0-93BA-AA9B8E60495E"><a name="GUID-A2E9D0D2-49EB-3FE0-93BA-AA9B8E60495E"><!-- --></a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()">Collapse all</a> <a id="index" href="index.html">Symbian^3 Product Developer Library</a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1">&#160;</div> <script type="text/javascript"> var currentIconMode = 0; window.name="id2437088 id2437096 id2366708 id2414975 id2414979 id2414984 "; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"><a href="index.html" title="Symbian^3 Product Developer Library">Symbian^3 Product Developer Library</a> &gt;</div> <h1 class="topictitle1">MWindowVisibilityObserver Class Reference</h1> <table class="signature"><tr><td>class MWindowVisibilityObserver</td></tr></table><div class="section"></div> <div class="section member-index"><table border="0" class="member-index"><thead><tr><th colspan="2">Public Member Functions</th></tr></thead><tbody><tr><td align="right" class="code"> <a href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.html">CCoeControl</a> *</td><td><a href="#GUID-0AB983DB-EE05-3FAC-9FB1-46B6E420A075">CoeControl</a>()</td></tr><tr class="bg"><td align="right" class="code">void</td><td><a href="#GUID-20677E76-2FF5-35FB-B109-649F530A0F0A">WindowFullyVisible</a>()</td></tr><tr><td align="right" class="code">void</td><td><a href="#GUID-1BFA545E-F077-3BA8-9CD8-3BD80FEC273E">WindowNotVisible</a>()</td></tr><tr class="bg"><td align="right" class="code">void</td><td><a href="#GUID-EA752759-9402-3880-B34D-0265F225F4CA">WindowPartiallyVisible</a>()</td></tr></tbody></table></div><h1 class="pageHeading topictitle1">Member Functions Documentation</h1><div class="nested1" id="GUID-0AB983DB-EE05-3FAC-9FB1-46B6E420A075"><a name="GUID-0AB983DB-EE05-3FAC-9FB1-46B6E420A075"><!-- --></a> <h2 class="topictitle2">CoeControl()</h2> <table class="signature"><tr><td> <a href="GUID-B06F99BD-F032-3B87-AB26-5DD6EBE8C160.html">CCoeControl</a> *</td><td>CoeControl</td><td>(</td><td>)</td><td>[pure virtual]</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-20677E76-2FF5-35FB-B109-649F530A0F0A"><a name="GUID-20677E76-2FF5-35FB-B109-649F530A0F0A"><!-- --></a> <h2 class="topictitle2">WindowFullyVisible()</h2> <table class="signature"><tr><td>void</td><td>WindowFullyVisible</td><td>(</td><td>)</td><td>[pure virtual]</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-1BFA545E-F077-3BA8-9CD8-3BD80FEC273E"><a name="GUID-1BFA545E-F077-3BA8-9CD8-3BD80FEC273E"><!-- --></a> <h2 class="topictitle2">WindowNotVisible()</h2> <table class="signature"><tr><td>void</td><td>WindowNotVisible</td><td>(</td><td>)</td><td>[pure virtual]</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-EA752759-9402-3880-B34D-0265F225F4CA"><a name="GUID-EA752759-9402-3880-B34D-0265F225F4CA"><!-- --></a> <h2 class="topictitle2">WindowPartiallyVisible()</h2> <table class="signature"><tr><td>void</td><td>WindowPartiallyVisible</td><td>(</td><td>)</td><td>[pure virtual]</td></tr></table><div class="section"></div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/GUID-A2E9D0D2-49EB-3FE0-93BA-AA9B8E60495E.html
HTML
epl-1.0
4,873
package org.apache.wicket.markup.html.image.resource; import java.util.*; import org.apache.wicket.request.resource.*; import org.apache.wicket.*; import org.apache.wicket.util.parse.metapattern.parsers.*; import org.apache.wicket.util.parse.metapattern.*; public class DefaultButtonImageResourceFactory implements IResourceFactory{ public IResource newResource(final String specification,final Locale locale,final String style,final String variation){ final Parser parser=new Parser((CharSequence)specification); if(parser.matches()){ return new DefaultButtonImageResource(parser.getWidth(),parser.getHeight(),parser.getLabel()); } throw new WicketRuntimeException("DefaultButtonImageResourceFactory does not recognized the specification "+specification); } private static final class Parser extends MetaPatternParser{ private static final IntegerGroup width; private static final IntegerGroup height; private static final Group label; private static final MetaPattern pattern; public Parser(final CharSequence input){ super(Parser.pattern,input); } public String getLabel(){ return Parser.label.get(this.matcher()); } public int getWidth(){ return Parser.width.getInt(this.matcher(),-1); } public int getHeight(){ return Parser.height.getInt(this.matcher(),-1); } static{ width=new IntegerGroup(); height=new IntegerGroup(); label=new Group(MetaPattern.ANYTHING); pattern=new MetaPattern(new MetaPattern[] { new OptionalMetaPattern(new MetaPattern[] { Parser.width,MetaPattern.COMMA,Parser.height,MetaPattern.COLON }),Parser.label }); } } }
windup/windup-sample-apps
test-files/src_example/org/apache/wicket/markup/html/image/resource/DefaultButtonImageResourceFactory.java
Java
epl-1.0
1,813
/** * Copyright (c) 2016 Deutsche Telekom AG and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.eclipse.smarthome.core.thing.binding.firmware; /** * The {@link ProgressCallback} is injected into the * {@link FirmwareUpdateHandler#updateFirmware(Firmware, ProgressCallback)} operation in order to post progress * information about the firmware update process. * * @author Thomas Höfer - Initial contribution */ public interface ProgressCallback { /** * Callback operation to define the {@link ProgressStep}s for the sequence of the firmware update. So if the * operation is invoked with the following progress steps * <ul> * <li>{@link ProgressStep#DOWNLOADING}</li> * <li>{@link ProgressStep#TRANSFERRING}</li> * <li>{@link ProgressStep#UPDATING}</li> * </ul> * then this will mean that the firmware update implementation will initially download the firmware, then * it will transfer the firmware to the actual device and in a final step it will trigger the update. * * @param sequence the progress steps describing the sequence of the firmware update process (must not be null * or empty) * * @throws IllegalArgumentException if given sequence is null or empty */ void defineSequence(ProgressStep... sequence); /** * Callback operation to indicate that the next progress step is going to be executed. Following the example of the * {@link ProgressCallback#defineSequence(ProgressStep...)} operation then the first invocation of this operation * will indicate that firmware update handler is going to download the firmware, the second invocation will indicate * that the handler is going to transfer the firmware to the device and consequently the third invocation will * indicate that the handler is going to trigger the update. * * @throws IllegalStateException if * <ul> * <li>there is no further step to be executed</li> * <li>if no sequence was defined</li> * </ul> */ void next(); /** * Callback operation to indicate that the firmware update has failed. * * @param errorMessageKey the key of the error message to be internationalized (must not be null or empty) * @param arguments the arguments to be injected into the internationalized error message (can be null) * * @throws IllegalArgumentException if given error message key is null or empty */ void failed(String errorMessageKey, Object... arguments); /** * Callback operation to indicate that the firmware update was successful. */ void success(); }
adimova/smarthome
bundles/core/org.eclipse.smarthome.core.thing/src/main/java/org/eclipse/smarthome/core/thing/binding/firmware/ProgressCallback.java
Java
epl-1.0
2,920
# gif-encoder ### Description A minimal Clojure library for encoding gifs. ### Notes This is a low-level implementation of the GIF spec. It may be useful to those who would like to generate gifs from code or include the ability to render gifs from an application. It does not include any additional features, such as image format decoding, or drawing or compositing tools. The Netcape Looping Application Extension is included. The Plain Text Extension is not implemented. ### Usage See `api.cljc` for an example user-friendly interface built-on the low-level implementation, and `examples.cljc` for examples of creating gifs using that API. ### Reference * http://www.w3.org/Graphics/GIF/spec-gif89a.txt * http://www.vurdalakov.net/misc/gif/netscape-looping-application-extension ### To do * Optimize gifs. * Add options for handling color palettes. * Optimize code. ### Implementation The gif spec is encoded as a set of data structures interpreted as a schema. Several functions are provided which implement necessary algorithms, such as the LZW compression algorithm. Default values are provided for some fields. No distinction is made between default values and fixed values. And no validation is performed. And nothing is done to prevent users from changing fixed values. Higher-level code should provide a better interface. #### Several data representations are employed: 1. A declarative specification of the format as a schema. This includes the layout for the various components of the data stream with labels and types and default values. 2. An instantiation of a schema, which is essentially the same as the schema, but with all values provided. Values are something that can be interpreted to match the given type as determined in the `field->pseudo-binary` function. Usually values are an `int`, an instantiation, or a sequence of one of those. 3. A pseudo-binary representation: `[bits int]`, where bits is the number of bits to extract from int. 4. The final binary output format. Finally, anyone using this library will probably want to create a user-friendly layer that provides domain-specific data structures and functions, and then implement those by instantiating the schema and calling the functions convert the instantions to binary. See `api.cljc` for an example. #### Schema Grammar Entities are either primitive values (`bit`, `byte`, `unsigned`, and `rgb`) or one of the compound types defined in `gif_encoder.clj` (and in the official gif spec). Compound types are represented as vectors of fields, and fields are vectors like `[label type default-value]`. Type is either a single value or a vector like `[type count]`. If type is a single value, then `count` is assumed to be 1. Count can be an `int` or one of `:?`, `:+`, `:*` with the usual meanings. ## Thanks Thanks to Zach Beane for [Skippy](http://xach.com/lisp/skippy/), which I referenced heavily while writing this library. ## License Copyright © 2015 Austin Haas Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
austinhaas/gif-encoder
README.md
Markdown
epl-1.0
3,107
/** * <copyright> * </copyright> * * $Id: AmetamodelFactory.java,v 1.1 2010/02/04 09:24:53 sefftinge Exp $ */ package org.eclipse.xtext.grammarinheritance.ametamodel; import org.eclipse.emf.ecore.EFactory; /** * <!-- begin-user-doc --> * The <b>Factory</b> for the model. * It provides a create method for each non-abstract class of the model. * <!-- end-user-doc --> * @see org.eclipse.xtext.grammarinheritance.ametamodel.AmetamodelPackage * @generated */ public interface AmetamodelFactory extends EFactory { /** * The singleton instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ AmetamodelFactory eINSTANCE = org.eclipse.xtext.grammarinheritance.ametamodel.impl.AmetamodelFactoryImpl.init(); /** * Returns a new object of class '<em>AType</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return a new object of class '<em>AType</em>'. * @generated */ AType createAType(); /** * Returns a new object of class '<em>AModel</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return a new object of class '<em>AModel</em>'. * @generated */ AModel createAModel(); /** * Returns the package supported by this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the package supported by this factory. * @generated */ AmetamodelPackage getAmetamodelPackage(); } //AmetamodelFactory
miklossy/xtext-core
org.eclipse.xtext.tests/emf-gen/org/eclipse/xtext/grammarinheritance/ametamodel/AmetamodelFactory.java
Java
epl-1.0
1,425
/** * Copyright (c) 2016 NumberFour AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * NumberFour AG - Initial API and implementation */ package org.eclipse.n4js.n4JS; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>This Target</b></em>'. * <!-- end-user-doc --> * * <!-- begin-model-doc --> * Possible target to which a this expression may be bound. This is used in the type inferrer. * Note that this is not bound by local scoping, as \'this\' is not a variable (or cross reference)! * <!-- end-model-doc --> * * * @see org.eclipse.n4js.n4JS.N4JSPackage#getThisTarget() * @model abstract="true" * @generated */ public interface ThisTarget extends EObject { } // ThisTarget
lbeurerkellner/n4js
plugins/org.eclipse.n4js.model/emf-gen/org/eclipse/n4js/n4JS/ThisTarget.java
Java
epl-1.0
986
/************************************************************************************************/ /* i-Code CNES is a static code analyzer. */ /* This software is a free software, under the terms of the Eclipse Public License version 1.0. */ /* http://www.eclipse.org/legal/epl-v10.html */ /************************************************************************************************/ package fr.cnes.analysis.tools.ui.preferences; import fr.cnes.analysis.tools.ui.Activator; import fr.cnes.icode.logger.ICodeLogger; import org.eclipse.jface.preference.IPreferenceStore; /** * Container for Checker preferences used by {@link UserPreferencesService} */ public class CheckerPreferencesContainer { /** * Class name */ private static final String CLASS = CheckerPreferencesContainer.class.getName(); /** * Checker's identifier */ private String id; /** * Checker's name */ private String name; /** * Checker's enabling */ private boolean checked; /** * Checker's severity */ private String severity; /** * Checker's max value */ private Float maxValue; /** * Checker's min value */ private Float minValue; /** * Checker is a metric */ private boolean isMetric; /** * Checker language's name */ private String languageName; /** * Checker language's id */ private String languageId; /** * @param pLanguageId Checker language's id * @param pLanguageName Checker language's name * @param pId Checker's identifier * @param pName Checker's name * @param pChecked Checker's enabling * @param pSeverity Checker's severity * @param pIsMetric Checker is a metric */ public CheckerPreferencesContainer(final String pLanguageId, final String pLanguageName, final String pId, final String pName, final boolean pChecked, final String pSeverity, final boolean pIsMetric) { final String method = "CheckerPreferencesContainer"; ICodeLogger.entering(CLASS, method, new Object[]{ pLanguageId, pLanguageName, pId, pName, Boolean.valueOf(pChecked), pSeverity, Boolean.valueOf(pIsMetric) }); this.languageId = pLanguageId; this.languageName = pLanguageName; this.id = pId; this.name = pName; this.checked = pChecked; this.severity = pSeverity; this.minValue = Float.valueOf(Float.NaN); this.maxValue = Float.valueOf(Float.NaN); this.isMetric = pIsMetric; ICodeLogger.exiting(CLASS, method); } /** * @param pLanguageId Checker language's id * @param pLanguageName Checker language's name * @param pId Checker's identifier * @param pName Checker's name * @param pChecked Checker's enabling * @param pSeverity Checker's severity * @param pMinValue Checker's min value * @param pMaxValue Checker's max value * @param pIsMetric Checker is a metric */ public CheckerPreferencesContainer(final String pLanguageId, final String pLanguageName, final String pId, final String pName, final boolean pChecked, final String pSeverity, final Float pMinValue, final Float pMaxValue, final boolean pIsMetric) { final String method = "CheckerPreferencesContainer"; ICodeLogger.entering(CLASS, method, new Object[]{ pLanguageId, pLanguageName, pId, pName, Boolean.valueOf(pChecked), pSeverity, pMinValue, pMaxValue, Boolean.valueOf(pIsMetric) }); this.languageId = pLanguageId; this.languageName = pLanguageName; this.id = pId; this.name = pName; this.checked = pChecked; this.severity = pSeverity; this.minValue = pMinValue; this.maxValue = pMaxValue; this.isMetric = pIsMetric; ICodeLogger.exiting(CLASS, method); } /** * @return the id */ public final String getId() { final String method = "getId"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, id); return id; } /** * @param pId the id to set */ public final void setId(final String pId) { final String method = "setId"; ICodeLogger.entering(CLASS, method, pId); this.id = pId; ICodeLogger.exiting(CLASS, method); } /** * @return the name */ public final String getName() { final String method = "getName"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, name); return name; } /** * @param pName the name to set */ public final void setName(final String pName) { final String method = "setName"; ICodeLogger.entering(CLASS, method, pName); this.name = pName; ICodeLogger.exiting(CLASS, method); } /** * @return the checked */ public final boolean isChecked() { final String method = "isChecked"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, Boolean.valueOf(checked)); return checked; } /** * @param pChecked the checked to set */ public final void setChecked(final boolean pChecked) { final String method = "setChecked"; ICodeLogger.entering(CLASS, method, Boolean.valueOf(pChecked)); this.checked = pChecked; ICodeLogger.exiting(CLASS, method); } /** * @return the severity */ public final String getSeverity() { final String method = "getSeverity"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, severity); return severity; } /** * @param pSeverity the severity to set */ public final void setSeverity(final String pSeverity) { final String method = "setSeverity"; ICodeLogger.entering(CLASS, method, pSeverity); this.severity = pSeverity; ICodeLogger.exiting(CLASS, method); } /** * @return the maxValue */ public final Float getMaxValue() { final String method = "getMaxValue"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, maxValue); return maxValue; } /** * @param pMaxValue the maxValue to set */ public final void setMaxValue(final float pMaxValue) { final String method = "setMaxValue"; ICodeLogger.entering(CLASS, method); this.maxValue = Float.valueOf(pMaxValue); ICodeLogger.exiting(CLASS, method); } /** * @return the minValue */ public final Float getMinValue() { final String method = "getMinValue"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, minValue); return minValue; } /** * @param pMinValue the minValue to set */ public final void setMinValue(final float pMinValue) { final String method = "setMinValue"; ICodeLogger.entering(CLASS, method, Float.valueOf(pMinValue)); this.minValue = Float.valueOf(pMinValue); ICodeLogger.exiting(CLASS, method); } /** * @param languageId */ public void savePreferences() { final String method = "savePreferences"; ICodeLogger.entering(CLASS, method); final IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setValue(this.getId(), checked); store.setValue(this.getId() + UserPreferencesService.PREF_SEVERITY_KEY, this.severity); if (!this.maxValue.isNaN()) { store.setValue(this.getId() + UserPreferencesService.PREF_MAX_VALUE_KEY, this.maxValue.floatValue()); } if (!this.minValue.isNaN()) { store.setValue(this.getId() + UserPreferencesService.PREF_MIN_VALUE_KEY, this.minValue.floatValue()); } ICodeLogger.exiting(CLASS, method); } /** * Set preferences to default. */ public void setToDefault() { final String method = "setToDefault"; ICodeLogger.entering(CLASS, method); final IPreferenceStore store = Activator.getDefault().getPreferenceStore(); this.checked = store.getDefaultBoolean(this.getId()); store.setToDefault(this.getId()); this.severity = store .getDefaultString(this.getId() + UserPreferencesService.PREF_SEVERITY_KEY); store.setToDefault(this.getId() + UserPreferencesService.PREF_SEVERITY_KEY); if (this.isMetric) { this.maxValue = Float.valueOf(store.getDefaultFloat( this.getId() + UserPreferencesService.PREF_MAX_VALUE_KEY)); store.setToDefault(this.getId() + UserPreferencesService.PREF_MAX_VALUE_KEY); } if (this.isMetric) { this.minValue = Float.valueOf(store.getDefaultFloat( this.getId() + UserPreferencesService.PREF_MAX_VALUE_KEY)); store.setToDefault(this.getId() + UserPreferencesService.PREF_MIN_VALUE_KEY); } ICodeLogger.exiting(CLASS, method); } /** * Update preferences store with current values of attributes. */ public void update() { final String method = "update"; ICodeLogger.entering(CLASS, method); final IPreferenceStore store = Activator.getDefault().getPreferenceStore(); if (!store.contains(this.getId())) { this.checked = true; } else { this.checked = store.getBoolean(this.getId()); } if (!store.contains(this.getId() + UserPreferencesService.PREF_SEVERITY_KEY)) { this.severity = UserPreferencesService.PREF_SEVERITY_ERROR_VALUE; } else { this.severity = store .getString(this.getId() + UserPreferencesService.PREF_SEVERITY_KEY); } if (this.isMetric) { this.maxValue = Float.valueOf(store .getFloat(this.getId() + UserPreferencesService.PREF_MAX_VALUE_KEY)); } if (this.isMetric) { this.minValue = Float.valueOf(store .getFloat(this.getId() + UserPreferencesService.PREF_MIN_VALUE_KEY)); } ICodeLogger.exiting(CLASS, method); } /** * @return the isMetric */ public final boolean isMetric() { final String method = "isMetric"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, Boolean.valueOf(isMetric)); return isMetric; } /** * @param pIsMetric the isMetric to set */ public final void setMetric(final boolean pIsMetric) { final String method = "setMetric"; ICodeLogger.entering(CLASS, method, Boolean.valueOf(pIsMetric)); this.isMetric = pIsMetric; ICodeLogger.exiting(CLASS, method); } /** * @param pMaxValue the maxValue to set */ public final void setMaxValue(final Float pMaxValue) { final String method = "setMaxValue"; ICodeLogger.entering(CLASS, method, pMaxValue); this.maxValue = pMaxValue; ICodeLogger.exiting(CLASS, method); } /** * @param pMinValue the minValue to set */ public final void setMinValue(final Float pMinValue) { final String method = "setMinValue"; ICodeLogger.entering(CLASS, method, pMinValue); this.minValue = pMinValue; ICodeLogger.exiting(CLASS, method); } /** * @return the languageId */ public final String getLanguageId() { final String method = "getLanguageId"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, languageId); return languageId; } /** * @param pLanguageId the languageId to set */ public final void setLanguageId(final String pLanguageId) { final String method = "setLanguageId"; ICodeLogger.entering(CLASS, method, pLanguageId); this.languageId = pLanguageId; ICodeLogger.exiting(CLASS, method); } /** * @param pLanguageName the languageName to set */ public final void setLanguageName(final String pLanguageName) { final String method = "setLanguageName"; ICodeLogger.entering(CLASS, method, pLanguageName); this.languageName = pLanguageName; ICodeLogger.exiting(CLASS, method); } /** * @return the languageName */ public final String getLanguageName() { final String method = "getLanguageName"; ICodeLogger.entering(CLASS, method); ICodeLogger.exiting(CLASS, method, languageName); return languageName; } }
dupuisa/i-CodeCNES
icode-ide/fr.cnes.analysis.tools.ui/src/fr/cnes/analysis/tools/ui/preferences/CheckerPreferencesContainer.java
Java
epl-1.0
13,616
package org.botlibre.test; import java.util.HashMap; import java.util.Map; import org.botlibre.util.Utils; public class GoogleTest { static String clientId = ""; static String clientSecret = ""; static String redirectUri= ""; static String accessToken = ""; static String refreshtoken = ""; static int step = 3; /** A new token is require per request. */ static String authCode = ""; public static void main(String[] args) throws Exception { if (step == 0) { System.out.println("open this link in a web browser"); System.out.println("https://accounts.google.com/o/oauth2/auth?client_id=" + clientId + "&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/calendar.readonly&response_type=code"); } else if (step == 1) { Map<String, String> params = new HashMap<String, String>(); params.put("code", authCode); params.put("client_id", clientId); params.put("client_secret", clientSecret); params.put("redirect_uri", "urn:ietf:wg:oauth:2.0:oob"); params.put("grant_type", "authorization_code"); String result = Utils.httpPOST("https://accounts.google.com/o/oauth2/token", params); System.out.println(result); } else if (step == 2) { Map<String, String> params = new HashMap<String, String>(); params.put("refresh_token", refreshtoken); params.put("client_id", clientId); params.put("client_secret", clientSecret); //params.put("redirect_uri", "urn:ietf:wg:oauth:2.0:oob"); params.put("grant_type", "refresh_token"); String result = Utils.httpPOST("https://accounts.google.com/o/oauth2/token", params); System.out.println(result); } else if (step == 3) { //String result = Utils.httpGET("https://www.googleapis.com/calendar/v3/calendars/primary?access_token=" + accessToken); String result = Utils.httpGET("https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMax=2016-10-05T00%3A00%3A00-07%3A00&timeMin=2016-10-06T00%3A00%3A00-07%3A00&access_token=" + accessToken); System.out.println(result); } } }
BOTlibre/BOTlibre
ai-engine-test/source/org/botlibre/test/GoogleTest.java
Java
epl-1.0
2,231
/* COPYRIGHT-ENEA-SRC-R2 * ************************************************************************** * Copyright (C) 2005-2007 by Enea Software AB. * All rights reserved. * * This Software is furnished under a software license agreement and * may be used only in accordance with the terms of such agreement. * Any other use or reproduction is prohibited. No title to and * ownership of the Software is hereby transferred. * * PROPRIETARY NOTICE * This Software consists of confidential information. * Trade secret law and copyright law protect this Software. * The above notice of copyright on this Software does not indicate * any actual or intended publication of such Software. ************************************************************************** * COPYRIGHT-END */ package com.ose.system.ui.views.system; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; import com.ose.system.ui.SystemBrowserPlugin; public class AddGateDialog extends Dialog { private String address; private int port; private Text addressText; private Text portText; private CLabel errorMessageLabel; public AddGateDialog(Shell parent) { super(parent); } protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText("Add Gate"); } protected Control createContents(Composite parent) { Control contents = super.createContents(parent); loadDialogSettings(); return contents; } protected Control createDialogArea(Composite parent) { Composite comp; Composite subcomp; ModifyHandler modifyHandler; GridData gd; Label addressLabel; Label portLabel; comp = (Composite) super.createDialogArea(parent); subcomp = new Composite(comp, SWT.NONE); subcomp.setLayout(new GridLayout(2, false)); modifyHandler = new ModifyHandler(); addressLabel = new Label(subcomp, SWT.NONE); addressLabel.setText("Address:"); addressText = new Text(subcomp, SWT.SINGLE | SWT.BORDER); gd = new GridData(GridData.FILL_HORIZONTAL); gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); addressText.setLayoutData(gd); addressText.addModifyListener(modifyHandler); portLabel = new Label(subcomp, SWT.NONE); portLabel.setText("Port:"); portText = new Text(subcomp, SWT.SINGLE | SWT.BORDER); gd = new GridData(GridData.FILL_HORIZONTAL); portText.setLayoutData(gd); portText.addModifyListener(modifyHandler); errorMessageLabel = new CLabel(subcomp, SWT.NONE); gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; errorMessageLabel.setLayoutData(gd); applyDialogFont(comp); return comp; } private void loadDialogSettings() { IDialogSettings settings; IDialogSettings section; settings = SystemBrowserPlugin.getDefault().getDialogSettings(); section = settings.getSection("AddGateDialog"); if (section == null) { addressText.setText(""); portText.setText("21768"); } else { addressText.setText(section.get("address")); portText.setText(section.get("port")); addressText.selectAll(); } } private void saveDialogSettings() { IDialogSettings settings; IDialogSettings section; settings = SystemBrowserPlugin.getDefault().getDialogSettings(); section = settings.addNewSection("AddGateDialog"); section.put("address", addressText.getText().trim()); section.put("port", portText.getText().trim()); } protected void okPressed() { address = addressText.getText().trim(); try { port = Integer.parseInt(portText.getText().trim()); } catch (NumberFormatException ignore) {} saveDialogSettings(); super.okPressed(); } private void updateDialog() { String errorMessage = isAddressValid(addressText.getText()); if (errorMessage == null) { errorMessage = isPortValid(portText.getText()); } setErrorMessage(errorMessage); } private void setErrorMessage(String errorMessage) { errorMessageLabel.setText((errorMessage == null) ? "" : errorMessage); errorMessageLabel.setImage((errorMessage == null) ? null : PlatformUI.getWorkbench().getSharedImages() .getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); getButton(IDialogConstants.OK_ID).setEnabled(errorMessage == null); getShell().update(); } private String isAddressValid(String text) { String errorMessage = null; if (text.trim().length() == 0) { errorMessage = "Address not specified"; } return errorMessage; } private String isPortValid(String text) { String errorMessage = null; if (text.trim().length() == 0) { errorMessage = "Port not specified"; } else { try { Integer.parseInt(text); } catch (NumberFormatException e) { errorMessage = "Invalid port number"; } } return errorMessage; } public String getAddress() { return address; } public int getPort() { return port; } class ModifyHandler implements ModifyListener { public void modifyText(ModifyEvent event) { updateDialog(); } } }
debabratahazra/OptimaLA
Optima/com.ose.system.ui/src/com/ose/system/ui/views/system/AddGateDialog.java
Java
epl-1.0
6,128
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="copyright" content="(C) Copyright 2010"/> <meta name="DC.rights.owner" content="(C) Copyright 2010"/> <meta name="DC.Type" content="cxxStruct"/> <meta name="DC.Title" content="TLocationStatusEnvelope"/> <meta name="DC.Format" content="XHTML"/> <meta name="DC.Identifier" content="GUID-7854C1AE-A85D-356C-8D21-85704055DC48"/> <title>TLocationStatusEnvelope</title> <link type="text/css" rel="stylesheet" href="css/common.css" media="screen"/> <link type="text/css" rel="stylesheet" href="css/sdl.css" media="screen"/> <!--[if IE]> <link href="css/iefix.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <meta name="keywords" content="api"/><link rel="stylesheet" type="text/css" href="cxxref.css"/></head> <body class="cxxref" id="GUID-7854C1AE-A85D-356C-8D21-85704055DC48"><a name="GUID-7854C1AE-A85D-356C-8D21-85704055DC48"><!-- --></a> <?php include_once (CURRENT_SKIN_PATH.'/sdl_header.html'); ?> <div id="sdl_container"> <div id="leftMenu"> <div id="expandcontractdiv"> <a id="collapseTree" href="javascript:tree.collapseAll()">Collapse all</a> <a id="index" href="index.html">Symbian^3 Product Developer Library</a> </div> <iframe style="border:none" height="800" width="300" src="index-toc.html"></iframe> <div id="treeDiv1">&#160;</div> <script type="text/javascript"> var currentIconMode = 0; window.name="id2437088 id2437096 id2578593 id2705246 id2608313 id2608318 "; YAHOO.util.Event.onDOMReady(buildTree, this,true); </script> </div> <div id="sdl_content"> <div class="breadcrumb"><a href="index.html" title="Symbian^3 Product Developer Library">Symbian^3 Product Developer Library</a> &gt;</div> <h1 class="topictitle1">TLocationStatusEnvelope Struct Reference</h1> <table class="signature"><tr><td>struct TLocationStatusEnvelope</td></tr></table><div class="section"></div> <div class="section member-index"><table border="0" class="member-index"><thead><tr><th colspan="2">Public Attributes</th></tr></thead><tbody><tr><td align="right" valign="top"> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint16</a> </td><td><a href="#GUID-0D59B4E0-4810-301F-AC0A-405FE1426266">iCellId</a></td></tr><tr class="bg"><td align="right" valign="top"> <a href="GUID-78E993D5-A845-32B4-B41A-947ABEF16AA0.html">TBuf8</a>&lt; <a href="GUID-6AFBC541-F607-39E9-B84C-C2311C63A50C.html">KCountryCodeLength</a> &gt;</td><td><a href="#GUID-C8C4EAB2-453E-3329-B228-8863EA5E8487">iCountryCode</a></td></tr><tr><td align="right" valign="top"> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint16</a> </td><td><a href="#GUID-8E9DF5C3-E568-3E38-AB54-27F5FC6A0A54">iLocationAreaCode</a></td></tr><tr class="bg"><td align="right" valign="top"> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint8</a> </td><td><a href="#GUID-21368ABD-4903-3DDF-8395-78A222A218C1">iLocationStatus</a></td></tr></tbody></table></div><h1 class="pageHeading topictitle1">Member Data Documentation</h1><div class="nested1" id="GUID-0D59B4E0-4810-301F-AC0A-405FE1426266"><a name="GUID-0D59B4E0-4810-301F-AC0A-405FE1426266"><!-- --></a> <h2 class="topictitle2"> TUint16 iCellId</h2> <table class="signature"><tr><td> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint16</a> </td><td>iCellId</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-C8C4EAB2-453E-3329-B228-8863EA5E8487"><a name="GUID-C8C4EAB2-453E-3329-B228-8863EA5E8487"><!-- --></a> <h2 class="topictitle2"> TBuf8&lt; KCountryCodeLength &gt; iCountryCode</h2> <table class="signature"><tr><td> <a href="GUID-78E993D5-A845-32B4-B41A-947ABEF16AA0.html">TBuf8</a>&lt; <a href="GUID-6AFBC541-F607-39E9-B84C-C2311C63A50C.html">KCountryCodeLength</a> &gt;</td><td>iCountryCode</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-8E9DF5C3-E568-3E38-AB54-27F5FC6A0A54"><a name="GUID-8E9DF5C3-E568-3E38-AB54-27F5FC6A0A54"><!-- --></a> <h2 class="topictitle2"> TUint16 iLocationAreaCode</h2> <table class="signature"><tr><td> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint16</a> </td><td>iLocationAreaCode</td></tr></table><div class="section"></div> </div> <div class="nested1" id="GUID-21368ABD-4903-3DDF-8395-78A222A218C1"><a name="GUID-21368ABD-4903-3DDF-8395-78A222A218C1"><!-- --></a> <h2 class="topictitle2"> TUint8 iLocationStatus</h2> <table class="signature"><tr><td> <a href="GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html">TUint8</a> </td><td>iLocationStatus</td></tr></table><div class="section"></div> </div> <p class="copyright">Copyright &#169;2010 Nokia Corporation and/or its subsidiary(-ies).<br /> All rights reserved. Unless otherwise stated, these materials are provided under the terms of the <a href=" http://www.eclipse.org/legal/epl-v10.html"> Eclipse Public License v1.0</a>.</p> </div> </div> <?php include_once (CURRENT_SKIN_PATH.'/sdl_footer.html'); ?> </body> </html>
warlordh/fork_Symbian
pdk/GUID-7854C1AE-A85D-356C-8D21-85704055DC48.html
HTML
epl-1.0
5,330