blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c01241f9366abd38cb5ede9c5ebd0738a2e76f1c | 568a75e1cbdbe73af9177312e8519c419f215a94 | /Day16/代码/2/src/main/java/activity/MainActivity.java | e0814f829c98dae050c077671fdbaf9dff75e4c3 | [] | no_license | daadt/HomeWork | e272e1d4ef7ac41ef7d8272164be3e40bb8fa5ef | 883017ccd098093ae094ac11c70aafd82ef99a62 | refs/heads/master | 2022-11-11T17:54:27.657848 | 2020-06-27T14:42:40 | 2020-06-27T14:42:40 | 268,200,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,957 | java | package activity;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import com.example.douts.R;
import java.util.ArrayList;
import base.BaseActivity;
import base.CommPagerAdapter;
import bean.MainPageChangeEvent;
import bean.PauseVideoEvent;
import butterknife.BindView;
import fragment.MainFragment;
import fragment.PersonalHomeFragment;
import utils.RxBus;
/**
* create by libo
* create on 2020/5/19
* description 主页面
*/
public class MainActivity extends BaseActivity {
@BindView(R.id.viewpager)
ViewPager viewPager;
private CommPagerAdapter pagerAdapter;
private ArrayList<Fragment> fragments = new ArrayList<>();
public static int curMainPage;
private MainFragment mainFragment = new MainFragment();
private PersonalHomeFragment personalHomeFragment = new PersonalHomeFragment();
/** 上次点击返回键时间 */
private long lastTime;
/** 连续按返回键退出时间 */
private final int EXIT_TIME = 2000;
@Override
protected int setLayoutId() {
return R.layout.activity_main;
}
@Override
protected void init() {
fragments.add(mainFragment);
fragments.add(personalHomeFragment);
pagerAdapter = new CommPagerAdapter(getSupportFragmentManager(), fragments, new String[]{"",""});
viewPager.setAdapter(pagerAdapter);
//点击头像切换页面
RxBus.getDefault().toObservable(MainPageChangeEvent.class)
.subscribe((Action1<MainPageChangeEvent>) event -> {
if (viewPager != null) {
viewPager.setCurrentItem(event.getPage());
}
});
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
curMainPage = position;
if (position == 0) {
RxBus.getDefault().post(new PauseVideoEvent(true));
} else if (position == 1){
RxBus.getDefault().post(new PauseVideoEvent(false));
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
@Override
public void onBackPressed() {
//双击返回退出App
if (System.currentTimeMillis() - lastTime > EXIT_TIME) {
if (viewPager.getCurrentItem() == 1) {
viewPager.setCurrentItem(0);
}else{
Toast.makeText(getApplicationContext(), "再按一次退出", Toast.LENGTH_SHORT).show();
lastTime = System.currentTimeMillis();
}
} else {
super.onBackPressed();
}
}
}
| [
"[email protected]"
] | |
6a197b55b62deffbe6978713d9558cf900941118 | b545fe87a6823d27a2321c4c7414217327620515 | /gmall-user-manage/src/main/java/com/atguigu/gmall/gmallusermanage/service/impl/UserInfoServiceImpl.java | a9ea49ed918fa0284d970f75c202f5a81ea6f3dd | [] | no_license | Daniel19911009/gmall | 56aac73378961e5a61d25c24d9e65bf1c3f15959 | 7ae1758bf1f960ecf912b4fb2d03e35c2d8c66b5 | refs/heads/master | 2020-07-18T11:22:47.036435 | 2019-09-05T02:38:14 | 2019-09-05T02:38:14 | 206,236,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,614 | java | package com.atguigu.gmall.gmallusermanage.service.impl;
import com.atguigu.gmall.gmallusermanage.entity.UserInfo;
import com.atguigu.gmall.gmallusermanage.mapper.UserInfoMapper;
import com.atguigu.gmall.gmallusermanage.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
/**
* @author Daniel
* @create 2019--09--04--13:45
* @Description:
*/
@Service
@Slf4j
public class UserInfoServiceImpl implements UserInfoService {
@Autowired
private UserInfoMapper userInfoMapper;
@Override
public List<UserInfo> getUserInfoListAll() {
log.error("人生无常!!!!");
System.out.println("及时行乐!!!");
return userInfoMapper.selectAll();
}
@Override
public void addUser(UserInfo userInfo) {
userInfoMapper.insertSelective(userInfo);
}
@Override
public void updateUser(UserInfo userInfo) {
userInfoMapper.updateByPrimaryKeySelective(userInfo);
}
@Override
public void updateUserByName(String name, UserInfo userInfo) {
Example example = new Example(UserInfo.class);
example.createCriteria().andEqualTo("loginName",name);
userInfoMapper.updateByExampleSelective(userInfo,example);
}
@Override
public void delUser(String id) {
userInfoMapper.deleteByPrimaryKey(id);
}
@Override
public UserInfo getUserInfoById(String id) {
return userInfoMapper.selectByPrimaryKey(id);
}
}
| [
"[email protected]"
] | |
50095d1a80fdfb7a50875e372cc1d546db7fa01d | 924905abd4ccf86c56ea89774a1a3e96837fbb09 | /src/main/java/leetcode/SumTree.java | 56285e62c4ace039f8d4de9a7beb7c5a4b49bc5a | [] | no_license | tejas1996/CompetitiveCoding | a224cf8d5806ed06d7e12b5a7cccff3025ced1e2 | 81f62a44dcc5be32ddbbdc03bee3bbe9ad3249fe | refs/heads/master | 2022-01-17T22:00:12.252681 | 2019-06-23T18:15:23 | 2019-06-23T18:15:23 | 114,524,166 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,499 | java | package leetcode;
public class SumTree {
public static void main(String[] args) {
TreeNode root = formTree();
bstToGst(root);
}
public static TreeNode bstToGst(TreeNode node) {
helper(node, 0);
System.out.println("root");
return node;
}
private static int helper(TreeNode node, int sum) {
if (node.left == null && node.right == null) {
int temp = node.val;
node.val = node.val + sum;
return temp;
}
int temp = node.val;
int right = 0, left = 0;
if (node.right != null) {
right = helper(node.right, sum);
}
node.val = node.val + right + sum;
if (node.left != null) {
left = helper(node.left, node.val);
}
return temp + left + right;
}
private static TreeNode formTree() {
TreeNode four = new TreeNode(4);
TreeNode six = new TreeNode(6);
TreeNode five = new TreeNode(5);
TreeNode seven = new TreeNode(7);
TreeNode eight = new TreeNode(8);
TreeNode one = new TreeNode(1);
TreeNode zero = new TreeNode(0);
TreeNode two = new TreeNode(2);
TreeNode three = new TreeNode(3);
four.right = six;
six.left = five;
six.right = seven;
seven.right = eight;
four.left = one;
one.right = two;
two.right = three;
one.left = zero;
return four;
}
}
| [
"[email protected]"
] | |
d64876e34199f622661dd63e7b87973cafa51def | 0ed34325a47f71e5fa963afeb906753f1c1726e1 | /src/views/ReadQRViews.java | 7a4e230a078e9a18eb7f103c8d7753d69addb525 | [] | no_license | chrisjoohn/attendance-system | e56d3be913b5d625d61d32712b47fb68983b98c8 | 6a66119295df586aa16c739b5d28b428fc59e4e9 | refs/heads/master | 2020-07-07T15:43:06.811973 | 2019-08-20T14:35:17 | 2019-08-20T14:35:17 | 200,231,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,226 | java | package views;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.image.BufferedImage;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import javax.swing.*;
import javax.swing.event.DocumentListener;
import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamPanel;
import com.github.sarxos.webcam.WebcamResolution;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.LuminanceSource;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.NotFoundException;
import com.google.zxing.Result;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.HybridBinarizer;
public class ReadQRViews extends JFrame implements Runnable, ThreadFactory {
private static final long serialVersionUID = 6441489157408381878L;
private Executor executor = Executors.newSingleThreadExecutor(this);
private Webcam webcam = null;
private WebcamPanel panel = null;
public JTextArea textarea, name;
public ReadQRViews() {
super();
setLayout(new FlowLayout());
// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension size = WebcamResolution.QVGA.getSize();
webcam = Webcam.getDefault();
webcam.setViewSize(size);
panel = new WebcamPanel(webcam);
panel.setPreferredSize(size);
panel.setFPSDisplayed(true);
textarea = new JTextArea();
// textarea.setEditable(false);
// textarea.setPreferredSize(size);
name = new JTextArea();
name.setEditable(false);
name.setPreferredSize(size);
add(panel);
// add(textarea);
add(name);
pack();
setLocationRelativeTo(null);
// setVisible(true);
executor.execute(this);
}
@Override
public void run() {
do {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
Result result = null;
BufferedImage image = null;
if (webcam.isOpen()) {
if ((image = webcam.getImage()) == null) {
continue;
}
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
try {
result = new MultiFormatReader().decode(bitmap);
} catch (NotFoundException e) {
// fall thru, it means there is no QR code in image
}
}
if (result != null) {
if(!textarea.getText().equals(result.getText())) {
textarea.setText(result.getText());
}
}
} while (true);
}
public void textFieldListener(DocumentListener change) {
this.textarea.getDocument().addDocumentListener(change);
}
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "example-runner");
t.setDaemon(true);
return t;
}
}
| [
"[email protected]"
] | |
4c1a59545f885d657ba1ae9e66125c2f82dbf5b2 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2015/12/MessageProcessingCallback.java | 237a389c879e7df20106fc31846853cab9c8c55e | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 3,873 | java | /*
* Copyright (c) 2002-2015 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.bolt.v1.messaging.msgprocess;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import org.neo4j.logging.Log;
import org.neo4j.bolt.v1.messaging.MessageHandler;
import org.neo4j.bolt.v1.runtime.Session;
import org.neo4j.bolt.v1.runtime.internal.Neo4jError;
public class MessageProcessingCallback<T> extends Session.Callback.Adapter<T,Void>
{
// TODO: move this somewhere more sane (when modules are unified)
public static void publishError( MessageHandler<IOException> out, Neo4jError error )
throws IOException
{
if ( error.status().code().classification().publishable() )
{
// If publishable, we forward the message as-is to the user.
out.handleFailureMessage( error.status(), error.message() );
}
else
{
// If not publishable, we only return an error reference to the user. This must
// be cross-referenced with the log files for full error detail. This feature
// exists to improve security so that sensitive information is not leaked.
out.handleFailureMessage( error.status(), String.format(
"An unexpected failure occurred, see details in the database " +
"logs, reference number %s.", error.reference() ) );
}
}
protected final Log log;
protected MessageHandler<IOException> out;
private Neo4jError error;
private Runnable onCompleted;
private boolean ignored;
public MessageProcessingCallback( Log logger )
{
this.log = logger;
}
public MessageProcessingCallback reset(
MessageHandler<IOException> out,
Runnable onCompleted )
{
this.out = out;
this.onCompleted = onCompleted;
clearState();
return this;
}
@Override
public void failure( Neo4jError err, Void none )
{
this.error = err;
}
@Override
public void ignored( Void none )
{
this.ignored = true;
}
@Override
public void completed( Void none )
{
try
{
if ( ignored )
{
out.handleIgnoredMessage();
}
else if ( error != null )
{
publishError( out, error );
}
else
{
out.handleSuccessMessage( successMetadata() );
}
}
catch ( Throwable e )
{
// TODO: we've lost the ability to communicate with the client. Shut down the session, close transactions.
log.error( "Failed to write response to driver", e );
}
finally
{
onCompleted.run();
clearState();
}
}
/** Allow sub-classes to override this to provide custom metadata */
protected Map<String,Object> successMetadata()
{
return Collections.emptyMap();
}
protected void clearState()
{
error = null;
ignored = false;
}
}
| [
"[email protected]"
] | |
1e7a4c6f1900ec0e715a3f2e5ecbf7cb2111451c | ff90717e060a2aafec3b099e709085116fcbe866 | /org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslLexer.java | 1e876183112bb6b42eccdb0c68e14bbd80d1b2a3 | [] | no_license | trileude/IMSE | 60a8c80fcb672388efcb3c0ef315d10b53a0a84f | 1c3751d97932f509a981f5916b5bc07aba5b56cf | refs/heads/master | 2021-01-22T09:48:09.071588 | 2013-12-16T12:40:12 | 2013-12-16T12:40:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 36,206 | java | package org.xtext.example.mydsl.parser.antlr.internal;
// Hack: Use our own Lexer superclass by means of import.
// Currently there is no other way to specify the superclass for the lexer.
import org.eclipse.xtext.parser.antlr.Lexer;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class InternalMyDslLexer extends Lexer {
public static final int RULE_ID=4;
public static final int RULE_STRING=6;
public static final int T__16=16;
public static final int T__15=15;
public static final int T__17=17;
public static final int T__12=12;
public static final int T__11=11;
public static final int T__14=14;
public static final int T__13=13;
public static final int RULE_ANY_OTHER=10;
public static final int RULE_INT=5;
public static final int RULE_WS=9;
public static final int RULE_SL_COMMENT=8;
public static final int EOF=-1;
public static final int RULE_ML_COMMENT=7;
// delegates
// delegators
public InternalMyDslLexer() {;}
public InternalMyDslLexer(CharStream input) {
this(input, new RecognizerSharedState());
}
public InternalMyDslLexer(CharStream input, RecognizerSharedState state) {
super(input,state);
}
public String getGrammarFileName() { return "../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g"; }
// $ANTLR start "T__11"
public final void mT__11() throws RecognitionException {
try {
int _type = T__11;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:11:7: ( ':' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:11:9: ':'
{
match(':');
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__11"
// $ANTLR start "T__12"
public final void mT__12() throws RecognitionException {
try {
int _type = T__12;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:12:7: ( '!' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:12:9: '!'
{
match('!');
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__12"
// $ANTLR start "T__13"
public final void mT__13() throws RecognitionException {
try {
int _type = T__13;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:13:7: ( 'Radio' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:13:9: 'Radio'
{
match("Radio");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__13"
// $ANTLR start "T__14"
public final void mT__14() throws RecognitionException {
try {
int _type = T__14;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:14:7: ( 'Text' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:14:9: 'Text'
{
match("Text");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__14"
// $ANTLR start "T__15"
public final void mT__15() throws RecognitionException {
try {
int _type = T__15;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:15:7: ( 'TextArea' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:15:9: 'TextArea'
{
match("TextArea");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__15"
// $ANTLR start "T__16"
public final void mT__16() throws RecognitionException {
try {
int _type = T__16;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:16:7: ( 'DropDown' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:16:9: 'DropDown'
{
match("DropDown");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__16"
// $ANTLR start "T__17"
public final void mT__17() throws RecognitionException {
try {
int _type = T__17;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:17:7: ( 'CheckBox' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:17:9: 'CheckBox'
{
match("CheckBox");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "T__17"
// $ANTLR start "RULE_ID"
public final void mRULE_ID() throws RecognitionException {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:225:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:225:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:225:11: ( '^' )?
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0=='^') ) {
alt1=1;
}
switch (alt1) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:225:11: '^'
{
match('^');
}
break;
}
if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:225:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop2:
do {
int alt2=2;
int LA2_0 = input.LA(1);
if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:
{
if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
default :
break loop2;
}
} while (true);
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_ID"
// $ANTLR start "RULE_INT"
public final void mRULE_INT() throws RecognitionException {
try {
int _type = RULE_INT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:227:10: ( ( '0' .. '9' )+ )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:227:12: ( '0' .. '9' )+
{
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:227:12: ( '0' .. '9' )+
int cnt3=0;
loop3:
do {
int alt3=2;
int LA3_0 = input.LA(1);
if ( ((LA3_0>='0' && LA3_0<='9')) ) {
alt3=1;
}
switch (alt3) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:227:13: '0' .. '9'
{
matchRange('0','9');
}
break;
default :
if ( cnt3 >= 1 ) break loop3;
EarlyExitException eee =
new EarlyExitException(3, input);
throw eee;
}
cnt3++;
} while (true);
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_INT"
// $ANTLR start "RULE_STRING"
public final void mRULE_STRING() throws RecognitionException {
try {
int _type = RULE_STRING;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:13: ( ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:15: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
{
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:15: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0=='\"') ) {
alt6=1;
}
else if ( (LA6_0=='\'') ) {
alt6=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 6, 0, input);
throw nvae;
}
switch (alt6) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:16: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{
match('\"');
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:20: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )*
loop4:
do {
int alt4=3;
int LA4_0 = input.LA(1);
if ( (LA4_0=='\\') ) {
alt4=1;
}
else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) {
alt4=2;
}
switch (alt4) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:21: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' )
{
match('\\');
if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||(input.LA(1)>='t' && input.LA(1)<='u') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
case 2 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:66: ~ ( ( '\\\\' | '\"' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
default :
break loop4;
}
} while (true);
match('\"');
}
break;
case 2 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:86: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:91: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )*
loop5:
do {
int alt5=3;
int LA5_0 = input.LA(1);
if ( (LA5_0=='\\') ) {
alt5=1;
}
else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) {
alt5=2;
}
switch (alt5) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:92: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' )
{
match('\\');
if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||(input.LA(1)>='t' && input.LA(1)<='u') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
case 2 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:229:137: ~ ( ( '\\\\' | '\\'' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
default :
break loop5;
}
} while (true);
match('\'');
}
break;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_STRING"
// $ANTLR start "RULE_ML_COMMENT"
public final void mRULE_ML_COMMENT() throws RecognitionException {
try {
int _type = RULE_ML_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:231:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:231:19: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:231:24: ( options {greedy=false; } : . )*
loop7:
do {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0=='*') ) {
int LA7_1 = input.LA(2);
if ( (LA7_1=='/') ) {
alt7=2;
}
else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) {
alt7=1;
}
}
else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:231:52: .
{
matchAny();
}
break;
default :
break loop7;
}
} while (true);
match("*/");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_ML_COMMENT"
// $ANTLR start "RULE_SL_COMMENT"
public final void mRULE_SL_COMMENT() throws RecognitionException {
try {
int _type = RULE_SL_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
{
match("//");
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:24: (~ ( ( '\\n' | '\\r' ) ) )*
loop8:
do {
int alt8=2;
int LA8_0 = input.LA(1);
if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) {
alt8=1;
}
switch (alt8) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:24: ~ ( ( '\\n' | '\\r' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
default :
break loop8;
}
} while (true);
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:40: ( ( '\\r' )? '\\n' )?
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0=='\n'||LA10_0=='\r') ) {
alt10=1;
}
switch (alt10) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:41: ( '\\r' )? '\\n'
{
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:41: ( '\\r' )?
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0=='\r') ) {
alt9=1;
}
switch (alt9) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:233:41: '\\r'
{
match('\r');
}
break;
}
match('\n');
}
break;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_SL_COMMENT"
// $ANTLR start "RULE_WS"
public final void mRULE_WS() throws RecognitionException {
try {
int _type = RULE_WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:235:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:235:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:235:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt11=0;
loop11:
do {
int alt11=2;
int LA11_0 = input.LA(1);
if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
alt11=1;
}
switch (alt11) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:
{
if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
input.consume();
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
recover(mse);
throw mse;}
}
break;
default :
if ( cnt11 >= 1 ) break loop11;
EarlyExitException eee =
new EarlyExitException(11, input);
throw eee;
}
cnt11++;
} while (true);
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_WS"
// $ANTLR start "RULE_ANY_OTHER"
public final void mRULE_ANY_OTHER() throws RecognitionException {
try {
int _type = RULE_ANY_OTHER;
int _channel = DEFAULT_TOKEN_CHANNEL;
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:237:16: ( . )
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:237:18: .
{
matchAny();
}
state.type = _type;
state.channel = _channel;
}
finally {
}
}
// $ANTLR end "RULE_ANY_OTHER"
public void mTokens() throws RecognitionException {
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
int alt12=14;
alt12 = dfa12.predict(input);
switch (alt12) {
case 1 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:10: T__11
{
mT__11();
}
break;
case 2 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:16: T__12
{
mT__12();
}
break;
case 3 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:22: T__13
{
mT__13();
}
break;
case 4 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:28: T__14
{
mT__14();
}
break;
case 5 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:34: T__15
{
mT__15();
}
break;
case 6 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:40: T__16
{
mT__16();
}
break;
case 7 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:46: T__17
{
mT__17();
}
break;
case 8 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:52: RULE_ID
{
mRULE_ID();
}
break;
case 9 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:60: RULE_INT
{
mRULE_INT();
}
break;
case 10 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:69: RULE_STRING
{
mRULE_STRING();
}
break;
case 11 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:81: RULE_ML_COMMENT
{
mRULE_ML_COMMENT();
}
break;
case 12 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:97: RULE_SL_COMMENT
{
mRULE_SL_COMMENT();
}
break;
case 13 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:113: RULE_WS
{
mRULE_WS();
}
break;
case 14 :
// ../org.xtext.mapping.dsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:1:121: RULE_ANY_OTHER
{
mRULE_ANY_OTHER();
}
break;
}
}
protected DFA12 dfa12 = new DFA12(this);
static final String DFA12_eotS =
"\3\uffff\4\22\1\16\2\uffff\3\16\4\uffff\1\22\1\uffff\3\22\5\uffff"+
"\5\22\1\45\2\22\1\50\1\22\1\uffff\2\22\1\uffff\6\22\1\62\1\63\1"+
"\64\3\uffff";
static final String DFA12_eofS =
"\65\uffff";
static final String DFA12_minS =
"\1\0\2\uffff\1\141\1\145\1\162\1\150\1\101\2\uffff\2\0\1\52\4\uffff"+
"\1\144\1\uffff\1\170\1\157\1\145\5\uffff\1\151\1\164\1\160\1\143"+
"\1\157\1\60\1\104\1\153\1\60\1\162\1\uffff\1\157\1\102\1\uffff\1"+
"\145\1\167\1\157\1\141\1\156\1\170\3\60\3\uffff";
static final String DFA12_maxS =
"\1\uffff\2\uffff\1\141\1\145\1\162\1\150\1\172\2\uffff\2\uffff\1"+
"\57\4\uffff\1\144\1\uffff\1\170\1\157\1\145\5\uffff\1\151\1\164"+
"\1\160\1\143\1\157\1\172\1\104\1\153\1\172\1\162\1\uffff\1\157\1"+
"\102\1\uffff\1\145\1\167\1\157\1\141\1\156\1\170\3\172\3\uffff";
static final String DFA12_acceptS =
"\1\uffff\1\1\1\2\5\uffff\1\10\1\11\3\uffff\1\15\1\16\1\1\1\2\1\uffff"+
"\1\10\3\uffff\1\11\1\12\1\13\1\14\1\15\12\uffff\1\4\2\uffff\1\3"+
"\11\uffff\1\5\1\6\1\7";
static final String DFA12_specialS =
"\1\0\11\uffff\1\2\1\1\51\uffff}>";
static final String[] DFA12_transitionS = {
"\11\16\2\15\2\16\1\15\22\16\1\15\1\2\1\12\4\16\1\13\7\16\1\14"+
"\12\11\1\1\6\16\2\10\1\6\1\5\15\10\1\3\1\10\1\4\6\10\3\16\1"+
"\7\1\10\1\16\32\10\uff85\16",
"",
"",
"\1\21",
"\1\23",
"\1\24",
"\1\25",
"\32\22\4\uffff\1\22\1\uffff\32\22",
"",
"",
"\0\27",
"\0\27",
"\1\30\4\uffff\1\31",
"",
"",
"",
"",
"\1\33",
"",
"\1\34",
"\1\35",
"\1\36",
"",
"",
"",
"",
"",
"\1\37",
"\1\40",
"\1\41",
"\1\42",
"\1\43",
"\12\22\7\uffff\1\44\31\22\4\uffff\1\22\1\uffff\32\22",
"\1\46",
"\1\47",
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
"\1\51",
"",
"\1\52",
"\1\53",
"",
"\1\54",
"\1\55",
"\1\56",
"\1\57",
"\1\60",
"\1\61",
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
"",
"",
""
};
static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
static final short[][] DFA12_transition;
static {
int numStates = DFA12_transitionS.length;
DFA12_transition = new short[numStates][];
for (int i=0; i<numStates; i++) {
DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
}
}
class DFA12 extends DFA {
public DFA12(BaseRecognizer recognizer) {
this.recognizer = recognizer;
this.decisionNumber = 12;
this.eot = DFA12_eot;
this.eof = DFA12_eof;
this.min = DFA12_min;
this.max = DFA12_max;
this.accept = DFA12_accept;
this.special = DFA12_special;
this.transition = DFA12_transition;
}
public String getDescription() {
return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
}
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
IntStream input = _input;
int _s = s;
switch ( s ) {
case 0 :
int LA12_0 = input.LA(1);
s = -1;
if ( (LA12_0==':') ) {s = 1;}
else if ( (LA12_0=='!') ) {s = 2;}
else if ( (LA12_0=='R') ) {s = 3;}
else if ( (LA12_0=='T') ) {s = 4;}
else if ( (LA12_0=='D') ) {s = 5;}
else if ( (LA12_0=='C') ) {s = 6;}
else if ( (LA12_0=='^') ) {s = 7;}
else if ( ((LA12_0>='A' && LA12_0<='B')||(LA12_0>='E' && LA12_0<='Q')||LA12_0=='S'||(LA12_0>='U' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='a' && LA12_0<='z')) ) {s = 8;}
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 9;}
else if ( (LA12_0=='\"') ) {s = 10;}
else if ( (LA12_0=='\'') ) {s = 11;}
else if ( (LA12_0=='/') ) {s = 12;}
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 13;}
else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='.')||(LA12_0>=';' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFF')) ) {s = 14;}
if ( s>=0 ) return s;
break;
case 1 :
int LA12_11 = input.LA(1);
s = -1;
if ( ((LA12_11>='\u0000' && LA12_11<='\uFFFF')) ) {s = 23;}
else s = 14;
if ( s>=0 ) return s;
break;
case 2 :
int LA12_10 = input.LA(1);
s = -1;
if ( ((LA12_10>='\u0000' && LA12_10<='\uFFFF')) ) {s = 23;}
else s = 14;
if ( s>=0 ) return s;
break;
}
NoViableAltException nvae =
new NoViableAltException(getDescription(), 12, _s, input);
error(nvae);
throw nvae;
}
}
} | [
"manu@manu-linux.(none)"
] | manu@manu-linux.(none) |
f569143c025671aee5d612d3644b526b0c60738c | 6798809bcb0db48e0094642ed776b0f95ed3d80c | /tests/semicolonexpected/NoSemicolonToSeparateStatements.java | 2b732a390304c49c7dbfd822041b5fd91e8b7720 | [] | no_license | thatsmydoing/javach | 8320142a170c5f80f8e1e09eb1d7c5b07d17083b | 0b59273a2886bc3f7ce92752332da291dcbfdf60 | refs/heads/master | 2021-01-22T02:04:40.265018 | 2012-06-06T07:40:15 | 2012-06-06T07:40:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 152 | java | public class NoSemicolonToSeparateStatements {
public static void main(String[] args) {
String out = "Hello World!" System.out.println(out);
}
} | [
"[email protected]"
] | |
db34da1645155fa7add220e1f15ec05ffa872e3e | 5fb078ad77ff8a6389f5f90410a6d6ef17a37b12 | /src/main/java/com/WubbaLubbaDrive/Models/UserNote.java | 0e2b91db9a7b0c65dcf67320d42d3198fbb6e08d | [] | no_license | ahmedkorani/WubbaLubbaDrive | 07e63525758313defe4a7caa79e1e39386acc75f | 5b03d9cb91dfcc509fe2a0774cd2d2684d7020df | refs/heads/master | 2023-04-06T16:24:25.127315 | 2021-04-16T03:44:04 | 2021-04-16T03:44:04 | 358,467,062 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 63 | java | package com.WubbaLubbaDrive.Models;
public class UserNote {
}
| [
"[email protected]"
] | |
3724bc1e1326b575c4b713ed656a5c4327a3f3bb | 7875546b3c70d1f8662b9a855485c9791d56341d | /api/src/main/java/shop/jinwookoh/api/security/config/WebSecurityConfig.java | a01cc3ae51e623fb8f37cc50d0fad2640c1ffade | [] | no_license | wlsdnr4675/TEAM_PROJECT | 948b07ac54d084076eca6f29df7f23c20f5957ac | c39233d25389c08acb1ea69cdcb289bbb1d5ee93 | refs/heads/main | 2023-06-05T15:03:35.242216 | 2021-06-27T08:59:17 | 2021-06-27T08:59:17 | 365,939,763 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,726 | java | package shop.jinwookoh.api.security.config;
import shop.jinwookoh.api.security.domain.SecurityProvider;
import lombok.RequiredArgsConstructor;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration // 인터셉터
@EnableWebSecurity
@RequiredArgsConstructor
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private final SecurityProvider provider;
@Bean
PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Bean
public ModelMapper modelMapper() {
return new ModelMapper();
}
@Override // 오버라이드 할때 열쇠있는걸로 오버라이드해야한다.
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable(); // csrf 기능 비활성화
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http.authorizeRequests().antMatchers("/artists/signin").permitAll().antMatchers("/artists/signup").permitAll()
.antMatchers("/artists/findAll").permitAll().antMatchers("/h2-console/**/**").permitAll()
.antMatchers("/artists/{artistId}").permitAll().antMatchers("/artists/update/{artistId}").permitAll()
.antMatchers("/resume/**/**").permitAll().antMatchers("/resume_file/**/**").permitAll()
.antMatchers("/category/**/**").permitAll()
.anyRequest().authenticated();
http.exceptionHandling().accessDeniedPage("/login");
http.apply(new SecurityConfig(provider));
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers(HttpMethod.OPTIONS, "/*/**") // 모든 곳에서 접속
.antMatchers("/", "/h2-console/**");
}
} | [
"[email protected]"
] | |
a27cb9c8609f534c631c298b637e0e6b3d7a9a41 | 09ef2687ffeeca6aeef6f515272ddd5d23e4c980 | /src/main/java/zh/learn/java/ch01inroduction/exercises/PrintTable.java | 9adc6a73bb91621c73cf4438dbe26a92b589da2f | [] | no_license | dzheleznyakov/Learning-Java | c4d9a972ebb43b759aaeefd339567b475260fcef | ce7fa558eb056ea9d6914d3dfd472c95c9fc85c3 | refs/heads/master | 2022-08-15T00:10:25.501464 | 2022-08-04T06:31:02 | 2022-08-04T06:31:02 | 226,674,344 | 0 | 0 | null | 2020-10-13T18:58:38 | 2019-12-08T13:46:07 | Java | UTF-8 | Java | false | false | 433 | java | // chapter 01 exercise 1.4
package zh.learn.java.ch01inroduction.exercises;
public class PrintTable {
public static void main(String[] args) {
System.out.println("a a^2 a^3 a^4");
System.out.println("1 1 1 1");
System.out.println("2 4 8 16");
System.out.println("3 9 27 81");
System.out.println("4 16 64 256");
}
}
| [
"[email protected]"
] | |
1d8a7e4f4879968b4c869fc85852f004086b61c6 | cab3a64205bfdd34280d1978205d407e8ebd725e | /src/main/java/com/tsien/mall/controller/backend/UserManageController.java | 5ebabd2a0bd2a23e4c07bd39331f46a29ef2c3f8 | [
"Apache-2.0"
] | permissive | Tsien16/TsienMall | cefec4ed8c24fce93100cc366aac7969058e22f3 | 12b9a2e503e476ef7b6a7b6251b26f7cb0a9a075 | refs/heads/master | 2022-12-10T13:35:14.631524 | 2021-12-02T01:23:31 | 2021-12-02T01:23:31 | 193,214,739 | 2 | 1 | Apache-2.0 | 2021-03-31T21:16:11 | 2019-06-22T09:15:23 | Java | UTF-8 | Java | false | false | 1,818 | java | package com.tsien.mall.controller.backend;
import com.tsien.mall.constant.Const;
import com.tsien.mall.constant.RoleEnum;
import com.tsien.mall.model.UserDO;
import com.tsien.mall.service.UserService;
import com.tsien.mall.util.ServerResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
/**
* Created with IntelliJ IDEA.
*
* @author tsien
* @version 1.0.0
* @date 2019/6/28 0028 0:20
*/
@RestController
@RequestMapping("/manage/user")
public class UserManageController {
@Resource
private UserService userService;
/**
* 管理员用户登陆
*
* @param session session
* @param username username
* @param password password
* @return response
*/
@PostMapping("login.do")
public ServerResponse<UserDO> login(HttpSession session,
@RequestParam("username") String username,
@RequestParam("password") String password) {
ServerResponse<UserDO> response = userService.login(username, password);
if (response.isSuccess()) {
UserDO userDO = response.getData();
// 判断登陆的用户是否是管理员
if (userDO.getRole() == RoleEnum.ROLE_ADMIN.getCode()) {
session.setAttribute(Const.CURRENT_USER, response.getData());
return response;
} else {
return ServerResponse.createByErrorMessage("不是管理员,无法登陆");
}
}
return response;
}
}
| [
"[email protected]"
] | |
fff26b4c03d106443e6c4e0fa87b446030c331d2 | 94122c95265bd0d5050548de511816f1930e3f85 | /addressbook/src/util/DataUtil.java | 73b09509a5b1f1c8e32a15a4467043f5b5708f60 | [] | no_license | rain-fog/addressbook | 306fc4daed43b492307be10ce7abce3b27a2b6ea | 0b4d7a71ca464d9e47fe53b06de2bcfea49cf759 | refs/heads/master | 2016-09-06T12:51:25.174729 | 2013-05-08T16:14:10 | 2013-05-08T16:14:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,497 | java | package util;
/**
* データユーティリティクラス
* @author shin
*
*/
public class DataUtil {
/**
* モード値を取得する。
* 適切な入力値でない場合は-1を返す。
* @param token 入力された文字列
* @return モード値。何も入力されていない、もしくは数値に変換
* 出来ない場合は-1を返す。
*/
public static int getMode(String input) {
String[] token = input.split(" ");
if (token.length == 0) {
return -1;
}
try {
Integer.parseInt(token[0]);
} catch (NumberFormatException e) {
return -1;
}
return Integer.parseInt(token[0]);
}
/**
* 名前に数値が含まれているかどうかチェックする。
* @param name 名前
* @return 名前に数値が含まれていなければtrue
*/
public static boolean checkName(String name) {
if (name.matches("\\d+")) {
return false;
}
return true;
}
/**
* 郵便番号が3桁-4桁、または7桁かチェックする。
* @param zip 郵便番号
* @return 郵便番号が正しければtrue
*/
public static boolean checkZip(String zip) {
if (zip.matches("\\d{3}-?\\d{4}")) {
return true;
}
return false;
}
/**
* 郵便番号が3桁-4桁の場合ハイフンを除く。
* @param zip 郵便番号
* @return ハイフンを除いた7桁の郵便番号。
* ハイフンなし7桁の場合は渡された郵便番号をそのまま返す。
* @throws IlleagalArgumentException - 郵便番号の値が正しくない場合
*/
public static String removeHyphen(String zip) {
if (!checkZip(zip)) {
throw new IllegalArgumentException("郵便番号の形式が正しくありません");
}
String[] token = zip.split("-");
String afterZip = "";
for (String str : token) {
afterZip += str;
}
return afterZip;
}
/**
* 7桁の郵便番号を3桁-4桁の形に変換する。
* @param zip 7桁の郵便番号
* @return 3桁-4桁の形式の郵便番号
*/
public static String addHyphen(String zip) {
if (zip == null) {
throw new NullPointerException("郵便番号の値がnullです");
} else if (!checkZip(zip)){
throw new IllegalArgumentException("郵便番号の形式が正しくありません");
}
String first = zip.substring(0, 3);
String latter = zip.substring(3);
String hyphenExistZip = first + "-" + latter;
return hyphenExistZip;
}
}
| [
"[email protected]"
] | |
f454f98f6c7331a1aca73e0798823be8585d151b | 8ef9128df2f4523591a89221fac01c705156f00a | /PageObjectModel/src/test/java/com/crm/qa/testcases/LoginPageTest.java | 4333be31d3783dbe86d0b1c61aa00742b292bf43 | [] | no_license | Sanjee27/Office-Project | 2739bae9f734a03f655cfd8492011e7014a40585 | 67a7315ad63a9f0b6f2cd2e8e8b20ad6ca9de498 | refs/heads/master | 2023-05-11T19:43:56.364169 | 2019-08-22T09:36:53 | 2019-08-22T09:36:53 | 150,700,875 | 0 | 0 | null | 2023-05-09T18:13:07 | 2018-09-28T07:16:07 | HTML | UTF-8 | Java | false | false | 914 | java | package com.crm.qa.testcases;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.crm.qa.base.TestBase;
import com.crm.qa.pages.HomePage;
import com.crm.qa.pages.LoginPage;
public class LoginPageTest extends TestBase{
LoginPage loginpage;
HomePage homepage;
public LoginPageTest(){
super();
}
@BeforeMethod
public void setUp(){
initialization();
loginpage=new LoginPage();
}
@Test(priority=1)
public void loginPageTitleTest(){
String title=loginpage.ValidateLoginPageTitle();
Assert.assertEquals(title, "CRM");
}
@Test(priority=2)
public void loginTest(){
homepage=loginpage.login(prop.getProperty("username"), prop.getProperty("password"));
}
@AfterMethod
public void tearDown(){
driver.quit();
}
}
| [
"[email protected]"
] | |
9eb7d1bfee2a0d4867aa0551dde672f355bd2ef6 | 162592581fedc5b1e47c9b44aa09e0febec4c194 | /network/src/main/java/com/shenkai/network/errorhandler/HttpErrorHandler.java | f9ed00ad0daa072c09affc924586770dc7f98612 | [] | no_license | conquerSK/JetpackMvvm | 6d0fcc7b835b7cec9ab95442956592396220d587 | 4e8d8cd56c321212ebd5ca251173d62d55c2afba | refs/heads/master | 2020-09-11T22:42:39.786533 | 2020-04-23T06:25:37 | 2020-04-23T06:25:37 | 222,214,718 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 671 | java | package com.shenkai.network.errorhandler;
import io.reactivex.Observable;
import io.reactivex.functions.Function;
/**
* Author:shenkai
* Time:2020/4/23 13:29
* Description:
* HttpResponseFunc处理以下两类网络错误:
* 1、http请求相关的错误,例如:404,403,socket timeout等等;
* 2、应用数据的错误会抛RuntimeException,最后也会走到这个函数来统一处理;
*/
public class HttpErrorHandler<T> implements Function<Throwable, Observable<T>> {
@Override
public Observable<T> apply(Throwable throwable) throws Exception {
return Observable.error(ExceptionHandle.handleException(throwable));
}
}
| [
"[email protected]"
] | |
5c6b09fd13af94cbb09acb68777bd3224b875e90 | c4e71f8d33be5c66c1711872598ee24cf077003f | /SmartRunner/app/src/main/java/com/haneoum/smartrunner/setting_listview/Warning.java | 91c9276ab10a4d6b1037fecf2a45f10121aa01e2 | [] | no_license | pinokio531/SmartRunner-android | 200dcf4811c633c899c320df736b61ee51906407 | 5440f2ae2b726acf35b14bad71b025c873fb6dfa | refs/heads/master | 2020-03-22T09:30:34.030872 | 2019-01-12T05:35:20 | 2019-01-12T05:35:20 | 139,842,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,699 | java | package com.haneoum.smartrunner.setting_listview;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SeekBar;
import android.widget.TextView;
import com.haneoum.smartrunner.R;
import com.haneoum.smartrunner.setting_listview.location.location_settings;
public class Warning extends AppCompatActivity {
//임승섭
MediaPlayer mp;
ListView lV;
String[] warninglist = {"warning horn 1", "warning horn 2", "warning horn 3"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.warning);
Bundle bundle = getIntent().getExtras();
String text = bundle.getString("경고음 설정");
TextView Tx = (TextView) findViewById(R.id.Text);
Tx.setText(text);
SeekBar seekBar = (SeekBar) findViewById(R.id.seekBar_volume);
final AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
int nMax = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
int nCurrentVolume = audioManager
.getStreamVolume(AudioManager.STREAM_MUSIC);
seekBar.setMax(nMax);
seekBar.setProgress(nCurrentVolume);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, i, 0);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), location_settings.class);
startActivity(intent);
}
});
lV = (ListView) findViewById(R.id.waringlist);
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, warninglist);
lV.setAdapter(arrayAdapter);
lV.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
adapterView.getItemAtPosition(i);
if (i == 0) {
if (mp == null) {
mp = MediaPlayer.create(Warning.this, R.raw.siren);
mp.start();
} else {
PlayStop();
mp = MediaPlayer.create(Warning.this, R.raw.siren);
mp.start();
}
} else if (i == 1) {
if (mp == null) {
mp = MediaPlayer.create(Warning.this, R.raw.abc);
mp.start();
} else {
PlayStop();
mp = MediaPlayer.create(Warning.this, R.raw.abc);
mp.start();
}
} else if (i == 2) {
if (mp == null) {
mp = MediaPlayer.create(Warning.this, R.raw.def);
mp.start();
} else {
PlayStop();
mp = MediaPlayer.create(Warning.this, R.raw.def);
mp.start();
}
}
}
});
}
@Override
public void onBackPressed() {
if (mp.isPlaying() == true) {
PlayStop();
super.onBackPressed();
Intent intent;
intent = new Intent(getParent(), Setting.class);
startActivity(intent);
}
else {
super.onBackPressed();
Intent intent;
intent = new Intent(getParent(), Setting.class);
startActivity(intent);
}
}
public void PlayStop() {
mp.stop();
mp.release();
}
}
| [
""
] | |
73690700e3561c32070c146aeff0666f2ce7bb3a | 4e059afed4008148457f3bc1fc14368cf19878b9 | /Node.java | 0612213ab67403441cf84488730c333b0dbacf61 | [] | no_license | rachelizabeth92/NewmanRachelH4 | 3ad202c27a95a56cd82bb82268e1fc2f6f395aec | 6027e839abe35815449d1ac5e820c9cfdc40376c | refs/heads/master | 2021-01-18T16:18:51.084565 | 2017-04-10T01:07:38 | 2017-04-10T01:07:38 | 86,735,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | public class Node
{
private String element;
private Node next;
private Node prev;
public Node(String element)
{
this.element = element;
this.next = null;
this.prev = null;
}
//methods
public void setNext(Node node)
{
this.next = node;
}
public Node getNext()
{
return this.next;
}
public void setPrev(Node node)
{
this.prev = node;
}
public Node getPrev()
{
return this.prev;
}
public String getElem()
{
return this.element;
}
} | [
"[email protected]"
] | |
3555cf4c32c2ab05e6f28442b4a7805cf50fe20b | 7647dee16c7f31b4245774c4f03409cd39c9de41 | /app/src/java/is203/se/Entity/BootstrapError.java | c26e4524ec52e8fd1c0c70bc4a8d882fe0f8ae84 | [] | no_license | randallh95/proto | cd73746514cf3b754b0d4169bb3322810a505b8a | d0193124b9b46c0238746bc7ecd4536897dee9aa | refs/heads/master | 2021-07-12T07:05:09.196042 | 2017-10-13T07:57:41 | 2017-10-13T07:57:41 | 105,674,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,360 | java | package is203.se.Entity;
import java.util.ArrayList;
public class BootstrapError {
private String fileName; // the name of the .csv file where this error was found
private int rowNum; // the row number of the error
private ArrayList<String> errorMsgList;
public BootstrapError(String fileName, int rowNum) {
this.fileName = fileName;
this.rowNum = rowNum;
errorMsgList = new ArrayList<>();
}
public void addErrorMsg(String errorMsg) {
errorMsgList.add(errorMsg);
}
public void addErrorMsgList(ArrayList<String> errorMsgList) {
this.errorMsgList = errorMsgList;
}
public String getFileName() {
return fileName;
}
public int getRowNum() {
return rowNum;
}
public ArrayList<String> getErrorMsgList() {
return errorMsgList;
}
public boolean hasNoErrors() {
return errorMsgList.isEmpty();
}
@Override
public String toString() {
String result = "";
int errorMsgListLength = errorMsgList.size();
for (int i = 0; i < errorMsgListLength; i++) {
if (i == errorMsgListLength - 1) {
result += errorMsgList.get(i);
} else {
result += errorMsgList.get(i) + ", ";
}
}
return result;
}
}
| [
"[email protected]"
] | |
cfa16a9ad3696bfd146d2db419db748f41a84ab0 | ec79e7da1321e7b4b83364d45dc692836bd70c2e | /src/main/java/soot/block/overrides/BlockMixerImproved.java | 289ee2a32d0f3db36f608f2314ea7beebd337179 | [
"MIT"
] | permissive | Aemande123/Soot | 6f0337659c141b67e2dbf07b7900a9c3ea135b94 | 7f1bcd2bb6e4169006f14b9704447a8ac4ae417a | refs/heads/master | 2020-03-30T04:17:34.873599 | 2018-09-28T12:22:21 | 2018-09-28T12:22:21 | 139,576,712 | 0 | 0 | MIT | 2018-07-03T11:58:06 | 2018-07-03T11:58:05 | null | UTF-8 | Java | false | false | 1,964 | java | package soot.block.overrides;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import soot.tile.overrides.TileEntityMixerBottomImproved;
import soot.util.EmberUtil;
import soot.util.IMigrateable;
import soot.util.MigrationUtil;
import teamroots.embers.RegistryManager;
import teamroots.embers.block.BlockMixer;
import teamroots.embers.item.ItemTinkerHammer;
import teamroots.embers.tileentity.TileEntityMixerTop;
import javax.annotation.Nullable;
public class BlockMixerImproved extends BlockMixer implements IMigrateable {
public BlockMixerImproved(Material material, String name, boolean addToTab) {
super(material, name, addToTab);
EmberUtil.overrideRegistryLocation(this,name);
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float x, float y, float z) {
ItemStack heldItem = player.getHeldItem(hand);
if (heldItem.getItem() instanceof ItemTinkerHammer && state.getBlock() == this){
MigrationUtil.migrateBlock(world,pos);
return true;
}
return super.onBlockActivated(world, pos, state, player, hand, facing, x, y, z);
}
@Nullable
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
if(meta == 1)
return new TileEntityMixerTop();
else
return new TileEntityMixerBottomImproved();
}
@Override
public IBlockState getReplacementState(IBlockState state) {
return RegistryManager.mixer.getDefaultState().withProperty(isTop,state.getValue(isTop));
}
}
| [
"[email protected]"
] | |
3a48a95a3330176cd937536b8685d30e32c8dfee | 21ac7ea72e8afb8502df15db36a5fedbfa95c812 | /taobao-dao/src/main/java/com/taobao/store/mapper/PersonMapper.java | 2e1bcf378a4cd08025541b1204c02862486cc6c3 | [] | no_license | szucielgp/store-taobao | 2a907debe9818967d5d009bc6863c5bfb15f7aa5 | 3356336bc6af27069c108b8243be554eeca183c3 | refs/heads/master | 2021-01-19T03:30:49.106536 | 2017-08-01T10:01:44 | 2017-08-01T10:01:44 | 87,321,205 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package com.taobao.store.mapper;
import com.taobao.store.pojo.Person;
import org.apache.ibatis.annotations.Param;
/**
* Created by kd_gavin on 2017/4/6,15:15.
*
* @dicription
*/
public interface PersonMapper {
Person selectByPrimaryKey(@Param("dbid") String dbid, @Param("openId") String openId);
}
| [
"[email protected]"
] | |
b23c81afc3301ed17431916cf17846ce91654096 | 30ad2a73c1858fdaa2acddbcded39192780965cd | /src/main/java/com/involucionados/modelo/entidades/Rol.java | 88f5f3e8fd355d79e0d762a7f07ca29518c86127 | [] | no_license | cristobalcifuentes/ProyectoFinalAwakelab | 588ed32a02a13a843b9e75136528321cab0a94a6 | a46be76fb79f084120555971ffa0cac6e2286cef | refs/heads/master | 2022-12-14T22:30:22.534896 | 2020-08-03T21:23:57 | 2020-08-03T21:23:57 | 282,069,867 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,102 | java | package com.involucionados.modelo.entidades;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@Table(name="Rol")
public class Rol {
@Id
@GeneratedValue(generator="autoincrementID")
@SequenceGenerator(name="autoincrementID",sequenceName="SEC_ROL", allocationSize=1)
@Column(name="ID")
private int id;
@Column(name="ROL")
private String rol;
@OneToMany(mappedBy="rol")
private List<Usuario> usuarios;
public Rol() {
super();
}
public Rol(int id, String rol) {
super();
this.id = id;
this.rol = rol;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getRol() {
return rol;
}
public void setRol(String rol) {
this.rol = rol;
}
public List<Usuario> getUsuarios() {
return usuarios;
}
public void setUsuarios(List<Usuario> usuarios) {
this.usuarios = usuarios;
}
}
| [
"Gerald@DESKTOP-9L3AH2H"
] | Gerald@DESKTOP-9L3AH2H |
6af4ea2bfb38af42fb618002608c71ef1078f844 | 310c0b531c81154eb9385ef48ceafa6d506d48f1 | /Exercicio04_ListaDuplamenteEncadeadaCircular/Main.java | cbaa099de8b00d96c42b9e5be9f396a537afea58 | [
"MIT"
] | permissive | Jownao/EstruturaDeDados2021-1 | afb935ec6fe4af7b534544aa8b3c3325bb2cf4a9 | 1ce8f4910851cb8fda3fd5023d32f4031a0d4579 | refs/heads/main | 2023-05-07T10:24:39.481844 | 2021-06-01T04:22:50 | 2021-06-01T04:22:50 | 351,608,537 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,778 | java | package Exercicio04_ListaDuplamenteEncadeadaCircular;
import Exercicio03_ListaDuplamenteEncadeada.Aluno;
import Exercicio04_ListaDuplamenteEncadeadaCircular.ListaDuplaCircular;
public class Main {
public static void main(String[] args) {
//Estanciando alunos
Aluno a1 = new Aluno("Johnny", 40);
Aluno a2 = new Aluno("Paulo", 19);
Aluno a3 = new Aluno("Luiz", 19);
Aluno a4 = new Aluno("Gustavo", 20);
Aluno a5 = new Aluno("Vinicius", 19);
Aluno a6 = new Aluno("Augusto", 19);
Aluno a7 = new Aluno("Paul", 19);
//Criando a Lista Encadeada
ListaDuplaCircular<Aluno> lista = new ListaDuplaCircular<Aluno>();
//Adicionando Alunos no inicio da lista
lista.adicionaInicio(a1);
lista.adicionaInicio(a2);
lista.adicionaInicio(a3);
lista.adicionaInicio(a3);
lista.removerDuplos();
//Printando lista de Alunos
a1 = (Aluno) lista.Recupera(0);
a2 = (Aluno) lista.Recupera(1);
a3 = (Aluno) lista.Recupera(2);
// a4 = (Aluno) lista.Recupera(3);
System.out.println(a1.getNome());
System.out.println(a2.getNome());
System.out.println(a3.getNome());
// System.out.println(a4.getNome());
System.out.println("-".repeat(100));
// Removendo Aluno que esta no inicio
// lista.removeFim();
//
// //Printando lista de Alunos
// a1 = (Aluno) lista.Recupera(0);
// a2 = (Aluno) lista.Recupera(1);
// System.out.println(a1.getNome());
// System.out.println(a2.getNome());
// System.out.println("-".repeat(100));
}
}
| [
"[email protected]"
] | |
c2d74c2551d878a52ec2f1d7a93b37f6a8a8df98 | e35635eb5626aab2e42be3112ffca2ce56dd7016 | /WebmasterV6/src/com/boatsoft/common/VO.java | 206b03430dee6769d6d3113454c557c4c7561d79 | [] | no_license | alucard2501/WebmasterV6 | e0277b0ecaa1fe2b7f4bef22c93cb0412877f5f8 | 5fa47967945ca3338af544b2c34746896cd88430 | refs/heads/master | 2021-09-02T14:46:33.901091 | 2018-01-03T08:36:41 | 2018-01-03T08:36:41 | 115,324,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,084 | java | package com.boatsoft.common;
import java.util.ArrayList;
public class VO {
public String RequestAction="NONE";
public String TableName="";
public int id=0;
private ArrayList<MListItem> PropertyList;
public VO(){
PropertyList=new ArrayList<MListItem>();
}
public VO(String action){
this.RequestAction=action;
PropertyList=new ArrayList<MListItem>();
}
public Object getProperty(String key){
for(MListItem item:this.PropertyList){
if(item.getKey().equals(key)){
return item.getValue();
}
}
return null;
}
public Object getProperty(int index){
if(index>=this.PropertyList.size())return null;
return this.PropertyList.get(index).getValue();
}
public String getPropertyName(int index){
if(index>=this.PropertyList.size())return null;
return this.PropertyList.get(index).getKey();
}
public int PropertySize(){
return this.PropertyList.size();
}
public void setProperty(String key, String value) {
// TODO Auto-generated method stub
this.PropertyList.add(new MListItem(key,value));
}
}
| [
"[email protected]"
] | |
ef01bc6cf196b4a5eacaa62528ec7a8216d00180 | 5707536bdaffe1c0de2abfa838111cabb287c452 | /components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/authz/validators/ResponseTypeRequestValidator.java | 36b833ea1501cf8430ad04f35d71876e03475440 | [
"Apache-2.0"
] | permissive | wso2-extensions/identity-inbound-auth-oauth | 1ea5481d0595e56fdf972c1bc6e6bd1c61bd7d82 | d153b3dd2ae065df135566cb6e8951ac8c1a8645 | refs/heads/master | 2023-09-01T08:58:09.127138 | 2023-09-01T05:37:33 | 2023-09-01T05:37:33 | 52,758,721 | 28 | 410 | Apache-2.0 | 2023-09-14T12:13:20 | 2016-02-29T02:41:06 | Java | UTF-8 | Java | false | false | 1,987 | java | /*
* Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com).
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.identity.oauth2.authz.validators;
import org.wso2.carbon.identity.oauth.common.exception.InvalidOAuthRequestException;
import org.wso2.carbon.identity.oauth2.dto.OAuth2ClientValidationResponseDTO;
import javax.servlet.http.HttpServletRequest;
/**
* Validator interface for OAuth 2 response types. This will validate the inputs from the client.
*/
public interface ResponseTypeRequestValidator {
/**
* Get the response type.
*
* @return Response type.
*/
String getResponseType();
/**
* Check Whether the provided inputs from the client satisfy the response type validation
*
* @param request The HttpServletRequest front the client.
* @throws InvalidOAuthRequestException InvalidOAuthRequestException.
*/
void validateInputParameters(HttpServletRequest request) throws InvalidOAuthRequestException;
/**
* Check Whether the provided client information satisfy the response type validation
*
* @param request The HttpServletRequest front the client.
* @return <code>OAuth2ClientValidationResponseDTO</code> bean with validity information,
* callback, App Name, Error Code and Error Message when appropriate.
*/
OAuth2ClientValidationResponseDTO validateClientInfo(HttpServletRequest request);
}
| [
"[email protected]"
] | |
9fd8e6d0560e9ac7df884f20be86e18fce512562 | c58830ca182253e1fe11305ab861dc26db085751 | /aventurasGraficas/src-gen/ar/edu/unq/aventuraGrafica/impl/RecogerObjetoImpl.java | 1ea8a4619ea8cea993a4b20f02dde7ffb12a2dc8 | [] | no_license | camilagarcia113/xtext-dsl-obj3 | 2e135e565a301ef9ec899bfd89c76838e3ffa8e6 | cb44c141c8484aa46bb572a8402be178b1d41003 | refs/heads/master | 2021-01-17T19:25:59.385417 | 2016-07-27T01:32:11 | 2016-07-27T01:32:11 | 64,266,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,751 | java | /**
*/
package ar.edu.unq.aventuraGrafica.impl;
import ar.edu.unq.aventuraGrafica.AventuraGraficaPackage;
import ar.edu.unq.aventuraGrafica.Objeto;
import ar.edu.unq.aventuraGrafica.RecogerObjeto;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Recoger Objeto</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link ar.edu.unq.aventuraGrafica.impl.RecogerObjetoImpl#getObjeto <em>Objeto</em>}</li>
* </ul>
*
* @generated
*/
public class RecogerObjetoImpl extends ComandoImpl implements RecogerObjeto
{
/**
* The cached value of the '{@link #getObjeto() <em>Objeto</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjeto()
* @generated
* @ordered
*/
protected Objeto objeto;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RecogerObjetoImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return AventuraGraficaPackage.Literals.RECOGER_OBJETO;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Objeto getObjeto()
{
if (objeto != null && objeto.eIsProxy())
{
InternalEObject oldObjeto = (InternalEObject)objeto;
objeto = (Objeto)eResolveProxy(oldObjeto);
if (objeto != oldObjeto)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AventuraGraficaPackage.RECOGER_OBJETO__OBJETO, oldObjeto, objeto));
}
}
return objeto;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Objeto basicGetObjeto()
{
return objeto;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setObjeto(Objeto newObjeto)
{
Objeto oldObjeto = objeto;
objeto = newObjeto;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AventuraGraficaPackage.RECOGER_OBJETO__OBJETO, oldObjeto, objeto));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case AventuraGraficaPackage.RECOGER_OBJETO__OBJETO:
if (resolve) return getObjeto();
return basicGetObjeto();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case AventuraGraficaPackage.RECOGER_OBJETO__OBJETO:
setObjeto((Objeto)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case AventuraGraficaPackage.RECOGER_OBJETO__OBJETO:
setObjeto((Objeto)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case AventuraGraficaPackage.RECOGER_OBJETO__OBJETO:
return objeto != null;
}
return super.eIsSet(featureID);
}
} //RecogerObjetoImpl
| [
"[email protected]"
] | |
f6f809a8343f5e1d0810c805513eb699e5b4fe91 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/09145f30990d13c32f1bdbdb276e78fd84685b8d/before/ExtractClassTest.java | 856cc76c884584fbb37de621ee2bea54ae58e818 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,965 | java | /*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* User: anna
* Date: 20-Aug-2008
*/
package com.intellij.refactoring;
import com.intellij.JavaTestUtil;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiField;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiModifier;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.refactoring.extractclass.ExtractClassProcessor;
import com.intellij.refactoring.util.classMembers.MemberInfo;
import junit.framework.Assert;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.TreeSet;
public class ExtractClassTest extends MultiFileTestCase{
@NotNull
@Override
protected String getTestRoot() {
return "/refactoring/extractClass/";
}
@Override
protected String getTestDataPath() {
return JavaTestUtil.getJavaTestDataPath();
}
private void doTestMethod() throws Exception {
doTestMethod(null);
}
private void doTestMethod(String conflicts) throws Exception {
doTestMethod("foo", conflicts);
}
private void doTestMethod(final String methodName, final String conflicts) throws Exception {
doTestMethod(methodName, conflicts, "Test");
}
private void doTestMethod(final String methodName,
final String conflicts,
final String qualifiedName) throws Exception {
doTest(new PerformAction() {
@Override
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
PsiClass aClass = myJavaFacade.findClass(qualifiedName, GlobalSearchScope.projectScope(myProject));
assertNotNull("Class Test not found", aClass);
final ArrayList<PsiMethod> methods = new ArrayList<PsiMethod>();
methods.add(aClass.findMethodsByName(methodName, false)[0]);
doTest(aClass, methods, new ArrayList<PsiField>(), conflicts, false);
}
});
}
public void testStatic() throws Exception {
doTestMethod();
}
public void testStaticImport() throws Exception {
doTestMethod();
}
public void testFieldReference() throws Exception {
doTestMethod("foo", "Field 'myField' needs getter");
}
public void testVarargs() throws Exception {
doTestMethod();
}
public void testNoDelegation() throws Exception {
doTestMethod();
}
public void testNoFieldDelegation() throws Exception {
doTestFieldAndMethod();
}
public void testFieldInitializers() throws Exception {
doTestField(null);
}
public void testDependantFieldInitializers() throws Exception {
doTestField(null);
}
public void testDependantNonStaticFieldInitializers() throws Exception {
doTestField(null, true);
}
public void testInheritanceDelegation() throws Exception {
doTestMethod();
}
public void testEnumSwitch() throws Exception {
doTestMethod();
}
public void testImplicitReferenceTypeParameters() throws Exception {
doTestMethod();
}
public void testStaticImports() throws Exception {
doTestMethod("foo", null, "foo.Test");
}
public void testNoConstructorParams() throws Exception {
doTestFieldAndMethod();
}
public void testConstructorParams() throws Exception {
doTestFieldAndMethod();
}
private void doTestFieldAndMethod() throws Exception {
doTestFieldAndMethod("bar");
}
public void testInnerClassRefs() throws Exception {
doTestInnerClass();
}
private void doTestFieldAndMethod(final String methodName) throws Exception {
doTest(new PerformAction() {
@Override
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
assertNotNull("Class Test not found", aClass);
final ArrayList<PsiMethod> methods = new ArrayList<PsiMethod>();
methods.add(aClass.findMethodsByName(methodName, false)[0]);
final ArrayList<PsiField> fields = new ArrayList<PsiField>();
fields.add(aClass.findFieldByName("myT", false));
doTest(aClass, methods, fields, null, false);
}
});
}
private void doTestField(final String conflicts) throws Exception {
doTestField(conflicts, false);
}
private void doTestField(final String conflicts, final boolean generateGettersSetters) throws Exception {
doTest(new PerformAction() {
@Override
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
assertNotNull("Class Test not found", aClass);
final ArrayList<PsiMethod> methods = new ArrayList<PsiMethod>();
final ArrayList<PsiField> fields = new ArrayList<PsiField>();
fields.add(aClass.findFieldByName("myT", false));
doTest(aClass, methods, fields, conflicts, generateGettersSetters);
}
});
}
private static void doTest(final PsiClass aClass, final ArrayList<PsiMethod> methods, final ArrayList<PsiField> fields, final String conflicts,
boolean generateGettersSetters) {
try {
ExtractClassProcessor processor = new ExtractClassProcessor(aClass, fields, methods, new ArrayList<PsiClass>(), StringUtil.getPackageName(aClass.getQualifiedName()), null,
"Extracted", null, generateGettersSetters, Collections.<MemberInfo>emptyList());
processor.run();
LocalFileSystem.getInstance().refresh(false);
FileDocumentManager.getInstance().saveAllDocuments();
}
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
if (conflicts != null) {
TreeSet expectedConflictsSet = new TreeSet(Arrays.asList(conflicts.split("\n")));
TreeSet actualConflictsSet = new TreeSet(Arrays.asList(e.getMessage().split("\n")));
Assert.assertEquals(expectedConflictsSet, actualConflictsSet);
return;
} else {
fail(e.getMessage());
}
}
if (conflicts != null) {
fail("Conflicts were not detected: " + conflicts);
}
}
public void testGenerateGetters() throws Exception {
doTestField(null, true);
}
public void testIncrementDecrement() throws Exception {
doTestField(null, true);
}
public void testGetters() throws Exception {
doTestFieldAndMethod("getMyT");
}
public void testHierarchy() throws Exception {
doTestFieldAndMethod();
}
public void testPublicFieldDelegation() throws Exception {
doTest(new PerformAction() {
@Override
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
assertNotNull("Class Test not found", aClass);
final ArrayList<PsiField> fields = new ArrayList<PsiField>();
fields.add(aClass.findFieldByName("myT", false));
ExtractClassProcessor processor = new ExtractClassProcessor(aClass, fields, new ArrayList<PsiMethod>(), new ArrayList<PsiClass>(), "", "Extracted");
processor.run();
LocalFileSystem.getInstance().refresh(false);
FileDocumentManager.getInstance().saveAllDocuments();
}
});
}
private void doTestInnerClass() throws Exception {
doTest(new PerformAction() {
@Override
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
assertNotNull("Class Test not found", aClass);
final ArrayList<PsiClass> classes = new ArrayList<PsiClass>();
classes.add(aClass.findInnerClassByName("Inner", false));
ExtractClassProcessor processor = new ExtractClassProcessor(aClass, new ArrayList<PsiField>(), new ArrayList<PsiMethod>(), classes, "", "Extracted");
processor.run();
LocalFileSystem.getInstance().refresh(false);
FileDocumentManager.getInstance().saveAllDocuments();
}
});
}
public void testInner() throws Exception {
doTestInnerClass();
}
public void testMultipleGetters() throws Exception {
doTestField("Field 'myT' needs getter");
}
public void testMultipleGetters1() throws Exception {
doTestMethod("getMyT", "Field 'myT' needs getter");
}
public void testUsedInInitializer() throws Exception {
doTestField("Field 'myT' needs setter\n" +
"Field 'myT' needs getter\n" +
"Class initializer requires moved members");
}
public void testUsedInConstructor() throws Exception {
doTestField("Field 'myT' needs getter\n" +
"Field 'myT' needs setter\n" +
"Constructor requires moved members");
}
public void testRefInJavadoc() throws Exception {
doTestField(null);
}
public void testMethodTypeParameters() throws Exception {
doTestMethod();
}
public void testPublicVisibility() throws Exception {
doTest(new PerformAction() {
@Override
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(myProject));
assertNotNull("Class Test not found", aClass);
final ArrayList<PsiMethod> methods = new ArrayList<PsiMethod>();
methods.add(aClass.findMethodsByName("foos", false)[0]);
final ArrayList<PsiField> fields = new ArrayList<PsiField>();
fields.add(aClass.findFieldByName("myT", false));
final ExtractClassProcessor processor =
new ExtractClassProcessor(aClass, fields, methods, new ArrayList<PsiClass>(), "", null, "Extracted", PsiModifier.PUBLIC, false, Collections.<MemberInfo>emptyList());
processor.run();
LocalFileSystem.getInstance().refresh(false);
FileDocumentManager.getInstance().saveAllDocuments();
}
});
}
} | [
"[email protected]"
] | |
1f6e73b44a1a1f579a22878320df43ff119b2fe8 | ff90b24d08ec20054f03564a4238400a7fff5d1e | /src/main/java/com/luotianyi/test3/web/UserController.java | 4bf477943932625876005d101d793509b91c507d | [] | no_license | blogsProject/ssh3 | d53c78527af96354086c3d809881953676d99053 | 7bf23b72d3524909042c899441abe56504e5f6b8 | refs/heads/master | 2020-04-07T05:17:51.582515 | 2018-03-07T14:53:22 | 2018-03-07T14:53:22 | 124,184,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package com.luotianyi.test3.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import com.luotianyi.test3.entiy.User;
import com.luotianyi.test3.service.UserService;
import com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings("serial")
@Controller
public class UserController extends ActionSupport {
@Autowired
@Qualifier("userService")
UserService userService;
User user;
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String login() {
String flag;
System.out.println(user);
String username = user.getUsername();
User temp = userService.getUserByUsername(username);
if (temp == null) {
flag = "error";
} else {
flag = temp.getPassword().equals(user.getPassword()) ? "success" : "error";
}
return flag;
}
}
| [
"[email protected]"
] | |
0bb92ead0c861c2f69557c08347ff30401b80c1e | ec3ee5557e2120e9046f61a81b9d828e63f24c88 | /frostmourne-monitor/src/main/java/com/autohome/frostmourne/monitor/dao/mybatis/frostmourne/mapper/dynamic/RecipientDynamicSqlSupport.java | 7610273fff816865217f3644551ab87436eee5ea | [
"MIT"
] | permissive | xyzj91/frostmourne-1 | 34d9f4a1b12ca471a4b40aeb309dfefefa3bfd77 | d66da4e0a6c17b7e0eee910c2c3950a0ef0c6b79 | refs/heads/master | 2022-11-19T08:07:09.781357 | 2020-07-16T16:21:23 | 2020-07-16T16:21:23 | 280,370,796 | 1 | 0 | MIT | 2020-07-17T08:31:12 | 2020-07-17T08:31:11 | null | UTF-8 | Java | false | false | 2,299 | java | package com.autohome.frostmourne.monitor.dao.mybatis.frostmourne.mapper.dynamic;
import java.sql.JDBCType;
import java.util.Date;
import javax.annotation.Generated;
import org.mybatis.dynamic.sql.SqlColumn;
import org.mybatis.dynamic.sql.SqlTable;
public final class RecipientDynamicSqlSupport {
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2020-07-11T14:44:51.801+08:00", comments="Source Table: recipient")
public static final Recipient recipient = new Recipient();
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2020-07-11T14:44:51.801+08:00", comments="Source field: recipient.id")
public static final SqlColumn<Long> id = recipient.id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2020-07-11T14:44:51.801+08:00", comments="Source field: recipient.alarm_id")
public static final SqlColumn<Long> alarm_id = recipient.alarm_id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2020-07-11T14:44:51.801+08:00", comments="Source field: recipient.alert_id")
public static final SqlColumn<Long> alert_id = recipient.alert_id;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2020-07-11T14:44:51.801+08:00", comments="Source field: recipient.account")
public static final SqlColumn<String> account = recipient.account;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2020-07-11T14:44:51.801+08:00", comments="Source field: recipient.create_at")
public static final SqlColumn<Date> create_at = recipient.create_at;
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2020-07-11T14:44:51.801+08:00", comments="Source Table: recipient")
public static final class Recipient extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);
public final SqlColumn<Long> alarm_id = column("alarm_id", JDBCType.BIGINT);
public final SqlColumn<Long> alert_id = column("alert_id", JDBCType.BIGINT);
public final SqlColumn<String> account = column("account", JDBCType.VARCHAR);
public final SqlColumn<Date> create_at = column("create_at", JDBCType.TIMESTAMP);
public Recipient() {
super("recipient");
}
}
} | [
"[email protected]"
] | |
91f437a5fef8cf442d4822124e2ff315ebd956a0 | 0f442bd5a47888ecea6b29b8d80e64ad890b368e | /src/main/java/org/rtassembly/npgraph/grpc/RequestAssembly.java | 1900e9ee942c831f40ef20aca15dd6a56125476b | [
"LicenseRef-scancode-other-permissive"
] | permissive | hsnguyen/assembly | 1c49ac2213012fd13f01f293b72937db438ea446 | 26bd8df1b834d9df0c09be34c64de9dd7d0b5175 | refs/heads/master | 2022-12-14T23:22:28.562235 | 2020-12-06T12:35:44 | 2020-12-06T12:35:44 | 100,936,177 | 23 | 2 | null | 2022-12-02T22:21:51 | 2017-08-21T09:30:17 | Java | UTF-8 | Java | false | true | 30,521 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: npgraph_service.proto
package org.rtassembly.npgraph.grpc;
/**
* <pre>
* Client sent all hits from a chunk simultaneously
* </pre>
*
* Protobuf type {@code assembly.RequestAssembly}
*/
public final class RequestAssembly extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:assembly.RequestAssembly)
RequestAssemblyOrBuilder {
private static final long serialVersionUID = 0L;
// Use RequestAssembly.newBuilder() to construct.
private RequestAssembly(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private RequestAssembly() {
readId_ = "";
hitsList_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new RequestAssembly();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RequestAssembly(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
readId_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
hitsList_ = new java.util.ArrayList<org.rtassembly.npgraph.grpc.AlignmentMsg>();
mutable_bitField0_ |= 0x00000001;
}
hitsList_.add(
input.readMessage(org.rtassembly.npgraph.grpc.AlignmentMsg.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
hitsList_ = java.util.Collections.unmodifiableList(hitsList_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.rtassembly.npgraph.grpc.AssemblyGuideProto.internal_static_assembly_RequestAssembly_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.rtassembly.npgraph.grpc.AssemblyGuideProto.internal_static_assembly_RequestAssembly_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.rtassembly.npgraph.grpc.RequestAssembly.class, org.rtassembly.npgraph.grpc.RequestAssembly.Builder.class);
}
public static final int READ_ID_FIELD_NUMBER = 1;
private volatile java.lang.Object readId_;
/**
* <code>string read_id = 1;</code>
* @return The readId.
*/
public java.lang.String getReadId() {
java.lang.Object ref = readId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
readId_ = s;
return s;
}
}
/**
* <code>string read_id = 1;</code>
* @return The bytes for readId.
*/
public com.google.protobuf.ByteString
getReadIdBytes() {
java.lang.Object ref = readId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
readId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int HITS_LIST_FIELD_NUMBER = 2;
private java.util.List<org.rtassembly.npgraph.grpc.AlignmentMsg> hitsList_;
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public java.util.List<org.rtassembly.npgraph.grpc.AlignmentMsg> getHitsListList() {
return hitsList_;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public java.util.List<? extends org.rtassembly.npgraph.grpc.AlignmentMsgOrBuilder>
getHitsListOrBuilderList() {
return hitsList_;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public int getHitsListCount() {
return hitsList_.size();
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public org.rtassembly.npgraph.grpc.AlignmentMsg getHitsList(int index) {
return hitsList_.get(index);
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public org.rtassembly.npgraph.grpc.AlignmentMsgOrBuilder getHitsListOrBuilder(
int index) {
return hitsList_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getReadIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, readId_);
}
for (int i = 0; i < hitsList_.size(); i++) {
output.writeMessage(2, hitsList_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getReadIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, readId_);
}
for (int i = 0; i < hitsList_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, hitsList_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.rtassembly.npgraph.grpc.RequestAssembly)) {
return super.equals(obj);
}
org.rtassembly.npgraph.grpc.RequestAssembly other = (org.rtassembly.npgraph.grpc.RequestAssembly) obj;
if (!getReadId()
.equals(other.getReadId())) return false;
if (!getHitsListList()
.equals(other.getHitsListList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + READ_ID_FIELD_NUMBER;
hash = (53 * hash) + getReadId().hashCode();
if (getHitsListCount() > 0) {
hash = (37 * hash) + HITS_LIST_FIELD_NUMBER;
hash = (53 * hash) + getHitsListList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.rtassembly.npgraph.grpc.RequestAssembly parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.rtassembly.npgraph.grpc.RequestAssembly prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* Client sent all hits from a chunk simultaneously
* </pre>
*
* Protobuf type {@code assembly.RequestAssembly}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:assembly.RequestAssembly)
org.rtassembly.npgraph.grpc.RequestAssemblyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.rtassembly.npgraph.grpc.AssemblyGuideProto.internal_static_assembly_RequestAssembly_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.rtassembly.npgraph.grpc.AssemblyGuideProto.internal_static_assembly_RequestAssembly_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.rtassembly.npgraph.grpc.RequestAssembly.class, org.rtassembly.npgraph.grpc.RequestAssembly.Builder.class);
}
// Construct using org.rtassembly.npgraph.grpc.RequestAssembly.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getHitsListFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
readId_ = "";
if (hitsListBuilder_ == null) {
hitsList_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
hitsListBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.rtassembly.npgraph.grpc.AssemblyGuideProto.internal_static_assembly_RequestAssembly_descriptor;
}
@java.lang.Override
public org.rtassembly.npgraph.grpc.RequestAssembly getDefaultInstanceForType() {
return org.rtassembly.npgraph.grpc.RequestAssembly.getDefaultInstance();
}
@java.lang.Override
public org.rtassembly.npgraph.grpc.RequestAssembly build() {
org.rtassembly.npgraph.grpc.RequestAssembly result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.rtassembly.npgraph.grpc.RequestAssembly buildPartial() {
org.rtassembly.npgraph.grpc.RequestAssembly result = new org.rtassembly.npgraph.grpc.RequestAssembly(this);
int from_bitField0_ = bitField0_;
result.readId_ = readId_;
if (hitsListBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
hitsList_ = java.util.Collections.unmodifiableList(hitsList_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.hitsList_ = hitsList_;
} else {
result.hitsList_ = hitsListBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.rtassembly.npgraph.grpc.RequestAssembly) {
return mergeFrom((org.rtassembly.npgraph.grpc.RequestAssembly)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.rtassembly.npgraph.grpc.RequestAssembly other) {
if (other == org.rtassembly.npgraph.grpc.RequestAssembly.getDefaultInstance()) return this;
if (!other.getReadId().isEmpty()) {
readId_ = other.readId_;
onChanged();
}
if (hitsListBuilder_ == null) {
if (!other.hitsList_.isEmpty()) {
if (hitsList_.isEmpty()) {
hitsList_ = other.hitsList_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureHitsListIsMutable();
hitsList_.addAll(other.hitsList_);
}
onChanged();
}
} else {
if (!other.hitsList_.isEmpty()) {
if (hitsListBuilder_.isEmpty()) {
hitsListBuilder_.dispose();
hitsListBuilder_ = null;
hitsList_ = other.hitsList_;
bitField0_ = (bitField0_ & ~0x00000001);
hitsListBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getHitsListFieldBuilder() : null;
} else {
hitsListBuilder_.addAllMessages(other.hitsList_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.rtassembly.npgraph.grpc.RequestAssembly parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.rtassembly.npgraph.grpc.RequestAssembly) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object readId_ = "";
/**
* <code>string read_id = 1;</code>
* @return The readId.
*/
public java.lang.String getReadId() {
java.lang.Object ref = readId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
readId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string read_id = 1;</code>
* @return The bytes for readId.
*/
public com.google.protobuf.ByteString
getReadIdBytes() {
java.lang.Object ref = readId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
readId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string read_id = 1;</code>
* @param value The readId to set.
* @return This builder for chaining.
*/
public Builder setReadId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
readId_ = value;
onChanged();
return this;
}
/**
* <code>string read_id = 1;</code>
* @return This builder for chaining.
*/
public Builder clearReadId() {
readId_ = getDefaultInstance().getReadId();
onChanged();
return this;
}
/**
* <code>string read_id = 1;</code>
* @param value The bytes for readId to set.
* @return This builder for chaining.
*/
public Builder setReadIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
readId_ = value;
onChanged();
return this;
}
private java.util.List<org.rtassembly.npgraph.grpc.AlignmentMsg> hitsList_ =
java.util.Collections.emptyList();
private void ensureHitsListIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
hitsList_ = new java.util.ArrayList<org.rtassembly.npgraph.grpc.AlignmentMsg>(hitsList_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.rtassembly.npgraph.grpc.AlignmentMsg, org.rtassembly.npgraph.grpc.AlignmentMsg.Builder, org.rtassembly.npgraph.grpc.AlignmentMsgOrBuilder> hitsListBuilder_;
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public java.util.List<org.rtassembly.npgraph.grpc.AlignmentMsg> getHitsListList() {
if (hitsListBuilder_ == null) {
return java.util.Collections.unmodifiableList(hitsList_);
} else {
return hitsListBuilder_.getMessageList();
}
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public int getHitsListCount() {
if (hitsListBuilder_ == null) {
return hitsList_.size();
} else {
return hitsListBuilder_.getCount();
}
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public org.rtassembly.npgraph.grpc.AlignmentMsg getHitsList(int index) {
if (hitsListBuilder_ == null) {
return hitsList_.get(index);
} else {
return hitsListBuilder_.getMessage(index);
}
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder setHitsList(
int index, org.rtassembly.npgraph.grpc.AlignmentMsg value) {
if (hitsListBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHitsListIsMutable();
hitsList_.set(index, value);
onChanged();
} else {
hitsListBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder setHitsList(
int index, org.rtassembly.npgraph.grpc.AlignmentMsg.Builder builderForValue) {
if (hitsListBuilder_ == null) {
ensureHitsListIsMutable();
hitsList_.set(index, builderForValue.build());
onChanged();
} else {
hitsListBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder addHitsList(org.rtassembly.npgraph.grpc.AlignmentMsg value) {
if (hitsListBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHitsListIsMutable();
hitsList_.add(value);
onChanged();
} else {
hitsListBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder addHitsList(
int index, org.rtassembly.npgraph.grpc.AlignmentMsg value) {
if (hitsListBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHitsListIsMutable();
hitsList_.add(index, value);
onChanged();
} else {
hitsListBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder addHitsList(
org.rtassembly.npgraph.grpc.AlignmentMsg.Builder builderForValue) {
if (hitsListBuilder_ == null) {
ensureHitsListIsMutable();
hitsList_.add(builderForValue.build());
onChanged();
} else {
hitsListBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder addHitsList(
int index, org.rtassembly.npgraph.grpc.AlignmentMsg.Builder builderForValue) {
if (hitsListBuilder_ == null) {
ensureHitsListIsMutable();
hitsList_.add(index, builderForValue.build());
onChanged();
} else {
hitsListBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder addAllHitsList(
java.lang.Iterable<? extends org.rtassembly.npgraph.grpc.AlignmentMsg> values) {
if (hitsListBuilder_ == null) {
ensureHitsListIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, hitsList_);
onChanged();
} else {
hitsListBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder clearHitsList() {
if (hitsListBuilder_ == null) {
hitsList_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
hitsListBuilder_.clear();
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public Builder removeHitsList(int index) {
if (hitsListBuilder_ == null) {
ensureHitsListIsMutable();
hitsList_.remove(index);
onChanged();
} else {
hitsListBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public org.rtassembly.npgraph.grpc.AlignmentMsg.Builder getHitsListBuilder(
int index) {
return getHitsListFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public org.rtassembly.npgraph.grpc.AlignmentMsgOrBuilder getHitsListOrBuilder(
int index) {
if (hitsListBuilder_ == null) {
return hitsList_.get(index); } else {
return hitsListBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public java.util.List<? extends org.rtassembly.npgraph.grpc.AlignmentMsgOrBuilder>
getHitsListOrBuilderList() {
if (hitsListBuilder_ != null) {
return hitsListBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(hitsList_);
}
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public org.rtassembly.npgraph.grpc.AlignmentMsg.Builder addHitsListBuilder() {
return getHitsListFieldBuilder().addBuilder(
org.rtassembly.npgraph.grpc.AlignmentMsg.getDefaultInstance());
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public org.rtassembly.npgraph.grpc.AlignmentMsg.Builder addHitsListBuilder(
int index) {
return getHitsListFieldBuilder().addBuilder(
index, org.rtassembly.npgraph.grpc.AlignmentMsg.getDefaultInstance());
}
/**
* <code>repeated .assembly.AlignmentMsg hits_list = 2;</code>
*/
public java.util.List<org.rtassembly.npgraph.grpc.AlignmentMsg.Builder>
getHitsListBuilderList() {
return getHitsListFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.rtassembly.npgraph.grpc.AlignmentMsg, org.rtassembly.npgraph.grpc.AlignmentMsg.Builder, org.rtassembly.npgraph.grpc.AlignmentMsgOrBuilder>
getHitsListFieldBuilder() {
if (hitsListBuilder_ == null) {
hitsListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
org.rtassembly.npgraph.grpc.AlignmentMsg, org.rtassembly.npgraph.grpc.AlignmentMsg.Builder, org.rtassembly.npgraph.grpc.AlignmentMsgOrBuilder>(
hitsList_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
hitsList_ = null;
}
return hitsListBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:assembly.RequestAssembly)
}
// @@protoc_insertion_point(class_scope:assembly.RequestAssembly)
private static final org.rtassembly.npgraph.grpc.RequestAssembly DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.rtassembly.npgraph.grpc.RequestAssembly();
}
public static org.rtassembly.npgraph.grpc.RequestAssembly getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<RequestAssembly>
PARSER = new com.google.protobuf.AbstractParser<RequestAssembly>() {
@java.lang.Override
public RequestAssembly parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RequestAssembly(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<RequestAssembly> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<RequestAssembly> getParserForType() {
return PARSER;
}
@java.lang.Override
public org.rtassembly.npgraph.grpc.RequestAssembly getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"[email protected]"
] | |
2d6ae2d61a413aa029ed359183dad445f263bb91 | d815bf4787aa5c3f0799576b0bf18ff2bab0585b | /src/main/java/world/ucode/pojo/Registration.java | 52b2c2fa203ce28f3345f0dfe1a2dabb91568bf4 | [] | no_license | OlgaLopushanska/ubay | e79027dca4bac067f4596ab04f703fbf429f4a86 | bfacb5c5c0c449840713ac4d76dbe7ca81b377fe | refs/heads/main | 2023-04-04T22:57:17.378397 | 2021-04-08T19:51:19 | 2021-04-08T19:51:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,378 | java | package world.ucode.pojo;
import javax.persistence.*;
import java.security.SecureRandom;
import java.sql.SQLTransactionRollbackException;
@Entity
@Table(name = "Registration")
public class Registration {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@Column(name = "Id", updatable = false, nullable = false)
private int id;
@Column(name = "login", nullable = false)
private String login;
@Column(name = "password", nullable = false)
private String password;
@Column(name = "role", nullable = false)
private String role;
@Column(name = "state", updatable = true)
private String state;
@Column(name = "IPadress", updatable = true)
private String IPadress;
@Column(name = "email", nullable = false, updatable = true)
private String email;
@Column(name = "hash", nullable = false, updatable = true)
private int hash;
public Registration(){}
public Registration(int id, String login, String password, String role, String state, String IPadress, String email,
int hash){
this.id = id;
this.login = login;
this.password = password;
this.role = role;
this.state = state;
this.IPadress = IPadress;
this.email = email;
this.hash = hash;
}
public int getId(){
return id;
}
public void setId(int id){
this.id = id;
}
public String getLogin(){
return login;
}
public String getPassword(){
return password;
}
public String getRole(){
return role;
}
public String getState() {
return state;
}
public String getIPadress() {
return IPadress;
}
public String getEmail() {
return email;
}
public int getHash() {
return hash;
}
public void setLogin(String login){
this.login = login;
}
public void setPassword(String password){
this.password = password;
}
public void setRole(String role){
this.role = role;
}
public void setState(String state) {
this.state = state;
}
public void setIPadress(String iPadress) {
this.IPadress = iPadress;
}
public void setEmail(String email) {
this.email = email;
}
public void setHash(int hash) {
this.hash = hash;
}
}
| [
"[email protected]"
] | |
7c18d0a6ce1452f557e5806a6861ee8f8a639925 | 691cec0e9a22c7874f19cc4eea3ca64a6aa50df9 | /offer_code_08.03/src/cn/kobe/Solution3.java | a2cdeeabc83384b087b0fddcb1c14785a9e4d5a5 | [] | no_license | luffryfight/Leetcode | 2b3ed1ea415ef9561ceafe7ff7331618b3b1823c | d668f7749b9dd4a0bdf907bbf93c498596d60c93 | refs/heads/master | 2023-07-15T19:04:13.670186 | 2021-08-23T03:23:19 | 2021-08-23T03:23:19 | 257,553,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package cn.kobe;
public class Solution3 {
//暴力的优化
public int findMagicIndex(int[] nums) {
for (int i = 0; i < nums.length; i++) {
if (nums[i] == i)
return i;
if (nums[i] > i + 1) {
i = nums[i] - 1;
}
}
return -1;
}
}
| [
"[email protected]"
] | |
4a8e794faed8382de76d730bcd387b467b553b5e | e707e6d6f7769a35d4292e45fdaab34edec5749e | /Dara1/app/src/main/java/com/example/test/dara/StartingLocationActivity.java | 75403ced2ace2f82de42650b0148e1163ee98c21 | [] | no_license | alecglen/Dara | 1594730c151d932188b9aa63d0131d48f2579884 | d43286ad4cbb04142161a5a246f7e84fc7056eb5 | refs/heads/master | 2021-04-12T08:06:26.266390 | 2018-05-22T20:31:49 | 2018-05-22T20:31:49 | 126,091,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,821 | java | package com.example.test.dara;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class StartingLocationActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_starting_location);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Make button lead back to the New Req interface
Button getAddress = findViewById(R.id.addressContinue);
getAddress.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText temp = findViewById(R.id.editText7);
String addr1 = temp.getText().toString();
EditText temp2 = findViewById(R.id.EndingeditText13);
String city = temp2.getText().toString();
EditText temp3 = findViewById(R.id.editText8);
String state = temp3.getText().toString();
String address = addr1 + ", " + city + ", " + state;
if (address.length() > 35) address = address.substring(0, 32) + "...";
Intent myIntent = new Intent(StartingLocationActivity.this, NewReqActivity.class);
Bundle bundle = getIntent().getExtras();
bundle.putString("Pick-up Location", address);
myIntent.putExtras(bundle);
StartingLocationActivity.this.startActivity(myIntent);
}
});
}
}
| [
"[email protected]"
] | |
ba483e2592858af7468700b67a03555e01478328 | 69cf7e7a74a365b556b76513cbe9a0e019280ca1 | /RTS/junit/edu/ycp/cs320/rts/junit/GameObjectTest.java | 4d83857fe19bea73519ff87b2b33f1842a41cc72 | [] | no_license | dmashuda/CS320RTS | 9806c3bbd09208ce0b80a57d656a9d4af0797ed4 | ae534aeecf5d0709eb12ea7ea724bdd8ee020b5d | refs/heads/master | 2021-01-01T19:16:48.651606 | 2014-05-14T03:40:21 | 2014-05-14T03:40:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,225 | java | package edu.ycp.cs320.rts.junit;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import edu.ycp.cs320.rts.shared.GameObject;
import edu.ycp.cs320.rts.shared.Point;
public class GameObjectTest {
private Point c1 = new Point(3,4);
private Point c2 = new Point(106,2);
private Point c3 = new Point(106,103);
private GameObject p1 = new GameObject();
private GameObject p2 = new GameObject();
private GameObject p3 = new GameObject();
@Before
public void setUp() throws Exception {
p1.setPosition(new Point(0,0));
p2.setPosition(new Point(10,10));
p3.setPosition(new Point(99,99));
p1.setSize(new Point(8,8));
p2.setSize(new Point(32,32));
p3.setSize(new Point(16,16));
}
@Test
public void testP1() {
assertEquals(true, p1.checkBounds(c1));
assertEquals(false, p1.checkBounds(c2));
assertEquals(false, p1.checkBounds(c3));
}
@Test
public void testP2() {
assertEquals(false, p2.checkBounds(c2));
assertEquals(false, p2.checkBounds(c3));
assertEquals(false, p2.checkBounds(c1));
}
@Test
public void testP3() {
assertEquals(false, p3.checkBounds(c1));
assertEquals(true, p3.checkBounds(c3));
assertEquals(false, p3.checkBounds(c2));
}
}
| [
"[email protected]"
] | |
a45ec2e0dfa8c3dbc4f8f854f49edb558800cfbc | 000f4ec33333e40dec5d75093a537070bc5a32e5 | /kodilla-patterns2/src/test/java/com/kodilla/patterns2/adapter/company/SalaryAdapterTestSuite.java | 4fe412bbea45fb7997c9544320d1a34749eb3599 | [] | no_license | michal-tokarski/michal-tokarski-kodilla-java | 67ac73e8ab237d6e964c46614f840f7a47944693 | 4e902fac090cdeb9a7b0a91ca2bbc9e8b2074163 | refs/heads/master | 2021-06-20T19:31:29.608260 | 2021-03-14T18:34:44 | 2021-03-14T18:34:44 | 190,971,793 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 611 | java | package com.kodilla.patterns2.adapter.company;
import com.kodilla.patterns2.adapter.company.oldhrsystem.Workers;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class SalaryAdapterTestSuite {
@Test
public void testTotalSalary() {
//Given
Workers workers = new Workers();
SalaryAdapter salaryAdapter = new SalaryAdapter();
//When
double totalSalary = salaryAdapter.TotalSalary(workers.getWorkers(), workers.getSalaries());
//Then
System.out.println(totalSalary);
assertEquals(totalSalary, 27750, 0);
}
}
| [
"[email protected]"
] | |
674b60f04c4209b5f0af3158e1ff04d1a9c3ef50 | 25fba3f7dc18e0d684c1162643d77db795f5b129 | /src/main/java/org/sblim/cimclient/internal/cimxml/CIMClientXML_HelperImpl.java | 7d594d520b81f7d62cf21fcc1c14506be3aefd46 | [] | no_license | lkx007/sblim-cim-client2 | c0fb1eb1d4bb9a4a8fe8be25a6197ac01d5462c1 | 5fbf0c281cbbe9d52e4d9c8cf18bfcd2a09946f7 | refs/heads/main | 2023-02-11T08:36:38.568797 | 2018-11-16T03:54:40 | 2018-11-16T03:54:40 | 327,822,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 97,555 | java | /**
* (C) Copyright IBM Corp. 2005, 2013
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Eclipse Public License from
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* @author : Roberto Pineiro, IBM, [email protected]
* @author : Chung-hao Tan, IBM, [email protected]
*
*
* Change History
* Flag Date Prog Description
*-------------------------------------------------------------------------------
* 13521 2004-11-26 thschaef XML Request Composition for static method call is wrong
* 18075 2005-08-11 pineiro5 Can not use method CIMClient.invokeMethod
* 1535756 2006-08-07 lupusalex Make code warning free
* 1365086 2006-10-25 ebak Possible bug in createQualifier
* 1565892 2006-11-16 lupusalex Make SBLIM client JSR48 compliant
* 1610046 2006-12-18 lupusalex Does not escape trailing spaces <KEYVALUE>
* 1610046 2007-01-10 lupusalex Rework: Does not escape trailing spaces <KEYVALUE>
* 1649611 2007-01-31 lupusalex Interop issue: Quotes not escaped by client
* 1671502 2007-02-28 lupusalex Remove dependency from Xerces
* 1660756 2007-03-02 ebak Embedded object support
* 1689085 2007-04-10 ebak Embedded object enhancements for Pegasus
* 1669961 2006-04-16 lupusalex CIMTypedElement.getType() =>getDataType()
* 1715027 2007-05-08 lupusalex Make message id random
* 1719991 2007-05-16 ebak FVT: regression ClassCastException in EmbObjHandler
* 1734888 2007-06-11 ebak Wrong reference building in METHODCALL request
* 1827728 2007-11-12 ebak embeddedInstances: attribute EmbeddedObject not set
* 1827728 2007-11-20 ebak rework: embeddedInstances: attribute EmbeddedObject not set
* 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
* 2204488 2008-10-28 raman_arora Fix code to remove compiler warnings
* 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
* 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
* 2763216 2009-04-14 blaschke-oss Code cleanup: visible spelling/grammar errors
* 2797550 2009-06-01 raman_arora JSR48 compliance - add Java Generics
* 2845211 2009-08-27 raman_arora Pull Enumeration Feature (SAX Parser)
* 2865222 2009-09-29 raman_arora enumerateQualifierTypes shouldn't require a class name
* 2858933 2009-10-12 raman_arora JSR48 new APIs: associatorClasses & associatorInstances
* 2886829 2009-11-18 raman_arora JSR48 new APIs: referenceClasses & referenceInstances
* 2944219 2010-02-05 blaschke-oss Problem with pull operations using client against EMC CIMOM
* 3027479 2010-07-09 blaschke-oss Dead store to local variable
* 3062747 2010-09-21 blaschke-oss SblimCIMClient does not log all CIM-XML responces.
* 3514537 2012-04-03 blaschke-oss TCK: execQueryInstances requires boolean, not Boolean
* 3521119 2012-04-24 blaschke-oss JSR48 1.0.0: remove CIMObjectPath 2/3/4-parm ctors
* 3527580 2012-05-17 blaschke-oss WBEMClient should not throw IllegalArgumentException
* 3601894 2013-01-23 blaschke-oss Enhance HTTP and CIM-XML tracing
* 2616 2013-02-23 blaschke-oss Add new API WBEMClientSBLIM.sendIndication()
* 2689 2013-10-10 blaschke-oss createMETHODCALL should not add PARAMTYPE attribute
*/
package org.sblim.cimclient.internal.cimxml;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.Random;
import java.util.Vector;
import javax.cim.CIMArgument;
import javax.cim.CIMClass;
import javax.cim.CIMDataType;
import javax.cim.CIMInstance;
import javax.cim.CIMNamedElementInterface;
import javax.cim.CIMObjectPath;
import javax.cim.CIMProperty;
import javax.cim.CIMQualifierType;
import javax.cim.CIMValuedElement;
import javax.cim.UnsignedInteger32;
import javax.wbem.WBEMException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.sblim.cimclient.internal.logging.TimeStamp;
import org.sblim.cimclient.internal.util.MOF;
import org.sblim.cimclient.internal.wbem.CIMError;
import org.sblim.cimclient.internal.wbem.operations.CIMAssociatorNamesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMAssociatorsOp;
import org.sblim.cimclient.internal.wbem.operations.CIMCreateClassOp;
import org.sblim.cimclient.internal.wbem.operations.CIMCreateInstanceOp;
import org.sblim.cimclient.internal.wbem.operations.CIMCreateNameSpaceOp;
import org.sblim.cimclient.internal.wbem.operations.CIMCreateQualifierTypeOp;
import org.sblim.cimclient.internal.wbem.operations.CIMDeleteClassOp;
import org.sblim.cimclient.internal.wbem.operations.CIMDeleteInstanceOp;
import org.sblim.cimclient.internal.wbem.operations.CIMDeleteQualifierTypeOp;
import org.sblim.cimclient.internal.wbem.operations.CIMEnumClassNamesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMEnumClassesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMEnumInstanceNamesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMEnumInstancesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMEnumNameSpaceOp;
import org.sblim.cimclient.internal.wbem.operations.CIMEnumQualifierTypesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMExecQueryOp;
import org.sblim.cimclient.internal.wbem.operations.CIMGetClassOp;
import org.sblim.cimclient.internal.wbem.operations.CIMGetInstanceOp;
import org.sblim.cimclient.internal.wbem.operations.CIMGetPropertyOp;
import org.sblim.cimclient.internal.wbem.operations.CIMGetQualifierTypeOp;
import org.sblim.cimclient.internal.wbem.operations.CIMInvokeMethodOp;
import org.sblim.cimclient.internal.wbem.operations.CIMOperation;
import org.sblim.cimclient.internal.wbem.operations.CIMReferenceNamesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMReferencesOp;
import org.sblim.cimclient.internal.wbem.operations.CIMSetClassOp;
import org.sblim.cimclient.internal.wbem.operations.CIMSetInstanceOp;
import org.sblim.cimclient.internal.wbem.operations.CIMSetPropertyOp;
import org.sblim.cimclient.internal.wbem.operations.CIMSetQualifierTypeOp;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
* Class CIMClientXML_HelperImpl is responsible for building CIM-XML requests
* and responses.
*/
public class CIMClientXML_HelperImpl {
private static class Counter {
private int iCounter;
protected Counter(int pCounter) {
this.iCounter = pCounter;
}
protected int incrementAndGet() {
return ++this.iCounter;
}
}
private static final String VERSION = "1.0";
private static final String ASSOCIATOR_NAMES = "AssociatorNames";
// Pull Enumeration variables
private static final String ASSOC_CLASS = "AssocClass";
private static final String CLASS_NAME = "ClassName";
private static final String CONTINUE_ON_ERROR = "ContinueOnError";
private static final String DEEP_INHERITANCE = "DeepInheritance";
private static final String ENUMERATION_CONTEXT = "EnumerationContext";
private static final String FILTER_QUERY_LANGUAGE = "FilterQueryLanguage";
private static final String FILTER_QUERY = "FilterQuery";
private static final String INCLUDE_CLASS_ORIGIN = "IncludeClassOrigin";
private static final String INSTANCE_NAME = "InstanceName";
private static final String MAX_OBJECT_COUNT = "MaxObjectCount";
private static final String PROPERTY_LIST = "PropertyList";
private static final String OPERATION_TIMEOUT = "OperationTimeout";
private static final String RESULT_CLASS = "ResultClass";
private static final String RETURN_QUERY_RESULT_CLASS = "ReturnQueryResultClass";
private static final String QUERY_RESULT_CLASS = "QueryResultClass";
private static final String ROLE = "Role";
private static final String RESULT_ROLE = "ResultRole";
private static final Random RANDOM = new Random();
private static final int MAX_ID = 1 << 20;
private final ThreadLocal<Counter> iCurrentId = new ThreadLocal<Counter>();
private final DocumentBuilder iBuilder;
private static String valueStr(CIMValuedElement<?> pE) {
Object o = pE.getValue();
return o == null ? MOF.NULL : o.toString();
}
/**
* Ctor.
*
* @throws ParserConfigurationException
*/
public CIMClientXML_HelperImpl() throws ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
this.iBuilder = factory.newDocumentBuilder();
}
/**
* getDocumentBuilder
*
* @return DocumentBuilder
*/
public DocumentBuilder getDocumentBuilder() {
return this.iBuilder;
}
/**
* newDocument
*
* @return Document
*/
public Document newDocument() {
return this.iBuilder.newDocument();
}
/**
* parse
*
* @param pIS
* @return Document
* @throws IOException
* @throws SAXException
*/
public Document parse(InputSource pIS) throws IOException, SAXException {
if (pIS == null) throw new IllegalArgumentException("null input stream argument");
return this.iBuilder.parse(pIS);
}
/**
* Serializes a given DOM document as (CIM-)XML to a given output stream
*
* @param pOS
* The output stream
* @param pDoc
* The documents
* @throws IOException
* Whenever something goes wrong
*/
public static void serialize(OutputStream pOS, Document pDoc) throws IOException {
CimXmlSerializer.serialize(pOS, pDoc, false);
}
/**
* Serializes a given DOM document as (CIM-)XML to a given output stream.
* The document is pretty wrapped and indented and surrounded with markers
* for the begin and end.
*
* @param pOS
* The output stream
* @param pDoc
* The documents
* @throws IOException
*/
public static void dumpDocument(OutputStream pOS, Document pDoc) throws IOException {
dumpDocument(pOS, pDoc, null);
}
/**
* Serializes a given DOM document as (CIM-)XML to a given output stream.
* The document is pretty wrapped and indented and surrounded with markers
* for the begin and end.
*
* @param pOS
* The output stream
* @param pDoc
* The documents
* @param pOrigin
* The origin of the output stream (request, indication response,
* etc.)
* @throws IOException
*/
public static void dumpDocument(OutputStream pOS, Document pDoc, String pOrigin)
throws IOException {
// debug
if (pOS == null) { return; }
if (pOrigin == null) pOrigin = "unknown";
pOS.write("<--- ".getBytes());
pOS.write(pOrigin.getBytes());
pOS.write(" begin ".getBytes());
pOS.write(TimeStamp.formatWithMillis(System.currentTimeMillis()).getBytes());
pOS.write(" -----\n".getBytes());
CimXmlSerializer.serialize(pOS, pDoc, true);
pOS.write("\n---- ".getBytes());
pOS.write(pOrigin.getBytes());
pOS.write(" end ------>\n".getBytes());
}
/**
* createCIMMessage
*
* @param pDoc
* @param pRequestE
* @return Element
*/
public Element createCIMMessage(Document pDoc, Element pRequestE) {
Element cimE = CIMXMLBuilderImpl.createCIM(pDoc);
Element messageE = CIMXMLBuilderImpl.createMESSAGE(pDoc, cimE, String.valueOf(getNextId()),
VERSION);
if (pRequestE != null) {
messageE.appendChild(pRequestE);
}
return messageE;
}
/**
* createMultiReq
*
* @param pDoc
* @return Element
*/
public Element createMultiReq(Document pDoc) {
Element multireqE = CIMXMLBuilderImpl.createMULTIREQ(pDoc);
return multireqE;
}
/**
* associatorNames_request
*
* @param pDoc
* @param pObjectName
* @param pAssocClass
* @param pResultClass
* @param pRole
* @param pResultRole
* @return Element
* @throws WBEMException
*/
public Element associatorNames_request(Document pDoc, CIMObjectPath pObjectName,
String pAssocClass, String pResultClass, String pRole, String pResultRole)
throws WBEMException {
// obtain data
String className = pObjectName.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
CIMProperty<?>[] keysA = pObjectName.getKeys();
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
ASSOCIATOR_NAMES);
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
Element iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
for (int i = 0; i < keysA.length; i++) {
CIMProperty<?> prop = keysA[i];
String propName = prop.getName();
// TODO: check that CIMDataType.toString() satisfies this
String propTypeStr = prop.getDataType().toString();
String propValueStr = valueStr(prop);
Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
}
if (pAssocClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
}
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
if (pResultRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
}
return simplereqE;
}
/**
* associatorNames_response
*
* @param pDoc
* @param pPathA
* @return Element
*/
public static Element associatorNames_response(Document pDoc, CIMObjectPath[] pPathA) {
Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
"associatorNames");
Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
try {
for (int i = 0; i < pPathA.length; i++) {
CIMXMLBuilderImpl.createOBJECTPATH(pDoc, iRetValE, pPathA[i]);
}
} catch (WBEMException e) {
throw new RuntimeException(e);
}
return simpRspE;
}
/**
* associatorInstances_request
*
* @param pDoc
* @param pObjectName
* @param pAssocClass
* @param pResultClass
* @param pRole
* @param pResultRole
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element associatorInstances_request(Document pDoc, CIMObjectPath pObjectName,
String pAssocClass, String pResultClass, String pRole, String pResultRole,
boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
String className = pObjectName.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
CIMProperty<?>[] keysA = pObjectName.getKeys();
// Make sure keys are populated
if (keysA.length == 0) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"associatorInstances requires keys for the instance to be populated");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
Element iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
for (int i = 0; i < keysA.length; i++) {
CIMProperty<?> prop = keysA[i];
String propName = prop.getName();
String propTypeStr = prop.getDataType().toString();
String propValueStr = valueStr(prop);
Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
}
if (pAssocClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
}
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
if (pResultRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
}
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* associatorClasses_request
*
* @param pDoc
* @param pObjectName
* @param pAssocClass
* @param pResultClass
* @param pRole
* @param pResultRole
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element associatorClasses_request(Document pDoc, CIMObjectPath pObjectName,
String pAssocClass, String pResultClass, String pRole, String pResultRole,
boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
throws WBEMException {
String className = pObjectName.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
// Make sure keys are not populated
if (pObjectName.getKeys().length != 0) throw new WBEMException(
WBEMException.CIM_ERR_INVALID_PARAMETER,
"Keys should not be populated for associatorClasses");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
Element iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
if (pAssocClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
}
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
if (pResultRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* associators_request
*
* @param pDoc
* @param pObjectName
* @param pAssocClass
* @param pResultClass
* @param pRole
* @param pResultRole
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element associators_request(Document pDoc, CIMObjectPath pObjectName,
String pAssocClass, String pResultClass, String pRole, String pResultRole,
boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
throws WBEMException {
// obtain data
String className = pObjectName.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
CIMProperty<?>[] keysA = pObjectName.getKeys();
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "Associators");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pObjectName);
Element iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
Element instancenameE = CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, className);
for (int i = 0; i < keysA.length; i++) {
CIMProperty<?> prop = keysA[i];
String propName = prop.getName();
// TODO: check that CIMDataType.toString() satisfies this
String propTypeStr = prop.getDataType().toString();
// CIMXMLBuilderImpl.getTypeStr(pValue.getType());
String propValueStr = valueStr(prop);
Element keybindingE = CIMXMLBuilderImpl.createKEYBINDING(pDoc, instancenameE, propName);
CIMXMLBuilderImpl.createKEYVALUE(pDoc, keybindingE, propTypeStr, propValueStr);
}
if (pAssocClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "AssocClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
}
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
if (pResultRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultRole");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList"); // BB
// fixed
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* associators_response
*
* @param pDoc
* @param pNamedElementA
* @return Element
*/
public static Element associators_response(Document pDoc,
CIMNamedElementInterface[] pNamedElementA) {
Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE, "associators");
Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
try {
for (int i = 0; i < pNamedElementA.length; i++) {
CIMNamedElementInterface namedElement = pNamedElementA[i];
CIMObjectPath op = namedElement.getObjectPath();
String nameSpace = op == null ? null : op.getNamespace();
CIMXMLBuilderImpl
.createVALUEOBJECTWITHPATH(pDoc, iRetValE, namedElement, nameSpace);
/*
* CIMXMLBuilderImpl.createCLASSPATH( pDoc, iRetValE,
* pClassA[i].getObjectPath() );
* CIMXMLBuilderImpl.createCLASS(pDoc, iRetValE, pClassA[i]);
*/
}
} catch (WBEMException e) {
throw new RuntimeException(e);
}
return simpRspE;
}
/**
* enumerateInstanceNames_request
*
* @param pDoc
* @param pPath
* @return Element
* @throws WBEMException
*/
public Element enumerateInstanceNames_request(Document pDoc, CIMObjectPath pPath)
throws WBEMException {
// obtain data
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"EnumerateInstanceNames");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
return simplereqE;
}
/**
* enumerateInstances_request
*
* @param pDoc
* @param pPath
* @param pDeepInheritance
* @param pLocalOnly
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element enumerateInstances_request(Document pDoc, CIMObjectPath pPath,
boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers,
boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
// obtain data
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"EnumerateInstances");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* getInstance_request
*
* @param pDoc
* @param pName
* @param pLocalOnly
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element getInstance_request(Document pDoc, CIMObjectPath pName, boolean pLocalOnly,
boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
throws WBEMException {
// obtain data
String className = pName.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetInstance");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"InstanceName");
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* deleteInstance_request
*
* @param pDoc
* @param pName
* @return Element
* @throws WBEMException
*/
public Element deleteInstance_request(Document pDoc, CIMObjectPath pName) throws WBEMException {
// obtain data
String className = pName.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"DeleteInstance");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"InstanceName");
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pName);
return simplereqE;
}
/**
* getClass_request
*
* @param pDoc
* @param pName
* @param pLocalOnly
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element getClass_request(Document pDoc, CIMObjectPath pName, boolean pLocalOnly,
boolean pIncludeQualifiers, boolean pIncludeClassOrigin, String[] pPropertyList)
throws WBEMException {
// obtain data
String className = pName.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetClass");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* createInstance_request
*
* @param pDoc
* @param pName
* @param pInstance
* @return Element
* @throws WBEMException
*/
public Element createInstance_request(Document pDoc, CIMObjectPath pName, CIMInstance pInstance)
throws WBEMException {
String className = pInstance.getObjectPath().getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"CreateInstance");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pName);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"NewInstance");
CIMXMLBuilderImpl.createINSTANCE(pDoc, iparamvalueE, pInstance);
return simplereqE;
}
/**
* invokeMethod_request
*
* @param pDoc
* @param pLocalPath
* @param pMethodName
* @param pInArgs
* @return Element
* @throws WBEMException
*/
public Element invokeMethod_request(Document pDoc, CIMObjectPath pLocalPath,
String pMethodName, CIMArgument<?>[] pInArgs) throws WBEMException {
// obtain data
String className = pLocalPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
CIMProperty<?>[] keysA = pLocalPath.getKeys();
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element methodcallE = CIMXMLBuilderImpl.createMETHODCALL(pDoc, simplereqE, pMethodName);
// 13521
if (keysA.length > 0) {
Element localpathE = CIMXMLBuilderImpl.createLOCALINSTANCEPATH(pDoc, methodcallE);
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, localpathE, pLocalPath); // 13521
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, localpathE, pLocalPath); // 13521
} else {
CIMXMLBuilderImpl.createLOCALCLASSPATH(pDoc, methodcallE, pLocalPath);
}
buildParamValues(pDoc, methodcallE, pLocalPath, pInArgs);
return simplereqE;
}
/**
* invokeMethod_response
*
* @param pDoc
* @param pMethodName
* @param pLocalPath
* @param pRetVal
* @param pOutArgA
* @return Element
* @throws WBEMException
*/
public static Element invokeMethod_response(Document pDoc, String pMethodName,
CIMObjectPath pLocalPath, Object pRetVal, CIMArgument<?>[] pOutArgA)
throws WBEMException {
if (pMethodName == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null method name");
Element simpleRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
Element methodRspE = CIMXMLBuilderImpl.createMETHODRESPONSE(pDoc, simpleRspE, pMethodName);
CIMXMLBuilderImpl.createRETURNVALUE(pDoc, methodRspE, pRetVal);
buildParamValues(pDoc, methodRspE, pLocalPath, pOutArgA);
return simpleRspE;
}
/**
* @param pLocalPath
*/
private static void buildParamValues(Document pDoc, Element pParentE, CIMObjectPath pLocalPath,
CIMArgument<?>[] pArgA) throws WBEMException {
if (pArgA == null) return;
for (int i = 0; i < pArgA.length; i++) {
CIMArgument<?> arg = pArgA[i];
if (arg == null) continue;
CIMXMLBuilderImpl.createPARAMVALUE(pDoc, pParentE, arg);
}
}
// public CIMResponse createIndication_request(Document doc) throws
// CIMXMLParseException, CIMException {
// Element rootE = doc.getDocumentElement();
// CIMResponse response = (CIMResponse)xmlParser.parseCIM(rootE);
// response.checkError();
// return response;
// // Vector v = (Vector)response.getFirstReturnValue();
// //
// // //TODO: Should we return the whole list of instances or just the first
// instance?
// // //TODO: return the whole vector of indications
// // if (v.size() > 0)
// // return (CIMInstance)v.elementAt(0);
// // else
// // return null;
// }
/**
* createIndication_response
*
* @param error
* @return Document
*/
public Document createIndication_response(CIMError error) {
// CIMXMLBuilderImpl.create XML
Document doc = this.iBuilder.newDocument();
Element cimE = CIMXMLBuilderImpl.createCIM(doc);
Element messageE = CIMXMLBuilderImpl.createMESSAGE(doc, cimE, String.valueOf(getNextId()),
"1.0");
Element simpleexprspE = CIMXMLBuilderImpl.createSIMPLEEXPRSP(doc, messageE);
Element expmethodresponseE = CIMXMLBuilderImpl.createEXPMETHODRESPONSE(doc, simpleexprspE,
"ExportIndication");
if (error == null) {
CIMXMLBuilderImpl.createIRETURNVALUE(doc, expmethodresponseE);
} else {
CIMXMLBuilderImpl.createERROR(doc, expmethodresponseE, error);
}
// Element
return doc;
}
/**
* createClass_request
*
* @param pDoc
* @param pPath
* @param pClass
* @return Element
* @throws WBEMException
*/
public Element createClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass)
throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "CreateClass");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewClass");
CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
return simplereqE;
}
/**
* getQualifier_request
*
* @param pDoc
* @param pPath
* @param pQt
* @return Element
* @throws WBEMException
*/
public Element getQualifier_request(Document pDoc, CIMObjectPath pPath, String pQt)
throws WBEMException {
// obtain data
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl
.createIMETHODCALL(pDoc, simplereqE, "GetQualifier");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"QualifierName");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
return simplereqE;
}
/**
* createQualifierType_request : This has been replaced by
* setQualifierType_request
*
* @param pDoc
* @param pPath
* @param pQt
* @return Element
* @throws WBEMException
*/
public Element createQualifierType_request(Document pDoc, CIMObjectPath pPath,
CIMQualifierType<?> pQt) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl
.createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"QualifierDeclaration");
CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
return simplereqE;
}
/**
* deleteClass_request
*
* @param pDoc
* @param pPath
* @return Element
* @throws WBEMException
*/
public Element deleteClass_request(Document pDoc, CIMObjectPath pPath) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "DeleteClass");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
return simplereqE;
}
/**
* deleteQualifierType_request
*
* @param pDoc
* @param pPath
* @return Element
* @throws WBEMException
*/
public Element deleteQualifierType_request(Document pDoc, CIMObjectPath pPath)
throws WBEMException {
// obtain data
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"DeleteQualifier");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"QualifierName");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPath.getObjectName());
return simplereqE;
}
/**
* enumerateClasses_request
*
* @param pDoc
* @param pPath
* @param pDeepInheritance
* @param pLocalOnly
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @return Element
*/
public Element enumerateClasses_request(Document pDoc, CIMObjectPath pPath,
boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers,
boolean pIncludeClassOrigin) {
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"EnumerateClasses");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE;
if (pPath != null && pPath.getObjectName() != null
&& pPath.getObjectName().trim().length() != 0) {
String className = pPath.getObjectName();
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "LocalOnly");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pLocalOnly);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
return simplereqE;
}
/**
* enumerateClasses_response
*
* @param pDoc
* @param pClA
* @return Element
*/
public static Element enumerateClasses_response(Document pDoc, CIMClass[] pClA) {
Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
"enumerateClasses");
Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
try {
for (int i = 0; i < pClA.length; i++) {
CIMXMLBuilderImpl.createCLASS(pDoc, iRetValE, pClA[i]);
}
} catch (WBEMException e) {
throw new RuntimeException(e);
}
return simpRspE;
}
/**
* enumerateInstances_response
*
* @param pDoc
* @param pInstA
* @return Element
*/
public static Element enumerateInstances_response(Document pDoc, CIMInstance[] pInstA) {
Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
"enumerateInstances");
Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
try {
for (int i = 0; i < pInstA.length; i++) {
CIMXMLBuilderImpl.createINSTANCE(pDoc, iRetValE, pInstA[i]);
}
} catch (WBEMException e) {
throw new RuntimeException(e);
}
return simpRspE;
}
/**
* enumerateClassNames_request
*
* @param pDoc
* @param pPath
* @param pDeepInheritance
* @return Element
*/
public Element enumerateClassNames_request(Document pDoc, CIMObjectPath pPath,
boolean pDeepInheritance) {
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"EnumerateClassNames");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE;
if (pPath != null && pPath.getObjectName() != null
&& pPath.getObjectName().trim().length() != 0) {
String className = pPath.getObjectName();
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ClassName");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "DeepInheritance");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
return simplereqE;
}
/**
* getProperty_request
*
* @param pDoc
* @param pPath
* @param pPropertyName
* @return Element
* @throws WBEMException
*/
public Element getProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName)
throws WBEMException {
// obtain data
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "GetProperty");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"InstanceName");
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
if (pPropertyName != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
}
return simplereqE;
}
/**
* referenceNames_request
*
* @param pDoc
* @param pPath
* @param pResultClass
* @param pRole
* @return Element
* @throws WBEMException
*/
public Element referenceNames_request(Document pDoc, CIMObjectPath pPath, String pResultClass,
String pRole) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"ReferenceNames");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
return simplereqE;
}
/**
* referenceClasses_request
*
* @param pDoc
* @param pPath
* @param pResultClass
* @param pRole
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element referenceClasses_request(Document pDoc, CIMObjectPath pPath,
String pResultClass, String pRole, boolean pIncludeQualifiers,
boolean pIncludeClassOrigin, String[] pPropertyList) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
// Make sure keys are not populated
if (pPath.getKeys().length != 0) throw new WBEMException(
WBEMException.CIM_ERR_INVALID_PARAMETER,
"Keys should not be populated for referenceClasses");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
// createOBJECTNAME will internally call createINSTANCENAME but as there
// are no keys Element containing keys will not be populated
CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* referenceInstances_request
*
* @param pDoc
* @param pPath
* @param pResultClass
* @param pRole
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element referenceInstances_request(Document pDoc, CIMObjectPath pPath,
String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList)
throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
// keys are required for CIMInstance
if (pPath.getKeys().length == 0) throw new WBEMException(
WBEMException.CIM_ERR_INVALID_PARAMETER,
"refrenceInstances requires keys for the instance to be populated");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
// createOBJECTNAME will internally call createINSTANCENAME to populate
// Element containing keys
CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* references_request
*
* @param pDoc
* @param pPath
* @param pResultClass
* @param pRole
* @param pIncludeQualifiers
* @param pIncludeClassOrigin
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element references_request(Document pDoc, CIMObjectPath pPath, String pResultClass,
String pRole, boolean pIncludeQualifiers, boolean pIncludeClassOrigin,
String[] pPropertyList) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "References");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE;
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ObjectName");
CIMXMLBuilderImpl.createOBJECTNAME(pDoc, iparamvalueE, pPath);
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "ResultClass");
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Role");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, "IncludeClassOrigin");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* setClass_request
*
* @param pDoc
* @param pPath
* @param pClass
* @return Element
* @throws WBEMException
*/
public Element setClass_request(Document pDoc, CIMObjectPath pPath, CIMClass pClass)
throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ModifyClass");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"ModifiedClass");
CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pClass);
return simplereqE;
}
/**
* setInstance_request
*
* @param pDoc
* @param pPath
* @param pInstance
* @param pIncludeQualifiers
* @param pPropertyList
* @return Element
* @throws WBEMException
*/
public Element setInstance_request(Document pDoc, CIMObjectPath pPath, CIMInstance pInstance,
boolean pIncludeQualifiers, String[] pPropertyList) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"ModifyInstance");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"ModifiedInstance");
CIMXMLBuilderImpl.createVALUENAMEDINSTANCE(pDoc, iparamvalueE, pPath, pInstance);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "IncludeQualifiers");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeQualifiers);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyList");
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++) {
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
}
return simplereqE;
}
/**
* setProperty_request
*
* @param pDoc
* @param pPath
* @param pPropertyName
* @param pNewValue
* @return Element
* @throws WBEMException
*/
public Element setProperty_request(Document pDoc, CIMObjectPath pPath, String pPropertyName,
Object pNewValue) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "SetProperty");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"InstanceName");
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
if (pPropertyName != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "PropertyName");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pPropertyName);
}
if (pNewValue != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "NewValue");
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pNewValue);
}
return simplereqE;
}
/**
* setQualifierType_request
*
* @param pDoc
* @param pPath
* @param pQt
* @return Element
* @throws WBEMException
*/
public Element setQualifierType_request(Document pDoc, CIMObjectPath pPath,
CIMQualifierType<?> pQt) throws WBEMException {
// Make sure class name exists, it is required to uniquely identify
// qualifier in namespace
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl
.createIMETHODCALL(pDoc, simplereqE, "SetQualifier");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"QualifierDeclaration");
CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iparamvalueE, pQt);
return simplereqE;
}
/**
* enumQualifierTypes_request
*
* @param pDoc
* @param pPath
* @return Element
* @throws WBEMException
*/
public Element enumQualifierTypes_request(Document pDoc, CIMObjectPath pPath)
throws WBEMException {
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"EnumerateQualifiers");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
return simplereqE;
}
/**
* enumQualifierTypes_response
*
* @param pDoc
* @param pQualiTypeA
* @return Element
* @throws WBEMException
*/
public static Element enumQualifierTypes_response(Document pDoc,
CIMQualifierType<?>[] pQualiTypeA) throws WBEMException {
Element simpRspE = CIMXMLBuilderImpl.createSIMPLERSP(pDoc, null);
Element iMethRspE = CIMXMLBuilderImpl.createIMETHODRESPONSE(pDoc, simpRspE,
"associatorNames");
Element iRetValE = CIMXMLBuilderImpl.createIRETURNVALUE(pDoc, iMethRspE);
for (int i = 0; i < pQualiTypeA.length; i++) {
CIMXMLBuilderImpl.createQUALIFIER_DECLARATION(pDoc, iRetValE, pQualiTypeA[i]);
}
return simpRspE;
}
/**
* execQuery_request
*
* @param pDoc
* @param pPath
* @param pQuery
* @param pQueryLanguage
* @return Element
*/
public Element execQuery_request(Document pDoc, CIMObjectPath pPath, String pQuery,
String pQueryLanguage) {
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE, "ExecQuery");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element querylanguageE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
"QueryLanguage");
CIMXMLBuilderImpl.createVALUE(pDoc, querylanguageE, pQueryLanguage);
Element queryE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, "Query");
CIMXMLBuilderImpl.createVALUE(pDoc, queryE, pQuery);
return simplereqE;
}
/**
* performBatchOperation_request
*
* @param pDoc
* @param pOperations
* @return Element
* @throws WBEMException
*/
public Element performBatchOperation_request(Document pDoc, Vector<CIMOperation> pOperations)
throws WBEMException {
Element messageE = createCIMMessage(pDoc, null);
if (pOperations.size() > 1) {
Element multireqE = createMultiReq(pDoc);
messageE.appendChild(multireqE);
messageE = multireqE;
}
int i = 0;
Iterator<CIMOperation> iter = pOperations.iterator();
while (iter.hasNext()) {
CIMOperation op = iter.next();
try {
Element requestE = null;
if (op instanceof CIMAssociatorsOp) {
CIMAssociatorsOp associatorsOp = (CIMAssociatorsOp) op;
requestE = associators_request(pDoc, associatorsOp.getObjectName(),
associatorsOp.getAssocClass(), associatorsOp.getResultClass(),
associatorsOp.getRole(), associatorsOp.getResultRole(), associatorsOp
.isIncludeQualifiers(), associatorsOp.isIncludeClassOrigin(),
associatorsOp.getPropertyList());
} else if (op instanceof CIMAssociatorNamesOp) {
CIMAssociatorNamesOp associatorNamesOp = (CIMAssociatorNamesOp) op;
requestE = associatorNames_request(pDoc, associatorNamesOp.getObjectName(),
associatorNamesOp.getAssocClass(), associatorNamesOp.getResultClass(),
associatorNamesOp.getRole(), associatorNamesOp.getResultRole());
} else if (op instanceof CIMCreateClassOp) {
CIMCreateClassOp createClassOp = (CIMCreateClassOp) op;
requestE = createClass_request(pDoc, createClassOp.getObjectName(),
createClassOp.getCimClass());
} else if (op instanceof CIMCreateInstanceOp) {
CIMCreateInstanceOp createInstanceOp = (CIMCreateInstanceOp) op;
requestE = createInstance_request(pDoc, createInstanceOp.getObjectName(),
createInstanceOp.getInstance());
} else if (op instanceof CIMCreateNameSpaceOp) {
CIMCreateNameSpaceOp createNameSpaceOp = (CIMCreateNameSpaceOp) op;
String namespace = createNameSpaceOp.getNameSpace();
int j = namespace.lastIndexOf('/');
if (j < 0) throw new WBEMException(WBEMException.CIM_ERR_NOT_FOUND,
"Invalid namespace. Must contain at least /");
String parentNs = namespace.substring(0, j);
namespace = namespace.substring(j + 1);
/*
* CIMInstance inst = new CIMInstance();
* inst.setClassName("CIM_NameSpace"); CIMProperty prop =
* new CIMProperty("NameSpace"); prop.setValue(new
* CIMValue(namespace, CIMDataType
* .getPredefinedType(CIMDataType.STRING))); Vector v = new
* Vector(); v.add(prop); inst.setProperties(v);
*/
CIMInstance inst = new CIMInstance(new CIMObjectPath(null, null, null, null,
"CIM_NameSpace", null), new CIMProperty[] { new CIMProperty<String>(
"NameSpace", CIMDataType.STRING_T, namespace, true, false, null) });
CIMObjectPath object = new CIMObjectPath(null, null, null, parentNs, null, null);
requestE = createInstance_request(pDoc, object, inst);
} else if (op instanceof CIMCreateQualifierTypeOp) {
CIMCreateQualifierTypeOp createQualifierTypeOp = (CIMCreateQualifierTypeOp) op;
requestE = createQualifierType_request(pDoc, createQualifierTypeOp
.getObjectName(), createQualifierTypeOp.getQualifierType());
} else if (op instanceof CIMDeleteClassOp) {
CIMDeleteClassOp deleteClassOp = (CIMDeleteClassOp) op;
requestE = deleteClass_request(pDoc, deleteClassOp.getObjectName());
} else if (op instanceof CIMDeleteInstanceOp) {
CIMDeleteInstanceOp deleteInstanceOp = (CIMDeleteInstanceOp) op;
requestE = deleteClass_request(pDoc, deleteInstanceOp.getObjectName());
} else if (op instanceof CIMDeleteQualifierTypeOp) {
CIMDeleteQualifierTypeOp deleteQualifierTypeOp = (CIMDeleteQualifierTypeOp) op;
requestE = deleteClass_request(pDoc, deleteQualifierTypeOp.getObjectName());
} else if (op instanceof CIMEnumClassesOp) {
CIMEnumClassesOp enumClassesOp = (CIMEnumClassesOp) op;
requestE = enumerateClasses_request(pDoc, enumClassesOp.getObjectName(),
enumClassesOp.isDeep(), enumClassesOp.isLocalOnly(), enumClassesOp
.isIncludeQualifiers(), enumClassesOp.isIncludeClassOrigin());
} else if (op instanceof CIMEnumClassNamesOp) {
CIMEnumClassNamesOp enumClassNamesOp = (CIMEnumClassNamesOp) op;
requestE = enumerateClassNames_request(pDoc, enumClassNamesOp.getObjectName(),
enumClassNamesOp.isDeep());
} else if (op instanceof CIMEnumInstanceNamesOp) {
CIMEnumInstanceNamesOp enumInstanceNamesOp = (CIMEnumInstanceNamesOp) op;
requestE = enumerateInstanceNames_request(pDoc, enumInstanceNamesOp
.getObjectName());
} else if (op instanceof CIMEnumInstancesOp) {
CIMEnumInstancesOp enumInstancesOp = (CIMEnumInstancesOp) op;
requestE = enumerateInstances_request(pDoc, enumInstancesOp.getObjectName(),
enumInstancesOp.isDeep(), enumInstancesOp.isLocalOnly(),
enumInstancesOp.isIncludeQualifiers(), enumInstancesOp
.isIncludeClassOrigin(), enumInstancesOp.getPropertyList());
} else if (op instanceof CIMEnumNameSpaceOp) {
CIMEnumNameSpaceOp enumNameSpaceOp = (CIMEnumNameSpaceOp) op;
// ebak: here we have to set CIMObjectPath's objectname
// enumNameSpaceOp.getObjectName().setObjectName("CIM_NameSpace");
CIMObjectPath objPath = enumNameSpaceOp.getObjectName();
objPath = new CIMObjectPath(objPath.getScheme(), objPath.getHost(), objPath
.getPort(), objPath.getNamespace(), "CIM_NameSpace", objPath.getKeys());
requestE = enumerateInstanceNames_request(pDoc, enumNameSpaceOp.getObjectName());
} else if (op instanceof CIMEnumQualifierTypesOp) {
CIMEnumQualifierTypesOp enumQualifierTypesOp = (CIMEnumQualifierTypesOp) op;
requestE = enumQualifierTypes_request(pDoc, enumQualifierTypesOp
.getObjectName());
} else if (op instanceof CIMExecQueryOp) {
CIMExecQueryOp execQueryOp = (CIMExecQueryOp) op;
requestE = execQuery_request(pDoc, execQueryOp.getObjectName(), execQueryOp
.getQuery(), execQueryOp.getQueryLanguage());
} else if (op instanceof CIMGetPropertyOp) {
CIMGetPropertyOp getPropertyOp = (CIMGetPropertyOp) op;
requestE = getInstance_request(pDoc, getPropertyOp.getObjectName(), false,
false, false, new String[] { getPropertyOp.getPropertyName() });
} else if (op instanceof CIMGetClassOp) {
CIMGetClassOp getClassOp = (CIMGetClassOp) op;
requestE = getClass_request(pDoc, getClassOp.getObjectName(), getClassOp
.isLocalOnly(), getClassOp.isIncludeQualifiers(), getClassOp
.isIncludeClassOrigin(), getClassOp.getPropertyList());
} else if (op instanceof CIMGetInstanceOp) {
CIMGetInstanceOp getInstanceOp = (CIMGetInstanceOp) op;
requestE = getInstance_request(pDoc, getInstanceOp.getObjectName(),
getInstanceOp.isLocalOnly(), getInstanceOp.isIncludeQualifiers(),
getInstanceOp.isIncludeClassOrigin(), getInstanceOp.getPropertyList());
} else if (op instanceof CIMGetQualifierTypeOp) {
CIMGetQualifierTypeOp getQualifierTypeOp = (CIMGetQualifierTypeOp) op;
requestE = getQualifier_request(pDoc, getQualifierTypeOp.getObjectName(),
getQualifierTypeOp.getQualifierType());
} else if (op instanceof CIMInvokeMethodOp) {
CIMInvokeMethodOp invokeMethodOp = (CIMInvokeMethodOp) op;
requestE = invokeMethod_request(pDoc, invokeMethodOp.getObjectName(),
invokeMethodOp.getMethodCall(), invokeMethodOp.getInParams());
} else if (op instanceof CIMReferenceNamesOp) {
CIMReferenceNamesOp referenceNamesOp = (CIMReferenceNamesOp) op;
requestE = referenceNames_request(pDoc, referenceNamesOp.getObjectName(),
referenceNamesOp.getResultClass(), referenceNamesOp.getResultRole());
} else if (op instanceof CIMReferencesOp) {
CIMReferencesOp referencesOp = (CIMReferencesOp) op;
requestE = references_request(pDoc, referencesOp.getObjectName(), referencesOp
.getResultClass(), referencesOp.getRole(), referencesOp
.isIncludeQualifiers(), referencesOp.isIncludeClassOrigin(),
referencesOp.getPropertyList());
} else if (op instanceof CIMSetClassOp) {
CIMSetClassOp setClassOp = (CIMSetClassOp) op;
requestE = setClass_request(pDoc, setClassOp.getObjectName(), setClassOp
.getCimClass());
} else if (op instanceof CIMSetInstanceOp) {
CIMSetInstanceOp setInstanceOp = (CIMSetInstanceOp) op;
requestE = setInstance_request(pDoc, setInstanceOp.getObjectName(),
setInstanceOp.getInstance(), setInstanceOp.isIncludeQualifiers(),
setInstanceOp.getPropertyList());
} else if (op instanceof CIMSetPropertyOp) {
CIMSetPropertyOp setPropertyOp = (CIMSetPropertyOp) op;
requestE = setProperty_request(pDoc, setPropertyOp.getObjectName(),
setPropertyOp.getPropertyName(), setPropertyOp.getCimValue());
} else if (op instanceof CIMSetQualifierTypeOp) {
CIMSetQualifierTypeOp setQualifierTypeOp = (CIMSetQualifierTypeOp) op;
requestE = setQualifierType_request(pDoc, setQualifierTypeOp.getObjectName(),
setQualifierTypeOp.getQualifierType());
}
if (requestE == null) throw new WBEMException(
WBEMException.CIM_ERR_INVALID_PARAMETER, "Illegal batch operation number ("
+ i + ") " + op.getClass());
messageE.appendChild(requestE);
} catch (WBEMException e) {
throw e;
} catch (Exception e) {
throw new WBEMException(WBEMException.CIM_ERR_FAILED, "At batch operation (" + i
+ ')', null, e);
}
i++;
}
return messageE;
}
/**
* Sets the message id counter to a given value. For use in units tests
* only.
*
* @param pId
* The new value
*/
public void setId(int pId) {
this.iCurrentId.set(new Counter(pId - 1));
}
/**
* Get the next message id. If this method is called for the first time by
* the current thread it will choose a start value randomly. Afterwards the
* id is incremented by 1. Be aware that different threads will have
* distinct id counters.
*
* @return The next message id
*/
private int getNextId() {
if (this.iCurrentId.get() == null) {
this.iCurrentId.set(new Counter(RANDOM.nextInt(MAX_ID)));
}
return this.iCurrentId.get().incrementAndGet();
}
/**
* pAssociatorPaths_request
*
* @param pDoc
* @param pPath
* @param pAssocClass
* @param pResultClass
* @param pRole
* @param pResultRole
* @param pFilterQueryLanguage
* @param pFilterQuery
* @param pOperationTimeout
* @param pContinueOnError
* @param pMaxObjectCount
* @return Element
* @throws WBEMException
*/
public Element OpenAssociatorInstancePaths_request(Document pDoc, CIMObjectPath pPath,
String pAssocClass, String pResultClass, String pRole, String pResultRole,
String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"OpenAssociatorInstancePaths");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
INSTANCE_NAME);
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
if (pAssocClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
}
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
if (pResultRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
}
if (pFilterQueryLanguage != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
FILTER_QUERY_LANGUAGE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
}
if (pFilterQuery != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
}
if (pOperationTimeout != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
OPERATION_TIMEOUT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* OpenAssociatorInstances_request
*
* @param pDoc
* @param pPath
* @param pAssocClass
* @param pResultClass
* @param pRole
* @param pResultRole
* @param pIncludeClassOrigin
* @param pPropertyList
* @param pFilterQueryLanguage
* @param pFilterQuery
* @param pOperationTimeout
* @param pContinueOnError
* @param pMaxObjectCount
* @return Element OpenAssociatorInstances_request
* @throws WBEMException
*/
public Element OpenAssociatorInstances_request(Document pDoc, CIMObjectPath pPath,
String pAssocClass, String pResultClass, String pRole, String pResultRole,
boolean pIncludeClassOrigin, String[] pPropertyList, String pFilterQueryLanguage,
String pFilterQuery, UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"OpenAssociatorInstances");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
INSTANCE_NAME);
// createINSTANCENAME will take care of keyBindings
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
if (pAssocClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ASSOC_CLASS);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pAssocClass);
}
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
if (pResultRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_ROLE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pResultRole);
}
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++)
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
if (pFilterQueryLanguage != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
FILTER_QUERY_LANGUAGE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
}
if (pFilterQuery != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
}
if (pOperationTimeout != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
OPERATION_TIMEOUT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* OpenEnumerateInstancePaths_request
*
* @param pDoc
* @param pPath
* @param pFilterQueryLanguage
* @param pFilterQuery
* @param pOperationTimeout
* @param pContinueOnError
* @param pMaxObjectCount
* @return Element
* @throws WBEMException
*/
public Element OpenEnumerateInstancePaths_request(Document pDoc, CIMObjectPath pPath,
String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"OpenEnumerateInstancePaths");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
if (pFilterQueryLanguage != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
FILTER_QUERY_LANGUAGE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
}
if (pFilterQuery != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
}
if (pOperationTimeout != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
OPERATION_TIMEOUT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* OpenEnumerateInstances_request
*
* @param pDoc
* @param pPath
* @param pPropertyList
* @param pIncludeClassOrigin
* @param pDeepInheritance
* @param pFilterQueryLanguage
* @param pFilterQuery
* @param pOperationTimeout
* @param pContinueOnError
* @param pMaxObjectCount
* @return Element
* @throws WBEMException
*/
public Element OpenEnumerateInstances_request(Document pDoc, CIMObjectPath pPath,
boolean pDeepInheritance, boolean pIncludeClassOrigin, String[] pPropertyList,
String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"OpenEnumerateInstances");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CLASS_NAME);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, className);
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, DEEP_INHERITANCE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pDeepInheritance);
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++)
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
if (pFilterQueryLanguage != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
FILTER_QUERY_LANGUAGE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
}
if (pFilterQuery != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
}
if (pOperationTimeout != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
OPERATION_TIMEOUT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* EnumerationCount_request
*
* @param pDoc
* @param pPath
* @param pEnumerationContext
* @return Element
* @throws WBEMException
*/
public Element EnumerationCount_request(Document pDoc, CIMObjectPath pPath,
String pEnumerationContext) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"EnumerationCount");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
if (pEnumerationContext != null) {
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
ENUMERATION_CONTEXT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
}
return simplereqE;
}
/**
* CloseEnumeration_request
*
* @param pDoc
* @param pPath
* @param pEnumerationContext
* @return Element
* @throws WBEMException
*/
public Element CloseEnumeration_request(Document pDoc, CIMObjectPath pPath,
String pEnumerationContext) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"CloseEnumeration");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
if (pEnumerationContext != null) {
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
ENUMERATION_CONTEXT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pEnumerationContext);
}
return simplereqE;
}
/**
* referencePaths_request
*
* @param pDoc
* @param pPath
* @param pResultClass
* @param pRole
* @param pFilterQueryLanguage
* @param pFilterQuery
* @param pOperationTimeout
* @param pContinueOnError
* @param pMaxObjectCount
* @return Element referencePaths_request
* @throws WBEMException
*/
public Element OpenReferenceInstancePaths_request(Document pDoc, CIMObjectPath pPath,
String pResultClass, String pRole, String pFilterQueryLanguage, String pFilterQuery,
UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"OpenReferenceInstancePaths");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
INSTANCE_NAME);
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
if (pFilterQueryLanguage != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
FILTER_QUERY_LANGUAGE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
}
if (pFilterQuery != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
}
if (pOperationTimeout != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
OPERATION_TIMEOUT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* references_request
*
* @param pDoc
* @param pPath
* @param pResultClass
* @param pRole
* @param pIncludeClassOrigin
* @param pPropertyList
* @param pFilterQueryLanguage
* @param pFilterQuery
* @param pOperationTimeout
* @param pContinueOnError
* @param pMaxObjectCount
* @return Element references_request
* @throws WBEMException
*/
public Element OpenReferenceInstances_request(Document pDoc, CIMObjectPath pPath,
String pResultClass, String pRole, boolean pIncludeClassOrigin, String[] pPropertyList,
String pFilterQueryLanguage, String pFilterQuery, UnsignedInteger32 pOperationTimeout,
boolean pContinueOnError, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"OpenReferenceInstances");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
INSTANCE_NAME);
CIMXMLBuilderImpl.createINSTANCENAME(pDoc, iparamvalueE, pPath);
if (pResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, RESULT_CLASS);
CIMXMLBuilderImpl.createCLASSNAME(pDoc, iparamvalueE, pResultClass);
}
if (pRole != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, ROLE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pRole);
}
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, INCLUDE_CLASS_ORIGIN);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pIncludeClassOrigin);
if (pPropertyList != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, PROPERTY_LIST);
Element valuearrayE = CIMXMLBuilderImpl.createVALUEARRAY(pDoc, iparamvalueE);
for (int i = 0; i < pPropertyList.length; i++)
CIMXMLBuilderImpl.createVALUE(pDoc, valuearrayE, pPropertyList[i]);
}
if (pFilterQueryLanguage != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
FILTER_QUERY_LANGUAGE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
}
if (pFilterQuery != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
}
if (pOperationTimeout != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
OPERATION_TIMEOUT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* OpenQueryInstances_request
*
* @param pDoc
* @param pPath
* @param pFilterQuery
* @param pFilterQueryLanguage
* @param pReturnQueryResultClass
* @param pOperationTimeout
* @param pContinueOnError
* @param pMaxObjectCount
* @param pQueryResultClass
* @return Element OpenQueryInstances_request
* @throws WBEMException
*/
public Element OpenQueryInstances_request(Document pDoc, CIMObjectPath pPath,
String pFilterQuery, String pFilterQueryLanguage, boolean pReturnQueryResultClass,
UnsignedInteger32 pOperationTimeout, boolean pContinueOnError,
UnsignedInteger32 pMaxObjectCount, CIMClass pQueryResultClass) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"OpenQueryInstances");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE;
if (pFilterQuery != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, FILTER_QUERY);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQuery);
}
if (pFilterQueryLanguage != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
FILTER_QUERY_LANGUAGE);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pFilterQueryLanguage);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
RETURN_QUERY_RESULT_CLASS);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pReturnQueryResultClass);
if (pOperationTimeout != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
OPERATION_TIMEOUT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pOperationTimeout);
}
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE, CONTINUE_ON_ERROR);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContinueOnError);
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
if (pQueryResultClass != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
QUERY_RESULT_CLASS);
CIMXMLBuilderImpl.createCLASS(pDoc, iparamvalueE, pQueryResultClass);
}
return simplereqE;
}
/**
* PullInstancesWithPath_request
*
* @param pDoc
* @param pPath
* @param pContext
* @param pMaxObjectCount
* @return Element PullInstancesWithPath_request
* @throws WBEMException
*/
public Element PullInstancesWithPath_request(Document pDoc, CIMObjectPath pPath,
String pContext, UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"PullInstancesWithPath");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE;
if (pContext != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
ENUMERATION_CONTEXT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
}
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* PullInstancePaths_request
*
* @param pDoc
* @param pPath
* @param pContext
* @param pMaxObjectCount
* @return Element PullInstancePaths
* @throws WBEMException
*/
public Element PullInstancePaths_request(Document pDoc, CIMObjectPath pPath, String pContext,
UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"PullInstancePaths");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE;
if (pContext != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
ENUMERATION_CONTEXT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
}
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* PullInstances_request
*
* @param pDoc
* @param pPath
* @param pContext
* @param pMaxObjectCount
* @return Element PullInstances_request
* @throws WBEMException
*/
public Element PullInstances_request(Document pDoc, CIMObjectPath pPath, String pContext,
UnsignedInteger32 pMaxObjectCount) throws WBEMException {
String className = pPath.getObjectName();
if (className == null) throw new WBEMException(WBEMException.CIM_ERR_INVALID_PARAMETER,
"null class name");
Element simplereqE = CIMXMLBuilderImpl.createSIMPLEREQ(pDoc);
Element imethodcallE = CIMXMLBuilderImpl.createIMETHODCALL(pDoc, simplereqE,
"PullInstances");
CIMXMLBuilderImpl.createLOCALNAMESPACEPATH(pDoc, imethodcallE, pPath);
Element iparamvalueE;
if (pContext != null) {
iparamvalueE = CIMXMLBuilderImpl.createIPARAMVALUE(pDoc, imethodcallE,
ENUMERATION_CONTEXT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pContext);
}
if (pMaxObjectCount != null) {
iparamvalueE = CIMXMLBuilderImpl
.createIPARAMVALUE(pDoc, imethodcallE, MAX_OBJECT_COUNT);
CIMXMLBuilderImpl.createVALUE(pDoc, iparamvalueE, pMaxObjectCount);
}
return simplereqE;
}
/**
* sendIndication_request
*
* @param pDoc
* @param pIndication
* @return Element sendIndication_request
* @throws WBEMException
*/
public Element sendIndication_request(Document pDoc, CIMInstance pIndication)
throws WBEMException {
Element simpleexpreqE = CIMXMLBuilderImpl.createSIMPLEEXPREQ(pDoc);
Element expmethodcallE = CIMXMLBuilderImpl.createEXPMETHODCALL(pDoc, simpleexpreqE,
"ExportIndication");
Element expparamvalueE = CIMXMLBuilderImpl.createEXPPARAMVALUE(pDoc, expmethodcallE,
"NewIndication");
CIMXMLBuilderImpl.createINSTANCE(pDoc, expparamvalueE, pIndication);
return simpleexpreqE;
}
}
| [
"[email protected]"
] | |
a6db5487650cf554e0996a5fa5243ec488733ebf | 602e369052c0e53e731701140d154bcd1c421db8 | /zlschool-api/src/main/java/com/zl/school/business/dto/course/GetCourseUnderListRes.java | 1d4510b4a5fa360aae84894c52de62c3ace7a830 | [] | no_license | 123wangkun/baoluaninfo | 1d51e32a7885719bec936c575ddc2d1d3213f0e2 | a5b2f4b1a52bbb0c78c1d325da5fdc0eee9bdaba | refs/heads/master | 2022-11-26T15:06:43.494843 | 2019-06-24T08:48:59 | 2019-06-24T08:48:59 | 193,442,090 | 1 | 0 | null | 2022-11-16T08:24:59 | 2019-06-24T05:50:23 | JavaScript | UTF-8 | Java | false | false | 1,285 | java | package com.zl.school.business.dto.course;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Date;
@Data
public class GetCourseUnderListRes {
@ApiModelProperty(value = "编码",required = true)
private String id;
@ApiModelProperty(value = "线下课程名称",required = true)
private String name;
@ApiModelProperty(value = "课程类型",required = true)
private String typeName;
@ApiModelProperty(value = "课程状态名称",required = true)
private Integer stateName;
@ApiModelProperty(value = "课程状态(1审核中;2进行中;3已结束;4未启用;)",required = true)
private Integer state;
@ApiModelProperty(value = "开始时间(线下)",required = true)
@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
private Date studyTime;
@ApiModelProperty(value = "创建时间",required = true)
@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
private Date createdTime;
@ApiModelProperty(value = "课程时长(分钟)",required = true)
private Integer totalTime;
}
| [
"[email protected]"
] | |
f35be0726af8d3b307631c0a291ab918efe304ce | a7c12e4a8c47ebdf4549cc62a5c2730c8cbd5dee | /src/main/java/com/jouav/myapp/service/impl/JobHistoryServiceImpl.java | 9516aff05be279b5d27d1addb5bdb9513c3a29d6 | [] | no_license | hanjingyao/app3 | 40e3529b390631d26145a140c87eaac1c7f3f0c0 | 276022a22e9ee5027fd7b7530a2c14f83c288279 | refs/heads/master | 2021-04-26T23:03:25.091959 | 2018-03-05T07:27:41 | 2018-03-05T13:30:57 | 123,923,334 | 0 | 1 | null | 2020-09-18T08:37:49 | 2018-03-05T13:27:15 | Java | UTF-8 | Java | false | false | 2,665 | java | package com.jouav.myapp.service.impl;
import com.jouav.myapp.service.JobHistoryService;
import com.jouav.myapp.domain.JobHistory;
import com.jouav.myapp.repository.JobHistoryRepository;
import com.jouav.myapp.service.dto.JobHistoryDTO;
import com.jouav.myapp.service.mapper.JobHistoryMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* Service Implementation for managing JobHistory.
*/
@Service
@Transactional
public class JobHistoryServiceImpl implements JobHistoryService {
private final Logger log = LoggerFactory.getLogger(JobHistoryServiceImpl.class);
private final JobHistoryRepository jobHistoryRepository;
private final JobHistoryMapper jobHistoryMapper;
public JobHistoryServiceImpl(JobHistoryRepository jobHistoryRepository, JobHistoryMapper jobHistoryMapper) {
this.jobHistoryRepository = jobHistoryRepository;
this.jobHistoryMapper = jobHistoryMapper;
}
/**
* Save a jobHistory.
*
* @param jobHistoryDTO the entity to save
* @return the persisted entity
*/
@Override
public JobHistoryDTO save(JobHistoryDTO jobHistoryDTO) {
log.debug("Request to save JobHistory : {}", jobHistoryDTO);
JobHistory jobHistory = jobHistoryMapper.toEntity(jobHistoryDTO);
jobHistory = jobHistoryRepository.save(jobHistory);
return jobHistoryMapper.toDto(jobHistory);
}
/**
* Get all the jobHistories.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Override
@Transactional(readOnly = true)
public Page<JobHistoryDTO> findAll(Pageable pageable) {
log.debug("Request to get all JobHistories");
return jobHistoryRepository.findAll(pageable)
.map(jobHistoryMapper::toDto);
}
/**
* Get one jobHistory by id.
*
* @param id the id of the entity
* @return the entity
*/
@Override
@Transactional(readOnly = true)
public JobHistoryDTO findOne(Long id) {
log.debug("Request to get JobHistory : {}", id);
JobHistory jobHistory = jobHistoryRepository.findOne(id);
return jobHistoryMapper.toDto(jobHistory);
}
/**
* Delete the jobHistory by id.
*
* @param id the id of the entity
*/
@Override
public void delete(Long id) {
log.debug("Request to delete JobHistory : {}", id);
jobHistoryRepository.delete(id);
}
}
| [
"[email protected]"
] | |
3485b797a1abe07397c0d97c36964099614faff5 | f773573e1493e514ae9708302a3c672ea1d3afd4 | /app/src/androidTest/java/com/example/lg/a216230115/ExampleInstrumentedTest.java | 7e2d717abaeeac92a625bd78092afea9c842ede2 | [] | no_license | mjkim1345/216230115_2nd | 79a1c4a4198a181628ed45737166cba818d19d23 | 506cee28349a3b15054b0b42b889c0df9e004f52 | refs/heads/master | 2021-08-23T16:45:38.326776 | 2017-12-05T18:54:08 | 2017-12-05T18:54:08 | 113,220,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 754 | java | package com.example.lg.a216230115;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.lg.a216230115", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
f3f47ae3c03d06ab767b449b1d5b45d3d6739440 | 37bdf47bab979d25ef29e5c4562c298cfeb942f3 | /HomeWork_day4/src/Date.java | bd2f700ca8530b8afc874c6da30a80e8073b4895 | [] | no_license | NovaXam/Cognizant | a4642037877f33146a4eefcd480f97e146f21d90 | d3f034e6350c320e7cd404c1e7a6b083ba57a3a2 | refs/heads/master | 2021-09-09T11:11:44.955835 | 2018-03-15T13:13:49 | 2018-03-15T13:13:49 | 124,000,490 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 171 | java | /**
* Created by student on 3/8/18.
*/
public class Date {
public Date() {
};
public String toString() {
return this.getClass().getName();
};
}
| [
"[email protected]"
] | |
bb3ceb2d947742f45607ad1ba6be181740d6b750 | 2e7f733be84815bb04ec181316820195650beb6f | /java-solutions/module-info.java | b4aaa10881512299f993586056645e5cb191b584 | [] | no_license | doctor-kaliy/java-advanced | fb405b351182db9faffb75155f45bf498f105a48 | 791d443f490ed131907b5f41f05035cbb8af10ab | refs/heads/main | 2023-07-07T22:41:26.206230 | 2021-09-06T12:26:40 | 2021-09-06T12:26:40 | 399,823,070 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 540 | java | module java.solutions {
requires transitive info.kgeorgiy.java.advanced.base;
requires info.kgeorgiy.java.advanced.implementor;
requires info.kgeorgiy.java.advanced.concurrent;
requires java.compiler;
requires info.kgeorgiy.java.advanced.crawler;
requires info.kgeorgiy.java.advanced.hello;
requires java.rmi;
exports info.kgeorgiy.ja.kosogorov.implementor;
exports info.kgeorgiy.ja.kosogorov.concurrent;
exports info.kgeorgiy.ja.kosogorov.bank;
opens info.kgeorgiy.ja.kosogorov.bank to junit;
}
| [
"[email protected]"
] | |
4030831dfdd9a4787005c02afd9cf04515ecfa7a | a2f95d3709f26265ca1eeee7f8c44f192d26a328 | /src/LeetCode/Company/FaceBook/NextPermutation.java | 41539db7dad9fe4956f791a08879f3bb868542a3 | [] | no_license | ruoyanhuang/algorithm | 7bc27b5b94f19a6596d6a61a17940a335443fe29 | 0b8c65148db161a8906ce546ab896458b3d70557 | refs/heads/master | 2020-04-05T16:55:57.913046 | 2019-03-03T22:25:30 | 2019-03-03T22:25:30 | 157,035,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,352 | java | package LeetCode.Company.FaceBook;
public class NextPermutation {
public void nextPermutation(int[] nums) {
if (nums == null || nums.length == 0) {
return;
}
for (int i = nums.length - 2; i >= 0; i--) {
if (nums[i] < nums[i + 1]) {
int tmp = findSmallestLarger(nums, nums[i], i + 1);
swap(nums, i, tmp);
reverse(nums, i + 1, nums.length - 1);
return;
}
}
reverse(nums, 0, nums.length - 1);
return;
}
public int findSmallestLarger(int[] nums, int target, int left) {
int right = nums.length - 1;
while (left + 1 < right) {
int mid = left + (right - left) / 2;
if (target >= nums[mid]) {
right = mid - 1;
} else {
left = mid;
}
}
return target < nums[right] ? right : left;
}
public void swap(int[] nums, int left, int right) {
int tmp = nums[left];
nums[left] = nums[right];
nums[right] = tmp;
}
public void reverse(int[] nums, int left, int right) {
if (left >= right) {
return;
}
while (left < right) {
swap(nums, left, right);
left++;
right--;
}
}
}
| [
"[email protected]"
] | |
74796812cb6bf46b3cf51d6f4c0052607b5790e7 | 5239779c4efc5e6179bbf4e9b906f4900957397e | /spark-project/src/main/java/com/ibeifeng/sparkproject/spark/product/AreaTop3ProductSpark.java | 6ae552ffc6a8435fc8b70059839e3b62933f6e06 | [] | no_license | tongweiliu/idea-hadoop-5 | 97ef436f7962ae819cbeba3c822fe65cb8f6bf82 | d27f2d66da8e9c0feaff6c37d927d03e2efee9bc | refs/heads/master | 2020-04-02T12:05:40.928362 | 2018-10-24T01:23:29 | 2018-10-24T01:23:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,913 | java | package com.ibeifeng.sparkproject.spark.product;
import com.alibaba.fastjson.JSONObject;
import com.ibeifeng.sparkproject.conf.ConfigurationManager;
import com.ibeifeng.sparkproject.constant.Constants;
import com.ibeifeng.sparkproject.dao.IAreaTop3ProductDAO;
import com.ibeifeng.sparkproject.dao.ITaskDAO;
import com.ibeifeng.sparkproject.dao.factory.DAOFactory;
import com.ibeifeng.sparkproject.domain.AreaTop3Product;
import com.ibeifeng.sparkproject.domain.Task;
import com.ibeifeng.sparkproject.util.ParamUtils;
import com.ibeifeng.sparkproject.util.SparkUtils;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.api.java.function.PairFunction;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.RowFactory;
import org.apache.spark.sql.SQLContext;
import org.apache.spark.sql.types.DataTypes;
import org.apache.spark.sql.types.StructType;
import scala.Tuple2;
import java.util.*;
/**
* 各区域top3热门商品统计Spark作业
* @author Administrator
*
*/
public class AreaTop3ProductSpark {
public static void main(String[] args) {
//创建SparkConf
SparkConf conf = new SparkConf()
.setAppName("AreaTop3ProductSpark");
SparkUtils.setMaster(conf);
//构建Spark上下文
JavaSparkContext sc = new JavaSparkContext(conf);
SQLContext sqlContext=SparkUtils.getSQLContext(sc.sc());
//注册自定义函数
sqlContext.udf().register("concat_long_string",
new ConcatLongStringUDF(), DataTypes.StringType);
sqlContext.udf().register("get_json_object",
new GetJsonObjectUDF(), DataTypes.StringType);
sqlContext.udf().register("random_prefix",
new ConcatLongStringUDF(), DataTypes.StringType);
sqlContext.udf().register("remove_random_prefix",
new RemoveRandomPrefixUDF(), DataTypes.StringType);
sqlContext.udf().register("group_concat_distinct",
new GroupConcatDistinctUDAF());
// 准备模拟数据
SparkUtils.mockData(sc, sqlContext);
// 获取命令行传入的taskid,查询对应的任务参数
ITaskDAO taskDAO = DAOFactory.getTaskDAO();
long taskid = ParamUtils.getTaskIdFromArgs(args,
Constants.SPARK_LOCAL_TASKID_PRODUCT);
Task task = taskDAO.findById(taskid);
JSONObject taskParam = JSONObject.parseObject(task.getTaskParam());
String startDate = ParamUtils.getParam(taskParam, Constants.PARAM_START_DATE);
String endDate = ParamUtils.getParam(taskParam, Constants.PARAM_END_DATE);
/*
* 查询用户指定日期范围内控点击行为数据(city_id,在哪个城市发生的点击行为)
* 技术点1:Hive数据源的使用
* */
JavaPairRDD<Long, Row> cityid2clickActionRDD = getcityid2ClickActionRDDByDate(
sqlContext, startDate, endDate);
/*
* 从MySQL中查询城市信息
* 技术点2:异构数据源之MySQL的使用
* */
JavaPairRDD<Long, Row> cityid2cityInfoRDD = getcityid2CityInfoRDD(sqlContext);
// 生成点击商品基础信息临时表
// 技术点3:将RDD转换为DataFrame,并注册临时表
generateTempClickProductBasicTable(sqlContext,
cityid2clickActionRDD, cityid2cityInfoRDD);
// 生成各区域各商品点击次数的临时表
generateTempAreaPrdocutClickCountTable(sqlContext);
// 生成包含完整商品信息的各区域各商品点击次数的临时表
generateTempAreaFullProductClickCountTable(sqlContext);
// 使用开窗函数获取各个区域内点击次数排名前3的热门商品
JavaRDD<Row> areaTop3ProductRDD = getAreaTop3ProductRDD(sqlContext);
// 这边的写入mysql和之前不太一样
// 因为实际上,就这个业务需求而言,计算出来的最终数据量是比较小的
// 总共就不到10个区域,每个区域还是top3热门商品,总共最后数据量也就是几十个
// 所以可以直接将数据collect()到本地
// 用批量插入的方式,一次性插入mysql即可
List<Row> rows = areaTop3ProductRDD.collect();
System.out.println("rows: " + rows.size());
persistAreaTop3Product(taskid, rows);
sc.close();
}
/**
* 将计算出来的各区域top3热门商品写入MySQL中
* @param taskid
* @param rows
*/
private static void persistAreaTop3Product(long taskid, List<Row> rows) {
List<AreaTop3Product> areaTop3Products=new ArrayList<>();
for(Row row : rows) {
AreaTop3Product areaTop3Product = new AreaTop3Product();
areaTop3Product.setTaskid(taskid);
areaTop3Product.setArea(row.getString(0));
areaTop3Product.setAreaLevel(row.getString(1));
areaTop3Product.setProductid(row.getLong(2));
areaTop3Product.setClickCount(Long.valueOf(String.valueOf(row.get(3))));
areaTop3Product.setCityInfos(row.getString(4));
areaTop3Product.setProductName(row.getString(5));
areaTop3Product.setProductStatus(row.getString(6));
areaTop3Products.add(areaTop3Product);
}
IAreaTop3ProductDAO areTop3ProductDAO = DAOFactory.getAreaTop3ProductDAO();
areTop3ProductDAO.insertBatch(areaTop3Products);
}
private static JavaRDD<Row> getAreaTop3ProductRDD(SQLContext sqlContext) {
/*
* 技术点:开窗函数
*
* 使用开窗函数,先进行一个子查询
* 按照area进行分组,给每个分组内的数据,按照点击次数降序排序,打上一个组内的行号
* 接着在外层查询中,过滤出各个组内的行号排名前3的数据
* 其实就是咱们的各个区域下的top3热门商品
*
* 华北,华东,华南,华中,西北,西南,东北
* A级:华北,华东
* B级:华南,华中
* C级:西北,西南
* D级:东北
*
* case when
* 根据多个条件,不同的条件对应不同的值
* case when then ... when then ... else ... end
* */
String sql =
"SELECT "
+ "area,"
+ "CASE "
+ "WHEN area='China North' OR area='China East' THEN 'A Level' "
+ "WHEN area='China South' OR area='China Middle' THEN 'B Level' "
+ "WHEN area='West North' OR area='West South' THEN 'C Level' "
+ "ELSE 'D Level' "
+ "END area_level,"
+ "product_id,"
+ "click_count,"
+ "city_infos,"
+ "product_name,"
+ "product_status "
+ "FROM ("
+ "SELECT "
+ "area,"
+ "product_id,"
+ "click_count,"
+ "city_infos,"
+ "product_name,"
+ "product_status,"
+ "row_number() OVER (PARTITION BY area ORDER BY click_count DESC) rank "
+ "FROM tmp_area_fullprod_click_count "
+ ") t "
+ "WHERE rank<=3";
DataFrame df = sqlContext.sql(sql);
return df.javaRDD();
}
/**
* 生成区域商品点击次数临时表(包含了商品的完整信息)
* @param sqlContext
*/
private static void generateTempAreaFullProductClickCountTable(SQLContext sqlContext) {
/*
* 将之前得到的各区域各商品点击次数表,product_id
* 去关联商品信息表,product_id,product_name和product_status
* product_status要特殊处理,0,1分别代表了自营和第三方的商品,
* 放在了一个json串里面
* get_json_object()函数,可以从json串中获取指定的字段的值
* if()函数,判断,如果product_status是0,那么就是自营商品,如果是1,
* 那么不是第三方商品
* area,product_id,click_count,city_infos,product_name,product_status
*
* 为什么要费时费力,计算出来商品经营类型
* 你拿一了某个区域top3热门的商品,那么其实这个商品是自营的,还是每三方的
* 其实是很重要的一件事
*
* 技术点:内置if函数的使用
* */
String sql =
"SELECT "
+ "tapcc.area,"
+ "tapcc.product_id,"
+ "tapcc.click_count,"
+ "tapcc.city_infos,"
+ "pi.product_name,"
+ "if(get_json_object(pi.extend_info,'product_status')='0','Self','Third Party') product_status "
+ "FROM tmp_area_product_click_count tapcc "
+ "JOIN product_info pi ON tapcc.product_id=pi.product_id ";
DataFrame df = sqlContext.sql(sql);
df.registerTempTable("tmp_area_fullprod_click_count");
}
/**
* 生成各区域商品点击次数临时表
* @param sqlContext
*/
private static void generateTempAreaPrdocutClickCountTable(SQLContext sqlContext) {
/*
* 按照area和product_id两个字段进行分组
* 计算出各区域各商品的点击次数
* 可以获取每个area下的每个product_id的城市信息拼接起来的串
* */
String sql="select area,product_id,count(*) click_count," +
"group_concat_distinct(concat_long_string(city_id,city_name,':')) city_infos " +
"from tmp_click_product_basic group by area,product_id";
//使用Spark SQL执行这条SQL语句
DataFrame df = sqlContext.sql(sql);
/*
* 再次将查询出来的数据注册为一个临时表
* 各区域各商品的点击次数(以及额外的城市列表)
* */
df.registerTempTable("tmp_area_product_click_count");
}
/**
* 生成点击商品基础信息临时表
* @param sqlContext
* @param cityid2clickActionRDD
* @param cityid2cityInfoRDD
*/
private static void generateTempClickProductBasicTable(SQLContext sqlContext, JavaPairRDD<Long, Row> cityid2clickActionRDD, JavaPairRDD<Long, Row> cityid2cityInfoRDD) {
// 执行join操作,进行点击行为数据和城市数据的关联
JavaPairRDD<Long, Tuple2<Row, Row>> joinedRDD =
cityid2clickActionRDD.join(cityid2cityInfoRDD);
//将上面的JavaPairRDD,转换成一个JavaRDD<Row>(才能将RDD转换为DataFrame)
JavaRDD<Row> mapedRDD = joinedRDD.map(new Function<Tuple2<Long, Tuple2<Row, Row>>, Row>() {
private static final long serialVersionUID = -5344855997234131889L;
@Override
public Row call(Tuple2<Long, Tuple2<Row, Row>> tuple) throws Exception {
long cittid = tuple._1;
Row clickAction = tuple._2._1;
Row cityInfo = tuple._2._2;
long productid = clickAction.getLong(1);
String cityName = cityInfo.getString(1);
String area = cityInfo.getString(2);
return RowFactory.create(cittid, cityName, area, productid);
}
});
StructType schema=DataTypes.createStructType(Arrays.asList(
DataTypes.createStructField("city_id",DataTypes.LongType,true),
DataTypes.createStructField("city_name",DataTypes.StringType,true),
DataTypes.createStructField("area",DataTypes.StringType,true),
DataTypes.createStructField("product_id",DataTypes.LongType,true)
));
/*
* 1 北京
* 2 上海
* 1 北京
* group by area,product_id
* 1:北京,2:上海
*
* 两个函数UDF:concat2(),将两个字段拼接起来,用指定的分隔符
* UDAF:group_concat_distinct(),将一个分组中的多个字段值,用逗号拼接起来,
* 同时进行去重
* */
DataFrame df = sqlContext.createDataFrame(mapedRDD, schema);
//将DataFrame中的数据,注册成临时表(tmp_click_product_basic)
df.registerTempTable("tmp_click_product_basic");
}
/**
* 使用Spark SQL从MySQL中查询城市信息
* @param sqlContext
* @return
*/
private static JavaPairRDD<Long, Row> getcityid2CityInfoRDD(SQLContext sqlContext) {
//构建MySQL连接配置信息(直接从配置文件中获取)
String url;
String user;
String password;
boolean local = ConfigurationManager.getBoolean(Constants.SPARK_LOCAL);
if(local){
url = ConfigurationManager.getProperty(Constants.JDBC_URL);
user = ConfigurationManager.getProperty(Constants.JDBC_USER);
password = ConfigurationManager.getProperty(Constants.JDBC_PASSWORD);
}else {
url = ConfigurationManager.getProperty(Constants.JDBC_URL_PROD);
user = ConfigurationManager.getProperty(Constants.JDBC_USER_PROD);
password = ConfigurationManager.getProperty(Constants.JDBC_PASSWORD_PROD);
}
Map<String, String> options = new HashMap<>();
options.put("url", url);
options.put("dbtable", "city_info");
options.put("user", user);
options.put("password", password);
// 通过SQLContext去从MySQL中查询数据
DataFrame cityInfoDF = sqlContext.read().format("jdbc")
.options(options).load();
JavaRDD<Row> cityInfoRDD = cityInfoDF.javaRDD();
return cityInfoRDD.mapToPair(new PairFunction<Row, Long, Row>() {
private static final long serialVersionUID = 6066704517384710758L;
@Override
public Tuple2<Long, Row> call(Row row) throws Exception {
long cityid=Long.parseLong(String.valueOf(row.get(0)));
return new Tuple2<>(cityid,row);
}
});
}
/**
* 查询指定日期范围内的点击行为数据
* @param sqlContext
* @param startDate
* @param endDate
* @return
*/
private static JavaPairRDD<Long, Row> getcityid2ClickActionRDDByDate(SQLContext sqlContext, String startDate, String endDate) {
/*
* 从user_visit_action中,查询用户访问行为数据
* 第一个限定:click_product_id,限定为不为空的访问行为,那么就代表着点击行为
* 第二个限定:在用户指定的日期范围内的数据
* */
String sql="select city_id,click_product_id product_id " +
"from user_visit_action " +
"where click_product_id is not null " +
"and date>='"+startDate+"' " +
"and date <='"+endDate+",";
DataFrame clickActionDF = sqlContext.sql(sql);
JavaRDD<Row> clickActionRDD = clickActionDF.javaRDD();
return clickActionRDD.mapToPair(new PairFunction<Row, Long, Row>() {
private static final long serialVersionUID = 6066704517384710758L;
@Override
public Tuple2<Long, Row> call(Row row) throws Exception {
Long cityid = row.getLong(0);
return new Tuple2<>(cityid, row);
}
});
}
}
| [
"[email protected]"
] | |
ff444c8b6b257a4a3b4e0cbf4093a806cdc9bb43 | 0f5c44fb88644abe232c35ae219ed50ff233af8d | /src/main/java/open/commons/tool/dvm/widget/UpdateLogDigalog.java | 6088aec9f90bbc5eb63eea0be383c82410223681 | [
"MIT"
] | permissive | parkjunhong/doc-version-manager | a792d01df73cb7719f3be30e2e7dd574c4afd59d | e763248449143f8f778821f81d112c4d3b263844 | refs/heads/master | 2023-01-24T15:25:49.658237 | 2021-07-29T07:55:26 | 2021-07-29T07:55:26 | 227,792,906 | 0 | 0 | MIT | 2021-12-10T01:01:11 | 2019-12-13T08:32:48 | Java | UTF-8 | Java | false | false | 3,798 | java | /*
*
* This file is generated under this project, "DocVersionManager".
*
* Date : 2014. 11. 26. 오후 5:03:42
*
* Author: Park_Jun_Hong_(fafanmama_at_naver_com)
*
*/
package open.commons.tool.dvm.widget;
import java.util.List;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Point;
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.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wb.swt.SWTResourceManager;
public class UpdateLogDigalog extends TitleAreaDialog {
private ScrolledComposite scrolledComposite;
private Text text;
private final int MAX_LENGTH = 0xFFFFF;
/**
* Create the dialog.
*
* @param parentShell
*/
public UpdateLogDigalog(Shell parentShell) {
super(parentShell);
setShellStyle(SWT.BORDER | SWT.RESIZE | SWT.TITLE);
setBlockOnOpen(false);
}
public void ready() {
create();
constrainShellSize();
getShell().setVisible(false);
}
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
setMessage("문서 업데이트 로그창");
setTitle("문서 업데이트 로그창");
setTitleImage(SWTResourceManager.getImage(UpdateLogDigalog.class, "/images/ic_action_go_to_today.png"));
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayout(new GridLayout(1, false));
container.setLayoutData(new GridData(GridData.FILL_BOTH));
this.scrolledComposite = new ScrolledComposite(container, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
this.scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
this.scrolledComposite.setExpandHorizontal(true);
this.scrolledComposite.setExpandVertical(true);
this.text = new Text(this.scrolledComposite, SWT.BORDER | SWT.WRAP | SWT.MULTI);
this.text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
scrolledComposite.setMinSize(text.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});
this.scrolledComposite.setContent(this.text);
this.scrolledComposite.setMinSize(this.text.computeSize(SWT.DEFAULT, SWT.DEFAULT));
return area;
}
int curLogLen = 0;
public void addLog(List<String> logs) {
StringBuffer sb = new StringBuffer();
for (String log : logs) {
sb.append(log);
sb.append("\n");
}
int ll = sb.length();
int rl = (curLogLen + ll) - MAX_LENGTH;
if (rl > 0) {
text.setSelection(curLogLen - ll, curLogLen);
text.clearSelection();
}
text.append(sb.toString());
}
@Override
protected void okPressed() {
getShell().setVisible(false);
}
/**
* Create contents of the button bar.
*
* @param parent
*/
@Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.OK_ID, "Close", true);
}
/**
* Return the initial size of the dialog.
*/
@Override
protected Point getInitialSize() {
return new Point(868, 404);
}
}
| [
"[email protected]"
] | |
92578fbdd6763ee06439bd6a16bdef06d0b61779 | dd1598513c6ee9aa3abff4118f8c9a2347f50a73 | /Bendo/src/ca/bendo/controller/course/CourseProfessorController.java | 4c48e3c5899f3c11402c6367cb057e497f1ab8fd | [] | no_license | timotheeguerin/uniiv-java | 2426b3b77fdfb6045c5080e74008bc2e71d1f4ec | dc94b1d72368af2b782a3cdc8d4a6710769f42d4 | refs/heads/master | 2021-03-27T14:32:54.115371 | 2013-07-19T13:53:56 | 2013-07-19T13:53:56 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 5,516 | java | /**
*
*/
package ca.bendo.controller.course;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import ca.bendo.alert.UserWarning;
import ca.bendo.db.entity.lang.Language;
import ca.bendo.form.handler.course.CourseProfessorHandler;
import ca.bendo.session.UserSession;
import ca.bendo.translation.RequestTranslator;
import ca.bendo.translation.translation.Translator;
/**
* @author Timothée Guérin
* @version Bendo
*
* <b>CourseProfessorController</b>
* <p>
* </p>
*
*
*/
@Controller
public class CourseProfessorController
{
/**
*
*/
@Autowired
private CourseProfessorHandler courseProfessorHandler;
/**
* Get the request after filling inputs and submit of login.
*
* @param request
* Request
* @param response
* Response
* @param universityId
* University id
*
* @param courseId
* Course id
* @return Jsp page
*/
@RequestMapping(value = "/university/{uniId}/course/{courseId}/professors", method = RequestMethod.GET)
public String courseTeachedByProfessor(@PathVariable("uniId") final long universityId,
@PathVariable("courseId") final long courseId, final HttpServletRequest request,
final HttpServletResponse response)
{
// Translator translator = (Translator)
// request.getAttribute("translator");
/**
*
*/
if (courseProfessorHandler.setupCourseProfessorPage(universityId, courseId, request))
{
return "views/university/course/CourseProfessorList";
} else
{
return "redirect:/university/univeristyerror";
}
}
/**
* Get the request after filling inputs and submit of login.
*
* @param professorId
* Professor id
* @param request
* Request
* @param response
* Response
* @return Jsp page
*/
@RequestMapping(value = "/professor/{profId}/courses/", method = RequestMethod.GET)
public String professorUniversity(@PathVariable("profId") final int professorId, final HttpServletRequest request,
final HttpServletResponse response)
{
// Translator translator = (Translator)
// request.getAttribute("translator");
/**
*
*/
if (courseProfessorHandler.setupProfessorCoursePage(professorId, request))
{
return "views/university/course/ProfessorCourseList";
} else
{
return "redirect:/university/univeristyerror";
}
}
/**
* Get the request after filling inputs and submit of login.
*
* @param request
* Request
* @param response
* Response
* @param universityId
* University id
*
* @param courseId
* Course id
* @return Jsp page
*/
@RequestMapping(value = "/university/{uniId}/course/{courseId}/professor/new", method = RequestMethod.GET)
public String professorReview(@PathVariable("uniId") final long universityId,
@PathVariable("courseId") final long courseId, final HttpServletRequest request,
final HttpServletResponse response)
{
return newCourseProfessorPage(universityId, courseId, request, response);
}
/**
* Get the request after filling inputs and submit of login.
*
* @param request
* Request
* @param response
* Response
* @param universityId
* University id
*
* @param courseId
* Course id
* @return Jsp page
*/
@RequestMapping(value = "/university/{uniId}/course/{courseId}/professor/new", method = RequestMethod.POST)
public String handleNewProfessorReview(@PathVariable("uniId") final long universityId,
@PathVariable("courseId") final long courseId, final HttpServletRequest request,
final HttpServletResponse response)
{
Translator translator = (Translator) request.getAttribute("translator");
Long languageId = Language.loadId(request);
if (UserSession.getSession(request).hasPermission("user"))
{
if (courseProfessorHandler.handle(universityId, courseId, request))
{
String url = "/university/" + universityId + "/course/" + courseId;
String param = "?alertmsg=alert_info_course_professor_added";
return "redirect:" + translator.translateUrl(url + param, languageId);
} else
{
request.setAttribute("new_review_form_error", true);
}
}
return newCourseProfessorPage(universityId, courseId, request, response);
}
/**
* Get the request after filling inputs and submit of login.
*
* @param universityId
* University id
* @param courseId
* Course id
* @param request
* Request
* @param response
* Response
* @return Jsp page
*/
public String newCourseProfessorPage(final long universityId, final long courseId,
final HttpServletRequest request, final HttpServletResponse response)
{
UserWarning.needValidUser(request);
RequestTranslator translator = RequestTranslator.load(request);
if (!courseProfessorHandler.setupNewCourseProfessorPage(universityId, courseId, request))
{
return "redirect:" + translator.getTranslator().getLink("new_course", translator.getLanguage().getId())
+ "?err_no_course_with_id=" + courseId;
} else
{
return "views/university/course/newCourseProfessor";
}
}
}
| [
"[email protected]"
] | |
a4732979a7ad34cb9cd07377809bab758af047fd | 8f87065bc3cb6d96ea2e398a98aacda4fc4bbe43 | /src/Class00000400Better.java | b51ae81010ab2efd705fc000445cf06eb6b22a0e | [] | no_license | fracz/code-quality-benchmark | a243d345441582473532f9b013993f77d59e19ae | c23e76fe315f43bea899beabb856e61348c34e09 | refs/heads/master | 2020-04-08T23:40:36.408828 | 2019-07-31T17:54:53 | 2019-07-31T17:54:53 | 159,835,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | // original filename: 00028270.txt
// after
public class Class00000400Better {
@Override
public WebSocketConnectOptions setPort(int port) {
Arguments.requireInRange(port, 1, 65535, "port p must be in range 1 <= p <= 65535");
this.port = port;
return this;
}
}
| [
"[email protected]"
] | |
3cdc00b91f44b09ba347b87a0bb8786b03270396 | c4930499ef0ac6bf7af134df12bd94b85f9a7478 | /build/generated/source/r/release/com/wcsmobile/R.java | 405887bf2ef83656e8299e1108f52e65a63b9dea | [] | no_license | 185368123/shuorigf_green_ver | 4a63342dc72ae740d89aacb76f8e1fe99893536d | 4bba2b85d706a1e3292302828dccb5a67a12e348 | refs/heads/master | 2020-03-22T19:27:27.959109 | 2018-08-21T10:15:03 | 2018-08-21T10:15:03 | 140,529,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 109,778 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.wcsmobile;
public final class R {
public static final class attr {
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int addition=0x7f010000;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int additionBottom=0x7f010001;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int additionLeft=0x7f010002;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int additionRight=0x7f010003;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int additionTop=0x7f010004;
/** <p>Must be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int kswAnimationDuration=0x7f010024;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int kswBackColor=0x7f010021;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int kswBackDrawable=0x7f010020;
/** <p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int kswBackMeasureRatio=0x7f010023;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswBackRadius=0x7f01001f;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int kswFadeBack=0x7f010022;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int kswTextMarginH=0x7f010028;
/** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int kswTextOff=0x7f010027;
/** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int kswTextOn=0x7f010026;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int kswThumbColor=0x7f010016;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int kswThumbDrawable=0x7f010015;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbHeight=0x7f01001d;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbMargin=0x7f010017;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbMarginBottom=0x7f010019;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbMarginLeft=0x7f01001a;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbMarginRight=0x7f01001b;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbMarginTop=0x7f010018;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbRadius=0x7f01001e;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
*/
public static final int kswThumbWidth=0x7f01001c;
/** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
*/
public static final int kswTintColor=0x7f010025;
/** <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int lineColor=0x7f010029;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int peng_drawableBottom=0x7f01000e;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableBottomHeight=0x7f010008;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableBottomWith=0x7f010007;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int peng_drawableLeft=0x7f010010;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableLeftHeight=0x7f01000c;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableLeftWith=0x7f01000b;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int peng_drawableRight=0x7f01000f;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableRightHeight=0x7f01000a;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableRightWith=0x7f010009;
/** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
*/
public static final int peng_drawableTop=0x7f01000d;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableTopHeight=0x7f010006;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int peng_drawableTopWith=0x7f010005;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int sc_border_width=0x7f010012;
/** <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int sc_checked_text_color=0x7f010014;
/** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int sc_corner_radius=0x7f010011;
/** <p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int sc_tint_color=0x7f010013;
}
public static final class color {
public static final int alpha=0x7f070000;
public static final int app_background=0x7f070001;
public static final int app_background1=0x7f070002;
public static final int app_background_no=0x7f070003;
public static final int battery_charging_state_text_color=0x7f070004;
public static final int battery_esidual_capacity_text_color=0x7f070005;
public static final int battery_temperature_text_color=0x7f070006;
public static final int black=0x7f070007;
public static final int blue=0x7f070008;
public static final int blue_dark=0x7f070009;
public static final int blue_medium=0x7f07000a;
public static final int bottombar_textcolor_selector=0x7f070030;
public static final int cancel_text_color=0x7f07000b;
public static final int dark=0x7f07000c;
public static final int fragment_background=0x7f07000d;
public static final int gray=0x7f07000e;
public static final int gray_dim=0x7f07000f;
public static final int gray_light=0x7f070010;
public static final int half_alpha=0x7f070011;
public static final int half_half_alpha=0x7f070012;
public static final int ksw_md_back_color=0x7f070031;
public static final int ksw_md_ripple_checked=0x7f070013;
public static final int ksw_md_ripple_normal=0x7f070014;
public static final int ksw_md_solid_checked=0x7f070015;
public static final int ksw_md_solid_checked_disable=0x7f070016;
public static final int ksw_md_solid_disable=0x7f070017;
public static final int ksw_md_solid_normal=0x7f070018;
public static final int ksw_md_solid_shadow=0x7f070019;
public static final int lightBlueColor=0x7f07001a;
public static final int light_gray=0x7f07001b;
public static final int light_gray_color=0x7f07001c;
public static final int light_gray_line=0x7f07001d;
public static final int light_gray_line_ba=0x7f07001e;
public static final int light_yellow=0x7f07001f;
public static final int light_yellow1=0x7f070020;
public static final int orange=0x7f070021;
public static final int province_line_border=0x7f070022;
public static final int radio_button_selected_color=0x7f070023;
public static final int radio_button_unselected_color=0x7f070024;
public static final int radio_colors=0x7f070032;
public static final int realtime_battery_layout_text_title=0x7f070025;
public static final int realtime_down_frame_color=0x7f070026;
public static final int realtime_mid_frame_color=0x7f070027;
public static final int realtime_parameter_title=0x7f070028;
public static final int realtime_up_frame_color=0x7f070029;
public static final int red=0x7f07002a;
public static final int red_dark=0x7f07002b;
public static final int transparent=0x7f07002c;
public static final int transparent_background=0x7f07002d;
public static final int weibo_listtab_off=0x7f07002e;
public static final int white=0x7f07002f;
}
public static final class dimen {
public static final int activity_horizontal_margin=0x7f050001;
public static final int activity_vertical_margin=0x7f050002;
public static final int btnTextSize=0x7f050000;
public static final int ksw_md_thumb_ripple_size=0x7f050003;
public static final int ksw_md_thumb_shadow_inset=0x7f050004;
public static final int ksw_md_thumb_shadow_inset_bottom=0x7f050005;
public static final int ksw_md_thumb_shadow_inset_top=0x7f050006;
public static final int ksw_md_thumb_shadow_offset=0x7f050007;
public static final int ksw_md_thumb_shadow_size=0x7f050008;
public static final int ksw_md_thumb_solid_inset=0x7f050009;
public static final int ksw_md_thumb_solid_size=0x7f05000a;
public static final int radio_button_conner_radius=0x7f05000b;
public static final int radio_button_stroke_border=0x7f05000c;
}
public static final class drawable {
public static final int bg_fuzai=0x7f020000;
public static final int bg_navigation_bar=0x7f020001;
public static final int bg_style_corner_popwin=0x7f020002;
public static final int bg_swich_button_selector=0x7f020003;
public static final int bg_switch=0x7f020004;
public static final int bg_switch_off=0x7f020005;
public static final int bg_switch_on=0x7f020006;
public static final int bg_tabbar=0x7f020007;
public static final int bg_taiyangnengdianchiban=0x7f020008;
public static final int bg_xudianchi=0x7f020009;
public static final int bottombar_itembg_selector=0x7f02000a;
public static final int btn_affirm_drawable=0x7f02000b;
public static final int btn_back_drawable=0x7f02000c;
public static final int btn_cancel_drawable=0x7f02000d;
public static final int btn_historical_into_chart=0x7f02000e;
public static final int btn_last_day_drawable=0x7f02000f;
public static final int btn_next_day_drawable=0x7f020010;
public static final int btn_switch=0x7f020011;
public static final int button_text_color=0x7f020012;
public static final int color_line=0x7f020013;
public static final int content_bg=0x7f020014;
public static final int device_info_selector=0x7f020015;
public static final int et_round_bg=0x7f020016;
public static final int f_btn_style_head=0x7f020017;
public static final int historical_data_selector=0x7f020018;
public static final int ic_launcher=0x7f020019;
public static final int ico_canshushezhi_nor=0x7f02001a;
public static final int ico_canshushezhi_sel=0x7f02001b;
public static final int ico_chongdianzhong=0x7f02001c;
public static final int ico_chongidancuowu=0x7f02001d;
public static final int ico_dianliang=0x7f02001e;
public static final int ico_dianliu=0x7f02001f;
public static final int ico_dianya=0x7f020020;
public static final int ico_fuzai=0x7f020021;
public static final int ico_gonglv=0x7f020022;
public static final int ico_lishishuju_nor=0x7f020023;
public static final int ico_lishishuju_sel=0x7f020024;
public static final int ico_more_nor=0x7f020025;
public static final int ico_more_sel=0x7f020026;
public static final int ico_more_selector=0x7f020027;
public static final int ico_shebeixinxi_nor=0x7f020028;
public static final int ico_shebeixinxi_sel=0x7f020029;
public static final int ico_shishijiankong_nor=0x7f02002a;
public static final int ico_shishijiankong_sel=0x7f02002b;
public static final int ico_taiyangnengban=0x7f02002c;
public static final int ico_weichongdian=0x7f02002d;
public static final int ico_wendu=0x7f02002e;
public static final int ico_xudianchi=0x7f02002f;
public static final int icon_accumulator_01=0x7f020030;
public static final int icon_accumulator_02=0x7f020031;
public static final int icon_accumulator_03=0x7f020032;
public static final int icon_accumulator_04=0x7f020033;
public static final int icon_accumulator_05=0x7f020034;
public static final int icon_accumulator_06=0x7f020035;
public static final int icon_add=0x7f020036;
public static final int icon_affirm=0x7f020037;
public static final int icon_affirm_elected=0x7f020038;
public static final int icon_back=0x7f020039;
public static final int icon_back_elected=0x7f02003a;
public static final int icon_backwards=0x7f02003b;
public static final int icon_backwards_elected=0x7f02003c;
public static final int icon_cancel=0x7f02003d;
public static final int icon_cancel_elected=0x7f02003e;
public static final int icon_data=0x7f02003f;
public static final int icon_data_elected=0x7f020040;
public static final int icon_energy_01=0x7f020041;
public static final int icon_energy_02=0x7f020042;
public static final int icon_energy_03=0x7f020043;
public static final int icon_energy_04=0x7f020044;
public static final int icon_forward=0x7f020045;
public static final int icon_forward_elected=0x7f020046;
public static final int icon_information=0x7f020047;
public static final int icon_information_elected=0x7f020048;
public static final int icon_link=0x7f020049;
public static final int icon_link_elected=0x7f02004a;
public static final int icon_load_01=0x7f02004b;
public static final int icon_load_02=0x7f02004c;
public static final int icon_load_03=0x7f02004d;
public static final int icon_load_04=0x7f02004e;
public static final int icon_load_05=0x7f02004f;
public static final int icon_monitoring=0x7f020050;
public static final int icon_monitoring_elected=0x7f020051;
public static final int icon_off=0x7f020052;
public static final int icon_on=0x7f020053;
public static final int icon_option=0x7f020054;
public static final int icon_option_01=0x7f020055;
public static final int icon_option_01elected=0x7f020056;
public static final int icon_option_02=0x7f020057;
public static final int icon_option_02elected=0x7f020058;
public static final int icon_option_03=0x7f020059;
public static final int icon_search=0x7f02005a;
public static final int icon_settings=0x7f02005b;
public static final int icon_settings_elected=0x7f02005c;
public static final int icon_shade=0x7f02005d;
public static final int icon_spread=0x7f02005e;
public static final int icon_triangle=0x7f02005f;
public static final int ksw_md_thumb=0x7f020060;
public static final int layout_selector=0x7f020061;
public static final int linearlayout_background=0x7f020062;
public static final int marker=0x7f020063;
public static final int marker1=0x7f020064;
public static final int marker2=0x7f020065;
public static final int param_setting_selector=0x7f020066;
public static final int popupview_bg=0x7f020067;
public static final int pressed_backgorund_corner=0x7f020068;
public static final int radio_checked=0x7f020069;
public static final int radio_unchecked=0x7f02006a;
public static final int real_time_monitoring_selector=0x7f02006b;
public static final int segment_button=0x7f02006c;
public static final int segment_grey=0x7f02006d;
public static final int segment_grey_focus=0x7f02006e;
public static final int segment_grey_press=0x7f02006f;
public static final int segment_radio_grey_left=0x7f020070;
public static final int segment_radio_grey_left_focus=0x7f020071;
public static final int segment_radio_grey_left_press=0x7f020072;
public static final int segment_radio_grey_middle=0x7f020073;
public static final int segment_radio_grey_middle_focus=0x7f020074;
public static final int segment_radio_grey_middle_press=0x7f020075;
public static final int segment_radio_grey_right=0x7f020076;
public static final int segment_radio_grey_right_focus=0x7f020077;
public static final int segment_radio_grey_right_press=0x7f020078;
public static final int segment_radio_left=0x7f020079;
public static final int segment_radio_middle=0x7f02007a;
public static final int segment_radio_right=0x7f02007b;
public static final int segment_radio_white_left=0x7f02007c;
public static final int segment_radio_white_left_focus=0x7f02007d;
public static final int segment_radio_white_left_press=0x7f02007e;
public static final int segment_radio_white_middle=0x7f02007f;
public static final int segment_radio_white_middle_focus=0x7f020080;
public static final int segment_radio_white_middle_press=0x7f020081;
public static final int segment_radio_white_right=0x7f020082;
public static final int segment_radio_white_right_focus=0x7f020083;
public static final int segment_radio_white_right_press=0x7f020084;
public static final int segment_white=0x7f020085;
public static final int segment_white_focus=0x7f020086;
public static final int sel_shape_common_style=0x7f020087;
public static final int start_logo=0x7f020088;
public static final int switch_device_status_drawable=0x7f020089;
public static final int switch_thumb=0x7f02008a;
public static final int switch_thumb_button=0x7f02008b;
public static final int switch_track_off=0x7f02008c;
public static final int switch_track_off_button=0x7f02008d;
public static final int switch_track_off_p=0x7f02008e;
public static final int switch_track_on=0x7f02008f;
public static final int switch_track_on_button=0x7f020090;
public static final int switch_track_on_p=0x7f020091;
public static final int tab_func=0x7f020092;
public static final int tab_func2=0x7f020093;
public static final int test=0x7f020094;
public static final int weibo_detail_bottom_bg=0x7f020095;
public static final int weibo_detail_buttombar_itembg_on=0x7f020096;
public static final int wheel_bg=0x7f020097;
public static final int wheel_val=0x7f020098;
}
public static final class id {
public static final int btnAdd=0x7f09000a;
public static final int btnCancel=0x7f090016;
public static final int btnConfirm=0x7f090017;
public static final int btnExit=0x7f090000;
public static final int btnLastDay=0x7f090047;
public static final int btnNextDay=0x7f090049;
public static final int btn_dialog_input_cancle=0x7f090019;
public static final int btn_dialog_input_confirm=0x7f09001a;
public static final int btn_disconnected_device=0x7f090030;
public static final int btn_read=0x7f090070;
public static final int btn_recovery_device=0x7f09002e;
public static final int btn_scan_device=0x7f090031;
public static final int btn_set_date=0x7f090007;
public static final int btn_setting=0x7f090071;
public static final int chart1=0x7f090011;
public static final int chart2=0x7f09003f;
public static final int content=0x7f090009;
public static final int current_amp_hour_layout=0x7f090050;
public static final int current_max_power_layout=0x7f090056;
public static final int current_power_layout=0x7f09004a;
public static final int current_voltage_layout=0x7f09005c;
public static final int disconnect_device_btn_layout=0x7f09002f;
public static final int et_affirmpwd=0x7f09008a;
public static final int et_dialog_input=0x7f090018;
public static final int et_newpwd=0x7f090089;
public static final int et_oldpwd=0x7f090088;
public static final int imgbtn_current_amp_hour=0x7f090051;
public static final int imgbtn_current_max_power=0x7f090057;
public static final int imgbtn_current_power=0x7f09004b;
public static final int imgbtn_current_voltage=0x7f09005d;
public static final int item_add_device=0x7f0900cb;
public static final int item_check_update=0x7f0900cc;
public static final int layoutContent=0x7f090012;
public static final int layout_picker=0x7f090014;
public static final int linearLayout=0x7f090010;
public static final int lvDeviceInfo=0x7f090015;
public static final int lvInfo=0x7f09001b;
public static final int rb_devinfo=0x7f09000f;
public static final int rb_historical_data=0x7f09000d;
public static final int rb_monitoring=0x7f09000c;
public static final int rb_param_set=0x7f09000e;
public static final int rdbtn_all=0x7f090005;
public static final int rdbtn_battery_parameters=0x7f090072;
public static final int rdbtn_load_parameters=0x7f090073;
public static final int rdbtn_month=0x7f090003;
public static final int rdbtn_year=0x7f090004;
public static final int recovery_device_btn_layout=0x7f09002d;
public static final int rg_tab=0x7f09000b;
public static final int sb_load_switch_status=0x7f090080;
public static final int scrollView1=0x7f090046;
public static final int segment_Group=0x7f090002;
public static final int switch_device_status=0x7f090029;
public static final int tvAddDevice=0x7f0900c7;
public static final int tvCheckUpdate=0x7f0900ca;
public static final int tvContent=0x7f090013;
public static final int tvDateTime=0x7f090048;
public static final int tvGetAdmin=0x7f0900c8;
public static final int tvModifyPwd=0x7f0900c9;
public static final int tvTitle=0x7f090001;
public static final int tv_all_consumption_power_title=0x7f09006e;
public static final int tv_all_consumption_power_value=0x7f09006f;
public static final int tv_all_production_power_title=0x7f09006c;
public static final int tv_all_production_power_value=0x7f09006d;
public static final int tv_all_run_days_title=0x7f090062;
public static final int tv_all_run_days_value=0x7f090063;
public static final int tv_balanced_charge_voltage_set_title=0x7f090097;
public static final int tv_battery_all_discharge_times_title=0x7f090064;
public static final int tv_battery_all_discharge_times_value=0x7f090065;
public static final int tv_battery_charge_all_apm_hour_title=0x7f090068;
public static final int tv_battery_charge_all_apm_hour_value=0x7f090069;
public static final int tv_battery_charge_full_times_title=0x7f090066;
public static final int tv_battery_charge_full_times_value=0x7f090067;
public static final int tv_battery_charging_state_value=0x7f09007e;
public static final int tv_battery_discharge_all_apm_hour_title=0x7f09006a;
public static final int tv_battery_discharge_all_apm_hour_value=0x7f09006b;
public static final int tv_battery_electricity_value=0x7f09007b;
public static final int tv_battery_esidual_capacity_value=0x7f09007c;
public static final int tv_battery_state_value=0x7f090079;
public static final int tv_battery_temperature_value=0x7f09007d;
public static final int tv_battery_type_set_title=0x7f090090;
public static final int tv_battery_voltage_value=0x7f09007a;
public static final int tv_charge_imit_oltage_set_title=0x7f090095;
public static final int tv_day_battery_max_voltage_title=0x7f090060;
public static final int tv_day_battery_max_voltage_value=0x7f090061;
public static final int tv_day_battery_min_voltage_title=0x7f09005e;
public static final int tv_day_battery_min_voltage_value=0x7f09005f;
public static final int tv_day_charge_amp_hour_title=0x7f090052;
public static final int tv_day_charge_amp_hour_value=0x7f090053;
public static final int tv_day_charge_max_power_title=0x7f090058;
public static final int tv_day_charge_max_power_value=0x7f090059;
public static final int tv_day_consumption_power_title=0x7f09004e;
public static final int tv_day_consumption_power_value=0x7f09004f;
public static final int tv_day_discharge_amp_hour_title=0x7f090054;
public static final int tv_day_discharge_amp_hour_value=0x7f090055;
public static final int tv_day_discharge_max_power_title=0x7f09005a;
public static final int tv_day_discharge_max_power_value=0x7f09005b;
public static final int tv_day_production_power_title=0x7f09004c;
public static final int tv_day_production_power_value=0x7f09004d;
public static final int tv_device_connect_state_title=0x7f090026;
public static final int tv_device_connect_state_value=0x7f090027;
public static final int tv_device_id_title=0x7f09001e;
public static final int tv_device_id_value=0x7f09001f;
public static final int tv_device_name=0x7f090085;
public static final int tv_device_name_change=0x7f09002c;
public static final int tv_device_name_title=0x7f09002a;
public static final int tv_device_name_value=0x7f09002b;
public static final int tv_device_sn_code_title=0x7f090024;
public static final int tv_device_sn_code_value=0x7f090025;
public static final int tv_device_status_title=0x7f090028;
public static final int tv_device_type_title=0x7f090020;
public static final int tv_device_type_value=0x7f090021;
public static final int tv_device_version_title=0x7f090022;
public static final int tv_device_version_value=0x7f090023;
public static final int tv_discharge_limit_voltage_set_title=0x7f0900a5;
public static final int tv_down_historicalchart_ave_value_title=0x7f090042;
public static final int tv_down_historicalchart_ave_value_value=0x7f090043;
public static final int tv_down_historicalchart_current_value=0x7f09003d;
public static final int tv_down_historicalchart_layout=0x7f09003b;
public static final int tv_down_historicalchart_max_value=0x7f09003e;
public static final int tv_down_historicalchart_max_value_title=0x7f090044;
public static final int tv_down_historicalchart_max_value_value=0x7f090045;
public static final int tv_down_historicalchart_min_value_title=0x7f090040;
public static final int tv_down_historicalchart_min_value_value=0x7f090041;
public static final int tv_down_historicalchart_title=0x7f09003c;
public static final int tv_equalization_charging_time_set_title=0x7f0900a9;
public static final int tv_equilibrium_charge_interval_set_title=0x7f0900ad;
public static final int tv_first_working_power_set_title=0x7f0900b9;
public static final int tv_first_working_time_set_title=0x7f0900b7;
public static final int tv_float_charging_voltage_set_title=0x7f09009b;
public static final int tv_historicalchart_date=0x7f090008;
public static final int tv_historicalchart_title=0x7f090006;
public static final int tv_item_title=0x7f090086;
public static final int tv_lift_charge_return_voltage_set_title=0x7f09009d;
public static final int tv_lift_charge_voltage_set_title=0x7f090099;
public static final int tv_load=0x7f09007f;
public static final int tv_load_electricity_value=0x7f090083;
public static final int tv_load_operating_mode_set_title=0x7f0900b1;
public static final int tv_load_power_value=0x7f090084;
public static final int tv_load_state_value=0x7f090081;
public static final int tv_load_voltage_value=0x7f090082;
public static final int tv_morning_working_power_set_title=0x7f0900c5;
public static final int tv_morning_working_time_set_title=0x7f0900c3;
public static final int tv_nominal_capacity_of_battery_set_title=0x7f09008e;
public static final int tv_optical_control_delay_time_set_title=0x7f0900b3;
public static final int tv_optical_control_voltage_set_title=0x7f0900b5;
public static final int tv_over_discharge_delay_time_set_title=0x7f0900a7;
public static final int tv_over_discharge_return_voltage_set_title=0x7f09009f;
public static final int tv_over_discharge_voltage_set_title=0x7f0900a3;
public static final int tv_over_voltage_voltage_set_title=0x7f090093;
public static final int tv_parameter_balanced_charge_voltage_set_value=0x7f090098;
public static final int tv_parameter_battery_type_set_value=0x7f090091;
public static final int tv_parameter_charge_imit_oltage_set_value=0x7f090096;
public static final int tv_parameter_discharge_limit_voltage_set_value=0x7f0900a6;
public static final int tv_parameter_equalization_charging_time_set_value=0x7f0900aa;
public static final int tv_parameter_equilibrium_charge_interval_set_value=0x7f0900ae;
public static final int tv_parameter_first_working_power_set_value=0x7f0900ba;
public static final int tv_parameter_first_working_time_set_value=0x7f0900b8;
public static final int tv_parameter_float_charging_voltage_set_value=0x7f09009c;
public static final int tv_parameter_lift_charge_return_voltage_set_value=0x7f09009e;
public static final int tv_parameter_lift_charge_voltage_set_value=0x7f09009a;
public static final int tv_parameter_load_operating_mode_set_value=0x7f0900b2;
public static final int tv_parameter_morning_working_power_set_value=0x7f0900c6;
public static final int tv_parameter_morning_working_time_set_value=0x7f0900c4;
public static final int tv_parameter_optical_control_delay_time_set_value=0x7f0900b4;
public static final int tv_parameter_optical_control_voltage_set_value=0x7f0900b6;
public static final int tv_parameter_over_discharge_delay_time_set_value=0x7f0900a8;
public static final int tv_parameter_over_discharge_return_voltage_set_value=0x7f0900a0;
public static final int tv_parameter_over_discharge_voltage_set_value=0x7f0900a4;
public static final int tv_parameter_over_voltage_voltage_set_value=0x7f090094;
public static final int tv_parameter_promote_charging_time_set_value=0x7f0900ac;
public static final int tv_parameter_second_working_power_set_value=0x7f0900be;
public static final int tv_parameter_second_working_time_set_value=0x7f0900bc;
public static final int tv_parameter_set_in_common_use_param_title=0x7f09008b;
public static final int tv_parameter_set_in_senior_use_param_title=0x7f090092;
public static final int tv_parameter_set_nominal_capacity_of_battery_set_value=0x7f09008f;
public static final int tv_parameter_set_system_voltage_set_value=0x7f09008d;
public static final int tv_parameter_temperature_compensation_coefficient_set_value=0x7f0900b0;
public static final int tv_parameter_third_working_power_set_value=0x7f0900c2;
public static final int tv_parameter_third_working_time_set_value=0x7f0900c0;
public static final int tv_parameter_warning_under_voltage_set_value=0x7f0900a2;
public static final int tv_promote_charging_time_set_title=0x7f0900ab;
public static final int tv_second_working_power_set_title=0x7f0900bd;
public static final int tv_second_working_time_set_title=0x7f0900bb;
public static final int tv_solar_panel_charging_power_value=0x7f090078;
public static final int tv_solar_panel_electricity_value=0x7f090077;
public static final int tv_solar_panel_state_value=0x7f090075;
public static final int tv_solar_panel_voltage_value=0x7f090076;
public static final int tv_system_voltage_set_title=0x7f09008c;
public static final int tv_temperature_compensation_coefficient_set_title=0x7f0900af;
public static final int tv_third_working_power_set_title=0x7f0900c1;
public static final int tv_third_working_time_set_title=0x7f0900bf;
public static final int tv_up_historicalchart_ave_value_title=0x7f090037;
public static final int tv_up_historicalchart_ave_value_value=0x7f090038;
public static final int tv_up_historicalchart_current_value=0x7f090033;
public static final int tv_up_historicalchart_max_value=0x7f090034;
public static final int tv_up_historicalchart_max_value_title=0x7f090039;
public static final int tv_up_historicalchart_max_value_value=0x7f09003a;
public static final int tv_up_historicalchart_min_value_title=0x7f090035;
public static final int tv_up_historicalchart_min_value_value=0x7f090036;
public static final int tv_up_historicalchart_title=0x7f090032;
public static final int tv_warning_under_voltage_set_title=0x7f0900a1;
public static final int update_pwd_dialog=0x7f090087;
public static final int viewFlipper=0x7f090074;
public static final int wvMonth=0x7f09001d;
public static final int wvYear=0x7f09001c;
}
public static final class layout {
public static final int activity_historical_data=0x7f030000;
public static final int activity_main=0x7f030001;
public static final int activity_start=0x7f030002;
public static final int custom_marker_view=0x7f030003;
public static final int dialog_add_device=0x7f030004;
public static final int dialog_input=0x7f030005;
public static final int dialog_list_item_select=0x7f030006;
public static final int dialog_normal=0x7f030007;
public static final int dialog_set_date=0x7f030008;
public static final int dialog_show_soft_version_info=0x7f030009;
public static final int fragment_device_info=0x7f03000a;
public static final int fragment_historical_chart=0x7f03000b;
public static final int fragment_historical_data=0x7f03000c;
public static final int fragment_param_setting=0x7f03000d;
public static final int fragment_realtime_monitor=0x7f03000e;
public static final int item_device_info=0x7f03000f;
public static final int item_list_info=0x7f030010;
public static final int item_popup_listview=0x7f030011;
public static final int update_password_dialog=0x7f030012;
public static final int view_battery_parameters=0x7f030013;
public static final int view_load_parameters=0x7f030014;
public static final int view_popup=0x7f030015;
}
public static final class menu {
public static final int main=0x7f080000;
}
public static final class string {
public static final int action_settings=0x7f040000;
public static final int added_device=0x7f040001;
public static final int all=0x7f040002;
public static final int all_chart_summary=0x7f040003;
public static final int all_consumption_power=0x7f040004;
public static final int all_production_power=0x7f040005;
public static final int all_run_days=0x7f040006;
public static final int apm_hour=0x7f040007;
public static final int app_name=0x7f040008;
public static final int automatic_recognition=0x7f040009;
public static final int ave_value=0x7f04000a;
public static final int balanced_charge_voltage_set=0x7f04000b;
public static final int base_month_chart_summary=0x7f04000c;
public static final int base_year_chart_summary=0x7f04000d;
public static final int battery=0x7f04000e;
public static final int battery_all_discharge_times=0x7f04000f;
public static final int battery_board_parameter=0x7f040010;
public static final int battery_charge_all_apm_hour=0x7f040011;
public static final int battery_charge_full_times=0x7f040012;
public static final int battery_discharge_all_apm_hour=0x7f040013;
public static final int battery_esidual_capacity=0x7f040014;
public static final int battery_parameters=0x7f040015;
public static final int battery_plate_state=0x7f040016;
public static final int battery_state=0x7f040017;
public static final int battery_state_val00h=0x7f040018;
public static final int battery_state_val01h=0x7f040019;
public static final int battery_state_val02h=0x7f04001a;
public static final int battery_state_val03h=0x7f04001b;
public static final int battery_state_val04h=0x7f04001c;
public static final int battery_state_val05h=0x7f04001d;
public static final int battery_state_val06h=0x7f04001e;
public static final int battery_temperature=0x7f04001f;
public static final int battery_type_set=0x7f040020;
public static final int battery_type_val00h=0x7f040021;
public static final int battery_type_val01h=0x7f040022;
public static final int battery_type_val02h=0x7f040023;
public static final int battery_type_val03h=0x7f040024;
public static final int battery_type_val04h=0x7f040025;
public static final int battery_voltage=0x7f040026;
public static final int can_not_connect_device_info=0x7f040027;
public static final int cancel=0x7f040028;
public static final int capacity=0x7f040029;
public static final int centigrade=0x7f04002a;
public static final int change_device_name=0x7f04002b;
public static final int change_device_name_=0x7f04002c;
public static final int charge_apm_hour=0x7f04002d;
public static final int charge_imit_oltage_set=0x7f04002e;
public static final int charge_max_power=0x7f04002f;
public static final int charging_electricity=0x7f040030;
public static final int charging_power=0x7f040031;
public static final int charging_state=0x7f040032;
public static final int check_update=0x7f040033;
public static final int closed=0x7f040034;
public static final int confirm=0x7f040035;
public static final int connect_device_device_success=0x7f040036;
public static final int consumption_power=0x7f040037;
public static final int controller_info_byte0=0x7f040038;
public static final int controller_info_byte1=0x7f040039;
public static final int controller_info_byte10=0x7f04003a;
public static final int controller_info_byte11=0x7f04003b;
public static final int controller_info_byte12=0x7f04003c;
public static final int controller_info_byte13=0x7f04003d;
public static final int controller_info_byte14=0x7f04003e;
public static final int controller_info_byte2=0x7f04003f;
public static final int controller_info_byte3=0x7f040040;
public static final int controller_info_byte4=0x7f040041;
public static final int controller_info_byte5=0x7f040042;
public static final int controller_info_byte6=0x7f040043;
public static final int controller_info_byte7=0x7f040044;
public static final int controller_info_byte8=0x7f040045;
public static final int controller_info_byte9=0x7f040046;
public static final int controller_info_none=0x7f040047;
public static final int correct_password=0x7f040048;
public static final int current_version_info=0x7f040049;
public static final int day=0x7f04004a;
public static final int day_battery_max_voltage=0x7f04004b;
public static final int day_battery_min_voltage=0x7f04004c;
public static final int day_charge_amp_hour=0x7f04004d;
public static final int day_charge_max_power=0x7f04004e;
public static final int day_consumption_power=0x7f04004f;
public static final int day_discharge_amp_hour=0x7f040050;
public static final int day_discharge_max_power=0x7f040051;
public static final int day_production_power=0x7f040052;
public static final int device_connect_state=0x7f040053;
public static final int device_connected=0x7f040054;
public static final int device_disconnected=0x7f040055;
public static final int device_id=0x7f040056;
public static final int device_info=0x7f040057;
public static final int device_name=0x7f040058;
public static final int device_name_exists=0x7f040059;
public static final int device_name_set_failed=0x7f04005a;
public static final int device_name_set_sucess=0x7f04005b;
public static final int device_not_link=0x7f04005c;
public static final int device_param_getting_failed=0x7f04005d;
public static final int device_param_getting_success=0x7f04005e;
public static final int device_param_setting_failed=0x7f04005f;
public static final int device_param_setting_nothing=0x7f040060;
public static final int device_param_setting_success=0x7f040061;
public static final int device_sn_code=0x7f040062;
public static final int device_status=0x7f040063;
public static final int device_type=0x7f040064;
public static final int device_version=0x7f040065;
public static final int discharge_apm_hour=0x7f040066;
public static final int discharge_limit_voltage_set=0x7f040067;
public static final int discharge_max_power=0x7f040068;
public static final int disconnect_device_info=0x7f040069;
public static final int disconnected_device=0x7f04006a;
public static final int electricity=0x7f04006b;
public static final int electricity_colon=0x7f04006c;
public static final int electricity_load=0x7f04006d;
public static final int equalization_charging_time_set=0x7f04006e;
public static final int equilibrium_charge_interval_set=0x7f04006f;
public static final int first_working_power_set=0x7f040070;
public static final int first_working_time_set=0x7f040071;
public static final int float_charging_voltage_set=0x7f040072;
public static final int get_admin=0x7f040073;
public static final int historical_data=0x7f040074;
public static final int in_common_use_param=0x7f040075;
public static final int in_senior_use_param=0x7f040076;
public static final int incorrect_password=0x7f040077;
public static final int init_null_charter=0x7f040078;
public static final int last_day=0x7f040079;
public static final int lift_charge_return_voltage_set=0x7f04007a;
public static final int lift_charge_voltage_set=0x7f04007b;
public static final int load=0x7f04007c;
public static final int load_electricity=0x7f04007d;
public static final int load_operating_mode_set=0x7f04007e;
public static final int load_operating_mode_val00h=0x7f04007f;
public static final int load_operating_mode_val01h=0x7f040080;
public static final int load_operating_mode_val02h=0x7f040081;
public static final int load_operating_mode_val03h=0x7f040082;
public static final int load_operating_mode_val04h=0x7f040083;
public static final int load_operating_mode_val05h=0x7f040084;
public static final int load_operating_mode_val06h=0x7f040085;
public static final int load_operating_mode_val07h=0x7f040086;
public static final int load_operating_mode_val08h=0x7f040087;
public static final int load_operating_mode_val09h=0x7f040088;
public static final int load_operating_mode_val0ah=0x7f040089;
public static final int load_operating_mode_val0bh=0x7f04008a;
public static final int load_operating_mode_val0ch=0x7f04008b;
public static final int load_operating_mode_val0dh=0x7f04008c;
public static final int load_operating_mode_val0eh=0x7f04008d;
public static final int load_operating_mode_val0fh=0x7f04008e;
public static final int load_operating_mode_val10h=0x7f04008f;
public static final int load_operating_mode_val11h=0x7f040090;
public static final int load_parameters=0x7f040091;
public static final int load_power=0x7f040092;
public static final int load_state=0x7f040093;
public static final int load_switch=0x7f040094;
public static final int load_voltage=0x7f040095;
public static final int max_value=0x7f040096;
public static final int min_value=0x7f040097;
public static final int month=0x7f040098;
public static final int more_high_voltage=0x7f040099;
public static final int more_low_voltage=0x7f04009a;
public static final int more_new_soft_version_info=0x7f04009b;
public static final int morning_working_power_set=0x7f04009c;
public static final int morning_working_time_set=0x7f04009d;
public static final int new_password=0x7f04009e;
public static final int next_day=0x7f04009f;
public static final int nominal_capacity_of_battery_set=0x7f0400a0;
public static final int old_password=0x7f0400a1;
public static final int opened=0x7f0400a2;
public static final int optical_control_delay_time_set=0x7f0400a3;
public static final int optical_control_voltage_set=0x7f0400a4;
public static final int over_discharge_delay_time_set=0x7f0400a5;
public static final int over_discharge_return_voltage_set=0x7f0400a6;
public static final int over_discharge_voltage_set=0x7f0400a7;
public static final int over_voltage_voltage_set=0x7f0400a8;
public static final int param_setting=0x7f0400a9;
public static final int please_get_admin=0x7f0400aa;
public static final int please_input_the_password=0x7f0400ab;
public static final int please_select_fixed_sys_vol=0x7f0400ac;
public static final int production_power=0x7f0400ad;
public static final int promote_charging_time_set=0x7f0400ae;
public static final int prompt=0x7f0400af;
public static final int readin=0x7f0400b0;
public static final int reaffirm_new_password=0x7f0400b1;
public static final int real_time_monitoring=0x7f0400b2;
public static final int realtime_monitor=0x7f0400b3;
public static final int recovery_device=0x7f0400b4;
public static final int restore_factory_failed=0x7f0400b5;
public static final int restore_factory_success=0x7f0400b6;
public static final int scan_device=0x7f0400b7;
public static final int scan_device_dialog_title=0x7f0400b8;
public static final int second_working_power_set=0x7f0400b9;
public static final int second_working_time_set=0x7f0400ba;
public static final int setting=0x7f0400bb;
public static final int solar_panel=0x7f0400bc;
public static final int solar_panel_electricity=0x7f0400bd;
public static final int solar_panel_voltage=0x7f0400be;
public static final int state_colon=0x7f0400bf;
public static final int system_voltage_set=0x7f0400c0;
public static final int temperature=0x7f0400c1;
public static final int temperature_compensation_coefficient_set=0x7f0400c2;
public static final int third_working_power_set=0x7f0400c3;
public static final int third_working_time_set=0x7f0400c4;
public static final int times=0x7f0400c5;
public static final int update_password=0x7f0400c6;
public static final int update_password_fail=0x7f0400c7;
public static final int update_password_success=0x7f0400c8;
public static final int v_power=0x7f0400c9;
public static final int voltage=0x7f0400ca;
public static final int voltage_colon=0x7f0400cb;
public static final int warning_under_voltage_set=0x7f0400cc;
public static final int year=0x7f0400cd;
public static final int your_device_bluetooth_not_supported=0x7f0400ce;
public static final int your_device_not_supported=0x7f0400cf;
}
public static final class style {
/** API 11 theme customizations can go here.
API 14 theme customizations can go here.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
*/
public static final int AppBaseTheme=0x7f060000;
/** All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f060001;
public static final int PageTitle=0x7f060002;
public static final int Theme=0x7f060003;
public static final int Theme_Transparent=0x7f060004;
public static final int app_text_title_bold_style=0x7f060005;
public static final int battery_layout_text_content_style=0x7f060006;
public static final int battery_layout_text_title_bold_style=0x7f060007;
public static final int battery_layout_text_title_style=0x7f060008;
public static final int battery_linear_layout_horizontal_style=0x7f060009;
public static final int device_info_layout_left_text_style=0x7f06000a;
public static final int device_info_layout_right_text_style=0x7f06000b;
public static final int historical_data_layout_text_title_bold_center_style=0x7f06000c;
public static final int historical_data_layout_text_title_left_style=0x7f06000d;
public static final int historical_data_layout_text_title_style=0x7f06000e;
public static final int historical_layout_text_title_style=0x7f06000f;
public static final int historical_linear_layout_horizontal_style=0x7f060010;
public static final int historical_right_imagebtn_layout_style=0x7f060011;
public static final int historicalchart_layout_text_title_style=0x7f060012;
public static final int historicalchart_text_current_value_style=0x7f060013;
public static final int historicalchart_text_min_value_title_style=0x7f060014;
public static final int historicalchart_text_min_value_value_style=0x7f060015;
public static final int historicalchart_text_title_style=0x7f060016;
public static final int item_device_info_text_style=0x7f060017;
public static final int item_popup_layout_text_content_style=0x7f060018;
public static final int light_tab=0x7f060019;
public static final int list_item__info_text_style=0x7f06001a;
public static final int more_new_soft_version_info_style=0x7f06001b;
public static final int param_set_layout_text_title_bold_style=0x7f06001c;
public static final int realtime_left_image_layout_style=0x7f06001d;
public static final int realtime_monitor_ex_text_style=0x7f06001e;
public static final int realtime_monitor_horizontal_line_style=0x7f06001f;
public static final int realtime_monitor_text_style=0x7f060020;
public static final int realtime_monitor_text_value_style=0x7f060021;
public static final int scan_device_dialog_title_style=0x7f060022;
public static final int tabbar_radio_button_style=0x7f060023;
public static final int tv_parameter_set_param_name_title_left_style=0x7f060024;
public static final int tv_parameter_set_param_name_title_style=0x7f060025;
public static final int tv_parameter_set_param_title_style=0x7f060026;
public static final int tv_parameter_set_param_value_title_right_style=0x7f060027;
public static final int tv_parameter_set_param_value_title_style=0x7f060028;
}
public static final class styleable {
/** Attributes that can be used with a LargeTouchableAreaView.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #LargeTouchableAreaView_addition com.wcsmobile:addition}</code></td><td></td></tr>
<tr><td><code>{@link #LargeTouchableAreaView_additionBottom com.wcsmobile:additionBottom}</code></td><td></td></tr>
<tr><td><code>{@link #LargeTouchableAreaView_additionLeft com.wcsmobile:additionLeft}</code></td><td></td></tr>
<tr><td><code>{@link #LargeTouchableAreaView_additionRight com.wcsmobile:additionRight}</code></td><td></td></tr>
<tr><td><code>{@link #LargeTouchableAreaView_additionTop com.wcsmobile:additionTop}</code></td><td></td></tr>
</table>
@see #LargeTouchableAreaView_addition
@see #LargeTouchableAreaView_additionBottom
@see #LargeTouchableAreaView_additionLeft
@see #LargeTouchableAreaView_additionRight
@see #LargeTouchableAreaView_additionTop
*/
public static final int[] LargeTouchableAreaView = {
0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003,
0x7f010004
};
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#addition}
attribute's value can be found in the {@link #LargeTouchableAreaView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:addition
*/
public static final int LargeTouchableAreaView_addition = 0;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#additionBottom}
attribute's value can be found in the {@link #LargeTouchableAreaView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:additionBottom
*/
public static final int LargeTouchableAreaView_additionBottom = 1;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#additionLeft}
attribute's value can be found in the {@link #LargeTouchableAreaView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:additionLeft
*/
public static final int LargeTouchableAreaView_additionLeft = 2;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#additionRight}
attribute's value can be found in the {@link #LargeTouchableAreaView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:additionRight
*/
public static final int LargeTouchableAreaView_additionRight = 3;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#additionTop}
attribute's value can be found in the {@link #LargeTouchableAreaView} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:additionTop
*/
public static final int LargeTouchableAreaView_additionTop = 4;
/** Attributes that can be used with a PengRadioButton.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableBottom com.wcsmobile:peng_drawableBottom}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableBottomHeight com.wcsmobile:peng_drawableBottomHeight}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableBottomWith com.wcsmobile:peng_drawableBottomWith}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableLeft com.wcsmobile:peng_drawableLeft}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableLeftHeight com.wcsmobile:peng_drawableLeftHeight}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableLeftWith com.wcsmobile:peng_drawableLeftWith}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableRight com.wcsmobile:peng_drawableRight}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableRightHeight com.wcsmobile:peng_drawableRightHeight}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableRightWith com.wcsmobile:peng_drawableRightWith}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableTop com.wcsmobile:peng_drawableTop}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableTopHeight com.wcsmobile:peng_drawableTopHeight}</code></td><td></td></tr>
<tr><td><code>{@link #PengRadioButton_peng_drawableTopWith com.wcsmobile:peng_drawableTopWith}</code></td><td></td></tr>
</table>
@see #PengRadioButton_peng_drawableBottom
@see #PengRadioButton_peng_drawableBottomHeight
@see #PengRadioButton_peng_drawableBottomWith
@see #PengRadioButton_peng_drawableLeft
@see #PengRadioButton_peng_drawableLeftHeight
@see #PengRadioButton_peng_drawableLeftWith
@see #PengRadioButton_peng_drawableRight
@see #PengRadioButton_peng_drawableRightHeight
@see #PengRadioButton_peng_drawableRightWith
@see #PengRadioButton_peng_drawableTop
@see #PengRadioButton_peng_drawableTopHeight
@see #PengRadioButton_peng_drawableTopWith
*/
public static final int[] PengRadioButton = {
0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008,
0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c,
0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010
};
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableBottom}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wcsmobile:peng_drawableBottom
*/
public static final int PengRadioButton_peng_drawableBottom = 9;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableBottomHeight}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableBottomHeight
*/
public static final int PengRadioButton_peng_drawableBottomHeight = 3;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableBottomWith}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableBottomWith
*/
public static final int PengRadioButton_peng_drawableBottomWith = 2;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableLeft}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wcsmobile:peng_drawableLeft
*/
public static final int PengRadioButton_peng_drawableLeft = 11;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableLeftHeight}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableLeftHeight
*/
public static final int PengRadioButton_peng_drawableLeftHeight = 7;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableLeftWith}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableLeftWith
*/
public static final int PengRadioButton_peng_drawableLeftWith = 6;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableRight}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wcsmobile:peng_drawableRight
*/
public static final int PengRadioButton_peng_drawableRight = 10;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableRightHeight}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableRightHeight
*/
public static final int PengRadioButton_peng_drawableRightHeight = 5;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableRightWith}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableRightWith
*/
public static final int PengRadioButton_peng_drawableRightWith = 4;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableTop}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wcsmobile:peng_drawableTop
*/
public static final int PengRadioButton_peng_drawableTop = 8;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableTopHeight}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableTopHeight
*/
public static final int PengRadioButton_peng_drawableTopHeight = 1;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#peng_drawableTopWith}
attribute's value can be found in the {@link #PengRadioButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:peng_drawableTopWith
*/
public static final int PengRadioButton_peng_drawableTopWith = 0;
/** Attributes that can be used with a SegmentedGroup.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #SegmentedGroup_sc_border_width com.wcsmobile:sc_border_width}</code></td><td></td></tr>
<tr><td><code>{@link #SegmentedGroup_sc_checked_text_color com.wcsmobile:sc_checked_text_color}</code></td><td></td></tr>
<tr><td><code>{@link #SegmentedGroup_sc_corner_radius com.wcsmobile:sc_corner_radius}</code></td><td></td></tr>
<tr><td><code>{@link #SegmentedGroup_sc_tint_color com.wcsmobile:sc_tint_color}</code></td><td></td></tr>
</table>
@see #SegmentedGroup_sc_border_width
@see #SegmentedGroup_sc_checked_text_color
@see #SegmentedGroup_sc_corner_radius
@see #SegmentedGroup_sc_tint_color
*/
public static final int[] SegmentedGroup = {
0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014
};
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#sc_border_width}
attribute's value can be found in the {@link #SegmentedGroup} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:sc_border_width
*/
public static final int SegmentedGroup_sc_border_width = 1;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#sc_checked_text_color}
attribute's value can be found in the {@link #SegmentedGroup} array.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:sc_checked_text_color
*/
public static final int SegmentedGroup_sc_checked_text_color = 3;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#sc_corner_radius}
attribute's value can be found in the {@link #SegmentedGroup} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:sc_corner_radius
*/
public static final int SegmentedGroup_sc_corner_radius = 0;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#sc_tint_color}
attribute's value can be found in the {@link #SegmentedGroup} array.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:sc_tint_color
*/
public static final int SegmentedGroup_sc_tint_color = 2;
/** Attributes that can be used with a SwitchButton.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #SwitchButton_kswAnimationDuration com.wcsmobile:kswAnimationDuration}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswBackColor com.wcsmobile:kswBackColor}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswBackDrawable com.wcsmobile:kswBackDrawable}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswBackMeasureRatio com.wcsmobile:kswBackMeasureRatio}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswBackRadius com.wcsmobile:kswBackRadius}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswFadeBack com.wcsmobile:kswFadeBack}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswTextMarginH com.wcsmobile:kswTextMarginH}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswTextOff com.wcsmobile:kswTextOff}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswTextOn com.wcsmobile:kswTextOn}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbColor com.wcsmobile:kswThumbColor}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbDrawable com.wcsmobile:kswThumbDrawable}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbHeight com.wcsmobile:kswThumbHeight}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbMargin com.wcsmobile:kswThumbMargin}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbMarginBottom com.wcsmobile:kswThumbMarginBottom}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbMarginLeft com.wcsmobile:kswThumbMarginLeft}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbMarginRight com.wcsmobile:kswThumbMarginRight}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbMarginTop com.wcsmobile:kswThumbMarginTop}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbRadius com.wcsmobile:kswThumbRadius}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswThumbWidth com.wcsmobile:kswThumbWidth}</code></td><td></td></tr>
<tr><td><code>{@link #SwitchButton_kswTintColor com.wcsmobile:kswTintColor}</code></td><td></td></tr>
</table>
@see #SwitchButton_kswAnimationDuration
@see #SwitchButton_kswBackColor
@see #SwitchButton_kswBackDrawable
@see #SwitchButton_kswBackMeasureRatio
@see #SwitchButton_kswBackRadius
@see #SwitchButton_kswFadeBack
@see #SwitchButton_kswTextMarginH
@see #SwitchButton_kswTextOff
@see #SwitchButton_kswTextOn
@see #SwitchButton_kswThumbColor
@see #SwitchButton_kswThumbDrawable
@see #SwitchButton_kswThumbHeight
@see #SwitchButton_kswThumbMargin
@see #SwitchButton_kswThumbMarginBottom
@see #SwitchButton_kswThumbMarginLeft
@see #SwitchButton_kswThumbMarginRight
@see #SwitchButton_kswThumbMarginTop
@see #SwitchButton_kswThumbRadius
@see #SwitchButton_kswThumbWidth
@see #SwitchButton_kswTintColor
*/
public static final int[] SwitchButton = {
0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018,
0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c,
0x7f01001d, 0x7f01001e, 0x7f01001f, 0x7f010020,
0x7f010021, 0x7f010022, 0x7f010023, 0x7f010024,
0x7f010025, 0x7f010026, 0x7f010027, 0x7f010028
};
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswAnimationDuration}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:kswAnimationDuration
*/
public static final int SwitchButton_kswAnimationDuration = 15;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswBackColor}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
@attr name com.wcsmobile:kswBackColor
*/
public static final int SwitchButton_kswBackColor = 12;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswBackDrawable}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wcsmobile:kswBackDrawable
*/
public static final int SwitchButton_kswBackDrawable = 11;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswBackMeasureRatio}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be a floating point value, such as "<code>1.2</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:kswBackMeasureRatio
*/
public static final int SwitchButton_kswBackMeasureRatio = 14;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswBackRadius}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswBackRadius
*/
public static final int SwitchButton_kswBackRadius = 10;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswFadeBack}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:kswFadeBack
*/
public static final int SwitchButton_kswFadeBack = 13;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswTextMarginH}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:kswTextMarginH
*/
public static final int SwitchButton_kswTextMarginH = 19;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswTextOff}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:kswTextOff
*/
public static final int SwitchButton_kswTextOff = 18;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswTextOn}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:kswTextOn
*/
public static final int SwitchButton_kswTextOn = 17;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbColor}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
@attr name com.wcsmobile:kswThumbColor
*/
public static final int SwitchButton_kswThumbColor = 1;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbDrawable}
attribute's value can be found in the {@link #SwitchButton} array.
<p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
@attr name com.wcsmobile:kswThumbDrawable
*/
public static final int SwitchButton_kswThumbDrawable = 0;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbHeight}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbHeight
*/
public static final int SwitchButton_kswThumbHeight = 8;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbMargin}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbMargin
*/
public static final int SwitchButton_kswThumbMargin = 2;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbMarginBottom}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbMarginBottom
*/
public static final int SwitchButton_kswThumbMarginBottom = 4;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbMarginLeft}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbMarginLeft
*/
public static final int SwitchButton_kswThumbMarginLeft = 5;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbMarginRight}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbMarginRight
*/
public static final int SwitchButton_kswThumbMarginRight = 6;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbMarginTop}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbMarginTop
*/
public static final int SwitchButton_kswThumbMarginTop = 3;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbRadius}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbRadius
*/
public static final int SwitchButton_kswThumbRadius = 9;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswThumbWidth}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>".
Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size),
in (inches), mm (millimeters).
@attr name com.wcsmobile:kswThumbWidth
*/
public static final int SwitchButton_kswThumbWidth = 7;
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#kswTintColor}
attribute's value can be found in the {@link #SwitchButton} array.
<p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
<p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
@attr name com.wcsmobile:kswTintColor
*/
public static final int SwitchButton_kswTintColor = 16;
/** Attributes that can be used with a dashedline.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #dashedline_lineColor com.wcsmobile:lineColor}</code></td><td></td></tr>
</table>
@see #dashedline_lineColor
*/
public static final int[] dashedline = {
0x7f010029
};
/**
<p>This symbol is the offset where the {@link com.wcsmobile.R.attr#lineColor}
attribute's value can be found in the {@link #dashedline} array.
<p>Must be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>",
"<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name com.wcsmobile:lineColor
*/
public static final int dashedline_lineColor = 0;
};
}
| [
"[email protected]"
] | |
e5f4f525d20f19bdc54a2816a0cdf57fb81a2314 | c47d4038f4b30ce6ea2ef25609686ea438b6d11f | /src/main/java/study/dfs/ActualProblem4.java | 08e47e2e00d228d6fe4cdb6f3bb6c90d69065e45 | [] | no_license | Rok93/codingtest-example | b93ed2b1683e4187aece21cb3499128585501b3e | 729c425a7cfacb83f8ad6a0981a77670ab1617d6 | refs/heads/master | 2021-08-22T04:05:04.225362 | 2021-07-13T09:49:20 | 2021-07-13T09:49:20 | 232,443,346 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,675 | java | package study.dfs;
//괄호 변환
public class ActualProblem4 {
public String solution(String p) {
if (isCorrect(p)) { // 올바른 괄호문자열!
return p;
}
return editWord(p);
}
private boolean isCorrect(String s) {
int repetitionNumber = s.length() / 2;
String copiedP = s;
for (int i = 0; i < repetitionNumber; i++) {
copiedP = copiedP.replaceAll("\\(\\)", "");
}
return copiedP.isEmpty();
}
private String editWord(String p) {
if (p.isEmpty()) {
return p;
}
int findIndex = findUIndex(p);
String u = p.substring(0, findIndex + 1);
String v = p.substring(findIndex + 1);
if (isCorrect(u)) {
return u + editWord(v);
}
return "(" + editWord(v) + ")" + turnString(u.substring(1, u.length() - 1));
}
private String turnString(String s) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == '(') {
sb.append(")");
continue;
}
sb.append("(");
}
return sb.toString();
}
private int findUIndex(String p) {
int leftCnt = 0;
int rightCnt = 0;
int i = 0;
while (true) {
char c = p.charAt(i);
if (c == '(') {
leftCnt++;
}
if (c == ')') {
rightCnt++;
}
if (leftCnt == rightCnt) {
break;
}
i++;
}
return i;
}
}
| [
"[email protected]"
] | |
ed14a36c127033bc806a5c1320f3afaeb9beeac4 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/flink/2015/4/SimpleCommunityDetectionData.java | 20b562b5e0740d9e228179d2fb2c140227c68504 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 2,585 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.graph.example.utils;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.graph.Edge;
import java.util.ArrayList;
import java.util.List;
/**
* Provides the default data set used for the Simple Community Detection example program.
* If no parameters are given to the program, the default edge data set is used.
*/
public class SimpleCommunityDetectionData {
// the algorithm is not guaranteed to always converge
public static final Integer MAX_ITERATIONS = 30;
public static final double DELTA = 0.5f;
public static DataSet<Edge<Long, Double>> getDefaultEdgeDataSet(ExecutionEnvironment env) {
List<Edge<Long, Double>> edges = new ArrayList<Edge<Long, Double>>();
edges.add(new Edge<Long, Double>(1L, 2L, 1.0));
edges.add(new Edge<Long, Double>(1L, 3L, 2.0));
edges.add(new Edge<Long, Double>(1L, 4L, 3.0));
edges.add(new Edge<Long, Double>(2L, 3L, 4.0));
edges.add(new Edge<Long, Double>(2L, 4L, 5.0));
edges.add(new Edge<Long, Double>(3L, 5L, 6.0));
edges.add(new Edge<Long, Double>(5L, 6L, 7.0));
edges.add(new Edge<Long, Double>(5L, 7L, 8.0));
edges.add(new Edge<Long, Double>(6L, 7L, 9.0));
edges.add(new Edge<Long, Double>(7L, 12L, 10.0));
edges.add(new Edge<Long, Double>(8L, 9L, 11.0));
edges.add(new Edge<Long, Double>(8L, 10L, 12.0));
edges.add(new Edge<Long, Double>(8L, 11L, 13.0));
edges.add(new Edge<Long, Double>(9L, 10L, 14.0));
edges.add(new Edge<Long, Double>(9L, 11L, 15.0));
edges.add(new Edge<Long, Double>(10L, 11L, 16.0));
edges.add(new Edge<Long, Double>(10L, 12L, 17.0));
edges.add(new Edge<Long, Double>(11L, 12L, 18.0));
return env.fromCollection(edges);
}
private SimpleCommunityDetectionData() {}
}
| [
"[email protected]"
] | |
314d091611cf83351a26022e460b86173bf9511a | 5f60fb471dcabe470cbee5aa61d22ce340d3ec6b | /kafka/spring-kafka/consumer/src/main/java/com/quickstarters/consumer/KafkaConsumerConfig.java | ffbca7f9f6e911d05348d6bf38150859738ce1e4 | [] | no_license | quick-starters/understand-trending-infra | aaa0f5d3e8cd8df3202f33c10118dd981777a800 | 1537fea4e9601e86320b6c0f4004164307bcca54 | refs/heads/main | 2023-08-27T21:07:43.226482 | 2021-11-02T12:11:31 | 2021-11-02T12:11:31 | 414,591,693 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,418 | java | package com.quickstarters.consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import java.util.HashMap;
import java.util.Map;
/**
* Consumer 설정
* - https://docs.spring.io/spring-kafka/docs/current/reference/html/#message-listeners
*/
@EnableKafka
@Configuration
public class KafkaConsumerConfig {
@Value(value = "${spring.kafka.bootstrap-servers}")
private String bootstrapAddress;
@Value(value = "${spring.kafka.consumer.group-id}")
private String defaultConsumerGroupId;
public ConsumerFactory<String, String> consumerFactory(String groupId) {
Map<String, Object> props = new HashMap<>();
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress);
props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
return new DefaultKafkaConsumerFactory<>(props);
}
public ConcurrentKafkaListenerContainerFactory<String, String> kafkaListenerContainerFactory(String groupId) {
ConcurrentKafkaListenerContainerFactory<String, String> factory = new ConcurrentKafkaListenerContainerFactory<>();
factory.setConsumerFactory(consumerFactory(groupId));
return factory;
}
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String> fooKafkaListenerContainerFactory() {
return kafkaListenerContainerFactory(defaultConsumerGroupId);
}
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String> filterKafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String, String> factory = kafkaListenerContainerFactory("filter");
factory.setRecordFilterStrategy(record -> record.value()
.contains("World"));
return factory;
}
}
| [
"[email protected]"
] | |
f972b55f1d3ee77529488034bcfce1d0698e8c5c | 058a87e4d1687647227f2310820d4455c62e4990 | /src/xadrez/PecaXadrez.java | 2822deb17aa08fc8750b0ecf64789907315c6530 | [] | no_license | marcos-vinicios/xadrez-sistema-java | f1214e5fd935436262980e37e36977b2fd82bb51 | f6c9afb7c943dcb5b184bb4837a9ebce7ce8b56c | refs/heads/master | 2020-07-15T03:25:14.531414 | 2019-09-16T22:06:55 | 2019-09-16T22:06:55 | 205,468,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 794 | java | package xadrez;
import tabuleiroJogo.Peca;
import tabuleiroJogo.Posicao;
import tabuleiroJogo.Tabuleiro;
public abstract class PecaXadrez extends Peca{
private Color color;
private int moveContagem;
public PecaXadrez(Tabuleiro tabuleiro, Color color) {
super(tabuleiro);
this.color = color;
}
public Color getColor() {
return color;
}
public int getMoveContagem() {
return moveContagem;
}
public void inclementarMoveContagem() {
moveContagem++;
}
public void decrescendoMoveContagem() {
moveContagem--;
}
public PosicaoXadrez getPosicaoXadrez() {
return PosicaoXadrez.daPosicao(posicao);
}
protected boolean existeOponentePeca(Posicao posicao) {
PecaXadrez p = (PecaXadrez)getTabuleiro().peca(posicao);
return p != null && p.getColor() != color;
}
}
| [
"[email protected]"
] | |
c92ad14fc1185e090a5a84fa3b19b77b66f32882 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/8/8_88d681204b8fdb8aa10813dd393b532df9401d3b/TextComponentOperator/8_88d681204b8fdb8aa10813dd393b532df9401d3b_TextComponentOperator_t.java | e1d69f2b62b69b9fd88732e3f2c5156015ded5f0 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,459 | java | /*
* Copyright 2008 Nokia Siemens Networks Oyj
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.robotframework.swing.textcomponent;
import org.netbeans.jemmy.ComponentChooser;
import org.netbeans.jemmy.operators.ContainerOperator;
import org.netbeans.jemmy.operators.JTextComponentOperator;
import org.robotframework.swing.operator.ComponentWrapper;
public class TextComponentOperator extends JTextComponentOperator implements ComponentWrapper {
public TextComponentOperator(ContainerOperator container, int index) {
super(container, index);
}
public TextComponentOperator(ContainerOperator container, ComponentChooser chooser) {
super(container, chooser);
}
/*
* We want to let the application do whatever it wants with the inputs the textfield receives.
*/
@Override
public boolean getVerification() {
return false;
}
}
| [
"[email protected]"
] | |
a226475ad752507782e9030300781274fc4747d1 | fd9408158a6fd90b342eac926729ef1e6256bdad | /javabasic/com.study.java.parent/spring-boot/src/main/java/com/springboot/controller/UserController.java | 30402b8dc47ebf8e3669a45c1c4092535b77ec7e | [] | no_license | seeyoula/javastudy | ed61a15168dea3406ab9178b883e499a623f09a8 | 020e7578518fca091b672cf4d9d680ec291e7369 | refs/heads/master | 2022-12-23T06:25:01.939061 | 2019-11-24T07:16:18 | 2019-11-24T07:16:18 | 59,389,750 | 1 | 0 | null | 2022-12-16T01:41:49 | 2016-05-22T01:44:09 | Java | UTF-8 | Java | false | false | 698 | java | package com.springboot.controller;
import com.springboot.entity.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by Administrator on 2017/8/6.
*/
@RestController
@RequestMapping("/user")
public class UserController {
@RequestMapping("/{id}")
public User view(@PathVariable("id") Long id) {
User user = new User();
user.setId(id);
user.setName("zhang");
return user;
}
}
| [
"[email protected]"
] | |
fb53c729500c11d8d3323914b54771a133c4633b | 6c4b3ce3e12c5a8ceda91006dfaceddbcd5908aa | /biz/systempartners/reports/S13Analysis.java | 3d188d2ef50214d14929e9e421f7ee67cf58c03d | [] | no_license | josefloso/FunsoftHMIS | a34bcc6f88c15e85069804814ecef1f9738d7576 | 0ba481260737382e57ac2c674acd03e00e9dde90 | refs/heads/master | 2021-01-15T22:20:32.504511 | 2015-12-01T07:02:42 | 2015-12-01T07:02:42 | 50,920,224 | 1 | 0 | null | 2016-02-02T12:49:53 | 2016-02-02T12:49:53 | null | UTF-8 | Java | false | false | 15,124 | java | /*
* ReportIntfr.java
*
* Created on July 6, 2008, 4:40 PM
*/
package biz.systempartners.reports;
/**
*
* @author funsoft
*/
public class S13Analysis extends javax.swing.JInternalFrame {
java.sql.Connection connectDB = null;
/** Creates new form ReportIntfr */
public S13Analysis(java.sql.Connection connDb) {
connectDB = connDb;
initComponents();
// loadReport();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
reportBodyPanel = new javax.swing.JPanel();
reportBodyJscrollPane = new javax.swing.JScrollPane();
reportBodyTable = new com.afrisoftech.dbadmin.JTable();
buttonPanel = new javax.swing.JPanel();
closeBtn = new javax.swing.JButton();
spaceLable = new javax.swing.JLabel();
headerPanel = new javax.swing.JPanel();
endDatePicker = new com.afrisoftech.lib.DatePicker();
stratDatePicker = new com.afrisoftech.lib.DatePicker();
beginDateLbl = new javax.swing.JLabel();
endDateLbl = new javax.swing.JLabel();
persupplierComboBox = new javax.swing.JComboBox();
jLabel1 = new javax.swing.JLabel();
perLPOComboBox = new javax.swing.JComboBox();
jLabel2 = new javax.swing.JLabel();
perDNOTEComboBox = new javax.swing.JComboBox();
jButton1 = new javax.swing.JButton();
setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("S13 Analysis");
try {
setSelected(true);
} catch (java.beans.PropertyVetoException e1) {
e1.printStackTrace();
}
setVisible(true);
getContentPane().setLayout(new java.awt.GridBagLayout());
reportBodyPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder()));
reportBodyPanel.setLayout(new java.awt.GridBagLayout());
reportBodyTable.setForeground(new java.awt.Color(0, 0, 255));
reportBodyJscrollPane.setViewportView(reportBodyTable);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
reportBodyPanel.add(reportBodyJscrollPane, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 200.0;
getContentPane().add(reportBodyPanel, gridBagConstraints);
buttonPanel.setLayout(new java.awt.GridBagLayout());
closeBtn.setMnemonic('l');
closeBtn.setText("Close Reporter");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 0;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
buttonPanel.add(closeBtn, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 100.0;
gridBagConstraints.weighty = 1.0;
buttonPanel.add(spaceLable, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
getContentPane().add(buttonPanel, gridBagConstraints);
headerPanel.setLayout(new java.awt.GridBagLayout());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 0;
headerPanel.add(endDatePicker, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
headerPanel.add(stratDatePicker, gridBagConstraints);
beginDateLbl.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
beginDateLbl.setText("PER LPO NO");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
headerPanel.add(beginDateLbl, gridBagConstraints);
endDateLbl.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
endDateLbl.setText("Date(Period)");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
headerPanel.add(endDateLbl, gridBagConstraints);
persupplierComboBox.setModel(com.afrisoftech.lib.ComboBoxModel.ComboBoxModel(connectDB, " SELECT distinct supplier FROM st_stock_cardex where transaction_type='Receiving' ")
);
persupplierComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
persupplierComboBoxItemStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 5);
headerPanel.add(persupplierComboBox, gridBagConstraints);
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jLabel1.setText("PER Supplier");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
headerPanel.add(jLabel1, gridBagConstraints);
perLPOComboBox.setModel(com.afrisoftech.lib.ComboBoxModel.ComboBoxModel(connectDB, "SELECT distinct order_no FROM st_stock_cardex where transaction_type='Receiving' "));
perLPOComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
perLPOComboBoxItemStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 5);
headerPanel.add(perLPOComboBox, gridBagConstraints);
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jLabel2.setText("PER S13 (SERIAL NO)");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3;
headerPanel.add(jLabel2, gridBagConstraints);
perDNOTEComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
perDNOTEComboBoxItemStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 5);
headerPanel.add(perDNOTEComboBox, gridBagConstraints);
jButton1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jButton1.setText("RE-PRINT S13");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 3;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
headerPanel.add(jButton1, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
getContentPane().add(headerPanel, gridBagConstraints);
setBounds(0, 0, 643, 306);
}// </editor-fold>//GEN-END:initComponents
private void persupplierComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_persupplierComboBoxItemStateChanged
if(persupplierComboBox.getSelectedIndex()>=0){
try{
reportBodyTable.setModel(com.afrisoftech.dbadmin.TableModel.createTableVectors(connectDB,""
+ "SELECT grn_no as S13,order_no,delivery_note_no,supplier,item,item_code,SUM(quantity_required)as QTY_Required,SUM(quantity_received) as QTY_Supplied, " +
"price_per_item,sum(debit) as Amount FROM st_stock_cardex "
+ "where supplier='"+persupplierComboBox.getSelectedItem().toString()+"' "
+ " and date between '"+com.afrisoftech.lib.SQLDateFormat.getSQLDate(stratDatePicker.getDate())+"' and '"+com.afrisoftech.lib.SQLDateFormat.getSQLDate(endDatePicker.getDate())+"' "
+"GROUP BY grn_no,order_no,delivery_note_no,supplier,item,price_per_item,item_code having sum(debit-quantity_ordered)>0 ORDER BY grn_no,order_no,delivery_note_no,item_code"));
perLPOComboBox.setModel(com.afrisoftech.lib.ComboBoxModel.ComboBoxModel(connectDB,""
+ " SELECT distinct order_no FROM st_stock_cardex where transaction_type='Receiving' "
+ " AND supplier='"+persupplierComboBox.getSelectedItem().toString()+"' "));
}
catch(Exception ex){
System.err.println("the store error is "+ex);
}
}
}//GEN-LAST:event_persupplierComboBoxItemStateChanged
private void perLPOComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_perLPOComboBoxItemStateChanged
{
try{ reportBodyTable.setModel(com.afrisoftech.dbadmin.TableModel.createTableVectors(connectDB,""
+ "SELECT grn_no as S13,order_no,delivery_note_no,supplier,item,item_code,SUM(quantity_required)as QTY_Required,SUM(quantity_received) as QTY_Supplied, " +
"price_per_item,sum(debit) as Amount FROM st_stock_cardex "
+ "where ORDER_NO='"+perLPOComboBox.getSelectedItem().toString()+"' "
+ " and date between '"+com.afrisoftech.lib.SQLDateFormat.getSQLDate(stratDatePicker.getDate())+"' and '"+com.afrisoftech.lib.SQLDateFormat.getSQLDate(endDatePicker.getDate())+"' "
+"GROUP BY grn_no,order_no,delivery_note_no,supplier,item,price_per_item,item_code having sum(debit-quantity_ordered)>0 ORDER BY grn_no,order_no,delivery_note_no,item_code"));
perDNOTEComboBox.setModel(com.afrisoftech.lib.ComboBoxModel.ComboBoxModel(connectDB,""
+ " SELECT distinct grn_no FROM st_stock_cardex where transaction_type='Receiving' and "
+ " order_no='"+perLPOComboBox.getSelectedItem().toString()+"' "));
}
catch(Exception ex){
System.err.println("the category error is "+ex);
}
}
}//GEN-LAST:event_perLPOComboBoxItemStateChanged
private void perDNOTEComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_perDNOTEComboBoxItemStateChanged
{
{
try{ reportBodyTable.setModel(com.afrisoftech.dbadmin.TableModel.createTableVectors(connectDB,""
+ "SELECT grn_no as S13,order_no,delivery_note_no,supplier,item,item_code,SUM(quantity_required)as QTY_Required,SUM(quantity_received) as QTY_Supplied, " +
"price_per_item,sum(debit) as Amount FROM st_stock_cardex "
+ "where ORDER_NO='"+perLPOComboBox.getSelectedItem().toString()+"' and grn_no='"+perDNOTEComboBox.getSelectedItem().toString()+"' "
+ " and date between '"+com.afrisoftech.lib.SQLDateFormat.getSQLDate(stratDatePicker.getDate())+"' and '"+com.afrisoftech.lib.SQLDateFormat.getSQLDate(endDatePicker.getDate())+"' "
+"GROUP BY grn_no,order_no,delivery_note_no,supplier,item,price_per_item,item_code having sum(debit-quantity_ordered)>0 ORDER BY grn_no,order_no,delivery_note_no,item_code"));
}
catch(Exception ex){
System.err.println("the item error is "+ex);
}
}
}
}//GEN-LAST:event_perDNOTEComboBoxItemStateChanged
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
com.afrisoftech.hospinventory.mtrhreports.SthirteenPdf policy = new com.afrisoftech.hospinventory.mtrhreports.SthirteenPdf();
// policy.SthirteenPdf(connectDB, this.stratDatePicker.getDate().toLocaleString(), this.endDatePicker.getDate().toLocaleString(), reportBodyTable.getValueAt(reportBodyTable.getSelectedRow(), 3).toString(), reportBodyTable.getValueAt(reportBodyTable.getSelectedRow(), 2).toString());
}//GEN-LAST:event_jButton1ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel beginDateLbl;
private javax.swing.JPanel buttonPanel;
private javax.swing.JButton closeBtn;
private javax.swing.JLabel endDateLbl;
private com.afrisoftech.lib.DatePicker endDatePicker;
private javax.swing.JPanel headerPanel;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JComboBox perDNOTEComboBox;
private javax.swing.JComboBox perLPOComboBox;
private javax.swing.JComboBox persupplierComboBox;
public static javax.swing.JScrollPane reportBodyJscrollPane;
public static javax.swing.JPanel reportBodyPanel;
public static javax.swing.JTable reportBodyTable;
private javax.swing.JLabel spaceLable;
private com.afrisoftech.lib.DatePicker stratDatePicker;
// End of variables declaration//GEN-END:variables
}
| [
"Charles@Funsoft"
] | Charles@Funsoft |
8675f87f8558b6cc69c1b207367b3578c1661aca | a94736b4cc9e44c469429e821e4f913729542b74 | /src/sample/dataBase/DataBaseHandler.java | 5bee4311cdb0e92c71205c61e50c7a360b8c1bb4 | [] | no_license | ZoviProstoDMT/Shop_Database | 9ba4f1e19f5e602376b931bec0d256ba6586e1f3 | f40c15e935ba0d741da9d7330bf8381ee280c114 | refs/heads/master | 2023-01-21T20:53:54.498358 | 2020-11-27T11:08:19 | 2020-11-27T11:08:19 | 242,668,077 | 0 | 1 | null | 2020-03-10T10:04:06 | 2020-02-24T06:59:31 | Java | UTF-8 | Java | false | false | 3,169 | java | package sample.dataBase;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.TableView;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.ResultSet;
public class DataBaseHandler extends Configs {
Connection dbConnection;
public Connection getDbconnection() throws ClassNotFoundException, SQLException {
String connectionString = "jdbc:postgresql://" + dbHost + ":" + dbPort + "/" + dbName;
dbConnection = DriverManager.getConnection(connectionString, dbUser, dbPass);
return dbConnection;
}
public void signUpUser(User user) {
String insert = "INSERT INTO " + Const.USER_TABLE + "(" + Const.USER_FIRSTNAME + "," + Const.USER_LASTNAME + "," + Const.USER_USERNAME
+ "," + Const.USER_PASSWORD + "," + Const.USER_LOCATION + "," + Const.USER_GENDER + ")" + "VALUES(?,?,?,?,?,?)";
try {
PreparedStatement prSt = getDbconnection().prepareStatement(insert);
prSt.setString(1, user.getFirstname());
prSt.setString(2, user.getLastname());
prSt.setString(3, user.getUsername());
prSt.setString(4, user.getPassword());
prSt.setString(5, user.getLocation());
prSt.setString(6, user.getGender());
prSt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
public ResultSet getUser(User user) {
ResultSet resSet = null;
String select = "SELECT * FROM " + Const.USER_TABLE + " WHERE " + Const.USER_USERNAME + " =? AND " + Const.USER_PASSWORD + " =?";
try {
PreparedStatement prSt = getDbconnection().prepareStatement(select);
prSt.setString(1,user.getUsername());
prSt.setString(2,user.getPassword());
resSet = prSt.executeQuery();
}
catch (SQLException e) {
e.printStackTrace();
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
return resSet;
}
public void deleteUser(String name) {
String delete = "DELETE FROM " + Const.USER_TABLE + " WHERE " + Const.USER_USERNAME + " ='" + name +"';";
try {
PreparedStatement prSt = getDbconnection().prepareStatement(delete);
prSt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
public void changeUserRole(String name, String role) {
String up = "UPDATE " + Const.USER_TABLE + " SET role = '" + role + "' WHERE " + Const.USER_USERNAME + " = '" + name + "';";
try {
PreparedStatement prSt = getDbconnection().prepareStatement(up);
prSt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
6092aef7ee676af1258f544210002141afd5b439 | baed17757992f47ba36899faca16c5d7f9245c76 | /src/main/java/other/LeetSpeakConverter.java | a2e16144e81c87c81913f3d14311960f736321ab | [] | no_license | ncapasso/JavaProgrammingExercises | cb9b27a82a1184af05d6cf3bf03fbdbd24a265a7 | deed64a0f35506fd6b75c72306c982e13237e9b2 | refs/heads/master | 2020-12-30T12:01:19.582461 | 2017-05-25T21:13:08 | 2017-05-25T21:13:08 | 91,497,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,764 | java | package other;
import utilities.IOUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
/**
* Created by ncapasso on 5/25/2017.
*/
public class LeetSpeakConverter {
private static final Map<String, String[]> leetMap;
static {
leetMap = new HashMap<>();
leetMap.put("a", new String[]{"/-\\", "/\\", "4", "@"});
leetMap.put("b", new String[]{"|3", "8", "|o"});
leetMap.put("c", new String[]{"(", "<", "K", "S"});
leetMap.put("d", new String[]{"|)", "o|", "|>", "<|"});
leetMap.put("e", new String[]{"3"});
leetMap.put("f", new String[]{"|=", "ph"});
leetMap.put("g", new String[]{"(", "9", "6"});
leetMap.put("h", new String[]{"|-|", "]-[", "}-{", "(-)", ")-(", "#"});
leetMap.put("i", new String[]{"l", "1", "|", "!", "]["});
leetMap.put("j", new String[]{"_|"});
leetMap.put("k", new String[]{"|<", "/<", "\\<", "|{"});
leetMap.put("l", new String[]{"|_", "|", "1"});
leetMap.put("m", new String[]{"|\\/|", "/\\/\\", "|'|'|", "(\\/)", "/\\\\", "/|\\", "/v\\"});
leetMap.put("n", new String[]{"|\\|", "/\\/", "|\\\\|", "/|/"});
leetMap.put("o", new String[]{"o", "()", "[]", "{}"});
leetMap.put("p", new String[]{"|2", "|D"});
leetMap.put("q", new String[]{"(,)", "kw"});
leetMap.put("r", new String[]{"|2", "|Z", "|?"});
leetMap.put("s", new String[]{"5", "$"});
leetMap.put("t", new String[]{"+", "\'][\'", "7"});
leetMap.put("u", new String[]{"|_|"});
leetMap.put("v", new String[]{"[/", "\\|", "\\/", "/"});
leetMap.put("w", new String[]{"\\/\\/", "\\|\\|", "|/|/", "\\|/", "\\^/", "//"});
leetMap.put("x", new String[]{"><", "}{"});
leetMap.put("y", new String[]{"`/", "\'/", "j"});
leetMap.put("z", new String[]{"2", "(\\)"});
}
public static void main(String[] args) {
// System.out.println(wordConverter("test123"));
System.out.println("Please enter words to convert into leet-speak. Empty line exits.");
ArrayList<String> input = IOUtils.getInput(System.in);
System.out.println("Do you want vowels to be changed? y/n");
String boolResp = IOUtils.getInputSingleLine(System.in);
if (boolResp != null && boolResp.toLowerCase().equals("n")) {
for (String s : input) {
System.out.println("Original word: " + s + "\nConverted word: " + wordConverter(s , true));
}
} else {
for (String s : input) {
System.out.println("Original word: " + s + "\nConverted word: " + wordConverter(s, false));
}
}
}
private static String wordConverter(String input, boolean changeVowels) {
Random random = new Random();
StringBuilder str = new StringBuilder();
char[] wordChar = input.toCharArray();
for (char c : wordChar) {
String tempStr = Character.toString(c).toLowerCase();
if (changeVowels && isAVowel(c)) {
str.append(c);
continue;
}
if (leetMap.containsKey(tempStr)) {
String[] tempArr = leetMap.get(tempStr);
str.append(tempArr[random.nextInt((tempArr.length))]);
} else {
str.append(c);
}
}
return str.toString();
}
private static boolean isAVowel(char c) {
switch (Character.toLowerCase(c)) {
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
return true;
default:
return false;
}
}
}
| [
"[email protected]"
] | |
65798ce163b83bfdea67f01c5eb43ed10c096f79 | 5501e073f5207b8e78385446b6e00f05749096a1 | /src/main/java/com/k9sv/domain/pojo/ProfitLog.java | 97489a1ff66da5c9e2bda0964e64a61a9277bc99 | [] | no_license | verseboys/chongxin | 5d3aac3f14dd8569901f1d843450ab3a06bdadca | 528568c386c0d9a0332ed6aff2f1bb4dbf9baf68 | refs/heads/master | 2021-01-24T01:28:15.942092 | 2017-11-20T02:57:04 | 2017-11-20T02:57:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,280 | java | package com.k9sv.domain.pojo;
import java.util.Date;
import com.k9sv.util.DateUtil;
/**
* ProfitLog entity. 收益记录
*/
public class ProfitLog implements java.io.Serializable {
// Fields
/**
*
*/
private static final long serialVersionUID = 7724732606603188852L;
private int id;
private int status;
private int uid;
private String buyId;
private int type;
private int fid;
private float profit;
private Date created;
@SuppressWarnings("unused")
private String createdStr;
private Profile profile;
private Profile friend;
private Buy buy;
// Constructors
/** default constructor */
public ProfitLog() {
}
/** full constructor */
public ProfitLog(int status, int uid, String buyId, int type, int fid,
float profit, Date created) {
this.status = status;
this.uid = uid;
this.buyId = buyId;
this.type = type;
this.fid = fid;
this.profit = profit;
this.created = created;
}
// Property accessors
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public int getStatus() {
return this.status;
}
public void setStatus(int status) {
this.status = status;
}
public int getUid() {
return this.uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public String getBuyId() {
return this.buyId;
}
public void setBuyId(String buyId) {
this.buyId = buyId;
}
public int getType() {
return this.type;
}
public void setType(int type) {
this.type = type;
}
public int getFid() {
return this.fid;
}
public void setFid(int fid) {
this.fid = fid;
}
public float getProfit() {
return this.profit;
}
public void setProfit(float profit) {
this.profit = profit;
}
public Date getCreated() {
return this.created;
}
public void setCreated(Date created) {
this.created = created;
}
public Profile getFriend() {
return friend;
}
public void setFriend(Profile friend) {
this.friend = friend;
}
public Buy getBuy() {
return buy;
}
public void setBuy(Buy buy) {
this.buy = buy;
}
public String getCreatedStr() {
return DateUtil.getFormatDateTime(this.created, "yyyy-MM-dd HH:mm");
}
public Profile getProfile() {
return profile;
}
public void setProfile(Profile profile) {
this.profile = profile;
}
} | [
"[email protected]"
] | |
c98001641ebc6b8110145fabd73b73b4f77fc623 | 5da68cf6cbaa6f6235dcaf35a64c191e66789c53 | /src/test/java/com/green/jwt/controllers/LoginControllerTest.java | 15d80e63243a2d0953b09c5d2f456458d1a5b559 | [] | no_license | gaurav-bagga/SpringJWT | e74c8b6cf00c42532b5601ffb26b74012329cae0 | 59328e82c865d01ab39838a5470139202a818c3e | refs/heads/master | 2021-03-12T23:32:57.973236 | 2015-03-01T16:54:00 | 2015-03-01T16:54:00 | 31,083,269 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,534 | java | package com.green.jwt.controllers;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.util.Map;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import com.green.jwt.model.User;
import com.green.jwt.service.TokenService;
/**
* This class is responsible for testing the {@link LoginController}.
*
* @author gaurav.bagga
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:test-application-config.xml","file:src/main/webapp/WEB-INF/mvc-config.xml"})
@WebAppConfiguration
public class LoginControllerTest {
private MockMvc mockMvc;
@Autowired private WebApplicationContext webApplicationContext;
@Autowired private TokenService tokenService;
@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
}
@Test
public void itShouldReturnJWTTokenForValidUser() throws Exception{
//given a user with valid credentials
User user = new User("james", "pass", null);
//when he logs into the system
MvcResult result = mockMvc.perform(post("/login")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(user)))
.andExpect(status().isOk())
.andDo(print())
.andReturn();
//he should get a valid JWT token
MockHttpServletResponse response = result.getResponse();
String token = response.getContentAsString();
Map<String, Object> params = tokenService.verify(token);
Assert.assertNotNull(token);
Assert.assertNotNull(params);
Assert.assertEquals("james", params.get("sub"));
}
@Test
public void itShouldReturn403ForInValidUser() throws Exception{
//given a user with in valid credentials
User user = new User("james", "pass123", null);
//when he logs into the system
MvcResult result = mockMvc.perform(post("/login")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(user)))
//then he should not get a status code unauthorized
.andExpect(status().isUnauthorized())
.andDo(print())
.andReturn();
//and no token should be returned
MockHttpServletResponse response = result.getResponse();
String token = response.getContentAsString();
try{
tokenService.verify(token);
Assert.fail();
}catch(Exception e){
}
}
}
| [
"[email protected]"
] | |
bc389426d0b07a268a019654f0a9b3cb5260e1e1 | 2582deebb8f42bce7d3280616077aa9c930fd12f | /etalon2017-master/.idea/dataSources/com/assignstudent/etalon/CompanyEntity.java | 1a5eb1f7bf419a9af08167bb3b61e861e4770b48 | [] | no_license | karpiyeniamv/JavaDev4 | c8066b231a2950acccc3617070e11e2c5250e631 | e357dd5e82b49303160113120060bc7634216f5a | refs/heads/master | 2021-05-04T19:55:17.656686 | 2017-12-29T14:48:18 | 2017-12-29T14:48:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,620 | java | package com.assignstudent.etalon;
import javax.persistence.*;
import java.util.Collection;
@Entity
@Table(name = "company", schema = "assignstudent", catalog = "")
public class CompanyEntity {
private int id;
private String companyName;
private Collection<com.assignstudent.etalon.RequestEntity> requestsById;
@Id
@Column(name = "id", nullable = false)
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Basic
@Column(name = "companyName", nullable = false, length = 45)
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CompanyEntity that = (CompanyEntity) o;
if (id != that.id) return false;
if (companyName != null ? !companyName.equals(that.companyName) : that.companyName != null) return false;
return true;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (companyName != null ? companyName.hashCode() : 0);
return result;
}
@OneToMany(mappedBy = "companyByCompanyId")
public Collection<com.assignstudent.etalon.RequestEntity> getRequestsById() {
return requestsById;
}
public void setRequestsById(Collection<com.assignstudent.etalon.RequestEntity> requestsById) {
this.requestsById = requestsById;
}
}
| [
"[email protected]"
] | |
e45c892c5bd95a667372012c9d574651985f4b66 | 1a189d05c961756a850fd57c9c3b91489ded8bb7 | /src/dataStructure/linkedList/LoopNode.java | c85ada4ed649b284eceb0b9686b88907f66cd133 | [] | no_license | wangqianping/Algorithms | da5a5761a63e469c34f27589d7b880f0bc073a94 | 44180322164d45c384fd42928abd2f3a0c2ba218 | refs/heads/master | 2021-03-30T06:53:53.412604 | 2020-04-06T18:01:29 | 2020-04-06T18:01:29 | 248,027,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,004 | java | package dataStructure.linkedList;
/**
* 循环链表
* <p>
* 和单链表唯一的区别就是最后一个节点指向第一个节点
*/
public class LoopNode {
private int data;
private LoopNode next = this;
public LoopNode(int data) {
this.data = data;
}
/**
* 删除下一个节点
*/
public void removeNext() {
//取出下下个节点
LoopNode node = next.next;
//将下下个节点赋值给当前节点的下一个节点
next = node;
}
/**
* 插入一个节点
*/
public void insert(LoopNode node) {
//下一节点作为当前节点的下一节点
node.next = next;
//要插入的节点作为当前节点的下一个节点
this.next = node;
}
/**
* 获取下一个节点
*/
public LoopNode next() {
return next;
}
/**
* 获取节点中的数据
*/
public int getData() {
return this.data;
}
}
| [
"[email protected]"
] | |
7a611b6debefa470e32fefc0b68e15df85dff5e8 | 3ec45313838c78fb175d16ba05c6a9140a790c9b | /SportEventAnalyserService/src/de/tudresden/inf/rn/mobilis/server/services/sea/service/proxy/ISportEventAnalyserIncoming.java | 42953a057c0240b60d12f7ad881fd9cde276b459 | [] | no_license | pschwede/sporteventanalyser | bb4546f1e7f62acc4ea0f43781aea64f62bd09c5 | 594782dfa28d1ec9300792245c282206d2601842 | refs/heads/master | 2021-01-23T07:35:02.532986 | 2013-08-14T17:41:52 | 2013-08-14T17:41:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 226 | java | package de.tudresden.inf.rn.mobilis.server.services.sea.service.proxy;
import de.tudresden.inf.rn.mobilis.xmpp.beans.XMPPBean;
public interface ISportEventAnalyserIncoming {
XMPPBean onGameMappings( MappingRequest in );
} | [
"[email protected]"
] | |
817a7f94023ee4de508d7b6d3a2f78d14e03208d | e416c74387ef6e7e861a4169d1d294ed7ddfe137 | /src/org/logginging/java/lib/clitools4j/CommandProcedureException.java | c287011bf60fd7e6753c3652a50514c43f2f88f1 | [
"MIT"
] | permissive | mironal/CliTools4j | e49deceec99c59ae900b04d079fbab5a8aa01e11 | b91d394d674731dd8838149b245b1b86abbd8dfa | refs/heads/master | 2021-01-13T01:35:56.410481 | 2012-12-13T11:34:50 | 2012-12-13T11:34:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package org.logginging.java.lib.clitools4j;
public class CommandProcedureException extends Exception {
/**
*
*/
private static final long serialVersionUID = -3985136202622166873L;
public CommandProcedureException(String message) {
super(message);
}
}
| [
"[email protected]"
] | |
8b839fc5273934aa0e7fe14e1e0ea2163b9200c1 | a3295d1f841e32d4551c36684c1543fda2c8e26f | /src/main/java/BeautyIt/BP/Menu/RemoveAdminMenu.java | 3013dd159a91cc8c9b67cf9c0e30e0afbdfd1d58 | [] | no_license | ShantKhayalian/BeautyProductsWebWorks | 85b322b68a28a728c9388e7e3b4669ad2b5c28c9 | 0fd29a4ce73c57b95f61e3eef45903344190c137 | refs/heads/master | 2023-01-24T05:51:17.951306 | 2019-04-19T06:21:35 | 2019-04-19T06:21:35 | 170,174,165 | 0 | 0 | null | 2023-01-11T19:55:42 | 2019-02-11T17:49:23 | HTML | UTF-8 | Java | false | false | 4,853 | java | package BeautyIt.BP.Menu;
import BeautyIt.BP.Bean.Admin;
import BeautyIt.BP.Bean.Menu;
import BeautyIt.BP.Bean.Messaging;
import BeautyIt.BP.Dao.AdminDao;
import BeautyIt.BP.Dao.MenuDao;
import BeautyIt.BP.Dao.UsersDao;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@WebServlet("/RemoveAdminMenu")
public class RemoveAdminMenu extends HttpServlet {
private String AdminEmailFromSession = null;
private AdminDao adminDao = new AdminDao();
private String adminUserName = null;
private int adminId = 0;
private List<Admin> adminInfoList = new ArrayList<>();
private List<Messaging> messagingList = new ArrayList<>();
private UsersDao usersDao = new UsersDao();
private int CountAdminMessages = 0;
private MenuDao menuDao = new MenuDao();
private String MenuIdString = null;
private int menuId = 0;
private List<Menu>menuAllList = new ArrayList<>();
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
removeAdminMenu(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
removeAdminMenu(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
private void removeAdminMenu(HttpServletRequest request, HttpServletResponse response) throws SQLException, ServletException, IOException {
getAdminSession(request);
getAdminFullInfo(AdminEmailFromSession);
getAdminId(AdminEmailFromSession);
checkEmailCount();
getParameters(request);
convertToInt(MenuIdString);
removeMenuFromData(menuId, request, response);
}
private int convertToInt(String MenuIdString) {
menuId = Integer.parseInt(MenuIdString);
return menuId;
}
private void removeMenuFromData(int menuId, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int deletingMenu = menuDao.deleteMenu(menuId);
if (deletingMenu > 0) {
getMenuList();
String message = "something went wrong";
gotoPage(request, response, message);
} else {
getMenuList();
String message = "Menu Deleted";
gotoPage(request, response, message);
}
}
private List<Menu> getMenuList() {
menuAllList = menuDao.LoadAllMenu();
return menuAllList;
}
private void gotoPage(HttpServletRequest request, HttpServletResponse response, String message) throws ServletException, IOException {
request.setAttribute("message", message);
request.setAttribute("menuAllList",menuAllList);
request.setAttribute("CountAdminMessages", CountAdminMessages);
request.setAttribute("AdminEmail", adminId);
request.getRequestDispatcher("/WEB-INF/Admin/AdminShowAllMenu.jsp").forward(request, response);
}
private void getParameters(HttpServletRequest request) {
MenuIdString = request.getParameter("MenuId");
}
private int checkEmailCount() throws SQLException {
CountAdminMessages = 0;
messagingList = usersDao.getAdminMessages(adminId);
for (Messaging messaging : messagingList) {
if (messaging.getMessageRead().toLowerCase().trim().equals("false")) {
CountAdminMessages++;
}
}
return CountAdminMessages;
}
private int getAdminId(String adminEmailFromSession) {
adminInfoList = adminDao.LoadAdminByEmail(adminEmailFromSession);
for (int i = 0; i < adminInfoList.size(); i++) {
adminId = adminInfoList.get(i).getAdminId();
}
return adminId;
}
private String getAdminFullInfo(String adminEmailFromSession) {
adminInfoList = adminDao.LoadAdminByEmail(adminEmailFromSession);
for (int i = 0; i < adminInfoList.size(); i++) {
adminUserName = adminInfoList.get(i).getAdmin_Username();
}
return adminUserName;
}
private void getAdminSession(HttpServletRequest request) {
HttpSession session = request.getSession(false);
AdminEmailFromSession = String.valueOf(session.getAttribute("adminuser"));
System.out.println("adminuser : " + AdminEmailFromSession);
}
}
| [
"[email protected]"
] | |
ec708054fbef8cc224250161bc6bb94f329a0a26 | d64d62de28802e86a80ea3456f80b3bea2efe8bb | /BancoImobiliario_POO/src/tabuleiro/Prisao.java | 90a76fca3de8315be6c5e4a0e3c466ca367c4f4b | [] | no_license | WeslleyGRR/BancoImobiliario | ab5f5a264e394a95c958c9d318ff8bea6c3215b0 | fb689cec6996bf0787e09c5da9eaafc2afd3eb8b | refs/heads/master | 2020-06-30T17:43:07.898075 | 2019-08-06T18:02:41 | 2019-08-06T18:02:41 | 200,900,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 117 | java | package tabuleiro;
public class Prisao implements CasaTabuleiro{
public String getNome(){
return "Prisao";
}
}
| [
"[email protected]"
] | |
1eb309867ee77c29f34fafa3fc51c61511832934 | e4c8f47b59e3025d66089d8606db5d4311975b7f | /app/src/main/java/com/taran/instagram/MainActivity.java | 0d61fad599e0824f4dedaded6f160a6cdffdcb45 | [] | no_license | fatemehtaran/Instagram | 673995e5d6107f6a941aac1707fb593d91a1ab56 | db79b9d28d139ea05fd4ed2341dcd02c75950a76 | refs/heads/master | 2023-01-19T02:36:22.732739 | 2020-11-28T20:04:26 | 2020-11-28T20:04:26 | 316,812,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,069 | java | package com.taran.instagram;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private EditText edtUserNameL , edtPasswordL;
private Button btnLogInL , btnSignUpL;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setTitle("log in");
btnSignUpL = findViewById(R.id.btnSignUpL);
btnLogInL = findViewById(R.id.btnLogInL);
edtUserNameL = findViewById(R.id.edtUserNameL);
edtPasswordL = findViewById(R.id.edtPasswordL);
// btnLogInL.setOnClickListener(this);
btnSignUpL.setOnClickListener(this);
}
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this,SignUp.class);
startActivity(intent);
}
} | [
"[email protected]"
] | |
8ae7d591165a8c4d8fe7e07cf5355ab3aa0f25bd | 4c2c911dd9bd7a7b30bec1b240553bf0169f1472 | /src/main/java/com/gsl/coolweather/app/MainActivity.java | 9e5017ba7f0a1ff599d92cf2403ca1537c07677f | [] | no_license | guosenlin/coolweather | 2510d1cb85d1909178e5f79c8e15b3583ea0e192 | 533b7eaddaa4435319ef76841f8ae301bb4cf526 | refs/heads/master | 2021-04-15T13:40:47.578399 | 2016-08-05T16:57:11 | 2016-08-05T16:57:11 | 65,031,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package com.gsl.coolweather.app;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"[email protected]"
] | |
38cdc1b8004a5c66fda764c6ce8617582995f12a | e84ee4e393ec074a8a0285aa05a88c45eaf4e5e9 | /src/03-Stacks-and-Queues/04-More-about-Leetcode/src/ArrayStack.java | 5bf9b26be6f43ca8e6c3b5029cec75a95daafd88 | [] | no_license | bianxinhuan/Play-with-Data-Structures | 8d29d20aedcc91c95722d16cef41b96dc4d92274 | 1d02fede2616bb422386a0b014d2b1ca5ba3475a | refs/heads/master | 2020-05-07T09:43:13.685279 | 2019-06-24T13:53:21 | 2019-06-24T13:53:21 | 180,388,749 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,180 | java | /**
* -
*
* @author bianxinhuan
* @date 2019-04-17 23:46:02
*/
public class ArrayStack<E> implements Stack<E> {
private Array<E> array;
public ArrayStack(int capacity) {
this.array = new Array<>(capacity);
}
public ArrayStack() {
this.array = new Array<>();
}
@Override
public int getSize() {
return array.getSize();
}
@Override
public boolean isEmpty() {
return array.isEmpty();
}
public int getCapacity() {
return array.getCapacity();
}
@Override
public void push(E e) {
array.addLast(e);
}
@Override
public E pop() {
return array.removeLast();
}
@Override
public E peek() {
return array.getLast();
}
@Override
public String toString() {
StringBuilder res = new StringBuilder();
res.append("Stack: ");
res.append('[');
for (int i = 0; i < array.getSize(); i++) {
res.append(array.get(i));
if (i != array.getSize() - 1) {
res.append(", ");
}
}
res.append("] top");
return res.toString();
}
}
| [
"[email protected]"
] | |
b7319adb06718c1dd3aba1bfb4ea2dfa84079066 | 7dccb79b9804d8d9459c86ba9721e1197f59b865 | /de.fhdo.lemma.intermediate.transformations/xtend-gen/de/fhdo/lemma/intermediate/transformations/AbstractEmftvmIntermediateModelTransformationStrategy.java | bbb20362e12da94ebf337f4fed24687d6ab786c8 | [
"MIT"
] | permissive | SeelabFhdo/lemma | a668854675d50d3f3cad56eb5e3961b683d0f70a | 2e9ccc882352116b253a7700b5ecf2c9316a5829 | refs/heads/main | 2023-08-28T18:04:56.990603 | 2023-03-24T08:03:13 | 2023-03-24T08:03:13 | 204,692,764 | 32 | 9 | MIT | 2022-10-25T12:25:06 | 2019-08-27T11:54:43 | Java | UTF-8 | Java | false | false | 9,131 | java | package de.fhdo.lemma.intermediate.transformations;
import de.fhdo.lemma.utils.LemmaUtils;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.m2m.atl.emftvm.EmftvmFactory;
import org.eclipse.m2m.atl.emftvm.ExecEnv;
import org.eclipse.m2m.atl.emftvm.Metamodel;
import org.eclipse.m2m.atl.emftvm.Model;
import org.eclipse.m2m.atl.emftvm.impl.resource.EMFTVMResourceFactoryImpl;
import org.eclipse.m2m.atl.emftvm.util.DefaultModuleResolver;
import org.eclipse.m2m.atl.emftvm.util.TimingData;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.Functions.Function2;
import org.eclipse.xtext.xbase.lib.MapExtensions;
/**
* Abstract strategy for model-to-model transformations relying on ATL's EMFTVM.
*
* @author <a href="mailto:[email protected]">Florian Rademacher</a>
*/
@SuppressWarnings("all")
public abstract class AbstractEmftvmIntermediateModelTransformationStrategy extends AbstractIntermediateModelTransformationStrategy<Model, Model> {
private EmftvmFactory emftvmFactory;
private ExecEnv executionEnvironment;
private ResourceSet resourceSet;
private Map<TransformationModelDescription, Model> potentialOutputModels = CollectionLiterals.<TransformationModelDescription, Model>newHashMap();
/**
* Get the platform path to the folder that holds the transformation model file
*/
public abstract String getModelTransformationFilePlatformFolder();
/**
* Get the name of the transformation model file
*/
public abstract String getModelTransformationFileName();
/**
* Constructor
*/
public AbstractEmftvmIntermediateModelTransformationStrategy() {
super();
this.emftvmFactory = EmftvmFactory.eINSTANCE;
this.executionEnvironment = this.emftvmFactory.createExecEnv();
this.resourceSet = this.setupResourceSet();
}
/**
* Helper to create the resource set used by the transformation
*/
private ResourceSet setupResourceSet() {
final ResourceSetImpl rs = new ResourceSetImpl();
final Map<String, Object> extensionToFactoryMap = rs.getResourceFactoryRegistry().getExtensionToFactoryMap();
XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl();
extensionToFactoryMap.put("xmi", _xMIResourceFactoryImpl);
EMFTVMResourceFactoryImpl _eMFTVMResourceFactoryImpl = new EMFTVMResourceFactoryImpl();
extensionToFactoryMap.put("emftvm", _eMFTVMResourceFactoryImpl);
EcoreResourceFactoryImpl _ecoreResourceFactoryImpl = new EcoreResourceFactoryImpl();
extensionToFactoryMap.put("ecore", _ecoreResourceFactoryImpl);
return rs;
}
/**
* Prepare model transformation
*/
@Override
protected void beforeTransformationHook(final Map<TransformationModelDescription, IFile> inputModelFiles, final Map<TransformationModelDescription, String> outputModelPaths) {
final Function1<IFile, String> _function = (IFile it) -> {
return LemmaUtils.getAbsolutePath(it);
};
final Map<TransformationModelDescription, String> absoluteInputModelPaths = MapExtensions.<TransformationModelDescription, IFile, String>mapValues(inputModelFiles, _function);
final Set<TransformationModelDescription> modelDescriptions = absoluteInputModelPaths.keySet();
final HashSet<String> registeredMetamodels = CollectionLiterals.<String>newHashSet();
final Consumer<TransformationModelDescription> _function_1 = (TransformationModelDescription it) -> {
final TransformationModelType modelType = this.modelTypes.get(it);
final String namespaceUri = modelType.getNamespaceUri();
boolean _contains = registeredMetamodels.contains(namespaceUri);
boolean _not = (!_contains);
if (_not) {
final Metamodel metamodel = EmftvmFactory.eINSTANCE.createMetamodel();
metamodel.setResource(modelType.getEcorePackage().eResource());
this.executionEnvironment.registerMetaModel(it.getReferenceModelName(), metamodel);
registeredMetamodels.add(namespaceUri);
}
};
modelDescriptions.forEach(_function_1);
}
/**
* Create transformation-technology-specific input model instance
*/
@Override
protected Model createTransformationInputModel(final TransformationModelDescription modelDescription, final Resource resource) {
final Model model = this.emftvmFactory.createModel();
model.setResource(resource);
TransformationModelDirection _direction = modelDescription.getDirection();
boolean _tripleEquals = (_direction == TransformationModelDirection.INOUT);
if (_tripleEquals) {
this.potentialOutputModels.put(modelDescription, model);
}
return model;
}
/**
* Create transformation-technology-specific output model instance
*/
@Override
protected Model createTransformationOutputModel(final TransformationModelDescription modelDescription, final String outputPath) {
Model _xifexpression = null;
boolean _containsKey = this.potentialOutputModels.containsKey(modelDescription);
boolean _not = (!_containsKey);
if (_not) {
Model _xblockexpression = null;
{
final Model model = EmftvmFactory.eINSTANCE.createModel();
model.setResource(this.resourceSet.createResource(URI.createURI(outputPath)));
this.potentialOutputModels.put(modelDescription, model);
_xblockexpression = model;
}
_xifexpression = _xblockexpression;
} else {
_xifexpression = null;
}
return _xifexpression;
}
/**
* Execute EMFTVM transformation
*/
@Override
protected Map<TransformationModelDescription, Resource> transformation(final Map<TransformationModelDescription, Model> transformationInputModels, final Map<TransformationModelDescription, Model> transformationOutputModels) {
this.registerModels(transformationInputModels);
this.registerModels(transformationOutputModels);
String _modelTransformationFilePlatformFolder = this.getModelTransformationFilePlatformFolder();
final DefaultModuleResolver moduleResolver = new DefaultModuleResolver(_modelTransformationFilePlatformFolder,
this.resourceSet);
final TimingData timingData = new TimingData();
this.executionEnvironment.loadModule(moduleResolver, this.getModelTransformationFileName());
timingData.finishLoading();
this.executionEnvironment.run(timingData);
timingData.finish();
final Function2<TransformationModelDescription, Model, Boolean> _function = (TransformationModelDescription description, Model model) -> {
boolean _xifexpression = false;
Resource _resource = model.getResource();
EList<EObject> _contents = null;
if (_resource!=null) {
_contents=_resource.getContents();
}
boolean _tripleNotEquals = (_contents != null);
if (_tripleNotEquals) {
boolean _isEmpty = model.getResource().getContents().isEmpty();
_xifexpression = (!_isEmpty);
} else {
_xifexpression = false;
}
return Boolean.valueOf(_xifexpression);
};
final Function1<Model, Resource> _function_1 = (Model it) -> {
return it.getResource();
};
return MapExtensions.<TransformationModelDescription, Model, Resource>mapValues(MapExtensions.<TransformationModelDescription, Model>filter(this.potentialOutputModels, _function), _function_1);
}
/**
* Helper to register models and their descriptions in EMFTVM's execution environment
*/
private void registerModels(final Map<TransformationModelDescription, Model> models) {
final BiConsumer<TransformationModelDescription, Model> _function = (TransformationModelDescription description, Model model) -> {
this.registerModel(description.getNameInModelTransformation(), description.getDirection(), model);
};
models.forEach(_function);
}
/**
* Helper to register a single model in EMFTVM's execution environment
*/
private void registerModel(final String nameInModelTransformation, final TransformationModelDirection direction, final Model model) {
if (direction != null) {
switch (direction) {
case IN:
this.executionEnvironment.registerInputModel(nameInModelTransformation, model);
break;
case OUT:
this.executionEnvironment.registerOutputModel(nameInModelTransformation, model);
break;
case INOUT:
this.executionEnvironment.registerInOutModel(nameInModelTransformation, model);
break;
default:
break;
}
}
}
}
| [
"[email protected]"
] | |
48c788cfa029167f18d834b46ca8d7d9b3cf7bb2 | 4190d949e54321e80d9d7d076506a902037046e8 | /Solutions/src/segments/NorthwestwardWind.java | 914f26f24a06b61851999a587f2f301441240f7a | [] | no_license | hyunjongpark/algorithm_study | f1bae88a32a3c59f3e4623aa2642faaec5e5a0ec | f2ee4973d628d4d50d09328140ba78131d8474ef | refs/heads/master | 2022-04-02T03:45:48.972960 | 2020-01-17T02:26:38 | 2020-01-17T02:26:38 | 104,432,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,923 | java | package segments;
/*
* https://www.acmicpc.net/problem/5419
*/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
public class NorthwestwardWind {
static int pointCount;
static public class Point {
public int x;
public int y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
}
static Point[] pList;
static int leafNodeCount = 0;
static long[] tree;
static public void main(String[] args) throws NumberFormatException, IOException {
System.setIn(new FileInputStream("northwind"));
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
int tc = Integer.parseInt(br.readLine());
for (int i = 0; i < tc; i++) {
pointCount = Integer.parseInt(br.readLine());
pList = new Point[pointCount];
for (int j = 0; j < pointCount; j++) {
StringTokenizer st = new StringTokenizer(br.readLine());
int x = Integer.parseInt(st.nextToken());
int y = Integer.parseInt(st.nextToken());
pList[j] = new Point(x, y);
}
Arrays.sort(pList, new Comparator<Point>() {
@Override
public int compare(Point arg0, Point arg1) {
if (arg0.y < arg1.y) {
return -1;
} else if (arg0.y > arg1.y) {
return 1;
} else {
return 0;
}
}
});
adjX();
tree = new long[(leafNodeCount + 1) * 4];
call();
}
}
static public void adjX() {
leafNodeCount = 0;
int temp = 0;
for (int i = 0; i < pList.length; i++) {
Point p = pList[i];
if (temp != p.y) {
leafNodeCount++;
}
temp = p.y;
p.y = leafNodeCount;
}
}
static public void call() {
Arrays.sort(pList, new Comparator<Point>() {
@Override
public int compare(Point arg0, Point arg1) {
if (arg0.x > arg1.x) {
return -1;
} else if (arg0.x < arg1.x) {
return 1;
} else {
if (arg0.y > arg1.y) {
return 1;
} else {
return -1;
}
}
}
});
long result = 0;
for (int i = 0; i < pList.length; i++) {
Point p = pList[i];
result += getSum(1, 0, leafNodeCount, 0, p.y);
update(1, 0, leafNodeCount, p.y);
}
System.out.println(result);
}
static long getSum(int node, int start, int end, int left, int right) {
if (right < start || end < left) {
return 0;
}
if (left <= start && end <= right) {
return tree[node];
}
int mid = (start + end) / 2;
return getSum(node * 2, start, mid, left, right) + getSum(node * 2 + 1, mid + 1, end, left, right);
}
static void update(int node, int start, int end, int index) {
if (index < start || end < index) {
return;
}
tree[node] += 1;
if (start == end) {
return;
}
int mid = (start + end) / 2;
update(node * 2, start, mid, index);
update(node * 2 + 1, mid + 1, end, index);
}
}
| [
"[email protected]"
] | |
f022352fdb028780fda2210a387fb3b203d2a2d5 | 0c6020d91a64abd35b7f4109c7fbef911f3b8783 | /src/database_instruments/Main.java | e11c011245c35103932a2b95a9636bca9f90f4d1 | [] | no_license | mishka251/JavaPostgres | 0d5bad4941f784bafcafbb0b1c236cd87a89804b | f310be6159f5a73c647aea57a9fe9452ea57d347 | refs/heads/master | 2022-08-16T01:18:33.333485 | 2020-06-22T09:05:44 | 2020-06-22T09:05:44 | 268,355,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,276 | java | package database_instruments;
import client_forms.LoginForm;
import javax.swing.*;
import java.sql.SQLException;
import java.util.Random;
public class Main {
static void createDB(PosgtresDB db) throws SQLException {
db.createTable("faculty",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("name", "VARCHAR (100)"),
});
db.createTable("department",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("name", "VARCHAR (100)"),
new TableColumn("faculty_id", "INTEGER", "REFERENCES faculty (id)")
});
db.createTable("group",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("name", "VARCHAR (100)"),
new TableColumn("speciality", "VARCHAR (100)"),
new TableColumn("number", "VARCHAR (100)"),
new TableColumn("word_code", "VARCHAR (100)"),
new TableColumn("number_code", "VARCHAR (100)"),
new TableColumn("department_id", "INTEGER", "REFERENCES department (id)")
});
db.createTable("student",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("name", "VARCHAR (100)"),
new TableColumn("surname", "VARCHAR (100)"),
new TableColumn("patronymic", "VARCHAR (100)"),
new TableColumn("no_zk", "VARCHAR (100)"),
new TableColumn("group_id", "INTEGER", "REFERENCES [group] (id)")
});
db.createTable("subjects",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("name", "VARCHAR (100)"),
});
db.createTable("user",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("name", "VARCHAR (100)"),
new TableColumn("surname", "VARCHAR (100)"),
new TableColumn("patronymic", "VARCHAR (100)"),
new TableColumn("position", "VARCHAR (100)"),
new TableColumn("email", "VARCHAR (100)"),
new TableColumn("phone", "VARCHAR (100)"),
new TableColumn("login", "VARCHAR (100)"),
new TableColumn("password", "VARCHAR (100)"),
});
db.createTable("register",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("control_type", "VARCHAR (100)"),
new TableColumn("date", "DATE"),
new TableColumn("subject_id", "INTEGER", "REFERENCES subjects (id)"),
new TableColumn("group_id", "INTEGER", "REFERENCES [group] (id)"),
new TableColumn("teacher_id", "INTEGER", "REFERENCES user (id)"),
});
db.createTable("rating",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("number", "INTEGER"),
new TableColumn("student_marks", "STRING"),
new TableColumn("group_id", "INTEGER", "REFERENCES [group] (id)"),
});
db.createTable("report",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("excellent_percent", "DOUBLE"),
new TableColumn("strikers_percent", "DOUBLE"),
new TableColumn("threesome_percent", "DOUBLE"),
new TableColumn("loosers_percent", "DOUBLE"),
new TableColumn("group_id", "INTEGER", "REFERENCES [group] (id)"),
new TableColumn("subject_id", "INTEGER", "REFERENCES subjects (id)"),
});
db.createTable("student_mark_in_register",
new TableColumn[]{
new TableColumn("id", "INTEGER", "PRIMARY KEY AUTOINCREMENT"),
new TableColumn("mark", "INTEGER"),
new TableColumn("student_id", "INTEGER", "REFERENCES student (id)"),
new TableColumn("register_id", "INTEGER", "REFERENCES register (id)"),
});
}
static void createUsers(PosgtresDB db) throws SQLException {
db.insert("user", new String[]{
"login",
"password",
"position"
},
new Object[]{
"teacher",
"teacher",
"teacher",
});
db.insert("user", new String[]{
"login",
"password",
"position",
},
new Object[]{
"decanat",
"decanat",
"decanat",
});
db.insert("user", new String[]{
"login",
"password",
"position",
},
new Object[]{
"admin",
"admin",
"admin",
});
}
static String getRandomName() {
String[] names = new String[]{
"Иван", "Петр", "Сидор", "Вася", "Саша", "Азат"
};
Random r = new Random();
return names[r.nextInt(names.length)];
}
static String getRandomSurname() {
String[] names = new String[]{
"Иванов", "Петров", "Сидоров", "Васильев", "Чернов", "Юсупов"
};
Random r = new Random();
return names[r.nextInt(names.length)];
}
static void createStudents(PosgtresDB db) throws SQLException {
long fac_id = db.insert("faculty", new String[]{"name"}, new Object[]{"ФИРТ"});
long caf_id = db.insert("department", new String[]{
"name",
"faculty_id"
},
new Object[]{
"ВИиК",
fac_id
});
String[] groupNames = new String[]{
"ЭАС",
"ПИ-1",
"ПИ-2"
};
String[] groupNumbers = new String[]{
"1",
"1",
"2"
};
String[] groupSpecs = new String[]{
"ЭАС",
"ПИ",
"ПИ"
};
long[] groups = new long[groupNames.length];
for (int i = 0; i < groupNames.length; i++) {
groups[i] = db.insert("group", new String[]{
"name",
"number",
"speciality",
"department_id"
},
new Object[]{
groupNames[i],
groupNumbers[i],
groupSpecs[i],
caf_id
});
}
for (long group : groups) {
for (int i = 0; i < 20; i++) {
db.insert("student", new String[]{
"name",
"surname",
"group_id"
},
new Object[]{
getRandomName(),
getRandomSurname(),
group
});
}
}
db.insert("subjects",
new String[]{"name"},
new Object[]{"матан"});
db.insert("subjects",
new String[]{"name"},
new Object[]{"физра"});
}
public static void main(String[] args) {
PosgtresDB db = new PosgtresDB();
db.connect();
try {
db.select("user");
} catch (Exception _ex) {
try {
Main.createDB(db);
Main.createUsers(db);
Main.createStudents(db);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, ex.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
return;
}
}
new LoginForm(db);
}
}
| [
"[email protected]"
] | |
6362d6a30619eaaff8a55aa040df7dde4d8c9f6d | 3ca1d1a6a844a7b9346a28b853ebc47a3b09a146 | /FacebookLoginSignup/app/src/test/java/com/example/abhishek/facebookloginsignup/ExampleUnitTest.java | 0891051089d6fa2561175ce4c803ce2b312a36ae | [] | no_license | AbhishekTiwari0812/MISC | 5c47c79814fd909cf4ab6111933637cbbb4970e9 | 16788dc27a0c448d6661448266b9a42c0d8595c3 | refs/heads/master | 2021-01-17T10:34:41.957842 | 2016-04-16T17:47:27 | 2016-04-16T17:47:27 | 41,962,927 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.example.abhishek.facebookloginsignup;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
4619ec1b295612d7508a7c83e88faef0ca442af2 | 17f7956c1dcdb25dbb367ebb2edda6c631c042fb | /rest-jdbc/src/main/java/com/cg/pojo/Dti_product.java | c63d7b337db41a5dde665a1ce04fbfcdcdc0e57f | [] | no_license | saurabhgour619/mywork | eab17ccbf02db5f98bf48861175e98a19f3aa639 | ce034c7af7ee9f4f52dd5c98d980ea096410aacb | refs/heads/master | 2020-03-21T03:13:59.670648 | 2018-08-03T09:22:33 | 2018-08-03T09:22:33 | 138,042,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 975 | java | package com.cg.pojo;
public class Dti_product {
private String pdt_code;
private String pdt_name;
private String pdt_desc;
private Double printed_price;
public Dti_product() {
}
public String getPdt_code() {
return pdt_code;
}
public void setPdt_code(String pdt_code) {
this.pdt_code = pdt_code;
}
public String getPdt_name() {
return pdt_name;
}
public void setPdt_name(String pdt_name) {
this.pdt_name = pdt_name;
}
public String getPdt_desc() {
return pdt_desc;
}
public void setPdt_desc(String pdt_desc) {
this.pdt_desc = pdt_desc;
}
public Double getPrinted_price() {
return printed_price;
}
public void setPrinted_price(Double printed_price) {
this.printed_price = printed_price;
}
@Override
public String toString() {
return "Product [pdt_code=" + pdt_code + ", pdt_name=" + pdt_name + ", pdt_desc=" + pdt_desc
+ ", printed_price=" + printed_price + "]";
}
} | [
"[email protected]"
] | |
8afcf94e385610553af59822c8f48d19f6a1901a | 8f6cae24251002b188f00a1983a787f877d6fc55 | /aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/UpdateGcmChannelResult.java | 2cafe70d197717b0f736950a93baf96796ddcaea | [
"Apache-2.0"
] | permissive | vipsql/aws-sdk-java | a0a2d0f4f15edf3c030f68e76f701efe4c80427c | 9cac4759453cfbd189fb33be8d1cac0a48415744 | refs/heads/master | 2020-03-27T07:09:28.248543 | 2016-12-23T07:52:33 | 2016-12-23T07:52:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,232 | java | /*
* Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.pinpoint.model;
import java.io.Serializable;
/**
*
*/
public class UpdateGcmChannelResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
private GCMChannelResponse gCMChannelResponse;
/**
* @param gCMChannelResponse
*/
public void setGCMChannelResponse(GCMChannelResponse gCMChannelResponse) {
this.gCMChannelResponse = gCMChannelResponse;
}
/**
* @return
*/
public GCMChannelResponse getGCMChannelResponse() {
return this.gCMChannelResponse;
}
/**
* @param gCMChannelResponse
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateGcmChannelResult withGCMChannelResponse(GCMChannelResponse gCMChannelResponse) {
setGCMChannelResponse(gCMChannelResponse);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getGCMChannelResponse() != null)
sb.append("GCMChannelResponse: ").append(getGCMChannelResponse());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateGcmChannelResult == false)
return false;
UpdateGcmChannelResult other = (UpdateGcmChannelResult) obj;
if (other.getGCMChannelResponse() == null ^ this.getGCMChannelResponse() == null)
return false;
if (other.getGCMChannelResponse() != null && other.getGCMChannelResponse().equals(this.getGCMChannelResponse()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getGCMChannelResponse() == null) ? 0 : getGCMChannelResponse().hashCode());
return hashCode;
}
@Override
public UpdateGcmChannelResult clone() {
try {
return (UpdateGcmChannelResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
808a3fe1a52693a63f2e941a9120c14767dc079e | 0e8890391facc930e91e07e6e1481a384750e67d | /OCP/OCPStrategy/src/src/impl/GBDatePrinter.java | 7257d24507d5c2dccdd592ad5f3956cb7a2d106f | [] | no_license | noavarice/solid | c70ba79ed06dfe713221c042ac26adc46693a275 | cd9470f0628fecf145572f3973f32734c10a149c | refs/heads/master | 2021-08-28T23:25:24.978987 | 2017-12-13T08:33:13 | 2017-12-13T08:33:13 | 112,929,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 570 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package src.impl;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import src.IDatePrinter;
/**
*
* @author alexrazinkov
*/
public class GBDatePrinter implements IDatePrinter {
@Override
public String getDate(Date date) {
final DateFormat df = new SimpleDateFormat("dd/MM/YYYY");
return df.format(date);
}
}
| [
"[email protected]"
] | |
988c6d5671cba523ab35ea553b883c99831ca27d | 3b796acb962d6615606cdae273be3023f45ebf27 | /core-Java-Basic-WS/coreJavaBasicExample/src/com/memoryCollection/GarbageCollection/NullifyingObject.java | f54ef1d9dc508eba67f3cc75b30c9a8d5e2d521f | [] | no_license | indranilsharma/coreJava | 051820708a4b9b5478da49a5f3b6b337cb41fbe3 | 299f50ee5eca877f844fe6e02ca0fac148a0ceab | refs/heads/master | 2021-10-13T13:25:28.780069 | 2021-09-28T16:41:25 | 2021-09-28T16:41:25 | 239,985,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 659 | java | package com.memoryCollection.GarbageCollection;
public class NullifyingObject {
NullifyingObject i;
public static void main(String[] args) {
NullifyingObject o1 = new NullifyingObject();
NullifyingObject o2 = new NullifyingObject();
NullifyingObject o3 = new NullifyingObject();
o1.i = o2;
o2.i = o3;
o3.i = o1;
Runtime.getRuntime().gc();
System.out.println(Runtime.getRuntime().freeMemory());
// object eligible for gc
o1 = null;
System.out.println(Runtime.getRuntime().freeMemory());
o2 = null;
// after this 3 object eligible for gc
System.gc();
System.out.println(Runtime.getRuntime().freeMemory());
o3 = null;
}
}
| [
"[email protected]"
] | |
92c702bfe6784f0172f04d4aaf6967c4ae6e4364 | 8748a3d45cacf26a4f24266f44ce22adbee266bb | /src/main/java/com/ls/constant/RedisConstant.java | 427cfd5901a14de3535e1b72b2e63a114a9888bd | [] | no_license | ls909074489/sell | 89e7b061e2287c2180c5c514224943e5024c57cc | 733064a9af5cd8eb3ed0f633ac1b000ac65b4772 | refs/heads/master | 2020-03-21T12:08:12.465364 | 2018-08-16T02:13:41 | 2018-08-16T02:13:41 | 138,537,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package com.ls.constant;
/**
* redis常量
* Created by 廖师兄
* 2017-07-30 16:22
*/
public interface RedisConstant {
String TOKEN_PREFIX = "token_%s";
Integer EXPIRE = 7200; //2小时
}
| [
"[email protected]"
] | |
3e684306bc15ef0cc4bfb35e818c14e6637725e6 | aca3e9948b81d516a0bb2580ddeac06732e49f52 | /Exercises_3.java/Test/PersonTest.java | f0eefadc2d34dd7e58bea9bd0badc3c81465aae0 | [] | no_license | mhoang17/OOP | f7b2ce29dc55beb982081a11b341e68a2425a99f | 84c6b2f9d8b1115a19eac7ed337073ac4fc546fe | refs/heads/master | 2021-04-25T09:37:02.456490 | 2018-03-11T13:22:07 | 2018-03-11T13:22:07 | 121,944,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
class PersonTest {
@Test
public void equalsTest() {
Person person = new Person("Hans", "Ole", 24, 1489374);
Person person2 = new Person("Hans", "Ole", 24, 1489374);
assertEquals(person,person2);
assertTrue(person.hashCode() == person2.hashCode());
}
} | [
"[email protected]"
] | |
c69fd2ea7e7306e77be1fad2c7b7856c2423452c | 0acebb7f30ace134844c236a74fbf7b43ba6e4fd | /Interop/ONNX/src/test/java/org/tribuo/interop/onnx/MultiLabelTransformerTest.java | 2b36f588527e208f4d7e97ed5d721e912eee3aed | [
"Apache-2.0",
"LicenseRef-scancode-protobuf",
"BSD-3-Clause",
"EPL-2.0",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"UPL-1.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | oracle/tribuo | 89dc83c3c3b132ad57aee6287790828a617c1e09 | df7e6a61691b5f302c7f2422d20a5f55eca75d5b | refs/heads/main | 2023-08-17T05:37:56.988232 | 2023-08-07T19:18:25 | 2023-08-07T19:18:25 | 272,672,735 | 1,256 | 182 | Apache-2.0 | 2023-08-07T19:18:26 | 2020-06-16T09:59:48 | Java | UTF-8 | Java | false | false | 8,523 | java | /*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.tribuo.interop.onnx;
import ai.onnxruntime.OnnxTensor;
import ai.onnxruntime.OrtEnvironment;
import ai.onnxruntime.OrtException;
import org.junit.jupiter.api.Test;
import org.tribuo.Example;
import org.tribuo.ImmutableOutputInfo;
import org.tribuo.Prediction;
import org.tribuo.classification.Label;
import org.tribuo.impl.ArrayExample;
import org.tribuo.multilabel.MultiLabel;
import org.tribuo.multilabel.MultiLabelFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
public class MultiLabelTransformerTest {
private static final MultiLabelFactory factory = new MultiLabelFactory();
private static final MultiLabelTransformer transformer = new MultiLabelTransformer();
@Test
public void multilabelTest() {
try (OrtEnvironment env = OrtEnvironment.getEnvironment()) {
Map<MultiLabel,Integer> outputMapping = new HashMap<>();
outputMapping.put(new MultiLabel("A"),0);
outputMapping.put(new MultiLabel("B"),1);
outputMapping.put(new MultiLabel("C"),2);
outputMapping.put(new MultiLabel("D"),3);
ImmutableOutputInfo<MultiLabel> outputInfo = factory.constructInfoForExternalModel(outputMapping);
OnnxTensor output = OnnxTensor.createTensor(env,new float[][]{{0.1f,0.51f,0.8f,0.0f}});
// Test transform to output
MultiLabel m = transformer.transformToOutput(Collections.singletonList(output),outputInfo);
assertFalse(m.contains("A"));
assertTrue(m.contains("B"));
assertTrue(m.contains("C"));
assertFalse(m.contains("D"));
assertEquals(0.51f,m.getLabelScore(new Label("B")).getAsDouble());
assertEquals(0.8f,m.getLabelScore(new Label("C")).getAsDouble());
// Test transform to prediction
Prediction<MultiLabel> pred = transformer.transformToPrediction(Collections.singletonList(output),outputInfo,1,new ArrayExample<>(m));
MultiLabel predOutput = pred.getOutput();
assertFalse(predOutput.contains("A"));
assertTrue(predOutput.contains("B"));
assertTrue(predOutput.contains("C"));
assertFalse(predOutput.contains("D"));
assertEquals(0.1f,pred.getOutputScores().get("A").getLabelScore(new Label("A")).getAsDouble());
assertEquals(0.51f,pred.getOutputScores().get("B").getLabelScore(new Label("B")).getAsDouble());
assertEquals(0.8f,pred.getOutputScores().get("C").getLabelScore(new Label("C")).getAsDouble());
assertEquals(0.0f,pred.getOutputScores().get("D").getLabelScore(new Label("D")).getAsDouble());
} catch (OrtException e) {
fail(e);
}
}
@Test
public void multiLabelBatchTest() {
try (OrtEnvironment env = OrtEnvironment.getEnvironment()) {
Map<MultiLabel,Integer> outputMapping = new HashMap<>();
outputMapping.put(new MultiLabel("A"),0);
outputMapping.put(new MultiLabel("B"),1);
outputMapping.put(new MultiLabel("C"),2);
outputMapping.put(new MultiLabel("D"),3);
ImmutableOutputInfo<MultiLabel> outputInfo = factory.constructInfoForExternalModel(outputMapping);
OnnxTensor output = OnnxTensor.createTensor(env,new float[][]{{0.1f,0.51f,0.8f,0.0f},{0.9f,0.1f,0.2f,1.0f},{0.0f,0.0f,0.0f,0.0f}});
// Test transform to batch output
List<MultiLabel> m = transformer.transformToBatchOutput(Collections.singletonList(output),outputInfo);
assertEquals(3,m.size());
MultiLabel first = m.get(0);
assertFalse(first.contains("A"));
assertTrue(first.contains("B"));
assertTrue(first.contains("C"));
assertFalse(first.contains("D"));
assertEquals(0.51f,first.getLabelScore(new Label("B")).getAsDouble());
assertEquals(0.8f,first.getLabelScore(new Label("C")).getAsDouble());
MultiLabel second = m.get(1);
assertTrue(second.contains("A"));
assertFalse(second.contains("B"));
assertFalse(second.contains("C"));
assertTrue(second.contains("D"));
assertEquals(0.9f,second.getLabelScore(new Label("A")).getAsDouble());
assertEquals(1.0f,second.getLabelScore(new Label("D")).getAsDouble());
MultiLabel third = m.get(2);
assertFalse(third.contains("A"));
assertFalse(third.contains("B"));
assertFalse(third.contains("C"));
assertFalse(third.contains("D"));
assertEquals(0,third.getLabelSet().size());
// Test transform to batch prediction
int[] numValidFeatures = new int[]{1,1,1};
List<Example<MultiLabel>> examples = new ArrayList<>();
examples.add(new ArrayExample<>(first));
examples.add(new ArrayExample<>(second));
examples.add(new ArrayExample<>(third));
List<Prediction<MultiLabel>> pred = transformer.transformToBatchPrediction(Collections.singletonList(output),outputInfo,numValidFeatures,examples);
Prediction<MultiLabel> firstPred = pred.get(0);
MultiLabel firstOutput = firstPred.getOutput();
assertFalse(firstOutput.contains("A"));
assertTrue(firstOutput.contains("B"));
assertTrue(firstOutput.contains("C"));
assertFalse(firstOutput.contains("D"));
assertEquals(0.1f,firstPred.getOutputScores().get("A").getLabelScore(new Label("A")).getAsDouble());
assertEquals(0.51f,firstPred.getOutputScores().get("B").getLabelScore(new Label("B")).getAsDouble());
assertEquals(0.8f,firstPred.getOutputScores().get("C").getLabelScore(new Label("C")).getAsDouble());
assertEquals(0.0f,firstPred.getOutputScores().get("D").getLabelScore(new Label("D")).getAsDouble());
Prediction<MultiLabel> secondPred = pred.get(1);
MultiLabel secondOutput = secondPred.getOutput();
assertTrue(secondOutput.contains("A"));
assertFalse(secondOutput.contains("B"));
assertFalse(secondOutput.contains("C"));
assertTrue(secondOutput.contains("D"));
assertEquals(0.9f,secondPred.getOutputScores().get("A").getLabelScore(new Label("A")).getAsDouble());
assertEquals(0.1f,secondPred.getOutputScores().get("B").getLabelScore(new Label("B")).getAsDouble());
assertEquals(0.2f,secondPred.getOutputScores().get("C").getLabelScore(new Label("C")).getAsDouble());
assertEquals(1.0f,secondPred.getOutputScores().get("D").getLabelScore(new Label("D")).getAsDouble());
Prediction<MultiLabel> thirdPred = pred.get(2);
MultiLabel thirdOutput = thirdPred.getOutput();
assertFalse(thirdOutput.contains("A"));
assertFalse(thirdOutput.contains("B"));
assertFalse(thirdOutput.contains("C"));
assertFalse(thirdOutput.contains("D"));
assertEquals(0.0f,thirdPred.getOutputScores().get("A").getLabelScore(new Label("A")).getAsDouble());
assertEquals(0.0f,thirdPred.getOutputScores().get("B").getLabelScore(new Label("B")).getAsDouble());
assertEquals(0.0f,thirdPred.getOutputScores().get("C").getLabelScore(new Label("C")).getAsDouble());
assertEquals(0.0f,thirdPred.getOutputScores().get("D").getLabelScore(new Label("D")).getAsDouble());
} catch (OrtException e) {
fail(e);
}
}
}
| [
"[email protected]"
] | |
4b7004c154a19df9a2a73969041e1a39e22d3f3a | 9b140f7af881f7e7149b7963abd407e4764c688a | /src/twelveengine/script/ScriptCallBegin.java | 5388beeeb768ec4e02adb8f7a955ec89b211181c | [] | no_license | infernoplus/12D-Client | 5e275cd7c66758f9f694d4b4655354d1ca3e257b | d5ddbea12a2db943d0462c49416eb0020644b740 | refs/heads/master | 2020-12-24T14:45:12.739076 | 2014-06-23T02:54:25 | 2014-06-23T02:54:25 | 20,868,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,572 | java | package twelveengine.script;
//Abstract-ish class. This is a super for every type of call in a script. Everything from constants to functions that return strings are a sub class of this.
//If you want to add a new script function then it'll be a subclass of this.
public class ScriptCallBegin extends ScriptCall {
private final String name = "Begin"; //For debugging. Just a name to identify this call by.
public ScriptCallBegin(ScriptManager m,int c, ScriptCall a[]) {
super(m, c, a);
}
private int e = 0;
private boolean wait = false;
public void step() {
if(!done) {
if(e < calls.length) {
if(wait) {
if(calls[e].done) {
wait = false;
e++;
}
else
calls[e].step();
}
else {
while(e < calls.length && calls[e].done) {
calls[e].executeVoid();
if(calls[e].done)
e++;
else
wait = true;
}
}
}
}
if(e >= calls.length) {
done = true;
}
}
//Returns void
public void executeVoid() {
done = false;
e = 0;
wait = false;
}
//Returns a bool
public boolean executeBool() {
return false;
}
//Returns a int
public int executeInt() {
return 0;
}
//Returns a float
public float executeFloat() {
return 0;
}
//Returns a string
public String executeString() {
return "";
}
public void debugTree(int i) {
int j = 0;
while(j < i) {
System.out.print("-");
j++;
}
j = 0;
System.out.println(" Call:" + name + " ID#" + cid + " Src: " + code);
while(j < calls.length) {
calls[j].debugTree(i+1);
j++;
}
}
} | [
"[email protected]"
] | |
99f58d5fb25d9e3b3f9d54c5cd1bf78cfa96385e | 6da91037bbe82153f35154ef504d494b24aebe86 | /src/main/java/com/simonbaars/clonerefactor/refactoring/enums/MethodType.java | 8f831f3ada742c3d2a8241d2f192a97aa1733ada | [
"MIT"
] | permissive | software-improvement-group-research/CloneRefactor | 0c8f02c04bbc2c609d7945c96d95b5b84d11a78f | caec155c9820f3775b011c8565ac2c32b827ea7e | refs/heads/master | 2021-07-08T19:25:08.739015 | 2020-11-13T15:25:59 | 2020-11-13T15:25:59 | 207,491,509 | 0 | 0 | MIT | 2020-11-13T15:26:00 | 2019-09-10T07:22:41 | null | UTF-8 | Java | false | false | 332 | java | package com.simonbaars.clonerefactor.refactoring.enums;
public enum MethodType {
VOID("Void"),
RETURNSASSIGNEDVARIABLE("Assign"),
RETURNSDECLAREDVARIABLE("Declare"),
RETURNS("Return");
private String name;
private MethodType(String name) {
this.name=name;
}
@Override
public String toString() {
return name;
}
}
| [
"[email protected]"
] | |
124eaa78c0a866fc5a3c186c553285f1fc6acfb0 | 2e90e8c829218e2dc596ca23af4e58d5ed088582 | /snippets/graph_lca.java | 566f70002ea16451b0d385125e47188a523bb08c | [] | no_license | shifona1/SCP | 688247a4f0da010d77ba659ca3d44a7717eb4e4f | 4f87f6d3e5d58c884fa82e33fe7bff0e274a71ab | refs/heads/master | 2021-09-07T20:30:15.802568 | 2018-02-28T15:32:29 | 2018-02-28T15:32:29 | 122,855,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,206 | java |
class Graph
{
ArrayList<ArrayList<Pair<Integer,Integer>>> a=new ArrayList<ArrayList<Pair<Integer,Integer>>>();
int[] flag;
int[] marked;
int[] distance;
int[] parent;
int[] depth;
int counter=0;
int LG = 30;
int[][] parents;
TreeSet<Pair<Integer,Integer>> pq;
// int[] distances;
void creategraph(int n)
{
a.clear();
flag=new int[n];
distance=new int[n];
Arrays.fill(distance,Integer.MAX_VALUE);
for(int i=0;i<n;i++)
{
a.add(new ArrayList<Pair<Integer,Integer>>());
}
pq=new TreeSet<Pair<Integer,Integer>>();
parent=new int[n];
parents = new int[LG][n];
for (int i=0;i<LG ;i++ ) {
Arrays.fill(parents[i],-1);
}
}
void addEdge(int u,int v,int cost)
{
a.get(u).add(new Pair<Integer,Integer>(v,cost));
}
void dfs(int s,int p)
{
if(flag[s]!=0) return;
else
flag[s]=counter;
parent[s]=p;
depth[s]=depth[p]+1;
ArrayList<Pair<Integer,Integer>> temp=a.get(s);
for(int i=0;i<temp.size();i++)
{
dfs(temp.get(i).a,s);
}
}
void dijkshtra(int s)
{
Pair<Integer,Integer> current;
marked = new int[a.size()];
while(pq.size()>0) {
current = pq.first();
pq.pollFirst();
if(marked[current.b]>0)
continue;
marked[current.b]=1;
ArrayList<Pair<Integer,Integer>> arr=a.get(current.b);
for(Pair<Integer,Integer> k:arr)
{
if(distance[current.b]+k.b<distance[k.a])
{
distance[k.a]=distance[current.b]+k.b;
pq.add(new Pair<Integer,Integer>(distance[k.a],k.a));
}
}
}
}
int lca(int n1,int n2)
{
int h1=depth[n1];
int h2=depth[n2];
if(h2<h1) // swap(n1,n2)
{
int t=n2;
n2=n1;
n1=t;
}
n2=kthParent(n2,h2-h1);
for(int i=LG-1;i>=0;i--)
{
int p1=parents[i][n1];
int p2=parents[i][n2];
if(p1!=p2)
{
n1=p1;
n2=p2;
}
}
return parents[1][n1];
}
int kthParent(int n,int k)
{
for (int i=0;k>0 && n>=0 ;i++,k>>=1 ) {
if((k&1)>0)
n=parents[i][n];
}
return n;
}
void build_lca(int root)
{
parents[0]=parent;
// parents[i][n] using parents[i-1][x]
for (int i=1; i<LG;i++ )
for(int n=0;n<parent.length;n++)
{
int pi_1=parents[i-1][n];
if(pi_1>=0)
parents[i][n]=parents[i-1][pi_1];
}
}
} | [
"[email protected]"
] | |
773125c7b71a981cc56b269a2dde029ad547900b | 9d22f98297e4461e9b08b1f1b1ab418a4a2158e6 | /dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HXmlData.java | 88c67e3958a171c1df9ccc54aed0d44dbf8c7cb6 | [
"CDDL-1.0",
"LicenseRef-scancode-proprietary-license",
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | wso2/wso2-ode | b530fda4a33701ab367bde4b2639f8b9f1be3a26 | 50dfe2b027d398ce8f26593b99d614a07a06d0c2 | refs/heads/master | 2023-08-29T12:44:37.595022 | 2022-10-11T14:06:49 | 2022-10-11T14:06:49 | 16,887,937 | 34 | 45 | Apache-2.0 | 2023-07-07T21:14:38 | 2014-02-16T15:55:47 | Java | UTF-8 | Java | false | false | 3,753 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ode.daohib.bpel.hobj;
import java.util.Collection;
import java.util.HashSet;
/**
* @hibernate.class table="BPEL_XML_DATA"
* @hibernate.query name="SELECT_XMLDATA_IDS_BY_INSTANCES" query="select id from HXmlData as x where x.instance in (:instances)"
*/
public class HXmlData extends HObject {
public static final String SELECT_XMLDATA_IDS_BY_INSTANCES = "SELECT_XMLDATA_IDS_BY_INSTANCES";
private boolean _simpleType;
private byte[] _data;
private Collection<HVariableProperty> _properties = new HashSet<HVariableProperty>();
private String _name;
private String _simpleValue;
private HScope _scope;
private HProcessInstance _instance;
/** Constructor. */
public HXmlData() {
super();
}
/**
* @hibernate.property type="org.apache.ode.daohib.bpel.hobj.GZipDataType"
*
* @hibernate.column name="DATA" sql-type="blob(2G)"
*/
public byte[] getData() {
return _data;
}
public void setData(byte[] data) {
_data = data;
}
/**
* @hibernate.property
* column="NAME"
* type="string"
* length="255"
* not-null="true"
*/
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
/**
* @hibernate.property
* column="SIMPLE_VALUE"
* type="string"
* length="255"
* not-null="false"
*/
public String getSimpleValue() {
return _simpleValue;
}
public void setSimpleValue(String simpleValue) {
_simpleValue = simpleValue;
}
/**
* @hibernate.bag
* lazy="true"
* inverse="true"
* cascade="delete"
* @hibernate.collection-key column="XML_DATA_ID" foreign-key="none"
* @hibernate.collection-one-to-many
* class="org.apache.ode.daohib.bpel.hobj.HVariableProperty"
*/
public Collection<HVariableProperty> getProperties() {
return _properties;
}
public void setProperties(Collection<HVariableProperty> properties) {
_properties = properties;
}
/**
* @hibernate.many-to-one column="SCOPE_ID" foreign-key="none"
*/
public HScope getScope() {
return _scope;
}
public void setScope(HScope scope) {
_scope = scope;
if(scope != null) {
setInstance(scope.getInstance());
}
}
/**
* @hibernate.many-to-one
* column="PIID" foreign-key="none"
*/
public HProcessInstance getInstance() {
return _instance;
}
public void setInstance(HProcessInstance instance) {
_instance = instance;
}
/**
* @hibernate.property
* column="IS_SIMPLE_TYPE"
*/
public boolean isSimpleType() {
return _simpleType;
}
public void setSimpleType(boolean simpleType) {
_simpleType = simpleType;
}
}
| [
"thilini@thilini.(none)"
] | thilini@thilini.(none) |
fc48c8f582eeb73b698af9c9d964d483b5f7f1dc | 8f0d58b0256f270e9ef4c7305d2b65ac4a3e4852 | /src/main/java/com/CursoEducaWeb/course/entities/Product.java | 3d67dc2b45094ef3ec7d360fc1545c2d88fc8ae6 | [] | no_license | PauloMiron/course-springboot-2-java-11 | b1ad864804ac548bb290760389c20ce68a61813f | d06ea128b9efa26bb45c62ecb16fc1b38a0caec9 | refs/heads/master | 2023-03-31T14:32:06.587497 | 2021-03-26T16:57:36 | 2021-03-26T16:57:36 | 351,093,263 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,508 | java | package com.CursoEducaWeb.course.entities;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.aspectj.weaver.ast.Or;
import org.springframework.context.annotation.Profile;
import javax.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
@Entity
@Table(name = "tb_product")
public class Product implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String description;
private Double price;
private String imgUrl;
@ManyToMany
@JoinTable(name = "tb_product_category",
joinColumns = @JoinColumn(name = "product_id"),
inverseJoinColumns = @JoinColumn(name = "category_id"))
private Set<Category> categories = new HashSet<>();
@OneToMany(mappedBy = "id.product")
private Set<OrderItem> items = new HashSet<>();
public Product (){}
public Product(Long id, String name, String description, Double price, String imgUrl) {
this.id = id;
this.name = name;
this.description = description;
this.price = price;
this.imgUrl = imgUrl;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
public Set<Category> getCategories() {
return categories;
}
@JsonIgnore
public Set<Order> getOrders(){
Set<Order> set = new HashSet<>();
for(OrderItem x : items){
set.add(x.getOrder());
}
return set;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Product product = (Product) o;
return Objects.equals(id, product.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
| [
"[email protected]"
] | |
ee18df09065251604ee4a62fc4b6cc445c934da6 | 21da7cf6320f92bba261bbe471485f69d4a5744b | /src/main/java/com/softeng/conorredington/assignment1/Course.java | bd240bdd3ddb76141967048d4603165b745dfa21 | [] | no_license | conorRed/CT417 | 2c63b75cd6d362f2d65c78d9af0d1763043fdd16 | 158ef8d33156e1ae83e9134f030931b3a840938f | refs/heads/master | 2020-04-02T06:48:10.244265 | 2018-10-27T12:20:36 | 2018-10-27T12:20:36 | 154,168,814 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,220 | java | package com.softeng.conorredington.assignment1;
import java.util.ArrayList;
import org.joda.time.DateTime;
/*
* @Author Conor Redington
*/
public class Course {
private String name;
private ArrayList<Module> modules;
private ArrayList<Student> students;
private DateTime startDate, endDate;
public Course(String name, ArrayList<Module> modules, ArrayList<Student> students, DateTime start, DateTime end) {
this.name = name;
this.modules = modules;
this.students = students;
this.startDate = start;
this.endDate = end;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ArrayList<Module> getModules() {
return modules;
}
public void setModules(ArrayList<Module> modules) {
this.modules = modules;
}
public ArrayList<Student> getStudents() {
return students;
}
public void setStudents(ArrayList<Student> students) {
this.students = students;
}
public DateTime getStartDate() {
return startDate;
}
public void setStartDate(DateTime startDate) {
this.startDate = startDate;
}
public DateTime getEndDate() {
return endDate;
}
public void setEndDate(DateTime endDate) {
this.endDate = endDate;
}
}
| [
"[email protected]"
] | |
f545c55f2e322fbfc259b38cc74faf8018560bc9 | 2f267fb656312a0fd6dba8b639e1845630c081af | /test-maven-gwt-modular/trunk/app-module4/src/main/java/org/stbland/test/mavengwtmodular/module4/client/mappers/animation/phone/TabletMainAnimationMapper.java | 5d7d9b97f462cb53bd4e3895adbefe1d35d0aea9 | [] | no_license | stbland/stbland | 88e949616b5c2db1343a817c4633364449e4d89c | 39e32c398d41cef3109dcfb21c7635b4884b5a90 | refs/heads/master | 2020-06-04T05:55:21.817441 | 2014-04-08T11:45:58 | 2014-04-08T11:45:58 | 32,307,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package org.stbland.test.mavengwtmodular.module4.client.mappers.animation.phone;
import org.stbland.test.mavengwtmodular.module4.client.mappers.animation.JQMTransitionMapper;
import com.google.gwt.place.shared.Place;
import com.sksamuel.jqm4gwt.Transition;
public class TabletMainAnimationMapper implements JQMTransitionMapper {
@Override
public Transition getTransition(Place oldPlace, Place newPlace) {
return Transition.FADE;
}
}
| [
"stbland@f6deccbe-e060-11de-8d18-5b59c22968bc"
] | stbland@f6deccbe-e060-11de-8d18-5b59c22968bc |
d4a12feba0583a09bfcca1a59bae0e08005239ee | 778968fa32b556d865e977f635d5ff815ebe4dc6 | /Advanced Programming Methods/Laboratoare/Lab/Lab2/src/runner/StrategyTaskRunner.java | c5135de4f50a4f9745ad22c1ffcd54166bc7189c | [] | no_license | katybucsa/faculty | cf29148329e8630c096de4aa53ef2b7cc271a53e | a7172e4e8433caca86021c74ce4961df477a535f | refs/heads/master | 2023-02-12T01:58:17.841213 | 2021-01-07T15:27:08 | 2021-01-07T15:47:28 | 327,284,764 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 745 | java | package runner;
import domain.Strategy;
import domain.Task;
import factory.Container;
import factory.TaskContainerFactory;
public class StrategyTaskRunner implements TaskRunner {
private Container container;
public StrategyTaskRunner(Strategy s){
container= TaskContainerFactory.getInstance().createContainer(s);
}
public void executeOneTask(){
if(!container.isEmpty()){
Task t=container.remove();
t.execute();
}
}
public void executeAll(){
while (!container.isEmpty()){
executeOneTask();
}
}
public void addTask(Task t){
container.add(t);
}
public boolean hasTask(){
return !container.isEmpty();
}
}
| [
"[email protected]"
] | |
26cfd5dede2a79b08c939b8d8b7c00b3a8020751 | 2928930eea35eaba07bcce68f8d0752021efcf7b | /NYTimesSearch/app/src/main/java/com/codepath/week1/nytimessearch/activities/ArticleActivity.java | 59564412bfe15871960554a0a52c0e8e38d572b9 | [
"Apache-2.0"
] | permissive | sanaltsk/codepath-nytimes | 20033350b85b8bd8724aea98d9bf099d251a8a57 | 09cc885ae6a67369a06540438a78fb1136f3a2ca | refs/heads/master | 2021-05-05T10:05:23.650005 | 2017-09-25T01:19:01 | 2017-09-25T01:19:01 | 104,020,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,338 | java | package com.codepath.week1.nytimessearch.activities;
import android.content.Intent;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.ShareActionProvider;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.codepath.week1.nytimessearch.R;
import com.codepath.week1.nytimessearch.model.Article;
public class ArticleActivity extends AppCompatActivity {
private ShareActionProvider miShareAction;
private Intent shareIntent;
private String url;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_article);
final Article article = (Article) getIntent().getParcelableExtra("article");
WebView webView = (WebView)findViewById(R.id.wvArticle);
webView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
url = article.getLink();
attachShareIntent(url);
webView.loadUrl(url);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.article_menu, menu);
MenuItem item = menu.findItem(R.id.action_share);
miShareAction = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
attachShareIntentAction();
return true;
}
public void attachShareIntentAction() {
if (miShareAction != null && shareIntent != null)
miShareAction.setShareIntent(shareIntent);
}
public void attachShareIntent(String url) {
shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, url);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_share) {
startActivity(Intent.createChooser(shareIntent, "Share link using"));
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
24fc675baeb74ad6b4a8c863d16233a011a08204 | c1521274d80388722358ac54e8b9b323cefa09f2 | /Java-Homework-master/src/Inheritance/Calc1.java | f7de0dac8a3b93ef9f24a64ac690834a2382d4bc | [] | no_license | alishergil/Homework-master-Java | 53e4701ec0617d8507659f76f38676b41823956c | 5112b8ceb45290984e689b733d0e7d08f6ef247a | refs/heads/master | 2021-04-15T02:54:20.797553 | 2020-03-22T23:05:51 | 2020-03-22T23:05:51 | 249,289,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 381 | java | package Inheritance;
public class Calc1 {
public void add(int num1, int num2) {
int c = num1 + num2;
System.out.println("Addition of num1 and num2 is: " + c);
}
public void sub(int num1, int num2) {
int c = num1 - num2;
System.out.println("Subtraction of num1 and num2 is: " + c);
}
// some random code below
String a = "fddfgf";
String b = a.concat("dfgfg");
}
| [
"[email protected]"
] | |
f37b3155a6d7dc84cc3e35068d8246fb437df4f7 | c410683a9d08113e4aaeebc4690822977a5cf680 | /src/fsm/excelToolkit/hmi/Window.java | 8a3faf9bb99695c70f68b1be5e3781eb2ca14c37 | [] | no_license | fivestarmoon/ExcelToolkit | 2f5e7f78366cb1813039fa64eafc362a95501b53 | c3cb8e8f1d4d0fef829083801eb60884a8a19b85 | refs/heads/master | 2023-07-22T02:42:43.314932 | 2019-08-11T02:25:48 | 2019-08-11T02:25:48 | 150,911,276 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,319 | java | package fsm.excelToolkit.hmi
;
import java.awt.Container;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.*;
import java.io.File;
import java.io.IOException;
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
import fsm.common.FsmResources;
import fsm.common.Log;
import fsm.common.parameters.Parameters;
import fsm.common.utils.FileModifiedListener;
import fsm.common.utils.FileModifiedMonitor;
import fsm.excelToolkit.Main;
import fsm.excelToolkit.generic.GenericSheetPanel;
import fsm.excelToolkit.hmi.table.TableSpreadsheet;
import fsm.excelToolkit.jira.JiraSummaryPanel;
import fsm.excelToolkit.loading.LoadingSummaryPanel;
import fsm.excelToolkit.wpsr.WpsrSummaryPanel;
@SuppressWarnings("serial")
public class Window extends JFrame
implements WindowListener, DropTargetListener, FileModifiedListener
{
public void createAndShowGUI()
{
// Create and set up the window.
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Set the main window frame's title
setTitle("Excel Toolkit");
setResizable(true);
// Set the window size
setSize(new Dimension(700,700));
setLocation(new Point(100,100));
addWindowListener(this);
// Create the menu
JMenuBar menuBar = new JMenuBar();
// File menu
JMenu fileMenu = new JMenu("File");
fileMenu.setMnemonic(KeyEvent.VK_F);
// File > Open
{
JMenuItem menuItem = new JMenuItem(
"Open JSON file ...",
FsmResources.getIconResource("file_empty.png"));
menuItem.setMnemonic(KeyEvent.VK_O);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
JFileChooser chooser = new JFileChooser(".");
chooser.addChoosableFileFilter(new FileNameExtensionFilter("Excel tool kit files", "extk"));
chooser.addChoosableFileFilter(new FileNameExtensionFilter("Text files", "txt"));
int returnVal = chooser.showOpenDialog(Window.this);
if(returnVal == JFileChooser.APPROVE_OPTION)
{
processNewParameterFile(chooser.getSelectedFile().getAbsolutePath());
}
}
});
fileMenu.add(menuItem);
}
// File > Reload
{
JMenuItem menuItem = new JMenuItem(
"Reload JSON file",
FsmResources.getIconResource("program_refresh.png"));
menuItem.setMnemonic(KeyEvent.VK_R);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_MASK));
menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
if ( lastFile_.length() > 0 )
{
processNewParameterFile(lastFile_);
}
}
});
fileMenu.add(menuItem);
}
// File > Edit
{
JMenuItem menuItem = new JMenuItem(
"Edit JSON file ...",
FsmResources.getIconResource("file_paste.png"));
menuItem.setMnemonic(KeyEvent.VK_E);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK));
menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
try
{
if ( lastFile_.length() > 0 )
{
Desktop.getDesktop().open(new File(lastFile_));
}
}
catch (IOException e1)
{
Log.severe("Could not open file with desktop", e1);
}
}
});
fileMenu.add(menuItem);
}
// File > Exit
{
JMenuItem menuItem = new JMenuItem(
"Exit",
FsmResources.getIconResource("program_exit.png"));
menuItem.setMnemonic(KeyEvent.VK_X);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
Window.this.dispatchEvent(new WindowEvent(Window.this, WindowEvent.WINDOW_CLOSING));
}
});
fileMenu.add(menuItem);
}
// Help menu
JMenu helpMenu = new JMenu("Help");
helpMenu.setMnemonic(KeyEvent.VK_H);
// Help > View Log
{
JMenuItem menuItem = new JMenuItem(
"View log ...");
menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
try
{
Desktop.getDesktop().open(new File(Main.GetLogFileName_s()));
}
catch (IOException e1)
{
Log.severe("Could not open file with desktop", e1);
}
}
});
helpMenu.add(menuItem);
}
// Help > About
{
JMenuItem menuItem = new JMenuItem(
"About");
menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
JOptionPane.showMessageDialog(Window.this, "Excel Toolkit\nKurt Hagen\n" + Main.GetBuildDate_s());
}
});
helpMenu.add(menuItem);
}
// Add menus to the bar
menuBar.add(fileMenu);
menuBar.add(Box.createHorizontalGlue());
menuBar.add(helpMenu);
// Add menu bar
setJMenuBar(menuBar);
// Display the window.
title_ = "";
showContent(new JLabel("Nothing to display ..."));
setVisible(true);
}
public void showContent(Container content)
{
setTitle("Excel Toolkit [" + title_ + "]");
setContentPane(content);
new DropTarget(content, this);
revalidate();
repaint();
}
public void processNewParameterFile(String absolutePath)
{
try
{
// Update the working directory
File file = new File(absolutePath);
String path = file.getParent();
if ( path != null )
{
System.setProperty("user.dir", path);
}
if ( fileModifiedMonitor_ != null )
{
fileModifiedMonitor_.stop();
fileModifiedMonitor_ = null;
}
lastFile_ = absolutePath;
params_ = new Parameters(absolutePath);
if ( table_ != null )
{
table_.destroyTable();
}
String type = params_.getReader().getStringValue("type", "");
if ( "wpsr_summary".equalsIgnoreCase(type) )
{
setSize(new Dimension(
(int) params_.getReader().getLongValue("width", 700),
(int) params_.getReader().getLongValue("height", 700)));
title_ = new File(absolutePath).getName();
showContent(new JLabel("Loading WPSR summary ..."));
table_ = new WpsrSummaryPanel();
table_.createTable(this, params_); // eventually calls showContent
}
else if ( "loading".equalsIgnoreCase(type) )
{
setSize(new Dimension(
(int) params_.getReader().getLongValue("width", 700),
(int) params_.getReader().getLongValue("height", 700)));
title_ = new File(absolutePath).getName();
showContent(new JLabel("Loading spreadsheet loading ..."));
table_ = new LoadingSummaryPanel();
table_.createTable(this, params_); // eventually calls showContent
}
else if ( "jira_summary".equalsIgnoreCase(type) )
{
setSize(new Dimension(
(int) params_.getReader().getLongValue("width", 700),
(int) params_.getReader().getLongValue("height", 700)));
title_ = new File(absolutePath).getName();
showContent(new JLabel("Loading JIRA summary ..."));
table_ = new JiraSummaryPanel();
table_.createTable(this, params_); // eventually calls showContent
}
else if ( "spreadsheets".equalsIgnoreCase(type) )
{
setSize(new Dimension(
(int) params_.getReader().getLongValue("width", 700),
(int) params_.getReader().getLongValue("height", 700)));
title_ = new File(absolutePath).getName();
showContent(new JLabel("Loading generic spreadsheets ..."));
table_ = new GenericSheetPanel();
table_.createTable(this, params_); // eventually calls showContent
}
else
{
showContent(new JLabel("Did not recogonize json \"type\" [" + type + "]"));
}
}
catch (Exception e)
{
showContent(new JLabel("Error in json " + absolutePath + ". See log for more information."));
return;
}
fileModifiedMonitor_ = new FileModifiedMonitor(new File(absolutePath), this);
}
@Override
public void windowOpened(WindowEvent e)
{
}
@Override
public void windowClosing(WindowEvent e)
{
Log.info("closing window ...");
}
@Override
public void windowClosed(WindowEvent e)
{
Log.info("done.");
}
@Override
public void windowIconified(WindowEvent e)
{
}
@Override
public void windowDeiconified(WindowEvent e)
{
}
@Override
public void windowActivated(WindowEvent e)
{
}
@Override
public void windowDeactivated(WindowEvent e)
{
}
@Override
public void dragEnter(DropTargetDragEvent dtde)
{
}
@Override
public void dragOver(DropTargetDragEvent dtde)
{
}
@Override
public void dropActionChanged(DropTargetDragEvent dtde)
{
}
@Override
public void dragExit(DropTargetEvent dte)
{
}
@Override
public void drop(DropTargetDropEvent dtde)
{
try
{
// Ok, get the dropped object and try to figure out what it is
Transferable tr = dtde.getTransferable();
DataFlavor[] flavors = tr.getTransferDataFlavors();
for (int i = 0; i < flavors.length; i++)
{
System.out.println("Possible flavor: " + flavors[i].getMimeType());
// Check for file lists specifically
if (flavors[i].isFlavorJavaFileListType())
{
// Great! Accept copy drops...
dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
System.out.println("Successful file list drop.");
// And add the list of file names to our text area
@SuppressWarnings("unchecked")
java.util.List<Object> list = (java.util.List<Object>)tr.getTransferData(flavors[i]);
if ( list.size() >= 1)
{
String files[] = new String[list.size()];
for ( int ii=0; ii<files.length; ii++ )
{
files[ii] = list.get(ii).toString();
}
processNewParameterFile(files[0]);
dtde.dropComplete(true);
return;
}
}
}
// User must not have dropped a file list
Log.info("Drop failed: " + dtde);
dtde.rejectDrop();
}
catch (Exception e)
{
Log.severe("Drop exception: ", e);
}
}
@Override
public void fileModified()
{
SwingUtilities.invokeLater(
new Runnable()
{
public void run()
{
processNewParameterFile(lastFile_);
}
});
}
// PROTECTED
// PRIVATE
private Parameters params_;
private TableSpreadsheet table_;
private String title_ = "";
private String lastFile_ = "";
private FileModifiedMonitor fileModifiedMonitor_ = null;
}
| [
"[email protected]"
] | |
7cbfa7fe99a9d9e26681abc134c6bcc12e3f2bd1 | cfaa8a7cd0db41123849719c4be095f65927b22b | /read/src/main/java/com/read/mobile/beans/MultySearchRequest.java | ece6e4935af8dbfee32277b9f7a85a816cb81eeb | [] | no_license | wuyoujian0313/Read-android | 9ae543316a580bc4794732e54ad5abbffab70463 | ab8bd6a9efe7c7692fdc882ecb54a86f7d148310 | refs/heads/master | 2021-09-03T11:21:23.016544 | 2018-01-08T16:54:56 | 2018-01-08T16:54:56 | 110,246,410 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | package com.read.mobile.beans;
import com.ngc.corelib.http.bean.BaseRequest;
public class MultySearchRequest extends BaseRequest {
/**
*
*/
private static final long serialVersionUID = -7052993329468263369L;
private String age;// 年龄范围
private String type;// 图书类型
private String offset;//
private String length;//
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getOffset() {
return offset;
}
public void setOffset(String offset) {
this.offset = offset;
}
public String getLength() {
return length;
}
public void setLength(String length) {
this.length = length;
}
}
| [
"[email protected]"
] | |
fb377cc96526ff726d0af7e971ed01bf99316134 | 52214e49b30b28f063b85eb6ea307e17b931caa6 | /app/src/androidTest/java/com/example/derek/justjava/ApplicationTest.java | e853057ffc7af5c35bc8fcca0fe7642a3997d47d | [] | no_license | dhaughton99/JustJava_Test | 141f7c71b48734ab4a913aba7afa3738e6c1af98 | 867fd2bfaf3c102448f0e5a74441c25d96ca638d | refs/heads/master | 2021-01-10T12:02:04.092505 | 2016-01-16T21:44:34 | 2016-01-16T21:44:34 | 49,792,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package com.example.derek.justjava;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"[email protected]"
] | |
63237825382bd507b936491a45f747e862b5634e | 6d75d4faed98defc08e9ac9cd2cb47b79daa77cd | /achieve-parent/achieve-summary/src/main/java/com/wei/designmodel/construction/proxy/dynamicproxy/cglibproxy/CGlibMeipo.java | eaeb3d00914875c3d7081677dfb4af52e91fa453 | [] | no_license | xingxingtx/common-parent | e37763444332ddb2fbca4254a9012226ab48ed76 | a6b26cf88fc94943881b6cba2aecaf2b19a93755 | refs/heads/main | 2023-06-16T20:23:45.412285 | 2021-07-14T12:04:07 | 2021-07-14T12:04:07 | 352,091,214 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,154 | java | package com.wei.designmodel.construction.proxy.dynamicproxy.cglibproxy;
import org.springframework.cglib.proxy.Enhancer;
import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;
import java.lang.reflect.Method;
/**
* @Author wei.peng on 2019/3/11.
*/
public class CGlibMeipo implements MethodInterceptor {
public Object getInstance(Class<?> clazz) throws Exception{
//相当于Proxy,代理的工具类
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(clazz);
enhancer.setCallback(this);
return enhancer.create();
}
@Override
public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
before();
Object obj = methodProxy.invokeSuper(o,objects);
after();
return obj;
}
private void before(){
System.out.println("我是媒婆,我要给你找对象,现在已经确认你的需求");
System.out.println("开始物色");
}
private void after(){
System.out.println("OK的话,准备办事");
}
}
| [
"[email protected]"
] | |
42b5b8707da32323359a6020c609022eb390fd95 | c632be558f680f86b59ea15feddce48ea05a4f60 | /수정본_13/JiManagement/app/src/main/java/com/example/park/management/GalleryActivity.java | 5bec3bf7f815273fe64a41008fc0bafd45c7c44f | [] | no_license | jisung0920/project_alpa | 854ec9e6163d3b19032e287e5aae83e174b86172 | 9156faefb7ccb48c841d3e8846cffff2724659f6 | refs/heads/master | 2021-01-12T00:22:56.511593 | 2017-02-26T16:17:59 | 2017-02-26T16:17:59 | 78,716,251 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,545 | java | package com.example.park.management;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class GalleryActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gallery);
final WebView web = (WebView)findViewById(R.id.instaView);
final String instaURL="https://www.instagram.com/explore/tags/alpa1104/?hl=nl";
web.loadUrl(instaURL);
web.getSettings().setJavaScriptEnabled(true);
web.setWebViewClient(new WebViewClient());
web.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction()!=KeyEvent.ACTION_DOWN)
return true;
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (web.getUrl().equals(instaURL)){}
else if (web.canGoBack()) {
web.goBack();
}
return true;
}
return false;
}
});
}
public void imageClick(View v){
Intent intent = new Intent(GalleryActivity.this, MainActivity.class);
GalleryActivity.this.startActivity(intent);
}
}
| [
"[email protected]"
] | |
73e0ce7d11ee540b8b6568fcffdc3a20648e3f05 | d97af3db60df4fd365fefb9f761aea98441a87fa | /app/src/main/java/com/ximai/savingsmore/save/activity/IssueCommentActivity.java | a5bf92d50ccdf30e770d8785ce4af72f9de9f79b | [] | no_license | liufanglin/jianjian_shengyousheng | efd1eb3f070ff6ad1f206a7d1d90a0306ec6c353 | 763b1d45157e9c1011e92fd39e49471a7c91b3df | refs/heads/master | 2020-04-08T18:19:44.545286 | 2019-03-24T07:11:58 | 2019-03-24T07:11:58 | 159,603,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,649 | java | package com.ximai.savingsmore.save.activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.request.RequestOptions;
import com.ximai.savingsmore.R;
import com.ximai.savingsmore.library.net.MyAsyncHttpResponseHandler;
import com.ximai.savingsmore.library.net.RequestParamsPool;
import com.ximai.savingsmore.library.net.URLText;
import com.ximai.savingsmore.library.net.WebRequestHelper;
import com.ximai.savingsmore.library.toolbox.GsonUtils;
import com.ximai.savingsmore.save.common.BaseActivity;
import com.ximai.savingsmore.save.modle.Images;
import com.ximai.savingsmore.save.modle.UpPhoto;
import com.ximai.savingsmore.save.modle.UploadGoodsBean;
import com.ximai.savingsmore.save.view.GlideRoundTransform;
import com.ximai.savingsmore.save.view.MyGridView;
import com.ximai.savingsmore.save.view.imagepicker.PhotoPreviewActivity;
import com.ximai.savingsmore.save.view.imagepicker.PhotoSelectorActivity;
import com.ximai.savingsmore.save.view.imagepicker.model.PhotoModel;
import com.ximai.savingsmore.save.view.imagepicker.util.CommonUtils;
import com.ximai.savingsmore.save.view.imagepicker.util.Config;
import com.ximai.savingsmore.save.view.imagepicker.util.DbTOPxUtils;
import com.ximai.savingsmore.save.view.imagepicker.util.FileUtils;
import org.apache.http.Header;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by caojian on 16/12/1.
*/
public class IssueCommentActivity extends BaseActivity implements View.OnClickListener {
private ImageView cha, yiban, mangyi, henmangyi, qianglie;
private ImageView kouwei1, kouwei2, kouwei3, kouwei4, kouwei5;
private ImageView fuwu1, fuwu2, fuwu3, fuwu4, fuwu5;
private ImageView huanjing1, huanjing2, huanjing3, huanjing4, huanjing5;
private List<Images> images = new ArrayList<Images>();
private MyGridView my_goods_GV;
private String goodId;
private String productScore;
private String sellerScore1, sellerScore2, sellerScore3;
private String Content;
private boolean IsAnonymous;
private EditText comment_conent;
private TextView wenzi_number;
private ImageView select;
private RelativeLayout back;
private RelativeLayout title_right;
private int screen_widthOffset;
private GridImgAdapter gridImgAdapter;
private ArrayList<UploadGoodsBean> img_uri = new ArrayList<>();//方格图片展示的图片数据
private List<PhotoModel> single_photos = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.issue_comment_activity);
initView();
initData();
initEvent();
}
/**
* view
*/
private void initView() {
toolbar.setVisibility(View.GONE);
select = (ImageView) findViewById(R.id.select);
back = (RelativeLayout) findViewById(R.id.back);
title_right = (RelativeLayout) findViewById(R.id.title_right);
comment_conent = (EditText) findViewById(R.id.comment_conent);
wenzi_number = (TextView) findViewById(R.id.wenzi_number);
cha = (ImageView) findViewById(R.id.cha);
yiban = (ImageView) findViewById(R.id.yiban);
mangyi = (ImageView) findViewById(R.id.mangyi);
henmangyi = (ImageView) findViewById(R.id.henmangyi);
qianglie = (ImageView) findViewById(R.id.qinglie);
my_goods_GV = (MyGridView) findViewById(R.id.myGridview);
kouwei1 = (ImageView) findViewById(R.id.kouwei1);
kouwei2 = (ImageView) findViewById(R.id.kouwei2);
kouwei3 = (ImageView) findViewById(R.id.kouwei3);
kouwei4 = (ImageView) findViewById(R.id.kouwei4);
kouwei5 = (ImageView) findViewById(R.id.kouwei5);
fuwu1 = (ImageView) findViewById(R.id.fuwu1);
fuwu2 = (ImageView) findViewById(R.id.fuwu2);
fuwu3 = (ImageView) findViewById(R.id.fuwu3);
fuwu4 = (ImageView) findViewById(R.id.fuwu4);
fuwu5 = (ImageView) findViewById(R.id.fuwu5);
huanjing1 = (ImageView) findViewById(R.id.huanjing1);
huanjing2 = (ImageView) findViewById(R.id.huanjing2);
huanjing3 = (ImageView) findViewById(R.id.huanjing3);
huanjing4 = (ImageView) findViewById(R.id.huanjing4);
huanjing5 = (ImageView) findViewById(R.id.huanjing5);
}
/**
* event
*/
private void initEvent() {
select.setOnClickListener(this);
title_right.setOnClickListener(this);
back.setOnClickListener(this);
cha.setOnClickListener(this);
yiban.setOnClickListener(this);
henmangyi.setOnClickListener(this);
mangyi.setOnClickListener(this);
qianglie.setOnClickListener(this);
kouwei1.setOnClickListener(this);
kouwei2.setOnClickListener(this);
kouwei3.setOnClickListener(this);
kouwei4.setOnClickListener(this);
kouwei5.setOnClickListener(this);
fuwu1.setOnClickListener(this);
fuwu2.setOnClickListener(this);
fuwu3.setOnClickListener(this);
fuwu4.setOnClickListener(this);
fuwu5.setOnClickListener(this);
huanjing1.setOnClickListener(this);
huanjing2.setOnClickListener(this);
huanjing3.setOnClickListener(this);
huanjing4.setOnClickListener(this);
huanjing5.setOnClickListener(this);
comment_conent.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (comment_conent.length() <= 15) {
wenzi_number.setText("还需要输入" + (15 - comment_conent.length()) + "个字,即可发表");
} else {
wenzi_number.setText("还需要输入0个字,即可发表");
}
}
@Override
public void afterTextChanged(Editable s) {}
});
}
/**
* data
*/
private void initData() {
goodId = getIntent().getStringExtra("id");
gridImgAdapter = new GridImgAdapter();
/**
* grdview加载
*/
Config.ScreenMap = Config.getScreenSize(this, this);
WindowManager windowManager = getWindowManager();
Display display = windowManager.getDefaultDisplay();
screen_widthOffset = (display.getWidth() - (5* DbTOPxUtils.dip2px(this, 2)))/5;
my_goods_GV.setAdapter(gridImgAdapter);
img_uri.add(null);
gridImgAdapter.notifyDataSetChanged();
}
/**
* 事件处理
* @param v
*/
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.back:
finish();
break;
case R.id.title_right:
if (null != comment_conent) {
Content = comment_conent.getText().toString();
}
if (null != Content && Content.length() > 15) {
if (null != productScore && !TextUtils.isEmpty(productScore) && null != Content && !TextUtils.isEmpty(Content)) {
comitComment(goodId, productScore, sellerScore1, sellerScore2, sellerScore3, Content, images, IsAnonymous);
} else {
Toast.makeText(IssueCommentActivity.this, "信息没有填写完整", Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(IssueCommentActivity.this, "评论内容不能少于15个字", Toast.LENGTH_SHORT).show();
}
break;
case R.id.select:
if (IsAnonymous) {
select.setImageResource(R.mipmap.kuang);
IsAnonymous = false;
} else {
select.setImageResource(R.mipmap.select_kuang);
IsAnonymous = true;
}
break;
case R.id.cha:
productScore = "1";
cha.setBackgroundResource(R.mipmap.cha3);
yiban.setBackgroundResource(R.mipmap.yiban13);
mangyi.setBackgroundResource(R.mipmap.manyi13);
henmangyi.setBackgroundResource(R.mipmap.henmanyi13);
qianglie.setBackgroundResource(R.mipmap.qianglietuijian13);
break;
case R.id.yiban:
productScore = "2";
cha.setBackgroundResource(R.mipmap.cha13);
yiban.setBackgroundResource(R.mipmap.yiban3);
mangyi.setBackgroundResource(R.mipmap.manyi13);
henmangyi.setBackgroundResource(R.mipmap.henmanyi13);
qianglie.setBackgroundResource(R.mipmap.qianglietuijian13);
break;
case R.id.mangyi:
productScore = "3";
cha.setBackgroundResource(R.mipmap.cha13);
yiban.setBackgroundResource(R.mipmap.yiban13);
mangyi.setBackgroundResource(R.mipmap.manyi3);
henmangyi.setBackgroundResource(R.mipmap.henmanyi13);
qianglie.setBackgroundResource(R.mipmap.qianglietuijian13);
break;
case R.id.henmangyi:
productScore = "4";
cha.setBackgroundResource(R.mipmap.cha13);
yiban.setBackgroundResource(R.mipmap.yiban13);
mangyi.setBackgroundResource(R.mipmap.manyi13);
henmangyi.setBackgroundResource(R.mipmap.henmanyi3);
qianglie.setBackgroundResource(R.mipmap.qianglietuijian13);
break;
case R.id.qinglie:
productScore = "5";
cha.setBackgroundResource(R.mipmap.cha13);
yiban.setBackgroundResource(R.mipmap.yiban13);
mangyi.setBackgroundResource(R.mipmap.manyi13);
henmangyi.setBackgroundResource(R.mipmap.henmanyi13);
qianglie.setBackgroundResource(R.mipmap.qianglietuijian3);
break;
case R.id.kouwei1:
sellerScore1 = "1";
kouwei1.setBackgroundResource(R.mipmap.xiaolian3);
kouwei2.setBackgroundResource(R.mipmap.xiaolian13);
kouwei3.setBackgroundResource(R.mipmap.xiaolian13);
kouwei4.setBackgroundResource(R.mipmap.xiaolian13);
kouwei5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.kouwei2:
sellerScore1 = "2";
kouwei1.setBackgroundResource(R.mipmap.xiaolian3);
kouwei2.setBackgroundResource(R.mipmap.xiaolian3);
kouwei3.setBackgroundResource(R.mipmap.xiaolian13);
kouwei4.setBackgroundResource(R.mipmap.xiaolian13);
kouwei5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.kouwei3:
sellerScore1 = "3";
kouwei1.setBackgroundResource(R.mipmap.xiaolian3);
kouwei2.setBackgroundResource(R.mipmap.xiaolian3);
kouwei3.setBackgroundResource(R.mipmap.xiaolian3);
kouwei4.setBackgroundResource(R.mipmap.xiaolian13);
kouwei5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.kouwei4:
sellerScore1 = "4";
kouwei1.setBackgroundResource(R.mipmap.xiaolian3);
kouwei2.setBackgroundResource(R.mipmap.xiaolian3);
kouwei3.setBackgroundResource(R.mipmap.xiaolian3);
kouwei4.setBackgroundResource(R.mipmap.xiaolian3);
kouwei5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.kouwei5:
sellerScore1 = "5";
kouwei1.setBackgroundResource(R.mipmap.xiaolian3);
kouwei2.setBackgroundResource(R.mipmap.xiaolian3);
kouwei3.setBackgroundResource(R.mipmap.xiaolian3);
kouwei4.setBackgroundResource(R.mipmap.xiaolian3);
kouwei5.setBackgroundResource(R.mipmap.xiaolian3);
break;
case R.id.fuwu1:
sellerScore2 = "1";
fuwu1.setBackgroundResource(R.mipmap.xiaolian3);
fuwu2.setBackgroundResource(R.mipmap.xiaolian13);
fuwu3.setBackgroundResource(R.mipmap.xiaolian13);
fuwu4.setBackgroundResource(R.mipmap.xiaolian13);
fuwu5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.fuwu2:
sellerScore2 = "2";
fuwu1.setBackgroundResource(R.mipmap.xiaolian3);
fuwu2.setBackgroundResource(R.mipmap.xiaolian3);
fuwu3.setBackgroundResource(R.mipmap.xiaolian13);
fuwu4.setBackgroundResource(R.mipmap.xiaolian13);
fuwu5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.fuwu3:
sellerScore2 = "3";
fuwu1.setBackgroundResource(R.mipmap.xiaolian3);
fuwu2.setBackgroundResource(R.mipmap.xiaolian3);
fuwu3.setBackgroundResource(R.mipmap.xiaolian3);
fuwu4.setBackgroundResource(R.mipmap.xiaolian13);
fuwu5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.fuwu4:
sellerScore2 = "4";
fuwu1.setBackgroundResource(R.mipmap.xiaolian3);
fuwu2.setBackgroundResource(R.mipmap.xiaolian3);
fuwu3.setBackgroundResource(R.mipmap.xiaolian3);
fuwu4.setBackgroundResource(R.mipmap.xiaolian3);
fuwu5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.fuwu5:
sellerScore2 = "5";
fuwu1.setBackgroundResource(R.mipmap.xiaolian3);
fuwu2.setBackgroundResource(R.mipmap.xiaolian3);
fuwu3.setBackgroundResource(R.mipmap.xiaolian3);
fuwu4.setBackgroundResource(R.mipmap.xiaolian3);
fuwu5.setBackgroundResource(R.mipmap.xiaolian3);
break;
case R.id.huanjing1:
sellerScore3 = "1";
huanjing1.setBackgroundResource(R.mipmap.xiaolian3);
huanjing2.setBackgroundResource(R.mipmap.xiaolian13);
huanjing3.setBackgroundResource(R.mipmap.xiaolian13);
huanjing4.setBackgroundResource(R.mipmap.xiaolian13);
huanjing5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.huanjing2:
sellerScore3 = "2";
huanjing1.setBackgroundResource(R.mipmap.xiaolian3);
huanjing2.setBackgroundResource(R.mipmap.xiaolian3);
huanjing3.setBackgroundResource(R.mipmap.xiaolian13);
huanjing4.setBackgroundResource(R.mipmap.xiaolian13);
huanjing5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.huanjing3:
sellerScore3 = "3";
huanjing1.setBackgroundResource(R.mipmap.xiaolian3);
huanjing2.setBackgroundResource(R.mipmap.xiaolian3);
huanjing3.setBackgroundResource(R.mipmap.xiaolian3);
huanjing4.setBackgroundResource(R.mipmap.xiaolian13);
huanjing5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.huanjing4:
sellerScore3 = "4";
huanjing1.setBackgroundResource(R.mipmap.xiaolian3);
huanjing2.setBackgroundResource(R.mipmap.xiaolian3);
huanjing3.setBackgroundResource(R.mipmap.xiaolian3);
huanjing4.setBackgroundResource(R.mipmap.xiaolian3);
huanjing5.setBackgroundResource(R.mipmap.xiaolian13);
break;
case R.id.huanjing5:
sellerScore3 = "5";
huanjing1.setBackgroundResource(R.mipmap.xiaolian3);
huanjing2.setBackgroundResource(R.mipmap.xiaolian3);
huanjing3.setBackgroundResource(R.mipmap.xiaolian3);
huanjing4.setBackgroundResource(R.mipmap.xiaolian3);
huanjing5.setBackgroundResource(R.mipmap.xiaolian3);
break;
}
}
/**
* 回调
* @param requestCode
* @param resultCode
* @param data
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
File srcFile = null;
File outPutFile = null;
Bitmap bm = null;
File temFile = null;
switch (requestCode) {
case 0: //店铺方格图片进行回调
if (data != null) {
List<String> paths = (List<String>) data.getExtras().getSerializable("photos");
if (img_uri.size() > 0) {
img_uri.remove(img_uri.size() - 1);
}
for (int i = 0; i < paths.size(); i++) {
img_uri.add(new UploadGoodsBean(paths.get(i), false));
//上传参数
}
for (int i = 0; i < paths.size(); i++) {
PhotoModel photoModel = new PhotoModel();
photoModel.setOriginalPath(paths.get(i));
photoModel.setChecked(true);
single_photos.add(photoModel);
}
if (img_uri.size() < 3) {
img_uri.add(null);
}
gridImgAdapter.notifyDataSetChanged();
/**
* 上传照片 -获取到本地的图片路径 - 转换成file - 进行上传
*/
if (paths.size() > 0) {
for (int i = 0; i < paths.size(); i++) {
upLoadImage(new File(paths.get(i)), "Comment");
}
}
}
break;
}
super.onActivityResult(requestCode, resultCode, data);
}
/**
* 提交评论
* @param Id
* @param ProductScore
* @param SellerScore
* @param SellerScore2
* @param SellerScore3
* @param Content
* @param images
* @param isAnonymous
*/
private void comitComment(String Id, String ProductScore, String SellerScore, String SellerScore2, String SellerScore3,
String Content, final List<Images> images, boolean isAnonymous) {
WebRequestHelper.json_post(IssueCommentActivity.this, URLText.SUBMIT_COMMENT, RequestParamsPool.submitComment(Id, ProductScore, SellerScore, SellerScore2, SellerScore3, Content, images, isAnonymous), new MyAsyncHttpResponseHandler(IssueCommentActivity.this) {
@Override
public void onResponse(int statusCode, Header[] headers, byte[] responseBody) {
JSONObject object = null;
try {
object = new JSONObject(new String(responseBody));
String IsSuccess = object.getString("IsSuccess");
String message = object.optString("Message");
if (IsSuccess.equals("true")) {
Intent intent = new Intent(IssueCommentActivity.this, CommentSuccessActivity.class);
if (images.size() > 0) {
intent.putExtra("jifen", "2");
}
startActivity(intent);
finish();
}
Toast.makeText(IssueCommentActivity.this, message, Toast.LENGTH_SHORT).show();
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
/**
* 上传图片
* @param file
* @param type
*/
private void upLoadImage(File file, final String type) {
// a++;
WebRequestHelper.post(URLText.UPLOAD_IMAGE, RequestParamsPool.upLoad(file, type), new MyAsyncHttpResponseHandler(IssueCommentActivity.this) {
@Override
public void onResponse(int statusCode, Header[] headers, byte[] responseBody) {
String result = new String(responseBody);
try {
// b++;
JSONObject jsonObject = new JSONObject(result);
UpPhoto upPhoto = GsonUtils.fromJson(jsonObject.optString("MainData"), UpPhoto.class);
Images images1 = new Images();
images1.ImageId = upPhoto.Id;
images1.ImagePath = upPhoto.FilePath;
images1.SortNo = upPhoto.SortNo;
images.add(images1);
gridImgAdapter.notifyDataSetChanged();
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
/**
* 方格店铺照片
*/
class GridImgAdapter extends BaseAdapter implements ListAdapter {
@Override
public int getCount() {
return img_uri.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
convertView = LayoutInflater.from(IssueCommentActivity.this).inflate(R.layout.activity_addstory_img_item, null);
ViewHolder holder;
if(convertView!=null){
holder = new ViewHolder();
convertView = LayoutInflater.from(IssueCommentActivity.this).inflate(R.layout.activity_addstory_img_item,null);
convertView.setTag(holder);
}else{
holder = (ViewHolder) convertView.getTag();
}
holder.add_IB = (ImageView) convertView.findViewById(R.id.add_IB);
holder.delete_IV = (ImageView) convertView.findViewById(R.id.delete_IV);
AbsListView.LayoutParams param = new AbsListView.LayoutParams(screen_widthOffset, screen_widthOffset);
convertView.setLayoutParams(param);
RequestOptions options = new RequestOptions()
.centerCrop()
// .placeholder(R.mipmap.head_image)
// .error(R.mipmap.ic_launcher)
.priority(Priority.HIGH)
.transform(new GlideRoundTransform(IssueCommentActivity.this,5)).diskCacheStrategy(DiskCacheStrategy.ALL);
if (img_uri.get(position) == null) {
holder.delete_IV.setVisibility(View.GONE);
Glide.with(IssueCommentActivity.this).load(R.mipmap.achieve_icon_addphoto_default)
.apply(options).into(holder.add_IB);
holder.add_IB.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(IssueCommentActivity.this, PhotoSelectorActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.putExtra("limit", 3 - (img_uri.size() - 1));
startActivityForResult(intent, 0);
}
});
} else {
Glide.with(IssueCommentActivity.this).load(img_uri.get(position).getUrl())
.apply(options).into(holder.add_IB);
holder.delete_IV.setOnClickListener(new View.OnClickListener() {
private boolean is_addNull;
@Override
public void onClick(View arg0) {
is_addNull = true;
String img_url = img_uri.remove(position).getUrl();
for (int i = 0; i < img_uri.size(); i++) {
if (img_uri.get(i) == null) {
is_addNull = false;
continue;
}
}
if (is_addNull) {
img_uri.add(null);
}
FileUtils.DeleteFolder(img_url);//删除在emulate/0文件夹生成的图片
images.remove(position);//这里添加对应的店铺展示图片集合
gridImgAdapter.notifyDataSetChanged();
}
});
holder.add_IB.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putSerializable("photos",(Serializable)single_photos);
bundle.putInt("position", position);
bundle.putBoolean("isSave",false);
CommonUtils.launchActivity(IssueCommentActivity.this, PhotoPreviewActivity.class, bundle);
}
});
}
return convertView;
}
class ViewHolder {
ImageView add_IB;
ImageView delete_IV;
}
}
} | [
"[email protected]"
] | |
7b57449a83c88c3a97397ac1518d7e59b82f71c7 | 1aecbb6166b090e749054fe7b92bced0227268dd | /ProyectoWebSenaSalud/src/entidades/Usuario.java | 5e170544bae90ac9780585f7fcb76ef48698cdc1 | [] | no_license | dahianaGrajales08/Sena-Salud | 60d6dc15c9b94729f8938dca57670d5b75463150 | c0b53e92e962a79f5c6fb7f38ce1ceb18c9b62ee | refs/heads/master | 2021-01-23T13:29:00.874898 | 2017-11-14T21:46:16 | 2017-11-14T21:46:16 | 102,663,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,513 | java | package entidades;
// Generated 28-ago-2017 10:11:09 by Hibernate Tools 5.2.0.CR1
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
* Usuario generated by hbm2java
*/
@Entity
@Table(name = "usuario", catalog = "bd_aprendices")
public class Usuario implements java.io.Serializable {
private int uno;
private Integer codigo;
private String user;
private String pass;
private boolean editable;
public Usuario() {
}
public Usuario(String user, String pass) {
this.user = user;
this.pass = pass;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "codigo", unique = true, nullable = false)
public Integer getCodigo() {
return this.codigo;
}
public void setCodigo(Integer codigo) {
this.codigo = codigo;
}
@Column(name = "user", nullable = false, length = 15)
public String getUser() {
return this.user;
}
public void setUser(String user) {
this.user = user;
}
@Column(name = "pass", nullable = false, length = 15)
public String getPass() {
return this.pass;
}
public void setPass(String pass) {
this.pass = pass;
}
@Transient
public boolean isEditable() {
return editable;
}
public void setEditable(boolean editable) {
this.editable = editable;
}
}
| [
"dahiana [email protected]"
] | dahiana [email protected] |
ffd34fbef71a809ab073315eeac997b60caf9b9f | 112f026ccd9b19f13440eb4707e39d1aad869647 | /back-end/src/main/java/amanda/biagi/unit/controllers/UserInfoController.java | fdf6c3d771fb210f467ef688a7efb8043f25f127 | [] | no_license | amandabiagi/UNIT | 412d9f1c3d7c5008e5e2bab101ff8846d801f85d | 80c32b912c3bb4834b9b39e4279dfdf203166ea1 | refs/heads/master | 2023-08-17T21:40:23.439169 | 2021-10-27T15:24:46 | 2021-10-27T15:24:46 | 419,788,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,307 | java | package amanda.biagi.unit.controllers;
import amanda.biagi.unit.models.Documento;
import amanda.biagi.unit.models.InfoUser;
import amanda.biagi.unit.models.UserDoc;
import amanda.biagi.unit.repositories.DocumentoRepository;
import amanda.biagi.unit.repositories.InfoUserRepository;
import amanda.biagi.unit.service.InfoUserService;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.websocket.server.PathParam;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@CrossOrigin(origins = "*", allowedHeaders = "*")
@RestController
@RequestMapping("/info")
public class UserInfoController {
private Integer idDoc = 0;
List<InfoUser> listaHomologacao = new ArrayList<>();
List<UserDoc> listaUserDoc = new ArrayList<>();
// List<Documento> listaDocumentos = new ArrayList<>();
@Autowired
public InfoUserRepository infoUserRepository;
@Autowired
public DocumentoRepository documentoRepository;
@Autowired
public InfoUserService infoUserService;
@PostMapping("/enviar")
public ResponseEntity<List<UserDoc>> enviar( @RequestParam String infoUserStr, MultipartFile pdf){
//Recebendo uma string por parametro e transformando em um objeto json
JSONObject jsonObject = new JSONObject(infoUserStr);
//Convertendo o objeto json em um objeto.
UserDoc userDoc = new UserDoc(jsonObject.getLong("ra"),
jsonObject.getString("nomeAluno"),
jsonObject.getString("quantidadeHoras"),
jsonObject.getString("atividade"));
userDoc.setNomeDocumento(pdf.getOriginalFilename());
idDoc ++;
userDoc.setId(idDoc);
listaUserDoc.add(userDoc);
infoUserService.salvarPDF(pdf);
return ResponseEntity.created(null).body(listaUserDoc);
}
@GetMapping("/exibir")
public ResponseEntity exibir(){
if (listaUserDoc.isEmpty()){
return ResponseEntity.noContent().build();
}
return ResponseEntity.ok(listaUserDoc);
}
@PostMapping("/salvar")
public ResponseEntity salvar(@RequestBody List<UserDoc> userDocs){
InfoUser infoUser = new InfoUser();
Documento documento = new Documento();
if (userDocs.isEmpty()){
return ResponseEntity.noContent().build();
}
for (UserDoc userDoc: userDocs) {
//Criando um documento
documento.setId(userDoc.getId());
documento.setNomeDocumento(userDoc.getNomeDocumento());
documento.setAtividade(userDoc.getAtividade());
documento.setQuantidadeHoras(userDoc.getQuantidadeHoras());
documento.setHomologado(userDoc.getHomologado());
//Criando um usuário
infoUser.setNomeAluno(userDoc.getNomeAluno());
infoUser.setRa(userDoc.getRa());
//Criando o relacionamento
documento.setFkAluno(infoUser);
infoUserRepository.save(infoUser);
documentoRepository.save(documento);
listaUserDoc.removeIf(u -> Objects.equals(u.getId(), userDoc.getId()));
}
return ResponseEntity.accepted().body(listaUserDoc);
}
@GetMapping(value = "/download/{nomeDoc}", produces = "application/pdf")
public ResponseEntity baixar(@PathVariable String nomeDoc) throws FileNotFoundException {
String caminho = ("src/main/resources/static/imagem/") + nomeDoc;
HttpHeaders headers = new HttpHeaders();
return new ResponseEntity( new FileSystemResource(caminho), headers, HttpStatus.OK);
}
@GetMapping("buscar-ra/")
public ResponseEntity buscarRa(@RequestParam String ra){
InfoUser infoUser = infoUserRepository.findByRa(Long.parseLong(ra));
if (infoUser == null){
return ResponseEntity.noContent().build();
}
return ResponseEntity.ok(infoUser);
}
}
| [
"[email protected]"
] | |
6864359d8f012caf7f68b798067612f82bc94228 | ed1fa5ecd717b065b617f75de1e7be430c7f18cd | /SmartDelivery(Final)/src/com/frame/OrDependenciesBiz.java | b658050b7a605d6e10a163dc208ed5e73ab4c408 | [] | no_license | bookkg2/Smart_Delivery_plus | 8c4a6c08f308b5aa11ebbbefd9182e3d85073a77 | 0de23b26320244bed7cedaf4cdf4dffec3a7aa07 | refs/heads/master | 2022-12-24T21:18:35.997094 | 2019-11-07T08:45:52 | 2019-11-07T08:45:52 | 213,577,656 | 1 | 1 | null | 2022-12-16T07:48:41 | 2019-10-08T07:36:33 | CSS | UTF-8 | Java | false | false | 613 | java | package com.frame;
import java.util.ArrayList;
import org.springframework.transaction.annotation.Transactional;
import com.vo.Order;
public interface OrDependenciesBiz<K,V> {
@Transactional
public void register(V v) throws Exception;
@Transactional
public void modify(V v) throws Exception;
@Transactional
public void remove(K k) throws Exception;
public ArrayList<V> get(K k) throws Exception;
public ArrayList<V> get() throws Exception;
//Specialized
public V oidmaxselect() throws Exception;
public V select_oid(String obj) throws Exception;
public V select_rec(String obj) throws Exception;
}
| [
"[email protected]"
] | |
22e12f3ee40080514570abf1620bb61c577554a7 | ab4a854c69dc9c7e37f57fc2a21a11cd87743d86 | /test/java/org/testory/TestComparingArrays.java | 5c01bc38e6158566b5eabc426cde7088b4d88494 | [
"Apache-2.0"
] | permissive | maciejmikosik/testory | 03b1c685aa889e31af5132ce9deabbe7a90c9cbc | 558523be532bfe0667b9398d7ad405f4c37a3dbf | refs/heads/master | 2022-04-03T21:41:05.060666 | 2018-02-22T23:20:27 | 2018-02-22T23:21:05 | 13,142,766 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,027 | java | package org.testory;
import static org.junit.Assert.assertSame;
import static org.testory.Testory.a;
import static org.testory.Testory.given;
import static org.testory.Testory.mock;
import static org.testory.Testory.thenCalled;
import static org.testory.Testory.thenEqual;
import static org.testory.Testory.thenReturned;
import static org.testory.Testory.when;
import static org.testory.Testory.willReturn;
import static org.testory.testing.Fakes.newObject;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
public class TestComparingArrays {
private List<?> mock;
private int index;
private Object object;
@Before
public void before() {
mock = mock(List.class);
index = 123;
object = newObject("object");
}
@Test
public void then_equals_uses_deep_equals() {
thenEqual(new Object[] { new Object[] { object } }, new Object[] { new Object[] { object } });
}
@Test
public void then_returned_uses_deep_equals() {
when(new Object[] { new Object[] { object } });
thenReturned(new Object[] { new Object[] { object } });
}
@Test
public void matcherizing_during_stubbing_uses_deep_equals() {
given(willReturn(index), mock).indexOf(new Object[] { new Object[] { object } });
assertSame(index, mock.indexOf(new Object[] { new Object[] { object } }));
}
@Test
public void matcherizing_during_stubbing_with_any_uses_deep_equals() {
given(willReturn(index), mock).indexOf(a(new Object[] { new Object[] { object } }));
assertSame(index, mock.indexOf(new Object[] { new Object[] { object } }));
}
@Test
public void matcherizing_during_verification_uses_deep_equals() {
mock.indexOf(new Object[] { new Object[] { object } });
thenCalled(mock).indexOf(new Object[] { new Object[] { object } });
}
@Test
public void matcherizing_during_verification_with_any_uses_deep_equals() {
mock.indexOf(new Object[] { new Object[] { object } });
thenCalled(mock).indexOf(a(new Object[] { new Object[] { object } }));
}
}
| [
"[email protected]"
] | |
8a39782e891ca3ffe2730ed998c553593ee937fe | 09ad36fff996f4ab37cbac3d34c2143d33e8631d | /mq-client/src/main/java/com/qiuxs/rmq/log/dao/TransRevcDao.java | 4a37f58b4e26b3a59085494983bdd18363dd29e9 | [
"Apache-2.0"
] | permissive | largeTree/cute-framework | bd374d688ae88b16cf911ff03bdb6c6921d7e9c4 | 8c4924c144681d5d48ec331eb647fecc99b774e4 | refs/heads/master | 2021-06-01T10:38:57.318987 | 2021-01-14T05:03:50 | 2021-01-14T05:03:50 | 115,576,933 | 0 | 0 | Apache-2.0 | 2021-01-14T05:03:51 | 2017-12-28T02:36:59 | Java | UTF-8 | Java | false | false | 268 | java | package com.qiuxs.rmq.log.dao;
import com.qiuxs.cuteframework.tech.mybatis.dao.MyBatisRepository;
import com.qiuxs.rmq.log.entity.TransRevc;
@MyBatisRepository
public interface TransRevcDao {
public void insert(TransRevc bean);
public void get(Long txId);
}
| [
"[email protected]"
] | |
54d571e2baf7e02dd7f907a044cc43e4771b5a4a | 03ecfb945a3971024b45d92d277e1c7a718daa9b | /src/main/java/com/soict/reviewshopfood/dao/ILikeDAO.java | b1190e16e9825b9b7f75c7fea549befd6de496fa | [] | no_license | VincentLong73/Review-Shop-Food | 010f0ab425ad2e5d4d3412399fff9345d47e88e8 | 00a7ea509fd9898953f7a3734b88bc322e152802 | refs/heads/master | 2023-02-26T02:04:57.155007 | 2021-01-19T04:20:02 | 2021-01-19T04:20:02 | 318,532,268 | 0 | 0 | null | 2021-01-19T04:20:04 | 2020-12-04T13:57:00 | Java | UTF-8 | Java | false | false | 426 | java | package com.soict.reviewshopfood.dao;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.soict.reviewshopfood.entity.Liked;
@Repository
@Transactional
public interface ILikeDAO extends JpaRepository<Liked, Integer>{
List<Liked> getLikedByCommentId(int commentId);
}
| [
"[email protected]"
] | |
68fc4199506d4698020682567d476ef73b4bf273 | 284b8f72bb4a29bc47286e634cc1be19baf58e1c | /de/folt/models/applicationmodel/guimodel/support/OpenTMSStyleRangeProperty.java | 994f7b456f0279a482e8766e6201978cdd4159d2 | [] | no_license | MittagQI/src | be708b8a204a6916e5b84fadcc6aac41494c6ab6 | c4b1efe4845a559d5eeb88ce8efb1047622bc193 | refs/heads/master | 2021-01-24T04:08:40.447496 | 2014-01-15T07:19:12 | 2014-01-15T07:19:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,133 | java | /*
* Created on 06.10.2009
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package de.folt.models.applicationmodel.guimodel.support;
/**
* This class implements simple properties for a StyleRange. Currently it just
* supports the type bEditable, this determines if a given Style Range can be
* edited or not. Default is false
*
* @author klemens
*/
public class OpenTMSStyleRangeProperty
{
/**
* main
*
* @param args
*/
public static void main(String[] args)
{
}
private boolean bEditable = false;
/**
* @param editable
* the bEditable to set - set to true if style range is editable
*/
public OpenTMSStyleRangeProperty(boolean editable)
{
super();
bEditable = editable;
}
/**
* @return the bEditable - is this an editable StyleRange? True if yes
*/
public boolean isBEditable()
{
return bEditable;
}
/**
* @param editable
* the bEditable to set - set to true if style range is editable
*/
public void setBEditable(boolean editable)
{
bEditable = editable;
}
}
| [
"[email protected]"
] | |
e52916ccda0389db154647e5180293c617ea1efd | 3aa6ef4ec0b52c5d8a1a34ec5d99a640bfe086e3 | /BackEnd/Advance/Spring/springcore/src/main/java/com/capgemini/springcore/interfaces/Animal.java | 42871cb44b64b13fe9add5033b6a311a27f02a82 | [] | no_license | jagnish1998/TY_CG_HTD_PuneMumbai_JFS_JagnishSharma | 7f37251e437119dd1381f9e34fd0ec9f61f7f0fa | 4b1f28bcdc020f840418491fedf08e0fe0974f6d | refs/heads/master | 2023-01-14T12:06:02.282243 | 2019-12-22T06:05:39 | 2019-12-22T06:05:39 | 225,846,035 | 0 | 0 | null | 2023-01-07T12:37:41 | 2019-12-04T11:00:47 | JavaScript | UTF-8 | Java | false | false | 138 | java | package com.capgemini.springcore.interfaces;
public interface Animal {
public void eat();
public void speak();
public void walk();
}
| [
"[email protected]"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.