blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 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 684M โ | 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 132
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 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dcf13a0ad5a720d4cc4a92e53f0a8282c6ea5562 | 0a2eb4ab0bbe0030e496e0b47420700c41a72b88 | /tests/org.openhealthtools.mdht.uml.cda.consol2.tests/src/test/java/org/openhealthtools/mdht/uml/cda/consol/tests/EncountersSection2Test.java | e4de7d673b5bab14af08091e52b351e5f12e5d1b | [] | no_license | jlyle1/mdht-models | a3c4ac734f8675831a67dd38e5ddf697ca50182b | c9251bc2d845abb8bbc40e7dc08f266c8ca2466f | refs/heads/develop | 2021-01-21T09:06:23.781479 | 2015-08-21T04:08:39 | 2015-08-21T04:08:39 | 37,085,312 | 0 | 0 | null | 2015-06-08T18:35:33 | 2015-06-08T18:35:32 | null | UTF-8 | Java | false | false | 12,653 | java | /*******************************************************************************
* Copyright (c) 2014 Dan Brown and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dan Brown (Audacious Inquiry) - initial API and implementation
* - additional testing code
*******************************************************************************/
package org.openhealthtools.mdht.uml.cda.consol.tests;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.ecore.EObject;
import org.junit.Test;
import org.openhealthtools.mdht.uml.cda.CDAFactory;
import org.openhealthtools.mdht.uml.cda.StrucDocText;
import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory;
import org.openhealthtools.mdht.uml.cda.consol.EncountersSection2;
import org.openhealthtools.mdht.uml.cda.consol.operations.EncountersSection2Operations;
import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest;
import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory;
import org.openhealthtools.mdht.uml.hl7.datatypes.ST;
/**
* <!-- begin-user-doc -->
* A static utility class that provides operations related to '<em><b>Encounters Section2</b></em>' model objects.
* <!-- end-user-doc -->
*
* <p>
* The following operations are supported:
* <ul>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#validateEncountersSection2NullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Encounters Section2 Null Flavor</em>}</li>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#validateEncountersSection2Text(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Encounters Section2 Text</em>}</li>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#validateEncountersSection2Title(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Encounters Section2 Title</em>}</li>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#validateEncountersSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Encounters Section Entries Optional Template Id</em>}</li>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#validateEncountersSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Encounters Section Entries Optional Code P</em>}</li>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#validateEncountersSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Encounters Section Entries Optional Code</em>}</li>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#validateEncountersSectionEntriesOptionalEncounterActivity2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Validate Encounters Section Entries Optional Encounter Activity2</em>}</li>
* <li>{@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection2#getConsolEncounterActivity2s() <em>Get Consol Encounter Activity2s</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class EncountersSection2Test extends CDAValidationTest {
/**
*
* @generated
*/
@Test
public void testValidateEncountersSection2NullFlavor() {
OperationsTestCase<EncountersSection2> validateEncountersSection2NullFlavorTestCase = new OperationsTestCase<EncountersSection2>(
"validateEncountersSection2NullFlavor",
operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION2_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"),
objectFactory) {
@Override
protected void updateToFail(EncountersSection2 target) {
}
@Override
protected void updateToPass(EncountersSection2 target) {
target.init();
}
@Override
protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) {
return EncountersSection2Operations.validateEncountersSection2NullFlavor(
(EncountersSection2) objectToTest, diagnostician, map);
}
};
validateEncountersSection2NullFlavorTestCase.doValidationTest();
}
/**
*
* @generated NOT
*/
@Test
public void testValidateEncountersSection2Text() {
OperationsTestCase<EncountersSection2> validateEncountersSection2TextTestCase = new OperationsTestCase<EncountersSection2>(
"validateEncountersSection2Text",
operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION2_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"),
objectFactory) {
@Override
protected void updateToFail(EncountersSection2 target) {
}
@Override
protected void updateToPass(EncountersSection2 target) {
target.init();
StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText();
target.setText(text);
}
@Override
protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) {
return EncountersSection2Operations.validateEncountersSection2Text(
(EncountersSection2) objectToTest, diagnostician, map);
}
};
validateEncountersSection2TextTestCase.doValidationTest();
}
/**
*
* @generated
*/
@Test
public void testValidateEncountersSection2Title() {
OperationsTestCase<EncountersSection2> validateEncountersSection2TitleTestCase = new OperationsTestCase<EncountersSection2>(
"validateEncountersSection2Title",
operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION2_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"),
objectFactory) {
@Override
protected void updateToFail(EncountersSection2 target) {
}
@Override
protected void updateToPass(EncountersSection2 target) {
target.init();
ST title = DatatypesFactory.eINSTANCE.createST("title");
target.setTitle(title);
}
@Override
protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) {
return EncountersSection2Operations.validateEncountersSection2Title(
(EncountersSection2) objectToTest, diagnostician, map);
}
};
validateEncountersSection2TitleTestCase.doValidationTest();
}
/**
*
* @generated
*/
@Test
public void testValidateEncountersSectionEntriesOptionalTemplateId() {
OperationsTestCase<EncountersSection2> validateEncountersSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase<EncountersSection2>(
"validateEncountersSectionEntriesOptionalTemplateId",
operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"),
objectFactory) {
@Override
protected void updateToFail(EncountersSection2 target) {
}
@Override
protected void updateToPass(EncountersSection2 target) {
target.init();
}
@Override
protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) {
return EncountersSection2Operations.validateEncountersSectionEntriesOptionalTemplateId(
(EncountersSection2) objectToTest, diagnostician, map);
}
};
validateEncountersSectionEntriesOptionalTemplateIdTestCase.doValidationTest();
}
/**
*
* @generated
*/
@Test
public void testValidateEncountersSectionEntriesOptionalCodeP() {
OperationsTestCase<EncountersSection2> validateEncountersSectionEntriesOptionalCodePTestCase = new OperationsTestCase<EncountersSection2>(
"validateEncountersSectionEntriesOptionalCodeP",
operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"),
objectFactory) {
@Override
protected void updateToFail(EncountersSection2 target) {
}
@Override
protected void updateToPass(EncountersSection2 target) {
target.init();
}
@Override
protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) {
return EncountersSection2Operations.validateEncountersSectionEntriesOptionalCodeP(
(EncountersSection2) objectToTest, diagnostician, map);
}
};
validateEncountersSectionEntriesOptionalCodePTestCase.doValidationTest();
}
/**
*
* @generated
*/
@Test
public void testValidateEncountersSectionEntriesOptionalCode() {
OperationsTestCase<EncountersSection2> validateEncountersSectionEntriesOptionalCodeTestCase = new OperationsTestCase<EncountersSection2>(
"validateEncountersSectionEntriesOptionalCode",
operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"),
objectFactory) {
@Override
protected void updateToFail(EncountersSection2 target) {
}
@Override
protected void updateToPass(EncountersSection2 target) {
target.init();
}
@Override
protected void setDependency(EncountersSection2 target) {
Collection<Object> passToken = new java.util.ArrayList<Object>(3);
passToken.add(target);
map.put("org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptionalCodeP", passToken);
}
@Override
protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) {
return EncountersSection2Operations.validateEncountersSectionEntriesOptionalCode(
(EncountersSection2) objectToTest, diagnostician, map);
}
};
validateEncountersSectionEntriesOptionalCodeTestCase.doValidationTest();
}
/**
*
* @generated NOT
*/
@Test
public void testValidateEncountersSectionEntriesOptionalEncounterActivity2() {
OperationsTestCase<EncountersSection2> validateEncountersSectionEntriesOptionalEncounterActivity2TestCase = new OperationsTestCase<EncountersSection2>(
"validateEncountersSectionEntriesOptionalEncounterActivity2",
operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_ENCOUNTER_ACTIVITY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"),
objectFactory) {
@Override
protected void updateToFail(EncountersSection2 target) {
// target.init defaults to a nullFlavor of NI which allows a pass
}
@Override
protected void updateToPass(EncountersSection2 target) {
target.addEncounter(ConsolFactory.eINSTANCE.createEncounterActivity2().init());
}
@Override
protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map<Object, Object> map) {
return EncountersSection2Operations.validateEncountersSectionEntriesOptionalEncounterActivity2(
(EncountersSection2) objectToTest, diagnostician, map);
}
};
validateEncountersSectionEntriesOptionalEncounterActivity2TestCase.doValidationTest();
}
/**
*
* @generated
*/
@Test
public void testGetConsolEncounterActivity2s() {
EncountersSection2 target = objectFactory.create();
target.getConsolEncounterActivity2s();
}
/**
*
* @generated
*/
private static class OperationsForOCL extends EncountersSection2Operations {
public String getOCLValue(String fieldName) {
String oclValue = null;
try {
oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this);
} catch (Exception e) {
oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName;
}
return oclValue;
}
}
/**
*
* @generated
*/
private static class ObjectFactory implements TestObjectFactory<EncountersSection2> {
@Override
public EncountersSection2 create() {
return ConsolFactory.eINSTANCE.createEncountersSection2();
}
}
/**
*
* @generated
*/
private static OperationsForOCL operationsForOCL = new OperationsForOCL();
/**
*
* @generated
*/
private static ObjectFactory objectFactory = new ObjectFactory();
/**
* Tests Operations Constructor for 100% coverage
* @generated
*/
private static class ConstructorTestClass extends EncountersSection2Operations {
};
/**
* Tests Operations Constructor for 100% coverage
* @generated
*/
@Test
public void testConstructor() {
new ConstructorTestClass();
} // testConstructor
/**
*
* @generated
*/
@Override
protected EObject getObjectToTest() {
return null;
}
} // EncountersSection2Operations
| [
"drb.gfc@comcast.net"
] | drb.gfc@comcast.net |
19082e38932e62befeab2167e758a362fc0135ac | e1bd560701723d45b69851a8d103b57a8e21ad28 | /ProjetoDevSistemaEdicao/src/br/unama/Modelo/teste.java | c3b15e0895c02bf057fadd75f03aafcec9471602 | [] | no_license | EquipeCaoADS/ProjetoDevSistemaEdicao | 95b1215484fa9a16dfd75e8345d0025088beb38f | 09d6ec928e4ba340812c52ee8bbe4bdb977d04de | refs/heads/master | 2020-04-05T22:36:07.408036 | 2018-11-12T19:50:26 | 2018-11-12T19:50:26 | 157,261,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 55 | java | package br.unama.Modelo;
public class teste {
}
| [
"User@WIN-CMECV4PC0OL.localdomain"
] | User@WIN-CMECV4PC0OL.localdomain |
0b389a39ab20e10cc5c67241a1a608d3792b3e29 | a7d8ca15560dbceb6cafcef163d7421af1f87d4a | /src/pl/mlethys/calorieCalc/model/CalculatedMeal.java | 7291a7175691891e5e36fcb0fab989e74de18307 | [] | no_license | mlethys/kcal_calc | 651cab6f5cec764332908049cc661ee15c00ee3a | 3b52167e94ac0f659ff29c787e8194d9bf15b541 | refs/heads/master | 2021-01-20T10:38:55.172862 | 2014-03-16T13:15:38 | 2014-03-16T13:15:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,610 | java | package pl.mlethys.calorieCalc.model;
import java.util.ArrayList;
import pl.mlethys.calorieCalc.view.TabBody;
/**
*
* @author mlethys
* @version
*/
public class CalculatedMeal extends Calculated
{
public CalculatedMeal()
{
kcal = 0;
proteins = 0;
carbs = 0;
fats = 0;
}
public void calculateMeal(ArrayList<TabBody> products) throws NoProductsException
{
if (products.isEmpty())
{
throw new NoProductsException();
}
float tmpKcal = 0;
float tmpProteins = 0;
float tmpCarbs = 0;
float tmpFats = 0;
for(int i = 0; i < products.size(); i++)
{
if (products.get(i).getMeal() == null)
{
return;
}
tmpKcal += products.get(i).getMeal().getKcal();
tmpProteins += products.get(i).getMeal().getProteins();
tmpCarbs += products.get(i).getMeal().getCarbs();
tmpFats += products.get(i).getMeal().getFats();
}
kcal = round(tmpKcal, 2);
proteins = round(tmpProteins, 2);
carbs = round(tmpCarbs, 2);
fats = round(tmpFats, 2);
}
public void setSummaryInfo(ArrayList<CalculatedProduct> products)
{
for(CalculatedProduct product : products)
{
kcal += product.getKcal();
proteins += product.getProteins();
fats += product.getFats();
carbs += product.getCarbs();
}
}
}
| [
"michal.kabala@gmail.com"
] | michal.kabala@gmail.com |
fefb1a3e29a224ad00c50f2023306c7937076170 | e8ea885b2835fb77c6b37c601bc59d94f895d300 | /src/cn/wzbrilliant/dbms/exception/InsertException.java | 7517893a7dd3396e1128c593bb39e1e978dda901 | [] | no_license | wisewong/Simple-DBMS | d659189a53bb589c36e3d69689a5549252891c94 | 72a1da613962d82368ba2a8459e12681da729f5a | refs/heads/master | 2021-05-30T13:59:41.821845 | 2016-03-12T14:43:11 | 2016-03-12T14:43:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 245 | java | package cn.wzbrilliant.dbms.exception;
public class InsertException extends RuntimeException {
public InsertException(String string) {
super(string);
}
/**
*
*/
private static final long serialVersionUID = 1471017610008385289L;
}
| [
"linil941030@gmail.com"
] | linil941030@gmail.com |
7f19a7404cdf522b2207c9feb82cd72fad57193b | ec87dbb40ce7dfbe530ceef3557a9dbc24470269 | /src/main/java/com/jewellerypos/api/model/SaleAddon.java | 05cd3149e9f5a9c10826e1aac85c85ed94f22410 | [] | no_license | satishnkn/jewelleryapi | 3620401ae91ec611a14c0607aa7fa3203e98fbdf | 98d77a51532df46f70b8e1d68e28685460461b9f | refs/heads/master | 2021-01-25T14:16:56.588389 | 2019-07-23T04:08:59 | 2019-07-23T04:08:59 | 123,678,923 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | package com.jewellerypos.api.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
@Entity
@Table(name = "SALE_ADDON")
public class SaleAddon implements Serializable{
/**
*
*/
private static final long serialVersionUID = 7712976169786270285L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "SALE_ADDON_ID")
private long saleAddonId;
@Column(name = "ADDON_PRODUCT_CODE")
private long addonProductCode;
@Column(name = "ADDON_PIECE")
private long addonPiece;
@Column(name = "ADDON_GROSS_WEIGHT")
private double addonGrossWeight;
@Column(name = "ADDON_NET_WEIGHT")
private double addonNetWeight;
@Column(name = "ADDON_LESS_WEIGHT")
private double addonLessWeight;
@Column(name = "ADDON_WASTAGE")
private double addonWastage;
@Column(name = "ADDON_MAKING_CHARGE")
private double addonMakingCharge;
@Column(name = "ADDON_RATE")
private double addonrate;
@Column(name = "ADDON_AMOUNT")
private double addonAmount;
}
| [
"viswanath"
] | viswanath |
cbe1a0a061484d50ec092ec4f5dcfc3c041b2b17 | d135e4040886d500f1e21ba8c5ffda6b301a62bf | /touchbox/src/main/java/com/xc/touchbox/model/FeedbackReply.java | 3b9fd6fed7424b3ec305e34a87853b19d78fe548 | [] | no_license | xianye/touchbox | eacfd8e83ff5d289bcfe786213dd93969f1d331f | c8f6cfd85f615da35a7c61b368c95d00a95ebaf5 | refs/heads/master | 2021-01-10T20:39:42.196655 | 2015-08-01T14:36:32 | 2015-08-01T14:36:32 | 40,029,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 246 | java | package com.xc.touchbox.model;
// Generated 2015-5-23 23:22:04 by Hibernate Tools 3.4.0.CR1
/**
* FeedbackReply generated by hbm2java
*/
public class FeedbackReply extends FeedbackReplyCommon implements
java.io.Serializable {
}
| [
"badboy_990726@163.com"
] | badboy_990726@163.com |
69d2a64e6b09a63046bc53a6da141aa691eeafaa | 07263ed168e1d8eaf27e60f49bcc12786f733f79 | /app/src/main/java/it/matteospaggiari/musicalstructureapp/Song.java | bf39b5e8893cb93c26380af113068a856a501388 | [] | no_license | MatteoSpaggiari/MusicalStructureApp | 95a00f287aa22e497182c21f9e78e39217aa429a | 469e433b14f9ea68a76157282088d28ce07a0102 | refs/heads/master | 2020-12-20T19:20:31.540952 | 2020-01-25T14:59:24 | 2020-01-25T14:59:24 | 236,184,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,561 | java | package it.matteospaggiari.musicalstructureapp;
/**
* {@link Song} represent a play_song that the user wants to listen.
* It contains a title, Artist and possible Album of that play_song
*/
public class Song {
/* Title of the Song */
private String mTitle;
/* Artist of the Song */
private Artist mArtist;
/* Album of the Song */
private Album mAlbum;
/* User favored play_song */
private boolean mFavorite;
public Song(String title) {
mTitle = title;
}
public Song(String title, Artist artist) {
mTitle = title;
mArtist = artist;
}
public Song(String title, Artist artist, boolean isFavorite) {
mTitle = title;
mArtist = artist;
mFavorite = isFavorite;
}
public Song(String title, Artist artist, Album album) {
mTitle = title;
mArtist = artist;
mAlbum = album;
}
public Song(String title, Artist artist, Album album, boolean isFavorite) {
mTitle = title;
mArtist = artist;
mAlbum = album;
mFavorite = isFavorite;
}
/*
* Get the Title of the Song.
* */
public String getTitle() {
return mTitle;
}
/*
* Get the Artist of the Song.
* */
public Artist getArtist() {
return mArtist;
}
/*
* Get the Album that contains the Song.
* */
public Album getAlbum() {
return mAlbum;
}
/*
* Is Favorite Song?
* */
public boolean isFavorite() {
return mFavorite;
}
}
| [
"matteo.spaggiari78@gmail.com"
] | matteo.spaggiari78@gmail.com |
6ed3ef6f9ea57d72838440888edf77cce957f442 | 4af0a2263e6fa200211c3208908bce25a9776a45 | /app/src/main/java/br/com/patrimonioonline/domain/adapter/SpinnerAdapter/AquisicaoAdapter.java | 15e21ab6216439e17ea4c035166f38d9a18df6be | [] | no_license | heliofeliciano/PatrimonioOnline | f694a1f829675ad0bc808eb1d3c436d0b27183fe | e90b3e5432feb763fcf12a395fec79a265b1db31 | refs/heads/master | 2020-04-16T02:10:52.543221 | 2016-11-11T19:05:09 | 2016-11-11T19:05:09 | 60,565,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,736 | java | package br.com.patrimonioonline.domain.adapter.SpinnerAdapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.List;
import br.com.patrimonioonline.R;
import br.com.patrimonioonline.domain.models.entities.AquisicaoEntity;
/**
* Created by helio on 24/06/16.
*/
public class AquisicaoAdapter extends ArrayAdapter<AquisicaoEntity> {
private Context context;
private List<AquisicaoEntity> lista;
public AquisicaoAdapter(Context context, int textViewResourceId, List<AquisicaoEntity> lista) {
super(context, textViewResourceId, lista);
this.context = context;
this.lista = lista;
}
@Override
public int getCount() {
return lista.size();
}
@Override
public AquisicaoEntity getItem(int position) {
return lista.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
View view;
if (convertView != null) {
view = convertView;
} else {
view = LayoutInflater.from(context).inflate(R.layout.spinner_item, parent, false);
holder = new ViewHolder(view);
}
holder.tvSpinnerItem.setText(lista.get(position).toString());
return view;
}
class ViewHolder {
TextView tvSpinnerItem;
public ViewHolder(View view) {
tvSpinnerItem = (TextView) view.findViewById(R.id.tv_spinner_item);
}
}
}
| [
"heliofeliciano@gmail.com"
] | heliofeliciano@gmail.com |
8b86eab6a171fa45caa4da3848dd5b7265b7430d | 454648f3309b8406232acf0d5190ddd6e902754f | /src/model/Bishop.java | 3a7bfb923123d0190bc9a82301251a15958bb3f7 | [
"Unlicense"
] | permissive | Clarkdale/Chess-Game | a54461f4948e26792865f3fcbbed04ea65ce3f07 | 52e81eecfbe61795c43f9c1ce81ffc5068741da0 | refs/heads/master | 2021-09-14T10:06:00.493302 | 2018-05-11T16:29:51 | 2018-05-11T16:29:51 | 111,443,728 | 0 | 1 | Unlicense | 2018-05-08T06:32:08 | 2017-11-20T17:49:56 | Java | UTF-8 | Java | false | false | 4,841 | java | package model;
/*====================================================================
Class Name: Bishop
Purpose: Bishop instance of piece class
Parent Class: Piece
====================================================================*/
import java.util.*;
public class Bishop extends Piece {
/**
*
*/
private static final long serialVersionUID = 1L;
public Bishop(int i, int j, boolean type, boolean ivory) {
super(i, j, type, ivory);
} // end method
public int getRow() {
return super.getRow();
} // end method
public int getColumn() {
return super.getColumn();
} // end method
public String graphic() {
if (super.type()) {
return ("WhiteBishop");
// return (new
// Image("https://www.cs.arizona.edu/sites/cs/files/styles/medium/public/images/people/mccann.jpg"));
} else {
return ("BlackBishop");
// return (new
// Image("https://www.amrita.edu/site/ISSISP2016/images/ChristianCollberg.jpg"));
} // end if/else
} // end method
/*====================================================================
Method Name: move
Purpose: Creates a set of tuples, which hold (x.y) positions
on the board as to where this type of piece could
potentially move. Essentially a "scan board" method
Parameters: in: A 2D array of pieces, which represent the board
Returns: A set of tuples of all possible moves
====================================================================*/
public Set<Tuple> move(Piece[][] in) {
// initial current variables set
int currX = super.getColumn();
int currY = super.getRow();
// output moveset initialized
Set<Tuple> out = new HashSet<>();
// Original space piece occupied is added, this is technically a valid move
out.add(new Tuple(currX, currY));
// Booleans created to use as checks for the circumstance that a piecec
// obstructs one of the diagonal paths of this piece
boolean case1 = true;
boolean case2 = true;
boolean case3 = true;
boolean case4 = true;
// For loop iterates up to 8, this is the maximum number of squares on the
// board
for (int i = 1; i < 8; i++) {
// booleans for pieces to the left of the initial square occupied
if (currX - i >= 0) {
// this piece of logic handles positions to the left, and down on the
// board
if (currY - i >= 0) {
// Process is stopped using case booleans if one of the squares is
// occupied by any piece
if (in[currY - i][currX - i] != null) {
// if statement makes it possible to take opponents pieces
if (in[currY - i][currX - i].type() != super.type() && case1) {
out.add(new Tuple(currX - i, currY - i));
} // end if
case1 = false;
} // end if
// as long as this boolean is false, it means that the path is Another
// obstructed, and this position can be added to the overall moveset
if (case1) {
out.add(new Tuple(currX - i, currY - i));
} // end if
} // end if
// This piece of logic handles moves to the left, and upwards on then
// board.
if (currY + i <= 7) {
// process is stopped if there is an obstruction from another piece
if (in[currY + i][currX - i] != null) {
// statement makes it possible to attack other pieces
if (in[currY + i][currX - i].type() != super.type() && case2) {
out.add(new Tuple(currX - i, currY + i));
} // end if
case2 = false;
} // end if
// So long as there is not an obstruction, possible move is added
// to the moveset
if (case2) {
out.add(new Tuple(currX - i, currY + i));
} // end if
} // end if
} // end if
// This block of logic handles pieces to the right of the initial square
// occupied by the instance of this piece, where this logic follows a
// similar structure to the block of logic above.
if (currX + i <= 7) {
if (currY - i >= 0) {
if (in[currY - i][currX + i] != null) {
if (in[currY - i][currX + i].type() != super.type() && case3) {
out.add(new Tuple(currX + i, currY - i));
} // end if
case3 = false;
} // end if
if (case3) {
out.add(new Tuple(currX + i, currY - i));
} // end if
} // end if
if (currY + i <= 7) {
if (in[currY + i][currX + i] != null) {
if (in[currY + i][currX + i].type() != super.type() && case4) {
out.add(new Tuple(currX + i, currY + i));
} // end if
case4 = false;
} // end if
if (case4) {
out.add(new Tuple(currX + i, currY + i));
} // end if
} // end if
} // end if
} // end for
return out;
} // end method
} // end class
| [
"clarkdale@email.arizona.edu"
] | clarkdale@email.arizona.edu |
530bfb2ff0f2e6ed32e2c0080736b2792791ad2d | de07223f56ea4b82e06bdb7dac671cdfae256b4f | /sf-house-bean/src/test/java/sf/house/bean/FunctionUtilTest.java | a0e8f489579e676aa25363c45fcdcc6ee3e27b5d | [] | no_license | nigel1000/sf-house | 0fab60f731f90bced53eea4269ee4d290af0441f | 786240fe86232c91fc2c40e622afa8687bdbeb82 | refs/heads/master | 2020-04-05T10:56:26.253066 | 2019-03-06T03:05:58 | 2019-03-06T03:05:58 | 144,843,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,045 | java | package sf.house.bean;
import lombok.extern.slf4j.Slf4j;
import sf.house.bean.util.FunctionUtil;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by hznijianfeng on 2018/11/14.
*/
@Slf4j
public class FunctionUtilTest {
public static void main(String[] args) {
List<Object> result = FunctionUtil.batchFunctionResults(
Arrays.asList(
list -> list.stream().collect(Collectors.summarizingInt(x -> x)),
list -> list.stream().filter(x -> x < 50).sorted().collect(Collectors.toList()),
list -> list.stream().collect(Collectors.groupingBy(x -> (x % 2 == 0 ? "even" : "odd"))),
list -> list.stream().sorted().collect(Collectors.toList()),
list -> list.stream().sorted().map(Math::sqrt).collect(Collectors.toMap(x -> x, y -> Math.pow(2, y)))),
Arrays.asList(64, 49, 25, 16, 9, 4, 1, 81, 36));
log.info("{}", result);
}
}
| [
"xiaodangjia@gov.cn"
] | xiaodangjia@gov.cn |
854a2f7d10b9f89c9e88a419ab8d44dffff0216b | 11c7fb3bc1ca0944775adb2a7352888b2bb79a17 | /shop/model/src/main/java/it/academy/model/Promo.java | fac29ed3c75b6934a42916b870346f92142feaac | [] | no_license | aleksey0koval/jd2_work | 109f1dac4bc82effec22f308bc05016945cd92d8 | 9f710a8d0752eefd9170c5e0987a34bb7f2f1466 | refs/heads/master | 2023-05-14T03:41:29.070331 | 2021-05-29T11:01:00 | 2021-05-29T11:01:00 | 322,027,620 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 850 | java | package it.academy.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "T_PROMO")
public class Promo {
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid")
@Column(name = "PROMO_ID")
private String promoId;
@Column(name = "PR_PRODUCT_NAME")
private String productName;
@Column(name = "PR_DESC")
private String description;
@ManyToMany()
@JoinTable(name = "T_PRODUCT_PROMO",
joinColumns = {@JoinColumn(name = "PROMO_ID")},
inverseJoinColumns = {@JoinColumn(name = "PRODUCT_ID")}
)
private List<Product> products;
}
| [
"aleksey0koval@gmail.com"
] | aleksey0koval@gmail.com |
08d7c95e0fd9656ad1f4bbb784b97240a2fc0ab2 | 52ed5bf9dc68e6e40ba9f00cf182f59a8550594e | /backend/it.univaq.flyaq.behaviour/src/it/univaq/flyaq/behaviour/impl/CoordinateImpl.java | 4f0093f151b7b15a35ca12a79c460ffcf8bdd184 | [] | no_license | PiedPiper911/FLYAQ | b228f62218051b2e0fd0181912099d3fff28a99d | 88941eb436755e30769bf66db5c4eedb75b43024 | refs/heads/master | 2023-03-18T05:15:36.062740 | 2015-04-05T21:24:15 | 2015-04-05T21:24:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,332 | java | /**
*/
package it.univaq.flyaq.behaviour.impl;
import it.univaq.flyaq.behaviour.BehaviourPackage;
import it.univaq.flyaq.behaviour.Coordinate;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Coordinate</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link it.univaq.flyaq.behaviour.impl.CoordinateImpl#getLatitude <em>Latitude</em>}</li>
* <li>{@link it.univaq.flyaq.behaviour.impl.CoordinateImpl#getLongitude <em>Longitude</em>}</li>
* <li>{@link it.univaq.flyaq.behaviour.impl.CoordinateImpl#getAltitude <em>Altitude</em>}</li>
* <li>{@link it.univaq.flyaq.behaviour.impl.CoordinateImpl#getHeading <em>Heading</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CoordinateImpl extends MinimalEObjectImpl.Container implements Coordinate {
/**
* The default value of the '{@link #getLatitude() <em>Latitude</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLatitude()
* @generated
* @ordered
*/
protected static final float LATITUDE_EDEFAULT = 0.0F;
/**
* The cached value of the '{@link #getLatitude() <em>Latitude</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLatitude()
* @generated
* @ordered
*/
protected float latitude = LATITUDE_EDEFAULT;
/**
* The default value of the '{@link #getLongitude() <em>Longitude</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLongitude()
* @generated
* @ordered
*/
protected static final float LONGITUDE_EDEFAULT = 0.0F;
/**
* The cached value of the '{@link #getLongitude() <em>Longitude</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLongitude()
* @generated
* @ordered
*/
protected float longitude = LONGITUDE_EDEFAULT;
/**
* The default value of the '{@link #getAltitude() <em>Altitude</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAltitude()
* @generated
* @ordered
*/
protected static final float ALTITUDE_EDEFAULT = 0.0F;
/**
* The cached value of the '{@link #getAltitude() <em>Altitude</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAltitude()
* @generated
* @ordered
*/
protected float altitude = ALTITUDE_EDEFAULT;
/**
* The default value of the '{@link #getHeading() <em>Heading</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeading()
* @generated
* @ordered
*/
protected static final float HEADING_EDEFAULT = 0.0F;
/**
* The cached value of the '{@link #getHeading() <em>Heading</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeading()
* @generated
* @ordered
*/
protected float heading = HEADING_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CoordinateImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BehaviourPackage.Literals.COORDINATE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public float getLatitude() {
return latitude;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLatitude(float newLatitude) {
float oldLatitude = latitude;
latitude = newLatitude;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BehaviourPackage.COORDINATE__LATITUDE, oldLatitude, latitude));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public float getLongitude() {
return longitude;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLongitude(float newLongitude) {
float oldLongitude = longitude;
longitude = newLongitude;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BehaviourPackage.COORDINATE__LONGITUDE, oldLongitude, longitude));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public float getAltitude() {
return altitude;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAltitude(float newAltitude) {
float oldAltitude = altitude;
altitude = newAltitude;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BehaviourPackage.COORDINATE__ALTITUDE, oldAltitude, altitude));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public float getHeading() {
return heading;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHeading(float newHeading) {
float oldHeading = heading;
heading = newHeading;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BehaviourPackage.COORDINATE__HEADING, oldHeading, heading));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BehaviourPackage.COORDINATE__LATITUDE:
return getLatitude();
case BehaviourPackage.COORDINATE__LONGITUDE:
return getLongitude();
case BehaviourPackage.COORDINATE__ALTITUDE:
return getAltitude();
case BehaviourPackage.COORDINATE__HEADING:
return getHeading();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BehaviourPackage.COORDINATE__LATITUDE:
setLatitude((Float)newValue);
return;
case BehaviourPackage.COORDINATE__LONGITUDE:
setLongitude((Float)newValue);
return;
case BehaviourPackage.COORDINATE__ALTITUDE:
setAltitude((Float)newValue);
return;
case BehaviourPackage.COORDINATE__HEADING:
setHeading((Float)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BehaviourPackage.COORDINATE__LATITUDE:
setLatitude(LATITUDE_EDEFAULT);
return;
case BehaviourPackage.COORDINATE__LONGITUDE:
setLongitude(LONGITUDE_EDEFAULT);
return;
case BehaviourPackage.COORDINATE__ALTITUDE:
setAltitude(ALTITUDE_EDEFAULT);
return;
case BehaviourPackage.COORDINATE__HEADING:
setHeading(HEADING_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BehaviourPackage.COORDINATE__LATITUDE:
return latitude != LATITUDE_EDEFAULT;
case BehaviourPackage.COORDINATE__LONGITUDE:
return longitude != LONGITUDE_EDEFAULT;
case BehaviourPackage.COORDINATE__ALTITUDE:
return altitude != ALTITUDE_EDEFAULT;
case BehaviourPackage.COORDINATE__HEADING:
return heading != HEADING_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (latitude: ");
result.append(latitude);
result.append(", longitude: ");
result.append(longitude);
result.append(", altitude: ");
result.append(altitude);
result.append(", heading: ");
result.append(heading);
result.append(')');
return result.toString();
}
} //CoordinateImpl
| [
"ivanomalavolta@gmail.com"
] | ivanomalavolta@gmail.com |
c8f33ee8b836cb9981f805d3dc5a4e3788dc0ced | 6ab91ccfce59e0d16ec47a83881bcabf889354e0 | /src/grammar/util/FileUtil.java | a31e1feb1c8750c5c744053c8d0c1854951b13d5 | [] | no_license | EvgeniyShilov/PPTA_3 | 38d32c471f7e288dabf124ce5ea504aa0371ae21 | 3a9d65af3285ed3c0afd3168f2efa097f8626f7b | refs/heads/master | 2021-08-29T14:12:04.742492 | 2017-12-14T02:43:45 | 2017-12-14T02:43:45 | 111,612,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 572 | java | package grammar.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class FileUtil {
public static List<String> readFile(String filename) throws IOException {
List<String> strings = new ArrayList<>();
File file = new File(filename);
BufferedReader reader = new BufferedReader(new FileReader(file));
String line;
while ((line = reader.readLine()) != null) strings.add(line);
return strings;
}
}
| [
"eugshilov@gmail.com"
] | eugshilov@gmail.com |
5622c94d87678dc03d9a6ca43f382ea106e33df9 | cfd652be22e92bcebf12bc533ceab039b3c5ea6f | /app/src/main/java/com/example/architecturecomponents/AddEditNoteActivity.java | 731eaa5e4b7e4f32b95fa9f4a6eff65d741cc8b1 | [] | no_license | harshitm98/Notes-App-MVVM | d3a280894c3d7aa2a5774a01ef3a27836922ef94 | a022fdbcd227fba66dbd113e0b8f476e77768b8a | refs/heads/master | 2020-04-27T06:17:02.323619 | 2019-03-10T18:15:55 | 2019-03-10T18:15:55 | 174,103,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,174 | java | package com.example.architecturecomponents;
import android.content.Intent;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.NumberPicker;
import android.widget.Toast;
public class AddEditNoteActivity extends AppCompatActivity {
public static final String EXTRA_ID =
"com.example.architecturecomponents.EXTRA_ID";
public static final String EXTRA_TITLE =
"com.example.architecturecomponents.EXTRA_TITLE";
public static final String EXTRA_DESCRIPTION =
"com.example.architecturecomponents.EXTRA_DESCRIPTION";
public static final String EXTRA_PRIORITY =
"com.example.architecturecomponents.EXTRA_PRIORITY";
private EditText editTextTitle;
private EditText editTextDescription;
private NumberPicker numberPicker;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_note);
editTextTitle = findViewById(R.id.edit_text_title);
editTextDescription = findViewById(R.id.edit_text_description);
numberPicker = findViewById(R.id.number_picker_priority);
numberPicker.setMinValue(1);
numberPicker.setMaxValue(10);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_close);
Intent intent = getIntent();
if(intent.hasExtra(EXTRA_ID)){
setTitle("Edit Note");
editTextTitle.setText(intent.getStringExtra(EXTRA_TITLE));
editTextDescription.setText(intent.getStringExtra(EXTRA_DESCRIPTION));
numberPicker.setValue(intent.getIntExtra(EXTRA_PRIORITY, 1));
}else{
setTitle("Add Note");
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.add_note_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.save_note:
saveNote();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void saveNote(){
String title = editTextTitle.getText().toString();
String description = editTextDescription.getText().toString();
int priority = numberPicker.getValue();
if(title.trim().isEmpty() || description.trim().isEmpty()){
Toast.makeText(this, "Please insert the title and description", Toast.LENGTH_SHORT).show();
return;
}
Intent intent = new Intent();
intent.putExtra(EXTRA_TITLE, title);
intent.putExtra(EXTRA_DESCRIPTION, description);
intent.putExtra(EXTRA_PRIORITY, priority);
int id = intent.getIntExtra(EXTRA_ID, -1);
if(id != -1){
intent.putExtra(EXTRA_ID, id);
}
setResult(RESULT_OK, intent);
finish();
}
}
| [
"harshitmah98@gmail.com"
] | harshitmah98@gmail.com |
978cc38b431a14dc49fcb1bcbbc9e3a76da5337a | fa2634d9c04b10a5ff0c30185fe0f4e89c869b2e | /app/src/main/java/com/example/testcase1/fragment1.java | 06adef924bd152956ce3da4f25a1f0afe4636695 | [] | no_license | deepak25feb/youtubeplayerrefrence | 58748c73e26e982a0eb87288f628bbda8f21de1f | 7f470ffb77fc7ffa46e1a737254b74d3ac591d67 | refs/heads/master | 2023-01-22T20:19:31.516473 | 2020-11-20T03:13:13 | 2020-11-20T03:13:13 | 314,433,735 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,858 | java | package com.example.testcase1;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.BoringLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import java.util.ArrayList;
import java.util.List;
//frag 1
public class fragment1 extends Fragment {
List<Model> list;
int resId;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.frag1,container,false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ListView listview = getActivity().findViewById(R.id.listview);
list = new ArrayList<>();
additionoflist();
// list.add(new Model("SUBJECT 1",R.drawable.ic_check_black));
// list.add(new Model("SUBJECT 2",R.drawable.ic_check_black));
// list.add(new Model("SUBJECT 3",R.drawable.ic_check_black));
// list.add(new Model("SUBJECT 4",R.drawable.ic_check_black));
// list.add(new Model("SUBJECT 5",R.drawable.ic_check_black));
Adapter adapter = new Adapter(getActivity(),0,list);
listview.setAdapter(adapter);
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if(position==0){
fraginfo frag = new fraginfo();
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.frame,frag).addToBackStack("one").commit();
}
}
});
}
void additionoflist(){
SharedPreferences sharedPreferences = getActivity().getSharedPreferences("IMAGEDATA", Context.MODE_PRIVATE);
int image1 = sharedPreferences.getInt("IMAGE 1",R.drawable.ic_check_green);
int image2 = sharedPreferences.getInt("IMAGE 2",R.drawable.ic_check_green);
int image3 = sharedPreferences.getInt("IMAGE 3",R.drawable.ic_check_green);
int image4 = sharedPreferences.getInt("IMAGE 4",R.drawable.ic_check_green);
int image5 = sharedPreferences.getInt("IMAGE 5",R.drawable.ic_check_green);
list.add(new Model("SUBJECT 1",image1));
list.add(new Model("SUBJECT 2",image2));
list.add(new Model("SUBJECT 3",image3));
list.add(new Model("SUBJECT 4",image4));
list.add(new Model("SUBJECT 5",image5));
}
}
| [
"singh.deepak.18bit056@gmail.com"
] | singh.deepak.18bit056@gmail.com |
bd3546c134befd09e47c47b1f49267e70b1113b9 | e427869d12e8affbac0994a6caa4622f1656e96f | /src/com/rimberse/TemperatureConverter.java | 06d07cd9fe82972bc3a453f7aaeb6f204f887b5b | [] | no_license | Rimberse/Temperature-converter | 31e39c51ac9a6284a57291f6df016937947d09bc | f531cb9e1aca1bd3ecc293dd45438e489584eff1 | refs/heads/master | 2020-12-13T12:22:11.602347 | 2020-01-19T20:50:59 | 2020-01-19T20:50:59 | 234,414,504 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 5,043 | java | package com.rimberse;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class TemperatureConverter implements ActionListener {
JFrame frame;
JRadioButton FButton;
JRadioButton CButton;
JTextField temperature;
JTextField result;
JLabel t;
JLabel r;
public static void main(String[] args) {
new TemperatureConverter().run();
}
public void run() {
frame = new JFrame("Temperature Conventor");
JPanel panel = new JPanel();
JPanel north = new JPanel();
JPanel center = new JPanel();
JLabel label = new JLabel("Select temperature scale:");
label.setHorizontalAlignment(JLabel.CENTER);
FButton = new JRadioButton("Fahrenheit");
FButton.setHorizontalAlignment(JRadioButton.CENTER);
FButton.setActionCommand("Fahrenheit");
FButton.setSelected(false);
CButton = new JRadioButton("Celsius");
CButton.setHorizontalAlignment(JRadioButton.CENTER);
CButton.setActionCommand("Celsius");
CButton.setSelected(false);
ButtonGroup group = new ButtonGroup();
group.add(FButton);
group.add(CButton);
temperature = new JTextField(5);
temperature.setHorizontalAlignment(JTextField.CENTER);
t = new JLabel("Temperature:");
t.setHorizontalAlignment(JLabel.CENTER);
JButton convert = new JButton("Convert");
result = new JTextField(5);
result.setHorizontalAlignment(JTextField.CENTER);
r = new JLabel("Result:");
r.setHorizontalAlignment(JLabel.CENTER);
result.setEditable(false);
panel.setLayout(new BorderLayout());
north.setLayout(new GridLayout(3, 2));
center.setLayout(new GridLayout(4, 2, 15, 0));
convert.addActionListener(this);
Font f = new Font("Times", Font.PLAIN, 18);
Font f2 = new Font("serif", Font.BOLD + Font.ITALIC, 20);
Font f3 = new Font("Courier", Font.PLAIN, 12);
label.setFont(f);
r.setFont(f2);
t.setFont(f2);
FButton.setFont(f3);
CButton.setFont(f3);
north.add(label);
north.add(new JLabel());
north.add(new JLabel());
north.add(new JLabel());
north.add(FButton);
north.add(CButton);
center.add(t);
center.add(r);
center.add(temperature);
center.add(result);
for (int i = 0; i < 4; i ++) {
center.add(new JLabel());
}
panel.add(BorderLayout.NORTH, north);
panel.add(BorderLayout.CENTER, center);
panel.add(BorderLayout.SOUTH, convert);
frame.getContentPane().add(panel);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
| UnsupportedLookAndFeelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SwingUtilities.updateComponentTreeUI(frame);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setPreferredSize(new Dimension(420, 370));
frame.pack();
frame.setLocationRelativeTo(null);
frame.setResizable(false);
frame.setVisible(true);
}
public double convertToFahrenheit(double celsius) {
double fahrenheit;
fahrenheit = (celsius * 1.8) + 32;
return fahrenheit;
}
public double convertToCelsius(double fahrenheit) {
double celsius;
celsius = (fahrenheit - 32) / 1.8;
return celsius;
}
@Override
public void actionPerformed(ActionEvent e) {
DecimalFormat df = new DecimalFormat("#.#");
df.setRoundingMode(RoundingMode.HALF_UP);
if (FButton.isSelected() == true) {
if (temperature.getText().contains("ยฐC") || temperature.getText().contains("ยฐF")) {
StringBuilder sb = new StringBuilder(temperature.getText());
sb.deleteCharAt(sb.length() - 1);
sb.deleteCharAt(sb.length() - 1);
sb.deleteCharAt(sb.length() - 1);
temperature.setText(sb.toString());
}
double fahrenheit = convertToFahrenheit(Double.parseDouble(temperature.getText()));
t.setText("Celsius:");
temperature.setText(temperature.getText() + " ยฐC");
r.setText("Fahrenheit:");
result.setText(df.format(fahrenheit) + " ยฐF");
} else if (CButton.isSelected() == true) {
if (temperature.getText().contains("ยฐC") || temperature.getText().contains("ยฐF")) {
StringBuilder sb = new StringBuilder(temperature.getText());
sb.deleteCharAt(sb.length() - 1);
sb.deleteCharAt(sb.length() - 1);
sb.deleteCharAt(sb.length() - 1);
temperature.setText(sb.toString());
}
double celsius = convertToCelsius(Double.parseDouble(temperature.getText()));
t.setText("Fahrenheit:");
temperature.setText(temperature.getText() + " ยฐF");
r.setText("Celsius:");
result.setText(df.format(celsius) + " ยฐC");
}
}
} | [
"kerimpltm@gmail.com"
] | kerimpltm@gmail.com |
f5b5bc40d45165167119276c2ce4b963b3f62d0e | ce8b6b9a65833e2ee688a5aa65e5327881a9f25f | /src/main/java/ru/job4j/bank/User.java | 9731c37c98fd5a4024b1c44fcb24aaafdff43140 | [] | no_license | mankokolya/job4j_elementary | a0fec6065f663880172cc53091c897a3b0e916d3 | 37389c7212ede6741597a893c774b7a6bfb75993 | refs/heads/master | 2022-12-01T18:02:18.390348 | 2020-06-17T20:13:31 | 2020-06-17T20:13:31 | 256,578,389 | 0 | 0 | null | 2020-04-17T18:19:10 | 2020-04-17T18:19:09 | null | UTF-8 | Java | false | false | 965 | java | package ru.job4j.bank;
import java.util.Objects;
public class User {
private String passport;
private String username;
public User(String passport, String username) {
this.passport = passport;
this.username = username;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
User user = (User) o;
return Objects.equals(this.passport, user.passport);
}
@Override
public int hashCode() {
return Objects.hash(this.passport);
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassport() {
return passport;
}
public void setPassport(String passport) {
this.passport = passport;
}
}
| [
"mankokolya@gmail.com"
] | mankokolya@gmail.com |
1f462de4c1e3ba83ebe99899434eecfc0232e580 | f7a1b01ffdf6b5251146ffac15cf1d4e283c74a3 | /app/src/main/java/com/dreams/chat/adapters/SubmittedPicsAdapter.java | 9398813ca346964d2be1c46c5e3bac475aef906d | [] | no_license | asimmirza1200/DreamsChat | 79d148802e66c94318e3e2be83c8fa98e78c192d | 9ef8334f9d24f7e45741e588470a01b8b1eb5dfb | refs/heads/master | 2023-01-20T01:26:48.589002 | 2020-11-25T14:14:50 | 2020-11-25T14:14:50 | 309,397,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,874 | java | package com.dreams.chat.adapters;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.dreams.chat.R;
import com.dreams.chat.models.SubmittedPicsModel;
import java.util.List;
public class SubmittedPicsAdapter extends RecyclerView.Adapter<SubmittedPicsAdapter.SubmittedPicsViewHolder> {
public SubmittedPicsAdapter(Context context, List<SubmittedPicsModel> submittedPicsList) {
this.context = context;
this.submittedPicsList = submittedPicsList;
}
Context context;
List<SubmittedPicsModel> submittedPicsList;
View view;
@NonNull
@Override
public SubmittedPicsViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
return new SubmittedPicsViewHolder(view= LayoutInflater.from(context).inflate(R.layout.item_rv_submitted_pics,viewGroup,false));
}
@Override
public void onBindViewHolder(@NonNull SubmittedPicsViewHolder submittedPicsViewHolder, int i) {
Glide.with(context).load(submittedPicsList.get(i).getPicture_url()).into(submittedPicsViewHolder.ivSubmittedPics);
submittedPicsViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
}
@Override
public int getItemCount() {
return submittedPicsList.size();
}
public class SubmittedPicsViewHolder extends RecyclerView.ViewHolder{
ImageView ivSubmittedPics;
public SubmittedPicsViewHolder(@NonNull View itemView) {
super(itemView);
ivSubmittedPics=itemView.findViewById(R.id.ivSubmittedPics);
}
}
}
| [
"Asimirza1200"
] | Asimirza1200 |
a85da7e57c062fc92dbe43aa8224b638c0ba3c46 | 6137371e818527732676a76284e6969b58951cc9 | /src/main/java/cn/gydata/zckb/zckbinterfaceorder/util/ConverterUtils.java | cc5fe7a7063b8a5d4f25af49c0422200781a427a | [] | no_license | 1778622334/zckb-interface-order | 177a0b4249d838a58c6c60dfa0baab22ab3e3727 | 3e40796e3c2e740195c6efa74d339418b715984c | refs/heads/master | 2022-07-02T09:48:45.291809 | 2019-12-12T07:44:57 | 2019-12-12T07:44:57 | 227,549,107 | 0 | 0 | null | 2022-06-29T17:50:36 | 2019-12-12T07:44:52 | Java | UTF-8 | Java | false | false | 4,428 | java | package cn.gydata.zckb.zckbinterfaceorder.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ConverterUtils {
/**
* <ๅฐobj่ฝฌๆขไธบstring๏ผๅฆๆobjไธบnullๅ่ฟๅdefaultVal>
*
* @param obj ้่ฆ่ฝฌๆขไธบstring็ๅฏน่ฑก
* @param defaultVal ้ป่ฎคๅผ
* @return obj่ฝฌๆขไธบstring
*/
public static String toString(Object obj, String defaultVal){
return (obj != null) ? obj.toString() : defaultVal;
}
/**
* <ๅฐobj่ฝฌๆขไธบstring๏ผ้ป่ฎคไธบ็ฉบ>
*
* @param obj ้่ฆ่ฝฌๆขไธบstring็ๅฏน่ฑก
* @return ๅฐๅฏน่ฑก่ฝฌๆขไธบstring็ๅญ็ฌฆไธฒ
*/
public static String toString(Object obj){
return toString(obj, "");
}
/**
* <ๅฐๅฏน่ฑก่ฝฌๆขไธบint>
*
* @param obj ้่ฆ่ฝฌๆขไธบint็ๅฏน่ฑก
* @param defaultVal ้ป่ฎคๅผ
* @return obj่ฝฌๆขๆ็intๅผ
*/
public static Integer toInt(Object obj, Integer defaultVal) {
try
{
return (obj != null) ? Integer.parseInt(toString(obj, "0")) : defaultVal;
}catch(Exception e)
{
}
return defaultVal;
}
/**
* <ๅฐๅฏน่ฑก่ฝฌๆขไธบint>
*
* @param obj ้่ฆ่ฝฌๆขไธบint็ๅฏน่ฑก
* @return obj่ฝฌๆขๆ็intๅผ
*/
public static Integer toInt(Object obj)
{
return toInt(obj, 0);
}
public static Boolean toBoolean(Object obj, Boolean defaultVal) {
try
{
return (obj != null) ?Boolean.parseBoolean(toString(obj, "false")) : defaultVal;
}catch(Exception e)
{
}
return defaultVal;
}
public static Boolean toBoolean(Object obj)
{
return toBoolean(obj, false);
}
/**
* <ๅฐๅฏน่ฑก่ฝฌๆขไธบInteger>
*
* @param obj ้่ฆ่ฝฌๆขไธบInteger็ๅฏน่ฑก
* @return obj่ฝฌๆขๆ็Integerๅผ
*/
public static Integer toInteger(Object obj)
{
return toInt(obj, null);
}
/**
* <ๅฐๅฏน่ฑก่ฝฌๆขไธบint>
*
* @param obj ้่ฆ่ฝฌๆขไธบint็ๅฏน่ฑก
* @param defaultVal ้ป่ฎคๅผ
* @return obj่ฝฌๆขๆ็intๅผ
*/
public static Float toFloat(Object obj, float defaultVal)
{
return (obj != null) ? Float.parseFloat(toString(obj, "0")) : defaultVal;
}
/**
* <ๅฐๅฏน่ฑก่ฝฌๆขไธบFloat>
*
* @param obj ้่ฆ่ฝฌๆขไธบFloat็ๅฏน่ฑก
* @return obj่ฝฌๆขๆ็Floatๅผ
*/
public static Float toFloat(Object obj)
{
return toFloat(obj, 0);
}
/**
* <ๅฐobj่ฝฌๆขไธบlong>
*
* @param obj ้่ฆ่ฝฌๆข็ๅฏน่ฑก
* @param defaultVal ้ป่ฎคๅผ
* @return ๅฆๆobjไธบ็ฉบๅ่ฟๅ้ป่ฎค๏ผไธไธบ็ฉบๅ่ฟๅ่ฝฌๆขๅ็long็ปๆ
*/
public static Long toLong(Object obj, long defaultVal)
{
return (obj != null) ? Long.parseLong(toString(obj)) : defaultVal;
}
/**
* <ๅฐobj่ฝฌๆขไธบlong>
*
* @param obj ้่ฆ่ฝฌๆข็ๅฏน่ฑก
* @return ๅฆๆobjไธบ็ฉบๅ่ฟๅ้ป่ฎค็0l๏ผไธไธบ็ฉบๅ่ฟๅ่ฝฌๆขๅ็long็ปๆ
*/
public static Long toLong(Object obj)
{
return toLong(obj, 0l);
}
/**
* ๅฐobject่ฝฌๆขไธบdouble็ฑปๅ๏ผๅฆๆๅบ้ๅ่ฟๅ defaultVal
* @param obj ้่ฆ่ฝฌๆข็ๅฏน่ฑก
* @param defaultVal ้ป่ฎคๅผ
* @return ่ฝฌๆขๅ็็ปๆ
*/
public static Double toDouble(Object obj,Double defaultVal)
{
try
{
return Double.parseDouble(obj.toString());
}
catch(Exception e)
{
return defaultVal;
}
}
/**
* ๅฐobject่ฝฌๆขไธบdouble็ฑปๅ๏ผๅฆๆๅบ้ๅ่ฟๅ 0d
* @param obj ้่ฆ่ฝฌๆข็ๅฏน่ฑก
* @return ่ฝฌๆขๅ็็ปๆ
*/
public static double toDouble(Object obj)
{
return toDouble(obj,0d);
}
/**
* <ๅฐList<Object>่ฝฌๆขไธบList<Map<String, Object>>>
*
* @param list ้่ฆ่ฝฌๆข็list
* @return ่ฝฌๆข็็ปๆ
*/
@SuppressWarnings("unchecked")
public static List<Map<String, Object>> converterForMapList(List<Object> list)
{
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
for (Object tempObj : list)
{
result.add((HashMap<String, Object>)tempObj);
}
return result;
}
}
| [
"1778622334@qq.com"
] | 1778622334@qq.com |
74094a381138144c99e61be750ac724cfaf4ba05 | 0a2d7b9d62e3e4b3c279b56a33e9935e670eae12 | /src/main/java/com/epam/rd/java/basic/practice5/Part1.java | 249aa2e554ca66d9137a92379d265d44cde80624 | [] | no_license | Jereana/task5 | ea7649cba4f8a878c1710e445aedf3652fddbd92 | e632f863ecbbeaf2f83c4f519b3b085b7f5ead98 | refs/heads/master | 2022-12-28T01:43:44.473229 | 2020-10-01T20:15:38 | 2020-10-01T20:15:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,555 | java | package com.epam.rd.java.basic.practice5;
public class Part1 {
public static void main(String[] args) {
Thread t1 = new MyThread();
t1.setName("firstChild");
t1.start();
Thread t2 = new Thread(new MyThread2("Child2"));
try {
t1.join();
t2.start();
t2.join();
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
e.printStackTrace();
}
}
static class MyThread extends Thread {
@Override
public void run() {
for (int i = 0; i < 4; i++) {
System.out.println(this.getName());
try {
sleep(500);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
e.printStackTrace();
}
}
}
}
static class MyThread2 implements Runnable {
String name;
public MyThread2(String name) {
this.name = name;
}
@Override
public void run() {
for (int i = 0; i < 4; i++) {
System.out.println(this.name);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
e.printStackTrace();
}
}
}
}
}
| [
"nastasia.glushchenko@gmail.com"
] | nastasia.glushchenko@gmail.com |
f718123523946495ea204decd5b4c5ac66c85c14 | d3d5783ba90af152a961f3da683dcf1206404922 | /librarytwo/src/main/java/com/andylai/librarytwo/Library2.java | c78686ba17692e1042501c2d4328559ac4bf4cd1 | [] | no_license | AndyLai13/ImportMultiLibary | 6350c9d565b80db64fa407abe5bdbcc5aea19737 | 52bbcdb76f70d1863186bb2772f723abe953d492 | refs/heads/master | 2021-05-18T18:52:54.521531 | 2020-03-30T16:44:30 | 2020-03-30T16:44:30 | 251,368,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 151 | java | package com.andylai.librarytwo;
import android.util.Log;
public class Library2 {
public void show() {
Log.d("Andy", "Library2");
}
}
| [
"badboyandy13@gmail.com"
] | badboyandy13@gmail.com |
0c04009bb18d5de6ac2d89fec23410dfaf2f77ee | 688fd6a72dc86fdfee21063180a6287d1ed3b026 | /AlYou/src/com/imalu/alyou/net/response/MoodCommentResponse.java | c89852bc3934fd113977069e97d33f1b8e45ec46 | [] | no_license | zzsier/AlYou | 336765683cad29f54cbb372f6b29f59affdaf69b | 9fe5ac53d490f94d50a749102170be0bd3ef0cea | refs/heads/master | 2021-01-22T06:55:08.407651 | 2015-02-10T07:03:12 | 2015-02-10T07:03:12 | 27,323,836 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 517 | java | package com.imalu.alyou.net.response;
import com.imalu.alyou.net.NetObject;
public class MoodCommentResponse extends NetObject {
public String getHuifurenName() {
try {
return this.getJsonObject().getString("HuifurenName");
} catch (Exception e) {
// TODO Auto-generated catch block
return "";
}
}
public String getContent() {
try {
return this.getJsonObject().getString("Content");
} catch (Exception e) {
// TODO Auto-generated catch block
return "";
}
}
}
| [
"Administrator@XT1-20141107UYY"
] | Administrator@XT1-20141107UYY |
130adaebdc3f289aff36aa129170bfd6ce8b878b | 7b5db27054cc360f9ea7f49e4e66e9a8f0e1670e | /app/src/main/java/com/minevera/asynctasks/SearchProductAsyncTask.java | aea2b7f442cd4dcb10e2b67d815c42c6e035b561 | [] | no_license | pavlo-rosa/mi-nevera | 9a22b2935bbf93b2d8108d6609d354b7fd4f2efc | 46e7b1745b26cb0c75ddde2ca9ef90156cd1c347 | refs/heads/master | 2023-01-20T12:16:31.756465 | 2020-11-16T15:58:45 | 2020-11-16T15:58:45 | 313,349,122 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,258 | java | package com.minevera.asynctasks;
import android.os.AsyncTask;
import com.backend.groupHomeApi.GroupHomeApi;
import com.backend.groupHomeApi.model.ProductHome;
import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.extensions.android.json.AndroidJsonFactory;
import com.minevera.Controller;
import java.io.IOException;
/**
* Created by Pablo on 20/04/2016.
*/
public class SearchProductAsyncTask extends AsyncTask<String, Void, ProductHome> {
private static GroupHomeApi myApiService = null;
@Override
protected ProductHome doInBackground(String... params) {
if (myApiService == null) { // Inicializamos el servicio si no estรก corriendo
GroupHomeApi.Builder builder = new GroupHomeApi.Builder(AndroidHttp.newCompatibleTransport(), new AndroidJsonFactory(), null)
.setRootUrl(Controller.urlDS);
myApiService = builder.build();
}
ProductHome productHome = null;
try {
productHome = myApiService.searchProductHome(Controller.gh.getId(), params[0]).execute();
} catch (IOException e) {
e.printStackTrace();
}
return productHome;
}
} | [
"pavlo.rosa@gmail.com"
] | pavlo.rosa@gmail.com |
f6e506ce3dd8763a62241b999107f931095efaa5 | 32b72e1dc8b6ee1be2e80bb70a03a021c83db550 | /ast_results/cgeo_c-geo-opensource/main/src/cgeo/geocaching/loaders/NextPageGeocacheListLoader.java | e2c58af05b28944c5c4f090940d3311d6e72025a | [] | no_license | cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | d90c41a17e88fcd99d543124eeb6e93f9133cb4a | 0564143d92f8024ff5fa6b659c2baebf827582b1 | refs/heads/master | 2020-07-13T13:53:40.297493 | 2019-01-11T11:51:18 | 2019-01-11T11:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | // isComment
package cgeo.geocaching.loaders;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.connector.ConnectorFactory;
import cgeo.geocaching.connector.capability.ISearchByNextPage;
import android.app.Activity;
import io.reactivex.functions.Function;
public class isClassOrIsInterface extends AbstractSearchLoader {
private final SearchResult isVariable;
public isConstructor(final Activity isParameter, final SearchResult isParameter) {
super(isNameExpr);
this.isFieldAccessExpr = isNameExpr;
}
@Override
public SearchResult isMethod() {
return isNameExpr.isMethod(isNameExpr.isMethod(), new Function<ISearchByNextPage, SearchResult>() {
@Override
public SearchResult isMethod(final ISearchByNextPage isParameter) {
return isNameExpr.isMethod(isNameExpr);
}
});
}
}
| [
"matheus@melsolucoes.net"
] | matheus@melsolucoes.net |
f867cc134433ea64ed93bb0620f198c4b4bb2098 | 6ed4a2bf44cbe9a5f172bfda905ae4693700c7d8 | /app/src/main/java/dev/dworks/apps/anexplorer/misc/FileUtils.java | c3e4bc7e2301a9fda18da39843826a10e3658f98 | [
"Apache-2.0"
] | permissive | varoon/AnExplorer | a73e6edc80923649964e7e26bc9a471eb77a5669 | 65ec099fde32aaf908ba8afaa2c02430eedafeff | refs/heads/master | 2021-01-17T21:01:59.958818 | 2016-07-24T22:10:13 | 2016-07-24T22:10:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,785 | java | package dev.dworks.apps.anexplorer.misc;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.MimeTypeMap;
import com.google.common.collect.Lists;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
import dev.dworks.apps.anexplorer.R;
import dev.dworks.apps.anexplorer.model.DocumentInfo;
import dev.dworks.apps.anexplorer.model.DocumentsContract.Document;
public class FileUtils {
private static final String TAG = "FileUtils";
private static final int BUFFER = 2048;
/** Regular expression for safe filenames: no spaces or metacharacters */
private static final Pattern SAFE_FILENAME_PATTERN = Pattern.compile("[\\w%+,./=_-]+");
private static final File[] EMPTY = new File[0];
/**
* Test if a file lives under the given directory, either as a direct child
* or a distant grandchild.
* <p>
* Both files <em>must</em> have been resolved using
* {@link File#getCanonicalFile()} to avoid symlink or path traversal
* attacks.
*/
public static boolean contains(File[] dirs, File file) {
for (File dir : dirs) {
if (contains(dir, file)) {
return true;
}
}
return false;
}
/**
* Test if a file lives under the given directory, either as a direct child
* or a distant grandchild.
* <p>
* Both files <em>must</em> have been resolved using
* {@link File#getCanonicalFile()} to avoid symlink or path traversal
* attacks.
*/
public static boolean contains(File dir, File file) {
if (dir == null || file == null) return false;
String dirPath = dir.getAbsolutePath();
String filePath = file.getAbsolutePath();
if (dirPath.equals(filePath)) {
return true;
}
if (!dirPath.endsWith("/")) {
dirPath += "/";
}
return filePath.startsWith(dirPath);
}
public static boolean deleteContents(File dir) {
File[] files = dir.listFiles();
boolean success = true;
if (files != null) {
for (File file : files) {
if (file.isDirectory()) {
success &= deleteContents(file);
}
if (!file.delete()) {
Log.w(TAG, "Failed to delete " + file);
success = false;
}
}
}
return success;
}
private static boolean isValidExtFilenameChar(char c) {
switch (c) {
case '\0':
case '/':
return false;
default:
return true;
}
}
/**
* Check if given filename is valid for an ext4 filesystem.
*/
public static boolean isValidExtFilename(String name) {
return (name != null) && name.equals(buildValidExtFilename(name));
}
/**
* Mutate the given filename to make it valid for an ext4 filesystem,
* replacing any invalid characters with "_".
*/
public static String buildValidExtFilename(String name) {
if (TextUtils.isEmpty(name) || ".".equals(name) || "..".equals(name)) {
return "(invalid)";
}
final StringBuilder res = new StringBuilder(name.length());
for (int i = 0; i < name.length(); i++) {
final char c = name.charAt(i);
if (isValidExtFilenameChar(c)) {
res.append(c);
} else {
res.append('_');
}
}
trimFilename(res, 255);
return res.toString();
}
private static boolean isValidFatFilenameChar(char c) {
if ((0x00 <= c && c <= 0x1f)) {
return false;
}
switch (c) {
case '"':
case '*':
case '/':
case ':':
case '<':
case '>':
case '?':
case '\\':
case '|':
case 0x7F:
return false;
default:
return true;
}
}
/**
* Check if given filename is valid for a FAT filesystem.
*/
public static boolean isValidFatFilename(String name) {
return (name != null) && name.equals(buildValidFatFilename(name));
}
/**
* Mutate the given filename to make it valid for a FAT filesystem,
* replacing any invalid characters with "_".
*/
public static String buildValidFatFilename(String name) {
if (TextUtils.isEmpty(name) || ".".equals(name) || "..".equals(name)) {
return "(invalid)";
}
final StringBuilder res = new StringBuilder(name.length());
for (int i = 0; i < name.length(); i++) {
final char c = name.charAt(i);
if (isValidFatFilenameChar(c)) {
res.append(c);
} else {
res.append('_');
}
}
// Even though vfat allows 255 UCS-2 chars, we might eventually write to
// ext4 through a FUSE layer, so use that limit.
trimFilename(res, 255);
return res.toString();
}
public static String trimFilename(String str, int maxBytes) {
final StringBuilder res = new StringBuilder(str);
trimFilename(res, maxBytes);
return res.toString();
}
private static void trimFilename(StringBuilder res, int maxBytes) {
byte[] raw = res.toString().getBytes(StandardCharsets.UTF_8);
if (raw.length > maxBytes) {
maxBytes -= 3;
while (raw.length > maxBytes) {
res.deleteCharAt(res.length() / 2);
raw = res.toString().getBytes(StandardCharsets.UTF_8);
}
res.insert(res.length() / 2, "...");
}
}
public static String rewriteAfterRename(File beforeDir, File afterDir, String path) {
if (path == null) return null;
final File result = rewriteAfterRename(beforeDir, afterDir, new File(path));
return (result != null) ? result.getAbsolutePath() : null;
}
public static String[] rewriteAfterRename(File beforeDir, File afterDir, String[] paths) {
if (paths == null) return null;
final String[] result = new String[paths.length];
for (int i = 0; i < paths.length; i++) {
result[i] = rewriteAfterRename(beforeDir, afterDir, paths[i]);
}
return result;
}
/**
* Given a path under the "before" directory, rewrite it to live under the
* "after" directory. For example, {@code /before/foo/bar.txt} would become
* {@code /after/foo/bar.txt}.
*/
public static File rewriteAfterRename(File beforeDir, File afterDir, File file) {
if (file == null || beforeDir == null || afterDir == null) return null;
if (contains(beforeDir, file)) {
final String splice = file.getAbsolutePath().substring(
beforeDir.getAbsolutePath().length());
return new File(afterDir, splice);
}
return null;
}
public static String formatFileCount(int count) {
String value = NumberFormat.getInstance().format(count);
return count == 0 ? "empty" : value + " file" + (count == 1 ? "" : "s");
}
private static List<File> searchFiles(File dir, FilenameFilter filter) {
List<File> result = new ArrayList<File>();
File[] filesFiltered = dir.listFiles(filter), filesAll = dir.listFiles();
if (filesFiltered != null) {
result.addAll(Arrays.asList(filesFiltered));
}
if (filesAll != null) {
for (File file : filesAll) {
if (file.isDirectory()) {
List<File> deeperList = searchFiles(file, filter);
result.addAll(deeperList);
}
}
}
return result;
}
public static ArrayList<File> searchDirectory(String searchPath, String searchQuery) {
ArrayList<File> totalList = new ArrayList<File>();
File searchDirectory = new File(searchPath);
totalList.addAll(searchFiles(searchDirectory, new SearchFilter(searchQuery)));
return totalList;
}
public static boolean moveFile(File fileFrom, File fileTo, String name) {
if (fileTo.isDirectory() && fileTo.canWrite()) {
if (fileFrom.isFile()) {
return copyFile(fileFrom, fileTo, name);
} else if (fileFrom.isDirectory()) {
File[] filesInDir = fileFrom.listFiles();
File filesToDir = new File(fileTo, fileFrom.getName());
if (!filesToDir.mkdirs()) {
return false;
}
for (int i = 0; i < filesInDir.length; i++) {
moveFile(filesInDir[i], filesToDir, null);
}
return true;
}
} else {
return false;
}
return false;
}
public static boolean copyFile(File file, File dest, String name) {
if (!file.exists() || file.isDirectory()) {
Log.v(TAG, "copyFile: file not exist or is directory, " + file);
return false;
}
BufferedOutputStream bos = null;
BufferedInputStream bis = null;
byte[] data = new byte[BUFFER];
int read = 0;
FileInputStream fi = null;
FileOutputStream fo = null;
try {
fi = new FileInputStream(file);
if (!dest.exists()) {
if (!dest.mkdirs())
return false;
}
File destFile = new File(dest, !TextUtils.isEmpty(name)
? name + "." + getExtFromFilename(file.getName())
: file.getName());
int n = 0;
while (destFile.exists() && n++ < 32) {
String destName =
(!TextUtils.isEmpty(name)
? name : getNameFromFilename(file.getName())) + " (" + n + ")" + "."
+ getExtFromFilename(file.getName());
destFile = new File(dest, destName);
}
if (!destFile.createNewFile())
return false;
bos = new BufferedOutputStream(new FileOutputStream(destFile));
bis = new BufferedInputStream(new FileInputStream(file));
while ((read = bis.read(data, 0, BUFFER)) != -1)
bos.write(data, 0, read);
return true;
} catch (FileNotFoundException e) {
Log.e(TAG, "copyFile: file not found, " + file);
e.printStackTrace();
} catch (IOException e) {
Log.e(TAG, "copyFile: " + e.toString());
} finally {
try {
//FIXME
//flush and close
bos.flush();
bis.close();
bos.close();
if (fi != null)
fi.close();
if (fo != null)
fo.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return false;
}
public static boolean deleteFile(File file) {
if (file.exists() && file.isFile() && file.canWrite()) {
return file.delete();
} else if (file.isDirectory()) {
if (null != file && file.list() != null && file.list().length == 0) {
return file.delete();
} else {
String[] fileList = file.list();
for (String filePaths : fileList) {
File tempFile = new File(file.getAbsolutePath() + "/" + filePaths);
if (tempFile.isFile()) {
tempFile.delete();
} else {
deleteFile(tempFile);
tempFile.delete();
}
}
}
if (file.exists()) {
return file.delete();
}
}
return false;
}
public static boolean compressFile(File parent, List<File> files) {
boolean success = false;
try {
File dest = new File(parent, FileUtils.getNameFromFilename(files.get(0).getName()) + ".zip");
ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(dest));
compressFile("", zout, files.toArray(new File[files.size()]));
zout.close();
success = true;
} catch (Exception e) {
}
return success;
}
private static void compressFile(String currentDir, ZipOutputStream zout, File[] files) throws Exception {
byte[] buffer = new byte[1024];
for (File fi : files) {
if (fi.isDirectory()) {
compressFile(currentDir + "/" + fi.getName(), zout, fi.listFiles());
continue;
}
ZipEntry ze = new ZipEntry(currentDir + "/" + fi.getName());
FileInputStream fin = new FileInputStream(fi.getPath());
zout.putNextEntry(ze);
int length;
while ((length = fin.read(buffer)) > 0) {
zout.write(buffer, 0, length);
}
zout.closeEntry();
fin.close();
}
}
public static boolean uncompress(File zipFile) {
boolean success = false;
try {
FileInputStream fis = new FileInputStream(zipFile);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
ZipEntry entry;
File destFolder = new File(zipFile.getParent(), FileUtils.getNameFromFilename(zipFile.getName()));
//destFolder.mkdirs();
while ((entry = zis.getNextEntry()) != null) {
File dest = new File(destFolder, entry.getName());
dest.getParentFile().mkdirs();
int size;
byte[] buffer = new byte[2048];
FileOutputStream fos = new FileOutputStream(dest);
BufferedOutputStream bos = new BufferedOutputStream(fos, buffer.length);
while ((size = zis.read(buffer, 0, buffer.length)) != -1) {
bos.write(buffer, 0, size);
}
bos.flush();
bos.close();
}
zis.close();
fis.close();
success = true;
} catch (Exception e) {
}
return success;
}
public static String getExtFromFilename(String filename) {
int dotPosition = filename.lastIndexOf('.');
if (dotPosition != -1) {
return filename.substring(dotPosition + 1, filename.length());
}
return "";
}
public static String getNameFromFilename(String filename) {
int dotPosition = filename.lastIndexOf('.');
if (dotPosition != -1) {
return filename.substring(0, dotPosition);
}
return "";
}
public static String getTypeForFile(File file) {
if (file.isDirectory()) {
return Document.MIME_TYPE_DIR;
} else {
return getTypeForName(file.getName());
}
}
public static String getTypeForName(String name) {
final int lastDot = name.lastIndexOf('.');
if (lastDot >= 0) {
final String extension = name.substring(lastDot + 1).toLowerCase();
final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
if (mime != null) {
return mime;
}
}
return "application/octet-stream";
}
/**
* Remove file extension from name, but only if exact MIME type mapping
* exists. This means we can reapply the extension later.
*/
public static String removeExtension(String mimeType, String name) {
final int lastDot = name.lastIndexOf('.');
if (lastDot >= 0) {
final String extension = name.substring(lastDot + 1).toLowerCase();
final String nameMime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
if (mimeType.equals(nameMime)) {
return name.substring(0, lastDot);
}
}
return name;
}
/**
* Add file extension to name, but only if exact MIME type mapping exists.
*/
public static String addExtension(String mimeType, String name) {
final String extension = MimeTypeMap.getSingleton()
.getExtensionFromMimeType(mimeType);
if (extension != null) {
return name + "." + extension;
}
return name;
}
public static String getName(String filename) {
if (filename == null) {
return null;
}
int index = filename.lastIndexOf(File.separator);
if (index == -1) {
return filename;
} else {
return filename.substring(index+1);
}
}
public static String removeExtension(String filename) {
if (filename == null) {
return null;
}
int index = filename.lastIndexOf('.');
if (index == -1) {
return filename;
} else {
return filename.substring(0, index);
}
}
public static String getFullNameFromFilepath(String filename) {
return removeExtension(getName(filename));
}
public static String getPathFromFilepath(String filepath) {
int index = filepath.lastIndexOf(File.separator);
if (index != -1) {
int end = index + 1;
if (end == 0) {
end++;
}
return filepath.substring(0, end);
}
return "";
}
private static class SearchFilter implements FilenameFilter {
String searchQuery;
boolean onlyFolders;
public SearchFilter(String search) {
this.searchQuery = search;
}
@SuppressWarnings("unused")
public SearchFilter(String search, boolean onlyFolders) {
this.onlyFolders = onlyFolders;
}
@Override
public boolean accept(File dir, String filename) {
if (!onlyFolders && (!filename.startsWith("."))) {
return filename.toLowerCase(Resources.getSystem().getConfiguration().locale).contains(searchQuery);
} else {
if (!dir.isDirectory() && !filename.startsWith(".")) {
return filename.toLowerCase(Resources.getSystem().getConfiguration().locale).contains(searchQuery);
}
}
return false;
}
}
private static final int KILO = 1024;
private static final int MEGA = KILO * KILO;
private static final int GIGA = MEGA * KILO;
/**
* @return A string suitable for display in bytes, kilobytes or megabytes
* depending on its size.
*/
public static String convertToHumanReadableSize(Context context, long size) {
final String count;
if (size == 0) {
return "";
} else if (size < KILO) {
count = String.valueOf(size);
return context.getString(R.string.bytes, count);
} else if (size < MEGA) {
count = String.valueOf(size / KILO);
return context.getString(R.string.kilobytes, count);
} else if (size < GIGA) {
count = String.valueOf(size / MEGA);
return context.getString(R.string.megabytes, count);
}
else {
DecimalFormat onePlace = new DecimalFormat("0.#");
count = onePlace.format((float) size / (float) GIGA);
return context.getString(R.string.gigabytes, count);
}
}
public static String makeFilePath(String parentPath, String name){
if(TextUtils.isEmpty(parentPath) || TextUtils.isEmpty(name)){
return "";
}
return parentPath + File.separator + name;
}
public static String makeFilePath(File parentFile, String name){
if(null == parentFile || TextUtils.isEmpty(name)){
return "";
}
return new File(parentFile, name).getPath();
}
public static void updateMedia(Context context, String... pathsArray){
MediaScannerConnection.scanFile(context, pathsArray, null, new MediaScannerConnection.OnScanCompletedListener() {
@Override
public void onScanCompleted(String s, Uri uri) {
//Log.i("Scanner", "Scanned " + s + ":");
//Log.i("Scanner", "-> uri=" + uri);
}
});
}
public static void updateMedia(Context context, ArrayList<DocumentInfo> docs, String parentPath) {
try {
if(Utils.hasKitKat()){
ArrayList<String> paths = Lists.newArrayList();
for(DocumentInfo doc : docs){
paths.add(parentPath + File.separator + doc.displayName);
}
String[] pathsArray = paths.toArray(new String[paths.size()]);
FileUtils.updateMedia(context, pathsArray);
}
else{
Uri contentUri = Uri.fromFile(new File(parentPath).getParentFile());
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, contentUri);
context.sendBroadcast(mediaScanIntent);
}
}
catch (Exception e){
e.printStackTrace();
}
}
public static void updateMedia(Context context, String path) {
try {
if(Utils.hasKitKat()){
FileUtils.updateMedia(context, new String[]{path});
}
else{
Uri contentUri = Uri.fromFile(new File(path).getParentFile());
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, contentUri);
context.sendBroadcast(mediaScanIntent);
}
}
catch (Exception e){
e.printStackTrace();
}
}
/**
* Generates a unique file name under the given parent directory. If the display name doesn't
* have an extension that matches the requested MIME type, the default extension for that MIME
* type is appended. If a file already exists, the name is appended with a numerical value to
* make it unique.
*
* For example, the display name 'example' with 'text/plain' MIME might produce
* 'example.txt' or 'example (1).txt', etc.
*
* @throws FileNotFoundException
*/
public static File buildUniqueFile(File parent, String mimeType, String displayName)
throws FileNotFoundException {
String name;
String ext;
if (Document.MIME_TYPE_DIR.equals(mimeType)) {
name = displayName;
ext = null;
} else {
String mimeTypeFromExt;
// Extract requested extension from display name
final int lastDot = displayName.lastIndexOf('.');
if (lastDot >= 0) {
name = displayName.substring(0, lastDot);
ext = displayName.substring(lastDot + 1);
mimeTypeFromExt = MimeTypeMap.getSingleton().getMimeTypeFromExtension(
ext.toLowerCase());
} else {
name = displayName;
ext = null;
mimeTypeFromExt = null;
}
if (mimeTypeFromExt == null) {
mimeTypeFromExt = "application/octet-stream";
}
final String extFromMimeType = MimeTypeMap.getSingleton().getExtensionFromMimeType(
mimeType);
if (dev.dworks.apps.anexplorer.libcore.util.Objects.equals(mimeType, mimeTypeFromExt)
|| dev.dworks.apps.anexplorer.libcore.util.Objects.equals(ext, extFromMimeType)) {
// Extension maps back to requested MIME type; allow it
} else {
// No match; insist that create file matches requested MIME
name = displayName;
ext = extFromMimeType;
}
}
File file = buildFile(parent, name, ext);
// If conflicting file, try adding counter suffix
int n = 0;
while (file.exists()) {
if (n++ >= 32) {
throw new FileNotFoundException("Failed to create unique file");
}
file = buildFile(parent, name + " (" + n + ")", ext);
}
return file;
}
private static File buildFile(File parent, String name, String ext) {
if (TextUtils.isEmpty(ext)) {
return new File(parent, name);
} else {
return new File(parent, name + "." + ext);
}
}
public static @NonNull File[] listFilesOrEmpty(File dir) {
File[] res = dir.listFiles();
if (res != null) {
return res;
} else {
return EMPTY;
}
}
} | [
"heart.break.kid.b4u@gmail.com"
] | heart.break.kid.b4u@gmail.com |
52f24fcffe33333a70a9075337cb417f39b86e32 | a00326c0e2fc8944112589cd2ad638b278f058b9 | /src/main/java/000/132/207/CWE191_Integer_Underflow__int_URLConnection_multiply_31.java | a962439cd33678ee74ee409c3ea59e977e753621 | [] | no_license | Lanhbao/Static-Testing-for-Juliet-Test-Suite | 6fd3f62713be7a084260eafa9ab221b1b9833be6 | b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68 | refs/heads/master | 2020-08-24T13:34:04.004149 | 2019-10-25T09:26:00 | 2019-10-25T09:26:00 | 216,822,684 | 0 | 1 | null | 2019-11-08T09:51:54 | 2019-10-22T13:37:13 | Java | UTF-8 | Java | false | false | 8,616 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE191_Integer_Underflow__int_URLConnection_multiply_31.java
Label Definition File: CWE191_Integer_Underflow__int.label.xml
Template File: sources-sinks-31.tmpl.java
*/
/*
* @description
* CWE: 191 Integer Underflow
* BadSource: URLConnection Read data from a web server with URLConnection
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: multiply
* GoodSink: Ensure there will not be an underflow before multiplying data by 2
* BadSink : If data is negative, multiply by 2, which can cause an underflow
* Flow Variant: 31 Data flow: make a copy of data within the same method
*
* */
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
public class CWE191_Integer_Underflow__int_URLConnection_multiply_31 extends AbstractTestCase
{
public void bad() throws Throwable
{
int dataCopy;
{
int data;
data = Integer.MIN_VALUE; /* Initialize data */
/* read input from URLConnection */
{
URLConnection urlConnection = (new URL("http://www.example.org/")).openConnection();
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
try
{
readerInputStream = new InputStreamReader(urlConnection.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data from a web server with URLConnection */
/* This will be reading the first "line" of the response body,
* which could be very long if there are no newlines in the HTML */
String stringNumber = readerBuffered.readLine();
if (stringNumber != null) // avoid NPD incidental warnings
{
try
{
data = Integer.parseInt(stringNumber.trim());
}
catch (NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat);
}
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (readerBuffered != null)
{
readerBuffered.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStream != null)
{
readerInputStream.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
}
}
dataCopy = data;
}
{
int data = dataCopy;
if(data < 0) /* ensure we won't have an overflow */
{
/* POTENTIAL FLAW: if (data * 2) < Integer.MIN_VALUE, this will underflow */
int result = (int)(data * 2);
IO.writeLine("result: " + result);
}
}
}
public void good() throws Throwable
{
goodG2B();
goodB2G();
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
int dataCopy;
{
int data;
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
dataCopy = data;
}
{
int data = dataCopy;
if(data < 0) /* ensure we won't have an overflow */
{
/* POTENTIAL FLAW: if (data * 2) < Integer.MIN_VALUE, this will underflow */
int result = (int)(data * 2);
IO.writeLine("result: " + result);
}
}
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G() throws Throwable
{
int dataCopy;
{
int data;
data = Integer.MIN_VALUE; /* Initialize data */
/* read input from URLConnection */
{
URLConnection urlConnection = (new URL("http://www.example.org/")).openConnection();
BufferedReader readerBuffered = null;
InputStreamReader readerInputStream = null;
try
{
readerInputStream = new InputStreamReader(urlConnection.getInputStream(), "UTF-8");
readerBuffered = new BufferedReader(readerInputStream);
/* POTENTIAL FLAW: Read data from a web server with URLConnection */
/* This will be reading the first "line" of the response body,
* which could be very long if there are no newlines in the HTML */
String stringNumber = readerBuffered.readLine();
if (stringNumber != null) // avoid NPD incidental warnings
{
try
{
data = Integer.parseInt(stringNumber.trim());
}
catch (NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat);
}
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO);
}
finally
{
/* clean up stream reading objects */
try
{
if (readerBuffered != null)
{
readerBuffered.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO);
}
try
{
if (readerInputStream != null)
{
readerInputStream.close();
}
}
catch (IOException exceptIO)
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO);
}
}
}
dataCopy = data;
}
{
int data = dataCopy;
if(data < 0) /* ensure we won't have an overflow */
{
/* FIX: Add a check to prevent an underflow from occurring */
if (data > (Integer.MIN_VALUE/2))
{
int result = (int)(data * 2);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too small to perform multiplication.");
}
}
}
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"anhtluet12@gmail.com"
] | anhtluet12@gmail.com |
0fb4cb48c9bf138f6fd270dec09944fa80535523 | af51bbb45a3331aaf44fe384447e05337eec7e02 | /app/src/main/java/com/example/huawei/assignment/MainActivity.java | 75dd752cd9f3564ff1c91512b232e2d74db8f144 | [] | no_license | qiuyuenheng/assignment | 1c8f85d7b54a60db3f1485ce128f6e6d44675b49 | c0ac8b431dae34f9695a7a7c7514200efc6dfa78 | refs/heads/master | 2020-04-11T11:47:03.577927 | 2018-12-14T09:10:14 | 2018-12-14T09:10:14 | 161,759,244 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | package com.example.huawei.assignment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.LinearLayout;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private List<people> peopleList = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initpeople();
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycle_view);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
recyclerView.setLayoutManager(layoutManager);
peopleAdapter adapter = new peopleAdapter(peopleList);
recyclerView.setAdapter(adapter);
}
private void initpeople(){
for (int i = 0; i < 13; i++)
{
people kenan = new people("kenan", R.drawable.kenan_pic);
peopleList.add(kenan);
}
}
}
| [
"1515795340@qq.com"
] | 1515795340@qq.com |
0f090ae08602023ec88a86b080e6023eb3a6828d | 0a962f363052ffe55173574e97689532abd7b02c | /src/Participant.java | 6622fa7f6cb1fdc826b6dbf0412c9edc3e86f9ef | [] | no_license | Shae1507/gestion-event | f13930ec3380b0983c329ed41321412ca250296f | ec9bd3f7d661ff4ca0d384818cebd8b81dbaa87f | refs/heads/master | 2020-04-18T11:50:50.608483 | 2019-01-25T08:41:37 | 2019-01-25T08:41:37 | 167,514,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 891 | java |
public class Participant {
private String nom;
private String prenom;
private String email;
private String pseudo;
private int rang;
public Participant(String nom, String prenom, String email, String pseudo, int rang) {
super();
this.nom = nom;
this.prenom = prenom;
this.email = email;
this.pseudo = pseudo;
this.rang = rang;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPseudo() {
return pseudo;
}
public void setPseudo(String pseudo) {
this.pseudo = pseudo;
}
public int getRang() {
return rang;
}
public void setRang(int rang) {
this.rang = rang;
}
}
| [
"lou.bouret@hotmail.fr"
] | lou.bouret@hotmail.fr |
bd0fb283295306e15183ed00eb49a1b03f57b829 | bc5fc4804b2ed12c1be9368102341ea591d01814 | /src/main/java/com/example/servingwebcontent/AccessingDataJpaApplication.java | ac10123bfa008cb78bb11ce6d04c1e84461f5a83 | [] | no_license | guiwil17/Site_web_java | 657d75215a005c1ad6bf5aa2db70b8281c8f6e99 | 78458d789c3c86faf4ce829a54932e7da19e4020 | refs/heads/master | 2023-05-26T23:00:05.704940 | 2021-06-09T12:45:37 | 2021-06-09T12:45:37 | 373,578,589 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,139 | java | package com.example.servingwebcontent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class AccessingDataJpaApplication {
private static final Logger log = LoggerFactory.getLogger(AccessingDataJpaApplication.class);
public static void main(String[] args) {
SpringApplication.run(AccessingDataJpaApplication.class);
}
@Bean
public CommandLineRunner demo(CustomerRepository repository) {
return (args) -> {
// save a few customers
repository.save(new Customer("Jack", "Bauer"));
repository.save(new Customer("Chloe", "O'Brian"));
repository.save(new Customer("Kim", "Bauer"));
repository.save(new Customer("David", "Palmer"));
repository.save(new Customer("Michelle", "Dessler"));
// fetch all customers
log.info("Customers found with findAll():");
log.info("-------------------------------");
for (Customer customer : repository.findAll()) {
log.info(customer.toString());
}
log.info("");
// fetch an individual customer by ID
Customer customer = repository.findById(1L);
log.info("Customer found with findById(1L):");
log.info("--------------------------------");
log.info(customer.toString());
log.info("");
// fetch customers by last name
log.info("Customer found with findByLastName('Bauer'):");
log.info("--------------------------------------------");
repository.findByLastName("Bauer").forEach(bauer -> {
log.info(bauer.toString());
});
// for (Customer bauer : repository.findByLastName("Bauer")) {
// log.info(bauer.toString());
// }
log.info("");
};
}
} | [
"guillaume.sol@etudiant.univ-reims.fr"
] | guillaume.sol@etudiant.univ-reims.fr |
2630d16ee403f2018aed58daf23cf7d50524c5ce | 1977757fa8a337e3346795cfb1ceca9ae95b97fb | /src/day25/Task1.java | ba8c43783f8756b9bf5b1f155e313593c2541318 | [] | no_license | Tarana82/MyFirstProject | fcb3e81c3659e9f846a71c7856fcf4ba914e15ad | 6fe9bb5f1d90812f6c2e5ef68ba275435a7cabce | refs/heads/master | 2021-02-11T16:22:21.801471 | 2020-03-03T03:33:39 | 2020-03-03T03:33:39 | 244,509,280 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 280 | java | package day25;
import java.util.Arrays;
public class Task1 {
public static void main(String[] args) {
String myName = "Tarana";
char [] myNamesChar = myName.toCharArray();
System.out.println("My name Char = " + Arrays.toString(myNamesChar));
}
}
| [
"tahmadova1982@gmail.com"
] | tahmadova1982@gmail.com |
ca5ddc45b78724a75a130098ec69280d26c8bb2b | 7069e18be7df2e665c36d223836b06ce4cf32f89 | /KMobRevamp/src/main/java/kmobrevamp/repository/ComplaintRepository.java | 9b78e1c66c85251ad51ac03c3927aafcde4cf566 | [] | no_license | gauravsaini296217/git-projs | a62797b3261a8e9e2d05c611635d32d373fe802a | 35c1f189b50d13f229895d426b4e6167f45cf736 | refs/heads/master | 2021-06-19T04:15:08.568715 | 2017-07-07T14:09:52 | 2017-07-07T14:09:52 | 93,486,691 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package kmobrevamp.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import kmobrevamp.model.Complaint;
@Repository("complaintRepository")
public interface ComplaintRepository extends JpaRepository<Complaint,String> {
Complaint findBySno(String sno);
}
| [
"gauravsaini296217@gmail.com"
] | gauravsaini296217@gmail.com |
b3974c627f931d2d362226991d2a8ef498a84bdc | f98229848913cf1146533a507e4658a3847fbdef | /app/src/main/java/edu/dyanakev/finalappproject/DatabaseHandler.java | 38e004f530bb063b9f5b3423597397911d2811bb | [] | no_license | MitaKxD/MAD_FINAL_Project | 0cdcb6fc8529fb7ae72251c4dca1c5b277b699a1 | f81b52d79c0569e665879b424ac09830c0b314e7 | refs/heads/master | 2023-02-03T00:00:01.295375 | 2020-12-23T00:12:23 | 2020-12-23T00:12:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,302 | java | package edu.dyanakev.finalappproject;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.List;
public class DatabaseHandler extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "project3game";
private static final String TABLE_HI_SCORES = "hi_scores";
private static final String KEY_SCORE_ID = "score_id";
private static final String KEY_PLAYER_NAME = "player_name";
private static final String KEY_GAME_DATE = "game_date";
private static final String KEY_SCORE = "score";
public DatabaseHandler(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
//3rd argument to be passed is CursorFactory instance
}
// Creating Tables
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_HISCORES_TABLE = "CREATE TABLE " + TABLE_HI_SCORES + "(" +
KEY_SCORE_ID + " INTEGER PRIMARY KEY," +
KEY_GAME_DATE + " TEXT NOT NULL," +
KEY_PLAYER_NAME + " TEXT NOT NULL," +
KEY_SCORE + " INTEGER NOT NULL" +
")";
db.execSQL(CREATE_HISCORES_TABLE);
}
// Upgrading database
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// Drop older table if existed
db.execSQL("DROP TABLE IF EXISTS " + TABLE_HI_SCORES);
// Create tables again
onCreate(db);
}
/*
* CRUD Helper methods
*/
public void emptyHiScores() {
// Drop older table if existed
SQLiteDatabase db = this.getWritableDatabase();
db.execSQL("DROP TABLE IF EXISTS " + TABLE_HI_SCORES);
// Create tables again
onCreate(db);
}
// code to add the new hiScore
void addHiScore(HiScore hiScore) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_GAME_DATE, hiScore.getGame_date());
values.put(KEY_PLAYER_NAME, hiScore.getPlayer_name());
values.put(KEY_SCORE, hiScore.getScore());
// Inserting Row
db.insert(TABLE_HI_SCORES, null, values);
//2nd argument is String containing nullColumnHack
db.close(); // Closing database connection
}
// code to get the single hiScore
HiScore getHiScore(int id) {
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.query(TABLE_HI_SCORES, new String[]{
KEY_SCORE_ID,
KEY_GAME_DATE,
KEY_PLAYER_NAME,
KEY_SCORE},
KEY_SCORE_ID + "=?",
new String[]{String.valueOf(id)}, null, null, null, null);
if (cursor != null)
cursor.moveToFirst();
HiScore hiScore = new HiScore(Integer.parseInt(
cursor.getString(0)),
cursor.getString(1),
cursor.getString(2),
cursor.getInt(3));
// return hi score
return hiScore;
}
// code to get all hiScores in a list view
public List<HiScore> getAllHiScores() {
List<HiScore> hiScoreList = new ArrayList<HiScore>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_HI_SCORES;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// looping through all rows and adding to list
if (cursor.moveToFirst()) {
do {
HiScore hiScore = new HiScore();
hiScore.setScore_id(Integer.parseInt(cursor.getString(0)));
hiScore.setGame_date(cursor.getString(1));
hiScore.setPlayer_name(cursor.getString(2));
hiScore.setScore(cursor.getInt(3));
// Adding hi score to list
hiScoreList.add(hiScore);
} while (cursor.moveToNext());
}
// return hiScore list
return hiScoreList;
}
// Getting top 5 scores
public List<HiScore> getTopFiveScores() {
List<HiScore> hiScoreList = new ArrayList<HiScore>();
// Select All Query
String selectQuery = "SELECT * FROM " + TABLE_HI_SCORES +
" ORDER BY SCORE DESC " +
" LIMIT 5";
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// Loops throuhg all the rows and adds it to the list
if (cursor.moveToFirst()) {
do {
HiScore hiScore = new HiScore();
hiScore.setScore_id(Integer.parseInt(cursor.getString(0)));
hiScore.setGame_date(cursor.getString(1));
hiScore.setPlayer_name(cursor.getString(2));
hiScore.setScore(cursor.getInt(3));
// Adding High Score list
hiScoreList.add(hiScore);
} while (cursor.moveToNext());
}
// return hi score list
return hiScoreList;
}
} | [
"s00189753@mail.itsligo.ie"
] | s00189753@mail.itsligo.ie |
43319bb67ebcb20ff2154eaab66e1f19ee440fcc | 3c782b41bca4dca6fa32e87efe5e77758c459956 | /example/android/app/build/generated/source/r/debug/com/facebook/drawee/R.java | c7907757b5c94c8b726da84c72cd989a1e529417 | [] | no_license | AloPeyk/AloPeykPicker | e3b864b4d187ef07463d6c760b2d669caa02d4cb | e089cfa2fd50044d6b132e4246e80488cf7bf741 | refs/heads/master | 2021-07-16T23:35:06.435504 | 2018-10-21T12:01:57 | 2018-10-21T12:01:57 | 152,074,573 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,280 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package com.facebook.drawee;
public final class R {
public static final class attr {
public static final int actualImageResource = 0x7f010106;
public static final int actualImageScaleType = 0x7f0100d3;
public static final int actualImageUri = 0x7f010105;
public static final int backgroundImage = 0x7f0100d4;
public static final int fadeDuration = 0x7f0100c8;
public static final int failureImage = 0x7f0100ce;
public static final int failureImageScaleType = 0x7f0100cf;
public static final int overlayImage = 0x7f0100d5;
public static final int placeholderImage = 0x7f0100ca;
public static final int placeholderImageScaleType = 0x7f0100cb;
public static final int pressedStateOverlayImage = 0x7f0100d6;
public static final int progressBarAutoRotateInterval = 0x7f0100d2;
public static final int progressBarImage = 0x7f0100d0;
public static final int progressBarImageScaleType = 0x7f0100d1;
public static final int retryImage = 0x7f0100cc;
public static final int retryImageScaleType = 0x7f0100cd;
public static final int roundAsCircle = 0x7f0100d7;
public static final int roundBottomEnd = 0x7f0100e0;
public static final int roundBottomLeft = 0x7f0100dc;
public static final int roundBottomRight = 0x7f0100db;
public static final int roundBottomStart = 0x7f0100df;
public static final int roundTopEnd = 0x7f0100de;
public static final int roundTopLeft = 0x7f0100d9;
public static final int roundTopRight = 0x7f0100da;
public static final int roundTopStart = 0x7f0100dd;
public static final int roundWithOverlayColor = 0x7f0100e1;
public static final int roundedCornerRadius = 0x7f0100d8;
public static final int roundingBorderColor = 0x7f0100e3;
public static final int roundingBorderPadding = 0x7f0100e4;
public static final int roundingBorderWidth = 0x7f0100e2;
public static final int viewAspectRatio = 0x7f0100c9;
}
public static final class id {
public static final int center = 0x7f0c0033;
public static final int centerCrop = 0x7f0c0034;
public static final int centerInside = 0x7f0c0035;
public static final int fitBottomStart = 0x7f0c0036;
public static final int fitCenter = 0x7f0c0037;
public static final int fitEnd = 0x7f0c0038;
public static final int fitStart = 0x7f0c0039;
public static final int fitXY = 0x7f0c003a;
public static final int focusCrop = 0x7f0c003b;
public static final int none = 0x7f0c0016;
}
public static final class styleable {
public static final int[] GenericDraweeHierarchy = { 0x7f0100c8, 0x7f0100c9, 0x7f0100ca, 0x7f0100cb, 0x7f0100cc, 0x7f0100cd, 0x7f0100ce, 0x7f0100cf, 0x7f0100d0, 0x7f0100d1, 0x7f0100d2, 0x7f0100d3, 0x7f0100d4, 0x7f0100d5, 0x7f0100d6, 0x7f0100d7, 0x7f0100d8, 0x7f0100d9, 0x7f0100da, 0x7f0100db, 0x7f0100dc, 0x7f0100dd, 0x7f0100de, 0x7f0100df, 0x7f0100e0, 0x7f0100e1, 0x7f0100e2, 0x7f0100e3, 0x7f0100e4 };
public static final int GenericDraweeHierarchy_actualImageScaleType = 11;
public static final int GenericDraweeHierarchy_backgroundImage = 12;
public static final int GenericDraweeHierarchy_fadeDuration = 0;
public static final int GenericDraweeHierarchy_failureImage = 6;
public static final int GenericDraweeHierarchy_failureImageScaleType = 7;
public static final int GenericDraweeHierarchy_overlayImage = 13;
public static final int GenericDraweeHierarchy_placeholderImage = 2;
public static final int GenericDraweeHierarchy_placeholderImageScaleType = 3;
public static final int GenericDraweeHierarchy_pressedStateOverlayImage = 14;
public static final int GenericDraweeHierarchy_progressBarAutoRotateInterval = 10;
public static final int GenericDraweeHierarchy_progressBarImage = 8;
public static final int GenericDraweeHierarchy_progressBarImageScaleType = 9;
public static final int GenericDraweeHierarchy_retryImage = 4;
public static final int GenericDraweeHierarchy_retryImageScaleType = 5;
public static final int GenericDraweeHierarchy_roundAsCircle = 15;
public static final int GenericDraweeHierarchy_roundBottomEnd = 24;
public static final int GenericDraweeHierarchy_roundBottomLeft = 20;
public static final int GenericDraweeHierarchy_roundBottomRight = 19;
public static final int GenericDraweeHierarchy_roundBottomStart = 23;
public static final int GenericDraweeHierarchy_roundTopEnd = 22;
public static final int GenericDraweeHierarchy_roundTopLeft = 17;
public static final int GenericDraweeHierarchy_roundTopRight = 18;
public static final int GenericDraweeHierarchy_roundTopStart = 21;
public static final int GenericDraweeHierarchy_roundWithOverlayColor = 25;
public static final int GenericDraweeHierarchy_roundedCornerRadius = 16;
public static final int GenericDraweeHierarchy_roundingBorderColor = 27;
public static final int GenericDraweeHierarchy_roundingBorderPadding = 28;
public static final int GenericDraweeHierarchy_roundingBorderWidth = 26;
public static final int GenericDraweeHierarchy_viewAspectRatio = 1;
public static final int[] SimpleDraweeView = { 0x7f0100c8, 0x7f0100c9, 0x7f0100ca, 0x7f0100cb, 0x7f0100cc, 0x7f0100cd, 0x7f0100ce, 0x7f0100cf, 0x7f0100d0, 0x7f0100d1, 0x7f0100d2, 0x7f0100d3, 0x7f0100d4, 0x7f0100d5, 0x7f0100d6, 0x7f0100d7, 0x7f0100d8, 0x7f0100d9, 0x7f0100da, 0x7f0100db, 0x7f0100dc, 0x7f0100dd, 0x7f0100de, 0x7f0100df, 0x7f0100e0, 0x7f0100e1, 0x7f0100e2, 0x7f0100e3, 0x7f0100e4, 0x7f010105, 0x7f010106 };
public static final int SimpleDraweeView_actualImageResource = 30;
public static final int SimpleDraweeView_actualImageScaleType = 11;
public static final int SimpleDraweeView_actualImageUri = 29;
public static final int SimpleDraweeView_backgroundImage = 12;
public static final int SimpleDraweeView_fadeDuration = 0;
public static final int SimpleDraweeView_failureImage = 6;
public static final int SimpleDraweeView_failureImageScaleType = 7;
public static final int SimpleDraweeView_overlayImage = 13;
public static final int SimpleDraweeView_placeholderImage = 2;
public static final int SimpleDraweeView_placeholderImageScaleType = 3;
public static final int SimpleDraweeView_pressedStateOverlayImage = 14;
public static final int SimpleDraweeView_progressBarAutoRotateInterval = 10;
public static final int SimpleDraweeView_progressBarImage = 8;
public static final int SimpleDraweeView_progressBarImageScaleType = 9;
public static final int SimpleDraweeView_retryImage = 4;
public static final int SimpleDraweeView_retryImageScaleType = 5;
public static final int SimpleDraweeView_roundAsCircle = 15;
public static final int SimpleDraweeView_roundBottomEnd = 24;
public static final int SimpleDraweeView_roundBottomLeft = 20;
public static final int SimpleDraweeView_roundBottomRight = 19;
public static final int SimpleDraweeView_roundBottomStart = 23;
public static final int SimpleDraweeView_roundTopEnd = 22;
public static final int SimpleDraweeView_roundTopLeft = 17;
public static final int SimpleDraweeView_roundTopRight = 18;
public static final int SimpleDraweeView_roundTopStart = 21;
public static final int SimpleDraweeView_roundWithOverlayColor = 25;
public static final int SimpleDraweeView_roundedCornerRadius = 16;
public static final int SimpleDraweeView_roundingBorderColor = 27;
public static final int SimpleDraweeView_roundingBorderPadding = 28;
public static final int SimpleDraweeView_roundingBorderWidth = 26;
public static final int SimpleDraweeView_viewAspectRatio = 1;
}
}
| [
"h.ahmadi@alopeyk.com"
] | h.ahmadi@alopeyk.com |
7ed6adb8b4f94d3e42d0684d56f11d7e7e6399b8 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/16/16_975a2fc3361007f11c42de4047d37024095bec3d/DataSetIterator/16_975a2fc3361007f11c42de4047d37024095bec3d_DataSetIterator_t.java | 6f09fdfcd611ace4bf410f26a9d3a3825a49bf12 | [] | 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 | 33,787 | java | /*
*************************************************************************
* Copyright (c) 2006 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
*
*************************************************************************
*/
package org.eclipse.birt.report.data.adapter.impl;
import java.math.BigDecimal;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.birt.core.data.DataType;
import org.eclipse.birt.core.data.DataTypeUtil;
import org.eclipse.birt.core.data.ExpressionUtil;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.core.script.JavascriptEvalUtil;
import org.eclipse.birt.data.engine.api.IGroupDefinition;
import org.eclipse.birt.data.engine.api.IResultIterator;
import org.eclipse.birt.data.engine.api.querydefn.Binding;
import org.eclipse.birt.data.engine.api.querydefn.GroupDefinition;
import org.eclipse.birt.data.engine.api.querydefn.QueryDefinition;
import org.eclipse.birt.data.engine.api.querydefn.ScriptExpression;
import org.eclipse.birt.data.engine.core.DataException;
import org.eclipse.birt.data.engine.olap.data.api.cube.IDatasetIterator;
import org.eclipse.birt.data.engine.olap.util.OlapExpressionUtil;
import org.eclipse.birt.report.data.adapter.api.AdapterException;
import org.eclipse.birt.report.data.adapter.api.DataAdapterUtil;
import org.eclipse.birt.report.data.adapter.api.DataRequestSession;
import org.eclipse.birt.report.data.adapter.group.GroupCalculatorFactory;
import org.eclipse.birt.report.data.adapter.group.ICalculator;
import org.eclipse.birt.report.data.adapter.i18n.AdapterResourceHandle;
import org.eclipse.birt.report.data.adapter.i18n.ResourceConstants;
import org.eclipse.birt.report.data.adapter.internal.adapter.GroupAdapter;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.DimensionConditionHandle;
import org.eclipse.birt.report.model.api.DimensionJoinConditionHandle;
import org.eclipse.birt.report.model.api.FilterConditionHandle;
import org.eclipse.birt.report.model.api.LevelAttributeHandle;
import org.eclipse.birt.report.model.api.RuleHandle;
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
import org.eclipse.birt.report.model.api.olap.CubeHandle;
import org.eclipse.birt.report.model.api.olap.DimensionHandle;
import org.eclipse.birt.report.model.api.olap.MeasureGroupHandle;
import org.eclipse.birt.report.model.api.olap.MeasureHandle;
import org.eclipse.birt.report.model.api.olap.TabularCubeHandle;
import org.eclipse.birt.report.model.api.olap.TabularDimensionHandle;
import org.eclipse.birt.report.model.api.olap.TabularHierarchyHandle;
import org.eclipse.birt.report.model.api.olap.TabularLevelHandle;
import org.mozilla.javascript.BaseFunction;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
/**
* This is an implementation of IDatasetIterator interface.
*
*/
public class DataSetIterator implements IDatasetIterator
{
private static final String DATE_TIME_ATTR_NAME = "DateTime";
//
private boolean started = false;
private IResultIterator it;
private ResultMeta metadata;
private static long nullTime;
static
{
Calendar c = Calendar.getInstance( );
c.clear( );
c.set( 0, 0, 1, 0, 0, 0 );
nullTime = c.getTimeInMillis( );
}
/**
* Create DataSetIterator for a hierarchy.
*
* @param session
* @param hierHandle
* @throws BirtException
*/
public DataSetIterator( DataRequestSessionImpl session,
TabularHierarchyHandle hierHandle ) throws AdapterException
{
this( session, hierHandle, null );
}
/**
* Create DataSetIterator for a hierarchy.
*
* @param session
* @param hierHandle
* @throws BirtException
*/
public DataSetIterator( DataRequestSessionImpl session,
TabularHierarchyHandle hierHandle, Map appContext ) throws AdapterException
{
QueryDefinition query = new QueryDefinition( );
query.setUsesDetails( false );
query.setDataSetName( getDataSet ( hierHandle ) );
List metaList = new ArrayList( );
this.prepareLevels( query,
hierHandle, metaList, null );
popualteFilter( session, getFilterIterator( hierHandle ), query );
executeQuery( session, query, appContext );
this.metadata = new ResultMeta( metaList );
}
private String getDataSet( TabularHierarchyHandle handle )
{
if ( handle.getDataSet( )!= null )
return handle.getDataSet( ).getQualifiedName( );
else
{
TabularCubeHandle cubeHandle = this.acquireContainerCube( handle );
if( cubeHandle!= null )
return cubeHandle.getDataSet( ).getQualifiedName( );
}
return null;
}
private Iterator getFilterIterator( TabularHierarchyHandle handle )
{
if ( handle.getDataSet( )!= null )
return handle.filtersIterator( );
else
{
TabularCubeHandle cubeHandle = this.acquireContainerCube( handle );
if( cubeHandle!= null )
return cubeHandle.filtersIterator( );
}
return new ArrayList().iterator( );
}
private TabularCubeHandle acquireContainerCube( TabularHierarchyHandle hierHandle )
{
DesignElementHandle handle = hierHandle.getContainer( ).getContainer( );
if( handle == null || !(handle instanceof TabularCubeHandle))
return null;
return (TabularCubeHandle)handle;
}
private void executeQuery( DataRequestSessionImpl session, QueryDefinition query, Map appContext )
throws AdapterException
{
try
{
Scriptable scope = session.getScope( );
TempDateTransformer tt = new TempDateTransformer();
ScriptableObject.putProperty( scope, tt.getClassName( ), tt );
this.it = session.prepare( query, appContext ).execute( scope ).getResultIterator( );
}
catch ( BirtException e )
{
throw new AdapterException( e.getLocalizedMessage( ), e );
}
}
/**
*
* @param session
* @param cubeHandle
* @param appContext
* @throws BirtException
*/
public DataSetIterator( DataRequestSessionImpl session,
TabularCubeHandle cubeHandle ) throws BirtException
{
this( session, cubeHandle, null );
}
/**
* Create DataSetIterator for fact table.
*
* @param session
* @param cubeHandle
* @throws BirtException
*/
public DataSetIterator( DataRequestSessionImpl session,
TabularCubeHandle cubeHandle, Map appContext ) throws BirtException
{
QueryDefinition query = new QueryDefinition( );
query.setUsesDetails( false );
query.setDataSetName( cubeHandle.getDataSet( ).getQualifiedName( ) );
List dimensions = cubeHandle.getContents( CubeHandle.DIMENSIONS_PROP );
List metaList = new ArrayList();
if ( dimensions != null )
{
for ( int i = 0; i < dimensions.size( ); i++ )
{
TabularDimensionHandle dimension = (TabularDimensionHandle) dimensions.get( i );
List hiers = dimension.getContents( DimensionHandle.HIERARCHIES_PROP );
//By now we only support one hierarchy per dimension.
assert hiers.size( ) == 1;
TabularHierarchyHandle hierHandle = (TabularHierarchyHandle) hiers.get( 0 );
if ( hierHandle.getDataSet( ) == null
|| hierHandle.getDataSet( )
.getQualifiedName( )
.equals( cubeHandle.getDataSet( ).getQualifiedName( ) ) )
{
prepareLevels( query,
hierHandle,
metaList,
dimension.getName());
}
else
{
Iterator it = cubeHandle.joinConditionsIterator( );
while ( it.hasNext( ) )
{
DimensionConditionHandle dimCondHandle = (DimensionConditionHandle) it.next( );
if ( dimCondHandle.getHierarchy( ).equals( hierHandle ) )
{
Iterator conditionIt = dimCondHandle.getJoinConditions( )
.iterator( );
while ( conditionIt.hasNext( ) )
{
DimensionJoinConditionHandle joinCondition = (DimensionJoinConditionHandle) conditionIt.next( );
String cubeKey = joinCondition.getCubeKey( );
String cubeKeyWithDimIdentifier = OlapExpressionUtil.getQualifiedLevelName( dimension.getName( ),
cubeKey );
metaList.add( new ColumnMeta( cubeKeyWithDimIdentifier,
null,
ColumnMeta.LEVEL_KEY_TYPE ) );
query.addBinding( new Binding( cubeKeyWithDimIdentifier,
new ScriptExpression( ExpressionUtil.createJSDataSetRowExpression( cubeKey ) ) ) );
GroupDefinition gd = new GroupDefinition( String.valueOf( query.getGroups( )
.size( ) ) );
gd.setKeyExpression( ExpressionUtil.createJSRowExpression( cubeKeyWithDimIdentifier ) );
query.addGroup( gd );
}
}
}
}
}
}
prepareMeasure( cubeHandle, query, metaList );
this.popualteFilter( session, cubeHandle.filtersIterator( ), query );
executeQuery( session, query, appContext );
this.metadata = new ResultMeta( metaList );
}
/**
*
* @param session
* @param filterIterator
* @param query
*/
private void popualteFilter( DataRequestSession session,
Iterator filterIterator, QueryDefinition query )
{
while( filterIterator.hasNext( ) )
{
FilterConditionHandle filter = (FilterConditionHandle) filterIterator.next( );
query.addFilter( session.getModelAdaptor( ).adaptFilter( filter ) );
}
}
/**
*
* @param cubeHandle
* @param query
* @param resultMetaList
* @throws DataException
* @throws AdapterException
*/
private void prepareMeasure( TabularCubeHandle cubeHandle,
QueryDefinition query, List metaList ) throws AdapterException
{
try
{
List measureGroups = cubeHandle.getContents( CubeHandle.MEASURE_GROUPS_PROP );
for ( int i = 0; i < measureGroups.size( ); i++ )
{
MeasureGroupHandle mgh = (MeasureGroupHandle) measureGroups.get( i );
List measures = mgh.getContents( MeasureGroupHandle.MEASURES_PROP );
for ( int j = 0; j < measures.size( ); j++ )
{
MeasureHandle measure = (MeasureHandle) measures.get( j );
String function = measure.getFunction( );
if ( query.getGroups( ).size( ) > 0 )
{
Binding binding = new Binding( measure.getName( ),
new ScriptExpression( measure.getMeasureExpression( ) ) );
binding.setAggrFunction( DataAdapterUtil.adaptModelAggregationType( function ) );
IGroupDefinition group = (IGroupDefinition) query.getGroups( )
.get( query.getGroups( ).size( ) - 1 );
binding.addAggregateOn( group.getName( ) );
query.addBinding( binding );
}
else
{
query.addBinding( new Binding( measure.getName( ),
new ScriptExpression( measure.getMeasureExpression( ) ) ) );
}
ColumnMeta meta = new ColumnMeta( measure.getName( ),
null,
ColumnMeta.MEASURE_TYPE );
meta.setDataType( DataAdapterUtil.adaptModelDataType( measure.getDataType( ) ) );
metaList.add( meta );
}
}
}
catch ( DataException e )
{
throw new AdapterException( e.getLocalizedMessage( ) );
}
}
private int getDefaultStartValue( String timeType, String value ) throws AdapterException
{
if( value != null && Double.valueOf( value ).doubleValue( )!= 0 )
return Integer.valueOf( value ).intValue( );
if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_MONTH.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_WEEK.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_WEEK_OF_MONTH.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_WEEK_OF_YEAR.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MONTH.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_QUARTER.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_YEAR.equals( timeType ) )
{
return 1;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_HOUR.equals( timeType ) )
{
return 0;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MINUTE.equals( timeType ) )
{
return 0;
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_SECOND.equals( timeType ) )
{
return 0;
}
else
throw new AdapterException( "Error" );
}
/**
*
* @param query
* @param resultMetaList
* @param levelNameColumnNamePair
* @param hierHandle
* @throws AdapterException
*/
private void prepareLevels( QueryDefinition query,
TabularHierarchyHandle hierHandle, List metaList, String dimName )
throws AdapterException
{
try
{
// Use same data set as cube fact table
List levels = hierHandle.getContents( TabularHierarchyHandle.LEVELS_PROP );
for ( int j = 0; j < levels.size( ); j++ )
{
TabularLevelHandle level = (TabularLevelHandle) levels.get( j );
ColumnMeta temp = null;
String exprString = ExpressionUtil.createJSDataSetRowExpression( level.getColumnName( ) );
int type = DataAdapterUtil.adaptModelDataType( level.getDataType( ) );
if ( type == DataType.UNKNOWN_TYPE || type == DataType.ANY_TYPE )
type = DataType.STRING_TYPE;
if ( level.getDateTimeLevelType( ) != null )
{
temp = new ColumnMeta( createLevelName( dimName, level.getName( )),
new DataProcessorWrapper( GroupCalculatorFactory.getGroupCalculator( IGroupDefinition.NUMERIC_INTERVAL,
DataType.INTEGER_TYPE,
String.valueOf( getDefaultStartValue( level.getDateTimeLevelType( ),
level.getIntervalBase( ) ) ),
level.getIntervalRange( ) ) ),
ColumnMeta.LEVEL_KEY_TYPE );
temp.setDataType( DataType.INTEGER_TYPE );
exprString = this.createDateTransformerExpr( level.getDateTimeLevelType( ), exprString );
}
else
{
IDataProcessor processor = null;
if ( DesignChoiceConstants.LEVEL_TYPE_DYNAMIC.equals( level.getLevelType( ) ) )
{
int interval = GroupAdapter.intervalFromModel( level.getInterval( ) );
if ( interval != IGroupDefinition.NO_INTERVAL )
processor = new DataProcessorWrapper( GroupCalculatorFactory.getGroupCalculator( interval,
type,
level.getIntervalBase( ),
level.getIntervalRange( ) ) );
}
else if ( DesignChoiceConstants.LEVEL_TYPE_MIRRORED.equals( level.getLevelType( ) ) )
{
Iterator it = level.staticValuesIterator( );
List dispExpr = new ArrayList( );
List filterExpr = new ArrayList( );
while ( it.hasNext( ) )
{
RuleHandle o = (RuleHandle) it.next( );
dispExpr.add( o.getDisplayExpression( ) );
filterExpr.add( o.getRuleExpression( ) );
}
// When use mirrored level type, we would change the
exprString = "";
for ( int i = 0; i < dispExpr.size( ); i++ )
{
String disp = "\""
+ JavascriptEvalUtil.transformToJsConstants( String.valueOf( dispExpr.get( i ) ) )
+ "\"";
String filter = String.valueOf( filterExpr.get( i ) );
exprString += "if(" + filter + ")" + disp + ";";
}
}
temp = new ColumnMeta( createLevelName( dimName, level.getName( )),
processor,
ColumnMeta.LEVEL_KEY_TYPE );
temp.setDataType( type );
}
metaList.add( temp );
Iterator it = level.attributesIterator( );
while ( it.hasNext( ) )
{
LevelAttributeHandle levelAttr = (LevelAttributeHandle) it.next( );
IDataProcessor processor = null;
String bindingExpr = null;
if( level.getDateTimeLevelType( ) != null && DATE_TIME_ATTR_NAME.equals( levelAttr.getName()))
{
processor = new DateTimeAttributeProcessor( level.getDateTimeLevelType());
bindingExpr = ExpressionUtil.createJSDataSetRowExpression( level.getColumnName() ) ;
}else
{
bindingExpr = ExpressionUtil.createJSDataSetRowExpression( levelAttr.getName() ) ;
}
ColumnMeta meta = new ColumnMeta( createLevelName( dimName, OlapExpressionUtil.getAttributeColumnName( level.getName( ),
levelAttr.getName( ) )),
processor,
ColumnMeta.UNKNOWN_TYPE );
meta.setDataType( DataAdapterUtil.adaptModelDataType( levelAttr.getDataType( ) ) );
metaList.add( meta );
query.addBinding( new Binding( meta.getName( ),
new ScriptExpression( bindingExpr ) ));
}
//Only dynamical level can use display name.
if ( DesignChoiceConstants.LEVEL_TYPE_DYNAMIC.equals( level.getLevelType( ) )
&& level.getDisplayColumnName( ) != null )
{
ColumnMeta meta = new ColumnMeta( createLevelName( dimName,
OlapExpressionUtil.getDisplayColumnName( level.getName( ) ) ),
null,
ColumnMeta.UNKNOWN_TYPE );
meta.setDataType( DataType.STRING_TYPE );
metaList.add( meta );
query.addBinding( new Binding( meta.getName( ),
new ScriptExpression( level.getDisplayColumnName( ) ) ) );
}
String levelName = createLevelName( dimName, level.getName( ));
query.addBinding( new Binding( levelName ,
new ScriptExpression( exprString, type )));
GroupDefinition gd = new GroupDefinition( String.valueOf( query.getGroups( ).size( )));
gd.setKeyExpression( ExpressionUtil.createJSRowExpression( levelName ) );
if ( level.getLevelType( ) != null && level.getDateTimeLevelType( ) == null )
{
gd.setIntervalRange( level.getIntervalRange( ) );
gd.setIntervalStart( level.getIntervalBase( ) );
gd.setInterval( GroupAdapter.intervalFromModel( level.getInterval( ) ) );
}
if ( level.getDateTimeLevelType( ) != null )
{
gd.setIntervalRange( level.getIntervalRange( ) == 0 ? 1
: level.getIntervalRange( ) );
gd.setIntervalStart( String.valueOf( getDefaultStartValue( level.getDateTimeLevelType( ),level.getIntervalBase( ))) );
gd.setInterval( IGroupDefinition.NUMERIC_INTERVAL );
}
query.addGroup( gd );
}
}
catch ( DataException e )
{
throw new AdapterException( e.getLocalizedMessage( ) );
}
}
private String createLevelName( String dimName, String levelName )
{
if( dimName!= null )
return dimName + "/" + levelName;
else
return levelName;
}
/*
* (non-Javadoc)
* @see org.eclipse.birt.data.engine.olap.api.cube.IDatasetIterator#close()
*/
public void close( ) throws BirtException
{
it.close( );
}
/*
* (non-Javadoc)
* @see org.eclipse.birt.data.engine.olap.api.cube.IDatasetIterator#getFieldIndex(java.lang.String)
*/
public int getFieldIndex( String name ) throws BirtException
{
return this.metadata.getFieldIndex( name );
}
/*
* (non-Javadoc)
* @see org.eclipse.birt.data.engine.olap.api.cube.IDatasetIterator#getFieldType(java.lang.String)
*/
public int getFieldType( String name ) throws BirtException
{
return this.metadata.getFieldType( name );
}
/*
* (non-Javadoc)
* @see org.eclipse.birt.data.engine.olap.api.cube.IDatasetIterator#getValue(int)
*/
public Object getValue( int fieldIndex ) throws BirtException
{
Object value = it.getValue( this.metadata.getFieldName( fieldIndex ) );
if ( value == null )
{
return this.metadata.getNullValueReplacer( fieldIndex );
}
if( byte[].class.equals( value.getClass( ) ) )
{
return value;
}
return DataTypeUtil.convert( this.metadata.getDataProcessor( fieldIndex )
.process( value ),
value.getClass( ) );
}
/*
* (non-Javadoc)
* @see org.eclipse.birt.data.engine.olap.api.cube.IDatasetIterator#next()
*/
public boolean next( ) throws BirtException
{
if ( it.getQueryResults( )
.getPreparedQuery( )
.getReportQueryDefn( )
.getGroups( )
.size( ) == 0 )
return it.next( );
if ( !started )
{
started = true;
return it.next( );
}
else
{
it.skipToEnd( it.getQueryResults( )
.getPreparedQuery( )
.getReportQueryDefn( )
.getGroups( )
.size( ) );
return it.next( );
}
}
private Calendar getCalendar( Object d )
{
assert d != null;
Date date;
try
{
date = DataTypeUtil.toDate( d );
Calendar c = Calendar.getInstance( );
c.setTime( date );
return c;
}
catch ( BirtException e )
{
throw new java.lang.IllegalArgumentException( AdapterResourceHandle.getInstance( )
.getMessage( ResourceConstants.INVALID_DATETIME_VALUE ) );
}
}
/**
*
*
*/
private class ResultMeta
{
//
private HashMap columnMetaMap;
private HashMap indexMap;
private Object[] nullValueReplacer;
/**
* Constructor.
* @param columnMetas
*/
ResultMeta( List columnMetas )
{
this.columnMetaMap = new HashMap( );
this.indexMap = new HashMap( );
this.nullValueReplacer = new Object[columnMetas.size( )];
for ( int i = 0; i < columnMetas.size( ); i++ )
{
ColumnMeta columnMeta = (ColumnMeta) columnMetas.get( i );
columnMeta.setIndex( i + 1 );
this.columnMetaMap.put( columnMeta.getName( ), columnMeta );
this.indexMap.put( new Integer( i + 1 ), columnMeta );
if ( columnMeta.isLevelKey( ) )
{
this.nullValueReplacer[i] = createNullValueReplacer( columnMeta.getType( ) );
}
}
}
/**
*
* @param fieldName
* @return
*/
public int getFieldIndex( String fieldName )
{
return ( (ColumnMeta) this.columnMetaMap.get( fieldName ) ).getIndex( );
}
/**
*
* @param fieldName
* @return
*/
public int getFieldType( String fieldName )
{
return ( (ColumnMeta) this.columnMetaMap.get( fieldName ) ).getType( );
}
/**
*
* @param index
* @return
*/
public String getFieldName( int index )
{
return ( (ColumnMeta) this.indexMap.get( new Integer( index ) ) ).getName( );
}
/**
*
* @param index
* @return
*/
public Object getNullValueReplacer( int index )
{
return this.nullValueReplacer[index - 1];
}
public IDataProcessor getDataProcessor( int index )
{
return ( (ColumnMeta) this.indexMap.get( new Integer( index ) ) ).getDataProcessor( );
}
/**
*
* @param fieldType
* @return
*/
private Object createNullValueReplacer( int fieldType )
{
switch ( fieldType )
{
case DataType.DATE_TYPE :
return new java.util.Date( nullTime );
case DataType.SQL_DATE_TYPE :
return new java.sql.Date( nullTime );
case DataType.SQL_TIME_TYPE :
return new Time( nullTime );
case DataType.BOOLEAN_TYPE :
return new Boolean( false );
case DataType.DECIMAL_TYPE :
return new BigDecimal( 0 );
case DataType.DOUBLE_TYPE :
return new Double( 0 );
case DataType.INTEGER_TYPE :
return new Integer( 0 );
case DataType.STRING_TYPE :
return "";
default :
return "";
}
}
}
/**
*
*
*/
private class ColumnMeta
{
//
static final int LEVEL_KEY_TYPE = 1;
static final int MEASURE_TYPE = 2;
static final int UNKNOWN_TYPE = 3;
private String name;
private int dataType, type;
private int index;
private IDataProcessor dataProcessor;
/**
*
* @param name
*/
ColumnMeta( String name, IDataProcessor processor, int type )
{
this.name = name;
this.type = type;
this.dataProcessor = ( processor == null )
? (IDataProcessor) new DummyDataProcessor( ) : processor;
}
/**
*
* @return
*/
public int getIndex( )
{
return this.index;
}
/**
*
* @return
*/
public int getType( )
{
return this.dataType;
}
/**
*
* @return
*/
public String getName( )
{
return this.name;
}
/**
*
* @param index
*/
public void setIndex( int index )
{
this.index = index;
}
/**
*
* @param type
*/
public void setDataType( int type )
{
this.dataType = type;
}
/**
*
* @return
*/
public boolean isLevelKey( )
{
return this.type == LEVEL_KEY_TYPE;
}
/**
*
* @return
*/
public boolean isMeasure( )
{
return this.type == MEASURE_TYPE;
}
/**
*
* @return
*/
public IDataProcessor getDataProcessor()
{
return this.dataProcessor;
}
}
private interface IDataProcessor
{
public Object process( Object d ) throws AdapterException;
}
private class DummyDataProcessor implements IDataProcessor
{
public Object process( Object d )
{
return d;
}
}
/**
* For all Time level, there is by default an "DateTime" attribute which contains the corresponding
* DateTime value of that time level.
*/
private class DateTimeAttributeProcessor implements IDataProcessor
{
private String timeType;
DateTimeAttributeProcessor( String timeType )
{
this.timeType = timeType;
}
public Object process( Object d ) throws AdapterException
{
if( d == null )
return null;
Calendar cal = getCalendar( d );
if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_MONTH.equals( timeType )
|| DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_WEEK.equals( timeType )
|| DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR.equals( timeType )
|| DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_WEEK_OF_MONTH.equals( timeType )
|| DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_WEEK_OF_YEAR.equals( timeType ))
{
cleanTimePortion( cal );
return cal.getTime();
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MONTH.equals( timeType ) )
{
//For all month, clear time portion and set DayOfMonth to 1.
cleanTimePortion( cal );
cal.set( Calendar.DATE, 1 );
return cal.getTime();
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_QUARTER.equals( timeType ) )
{
//For all quarter, clear time portion and set month to first month of
//that quarter and set day to first day of that month.
cleanTimePortion( cal );
cal.set( Calendar.DATE, 1 );
int month = cal.get( Calendar.MONTH );
switch ( month )
{
case Calendar.JANUARY :
case Calendar.FEBRUARY :
case Calendar.MARCH :
cal.set(Calendar.MONTH, 0);
break;
case Calendar.APRIL :
case Calendar.MAY :
case Calendar.JUNE :
cal.set(Calendar.MONTH, 3);
break;
case Calendar.JULY :
case Calendar.AUGUST :
case Calendar.SEPTEMBER :
cal.set(Calendar.MONTH, 6);
break;
case Calendar.OCTOBER :
case Calendar.NOVEMBER :
case Calendar.DECEMBER :
cal.set(Calendar.MONTH, 9);
break;
}
return cal.getTime();
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_YEAR.equals( timeType ) )
{
//For year, clear all time portion and set Date to Jan 1st.
cleanTimePortion( cal );
cal.set(Calendar.MONTH, 0);
cal.set(Calendar.DATE, 1);
return cal.getTime();
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_HOUR.equals( timeType ) )
{
//For hour, set minute to 0 and second to 1.
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 1);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MINUTE.equals( timeType ) )
{
//For minute, set second to 1.
cal.set(Calendar.SECOND, 1);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_SECOND.equals( timeType ) )
{
//For second, set millisecond to 0.
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
else
throw new AdapterException( ResourceConstants.INVALID_DATE_TIME_TYPE, timeType );
}
}
/**
* Clear time portion of a date value
* @param d
*/
private void cleanTimePortion( Calendar d )
{
d.set(Calendar.HOUR_OF_DAY, 0);
d.set(Calendar.MINUTE, 0);
d.set(Calendar.SECOND, 0);
d.set(Calendar.MILLISECOND,0 );
}
private String createDateTransformerExpr( String timeType, String value )
{
return "TempDateTransformer.transform(\""
+ timeType + "\"," + value
+ ")";
}
private class TempDateTransformer extends ScriptableObject
{
public TempDateTransformer( )
{
this.defineProperty( "transform", new Function_Transform( ), 0 );
}
/**
*
*/
public String getClassName( )
{
return "TempDateTransformer";
}
}
private class Function_Transform extends Function_temp
{
/*
* (non-Javadoc)
*
* @see org.eclipse.birt.report.data.adapter.impl.DataSetIterator.TimeValueProcessor.Function_temp#getValue(java.lang.Object[])
*/
protected Object getValue( Object[] args ) throws BirtException
{
assert args.length == 2;
String timeType = args[0].toString( );
Object d = args[1];
if ( args[1] == null )
return new Integer( 0 );
if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_MONTH.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.DAY_OF_MONTH ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_WEEK.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.DAY_OF_WEEK ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.DAY_OF_YEAR ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_WEEK_OF_MONTH.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.WEEK_OF_MONTH ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_WEEK_OF_YEAR.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.WEEK_OF_YEAR ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MONTH.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.MONTH ) + 1 );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_QUARTER.equals( timeType ) )
{
int month = getCalendar( d ).get( Calendar.MONTH );
int quarter = -1;
switch ( month )
{
case Calendar.JANUARY :
case Calendar.FEBRUARY :
case Calendar.MARCH :
quarter = 1;
break;
case Calendar.APRIL :
case Calendar.MAY :
case Calendar.JUNE :
quarter = 2;
break;
case Calendar.JULY :
case Calendar.AUGUST :
case Calendar.SEPTEMBER :
quarter = 3;
break;
case Calendar.OCTOBER :
case Calendar.NOVEMBER :
case Calendar.DECEMBER :
quarter = 4;
break;
default :
quarter = -1;
}
return new Integer( quarter );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_YEAR.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.YEAR ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_HOUR.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.HOUR_OF_DAY ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_MINUTE.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.MINUTE ) );
}
else if ( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_SECOND.equals( timeType ) )
{
return new Integer( getCalendar( d ).get( Calendar.SECOND ) );
}
else
throw new AdapterException( ResourceConstants.INVALID_DATE_TIME_TYPE, timeType );
}
}
abstract class Function_temp extends BaseFunction implements Function
{
public Object call( Context cx, Scriptable scope, Scriptable thisObj,
java.lang.Object[] args )
{
args = convertToJavaObjects( args );
try
{
return getValue( args );
}
catch ( BirtException e )
{
throw new IllegalArgumentException( "The type of arguement is incorrect." );
}
}
protected abstract Object getValue( Object[] args )
throws BirtException;
private Object[] convertToJavaObjects( Object[] args )
{
for ( int i = 0; i < args.length; i++ )
{
args[i] = JavascriptEvalUtil.convertJavascriptValue( args[i] );
}
return args;
}
}
private class DataProcessorWrapper implements IDataProcessor
{
private ICalculator calculator;
DataProcessorWrapper ( ICalculator calculator )
{
this.calculator = calculator;
}
public Object process( Object d ) throws AdapterException
{
try
{
return this.calculator.calculate( d );
}
catch ( BirtException e )
{
throw new AdapterException( e.getLocalizedMessage( ));
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
430fa221d813490bc91f601240093d90b4dc1413 | bd46fcd58357a4eec9d8e9b34560d99306aa6e48 | /src/cn/chiucheung/pojo/system/flow/ProcessDefinitionVo.java | 5c87356ecc8e9b1e63cfe35eee472536e042272b | [] | no_license | shishangzhe/chiucheung | 7d9be129e1a4436b4307dd62e79d2c1aebdda0dd | f5e56de765c758305a7e8295057f0ba049aa96c6 | refs/heads/master | 2020-08-03T14:42:33.164295 | 2019-09-30T09:40:09 | 2019-09-30T09:40:09 | 211,789,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 834 | java | package cn.chiucheung.pojo.system.flow;
public class ProcessDefinitionVo {
private String name;
private int page;//็ฌฌๅ ้กต
private int rows;//ๆฏ้กตๅคๅฐๆก่ฎฐๅฝ
private int startPage;
private String sort;
private String order;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
public int getStartPage() {
return (page-1)*rows;
}
}
| [
"da-13@chiucheung.cn"
] | da-13@chiucheung.cn |
16da0ba3ccfd2be7f471cb08c3c7cff78ef222d5 | 1f6a392f8cf3e0e8140bbfe6780e072854242898 | /src/main/java/com/ttsc/data/service/notice/impl/NoticeInfoServiceImpl.java | b30842f66162d45cce22700c20d2efb2c7715bd6 | [] | no_license | stonezhu1985/ttsc-order | 9e51e68cd85c338f0d90662d4d8ad1844a715b61 | 859ef3f8be7a8c934741b8d79a1b1c28ab1b8a8f | refs/heads/master | 2021-01-10T03:05:18.915222 | 2015-12-05T05:08:41 | 2015-12-05T05:08:41 | 46,650,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 952 | java | package com.ttsc.data.service.notice.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ttsc.data.dao.notice.NoticeInfoDao;
import com.ttsc.data.entity.notice.NoticeInfo;
import com.ttsc.data.po.NoticeQueryPo;
import com.ttsc.data.service.notice.NoticeInfoService;
@Component("noticeInfoService")
public class NoticeInfoServiceImpl implements NoticeInfoService {
@Autowired
NoticeInfoDao noticeInfoDao;
@Override
public NoticeInfo getNoticeById(int id) {
// TODO Auto-generated method stub
return noticeInfoDao.getNoticeById(id);
}
@Override
public List<NoticeInfo> queryList(NoticeQueryPo query) {
// TODO Auto-generated method stub
return noticeInfoDao.queryList(query);
}
@Override
public int queryListCount(NoticeQueryPo query) {
// TODO Auto-generated method stub
return noticeInfoDao.queryListCount(query);
}
}
| [
"jiangzhq_520@163.com"
] | jiangzhq_520@163.com |
33cac16b34f54b5c91c47f9445753e38b5be9be5 | ab1ea6a48352d236407953faed52c5dceb1db837 | /CurrencyConversionService/src/test/java/com/nepdroid/microservices/CurrencyConversionServiceApplicationTests.java | 71a4001d3355d9ed76eccf5e81018b577301b6b0 | [] | no_license | way2anash/SpringBoot-Microservices | 0910bec281ef8acc6def1c8ab086564a4a970d09 | a28d597cccf8e565285d2ce16b90c6f206bc9437 | refs/heads/master | 2021-05-27T13:05:16.902311 | 2020-04-09T04:27:41 | 2020-04-09T04:27:41 | 254,271,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.nepdroid.microservices;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class CurrencyConversionServiceApplicationTests {
@Test
void contextLoads() {
}
}
| [
"ansarianash.np@gmail.com"
] | ansarianash.np@gmail.com |
7ce0e6dbccb831977537349d81fec84b31c90521 | 05da51187abaadb4c3cf5cda1abd87809fb4713e | /src/main/java/com/foodtech/back/repository/model/UserRepository.java | ddd7b82a93699e37f02c20bb6d2daa6f6127f088 | [] | no_license | pkaravaev/wow_kitchen | 5d0540048ee339b18c1208914ca5c840c77c830b | d24c439af0782af4686e72c1ad0c844208f54997 | refs/heads/master | 2023-03-20T22:02:43.174052 | 2021-01-13T15:18:13 | 2021-01-13T15:18:13 | 313,244,374 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,809 | java | package com.foodtech.back.repository.model;
import com.foodtech.back.entity.model.User;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.data.jpa.repository.Query;
import javax.persistence.LockModeType;
import java.util.List;
import java.util.Optional;
@SuppressWarnings("NullableProblems")
public interface UserRepository extends JpaRepository<User, Long> {
@Override
List<User> findAll();
@Override
@EntityGraph(attributePaths = {"roles"})
Optional<User> findById(Long id);
@Lock(LockModeType.PESSIMISTIC_WRITE)
@Query("SELECT u FROM User u WHERE u.id=?1")
// @QueryHints({@QueryHint(name = "javax.persistence.lock.timeout", value = "10000")})
Optional<User> findByIdForUpdate(Long id);
@EntityGraph(attributePaths = {"roles"})
Optional<User> findByCountryCodeAndMobileNumber(String countryCode, String mobileNumber);
@Query("SELECT DISTINCT u FROM User u " +
"LEFT JOIN FETCH u.roles " +
"LEFT JOIN FETCH u.addresses " +
"WHERE u.countryCode=?1 AND u.mobileNumber=?2")
Optional<User> findByCountryCodeAndMobileNumberWithAddresses(String countryCode, String mobileNumber);
@Query("SELECT DISTINCT u FROM User u " +
"LEFT JOIN FETCH u.roles " +
"LEFT JOIN FETCH u.addresses " +
"WHERE u.id=?1")
Optional<User> findByIdWithAddresses(Long id);
@Query("SELECT DISTINCT u.id FROM User u WHERE u.bonusAccount.registrationPromoCode =?1")
Optional<Long> findPromoCodeOwnerId(String code);
boolean existsByBonusAccountRegistrationPromoCodeEquals(String code);
void deleteByMobileNumber(String number);
}
| [
"Pavel1990@"
] | Pavel1990@ |
ada6c561e901c3ca69d021cd5b7ac68e6638ed5f | ae2c62ea5a4e1adf6b80ab71d750cb83be09ce66 | /test/br/unisc/computador/politicas/PoliticaSubstituicaoLFUTest.java | f0e7df2da9eead2183efbf5fc9c947ad13dd7fb9 | [] | no_license | guisehn/cachesim | 3ace7bf3f8773cfad91225b88ab976f1dd183f07 | f62d378bf161b7407cc865690a89148bbfdeb2a9 | refs/heads/master | 2021-01-15T08:18:27.797655 | 2015-08-22T23:35:01 | 2015-08-22T23:35:01 | 36,961,938 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,921 | java | package br.unisc.computador.politicas;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class PoliticaSubstituicaoLFUTest {
public PoliticaSubstituicaoLFUTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testarPoliticaSubstituicao() {
Object[] conjunto = new Object[] { new Object(), new Object(), new Object(), new Object() };
PoliticaSubstituicaoLFU politica = new PoliticaSubstituicaoLFU();
// Blocos gravados na ordem: 1, 0, 3, 2
// No momento em que sรฃo gravados, os blocos ficam com frequรชncia = 1
politica.marcarBlocoGravado(conjunto, conjunto[1]);
politica.marcarBlocoGravado(conjunto, conjunto[0]);
politica.marcarBlocoGravado(conjunto, conjunto[3]);
politica.marcarBlocoGravado(conjunto, conjunto[2]);
// Visita o bloco 3, logo aumenta a sua frequรชncia. Agora:
// Frequencia bloco 0 = 1
// Frequencia bloco 1 = 1
// Frequencia bloco 2 = 1
// Frequencia bloco 3 = 2
politica.marcarBlocoLido(conjunto, conjunto[3]);
// Os blocos 0, 1 e 2 possuem as frequรชncias mรญnimas (F = 1), portanto
// um deles deverรก ser substituรญdo.
// Para o "desempate", o registro mais antigo, ou seja, gravado hรก
// mais tempo na cache serรก o escolhido para ser substituรญdo.
// Como o bloco 1 foi o primeiro a ser colocado na cache, e possui a
// frequรชncia mรญnima, este deve ser escolhido para ser substituรญdo.
assertEquals(1, politica.calcularPosicaoSubstituicao(conjunto));
// Bloco 1 รฉ marcado como gravado novamente na cache (assim, torna-se
// o mais recente a ser gravado na cache). Sua frequรชncia foi novamente
// setada para 1.
politica.marcarBlocoGravado(conjunto, conjunto[1]);
// Os blocos 0, 1 e 2 possuem as frequรชncias mรญnimas (F = 1), portanto
// um deles deverรก ser substituรญdo.
// Agora, o mais antigo รฉ o bloco 0, seguido pelo bloco 2, e depois pelo
// bloco 1, que foi regravado na cache.
// Sendo o mais antigo, o bloco 0 deve ser agora marcado para ser substituรญdo.
assertEquals(0, politica.calcularPosicaoSubstituicao(conjunto));
// Bloco 0 regravado.
politica.marcarBlocoGravado(conjunto, conjunto[0]);
// Os blocos 0, 1 e 2 possuem as frequรชncias mรญnimas (F = 1), portanto
// um deles deverรก ser substituรญdo.
// O bloco 2 รฉ o mais antigo da cache agora, entรฃo ele รฉ o escolhido.
assertEquals(2, politica.calcularPosicaoSubstituicao(conjunto));
// Bloco 2 regravado.
politica.marcarBlocoGravado(conjunto, conjunto[2]);
// Agora o bloco 1 รฉ o mais antigo da cache novamente com frequรชncia mรญnima,
// portanto deve ser apontado para substituiรงรฃo.
assertEquals(1, politica.calcularPosicaoSubstituicao(conjunto));
// Bloco 1 regravado.
politica.marcarBlocoGravado(conjunto, conjunto[1]);
// Visita bloco 0, aumentando a sua frequรชncia para 2. Agora:
// Frequencia bloco 0 = 2
// Frequencia bloco 1 = 1
// Frequencia bloco 2 = 1
// Frequencia bloco 3 = 2
politica.marcarBlocoLido(conjunto, conjunto[0]);
// Os blocos com frequรชncia mรญnima agora sรฃo o 1 e o 2. Sendo o 2 o mais antigo,
// este deverรก ser marcado para substituiรงรฃo.
assertEquals(2, politica.calcularPosicaoSubstituicao(conjunto));
}
}
| [
"ghsehn@gmail.com"
] | ghsehn@gmail.com |
39454ef2f32435cf80dd56ad4a219ce004a8a211 | 9d4ff5c70622e94e236415f80480c80b1d56faa7 | /src/codingareana/qq.java | 2e8d5fb2f9293483b7f4ca31b697153eb88afd60 | [] | no_license | rashidahmad03/TestingLogic1 | e74f10de44dea078383e1eba3b52907945f8f1c3 | 3e873f0dab4441fd1bcbc2119bdc311eee125171 | refs/heads/master | 2022-09-14T08:36:30.735596 | 2020-01-29T19:35:10 | 2020-01-29T19:35:10 | 182,634,809 | 0 | 0 | null | 2022-09-01T23:19:17 | 2019-04-22T06:20:54 | Java | UTF-8 | Java | false | false | 1,047 | java | package codingareana;
import java.util.Scanner;
public class qq {
public static void main(String[] args) {
//
// Scanner sc = new Scanner(System.in);
// int t = sc.nextInt();
//
// for (int lk = 0; lk < t; lk++) {
// int i, j, res = 0;
// int count = sc.nextInt();
// int item = sc.nextInt();
//
// sc.nextLine();
// String str = sc.nextLine();
//
// for (i = 0; i < str.length(); i++) {
// for (j = 0; j < str.length() - i; j++) {
// int len = j + i;
// int c = 0;
// for (int k = j; k <= len; k++) {
//
// {
// if ((str.charAt(k) - '0') == item) {
//
// c++;
// }
// }
// }
// if (count == c) {
// res++;
// }
//
// }
// }
// System.out.println(res);
// }
Scanner s = new Scanner(System.in);
int T = s.nextInt();
while (T-- != 0) {
int x, count = 0;
x = s.nextInt();
while (x != 0) {
count = count + (x & 1);
x >>= 1;
}
System.out.println((1 << count) - 1);
}
}
}
| [
"AhmadRa@india.rapidigm.com"
] | AhmadRa@india.rapidigm.com |
11bda3330dd5c29e4319a97d732a50729105ac5e | d7eb7cc94ab9b258230b4386861af4059d4a1ebb | /cloudalibaba-sentinel-service8401/src/main/java/com/atguigu/springcloud/myhandler/CustomerBlockHandler.java | e2fe5b24fd5597e7b8830695e83b587e6044b37e | [] | no_license | z2847492481/cloud2021 | 91d0cb1f0dad379836bc3ee9d816dfa7a3d42c62 | 7459b9151ac5bb8e02ff40caa093793d1f8f3c18 | refs/heads/master | 2023-07-18T23:42:10.671288 | 2021-09-24T04:49:06 | 2021-09-24T04:49:06 | 407,081,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 632 | java | package com.atguigu.springcloud.myhandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import org.springframework.stereotype.Component;
@Component
public class CustomerBlockHandler {
public static CommonResult handlerException(BlockException blockException){
return new CommonResult(4444,"ๅฎขๆท่ชๅฎไน------------------1");
}
public static CommonResult handlerException2(BlockException blockException){
return new CommonResult(4444,"ๅฎขๆท่ชๅฎไน------------------2");
}
}
| [
"2847492481@qq.com"
] | 2847492481@qq.com |
97530a480e24cc140a69beb60e0e95aeb86ff9de | 2c16007de25b78fa7f010cf8d471606b1bb31b2e | /aop/src/test/java/org/jboss/test/aop/dynamicinvoke/POJO.java | ea299eb15cab150876642d4456e7e81c2e341e58 | [] | no_license | stalep/jboss-aop | 24e1c64acb48540dca858fa3b093861b91f724eb | f9d6e15fc724f9e1c07a98aa301a52b4273a882f | refs/heads/master | 2022-07-08T04:31:18.718343 | 2009-01-28T03:01:01 | 2009-01-28T03:01:01 | 116,122 | 3 | 2 | null | 2022-07-01T22:17:50 | 2009-01-27T22:31:04 | Java | UTF-8 | Java | false | false | 1,523 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.test.aop.dynamicinvoke;
/**
* Pojo classe for dynamic invoke test.
*
* @author <a href="flavia.rainone@jboss.com">Flavia Rainone</a>
*/
public class POJO
{
private static String lastRun = null;
public static String getLastRun()
{
return lastRun;
}
public static void clearHistory()
{
lastRun = null;
}
public void advised()
{
lastRun = "advised";
}
public void unadvised()
{
lastRun = "unadvised";
}
} | [
"flavia.rainone@jboss.com@84be2c1e-ba19-0410-b317-a758671a6fc1"
] | flavia.rainone@jboss.com@84be2c1e-ba19-0410-b317-a758671a6fc1 |
cf89c57964dfd4a63b803b62065b73355725f649 | 0674f68a900974d34c3091463ecc65465c0245f4 | /01-javabasic/src/Unary01.java | 24c77892e4aaadedaac0dfda3dfd6410b69495d1 | [] | no_license | SongJaeHy/test | 0cc06c32d8cc6f40a06dc74c7378e867121c6981 | 4818ffa0c930c70e95550f34063ed7fa869cdd7d | refs/heads/master | 2023-06-12T05:01:28.894036 | 2021-07-05T11:46:02 | 2021-07-05T11:46:02 | 381,006,175 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | java |
public class Unary01 {
public static void main(String[] args) {
// ๋จํญ ์ฐ์ฐ์ ++,--
// ++, --๋ ์ซ์์ ์ผ์ชฝ ํน์ ์ค๋ฅธ์ชฝ์ ๋ถ์ ์ ์์ต๋๋ค.
// ์ผ์ชฝ์ ๋ถ๋ ๊ฒฝ์ฐ๋ฅผ ์ ์ ์์
// ์ค๋ฅธ์ชฝ์ ๋ถ๋ ๊ฒฝ์ฐ๋ฅผ ํ์ ์์์ผ๋ก ํํํ๋ฉฐ
// ์ด๋ ๋ฐฉํฅ์ ๋ถ๋์ ๋ฐ๋ผ ์คํ ์์๊ฐ ๋ฐ๋๋๋ค.
// ++๋ ๋์ ๋ณ์์ ์ซ์๋ฅผ 1์ฆ๊ฐ, --๋ 1๊ฐ์ ์ํต๋๋ค.
int a = 1;
System.out.println(++a);
// ์ ์ ์์, ์คํ ์ 1๋ถํฐ ์ฆ๊ฐ์ํค๊ณ a์ถ๋ ฅ
// 1. a = a + 1;
// 2. System.out.println(a(2));
System.out.println(a);//a๋ ์ฆ๊ฐ๋ ๊ฐ์ด ์ ์ง๋จ
System.out.println(a++);
// ํ์ ์์, a(2)์ถ๋ ฅ ํ 1์ฆ๊ฐ
// 1. System.out.println(a(2));
// 2. a = a(2) + 1;
System.out.println(a);//a๋ ์ฆ๊ฐ๋ ๊ฐ์ด ์ ์ง๋จ
}
}
| [
"SongJaeHy"
] | SongJaeHy |
ca59400b7ff3bb5d8715e0f6072ca94762f560a5 | efb26af67f2277684a3a36c3b2a868b24ec0a38b | /x/src/SpawnPoint.java | 1dc6409b67440c860127f81b0675408d5b74b81a | [] | no_license | asdf121212/CatsGame | d511949a533a2c124fdfa93524587703047af719 | 579dd027391e7cec3f135b5c5d46156f4e28f9b9 | refs/heads/master | 2021-12-03T19:54:28.128800 | 2021-09-27T22:28:40 | 2021-09-27T22:28:40 | 253,625,202 | 0 | 0 | null | 2020-05-15T00:05:47 | 2020-04-06T21:59:02 | Java | UTF-8 | Java | false | false | 151 | java | import java.io.Serializable;
public class SpawnPoint implements Serializable {
public int x;
public int y;
public boolean isFallTrap;
}
| [
"thomas@Thomass-MBP.lan"
] | thomas@Thomass-MBP.lan |
c784fc7b3a5f8db4a8062ec3c21b29d6bda67f69 | b26b3f5bccce4e2011d96bb418abb119284fdda6 | /src/main/java/com/egabi/cbe/model/CbeGlAccountsAdjTabPK.java | 8bcdde445d1f114f86e2afe0b9f013e79abc2544 | [] | no_license | ManarAdel/CBE | 3bdc69e64f89c199efa9c42c678247cbd9231757 | 666aa2fc01f2b798f93aebb3a3d736519b83715c | refs/heads/master | 2021-05-03T05:56:56.030120 | 2018-03-15T10:02:02 | 2018-03-15T10:02:02 | 120,587,954 | 0 | 1 | null | 2018-02-07T13:26:59 | 2018-02-07T08:44:49 | JavaScript | UTF-8 | Java | false | false | 3,100 | java | package com.egabi.cbe.model;
import java.io.Serializable;
import javax.persistence.*;
/**
* The primary key class for the CBE_GL_ACCOUNTS_ADJ_TAB database table.
*
*/
@Embeddable
public class CbeGlAccountsAdjTabPK implements Serializable {
//default serial version id, required for serializable classes.
private static final long serialVersionUID = 1L;
@Temporal(TemporalType.DATE)
private java.util.Date busdate;
@Column(name="GL_CODE")
private long glCode;
@Column(name="CUSTOMER_CODE")
private long customerCode;
@Column(name="SUB_ACCOUNT_NO")
private long subAccountNo;
@Column(name="CURRENCY_CODE")
private String currencyCode;
@Column(name="BRANCH_CODE")
private long branchCode;
@Column(name="CENTER_CODE")
private long centerCode;
public CbeGlAccountsAdjTabPK() {
}
public java.util.Date getBusdate() {
return this.busdate;
}
public void setBusdate(java.util.Date busdate) {
this.busdate = busdate;
}
public long getGlCode() {
return this.glCode;
}
public void setGlCode(long glCode) {
this.glCode = glCode;
}
public long getCustomerCode() {
return this.customerCode;
}
public void setCustomerCode(long customerCode) {
this.customerCode = customerCode;
}
public long getSubAccountNo() {
return this.subAccountNo;
}
public void setSubAccountNo(long subAccountNo) {
this.subAccountNo = subAccountNo;
}
public String getCurrencyCode() {
return this.currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
public long getBranchCode() {
return this.branchCode;
}
public void setBranchCode(long branchCode) {
this.branchCode = branchCode;
}
public long getCenterCode() {
return this.centerCode;
}
public void setCenterCode(long centerCode) {
this.centerCode = centerCode;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof CbeGlAccountsAdjTabPK)) {
return false;
}
CbeGlAccountsAdjTabPK castOther = (CbeGlAccountsAdjTabPK)other;
return
this.busdate.equals(castOther.busdate)
&& (this.glCode == castOther.glCode)
&& (this.customerCode == castOther.customerCode)
&& (this.subAccountNo == castOther.subAccountNo)
&& this.currencyCode.equals(castOther.currencyCode)
&& (this.branchCode == castOther.branchCode)
&& (this.centerCode == castOther.centerCode);
}
@Override
public int hashCode() {
final int prime = 31;
int hash = 17;
hash = hash * prime + this.busdate.hashCode();
hash = hash * prime + ((int) (this.glCode ^ (this.glCode >>> 32)));
hash = hash * prime + ((int) (this.customerCode ^ (this.customerCode >>> 32)));
hash = hash * prime + ((int) (this.subAccountNo ^ (this.subAccountNo >>> 32)));
hash = hash * prime + this.currencyCode.hashCode();
hash = hash * prime + ((int) (this.branchCode ^ (this.branchCode >>> 32)));
hash = hash * prime + ((int) (this.centerCode ^ (this.centerCode >>> 32)));
return hash;
}
} | [
"manar.adel@egabi.com"
] | manar.adel@egabi.com |
e6256faaf935eddb58e05b67ecd8e5b8ca7cfbd0 | 7834032d659caabdb87507891447386a6d9b8292 | /src/main/java/tnt/util/FileUtil.java | 9e0145acff34fe7ed056cc669c0d1818ea7d7a24 | [] | no_license | foolo/tnt | 7070e1ac34edba7d948249fd3d1a2d4549378d22 | 9fcc81c296817616ea19518970b3943d73bc9f93 | refs/heads/master | 2021-11-20T10:29:47.196875 | 2021-08-08T12:24:27 | 2021-08-08T12:24:27 | 198,627,743 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,467 | java | package tnt.util;
import java.awt.Component;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import javax.swing.JOptionPane;
public class FileUtil {
private static class CopyException extends RuntimeException {
public CopyException(String message) {
super(message);
}
}
private static void copy(Path source, Path dest) {
try {
Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);
}
catch (IOException e) {
throw new CopyException(e.toString());
}
}
public static void copyFolder(Path src, Path dest) throws IOException {
try {
Files.walk(src).forEach(source -> copy(source, dest.resolve(src.relativize(source))));
}
catch (CopyException ex) {
throw new IOException(ex.getMessage());
}
}
public static void desktopOpen(Component parent, File f) {
try {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().open(f);
}
}
catch (IOException | NullPointerException | IllegalArgumentException | UnsupportedOperationException ex) {
JOptionPane.showMessageDialog(parent, "Could not open direcory: " + f.toString() + "\n" + ex, "", JOptionPane.ERROR_MESSAGE);
}
}
public static File getExistingDirectory(File file) {
File f = file;
for (int i = 0; i < 10 && f != null; i++) {
if (f.exists()) {
return f;
}
f = f.getParentFile();
}
return f;
}
}
| [
"olof.andersson@gmail.com"
] | olof.andersson@gmail.com |
3d8e355d83b2d9aeb2822cd3a0ebde33a1ac6889 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_9a877e3c59a1230d9af06bb63dc3629a12bb85e9/SecurityNode/11_9a877e3c59a1230d9af06bb63dc3629a12bb85e9_SecurityNode_s.java | b88eaa7e75322dcbeb47944eda71117cd1a2b876 | [] | 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 | 8,831 | java | /*
* jGnash, a personal finance application
* Copyright (C) 2001-2013 Craig Cavanaugh
*
* This program 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 jgnash.engine;
import jgnash.util.DateUtils;
import java.io.ObjectStreamException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.PostLoad;
/**
* Security Node
* <p/>
* The last market price is cached to improve performance
*
* @author Craig Cavanaugh
*/
@Entity
public class SecurityNode extends CommodityNode {
private static final long serialVersionUID = -8377663762619941498L;
@ManyToOne
private CurrencyNode reportedCurrency;
/**
* The currency that security values are reported in
*/
@Enumerated(EnumType.STRING)
private QuoteSource quoteSource = QuoteSource.NONE;
/**
* ISIN or CUSIP. Used for OFX and quote downloads
*/
private String isin;
@JoinTable
@OneToMany(cascade = {CascadeType.ALL})
private Set<SecurityHistoryNode> historyNodes = new HashSet<>();
private transient ReadWriteLock lock;
public SecurityNode() {
lock = new ReentrantReadWriteLock(true);
}
public SecurityNode(final CurrencyNode node) {
this();
setReportedCurrencyNode(node);
}
private ReadWriteLock getLock() {
return lock;
}
/**
* Prefix is deferred to the reported currency
*
* @return prefix of the reported currency
*/
@Override
public String getPrefix() {
return reportedCurrency.getPrefix();
}
@Override
public void setPrefix(final String ignored) {
}
/**
* Suffix is deferred to the reported currency
*
* @return suffix of the reported currency
*/
@Override
public String getSuffix() {
return reportedCurrency.getSuffix();
}
@Override
public void setSuffix(final String ignored) {
}
/**
* Returns the quote download source
*
* @return quote download source
*/
public QuoteSource getQuoteSource() {
return quoteSource;
}
/**
* Sets the quote download source
*
* @param source QuoteSource to use
*/
public void setQuoteSource(final QuoteSource source) {
quoteSource = source;
}
public String getISIN() {
return isin;
}
public void setISIN(final String isin) {
this.isin = isin;
}
/**
* Set the CurrencyNode that security histories are reported in
*
* @param node reported CurrencyNode
*/
public void setReportedCurrencyNode(final CurrencyNode node) {
reportedCurrency = node;
}
/**
* Returns the CurrencyNode that security histories are reported in
*
* @return reported CurrencyNode
*/
public CurrencyNode getReportedCurrencyNode() {
return reportedCurrency;
}
boolean addHistoryNode(final SecurityHistoryNode node) {
boolean result = false;
Lock l = getLock().writeLock();
l.lock();
try {
/* int index = Collections.binarySearch(historyNodes, node);
if (index < 0) {
historyNodes.add(-index - 1, node);
} else {
historyNodes.set(index, node);
}*/
historyNodes.add(node);
result = true;
} finally {
l.unlock();
}
return result;
}
boolean removeHistoryNode(final SecurityHistoryNode hNode) {
Lock l = getLock().writeLock();
l.lock();
boolean result = false;
try {
result = historyNodes.remove(hNode);
} finally {
l.unlock();
}
return result;
}
/**
*
* @return A sorted list of the security history
*/
private List<SecurityHistoryNode> getSortedList() {
getLock().readLock().lock();
try {
ArrayList<SecurityHistoryNode> sorted = new ArrayList<>(historyNodes);
Collections.sort(sorted);
return sorted;
} finally {
getLock().readLock().unlock();
}
}
/*private SecurityHistoryNode getLastHistoryNode() {
getLock().readLock().lock();
try {
SecurityHistoryNode node = null;
if (!historyNodes.isEmpty()) {
List<SecurityHistoryNode> sorted = getSortedList();
node = sorted.get(sorted.size() - 1);
}
return node;
} finally {
getLock().readLock().unlock();
}
}*/
/**
* Get a copy of SecurityHistoryNodes for this security
*
* @return Returns a shallow copy of the history nodes to protect against
* modification
*/
public List<SecurityHistoryNode> getHistoryNodes() {
return getSortedList();
}
SecurityHistoryNode getHistoryNode(final Date date) {
Date testDate = DateUtils.trimDate(date);
getLock().readLock().lock();
List<SecurityHistoryNode> sortedList = getSortedList();
try {
SecurityHistoryNode hNode = null;
for (int i = sortedList.size() - 1; i >= 0; i--) {
SecurityHistoryNode node = sortedList.get(i);
if (testDate.compareTo(node.getDate()) >= 0) {
hNode = node;
break;
}
}
if (hNode == null) {
hNode = sortedList.get(sortedList.size() - 1);
}
return hNode;
} finally {
getLock().readLock().unlock();
}
}
BigDecimal getMarketPrice(final Date date) {
BigDecimal marketPrice = BigDecimal.ZERO;
Date testDate = DateUtils.trimDate(date);
getLock().readLock().lock();
try {
for (SecurityHistoryNode node : historyNodes) {
if (node.getDate().getTime() <= testDate.getTime()) {
marketPrice = node.getPrice();
} else {
break;
}
}
return marketPrice;
} finally {
getLock().readLock().unlock();
}
}
/**
* Returns the latest market price exchanged to the specified currency
*
* @param date date to find closest matching rate without exceeding
* @param node currency to exchange to
* @return latest market price
*/
public BigDecimal getMarketPrice(final Date date, final CurrencyNode node) {
return getMarketPrice(date).multiply(getReportedCurrencyNode().getExchangeRate(node));
}
/**
* Return a clone of this security node Security history is not cloned
*
* @return clone of this SecurityNode with history nodes
*/
@Override
public Object clone() throws CloneNotSupportedException {
SecurityNode node = (SecurityNode) super.clone();
node.historyNodes = new HashSet<>();
node.lock = new ReentrantReadWriteLock(true);
return node;
}
private Object readResolve() throws ObjectStreamException {
lock = new ReentrantReadWriteLock(true);
return this;
}
@PostLoad
@SuppressWarnings("unused")
private void postLoad() {
lock = new ReentrantReadWriteLock(true);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
eef9981a9ecbeb6d4e4d1b6433d3cf073b968a42 | dd9f3efe75c99de6f6ad4fd21abd4e8593763b40 | /2018Fall/src/Day_32_methodswithreturn01/AccumulatorMethods.java | 3494a89fd6b4b44ee73f2318f967287a66802223 | [] | no_license | SeizeThed4y/JAVADAYS | d579ed669c2911ae6584fed8bd886436a4105d4d | 8d53e217e45be206289339d2e3dc7e42fa2d5285 | refs/heads/master | 2020-04-06T12:20:41.171201 | 2018-11-22T01:51:22 | 2018-11-22T01:51:22 | 157,451,883 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | package Day_32_methodswithreturn01;
public class AccumulatorMethods {
public static void main(String[] args) {
System.out.println(getStarts(5));
SumTon(2);
}
/*
* methods getStarts that accepts an int and returns a string it will return
* that many * stars.
*
*
* for example (5) --> *****
*/
public static String getStarts(int number) {
String star = "*";
for (int i = 1; i < number; i++) {
star = star + "*";
}
return star;
}
/*
* method: sumToN: accepts an int and return sum of ints starting from 1 to that
* int. sumToN(3) -> 6 (1+2+3) sumToN(5) -> 15 (1+2+3+4+5)
*/
public static int SumTon(int num) {
int sum = 0;
for (int i = 1; i <= num; i++) {
sum += i;
}
System.out.println(sum);
return sum;
}
}
| [
"frk.coskunn@gmail.com"
] | frk.coskunn@gmail.com |
aa0a08005f7e1147399c4cceef9ca17665f199a7 | 6422076cdbde638f01bf271c8210e7732e5e7693 | /mp-tools/src/main/java/com/boal/wechat/model/message/VoiceMsg.java | 6840df4944622f5f38b0ace0f125cdd87f7c611e | [] | no_license | yangheqingvip/mp-tools | 5fb979dc13f0e9eb51ad69c8db4772cbfa30c5da | afce0e263c69289aaa4273fac4bb35a66d46c672 | refs/heads/master | 2021-03-28T23:28:48.277002 | 2018-11-13T08:55:57 | 2018-11-13T08:55:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,067 | java | package com.boal.wechat.model.message;
import com.google.gson.annotations.SerializedName;
/**
* <br/>
* <br/>
* <b>Date:</b> 2018/08/27<br/>
*
* @author Boal Lin
* @version 1.0
*/
public class VoiceMsg extends BasicMsg {
public VoiceMsg() {
super();
this.msgType = "voice";
}
@SerializedName("voice")
private ParamContent paramContent = new ParamContent();
public ParamContent getParamContent() {
return paramContent;
}
public static class ParamContent {
/**
* ๅพ็ๆถๆฏๅชไฝid๏ผๅฏไปฅ่ฐ็จๅคๅชไฝๆไปถไธ่ฝฝๆฅๅฃๆๅๆฐๆฎ
*/
@SerializedName("media_id")
private String mediaId;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
}
public String getMediaId() {
return this.paramContent.mediaId;
}
public void setMediaId(String mediaId) {
this.paramContent.mediaId = mediaId;
}
}
| [
"851257192@qq.com"
] | 851257192@qq.com |
7529189b64dcc4e17917da87cbd8d96a46140e84 | 7c53f3b623f0b297de56b0131720766588ae1d39 | /src/leetcode/one/WildcardMatching.java | 73846d35a97819ada937098a485ea1ffb3b211fc | [] | no_license | lushuoyan/MyPractiseCode | fd0296fb1c91a24b89d05d4c346956e39b4ef3f4 | c32a25cd20ca10ab2c2b2e9a17cac0a29f5d6953 | refs/heads/master | 2020-05-21T22:07:57.649571 | 2016-10-08T05:47:55 | 2016-10-08T05:47:55 | 65,428,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,001 | java | package leetcode.one;
public class WildcardMatching {
public static void main(String[] args) {
System.out.println(isMatch("aa", "*"));
}
// aaaabaaaabbbbaabbbaabbaababbabbaaaababaaabbbbbbaabbbabababbaaabaabaaaaaabbaabbbbaababbababaabbbaababbbba
// *****b*aba***babaa*bbaba***a*aaba*b*aa**a*b**ba***a*a*
public static boolean isMatch(String s, String p) {
p = p.replace("?", ".");
p = p.replace("*", "(.){0,}");
return s.matches(p);
// if (p.equals("*")) {
// return true;
// }
//
// while (true) {
// if (s.equals("") && p.equals("")) {
// return true;
// }
// if (s.equals("") || p.equals("")) {
// return false;
// }
// if (!p.contains("?") && !p.contains("*")) {
// if (p.equals(s)) {
// return true;
// }
// return false;
// }
// while (p.indexOf("?") == 0) {
// if (s.equals("")) {
// return false;
// }
// s = s.substring(1);
// p = p.substring(1);
// }
// if (p.contains("?") && p.contains("*")) {
//
// }
//
// }
}
}
| [
"slushuoyan@gmail.com"
] | slushuoyan@gmail.com |
90ce2e6efc1e829dfc511cdf2789c0c1413f1f95 | fdb8be87b4d284f9bf25dfa82b42340c96405b8f | /src/main/java/com/dt/module/flow/entity/SysProcessClassItem.java | 8a5c0e2649a24805347a5744aa0ec9abf62d1a04 | [
"Apache-2.0"
] | permissive | dragonli-outsource/zichanguanli | 2328342f80d861fb7814029dda519714cdec4239 | e4d0bd269cdab1cb51e61334b73ac85ae442f794 | refs/heads/master | 2022-11-19T21:53:21.194504 | 2019-12-21T08:43:58 | 2019-12-21T08:43:58 | 228,841,796 | 0 | 3 | Apache-2.0 | 2022-11-16T10:55:57 | 2019-12-18T13:04:50 | JavaScript | UTF-8 | Java | false | false | 2,097 | java | package com.dt.module.flow.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dt.core.common.base.BaseModel;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
/**
* <p>
*
* </p>
*
* @author algernonking
* @since 2019-12-01
*/
@TableName("sys_process_class_item")
public class SysProcessClassItem extends BaseModel<SysProcessClassItem> {
private static final long serialVersionUID = 1L;
@TableId("id")
private String id;
@TableField("cid")
private String cid;
@TableField("name")
private String name;
@TableField("mark")
private String mark;
@TableField("processname")
private String processname;
@TableField("processkey")
private String processkey;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMark() {
return mark;
}
public void setMark(String mark) {
this.mark = mark;
}
public String getProcessname() {
return processname;
}
public void setProcessname(String processname) {
this.processname = processname;
}
public String getProcesskey() {
return processkey;
}
public void setProcesskey(String processkey) {
this.processkey = processkey;
}
@Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() {
return "SysProcessClassItem{" +
"id=" + id +
", cid=" + cid +
", name=" + name +
", mark=" + mark +
", processname=" + processname +
", processkey=" + processkey +
"}";
}
}
| [
"315920958@qq.com"
] | 315920958@qq.com |
308c9187dcfb195af1b1258147ca35bddfa2181a | b6a5504d70f49091b002b1898899e00153ccbbb6 | /gen/ca/uwaterloo/a12_j28tan/R@cda7e0275da54d53ab88628da1476e40.java | 84e6c936fbff084f3503ad9ef4cd05d3902c15d1 | [] | no_license | saijalsuri/memory-card-game | 40d104b43f86b211164ce30f825d03a51696c825 | e09846fb44dee49f2c51646d75840610949ea572 | refs/heads/master | 2022-06-16T00:16:34.352889 | 2022-05-22T23:09:22 | 2022-05-22T23:09:22 | 80,250,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,975 | 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 ca.uwaterloo.a12_j28tan;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int a12_frontpage=0x7f020000;
public static final int card1=0x7f020001;
public static final int card10=0x7f020002;
public static final int card11=0x7f020003;
public static final int card12=0x7f020004;
public static final int card13=0x7f020005;
public static final int card14=0x7f020006;
public static final int card15=0x7f020007;
public static final int card16=0x7f020008;
public static final int card17=0x7f020009;
public static final int card18=0x7f02000a;
public static final int card19=0x7f02000b;
public static final int card2=0x7f02000c;
public static final int card20=0x7f02000d;
public static final int card21=0x7f02000e;
public static final int card3=0x7f02000f;
public static final int card4=0x7f020010;
public static final int card5=0x7f020011;
public static final int card6=0x7f020012;
public static final int card7=0x7f020013;
public static final int card8=0x7f020014;
public static final int card9=0x7f020015;
public static final int ic_launcher=0x7f020016;
public static final int icon=0x7f020017;
public static final int jungle_jumble_icon=0x7f020018;
public static final int textview_back=0x7f020019;
public static final int tree_icon=0x7f02001a;
}
public static final class id {
public static final int How_to_Play=0x7f070001;
public static final int Instructions=0x7f070003;
public static final int LinearLayout01=0x7f070011;
public static final int MainActivity=0x7f070002;
public static final int Menu=0x7f070000;
public static final int Start=0x7f070004;
public static final int TableLayout03=0x7f07000b;
public static final int TableRow01=0x7f07000e;
public static final int TableRow02=0x7f07000f;
public static final int TableRow03=0x7f070010;
public static final int TableRow04=0x7f07000c;
public static final int TableRow05=0x7f07000d;
public static final int game_grid_size=0x7f070005;
public static final int high_score=0x7f070006;
public static final int menu_settings=0x7f070013;
public static final int tableRow1=0x7f070007;
public static final int tableRow2=0x7f070008;
public static final int tableRow3=0x7f070009;
public static final int tableRow4=0x7f07000a;
public static final int time=0x7f070012;
}
public static final class layout {
public static final int activity_instructions_page=0x7f030000;
public static final int activity_levels=0x7f030001;
public static final int activity_main=0x7f030002;
public static final int activity_new_game=0x7f030003;
}
public static final class menu {
public static final int activity_instructions_page=0x7f060000;
public static final int activity_levels=0x7f060001;
public static final int activity_main=0x7f060002;
public static final int activity_new_game=0x7f060003;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int hello_world=0x7f040001;
public static final int menu_settings=0x7f040002;
public static final int title_activity_instructions_page=0x7f040005;
public static final int title_activity_levels=0x7f040004;
public static final int title_activity_new_game=0x7f040003;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f050000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f050001;
}
}
| [
"saijalsuri@live.com"
] | saijalsuri@live.com |
1ae79b5bacc30f4287c508b919d06188f12e45d4 | b82df40b69d254b0f13e122beb90b989da327810 | /src/main/java/state/Test.java | 5da7faefa10719480c72d7f8ab6319b57488aded | [] | no_license | lylzmm/forestry | 4f97a15b6642226dd78c1eb390f0a15ac8755269 | 17727a1ab3b146234e026830219073b896fc8775 | refs/heads/master | 2023-08-24T19:11:18.052695 | 2021-09-27T00:58:54 | 2021-09-27T00:58:54 | 410,699,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package state;
import java.util.ArrayList;
public class Test {
public static void main(String[] args) {
System.out.println(1629681475005L - 1629356088053L);
}
}
| [
"1764705089@qq.com"
] | 1764705089@qq.com |
34264054d9a5d4a61d33cef3ed31f31d89b39e41 | a17871ba6e0928d3ac9dd48aa709dd07e5c24429 | /src/java/modeloDAO/AreaDAO.java | 48dc5e0f536a5e61ee3c45d1573780a8cbc5d770 | [] | no_license | Marcoar02/examenfinal-LP2 | 256021e8bc8cf53a603a9196fb2cafd374fe00e4 | e9e1b52ddba227c8cd5b09ffff7b75ef8cfb5972 | refs/heads/master | 2022-12-03T02:57:15.585121 | 2020-08-20T08:49:55 | 2020-08-20T08:49:55 | 288,953,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,700 | java |
package modeloDAO;
import Config.bd.ConectaBd;
import Interfaces.CRUD_Area;
import Modelo.Area;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
public class AreaDAO implements CRUD_Area {
ConectaBd cn = new ConectaBd();
Connection con;
PreparedStatement pst;
ResultSet rs;
Area e = new Area();
@Override
public List listaarea() {
ArrayList<Area> areas = new ArrayList<>();
String consulta = " select * "
+ " from area ";
try {
con = cn.getConnection();
pst = con.prepareStatement(consulta);
rs = pst.executeQuery();
while (rs.next()) {
Area area = new Area();
area.setIdarea(rs.getInt("idarea"));
area.setNombre(rs.getString("nombre"));
area.setEstado(rs.getString("estado"));
areas.add(area);
}
} catch (Exception e) {
}
return areas;
}
@Override
public Area buscararea(int idarea) {
String consulta = " select * "
+ " from area "
+ " where idarea = "+ idarea +" ; ";
try {
con = cn.getConnection();
pst = con.prepareStatement(consulta);
rs = pst.executeQuery();
while (rs.next()) {
e.setIdarea(rs.getInt("idarea"));
e.setNombre(rs.getString("nombre"));
e.setEstado(rs.getString("estado"));
}
} catch (Exception e) {
}
return e;
}
@Override
public boolean agregararea(Area area) {
String consulta = " insert into area(nombre, estado) "
+ " values( "
+ "'"+ area.getNombre() +"', "
+ "'"+ area.getEstado() +"'); ";
try {
con = cn.getConnection();
pst = con.prepareStatement(consulta);
pst.executeUpdate();
} catch (Exception e) {
}
return false;
}
@Override
public boolean editararea(Area area) {
String consulta = " update area "
+ " set "
+ " nombre = '"+ area.getNombre() +"',"
+ " estado = '"+ area.getEstado() +"' "
+ " where "
+ " idarea = "+ area.getIdarea() +" ; ";
try {
con = cn.getConnection();
pst = con.prepareStatement(consulta);
pst.executeUpdate();
} catch (Exception e) {
}
return false;
}
@Override
public boolean eliminararea(int idarea) {
String consulta = " delete from area "
+ " where "
+ " idarea = "+ idarea +" ; ";
try {
con = cn.getConnection();
pst = con.prepareStatement(consulta);
pst.executeUpdate();
} catch (Exception e) {
}
return false;
}
public boolean validareliminacion(int idarea) {
boolean valido = true;
String consulta = "select * from sugerencia where idarea = "+idarea;
try {
con = cn.getConnection();
pst = con.prepareStatement(consulta);
rs = pst.executeQuery();
if(rs.last()){
valido = false;
}
} catch (Exception e) {
}
return valido;
}
}
| [
"1813011485@untels.edu.pe"
] | 1813011485@untels.edu.pe |
b05e88cf92eb7d36733e71a0bec545fbbc2edb8d | 8b27f0d905f724cb6a18e75fc5b082c18d24b203 | /app/src/main/java/com/dawoo/lotterybox/adapter/hall/parent/BannerViewHolder.java | 7f673d87d69642421a218bdd55a4a646761a8181 | [] | no_license | easyGuyLyn/lt_b_pai | 96a03989e6075dc731e76d5f83bfbb93a8664c50 | a63853d73cf1e2b3a8a0e002af08a54d632f4990 | refs/heads/master | 2023-04-04T11:48:20.736794 | 2021-04-05T04:31:32 | 2021-04-05T04:31:32 | 140,645,815 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,600 | java | package com.dawoo.lotterybox.adapter.hall.parent;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.dawoo.lotterybox.ConstantValue;
import com.dawoo.lotterybox.R;
import com.dawoo.lotterybox.adapter.hall.child.BaseViewHolder;
import com.dawoo.lotterybox.adapter.hall.child.adapterset.BannerConfigInit;
import com.dawoo.lotterybox.bean.BannerBean;
import com.dawoo.lotterybox.bean.DataCenter;
import com.dawoo.lotterybox.util.ActivityUtil;
import com.dawoo.lotterybox.util.NetUtil;
import com.youth.banner.Banner;
import java.util.ArrayList;
import java.util.List;
/**
* Created by b on 18-4-12.
* ่ฝฎๆญๅพ
*/
public class BannerViewHolder extends BaseViewHolder {
Banner mBanner;
public BannerViewHolder(Context context ,View itemView) {
super(itemView);
mBanner = itemView.findViewById(R.id.banner);
}
public void bindView(List<BannerBean> bannerBeans){
List images = new ArrayList();
List titles = new ArrayList();
List<String> Links = new ArrayList();
for (int i = 0; i < bannerBeans.size(); i++) {
images.add(NetUtil.handleUrl(DataCenter.getInstance().getImgDomain(), bannerBeans.get(i).getCover()));
titles.add(bannerBeans.get(i).getName());
Links.add(bannerBeans.get(i).getLink());
}
BannerConfigInit init = new BannerConfigInit(mBanner, images, titles, position ->
ActivityUtil.startWebView(Links.get(position), ConstantValue.WEBVIEW_TYPE_ORDINARY));
init.start();
}
}
| [
"archar@dawoo.com"
] | archar@dawoo.com |
8dc2f990b89401f999097df6e523adac97070178 | ef38f7de1121afa3c8d61927607d6814ac074e16 | /src/main/java/com/irurueta/navigation/inertial/calibration/generators/MeasurementsGenerator.java | 44bea6833ef139807b8ed0efad097799385d7704 | [
"Apache-2.0"
] | permissive | yxw027/irurueta-navigation | 951e2d1d153cc1441bac63b2da3c2f45cef0dd8e | 0d9cdcaabf36772217c1ee242ba6bda35dd48750 | refs/heads/master | 2023-01-10T16:09:33.751999 | 2020-11-13T23:34:15 | 2020-11-13T23:34:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 28,829 | java | /*
* Copyright (C) 2020 Alberto Irurueta Carro (alberto@irurueta.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.irurueta.navigation.inertial.calibration.generators;
import com.irurueta.navigation.LockedException;
import com.irurueta.navigation.inertial.calibration.AccelerationTriad;
import com.irurueta.navigation.inertial.calibration.intervals.AccelerationTriadStaticIntervalDetector;
import com.irurueta.navigation.inertial.calibration.intervals.AccelerationTriadStaticIntervalDetectorListener;
import com.irurueta.navigation.inertial.calibration.intervals.TriadStaticIntervalDetector;
import com.irurueta.navigation.inertial.calibration.noise.WindowedTriadNoiseEstimator;
import com.irurueta.units.Acceleration;
/**
* Base class to generate measurements for the calibration of accelerometers, gyroscopes or
* magnetometers after detection of static/dynamic intervals.
*
* @param <T> type of measurement to be generated.
* @param <G> type of generator.
* @param <L> type of listener.
* @param <I> type of input data to be processed.
*/
public abstract class MeasurementsGenerator<T, G extends MeasurementsGenerator<T, G, L, I>,
L extends MeasurementsGeneratorListener<T, G, L, I>, I> {
/**
* Default minimum number of samples required in a static interval to be taken into account.
* Smaller static intervals will be discarded.
*/
public static final int DEFAULT_MIN_STATIC_SAMPLES = 2 * TriadStaticIntervalDetector.DEFAULT_WINDOW_SIZE;
/**
* Default maximum number of samples allowed in dynamic intervals.
* Larger dynamic intervals will be discarded.
*/
public static final int DEFAULT_MAX_DYNAMIC_SAMPLES = 30 * TriadStaticIntervalDetector.DEFAULT_WINDOW_SIZE;
/**
* Listener to handle generated events.
*/
protected L mListener;
/**
* An acceleration triad.
* This is reused for memory efficiency.
*/
protected final AccelerationTriad mTriad = new AccelerationTriad();
/**
* Static/dynamic interval detector using accelerometer samples.
*/
protected final AccelerationTriadStaticIntervalDetector mStaticIntervalDetector;
/**
* Indicates whether generator is running or not.
*/
private boolean mRunning;
/**
* Minimum number of samples required in a static interval to be taken into account.
* Smaller static intervals will be discarded.
*/
private int mMinStaticSamples = DEFAULT_MIN_STATIC_SAMPLES;
/**
* Maximum number of samples allowed in dynamic intervals.
* Larger dynamic intervals will be discarded.
*/
private int mMaxDynamicSamples = DEFAULT_MAX_DYNAMIC_SAMPLES;
/**
* Number of samples that have been processed in a static period so far.
*/
private int mProcessedStaticSamples;
/**
* Number of samples that have been processed in a dynamic period so far.
*/
private int mProcessedDynamicSamples;
/**
* Indicates whether static interval must be skipped.
*/
private boolean mSkipStaticInterval;
/**
* Indicates whether dynamic interval must be skipped.
*/
private boolean mSkipDynamicInterval;
/**
* Constructor.
*/
public MeasurementsGenerator() {
mStaticIntervalDetector = new AccelerationTriadStaticIntervalDetector();
try {
setupListener();
} catch (final LockedException ignore) {
}
}
/**
* Constructor.
*
* @param listener listener to handle events raised by this generator.
*/
public MeasurementsGenerator(final L listener) {
this();
mListener = listener;
}
/**
* Gets minimum number of samples required in a static interval to be taken into account.
* Smaller static intervals will be discarded.
*
* @return minimum number of samples required in a static interval to be taken into account.
*/
public int getMinStaticSamples() {
return mMinStaticSamples;
}
/**
* Sets minimum number of samples required in a static interval to be taken into account.
* Smaller static intervals will be discarded.
*
* @param minStaticSamples minimum number of samples required in a static interval to be
* taken into account.
* @throws LockedException if generator is busy.
* @throws IllegalArgumentException if provided value is less than 2.
*/
public void setMinStaticSamples(final int minStaticSamples) throws LockedException {
if (mRunning) {
throw new LockedException();
}
if (minStaticSamples < WindowedTriadNoiseEstimator.MIN_WINDOW_SIZE) {
throw new IllegalArgumentException();
}
mMinStaticSamples = minStaticSamples;
}
/**
* Gets maximum number of samples allowed in dynamic intervals.
*
* @return maximum number of samples allowed in dynamic intervals.
*/
public int getMaxDynamicSamples() {
return mMaxDynamicSamples;
}
/**
* Sets maximum number of samples allowed in dynamic intervals.
*
* @param maxDynamicSamples maximum number of samples allowed in dynamic intervals.
* @throws LockedException if generator is busy.
* @throws IllegalArgumentException if provided value is less than 2.
*/
public void setMaxDynamicSamples(final int maxDynamicSamples) throws LockedException {
if (mRunning) {
throw new LockedException();
}
if (maxDynamicSamples < WindowedTriadNoiseEstimator.MIN_WINDOW_SIZE) {
throw new IllegalArgumentException();
}
mMaxDynamicSamples = maxDynamicSamples;
}
/**
* Gets listener to handle generated events.
*
* @return listener to handle generated events.
*/
public L getListener() {
return mListener;
}
/**
* Sets listener to handle generated events.
*
* @param listener listener to handle generated evets.
* @throws LockedException if generator is busy.
*/
public void setListener(final L listener) throws LockedException {
if (mRunning) {
throw new LockedException();
}
mListener = listener;
}
/**
* Gets length of number of samples to keep within the window being processed
* to determine instantaneous accelerometer noise level.
*
* @return length of number of samples to keep within the window.
*/
public int getWindowSize() {
return mStaticIntervalDetector.getWindowSize();
}
/**
* Sets length of number of samples to keep within the window being processed
* to determine instantaneous accelerometer noise level.
* Window size must always be larger than allowed minimum value, which is 2 and
* must have an odd value.
*
* @param windowSize length of number of samples to keep within the window.
* @throws LockedException if detector is busy processing a previous sample.
* @throws IllegalArgumentException if provided value is not valid.
*/
public void setWindowSize(final int windowSize) throws LockedException {
if (mRunning) {
throw new LockedException();
}
mStaticIntervalDetector.setWindowSize(windowSize);
}
/**
* Gets number of samples to be processed initially while keeping the sensor static in order
* to find the base noise level when device is static.
*
* @return number of samples to be processed initially.
*/
public int getInitialStaticSamples() {
return mStaticIntervalDetector.getInitialStaticSamples();
}
/**
* Sets number of samples to be processed initially while keeping the sensor static in order
* to find the base noise level when device is static.
*
* @param initialStaticSamples number of samples to be processed initially.
* @throws LockedException if detector is busy.
* @throws IllegalArgumentException if provided value is less than
* {@link TriadStaticIntervalDetector#MINIMUM_INITIAL_STATIC_SAMPLES}
*/
public void setInitialStaticSamples(final int initialStaticSamples)
throws LockedException {
if (mRunning) {
throw new LockedException();
}
mStaticIntervalDetector.setInitialStaticSamples(initialStaticSamples);
}
/**
* Gets factor to be applied to detected base noise level in order to
* determine threshold for static/dynamic period changes. This factor is
* unit-less.
*
* @return factor to be applied to detected base noise level.
*/
public double getThresholdFactor() {
return mStaticIntervalDetector.getThresholdFactor();
}
/**
* Sets factor to be applied to detected base noise level in order to
* determine threshold for static/dynamic period changes. This factor is
* unit-less.
*
* @param thresholdFactor factor to be applied to detected base noise level.
* @throws LockedException if detector is busy.
* @throws IllegalArgumentException if provided value is zero or negative.
*/
public void setThresholdFactor(final double thresholdFactor)
throws LockedException {
if (mRunning) {
throw new LockedException();
}
mStaticIntervalDetector.setThresholdFactor(thresholdFactor);
}
/**
* Gets factor to determine that a sudden movement has occurred during
* initialization if instantaneous noise level exceeds accumulated noise
* level by this factor amount.
* This factor is unit-less.
*
* @return factor to determine that a sudden movement has occurred.
*/
public double getInstantaneousNoiseLevelFactor() {
return mStaticIntervalDetector.getInstantaneousNoiseLevelFactor();
}
/**
* Sets factor to determine that a sudden movement has occurred during
* initialization if instantaneous noise level exceeds accumulated noise
* level by this factor amount.
* This factor is unit-less.
*
* @param instantaneousNoiseLevelFactor factor to determine that a sudden
* movement has occurred during
* initialization.
* @throws LockedException if detector is busy.
* @throws IllegalArgumentException if provided value is zero or negative.
*/
public void setInstantaneousNoiseLevelFactor(
final double instantaneousNoiseLevelFactor) throws LockedException {
if (mRunning) {
throw new LockedException();
}
mStaticIntervalDetector.setInstantaneousNoiseLevelFactor(
instantaneousNoiseLevelFactor);
}
/**
* Gets overall absolute threshold to determine whether there has been
* excessive motion during the whole initialization phase.
* Failure will be detected if estimated base noise level exceeds this
* threshold when initialization completes.
* This threshold is expressed in meters per squared second (m/s^2).
*
* @return overall absolute threshold to determine whether there has
* been excessive motion.
*/
public double getBaseNoiseLevelAbsoluteThreshold() {
return mStaticIntervalDetector.getBaseNoiseLevelAbsoluteThreshold();
}
/**
* Sets overall absolute threshold to determine whether there has been
* excessive motion during the whole initialization phase.
* Failure will be detected if estimated base noise level exceeds this
* threshold when initialization completes.
* This threshold is expressed in meters per squared second (m/s^2).
*
* @param baseNoiseLevelAbsoluteThreshold overall absolute threshold to
* determine whether there has been
* excessive motion.
* @throws LockedException if detector is busy.
* @throws IllegalArgumentException if provided value is zero or negative.
*/
public void setBaseNoiseLevelAbsoluteThreshold(
final double baseNoiseLevelAbsoluteThreshold) throws LockedException {
if (mRunning) {
throw new LockedException();
}
mStaticIntervalDetector.setBaseNoiseLevelAbsoluteThreshold(
baseNoiseLevelAbsoluteThreshold);
}
/**
* Gets overall absolute threshold to determine whether there has been
* excessive motion during the whole initialization phase.
* Failure will be detected if estimated base noise level exceeds this
* threshold when initialization completes.
*
* @return overall absolute threshold to determine whether there has been
* excessive motion.
*/
public Acceleration getBaseNoiseLevelAbsoluteThresholdAsMeasurement() {
return mStaticIntervalDetector.getBaseNoiseLevelAbsoluteThresholdAsMeasurement();
}
/**
* Gets overall absolute threshold to determine whether there has been
* excessive motion during the whole initialization phase.
* Failure will be detected if estimated base noise level exceeds this
* threshold when initialization completes.
*
* @param result instance where result will be stored.
*/
public void getBaseNoiseLevelAbsoluteThresholdAsMeasurement(
final Acceleration result) {
mStaticIntervalDetector.getBaseNoiseLevelAbsoluteThresholdAsMeasurement(
result);
}
/**
* Sets overall absolute threshold to determine whether there has been
* excessive motion during the whole initialization phase.
* Failure will be detected if estimated base noise level exceeds this
* threshold when initialization completes.
*
* @param baseNoiseLevelAbsoluteThreshold overall absolute threshold to
* determine whether there has been
* excessive motion.
* @throws LockedException if detector is busy.
* @throws IllegalArgumentException if provided value is zero or negative.
*/
public void setBaseNoiseLevelAbsoluteThreshold(
final Acceleration baseNoiseLevelAbsoluteThreshold) throws LockedException {
if (mRunning) {
throw new LockedException();
}
mStaticIntervalDetector.setBaseNoiseLevelAbsoluteThreshold(
baseNoiseLevelAbsoluteThreshold);
}
/**
* Gets internal status of this generator.
*
* @return internal status of this generator.
*/
public TriadStaticIntervalDetector.Status getStatus() {
return mStaticIntervalDetector.getStatus();
}
/**
* Gets accelerometer base noise level that has been detected during
* initialization expressed in meters per squared second (m/s^2).
* This is equal to the standard deviation of the accelerometer measurements
* during initialization phase.
*
* @return accelerometer base noise level.
*/
public double getBaseNoiseLevel() {
return mStaticIntervalDetector.getBaseNoiseLevel();
}
/**
* Gets accelerometer base noise level that has been detected during
* initialization.
* This is equal to the standard deviation of the accelerometer measurements
* during initialization phase.
*
* @return measurement base noise level.
*/
public Acceleration getBaseNoiseLevelAsMeasurement() {
return mStaticIntervalDetector.getBaseNoiseLevelAsMeasurement();
}
/**
* Gets accelerometer base noise level that has been detected during
* initialization.
*
* @param result instance where result will be stored.
*/
public void getBaseNoiseLevelAsMeasurement(final Acceleration result) {
mStaticIntervalDetector.getBaseNoiseLevelAsMeasurement(result);
}
/**
* Gets threshold to determine static/dynamic period changes expressed in
* meters per squared second (m/s^2).
*
* @return threshold to determine static/dynamic period changes.
*/
public double getThreshold() {
return mStaticIntervalDetector.getThreshold();
}
/**
* Gets threshold to determine static/dynamic period changes.
*
* @return threshold to determine static/dynamic period changes.
*/
public Acceleration getThresholdAsMeasurement() {
return mStaticIntervalDetector.getThresholdAsMeasurement();
}
/**
* Gets threshold to determine static/dynamic period changes.
*
* @param result instance where result will be stored.
*/
public void getThresholdAsMeasurement(final Acceleration result) {
mStaticIntervalDetector.getThresholdAsMeasurement(result);
}
/**
* Gets number of samples that have been processed in a static period so far.
*
* @return number of samples that have been processed in a static period so far.
*/
public int getProcessedStaticSamples() {
return mProcessedStaticSamples;
}
/**
* Gets number of samples that have been processed in a dynamic period so far.
*
* @return number of samples that have been processed in a dynamic period so far.
*/
public int getProcessedDynamicSamples() {
return mProcessedDynamicSamples;
}
/**
* Indicates whether last static interval must be skipped.
*
* @return true if last static interval must be skipped.
*/
public boolean isStaticIntervalSkipped() {
return mSkipStaticInterval;
}
/**
* Indicates whether last dynamic interval must be skipped.
*
* @return true if last dynamic interval must be skipped.
*/
public boolean isDynamicIntervalSkipped() {
return mSkipDynamicInterval;
}
/**
* Indicates whether generator is running or not.
*
* @return true if generator is running, false otherwise.
*/
public boolean isRunning() {
return mRunning;
}
/**
* Processes a sample of data.
*
* @param sample sample of data to be processed.
* @return true if provided samples has been processed, false if provided triad has been skipped because
* generator previously failed. If generator previously failed, it will need to be reset before
* processing additional samples.
* @throws LockedException if generator is busy processing a previous sample.
*/
public boolean process(final I sample) throws LockedException {
if (mRunning) {
throw new LockedException();
}
mRunning = true;
checkProcessedSamples();
getAccelerationTriadFromInputSample(sample);
final boolean result = mStaticIntervalDetector.process(mTriad);
if (result) {
updateCounters();
postProcess(sample);
}
mRunning = false;
return result;
}
/**
* Resets this generator.
*
* @throws LockedException if generator is busy.
*/
public void reset() throws LockedException {
if (mRunning) {
throw new LockedException();
}
mStaticIntervalDetector.reset();
mProcessedDynamicSamples = 0;
mProcessedStaticSamples = 0;
mSkipDynamicInterval = false;
mSkipStaticInterval = false;
if (mListener != null) {
//noinspection unchecked
mListener.onReset((G) this);
}
}
/**
* Post process provided input sample.
*
* @param sample an input sample.
* @throws LockedException if generator is busy.
*/
protected abstract void postProcess(final I sample) throws LockedException;
/**
* Gets corresponding acceleration triad from provided input sample.
* This method must store the result into {@link #mTriad}.
*
* @param sample input sample.
*/
protected abstract void getAccelerationTriadFromInputSample(
final I sample);
/**
* Handles a static-to-dynamic interval change.
*
* @param accumulatedAvgX average x-coordinate of measurements during last
* static period expressed in meters per squared
* second (m/s^2).
* @param accumulatedAvgY average y-coordinate of specific force during last
* static period expressed in meters per squared
* second (m/s^2).
* @param accumulatedAvgZ average z-coordinate of specific force during last
* static period expressed in meters per squared
* second (m/s^2).
* @param accumulatedStdX standard deviation of x-coordinate of measurements
* during last static period expressed in meters per
* squared second (m/s^2).
* @param accumulatedStdY standard deviation of y-coordinate of measurements
* during last static period expressed in meters per
* squared second (m/s^2).
* @param accumulatedStdZ standard deviation of z-coordinate of measurements
* during last static period expressed in meters per
* squared second (m/s^2).
*/
protected abstract void handleStaticToDynamicChange(
final double accumulatedAvgX,
final double accumulatedAvgY,
final double accumulatedAvgZ,
final double accumulatedStdX,
final double accumulatedStdY,
final double accumulatedStdZ);
/**
* Handles a dynamic-to-static interval change.
*/
protected abstract void handleDynamicToStaticChange();
/**
* Handles an initialization completion.
*/
protected abstract void handleInitializationCompleted();
/**
* Handles an error during initialization.
*/
protected abstract void handleInitializationFailed();
/**
* Check processed samples so far before processing a new one.
*/
protected void checkProcessedSamples() {
if (mProcessedDynamicSamples > mMaxDynamicSamples) {
final boolean wasSkipped = mSkipDynamicInterval;
mSkipDynamicInterval = true;
if (mListener != null && !wasSkipped) {
//noinspection unchecked
mListener.onDynamicIntervalSkipped((G) this);
}
}
}
/**
* Updates counters of processed samples.
*/
protected void updateCounters() {
switch (mStaticIntervalDetector.getStatus()) {
case STATIC_INTERVAL:
mProcessedStaticSamples++;
mProcessedDynamicSamples = 0;
break;
case DYNAMIC_INTERVAL:
mProcessedDynamicSamples++;
mProcessedStaticSamples = 0;
break;
}
}
/**
* Setups listener for static interval detector.
*
* @throws LockedException if static interval detector is busy.
*/
private void setupListener() throws LockedException {
final AccelerationTriadStaticIntervalDetectorListener listener =
new AccelerationTriadStaticIntervalDetectorListener() {
@Override
public void onInitializationStarted(
final AccelerationTriadStaticIntervalDetector detector) {
if (mListener != null) {
//noinspection unchecked
mListener.onInitializationStarted((G) MeasurementsGenerator.this);
}
}
@Override
public void onInitializationCompleted(
final AccelerationTriadStaticIntervalDetector detector,
final double baseNoiseLevel) {
handleInitializationCompleted();
if (mListener != null) {
//noinspection unchecked
mListener.onInitializationCompleted(
(G) MeasurementsGenerator.this,
baseNoiseLevel);
}
}
@Override
public void onError(
final AccelerationTriadStaticIntervalDetector detector,
final double accumulatedNoiseLevel,
final double instantaneousNoiseLevel,
final TriadStaticIntervalDetector.ErrorReason reason) {
handleInitializationFailed();
if (mListener != null) {
//noinspection unchecked
mListener.onError((G) MeasurementsGenerator.this, reason);
}
}
@Override
public void onStaticIntervalDetected(
final AccelerationTriadStaticIntervalDetector detector,
final double instantaneousAvgX,
final double instantaneousAvgY,
final double instantaneousAvgZ,
final double instantaneousStdX,
final double instantaneousStdY,
final double instantaneousStdZ) {
handleDynamicToStaticChange();
mSkipDynamicInterval = false;
if (mListener != null) {
//noinspection unchecked
mListener.onStaticIntervalDetected((G) MeasurementsGenerator.this);
}
}
@Override
public void onDynamicIntervalDetected(
final AccelerationTriadStaticIntervalDetector detector,
final double instantaneousAvgX,
final double instantaneousAvgY,
final double instantaneousAvgZ,
final double instantaneousStdX,
final double instantaneousStdY,
final double instantaneousStdZ,
final double accumulatedAvgX,
final double accumulatedAvgY,
final double accumulatedAvgZ,
final double accumulatedStdX,
final double accumulatedStdY,
final double accumulatedStdZ) {
if (mProcessedStaticSamples < mMinStaticSamples) {
final boolean wasSkipped = mSkipStaticInterval;
mSkipStaticInterval = true;
if (mListener != null && !wasSkipped) {
//noinspection unchecked
mListener.onStaticIntervalSkipped((G) MeasurementsGenerator.this);
}
}
handleStaticToDynamicChange(
accumulatedAvgX, accumulatedAvgY, accumulatedAvgZ,
accumulatedStdX, accumulatedStdY, accumulatedStdZ);
mSkipStaticInterval = false;
if (mListener != null) {
//noinspection unchecked
mListener.onDynamicIntervalDetected((G) MeasurementsGenerator.this);
}
}
@Override
public void onReset(
final AccelerationTriadStaticIntervalDetector detector) {
}
};
mStaticIntervalDetector.setListener(listener);
}
}
| [
"alberto@irurueta.com"
] | alberto@irurueta.com |
0e13cef5da84710c49014fff59f73904e71ef13b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_835ecf22515ed2e45c4cb9263557b75287f4663f/MMAcquisition/9_835ecf22515ed2e45c4cb9263557b75287f4663f_MMAcquisition_t.java | 222b095e2d66e4ad5a4064ea9dbac6580b8edeb8 | [] | 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 | 20,661 | java | ///////////////////////////////////////////////////////////////////////////////
//FILE: MMAcquisition.java
//PROJECT: Micro-Manager
//SUBSYSTEM: mmstudio
//-----------------------------------------------------------------------------
//
// AUTHOR: Nico Stuurman, November 2010
//
// COPYRIGHT: University of California, San Francisco, 2010
//
// LICENSE: This file is distributed under the BSD license.
// License text is included with the source distribution.
//
// This file 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.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
/*
* This class is used to execute most of the acquisition and image display
* functionality in the ScriptInterface
*/
package org.micromanager.acquisition;
import java.awt.Color;
import java.io.File;
import java.util.Iterator;
import mmcorej.TaggedImage;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONException;
import org.micromanager.MMStudioMainFrame;
import org.micromanager.api.TaggedImageStorage;
import org.micromanager.utils.MDUtils;
import org.micromanager.utils.MMScriptException;
import org.micromanager.utils.ReportingUtils;
public class MMAcquisition {
private int numFrames_ = 0;
private int numChannels_ = 0;
private int numSlices_ = 0;
private int numPositions_ = 0;
protected String name_;
protected int width_ = 0;
protected int height_ = 0;
protected int depth_ = 1;
private boolean initialized_ = false;
private long startTimeMs_;
private String comment_ = "Acquisition from a script";
private String rootDirectory_;
private VirtualAcquisitionDisplay virtAcq_;
private final boolean existing_;
private final boolean diskCached_;
private final boolean show_;
private JSONArray channelColors_ = new JSONArray();
private JSONArray channelNames_ = new JSONArray();
private JSONObject summary_ = new JSONObject();
private final String NOTINITIALIZED = "Acquisition was not initialized";
public MMAcquisition(String name, String dir) throws MMScriptException {
this(name, dir, false, false, false);
}
public MMAcquisition(String name, String dir, boolean show) throws MMScriptException {
this(name, dir, show, false, false);
}
public MMAcquisition(String name, String dir, boolean show,
boolean diskCached, boolean existing) throws MMScriptException {
name_ = name;
rootDirectory_ = dir;
show_ = show;
existing_ = existing;
diskCached_ = diskCached;
}
static private String generateRootName(String name, String baseDir) {
// create new acquisition directory
int suffixCounter = 0;
String testPath;
File testDir;
String testName;
do {
testName = name + "_" + suffixCounter;
testPath = baseDir + File.separator + testName;
suffixCounter++;
testDir = new File(testPath);
} while (testDir.exists());
return testName;
}
public void setImagePhysicalDimensions(int width, int height, int depth) throws MMScriptException {
if (initialized_) {
throw new MMScriptException("Can't image change dimensions - the acquisition is already initialized");
}
width_ = width;
height_ = height;
depth_ = depth;
}
public int getWidth() {
return width_;
}
public int getHeight() {
return height_;
}
public int getDepth() {
return depth_;
}
public int getFrames() {
return numFrames_;
}
public int getChannels() {
return numChannels_;
}
public int getSlices() {
return numSlices_;
}
public void setDimensions(int frames, int channels, int slices) throws MMScriptException {
setDimensions(frames, channels, slices, 0);
}
public void setDimensions(int frames, int channels, int slices, int positions) throws MMScriptException {
if (initialized_) {
throw new MMScriptException("Can't change dimensions - the acquisition is already initialized");
}
numFrames_ = frames;
numChannels_ = channels;
numSlices_ = slices;
numPositions_ = positions;
}
public void setRootDirectory(String dir) throws MMScriptException {
if (initialized_) {
throw new MMScriptException("Can't change root directory - the acquisition is already initialized");
}
rootDirectory_ = dir;
}
public void initialize() throws MMScriptException {
if (initialized_)
throw new MMScriptException("Acquisition is already initialized");
TaggedImageStorage imageFileManager;
String name = name_;
if (diskCached_) {
String dirname = rootDirectory_ + File.separator + name;
imageFileManager = new TaggedImageStorageDiskDefault(dirname,
!existing_, new JSONObject());
} else {
imageFileManager = new TaggedImageStorageRam(null);
}
MMImageCache imageCache = new MMImageCache(imageFileManager);
if (!existing_) {
createDefaultAcqSettings(name, imageCache);
}
virtAcq_ = new VirtualAcquisitionDisplay(imageCache, null);
if (show_ && diskCached_ && existing_) {
// start loading all other images in a background thread
PreLoadDataThread t = new PreLoadDataThread(virtAcq_);
new Thread(t).start();
}
if (show_) {
virtAcq_.show();
}
initialized_ = true;
}
private void createDefaultAcqSettings(String name, MMImageCache imageCache) {
if (new File(rootDirectory_).exists()) {
name = generateRootName(name, rootDirectory_);
}
String keys[] = new String[summary_.length()];
Iterator<String> it = summary_.keys();
int i = 0;
while (it.hasNext()) {
keys[0] = it.next();
i++;
}
try {
JSONObject summaryMetadata = new JSONObject(summary_, keys);
summaryMetadata.put("Width", width_);
summaryMetadata.put("Height", height_);
summaryMetadata.put("Slices", numSlices_);
summaryMetadata.put("Frames", numFrames_);
summaryMetadata.put("Channels", numChannels_);
summaryMetadata.put("Positions", numPositions_);
summaryMetadata.put("NumComponents", 1);
summaryMetadata.put("Comment", comment_);
summaryMetadata.put("MetadataVersion", 10);
summaryMetadata.put("Source", "Micro-Manager");
summaryMetadata.put("PixelSize_um", MMStudioMainFrame.getInstance().getCore().getPixelSizeUm());
summaryMetadata.put("PixelAspect", 1.0);
summaryMetadata.put("GridColumn", 0);
summaryMetadata.put("GridRow", 0);
//summaryMetadata.put("ComputerName", getComputerName());
summaryMetadata.put("UserName", System.getProperty("user.name"));
if (depth_ == 1) {
summaryMetadata.put("PixelType", "GRAY8");
} else if (depth_ == 2) {
summaryMetadata.put("PixelType", "GRAY16");
}
summaryMetadata.put("StartTime", MDUtils.getCurrentTime());
startTimeMs_ = System.currentTimeMillis();
setDefaultChannelTags(summaryMetadata);
imageCache.setSummaryMetadata(summaryMetadata);
} catch (JSONException ex) {
ReportingUtils.showError(ex);
}
}
private void setDefaultChannelTags(JSONObject md) {
JSONArray channelMaxes = new JSONArray();
JSONArray channelMins = new JSONArray();
for (Integer i = 0; i < numChannels_; i++) {
try {
channelColors_.get(i);
} catch (JSONException ex) {
try {
channelColors_.put(i, (Object) Color.white.getRGB());
} catch (JSONException exx ) {;}
}
try {
channelNames_.get(i);
} catch (JSONException ex) {
try {
channelNames_.put(i, String.valueOf(i));
} catch (JSONException exx) {;}
}
try {
channelMaxes.put(255);
channelMins.put(0);
} catch (Exception e) {
ReportingUtils.logError(e);
}
}
try {
md.put("ChColors", channelColors_);
md.put("ChNames", channelNames_);
md.put("ChContrastMax", channelMaxes);
md.put("ChContrastMin", channelMins);
} catch (Exception e) {
ReportingUtils.logError(e);
}
}
public void insertImage(Object pixels, int frame, int channel, int slice)
throws MMScriptException {
insertImage(pixels, frame, channel, slice, 0);
}
public void insertImage(Object pixels, int frame, int channel, int slice, int position) throws MMScriptException {
if (!initialized_) {
throw new MMScriptException("Acquisition data must be initialized before inserting images");
}
// update acq data
try {
JSONObject tags = new JSONObject();
tags.put("Frame", frame);
tags.put("ChannelIndex", channel);
tags.put("Channel", getChannelName(channel));
tags.put("Slice", slice);
tags.put("PositionIndex", position);
// the following influences the format data will be saved!
if (numPositions_ > 1) {
tags.put("PositionName", "Pos" + position);
}
tags.put("Width", width_);
tags.put("Height", height_);
if (depth_ == 1) {
tags.put("PixelType", "GRAY8");
} else if (depth_ == 2) {
tags.put("PixelType", "GRAY16");
}
TaggedImage tg = new TaggedImage(pixels, tags);
insertImage(tg);
} catch (JSONException e) {
throw new MMScriptException(e);
}
}
public void insertTaggedImage(TaggedImage taggedImg, int frame, int channel, int slice)
throws MMScriptException {
if (!initialized_) {
throw new MMScriptException("Acquisition data must be initialized before inserting images");
}
// update acq data
try {
JSONObject tags = taggedImg.tags;
tags.put("Frame", frame);
tags.put("ChannelIndex", channel);
tags.put("Slice", slice);
tags.put("PositionIndex", 0);
//tags.put("Width", width_);
//tags.put("Height", height_);
if (depth_ == 1) {
tags.put("PixelType", "GRAY8");
} else if (depth_ == 2) {
tags.put("PixelType", "GRAY16");
}
insertImage(taggedImg);
} catch (JSONException e) {
throw new MMScriptException(e);
}
}
public void insertImage(TaggedImage taggedImg) throws MMScriptException {
insertImage(taggedImg, show_);
}
public void insertImage(TaggedImage taggedImg, boolean updateDisplay) throws MMScriptException {
if (!initialized_) {
throw new MMScriptException("Acquisition data must be initialized before inserting images");
}
try {
int channel = taggedImg.tags.getInt("ChannelIndex");
taggedImg.tags.put("Channel", getChannelName(channel));
long elapsedTimeMillis = System.currentTimeMillis() - startTimeMs_;
taggedImg.tags.put("ElapsedTime-ms", elapsedTimeMillis);
taggedImg.tags.put("Time", MDUtils.getCurrentTime());
} catch (JSONException ex) {
throw new MMScriptException(ex);
}
virtAcq_.imageCache_.putImage(taggedImg);
if (updateDisplay) {
virtAcq_.showImage(taggedImg);
}
}
public void close() {
if (virtAcq_ != null) {
if (virtAcq_.acquisitionIsRunning()) {
virtAcq_.abort();
}
//virtAcq_.close();
}
}
public boolean isInitialized() {
return initialized_;
}
public void closeImage5D() {
close();
virtAcq_.close();
}
public void setComment(String comment) throws MMScriptException {
if (isInitialized()) {
try {
virtAcq_.imageCache_.getSummaryMetadata().put("COMMENT", comment);
} catch (JSONException e) {
throw new MMScriptException("Failed to set Comment");
}
} else {
comment_ = comment;
}
}
public AcquisitionData getAcqData() {
return null;
}
public JSONObject getSummaryMetadata() {
if (isInitialized())
return virtAcq_.imageCache_.getSummaryMetadata();
return null;
}
public String getChannelName(int channel) {
if (isInitialized()) {
try {
getSummaryMetadata().getJSONArray("ChNames").get(channel);
} catch (JSONException e) {
ReportingUtils.logError(e);
return "";
}
} else {
try {
return channelNames_.getString(channel);
} catch (JSONException ex) {
// not found, do nothing
}
}
return "";
}
public void setChannelName(int channel, String name) throws MMScriptException {
if (isInitialized()) {
try {
virtAcq_.imageCache_.getDisplayAndComments().getJSONArray("Channels").getJSONObject(channel).put("Name", name);
virtAcq_.imageCache_.getSummaryMetadata().getJSONArray("ChNames").put(channel, name);
} catch (JSONException e) {
throw new MMScriptException("Problem setting Channel name");
}
} else {
try {
channelNames_.put(channel, name);
} catch (JSONException ex) {
throw new MMScriptException(ex);
}
}
}
public void setChannelColor(int channel, int rgb) throws MMScriptException {
if (isInitialized()) {
try {
virtAcq_.setChannelColor(channel, rgb, true);
virtAcq_.imageCache_.getSummaryMetadata().getJSONArray("ChColors").put(channel, rgb);
} catch (JSONException ex) {
throw new MMScriptException(ex);
}
} else {
try {
channelColors_.put(channel, rgb);
} catch (JSONException ex) {
throw new MMScriptException(ex);
}
}
}
public void setChannelContrast(int channel, int min, int max) throws MMScriptException {
if (isInitialized())
virtAcq_.setChannelDisplayRange(channel, min, max, true);
throw new MMScriptException (NOTINITIALIZED);
}
public void setContrastBasedOnFrame(int frame, int slice) throws MMScriptException {
if (!isInitialized())
throw new MMScriptException (NOTINITIALIZED);
throw new MMScriptException("Not implemented");
// TODO
/*
try {
DisplaySettings[] settings = acqData_.setChannelContrastBasedOnFrameAndSlice(frame, slice);
if (imgWin_ != null) {
for (int i=0; i<settings.length; i++)
imgWin_.getImage5D().setChannelMinMax(i+1, settings[i].min, settings[i].max);
}
} catch (MMAcqDataException e) {
throw new MMScriptException(e);
}
*/
}
/*
* Set a property in summary metadata
*/
public void setProperty(String propertyName, String value) throws MMScriptException {
if (isInitialized()) {
try {
virtAcq_.imageCache_.getSummaryMetadata().put(propertyName, value);
} catch (JSONException e) {
throw new MMScriptException("Failed to set property: " + propertyName);
}
} else {
try {
summary_.put(propertyName, value);
} catch (JSONException e) {
throw new MMScriptException("Failed to set property: " + propertyName);
}
}
}
/*
* Get a property from the summary metadata
*/
public String getProperty(String propertyName) throws MMScriptException {
if (isInitialized()) {
try {
return virtAcq_.imageCache_.getSummaryMetadata().getString(propertyName);
} catch (JSONException e) {
throw new MMScriptException("Failed to get property: " + propertyName);
}
} else {
try {
return summary_.getString(propertyName);
} catch (JSONException e) {
throw new MMScriptException("Failed to get property: " + propertyName);
}
}
}
public void setProperty(int frame, int channel, int slice, String propName,
String value) throws MMScriptException {
if (isInitialized()) {
try {
JSONObject tags = virtAcq_.imageCache_.getImage(channel, slice, frame, 0).tags;
tags.put(propName, value);
} catch (JSONException e) {
throw new MMScriptException(e);
}
} else
throw new MMScriptException("Can not set property before acquisition is initialized");
}
public void setSystemState(int frame, int channel, int slice, JSONObject state) throws MMScriptException {
if (isInitialized()) {
try {
JSONObject tags = virtAcq_.imageCache_.getImage(channel, slice, frame, 0).tags;
Iterator<String> iState = state.keys();
while (iState.hasNext()) {
String key = iState.next();
tags.put(key, state.get(key));
}
} catch (JSONException e) {
throw new MMScriptException(e);
}
} else
throw new MMScriptException("Can not set system state before acquisition is initialized");
}
public String getProperty(int frame, int channel, int slice, String propName) throws MMScriptException {
if (isInitialized()) {
try {
JSONObject tags = virtAcq_.imageCache_.getImage(channel, slice, frame, 0).tags;
return tags.getString(propName);
} catch (JSONException ex) {
throw new MMScriptException(ex);
}
} else {
}
return "";
}
public boolean hasActiveImage5D() {
return virtAcq_.windowClosed();
}
public void setSummaryProperties(JSONObject md) throws MMScriptException {
if (isInitialized()) {
try {
JSONObject tags = virtAcq_.imageCache_.getSummaryMetadata();
Iterator<String> iState = md.keys();
while (iState.hasNext()) {
String key = iState.next();
tags.put(key, md.get(key));
}
} catch (Exception ex) {
throw new MMScriptException(ex);
}
} else {
try {
Iterator<String> iState = md.keys();
while (iState.hasNext()) {
String key = iState.next();
summary_.put(key, md.get(key));
}
} catch (Exception ex) {
throw new MMScriptException(ex);
}
}
}
public boolean windowClosed() {
if (!initialized_) {
return false;
}
if (virtAcq_ != null && !virtAcq_.windowClosed()) {
return false;
}
return true;
}
public void setSystemState(JSONObject md) throws MMScriptException {
throw new UnsupportedOperationException("Not supported yet.");
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
7a0a39eb5404949a199f7354c81297d64afa8d77 | f2eed87ebef8c574fe732b92b98879783bd1a31b | /src/main/java/org/foresee/dbs/basic/RegularExpresion.java | 59ded2c2c5a2032c13570966d71216c2b5dc7fd6 | [] | no_license | Foresee2016/dbs | 84740d59916dac462a629abf0d72420fe1cbfade | a503f2a4e3375ebe62fb366b8ec05826a31e376e | refs/heads/master | 2020-03-19T07:26:42.034587 | 2018-12-01T10:53:33 | 2018-12-01T10:53:33 | 136,113,926 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package org.foresee.dbs.basic;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegularExpresion {
public static void main(String[] args) {
String text="A horse is a horse, of course of course";
String pattern="horse|course";
Matcher matcher=Pattern.compile(pattern).matcher(text);
while(matcher.find()){
System.out.println("Matched: '"+matcher.group()+"' at position "+matcher.start()+" --- "+matcher.end());
}
}
}
| [
"1123520670@qq.com"
] | 1123520670@qq.com |
47fc07be6c0069ff1ad365bbee1e328cc86f0ac4 | 79de6ffd3f19b1a2cc53146c4c3f53137a5b7aa8 | /app/src/main/java/com/bawei/dome33/mvp/BasePresenter.java | 39aa67fe823a5408766387d2524d2e1a6cbe0890 | [] | no_license | 2623533526/Dome33 | bfc1182f7118b65236d824b03c5341d108ec342d | 8b386e472f1e97847e1510dd9d77e4623c17e53c | refs/heads/master | 2020-12-22T06:57:39.267729 | 2020-01-28T09:58:16 | 2020-01-28T09:58:16 | 236,704,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 576 | java | package com.bawei.dome33.mvp;
import java.lang.ref.WeakReference;
/**
* @author: ๅผ ๅฎถ่พ
* @date: 2020/01/22
*/
public abstract class BasePresenter<M extends IBaseModel,V extends IBaseView>{
public M model;
private WeakReference<V> weakReference;
public BasePresenter() {
model=initModel();
}
public void attach(V v){
weakReference=new WeakReference<V>(v);
}
public void detach(){
weakReference.clear();
}
public V getView(){
return weakReference.get();
}
protected abstract M initModel();
}
| [
"2626533526@qq.com"
] | 2626533526@qq.com |
16fdceda2600a30d7c36374bdb7985eb6fbe6dca | ef786f99126b1a3f00970d77111d62241cd9fefa | /src/test/java/io/github/eroshenkoam/allure/steps/RestSteps.java | a6933d8e1505c90153ef6056f6c47e51015197bb | [] | no_license | eroshenkoam/allure-cucumber6 | 2fa5bf78eab22ba6cefeeac21f95f1914c46c459 | 55de4dfeae74ed712ba9d8c5cfd6eba1e02334f4 | refs/heads/master | 2023-03-21T22:31:23.456740 | 2021-03-08T20:41:11 | 2021-03-08T20:41:11 | 345,770,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,104 | java | package io.github.eroshenkoam.allure.steps;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import static io.qameta.allure.Allure.step;
public class RestSteps {
@When("I create label with title {string} via api")
public void createLabelWithTitle(final String title) {
step("POST /repos/:owner/:repo/labels");
}
@When("I delete label with title {string} via api")
public void deleteLabelWithTitle(final String title) {
step("GET /repos/:owner/:repo/labels?text=" + title);
step("DELETE /repos/:owner/:repo/labels/237");
}
@Then("I should see label with title {string} via api")
public void labelsShouldContainsNoteWithText(final String text) {
step("GET /repos/:owner/:repo/labels?text=" + text);
step("GET /repos/:owner/:repo/labels/834");
}
@Then("I should not see label with content {string} via api")
public void labelsShouldNotContainsNoteWithText(final String text) {
step("GET /repos/:owner/:repo/labels?text=" + text);
step("GET /repos/:owner/:repo/labels/834");
}
}
| [
"eroshenkoam@qameta.io"
] | eroshenkoam@qameta.io |
b81a3daf85947c6b9307f198623e0f19fce2cc7e | 382813a970cfe95a9fee5099abd0ce5a2ed197fb | /src/main/java/jp/co/careritz/inmane/form/UsersCreateForm.java | 6efa17eb45066b5b6b1b5c52f78c7cedfced90cd | [] | no_license | trainer2019/in-mane-proto | e33bf2ee2ac9fb0ec026260a4f64ba650b4f3c74 | 5e5abd7bf606e77e3e73ef23e582fb31c6cbf912 | refs/heads/master | 2020-04-26T01:57:35.329520 | 2019-06-07T10:53:56 | 2019-06-07T10:53:56 | 173,220,483 | 0 | 1 | null | 2019-03-01T09:39:15 | 2019-03-01T02:23:25 | Java | UTF-8 | Java | false | false | 2,842 | java | package jp.co.careritz.inmane.form;
import java.sql.Date;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
public class UsersCreateForm {
/** ใฆใผใถID. */
@NotEmpty(message = "ๅฟ
้ ๅ
ฅๅใฎ้
็ฎใงใใ")
@Pattern(regexp = "[a-zA-Z0-9]*", message = "ๅ่ง่ฑๆฐๅญใงใใๅฟ
่ฆใใใใพใใ")
private String userId;
/** ใในใฏใผใ. */
@Pattern(regexp = "[a-zA-Z0-9]*", message = "ๅ่ง่ฑๆฐๅญใงใใๅฟ
่ฆใใใใพใใ")
private String password;
/** ใฆใผใถๅ. */
@Size(min = 1, max = 20, message = "{min}ๆๅญไปฅไธ{max}ๆๅญไปฅไธใงๅ
ฅๅใใฆใใ ใใใ")
private String userName;
/** ใญใผใซๅ. */
@NotEmpty(message = "ๅฟ
้ ๅ
ฅๅใฎ้
็ฎใงใใ")
@Pattern(regexp = "USER|ADMIN")
private String roleName;
/** ใญใฐใคใณๅคฑๆๅๆฐ. */
private int loginFailureCount;
/** ใญใฐใคใณๆๅฆๆ้. */
private Date loginDeniedAt;
/** ๅ้คๆธใใฉใฐ. */
private int deleted;
/** ๆดๆฐ่
ID. */
private String updaterId;
/** ๆดๆฐๆฅๆ. */
private Date updatedAt;
/** ไฝๆ่
ID. */
private String createrId;
/** ไฝๆๆฅๆ. */
private Date createdAt;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public int getLoginFailureCount() {
return loginFailureCount;
}
public void setLoginFailureCount(int loginFailureCount) {
this.loginFailureCount = loginFailureCount;
}
public Date getLoginDeniedAt() {
return loginDeniedAt;
}
public void setLoginDeniedAt(Date loginDeniedAt) {
this.loginDeniedAt = loginDeniedAt;
}
public int getDeleted() {
return deleted;
}
public void setDeleted(int deleted) {
this.deleted = deleted;
}
public String getUpdaterId() {
return updaterId;
}
public void setUpdaterId(String updaterId) {
this.updaterId = updaterId;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public String getCreaterId() {
return createrId;
}
public void setCreaterId(String createrId) {
this.createrId = createrId;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
}
| [
"yoshifumi.kanatani@careritz.co.jp"
] | yoshifumi.kanatani@careritz.co.jp |
dfe84c46568119c2a419e31b751019cbc958c322 | a194a03ff9debe009918abd90b5f5f64eea2f3db | /app/src/main/java/bcn/alten/altenappmanagement/data/db/ops/followup/EditFollowUpWrapper.java | dac706a40ef369f233766b4dd8fffc6b0de32db6 | [] | no_license | rubenpla-develop/ManagementHelperApp | 67e7f2171f4298b08aa1196efa2feb8f04cbc2db | a2d397dea045ccc2b9ba539b5c01d7a5e7bb4582 | refs/heads/master | 2020-03-23T05:35:05.250212 | 2018-01-30T10:05:38 | 2018-01-30T10:05:38 | 141,153,287 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 513 | java | package bcn.alten.altenappmanagement.data.db.ops.followup;
import bcn.alten.altenappmanagement.model.FollowUp;
public class EditFollowUpWrapper {
private final String TAG = EditFollowUpWrapper.class.getSimpleName();
private FollowUp followUp;
public EditFollowUpWrapper(FollowUp followUp) {
this.followUp = followUp;
}
public void performEditFollowUpOperation() {
EditFollowUpAsyncTask asyncTask = new EditFollowUpAsyncTask(followUp);
asyncTask.execute();
}
}
| [
"ruben.pla@alten.es"
] | ruben.pla@alten.es |
9998e56c1ec5455f3d740c0edf3ef2db0e4e54b9 | 5cc01acac3353ddaf7a15413f90f3619b7fbd60d | /src/main/java/com/softwareatumedida/bean/TipoUsuarioBean.java | 23c054094deef8f125a8ed1e3105dac1acb7c3d4 | [] | no_license | javaprogramer1985/controlescolar2017 | 1cfd18e72ccd7abec7d16747262ef00319cf7e3f | 350f3f298d264f01cc003e96b9fbe107bdd062e3 | refs/heads/master | 2021-07-10T06:55:08.390110 | 2017-10-10T20:41:40 | 2017-10-10T20:41:40 | 103,335,339 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 779 | java | package com.softwareatumedida.bean;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.model.SelectItem;
import lombok.Data;
@ManagedBean
@Data
public class TipoUsuarioBean {
private String tipo;
private Map<String,String> tiposUsuario = new HashMap<>();
@PostConstruct
public void init(){
tiposUsuario = new HashMap<>();
tiposUsuario.put("1", "Profesor");
tiposUsuario.put("2", "Administrador");
}
public TipoUsuarioBean(String tipo) {
this.tipo = tipo;
}
public TipoUsuarioBean() {
}
}
| [
"javaprogramer1985@gmail.com"
] | javaprogramer1985@gmail.com |
c9a64835f126e7b4b490f70606e24a95ed8e6964 | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/jdbi/validation/488/ParsedParameters.java | 83154e50dfa92c493002bc49010b7705b06cdff5 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,742 | java | /*
* 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.jdbi.v3.core.statement;
import static java.util.Collections.unmodifiableList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* The parsed parameters from an SQL statement.
*/
public class ParsedParameters {
private final boolean positional;
private final List<String> parameterNames;
ParsedParameters(boolean positional, List<String> parameterNames) {
this.positional = positional;
this.parameterNames = unmodifiableList(new ArrayList<>(parameterNames));
}
/**
* @return true if the SQL statement uses positional parameters, false if
* the statement uses named parameters, or has no parameters at all.
*/
public boolean isPositional() {
return positional;
}
/**
* @return the number of parameters from the SQL statement.
*/
public int getParameterCount() {
return parameterNames.size();
}
/**
* @return the parameter names from the SQL statement.
*/
public List<String> getParameterNames() {
return parameterNames;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ParsedParameters that = (ParsedParameters) o;
return positional == that.positional
&& Objects.equals(parameterNames, that.parameterNames);
}
@Override
public int hashCode() {
return Objects.hash(positional, parameterNames);
}
@Override
public String toString() {
return "ParsedParameters{"
+ "positional=" + positional
+ ", parameterNames=" + parameterNames
+ '}';
}
/**
* A static factory of named {@link ParsedParameters} instances.
* List given in argument must contain parameter names from the
* related statement. They must be bare names, free of SQL
* variable processing syntax such as a prefixed colon or other
* delimiters.
*
* @param names the parameter names from SQL statement
* @return New {@link ParsedParameters} instance
* @throws IllegalArgumentException if names list contains positional parameter
*/
public static ParsedParameters named(List<String> names) {
if (names.contains(ParsedSql.POSITIONAL_PARAM)) {
throw new IllegalArgumentException("Named parameters "
+ "list must not contain positional parameter "
+ "\"" + ParsedSql.POSITIONAL_PARAM + "\"");
}
return new ParsedParameters(false, names);
}
/**
* A static factory of positional {@link ParsedParameters} instances.
* The count given in the argument must indicate how many positional
* parameters are available in the statement.
*
* @param count the number of positional parameters in statement
* @return New {@link ParsedParameters} instance
*/
public static ParsedParameters positional(int count) {
return new ParsedParameters(true, Collections.nCopies(count, "?"));
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
516ad1706b1c23a93a57ce86884171ea8095224f | 60cc6ba4d8421e769e4e5b9d434a84a1ef11dc24 | /src/main/java/com/guandera/core/server/service/ClienteServiceImpl.java | bb9176e58100842cab29845a43e005ef296013fb | [] | no_license | erika1013/genesys | f2f39552026d2a78848bd54ae56e0c8021c01817 | dc98bb71ded048915e549be49454270865a79a7b | refs/heads/master | 2020-05-25T06:51:51.230721 | 2019-05-20T15:42:19 | 2019-05-20T15:42:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,339 | java | package com.guandera.core.server.service;
import static com.googlecode.objectify.ObjectifyService.*;
import java.io.Serializable;
import java.util.List;
import com.googlecode.objectify.Key;
import com.guandera.core.client.service.ClienteService;
import com.guandera.core.shared.model.Cliente;
import com.guandera.core.shared.model.ClienteCargo;
import com.guandera.core.shared.model.ClienteContacto;
import com.guandera.core.shared.model.TipoIdentificacion;
/**
*
* @author Fredi Javier Velasco Villarreal
*/
public class ClienteServiceImpl implements ClienteService, Serializable {
/**
*
*/
private static final long serialVersionUID = 6997095638234553392L;
@Override
public void actualizar(Cliente cliente) {
ofy().save().entity(cliente).now();
}
@Override
public Cliente consultarPorId(Long id) {
Key<Cliente> k = Key.create(Cliente.class, id);
return ofy().load().key(k).now();
}
@Override
public List<Cliente> consultarTodos() {
return ofy().load().type(Cliente.class).list();
}
@Override
public long contar() {
long cont = ofy().load().type(Cliente.class).count();
return cont;
}
@Override
public void crear(Cliente cliente) {
ofy().save().entity(cliente).now();
}
@Override
public void eliminar(Cliente cliente) {
ofy().delete().entity(cliente).now();
}
@Override
public Long siguienteRegistro() {
long siguiente = ofy().load().type(Cliente.class).count();
return siguiente + 1;
}
@Override
public List<TipoIdentificacion> consultarTiposIdentificacion() {
return ofy().load().type(TipoIdentificacion.class).list();
}
@Override
public void actualizarClienteContacto(ClienteContacto itemClienteContacto) {
ofy().save().entity(itemClienteContacto).now();
}
@Override
public ClienteContacto consultarClienteContactoPorId(Long itemClienteContacto) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<ClienteContacto> consultarClienteContactos(Long clienteid) {
Key<Cliente> k = Key.create(Cliente.class, clienteid);
return ofy().load().type(ClienteContacto.class).filter("cliente", k).list();
}
@Override
public void crearClienteContacto(ClienteContacto itemClienteContacto) {
ofy().save().entity(itemClienteContacto).now();
}
@Override
public void eliminarClienteContacto(ClienteContacto itemClienteContacto) {
ofy().delete().entity(itemClienteContacto).now();
}
@Override
public boolean existeClienteContacto(Integer numeroidentificacion) {
ClienteContacto persona = ofy().load().type(ClienteContacto.class)
.filter("numeroidentificacion", numeroidentificacion).first().now();
if (persona != null) {
return true;
} else {
return false;
}
}
@Override
public List<ClienteCargo> consultarCargos() {
return ofy().load().type(ClienteCargo.class).list();
}
@Override
public List<ClienteCargo> consultarClienteCargos(Long clienteid) {
Key<Cliente> k = Key.create(Cliente.class, clienteid);
return ofy().load().type(ClienteCargo.class).filter("cliente", k).list();
}
@Override
public void crearCargo(ClienteCargo cargo) {
ofy().save().entity(cargo).now();
}
@Override
public void actualizarCargo(ClienteCargo cargo) {
ofy().save().entity(cargo).now();
}
@Override
public void eliminarCargo(ClienteCargo cargo) {
ofy().delete().entity(cargo).now();
}
} | [
"jhayro_tejodi@hotmail.com"
] | jhayro_tejodi@hotmail.com |
aabe3e51607eaa1090535f77e07e7bfac15b97b3 | 9016cc89d51073699cd67f6d57d9acddde9c2726 | /trunk/deliver_ck-store-sdk/src/tw/com/sti/clientsdk/unionpay/SignBy.java | a9465f084479bf275af7b99386b47587ced7224d | [] | no_license | BGCX067/ezui001-svn-to-git | 6457e33d033f99c1d79103302d880eb5b521c1c5 | f0d73556324f2b407f5a069ec967d3204449f518 | refs/heads/master | 2016-09-01T08:52:31.606593 | 2015-12-28T14:21:05 | 2015-12-28T14:21:05 | 48,872,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,431 | java | package tw.com.sti.clientsdk.unionpay;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.security.KeyStore;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.cert.CertificateException;
import javax.crypto.Cipher;
public class SignBy {
/**
* ็ๆ็ญพๅ
*/
public String createSign(String original_string,String alias,String password,InputStream PrivateSign){
try {
byte [] signsMD5 = MD5(original_string);
byte [] signsRSA = rsaEncode(signsMD5,alias,password,PrivateSign);
return new String(Base64.encode(signsRSA));
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
*
* @param md5
* @return
*/
private byte[] MD5(String src) {
MessageDigest messageDigest;
try {
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(src.getBytes("utf-8"));
byte[] digest = messageDigest.digest();
return digest;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
}
/**
* BASE64็ผ็
* @param bstr
* @return
*/
// private String BASE64encode(byte[] bstr){
// String s = new sun.misc.BASE64Encoder().encode(bstr).replaceAll("\r\n", "");
// s = s.replaceAll("\n", "");
// return s;
// }
/**
*
* @param signsRSA
* @param isTest
* @return
* @throws IOException
* @throws CertificateException
* @throws NoSuchAlgorithmException
*/
private byte[] rsaEncode(byte[] signsRSA,String alias,String pwd,InputStream dataSign) {
// ไปฅPKCS2็ฑปๅๆๅผๅฏ้ฅๅบ
try {
KeyStore store = KeyStore.getInstance("PKCS12");
InputStream inStream = dataSign;
store.load(inStream, pwd.toCharArray());
inStream.close();
// ไปๅฏ้ฅๅบไธญๆๅๅฏ้ฅ
PrivateKey pKey = (PrivateKey)store.getKey(alias, pwd.toCharArray());
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, pKey);
return cipher.doFinal(signsRSA);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
| [
"you@example.com"
] | you@example.com |
b584fac7a2f3c0cde1d91417bf77e1c769d6f28c | ac6ef333dd6759e7992623b7480022ebaf2d8c7d | /app/src/main/java/com/icatch/ismartdv2016/Presenter/LocalVideoWallPresenter.java | 66f90a5fb9bb0c98e6379268e7d65a7046812947 | [] | no_license | Alexander12827/iCatch | ccfa7d25ff6fd5ecbfbf13c64767135fe7b90b0a | 2fa1f15d57d954176a442473bdc30375656d0093 | refs/heads/master | 2020-07-29T18:48:26.275171 | 2017-02-13T17:44:12 | 2017-02-13T17:44:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,017 | java | package com.icatch.ismartdv2016.Presenter;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Environment;
import android.util.LruCache;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ImageView;
import com.icatch.ismartdv2016.Adapter.LocalVideoWallGridAdapter;
import com.icatch.ismartdv2016.Adapter.LocalVideoWallListAdapter;
import com.icatch.ismartdv2016.AppInfo.AppInfo;
import com.icatch.ismartdv2016.BaseItems.LimitQueue;
import com.icatch.ismartdv2016.BaseItems.LocalPbItemInfo;
import com.icatch.ismartdv2016.BaseItems.PhotoWallPreviewType;
import com.icatch.ismartdv2016.GlobalApp.GlobalInfo;
import com.icatch.ismartdv2016.Listener.OnAddAsytaskListener;
import com.icatch.ismartdv2016.Log.AppLog;
import com.icatch.ismartdv2016.MyCamera.MyCamera;
import com.icatch.ismartdv2016.Presenter.Interface.BasePresenter;
import com.icatch.ismartdv2016.R;
import com.icatch.ismartdv2016.SystemInfo.SystemInfo;
import com.icatch.ismartdv2016.ThumbnailGetting.ThumbnailOperation;
import com.icatch.ismartdv2016.Tools.FileOpertion.MFileTools;
import com.icatch.ismartdv2016.Tools.LruCacheTool;
import com.icatch.ismartdv2016.View.Interface.LocalVideoWallView;
import com.icatch.wificam.customer.ICatchWificamAssist;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
public class LocalVideoWallPresenter extends BasePresenter {
private static int NUM_COLUMNS = 4;
private static int section = 1;
private String TAG = "LocalVideoWallPresenter";
private Activity activity;
private LimitQueue<Asytask> asytaskList;
List<File> fileList;
private OnScrollListener gridViewOnScrollListener = new OnScrollListener() {
public void onScrollStateChanged(AbsListView view, int scrollState) {
AppLog.i(LocalVideoWallPresenter.this.TAG, "onScrollStateChanged scrollState=" + scrollState);
if (scrollState == 0) {
AppLog.i(LocalVideoWallPresenter.this.TAG, "onScrollStateChanged firstVisibleItem=" + LocalVideoWallPresenter.this.mFirstVisibleItem + " visibleItemCount=" + LocalVideoWallPresenter.this.mVisibleItemCount);
if (LocalVideoWallPresenter.this.asytaskList != null && LocalVideoWallPresenter.this.asytaskList.size() > 0) {
((Asytask) LocalVideoWallPresenter.this.asytaskList.poll()).execute(new String[0]);
}
}
}
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
AppLog.i(LocalVideoWallPresenter.this.TAG, "onScroll firstVisibleItem=" + firstVisibleItem + " visibleItemCount=" + visibleItemCount + " isFirstEnterThisActivity=" + LocalVideoWallPresenter.this.isFirstEnterThisActivity);
LocalVideoWallPresenter.this.mFirstVisibleItem = firstVisibleItem;
LocalVideoWallPresenter.this.mVisibleItemCount = visibleItemCount;
if (LocalVideoWallPresenter.this.isFirstEnterThisActivity && visibleItemCount > 0 && LocalVideoWallPresenter.this.asytaskList != null && LocalVideoWallPresenter.this.asytaskList.size() > 0) {
((Asytask) LocalVideoWallPresenter.this.asytaskList.poll()).execute(new String[0]);
LocalVideoWallPresenter.this.isFirstEnterThisActivity = false;
}
}
};
private int height;
private boolean isFirstEnterThisActivity = true;
private PhotoWallPreviewType layoutType = PhotoWallPreviewType.PREVIEW_TYPE_GRID;
private OnScrollListener listViewOnScrollListener = new OnScrollListener() {
public void onScrollStateChanged(AbsListView view, int scrollState) {
AppLog.i(LocalVideoWallPresenter.this.TAG, "onScrollStateChanged");
if (scrollState == 0) {
AppLog.i(LocalVideoWallPresenter.this.TAG, "onScrollStateChanged firstVisibleItem=" + LocalVideoWallPresenter.this.mFirstVisibleItem + " visibleItemCount=" + LocalVideoWallPresenter.this.mVisibleItemCount);
LocalVideoWallPresenter.this.asytaskList.clear();
LocalVideoWallPresenter.this.loadBitmaps(LocalVideoWallPresenter.this.mFirstVisibleItem, LocalVideoWallPresenter.this.mVisibleItemCount);
return;
}
LocalVideoWallPresenter.this.asytaskList.clear();
}
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
AppLog.i(LocalVideoWallPresenter.this.TAG, "onScroll firstVisibleItem=" + firstVisibleItem);
if (firstVisibleItem != LocalVideoWallPresenter.this.topVisiblePosition) {
LocalVideoWallPresenter.this.topVisiblePosition = firstVisibleItem;
String fileDate = ((LocalPbItemInfo) LocalVideoWallPresenter.this.mGirdList.get(firstVisibleItem)).getFileDate();
AppLog.i(LocalVideoWallPresenter.this.TAG, "fileDate=" + fileDate);
LocalVideoWallPresenter.this.localVideoWallView.setListViewHeaderText(fileDate);
}
LocalVideoWallPresenter.this.mFirstVisibleItem = firstVisibleItem;
LocalVideoWallPresenter.this.mVisibleItemCount = visibleItemCount;
if (LocalVideoWallPresenter.this.isFirstEnterThisActivity && visibleItemCount > 0) {
LocalVideoWallPresenter.this.loadBitmaps(firstVisibleItem, visibleItemCount);
LocalVideoWallPresenter.this.isFirstEnterThisActivity = false;
}
}
};
private LocalVideoWallGridAdapter localVideoWallGridAdapter;
private LocalVideoWallListAdapter localVideoWallListAdapter;
private LocalVideoWallView localVideoWallView;
private int mFirstVisibleItem;
private List<LocalPbItemInfo> mGirdList;
private LruCache<String, Bitmap> mLruCache = LruCacheTool.getInstance().getLruCache();
private int mVisibleItemCount;
private MyCamera myCamera;
private Map<String, Integer> sectionMap = new HashMap();
private int topVisiblePosition = -1;
private int width;
class Asytask extends AsyncTask<String, Integer, Bitmap> {
String filePath;
public Asytask(String path) {
this.filePath = path;
}
protected Bitmap doInBackground(String... params) {
Bitmap bm = LruCacheTool.getInstance().getBitmapFromLruCache(this.filePath);
AppLog.d(LocalVideoWallPresenter.this.TAG, "Asytask doInBackground filePath=" + this.filePath + " bm=" + bm);
if (bm != null) {
return bm;
}
bm = ThumbnailOperation.getlocalVideoWallThumbnail(this.filePath);
LruCacheTool.getInstance().addBitmapToLruCache(this.filePath, bm);
return bm;
}
protected void onPostExecute(Bitmap result) {
if (result == null) {
AppLog.d(LocalVideoWallPresenter.this.TAG, "Asytask onPostExecute result is null");
return;
}
ImageView imageView;
AppLog.d(LocalVideoWallPresenter.this.TAG, "Asytask onPostExecute result size=" + result.getByteCount());
if (LocalVideoWallPresenter.this.layoutType == PhotoWallPreviewType.PREVIEW_TYPE_GRID) {
imageView = (ImageView) LocalVideoWallPresenter.this.localVideoWallView.gridViewFindViewWithTag(this.filePath);
} else {
imageView = (ImageView) LocalVideoWallPresenter.this.localVideoWallView.listViewFindViewWithTag(this.filePath);
}
AppLog.i(LocalVideoWallPresenter.this.TAG, "loadBitmaps filePath=" + this.filePath + "result.isRecycled=" + result.isRecycled() + " imageView=" + imageView);
if (!(imageView == null || result.isRecycled())) {
imageView.setImageBitmap(result);
}
if (LocalVideoWallPresenter.this.asytaskList != null && LocalVideoWallPresenter.this.asytaskList.size() > 0) {
((Asytask) LocalVideoWallPresenter.this.asytaskList.poll()).execute(new String[0]);
}
}
}
public LocalVideoWallPresenter(Activity activity) {
super(activity);
this.activity = activity;
this.asytaskList = new LimitQueue(SystemInfo.getWindowVisibleCountMax(NUM_COLUMNS));
initCamera();
}
public void setView(LocalVideoWallView localVideoWallView) {
this.localVideoWallView = localVideoWallView;
initCfg();
}
public boolean initCamera() {
this.myCamera = new MyCamera();
if (this.myCamera.getSDKsession().prepareSession("192.168.1.1", false)) {
GlobalInfo.getInstance().setCurrentCamera(this.myCamera);
AppLog.i(this.TAG, "Set CurrentCamera");
this.myCamera.initCameraForLocalPB();
return true;
}
AppLog.e(this.TAG, "prepareSession failed!");
return false;
}
public void destroyCamera() {
this.myCamera.destroyCamera();
}
private List<LocalPbItemInfo> getVideoList() {
List<LocalPbItemInfo> tempList = new ArrayList();
this.width = SystemInfo.getMetrics().widthPixels;
this.fileList = MFileTools.getVideosOrderByDate(Environment.getExternalStorageDirectory().toString() + AppInfo.DOWNLOAD_PATH);
for (int ii = 0; ii < this.fileList.size(); ii++) {
long time = ((File) this.fileList.get(ii)).lastModified();
AppLog.i(this.TAG, "file.lastModified()" + time);
String fileDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date(time));
if (this.sectionMap.containsKey(fileDate)) {
tempList.add(new LocalPbItemInfo((File) this.fileList.get(ii), ((Integer) this.sectionMap.get(fileDate)).intValue()));
} else {
this.sectionMap.put(fileDate, Integer.valueOf(section));
tempList.add(new LocalPbItemInfo((File) this.fileList.get(ii), ((Integer) this.sectionMap.get(fileDate)).intValue()));
section++;
}
}
return tempList;
}
public void loadLocalVideoWall() {
if (this.mGirdList == null || this.mGirdList.size() < 0) {
this.mGirdList = getVideoList();
}
GlobalInfo.getInstance().localVideoList = this.mGirdList;
if (this.layoutType == PhotoWallPreviewType.PREVIEW_TYPE_LIST) {
this.localVideoWallView.setGridViewVisibility(8);
this.localVideoWallView.setListViewVisibility(0);
this.localVideoWallListAdapter = new LocalVideoWallListAdapter(this.activity, this.mGirdList, this.mLruCache);
this.localVideoWallView.setListViewAdapter(this.localVideoWallListAdapter);
this.localVideoWallView.setListViewOnScrollListener(this.listViewOnScrollListener);
return;
}
this.width = SystemInfo.getMetrics().widthPixels;
this.localVideoWallView.setGridViewVisibility(0);
this.localVideoWallView.setListViewVisibility(8);
AppLog.i(this.TAG, "width=" + 0);
this.localVideoWallGridAdapter = new LocalVideoWallGridAdapter(this.activity, this.mGirdList, this.width, this.mLruCache, new OnAddAsytaskListener() {
public void addAsytask(int position) {
AppLog.d(LocalVideoWallPresenter.this.TAG, "addAsytask position" + position);
LocalVideoWallPresenter.this.asytaskList.offer(new Asytask(((LocalPbItemInfo) LocalVideoWallPresenter.this.mGirdList.get(position)).getFilePath()));
}
});
this.localVideoWallView.setGridViewAdapter(this.localVideoWallGridAdapter);
this.localVideoWallView.setGridViewOnScrollListener(this.gridViewOnScrollListener);
}
public void changePreviewType() {
if (this.layoutType == PhotoWallPreviewType.PREVIEW_TYPE_LIST) {
this.layoutType = PhotoWallPreviewType.PREVIEW_TYPE_GRID;
this.localVideoWallView.setMenuPreviewTypeIcon(R.drawable.ic_view_grid_white_24dp);
} else {
this.layoutType = PhotoWallPreviewType.PREVIEW_TYPE_LIST;
this.localVideoWallView.setMenuPreviewTypeIcon(R.drawable.ic_view_list_white_24dp);
}
loadLocalVideoWall();
}
public void redirectToAnotherActivity(Context context, Class<?> cls, int position) {
AppLog.i(this.TAG, "redirectToAnotherActivity position=" + position);
clealAsytaskList();
final String videoPath = ((LocalPbItemInfo) this.mGirdList.get(position)).getFilePath();
final Uri uri = Uri.fromFile(new File(videoPath));
this.isFirstEnterThisActivity = true;
final int i = position;
final Class<?> cls2 = cls;
final Context context2 = context;
new Timer().schedule(new TimerTask() {
public void run() {
if (ICatchWificamAssist.getInstance().supportLocalPlay(videoPath)) {
AppLog.d(LocalVideoWallPresenter.this.TAG, "supportLocalPlay videoPath=" + videoPath);
Intent intent = new Intent();
intent.putExtra("curfilePath", videoPath);
intent.putExtra("curfilePosition", i);
AppLog.i(LocalVideoWallPresenter.this.TAG, "intent:start redirectToAnotherActivity class =" + cls2.getName());
intent.setClass(context2, cls2);
context2.startActivity(intent);
return;
}
AppLog.d(LocalVideoWallPresenter.this.TAG, "not supportLocalPlay");
intent = new Intent("android.intent.action.VIEW");
intent.setDataAndType(uri, "video/mp4");
context2.startActivity(intent);
}
}, 300);
}
void loadBitmaps(int firstVisibleItem, int visibleItemCount) {
for (int ii = firstVisibleItem; ii < firstVisibleItem + visibleItemCount; ii++) {
if (ii < this.mGirdList.size()) {
this.asytaskList.offer(new Asytask(((LocalPbItemInfo) this.mGirdList.get(ii)).getFilePath()));
AppLog.i(this.TAG, "add task loadBitmaps ii=" + ii);
}
}
if (this.asytaskList != null && this.asytaskList.size() > 0) {
((Asytask) this.asytaskList.poll()).execute(new String[0]);
}
}
public void clearResource() {
this.asytaskList.clear();
}
public void clealAsytaskList() {
AppLog.d(this.TAG, "clealAsytaskList");
if (this.asytaskList != null && this.asytaskList.size() > 0) {
AppLog.d(this.TAG, "clealAsytaskList size=" + this.asytaskList.size());
this.asytaskList.clear();
}
}
}
| [
"aizazahmad56@gmail.com"
] | aizazahmad56@gmail.com |
0c36bd253ed7c39a7d04e95e60de0c2ef1edb327 | 9ec69ec03acf33068474ea482d3965e6cef2a786 | /src/main/java/com/example/blogreact/web/rest/util/PaginationUtil.java | bfcf6585dfe6cb9f64313ed52287464d134b55e4 | [] | no_license | marcopgordillo/blogreact | cba58b16bc3b3146f9ae699c11591de23e31bf04 | 35987eb8ccd0189349b5e4485a255691bd2c6e9d | refs/heads/master | 2020-03-22T22:08:38.245291 | 2018-11-26T17:27:34 | 2018-11-26T17:27:34 | 140,735,692 | 0 | 0 | null | 2018-07-12T17:41:39 | 2018-07-12T16:00:40 | Java | UTF-8 | Java | false | false | 1,751 | java | package com.example.blogreact.web.rest.util;
import org.springframework.data.domain.Page;
import org.springframework.http.HttpHeaders;
import org.springframework.web.util.UriComponentsBuilder;
/**
* Utility class for handling pagination.
*
* <p>
* Pagination uses the same principles as the <a href="https://developer.github.com/v3/#pagination">GitHub API</a>,
* and follow <a href="http://tools.ietf.org/html/rfc5988">RFC 5988 (Link header)</a>.
*/
public final class PaginationUtil {
private PaginationUtil() {
}
public static <T> HttpHeaders generatePaginationHttpHeaders(Page<T> page, String baseUrl) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-Total-Count", Long.toString(page.getTotalElements()));
String link = "";
if ((page.getNumber() + 1) < page.getTotalPages()) {
link = "<" + generateUri(baseUrl, page.getNumber() + 1, page.getSize()) + ">; rel=\"next\",";
}
// prev link
if ((page.getNumber()) > 0) {
link += "<" + generateUri(baseUrl, page.getNumber() - 1, page.getSize()) + ">; rel=\"prev\",";
}
// last and first link
int lastPage = 0;
if (page.getTotalPages() > 0) {
lastPage = page.getTotalPages() - 1;
}
link += "<" + generateUri(baseUrl, lastPage, page.getSize()) + ">; rel=\"last\",";
link += "<" + generateUri(baseUrl, 0, page.getSize()) + ">; rel=\"first\"";
headers.add(HttpHeaders.LINK, link);
return headers;
}
private static String generateUri(String baseUrl, int page, int size) {
return UriComponentsBuilder.fromUriString(baseUrl).queryParam("page", page).queryParam("size", size).toUriString();
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
363be0559d10c16f3edee8fe802ba878b904d364 | 850b9502de98dd8270e09451b7f6767c76e67d92 | /TestNGLearning/src/test/java/testcases/TestCase3.java | 9238e43b1ea3a6545488f2a67364df67194a45df | [] | no_license | iamchandra1511/seleniumExamples | 0315f2521891c361e733ba9fc7ae8a46109ea627 | 777234d15966b677b09d5274d6b71ddbf3a95775 | refs/heads/master | 2022-12-25T10:52:35.348964 | 2020-09-15T23:34:10 | 2020-09-15T23:34:10 | 294,162,904 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package testcases;
import org.testng.Assert;
import org.testng.annotations.Test;
public class TestCase3 extends BaseTest{
@Test(priority=1,groups= {"functional","smoke"})
public void doUserReg() {
System.out.println("Executing User Reg test");
Assert.fail("User not registered successfully");
}
@Test(priority=2,dependsOnMethods= "doUserReg",groups= {"functional","smoke"})
public void doLogin() {
System.out.println("Executing login test");
}
@Test(priority=3,dependsOnMethods= "doUserReg",alwaysRun=true,groups= {"functional","smoke"})
public void thirdTest() {
System.out.println("Executing Third Test");
}
@Test(priority=4,groups="bvt")
public void fourthTest() {
System.out.println("Executing Fourth Test");
}
}
| [
"chandra1511amensys@gmail.com"
] | chandra1511amensys@gmail.com |
3fcaa996f6ede96ae15fa08c654399667da6917c | 752be787c3f150dd42f7f32684863fab47c9e961 | /src/main/java/com/sstu/practic/spring/services/MyExperimentService.java | 653b048aeb88b055c5b6ddbef637e4905bd43695 | [] | no_license | VladislavLee/SSTUPractik | 8b23f1a36d877dda83af1de800a00621f4e5b346 | 982aca0edcf491b53959a9b825eec6b547fd4f8a | refs/heads/master | 2022-12-24T04:47:54.436866 | 2019-11-05T14:06:42 | 2019-11-05T14:06:42 | 199,058,152 | 0 | 0 | null | 2022-12-10T05:42:30 | 2019-07-26T17:47:04 | Java | UTF-8 | Java | false | false | 1,083 | java | package com.sstu.practic.spring.services;
import com.sstu.practic.spring.data.model.TbExperiment;
import com.sstu.practic.spring.data.model.TbGroup;
import com.sstu.practic.spring.data.model.TbUser;
import com.sstu.practic.spring.data.repositories.ExperimentRepository;
import com.sstu.practic.spring.data.repositories.GroupRepository;
import com.sstu.practic.spring.services.security.SecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class MyExperimentService {
@Autowired
private ExperimentRepository experimentRepository;
@Autowired
private SecurityContext securityContext;
@Autowired
private GroupRepository groupRepository;
public List<TbExperiment> getMyExperiment() {
List<TbGroup> groupList = groupRepository.findAllByUserListContains(securityContext.getUser());
return experimentRepository.findAllByGroupListContainsList(groupList);
}
}
| [
"leevlad42@gmail.com"
] | leevlad42@gmail.com |
1d07cf08a0f8a2686f5b12ecdff91e2b139807d5 | 4edce2a17e0c0800cdfeaa4b111e0c2fbea4563b | /net/minecraft/src/SelectionListInvited.java | cce3dbf26d94125dba3d5c2475b59ea3154995d8 | [] | no_license | zaices/minecraft | da9b99abd99ac56e787eef1b6fecbd06b2d4cd51 | 4a99d8295e7ce939663e90ba8f1899c491545cde | refs/heads/master | 2021-01-10T20:20:38.388578 | 2013-10-06T00:16:11 | 2013-10-06T00:18:48 | 13,142,359 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,053 | java | package net.minecraft.src;
class SelectionListInvited extends SelectionListBase
{
final GuiScreenConfigureWorld field_98264_a;
public SelectionListInvited(GuiScreenConfigureWorld par1GuiScreenConfigureWorld)
{
super(GuiScreenConfigureWorld.func_96265_a(par1GuiScreenConfigureWorld), GuiScreenConfigureWorld.func_96271_b(par1GuiScreenConfigureWorld), GuiScreenConfigureWorld.func_96274_a(par1GuiScreenConfigureWorld, 2), GuiScreenConfigureWorld.func_96269_c(par1GuiScreenConfigureWorld), GuiScreenConfigureWorld.func_96274_a(par1GuiScreenConfigureWorld, 9) - GuiScreenConfigureWorld.func_96274_a(par1GuiScreenConfigureWorld, 2), 12);
this.field_98264_a = par1GuiScreenConfigureWorld;
}
protected int func_96608_a()
{
return GuiScreenConfigureWorld.func_96266_d(this.field_98264_a).field_96402_f.size() + 1;
}
protected void func_96615_a(int par1, boolean par2)
{
if (par1 < GuiScreenConfigureWorld.func_96266_d(this.field_98264_a).field_96402_f.size())
{
GuiScreenConfigureWorld.func_96270_b(this.field_98264_a, par1);
}
}
protected boolean func_96609_a(int par1)
{
return par1 == GuiScreenConfigureWorld.func_96263_e(this.field_98264_a);
}
protected int func_96613_b()
{
return this.func_96608_a() * 12;
}
protected void func_96611_c() {}
protected void func_96610_a(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
{
if (par1 < GuiScreenConfigureWorld.func_96266_d(this.field_98264_a).field_96402_f.size())
{
this.func_98263_b(par1, par2, par3, par4, par5Tessellator);
}
}
private void func_98263_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
{
String var6 = (String)GuiScreenConfigureWorld.func_96266_d(this.field_98264_a).field_96402_f.get(par1);
this.field_98264_a.drawString(GuiScreenConfigureWorld.func_96273_f(this.field_98264_a), var6, par2 + 2, par3 + 1, 16777215);
}
}
| [
"chlumanog@gmail.com"
] | chlumanog@gmail.com |
049add00a658204fb4e615149acb93fbf0073f31 | e78524f7bde2dc64056a7173982fc49146cb06ee | /workspace/app_v2/src/com/icanit/app_v2/adapter/MerchandizeAdPagerAdapter.java | 510c51d0c60d87caf3a349b6b66a8e7cd5eb984a | [] | no_license | ben-kenobi/android_lagacy | 90b417538a94c1643ef8b70998c478ec508eb217 | ecaf31f82a8245f9c0a3702870cfa84ac747b6e1 | refs/heads/master | 2020-12-24T08:08:36.967953 | 2017-06-06T16:12:21 | 2017-06-06T16:12:21 | 73,343,156 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,740 | java | package com.icanit.app_v2.adapter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.icanit.app_v2.R;
import com.icanit.app_v2.entity.AppGoods;
import com.icanit.app_v2.exception.AppException;
import com.icanit.app_v2.util.ImageUtil;
public class MerchandizeAdPagerAdapter extends MyBasePagerAdapter{
private LayoutInflater inflater;
private Context context;
private List<AppGoods> goodsList;
private int resId=R.layout.item4vp_advertisement;
private Map<Integer,View> viewMap=new HashMap<Integer,View>();
private LinkedList<View> convertViews=new LinkedList<View>();
public MerchandizeAdPagerAdapter(Context context) throws AppException{
super();
this.context=context;inflater=LayoutInflater.from(context);
}
public int getCount() {
Log.d("pagerAdapter","getCount");
if(goodsList==null)
return 0; return goodsList.size();
}
public boolean isViewFromObject(View arg0, Object arg1) {
Log.d("pagerAdapter","arg0="+arg0+",arg1="+arg1+" isViewFromObject");
return arg0==arg1;
}
@Override
public void finishUpdate(ViewGroup container) {
Log.d("pagerAdapter","container="+container+" finishUpdate");
super.finishUpdate(container);
}
@Override
public int getItemPosition(Object object) {
Log.d("pagerAdapter","object="+object+" getItemPosition");
// return super.getItemPosition(object);
return POSITION_NONE;
}
@Override
public void setPrimaryItem(ViewGroup container, int position, Object object) {
Log.d("pagerAdapter","container="+container+",position="+position+",object="+object+" setPrimaryItem");
super.setPrimaryItem(container, position, object);
}
@Override
public void startUpdate(ViewGroup container) {
Log.d("pagerAdapter","container="+container+" startUpdate");
super.startUpdate(container);
}
@Override
public CharSequence getPageTitle(int position) {
return null;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
viewMap.remove(position);
container.removeView((View)object);
convertViews.add((View)object);
// System.out.println(position+",object="+object+",convertViews="+convertViews+" destoryItem @MerchantAdPagerAdapter");
}
@Override
public Object instantiateItem(ViewGroup container,final int position) {
final ViewHolder holder;final AppGoods goods= goodsList.get(position);
View convertView=null;
if(convertView==null&&!convertViews.isEmpty()) convertView=convertViews.removeFirst();
if(convertView==null){
holder=new ViewHolder();
convertView=inflater.inflate(resId, container,false);
holder.imageView=(ImageView)convertView.findViewById(R.id.imageView1);
convertView.setTag(holder);
Log.d("errorTag",position+" @MerchandizeAdPagerAdapter convertView==null");
}else holder=(ViewHolder)convertView.getTag();
Log.d("errorTag",position+" @MerchantdizeAdPagerAdapter convertView!=null");
ImageUtil.asyncDownloadImageAndShow(holder.imageView, "",context,busy);
viewMap.put(position,convertView);
holder.imageView.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
try {
context.getClass().getMethod("showMerchandizeDetail", AppGoods.class)
.invoke(context, goods);
} catch (Exception e) {
e.printStackTrace();
}
}
});
container.addView(convertView);
// System.out.println(position+",convertViews="+convertViews+",convertView="+convertView+" instantiateItem @MerchantAdPagerAdapter");
return convertView;
}
public void updateView(ViewPager pager,int position){
if(position!=-1&&!viewMap.containsKey(position))return ;
System.out.println(position+",viewMap="+viewMap+",contains="+viewMap.containsKey(position)+" @MerchandizeAdpagerAdapter");
Iterator<Entry<Integer,View>> it=viewMap.entrySet().iterator();
while(it.hasNext()){
Entry<Integer,View> en = it.next();
AppGoods goods =goodsList.get(en.getKey());
ViewHolder holder = (ViewHolder)en.getValue().getTag();
}
}
public List<AppGoods> getGoodsList() {
return goodsList;
}
public void setGoodsList(List<AppGoods> goodsList) {
this.goodsList = goodsList;
notifyDataSetChanged();
}
public void refreshViewPager(){
}
static class ViewHolder{
ImageView imageView;
}
}
| [
"whatelsecani@gmail.com"
] | whatelsecani@gmail.com |
1881af47d13e9b64bcd8881984fb1342b3ac96b3 | 8d90dab8d7d0434e80c4d7149a9fc86056d28060 | /src/test/java/com/dmarut/schoolregister/SchoolRegisterApplicationTests.java | f2047d25ec91a4a9b7f5be896fdc2ae15109674e | [] | no_license | DenisMarut/school-register | 0a27b9a15b01bb9ec2433c38aca098c07e9308d9 | d84bba7ea77d179ab06dacf3dd10c076ceb513b1 | refs/heads/master | 2023-01-30T16:02:45.231582 | 2020-12-13T13:39:30 | 2020-12-13T13:39:30 | 321,072,603 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.dmarut.schoolregister;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SchoolRegisterApplicationTests {
@Test
void contextLoads() {
}
}
| [
"55002785+DenisMarut@users.noreply.github.com"
] | 55002785+DenisMarut@users.noreply.github.com |
bb727d6ff7ae8e896b76e15fe1a2b1275ea90873 | b4bfc348217b34630ed6254ef892aa2220d381a3 | /curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java | 7d51cd8ccc9c9491eb4739101664e33c6462f274 | [
"Apache-2.0"
] | permissive | doctorwho1986/curator | 455721f8f5a116f5f87eaf02d530ccee3d243540 | ac2b903d96b74b277a6ba9b11148e642f1fca29d | refs/heads/master | 2021-01-12T20:57:00.786514 | 2014-10-16T20:54:26 | 2014-10-16T20:54:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 26,798 | 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.curator.framework.recipes.cache;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.api.BackgroundCallback;
import org.apache.curator.framework.api.CuratorEvent;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.listen.Listenable;
import org.apache.curator.framework.listen.ListenerContainer;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.utils.CloseableExecutorService;
import org.apache.curator.utils.ThreadUtils;
import org.apache.curator.utils.ZKPaths;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Closeable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.apache.curator.utils.PathUtils.validatePath;
/**
* <p>A utility that attempts to keep all data from all children of a ZK path locally cached. This class
* will watch the ZK path, respond to update/create/delete events, pull down the data, etc. You can
* register a listener that will get notified when changes occur.</p>
* <p></p>
* <p><b>IMPORTANT</b> - it's not possible to stay transactionally in sync. Users of this class must
* be prepared for false-positives and false-negatives. Additionally, always use the version number
* when updating data to avoid overwriting another process' change.</p>
*/
public class TreeCache implements Closeable
{
private static final Logger LOG = LoggerFactory.getLogger(TreeCache.class);
public static final class Builder
{
private final CuratorFramework client;
private final String path;
private boolean cacheData = true;
private boolean dataIsCompressed = false;
private CloseableExecutorService executorService = null;
private Builder(CuratorFramework client, String path)
{
this.client = checkNotNull(client);
this.path = validatePath(path);
}
/**
* Builds the {@link TreeCache} based on configured values.
*/
public TreeCache build()
{
CloseableExecutorService executor = executorService;
if ( executor == null )
{
executor = new CloseableExecutorService(Executors.newSingleThreadExecutor(defaultThreadFactory));
}
return new TreeCache(client, path, cacheData, dataIsCompressed, executor);
}
/**
* Sets whether or not to cache byte data per node; default {@code true}.
*/
public Builder setCacheData(boolean cacheData)
{
this.cacheData = cacheData;
return this;
}
/**
* Sets whether or to decompress node data; default {@code false}.
*/
public Builder setDataIsCompressed(boolean dataIsCompressed)
{
this.dataIsCompressed = dataIsCompressed;
return this;
}
/**
* Sets the executor to publish events; a default executor will be created if not specified.
*/
public Builder setExecutor(ThreadFactory threadFactory)
{
return setExecutor(new CloseableExecutorService(Executors.newSingleThreadExecutor(threadFactory)));
}
/**
* Sets the executor to publish events; a default executor will be created if not specified.
*/
public Builder setExecutor(ExecutorService executorService)
{
if ( executorService instanceof CloseableExecutorService )
{
return setExecutor((CloseableExecutorService)executorService);
}
else
{
return setExecutor(new CloseableExecutorService(executorService));
}
}
/**
* Sets the executor to publish events; a default executor will be created if not specified.
*/
public Builder setExecutor(CloseableExecutorService executorService)
{
this.executorService = checkNotNull(executorService);
return this;
}
}
/**
* Create a TreeCache builder for the given client and path to configure advanced options.
* <p/>
* If the client is namespaced, all operations on the resulting TreeCache will be in terms of
* the namespace, including all published events. The given path is the root at which the
* TreeCache will watch and explore. If no node exists at the given path, the TreeCache will
* be initially empty.
*
* @param client the client to use; may be namespaced
* @param path the path to the root node to watch/explore; this path need not actually exist on
* the server
* @return a new builder
*/
public static Builder newBuilder(CuratorFramework client, String path)
{
return new Builder(client, path);
}
private enum NodeState
{
PENDING, LIVE, DEAD
}
private final class TreeNode implements Watcher, BackgroundCallback
{
final AtomicReference<NodeState> nodeState = new AtomicReference<NodeState>(NodeState.PENDING);
final TreeNode parent;
final String path;
final AtomicReference<Stat> stat = new AtomicReference<Stat>();
final AtomicReference<byte[]> data = new AtomicReference<byte[]>();
final AtomicReference<ConcurrentMap<String, TreeNode>> children = new AtomicReference<ConcurrentMap<String, TreeNode>>();
TreeNode(String path, TreeNode parent)
{
this.path = path;
this.parent = parent;
}
private void refresh() throws Exception
{
outstandingOps.addAndGet(2);
doRefreshData();
doRefreshChildren();
}
private void refreshChildren() throws Exception
{
outstandingOps.incrementAndGet();
doRefreshChildren();
}
private void refreshData() throws Exception
{
outstandingOps.incrementAndGet();
doRefreshData();
}
private void doRefreshChildren() throws Exception
{
client.getChildren().usingWatcher(this).inBackground(this).forPath(path);
}
private void doRefreshData() throws Exception
{
if ( dataIsCompressed )
{
client.getData().decompressed().usingWatcher(this).inBackground(this).forPath(path);
}
else
{
client.getData().usingWatcher(this).inBackground(this).forPath(path);
}
}
void wasReconnected() throws Exception
{
refresh();
ConcurrentMap<String, TreeNode> childMap = children.get();
if ( childMap != null )
{
for ( TreeNode child : childMap.values() )
{
child.wasReconnected();
}
}
}
void wasCreated() throws Exception
{
refresh();
}
void wasDeleted() throws Exception
{
stat.set(null);
data.set(null);
client.clearWatcherReferences(this);
ConcurrentMap<String, TreeNode> childMap = children.getAndSet(null);
if ( childMap != null )
{
ArrayList<TreeNode> childCopy = new ArrayList<TreeNode>(childMap.values());
childMap.clear();
for ( TreeNode child : childCopy )
{
child.wasDeleted();
}
}
if ( treeState.get() == TreeState.CLOSED )
{
return;
}
if ( nodeState.compareAndSet(NodeState.LIVE, NodeState.DEAD) )
{
publishEvent(TreeCacheEvent.Type.NODE_REMOVED, path);
}
if ( parent == null )
{
// Root node; use an exist query to watch for existence.
client.checkExists().usingWatcher(this).inBackground().forPath(path);
}
else
{
// Remove from parent if we're currently a child
ConcurrentMap<String, TreeNode> parentChildMap = parent.children.get();
if ( parentChildMap != null )
{
parentChildMap.remove(ZKPaths.getNodeFromPath(path), this);
}
}
}
@Override
public void process(WatchedEvent event)
{
try
{
switch ( event.getType() )
{
case NodeCreated:
Preconditions.checkState(parent == null, "unexpected NodeCreated on non-root node");
wasCreated();
break;
case NodeChildrenChanged:
refreshChildren();
break;
case NodeDataChanged:
refreshData();
break;
case NodeDeleted:
wasDeleted();
break;
}
}
catch ( Exception e )
{
handleException(e);
}
}
@Override
public void processResult(CuratorFramework client, CuratorEvent event) throws Exception
{
Stat newStat = event.getStat();
switch ( event.getType() )
{
case EXISTS:
Preconditions.checkState(parent == null, "unexpected EXISTS on non-root node");
if ( event.getResultCode() == KeeperException.Code.OK.intValue() )
{
nodeState.compareAndSet(NodeState.DEAD, NodeState.PENDING);
wasCreated();
}
else if ( event.getResultCode() == KeeperException.Code.NONODE.intValue() )
{
wasDeleted();
}
break;
case CHILDREN:
if ( event.getResultCode() == KeeperException.Code.OK.intValue() )
{
Stat oldStat = stat.get();
if ( oldStat != null && oldStat.getMzxid() == newStat.getMzxid() )
{
// Only update stat if mzxid is different, otherwise we might obscure
// GET_DATA event updates.
stat.set(newStat);
}
if ( event.getChildren().isEmpty() )
{
break;
}
ConcurrentMap<String, TreeNode> childMap = children.get();
if ( childMap == null )
{
childMap = Maps.newConcurrentMap();
if ( !children.compareAndSet(null, childMap) )
{
childMap = children.get();
}
}
// Present new children in sorted order for test determinism.
List<String> newChildren = new ArrayList<String>();
for ( String child : event.getChildren() )
{
if ( !childMap.containsKey(child) )
{
newChildren.add(child);
}
}
Collections.sort(newChildren);
for ( String child : newChildren )
{
String fullPath = ZKPaths.makePath(path, child);
TreeNode node = new TreeNode(fullPath, this);
if ( childMap.putIfAbsent(child, node) == null )
{
node.wasCreated();
}
}
}
else if ( event.getResultCode() == KeeperException.Code.NONODE.intValue() )
{
wasDeleted();
}
break;
case GET_DATA:
if ( event.getResultCode() == KeeperException.Code.OK.intValue() )
{
if ( cacheData )
{
data.set(event.getData());
}
Stat oldStat = stat.getAndSet(newStat);
if ( nodeState.compareAndSet(NodeState.PENDING, NodeState.LIVE) )
{
publishEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData(event.getPath(), newStat, event.getData()));
}
else
{
if ( oldStat == null || oldStat.getMzxid() != newStat.getMzxid() )
{
publishEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData(event.getPath(), newStat, event.getData()));
}
}
}
else if ( event.getResultCode() == KeeperException.Code.NONODE.intValue() )
{
wasDeleted();
}
break;
default:
// An unknown event, probably an error of some sort like connection loss.
LOG.info(String.format("Unknown event %s", event));
// Don't produce an initialized event on error; reconnect can fix this.
outstandingOps.decrementAndGet();
return;
}
if ( outstandingOps.decrementAndGet() == 0 )
{
if ( isInitialized.compareAndSet(false, true) )
{
publishEvent(TreeCacheEvent.Type.INITIALIZED);
}
}
}
}
private enum TreeState
{
LATENT,
STARTED,
CLOSED
}
/**
* Tracks the number of outstanding background requests in flight. The first time this count reaches 0, we publish the initialized event.
*/
private final AtomicLong outstandingOps = new AtomicLong(0);
/**
* Have we published the {@link TreeCacheEvent.Type#INITIALIZED} event yet?
*/
private final AtomicBoolean isInitialized = new AtomicBoolean(false);
private final TreeNode root;
private final CuratorFramework client;
private final CloseableExecutorService executorService;
private final boolean cacheData;
private final boolean dataIsCompressed;
private final ListenerContainer<TreeCacheListener> listeners = new ListenerContainer<TreeCacheListener>();
private final ListenerContainer<UnhandledErrorListener> errorListeners = new ListenerContainer<UnhandledErrorListener>();
private final AtomicReference<TreeState> treeState = new AtomicReference<TreeState>(TreeState.LATENT);
private final ConnectionStateListener connectionStateListener = new ConnectionStateListener()
{
@Override
public void stateChanged(CuratorFramework client, ConnectionState newState)
{
handleStateChange(newState);
}
};
static final ThreadFactory defaultThreadFactory = ThreadUtils.newThreadFactory("TreeCache");
/**
* Create a TreeCache for the given client and path with default options.
* <p/>
* If the client is namespaced, all operations on the resulting TreeCache will be in terms of
* the namespace, including all published events. The given path is the root at which the
* TreeCache will watch and explore. If no node exists at the given path, the TreeCache will
* be initially empty.
*
* @param client the client to use; may be namespaced
* @param path the path to the root node to watch/explore; this path need not actually exist on
* the server
* @see #newBuilder(CuratorFramework, String)
*/
public TreeCache(CuratorFramework client, String path)
{
this(client, path, true, false, new CloseableExecutorService(Executors.newSingleThreadExecutor(defaultThreadFactory), true));
}
/**
* @param client the client
* @param path path to watch
* @param cacheData if true, node contents are cached in addition to the stat
* @param dataIsCompressed if true, data in the path is compressed
* @param executorService Closeable ExecutorService to use for the TreeCache's background thread
*/
TreeCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, final CloseableExecutorService executorService)
{
this.root = new TreeNode(validatePath(path), null);
this.client = client;
this.cacheData = cacheData;
this.dataIsCompressed = dataIsCompressed;
this.executorService = executorService;
}
/**
* Start the cache. The cache is not started automatically. You must call this method.
*
* @return this
* @throws Exception errors
*/
public TreeCache start() throws Exception
{
Preconditions.checkState(treeState.compareAndSet(TreeState.LATENT, TreeState.STARTED), "already started");
client.getConnectionStateListenable().addListener(connectionStateListener);
if ( client.getZookeeperClient().isConnected() )
{
root.wasCreated();
}
return this;
}
/**
* Close/end the cache.
*/
@Override
public void close()
{
if ( treeState.compareAndSet(TreeState.STARTED, TreeState.CLOSED) )
{
client.getConnectionStateListenable().removeListener(connectionStateListener);
listeners.clear();
executorService.close();
try
{
root.wasDeleted();
}
catch ( Exception e )
{
handleException(e);
}
}
}
/**
* Return the cache listenable
*
* @return listenable
*/
public Listenable<TreeCacheListener> getListenable()
{
return listeners;
}
/**
* Allows catching unhandled errors in asynchornous operations.
*
* TODO: consider making public.
*/
@VisibleForTesting
Listenable<UnhandledErrorListener> getUnhandledErrorListenable()
{
return errorListeners;
}
private TreeNode find(String fullPath)
{
if ( !fullPath.startsWith(root.path) )
{
return null;
}
TreeNode current = root;
if ( fullPath.length() > root.path.length() )
{
if ( root.path.length() > 1 )
{
fullPath = fullPath.substring(root.path.length());
}
List<String> split = ZKPaths.split(fullPath);
for ( String part : split )
{
ConcurrentMap<String, TreeNode> map = current.children.get();
if ( map == null )
{
return null;
}
current = map.get(part);
if ( current == null )
{
return null;
}
}
}
return current;
}
/**
* Return the current set of children at the given path, mapped by child name. There are no
* guarantees of accuracy; this is merely the most recent view of the data. If there is no
* node at this path, {@code null} is returned.
*
* @param fullPath full path to the node to check
* @return a possibly-empty list of children if the node is alive, or null
*/
public Map<String, ChildData> getCurrentChildren(String fullPath)
{
TreeNode node = find(fullPath);
if ( node == null || node.nodeState.get() != NodeState.LIVE )
{
return null;
}
ConcurrentMap<String, TreeNode> map = node.children.get();
Map<String, ChildData> result;
if ( map == null )
{
result = ImmutableMap.of();
}
else
{
ImmutableMap.Builder<String, ChildData> builder = ImmutableMap.builder();
for ( Map.Entry<String, TreeNode> entry : map.entrySet() )
{
TreeNode childNode = entry.getValue();
ChildData childData = new ChildData(childNode.path, childNode.stat.get(), childNode.data.get());
// Double-check liveness after retreiving data.
if ( childNode.nodeState.get() == NodeState.LIVE )
{
builder.put(entry.getKey(), childData);
}
}
result = builder.build();
}
// Double-check liveness after retreiving children.
return node.nodeState.get() == NodeState.LIVE ? result : null;
}
/**
* Return the current data for the given path. There are no guarantees of accuracy. This is
* merely the most recent view of the data. If there is no node at the given path,
* {@code null} is returned.
*
* @param fullPath full path to the node to check
* @return data if the node is alive, or null
*/
public ChildData getCurrentData(String fullPath)
{
TreeNode node = find(fullPath);
if ( node == null || node.nodeState.get() != NodeState.LIVE )
{
return null;
}
ChildData result = new ChildData(node.path, node.stat.get(), node.data.get());
// Double-check liveness after retreiving data.
return node.nodeState.get() == NodeState.LIVE ? result : null;
}
private void callListeners(final TreeCacheEvent event)
{
listeners.forEach(new Function<TreeCacheListener, Void>()
{
@Override
public Void apply(TreeCacheListener listener)
{
try
{
listener.childEvent(client, event);
}
catch ( Exception e )
{
handleException(e);
}
return null;
}
});
}
/**
* Send an exception to any listeners, or else log the error if there are none.
*/
private void handleException(final Throwable e)
{
if ( errorListeners.size() == 0 )
{
LOG.error("", e);
}
else
{
errorListeners.forEach(new Function<UnhandledErrorListener, Void>()
{
@Override
public Void apply(UnhandledErrorListener listener)
{
try
{
listener.unhandledError("", e);
}
catch ( Exception e )
{
LOG.error("Exception handling exception", e);
}
return null;
}
});
}
}
private void handleStateChange(ConnectionState newState)
{
switch ( newState )
{
case SUSPENDED:
publishEvent(TreeCacheEvent.Type.CONNECTION_SUSPENDED);
break;
case LOST:
publishEvent(TreeCacheEvent.Type.CONNECTION_LOST);
break;
case CONNECTED:
try
{
root.wasCreated();
}
catch ( Exception e )
{
handleException(e);
}
break;
case RECONNECTED:
try
{
root.wasReconnected();
publishEvent(TreeCacheEvent.Type.CONNECTION_RECONNECTED);
}
catch ( Exception e )
{
handleException(e);
}
break;
}
}
private void publishEvent(TreeCacheEvent.Type type)
{
publishEvent(new TreeCacheEvent(type, null));
}
private void publishEvent(TreeCacheEvent.Type type, String path)
{
publishEvent(new TreeCacheEvent(type, new ChildData(path, null, null)));
}
private void publishEvent(TreeCacheEvent.Type type, ChildData data)
{
publishEvent(new TreeCacheEvent(type, data));
}
private void publishEvent(final TreeCacheEvent event)
{
if ( treeState.get() != TreeState.CLOSED )
{
executorService.submit(new Runnable()
{
@Override
public void run()
{
{
try
{
callListeners(event);
}
catch ( Exception e )
{
handleException(e);
}
}
}
});
}
}
}
| [
"scottb@squareup.com"
] | scottb@squareup.com |
59dbd8bb6929ad815a8f4aec32aa26c2a7ef0cb1 | 6f3b884a350a7a046402c5fd9c2a7372ad55fe03 | /src/lv/akurss/lesson2/lecture/Functions2.java | 9a4bbd68884176d0fb62d994fd3fdecbf9d49868 | [] | no_license | andermax/akurss | 1e0a6ec5b128baa8ad61b8f6ee6af7f2c966632f | 6baa8854f6f6e1f14fa35add9fb484ac0f7513fd | refs/heads/master | 2021-05-06T01:03:58.923636 | 2017-12-15T19:41:40 | 2017-12-15T19:41:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 306 | java | package lv.akurss.lesson2.lecture;
public class Functions2 {
public static void main(String[] args) {
int sum = add(2, 5);
int sum2 = add(1, 4);
System.out.println(sum);
System.out.println(sum2);
}
static int add(int left, int right) {
int addition = left + right;
return addition;
}
}
| [
"maks@cateye.lv"
] | maks@cateye.lv |
1ed0ebe911b19c3765ae68a75a46621f76e6aa99 | 54e0eec7d7931164c28086044b858128b6204050 | /src/com/uber/test/DistanceCalculatorTest.java | cc5ce3b230d74dcaedbcfbec066ddacc7376511b | [] | no_license | akshaybhudke/BillCalculator | 18097cfec14dd565f00172703ddefbe37f068c9d | d7886c4ec4fe3db01e391bfd6a3bea2d9976df28 | refs/heads/master | 2020-12-02T16:20:16.070663 | 2017-07-13T12:37:40 | 2017-07-13T12:37:40 | 96,537,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 65 | java | package com.uber.test;
public class DistanceCalculatorTest {
}
| [
"mailtoakshaybhudke@gmail.com"
] | mailtoakshaybhudke@gmail.com |
d23f6b48b395d0aa97602e61e4fe9f8c3c11b7fc | a862d1bff3cfcd4a5dda4c5de583c32f73e520a5 | /app/src/main/java/org/almotech/oscal/providers/SearchSuggestionProvider.java | d3caffa3398cfed2e022ea1c42d07f3c817c8692 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | OpenLabsHackerspace/Oscal-Android-App | d942d9e32d7e5837b9bfdaba4ee164eeec945609 | 364857c4750a264fb3fcd84855dbb22d73c10f93 | refs/heads/master | 2021-01-10T15:55:05.231211 | 2016-04-11T14:47:21 | 2016-04-11T14:47:21 | 55,682,335 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,719 | java | package org.almotech.oscal.providers;
import android.app.SearchManager;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.text.TextUtils;
import org.almotech.oscal.db.DatabaseManager;
/**
* Simple content provider responsible for search suggestions.
*
* @author Christophe Beyls
*/
public class SearchSuggestionProvider extends ContentProvider {
private static final int MIN_QUERY_LENGTH = 3;
private static final int DEFAULT_MAX_RESULTS = 5;
@Override
public boolean onCreate() {
return true;
}
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
throw new UnsupportedOperationException();
}
@Override
public Uri insert(Uri uri, ContentValues values) {
throw new UnsupportedOperationException();
}
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
throw new UnsupportedOperationException();
}
@Override
public String getType(Uri uri) {
return SearchManager.SUGGEST_MIME_TYPE;
}
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
String query = uri.getLastPathSegment();
// Ignore empty or too small queries
if (query == null) {
return null;
}
query = query.trim();
if ((query.length() < MIN_QUERY_LENGTH) || "search_suggest_query".equals(query)) {
return null;
}
String limitParam = uri.getQueryParameter("limit");
int limit = TextUtils.isEmpty(limitParam) ? DEFAULT_MAX_RESULTS : Integer.parseInt(limitParam);
return DatabaseManager.getInstance().getSearchSuggestionResults(query, limit);
}
}
| [
"shkurtiarmando@gmail.com"
] | shkurtiarmando@gmail.com |
29a080bceb662ad225fa678e8c8b761d5fa34164 | 4536078b4070fc3143086ff48f088e2bc4b4c681 | /v1.0.4/decompiled/d/m/a/a.java | 5767611dcc4059321292d77945fe3e48b2ac93a3 | [] | no_license | olealgoritme/smittestopp_src | 485b81422752c3d1e7980fbc9301f4f0e0030d16 | 52080d5b7613cb9279bc6cda5b469a5c84e34f6a | refs/heads/master | 2023-05-27T21:25:17.564334 | 2023-05-02T14:24:31 | 2023-05-02T14:24:31 | 262,846,147 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,038 | java | package d.m.a;
import android.util.Log;
import androidx.fragment.app.Fragment;
import d.o.g.b;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;
public final class a
extends y
implements p.e
{
public final p r;
public boolean s;
public int t = -1;
public a(p paramp)
{
super(locall, (ClassLoader)localObject);
r = paramp;
}
public static boolean b(y.a parama)
{
parama = b;
boolean bool;
if ((parama != null) && (mAdded) && (mView != null) && (!mDetached) && (!mHidden) && (parama.isPostponed())) {
bool = true;
} else {
bool = false;
}
return bool;
}
public int a()
{
return a(false);
}
public int a(boolean paramBoolean)
{
if (!s)
{
if (p.c(2))
{
Object localObject = new StringBuilder();
((StringBuilder)localObject).append("Commit: ");
((StringBuilder)localObject).append(this);
Log.v("FragmentManager", ((StringBuilder)localObject).toString());
localObject = new PrintWriter(new d.i.h.a("FragmentManager"));
a(" ", (PrintWriter)localObject, true);
((PrintWriter)localObject).close();
}
s = true;
if (g) {
t = r.i.getAndIncrement();
} else {
t = -1;
}
r.a(this, paramBoolean);
return t;
}
throw new IllegalStateException("commit already called");
}
public y a(Fragment paramFragment)
{
Object localObject = mFragmentManager;
if ((localObject != null) && (localObject != r))
{
localObject = e.a.a.a.a.a("Cannot remove Fragment attached to a different FragmentManager. Fragment ");
((StringBuilder)localObject).append(paramFragment.toString());
((StringBuilder)localObject).append(" is already attached to a FragmentManager.");
throw new IllegalStateException(((StringBuilder)localObject).toString());
}
super.a(paramFragment);
return this;
}
public y a(Fragment paramFragment, g.b paramb)
{
if (mFragmentManager == r)
{
if (paramb.isAtLeast(g.b.CREATED))
{
super.a(paramFragment, paramb);
return this;
}
paramFragment = e.a.a.a.a.a("Cannot set maximum Lifecycle below ");
paramFragment.append(g.b.CREATED);
throw new IllegalArgumentException(paramFragment.toString());
}
paramFragment = e.a.a.a.a.a("Cannot setMaxLifecycle for Fragment not attached to FragmentManager ");
paramFragment.append(r);
throw new IllegalArgumentException(paramFragment.toString());
}
public void a(int paramInt)
{
if (!g) {
return;
}
Object localObject1;
if (p.c(2))
{
localObject1 = new StringBuilder();
((StringBuilder)localObject1).append("Bump nesting in ");
((StringBuilder)localObject1).append(this);
((StringBuilder)localObject1).append(" by ");
((StringBuilder)localObject1).append(paramInt);
Log.v("FragmentManager", ((StringBuilder)localObject1).toString());
}
int i = a.size();
for (int j = 0; j < i; j++)
{
localObject1 = (y.a)a.get(j);
Object localObject2 = b;
if (localObject2 != null)
{
mBackStackNesting += paramInt;
if (p.c(2))
{
localObject2 = e.a.a.a.a.a("Bump nesting of ");
((StringBuilder)localObject2).append(b);
((StringBuilder)localObject2).append(" to ");
((StringBuilder)localObject2).append(b.mBackStackNesting);
Log.v("FragmentManager", ((StringBuilder)localObject2).toString());
}
}
}
}
public void a(int paramInt1, Fragment paramFragment, String paramString, int paramInt2)
{
super.a(paramInt1, paramFragment, paramString, paramInt2);
mFragmentManager = r;
}
public void a(String paramString, PrintWriter paramPrintWriter, boolean paramBoolean)
{
if (paramBoolean)
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mName=");
paramPrintWriter.print(this.i);
paramPrintWriter.print(" mIndex=");
paramPrintWriter.print(t);
paramPrintWriter.print(" mCommitted=");
paramPrintWriter.println(s);
if (f != 0)
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mTransition=#");
paramPrintWriter.print(Integer.toHexString(f));
}
if ((b != 0) || (c != 0))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mEnterAnim=#");
paramPrintWriter.print(Integer.toHexString(b));
paramPrintWriter.print(" mExitAnim=#");
paramPrintWriter.println(Integer.toHexString(c));
}
if ((d != 0) || (e != 0))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mPopEnterAnim=#");
paramPrintWriter.print(Integer.toHexString(d));
paramPrintWriter.print(" mPopExitAnim=#");
paramPrintWriter.println(Integer.toHexString(e));
}
if ((this.j != 0) || (k != null))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mBreadCrumbTitleRes=#");
paramPrintWriter.print(Integer.toHexString(this.j));
paramPrintWriter.print(" mBreadCrumbTitleText=");
paramPrintWriter.println(k);
}
if ((l != 0) || (m != null))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("mBreadCrumbShortTitleRes=#");
paramPrintWriter.print(Integer.toHexString(l));
paramPrintWriter.print(" mBreadCrumbShortTitleText=");
paramPrintWriter.println(m);
}
}
if (!a.isEmpty())
{
paramPrintWriter.print(paramString);
paramPrintWriter.println("Operations:");
int i = a.size();
for (int j = 0; j < i; j++)
{
y.a locala = (y.a)a.get(j);
Object localObject;
switch (a)
{
default:
localObject = e.a.a.a.a.a("cmd=");
((StringBuilder)localObject).append(a);
localObject = ((StringBuilder)localObject).toString();
break;
case 10:
localObject = "OP_SET_MAX_LIFECYCLE";
break;
case 9:
localObject = "UNSET_PRIMARY_NAV";
break;
case 8:
localObject = "SET_PRIMARY_NAV";
break;
case 7:
localObject = "ATTACH";
break;
case 6:
localObject = "DETACH";
break;
case 5:
localObject = "SHOW";
break;
case 4:
localObject = "HIDE";
break;
case 3:
localObject = "REMOVE";
break;
case 2:
localObject = "REPLACE";
break;
case 1:
localObject = "ADD";
break;
case 0:
localObject = "NULL";
}
paramPrintWriter.print(paramString);
paramPrintWriter.print(" Op #");
paramPrintWriter.print(j);
paramPrintWriter.print(": ");
paramPrintWriter.print((String)localObject);
paramPrintWriter.print(" ");
paramPrintWriter.println(b);
if (paramBoolean)
{
if ((c != 0) || (d != 0))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("enterAnim=#");
paramPrintWriter.print(Integer.toHexString(c));
paramPrintWriter.print(" exitAnim=#");
paramPrintWriter.println(Integer.toHexString(d));
}
if ((e != 0) || (f != 0))
{
paramPrintWriter.print(paramString);
paramPrintWriter.print("popEnterAnim=#");
paramPrintWriter.print(Integer.toHexString(e));
paramPrintWriter.print(" popExitAnim=#");
paramPrintWriter.println(Integer.toHexString(f));
}
}
}
}
}
public boolean a(ArrayList<a> paramArrayList, int paramInt1, int paramInt2)
{
if (paramInt2 == paramInt1) {
return false;
}
int i = a.size();
int j = -1;
int k = 0;
while (k < i)
{
Fragment localFragment = a.get(k)).b;
int m;
if (localFragment != null) {
m = mContainerId;
} else {
m = 0;
}
int n = j;
if (m != 0)
{
n = j;
if (m != j)
{
for (j = paramInt1; j < paramInt2; j++)
{
a locala = (a)paramArrayList.get(j);
int i1 = a.size();
for (n = 0; n < i1; n++)
{
localFragment = a.get(n)).b;
int i2;
if (localFragment != null) {
i2 = mContainerId;
} else {
i2 = 0;
}
if (i2 == m) {
return true;
}
}
}
n = m;
}
}
k++;
j = n;
}
return false;
}
public boolean a(ArrayList<a> paramArrayList, ArrayList<Boolean> paramArrayList1)
{
if (p.c(2))
{
StringBuilder localStringBuilder = new StringBuilder();
localStringBuilder.append("Run: ");
localStringBuilder.append(this);
Log.v("FragmentManager", localStringBuilder.toString());
}
paramArrayList.add(this);
paramArrayList1.add(Boolean.valueOf(false));
if (g)
{
paramArrayList = r;
if (d == null) {
d = new ArrayList();
}
d.add(this);
}
return true;
}
public y b(Fragment paramFragment)
{
if (paramFragment != null)
{
Object localObject = mFragmentManager;
if ((localObject != null) && (localObject != r))
{
localObject = e.a.a.a.a.a("Cannot setPrimaryNavigation for Fragment attached to a different FragmentManager. Fragment ");
((StringBuilder)localObject).append(paramFragment.toString());
((StringBuilder)localObject).append(" is already attached to a FragmentManager.");
throw new IllegalStateException(((StringBuilder)localObject).toString());
}
}
super.b(paramFragment);
return this;
}
/* Error */
public void b()
{
// Byte code:
// 0: aload_0
// 1: getfield 128 d/m/a/y:g Z
// 4: ifne +99 -> 103
// 7: aload_0
// 8: iconst_0
// 9: putfield 361 d/m/a/y:h Z
// 12: aload_0
// 13: getfield 43 d/m/a/a:r Ld/m/a/p;
// 16: astore_1
// 17: aload_1
// 18: getfield 24 d/m/a/p:n Ld/m/a/m;
// 21: ifnull +81 -> 102
// 24: aload_1
// 25: getfield 364 d/m/a/p:w Z
// 28: ifeq +6 -> 34
// 31: goto +71 -> 102
// 34: aload_1
// 35: iconst_1
// 36: invokevirtual 366 d/m/a/p:c (Z)V
// 39: aload_0
// 40: aload_1
// 41: getfield 368 d/m/a/p:y Ljava/util/ArrayList;
// 44: aload_1
// 45: getfield 371 d/m/a/p:z Ljava/util/ArrayList;
// 48: invokeinterface 373 3 0
// 53: ifeq +34 -> 87
// 56: aload_1
// 57: iconst_1
// 58: putfield 375 d/m/a/p:b Z
// 61: aload_1
// 62: aload_1
// 63: getfield 368 d/m/a/p:y Ljava/util/ArrayList;
// 66: aload_1
// 67: getfield 371 d/m/a/p:z Ljava/util/ArrayList;
// 70: invokevirtual 378 d/m/a/p:c (Ljava/util/ArrayList;Ljava/util/ArrayList;)V
// 73: aload_1
// 74: invokevirtual 380 d/m/a/p:a ()V
// 77: goto +10 -> 87
// 80: astore_2
// 81: aload_1
// 82: invokevirtual 380 d/m/a/p:a ()V
// 85: aload_2
// 86: athrow
// 87: aload_1
// 88: invokevirtual 383 d/m/a/p:o ()V
// 91: aload_1
// 92: invokevirtual 385 d/m/a/p:e ()V
// 95: aload_1
// 96: getfield 388 d/m/a/p:c Ld/m/a/x;
// 99: invokevirtual 391 d/m/a/x:a ()V
// 102: return
// 103: new 142 java/lang/IllegalStateException
// 106: dup
// 107: ldc_w 393
// 110: invokespecial 145 java/lang/IllegalStateException:<init> (Ljava/lang/String;)V
// 113: athrow
// Local variable table:
// start length slot name signature
// 0 114 0 this a
// 16 80 1 localp p
// 80 6 2 localObject Object
// Exception table:
// from to target type
// 61 73 80 finally
}
public void b(boolean paramBoolean)
{
Object localObject1;
for (int i = a.size() - 1; i >= 0; i--)
{
localObject1 = (y.a)a.get(i);
Object localObject2 = b;
if (localObject2 != null)
{
int j = f;
int k = 8194;
if (j != 4097) {
if (j != 4099)
{
if (j != 8194) {
k = 0;
} else {
k = 4097;
}
}
else {
k = 4099;
}
}
((Fragment)localObject2).setNextTransition(k);
}
switch (a)
{
case 2:
default:
localObject2 = e.a.a.a.a.a("Unknown cmd: ");
((StringBuilder)localObject2).append(a);
throw new IllegalArgumentException(((StringBuilder)localObject2).toString());
case 10:
r.a((Fragment)localObject2, g);
break;
case 9:
r.q((Fragment)localObject2);
break;
case 8:
r.q(null);
break;
case 7:
((Fragment)localObject2).setNextAnim(f);
r.a((Fragment)localObject2, true);
r.f((Fragment)localObject2);
break;
case 6:
((Fragment)localObject2).setNextAnim(e);
r.c((Fragment)localObject2);
break;
case 5:
((Fragment)localObject2).setNextAnim(f);
r.a((Fragment)localObject2, true);
r.i((Fragment)localObject2);
break;
case 4:
((Fragment)localObject2).setNextAnim(e);
r.s((Fragment)localObject2);
break;
case 3:
((Fragment)localObject2).setNextAnim(e);
r.a((Fragment)localObject2);
break;
case 1:
((Fragment)localObject2).setNextAnim(f);
r.a((Fragment)localObject2, true);
r.o((Fragment)localObject2);
}
if ((!p) && (a != 3) && (localObject2 != null)) {
r.m((Fragment)localObject2);
}
}
if ((!p) && (paramBoolean))
{
localObject1 = r;
((p)localObject1).a(m, true);
}
}
public boolean b(int paramInt)
{
int i = a.size();
for (int j = 0; j < i; j++)
{
Fragment localFragment = a.get(j)).b;
int k;
if (localFragment != null) {
k = mContainerId;
} else {
k = 0;
}
if ((k != 0) && (k == paramInt)) {
return true;
}
}
return false;
}
public void c()
{
int i = a.size();
Object localObject1;
for (int j = 0; j < i; j++)
{
localObject1 = (y.a)a.get(j);
Object localObject2 = b;
if (localObject2 != null) {
((Fragment)localObject2).setNextTransition(f);
}
switch (a)
{
case 2:
default:
localObject2 = e.a.a.a.a.a("Unknown cmd: ");
((StringBuilder)localObject2).append(a);
throw new IllegalArgumentException(((StringBuilder)localObject2).toString());
case 10:
r.a((Fragment)localObject2, h);
break;
case 9:
r.q(null);
break;
case 8:
r.q((Fragment)localObject2);
break;
case 7:
((Fragment)localObject2).setNextAnim(c);
r.a((Fragment)localObject2, false);
r.c((Fragment)localObject2);
break;
case 6:
((Fragment)localObject2).setNextAnim(d);
r.f((Fragment)localObject2);
break;
case 5:
((Fragment)localObject2).setNextAnim(c);
r.a((Fragment)localObject2, false);
r.s((Fragment)localObject2);
break;
case 4:
((Fragment)localObject2).setNextAnim(d);
r.i((Fragment)localObject2);
break;
case 3:
((Fragment)localObject2).setNextAnim(d);
r.o((Fragment)localObject2);
break;
case 1:
((Fragment)localObject2).setNextAnim(c);
r.a((Fragment)localObject2, false);
r.a((Fragment)localObject2);
}
if ((!p) && (a != 1) && (localObject2 != null)) {
r.m((Fragment)localObject2);
}
}
if (!p)
{
localObject1 = r;
((p)localObject1).a(m, true);
}
}
public String toString()
{
StringBuilder localStringBuilder = new StringBuilder(128);
localStringBuilder.append("BackStackEntry{");
localStringBuilder.append(Integer.toHexString(System.identityHashCode(this)));
if (t >= 0)
{
localStringBuilder.append(" #");
localStringBuilder.append(t);
}
if (i != null)
{
localStringBuilder.append(" ");
localStringBuilder.append(i);
}
localStringBuilder.append("}");
return localStringBuilder.toString();
}
}
/* Location:
* Qualified Name: base.d.m.a.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"olealgoritme@gmail.com"
] | olealgoritme@gmail.com |
c0ff91f6ed81c3ebae1ffd6ae52c16ba8b33aa26 | 6793ba2568df7e01514b08da580f536efbf82227 | /src/module/decode/p25/P25DecoderState.java | f510e2a64fc0d889abf00dbb2d9438b5e6a27133 | [] | no_license | anistor/sdrtrunk | 8c7562c0b117515255c7bf26be5f8e0d236004fd | 5a91630996490c800d302249a2828eaa774f049a | refs/heads/master | 2021-01-15T09:47:08.698981 | 2015-10-10T10:05:08 | 2015-10-10T10:05:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 96,059 | java | /*******************************************************************************
* SDR Trunk
* Copyright (C) 2014,2015 Dennis Sheirer
*
* This program 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 module.decode.p25;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import message.Message;
import module.decode.DecoderType;
import module.decode.event.CallEvent;
import module.decode.event.CallEvent.CallEventType;
import module.decode.p25.P25Decoder.Modulation;
import module.decode.p25.message.IBandIdentifier;
import module.decode.p25.message.P25Message;
import module.decode.p25.message.hdu.HDUMessage;
import module.decode.p25.message.ldu.LDU1Message;
import module.decode.p25.message.ldu.LDUMessage;
import module.decode.p25.message.ldu.lc.CallTermination;
import module.decode.p25.message.ldu.lc.TelephoneInterconnectVoiceChannelUser;
import module.decode.p25.message.ldu.lc.UnitToUnitVoiceChannelUser;
import module.decode.p25.message.pdu.PDUMessage;
import module.decode.p25.message.pdu.confirmed.PDUConfirmedMessage;
import module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextAccept;
import module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextReject;
import module.decode.p25.message.pdu.confirmed.SNDCPActivateTDSContextRequest;
import module.decode.p25.message.pdu.confirmed.SNDCPDeactivateTDSContext;
import module.decode.p25.message.pdu.confirmed.SNDCPUserData;
import module.decode.p25.message.pdu.osp.control.AdjacentStatusBroadcastExtended;
import module.decode.p25.message.pdu.osp.control.CallAlertExtended;
import module.decode.p25.message.pdu.osp.control.GroupAffiliationQueryExtended;
import module.decode.p25.message.pdu.osp.control.GroupAffiliationResponseExtended;
import module.decode.p25.message.pdu.osp.control.MessageUpdateExtended;
import module.decode.p25.message.pdu.osp.control.NetworkStatusBroadcastExtended;
import module.decode.p25.message.pdu.osp.control.ProtectionParameterBroadcast;
import module.decode.p25.message.pdu.osp.control.RFSSStatusBroadcastExtended;
import module.decode.p25.message.pdu.osp.control.RoamingAddressUpdateExtended;
import module.decode.p25.message.pdu.osp.control.StatusQueryExtended;
import module.decode.p25.message.pdu.osp.control.StatusUpdateExtended;
import module.decode.p25.message.pdu.osp.control.UnitRegistrationResponseExtended;
import module.decode.p25.message.pdu.osp.data.GroupDataChannelGrantExtended;
import module.decode.p25.message.pdu.osp.data.IndividualDataChannelGrantExtended;
import module.decode.p25.message.pdu.osp.voice.GroupVoiceChannelGrantExplicit;
import module.decode.p25.message.pdu.osp.voice.TelephoneInterconnectChannelGrantExplicit;
import module.decode.p25.message.pdu.osp.voice.UnitToUnitAnswerRequestExplicit;
import module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantExtended;
import module.decode.p25.message.pdu.osp.voice.UnitToUnitVoiceChannelGrantUpdateExtended;
import module.decode.p25.message.tdu.TDUMessage;
import module.decode.p25.message.tdu.lc.AdjacentSiteStatusBroadcast;
import module.decode.p25.message.tdu.lc.GroupVoiceChannelUpdate;
import module.decode.p25.message.tdu.lc.GroupVoiceChannelUpdateExplicit;
import module.decode.p25.message.tdu.lc.NetworkStatusBroadcast;
import module.decode.p25.message.tdu.lc.NetworkStatusBroadcastExplicit;
import module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcast;
import module.decode.p25.message.tdu.lc.SecondaryControlChannelBroadcastExplicit;
import module.decode.p25.message.tdu.lc.TDULinkControlMessage;
import module.decode.p25.message.tsbk.TSBKMessage;
import module.decode.p25.message.tsbk.osp.control.AcknowledgeResponse;
import module.decode.p25.message.tsbk.osp.control.AdjacentStatusBroadcast;
import module.decode.p25.message.tsbk.osp.control.AuthenticationCommand;
import module.decode.p25.message.tsbk.osp.control.CallAlert;
import module.decode.p25.message.tsbk.osp.control.DenyResponse;
import module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand;
import module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery;
import module.decode.p25.message.tsbk.osp.control.GroupAffiliationResponse;
import module.decode.p25.message.tsbk.osp.control.IdentifierUpdate;
import module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse;
import module.decode.p25.message.tsbk.osp.control.MessageUpdate;
import module.decode.p25.message.tsbk.osp.control.ProtectionParameterUpdate;
import module.decode.p25.message.tsbk.osp.control.QueuedResponse;
import module.decode.p25.message.tsbk.osp.control.RFSSStatusBroadcast;
import module.decode.p25.message.tsbk.osp.control.RadioUnitMonitorCommand;
import module.decode.p25.message.tsbk.osp.control.RoamingAddressCommand;
import module.decode.p25.message.tsbk.osp.control.StatusQuery;
import module.decode.p25.message.tsbk.osp.control.StatusUpdate;
import module.decode.p25.message.tsbk.osp.control.SystemService;
import module.decode.p25.message.tsbk.osp.control.UnitDeregistrationAcknowledge;
import module.decode.p25.message.tsbk.osp.control.UnitRegistrationCommand;
import module.decode.p25.message.tsbk.osp.control.UnitRegistrationResponse;
import module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncement;
import module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncementExplicit;
import module.decode.p25.message.tsbk.osp.data.GroupDataChannelGrant;
import module.decode.p25.message.tsbk.osp.data.IndividualDataChannelGrant;
import module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelAnnouncementExplicit;
import module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelGrant;
import module.decode.p25.message.tsbk.osp.data.SNDCPDataPageRequest;
import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrant;
import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdate;
import module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdateExplicit;
import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectAnswerRequest;
import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrant;
import module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrantUpdate;
import module.decode.p25.message.tsbk.osp.voice.UnitToUnitAnswerRequest;
import module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrant;
import module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdate;
import module.decode.p25.reference.IPProtocol;
import module.decode.p25.reference.Response;
import module.decode.p25.reference.Service;
import module.decode.p25.reference.Vendor;
import module.decode.state.ChangedAttribute;
import module.decode.state.DecoderState;
import module.decode.state.DecoderStateEvent;
import module.decode.state.DecoderStateEvent.Event;
import module.decode.state.State;
import module.decode.state.TrafficChannelAllocationEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import alias.Alias;
import alias.AliasList;
import controller.channel.Channel.ChannelType;
public class P25DecoderState extends DecoderState
{
private final static Logger mLog = LoggerFactory.getLogger( P25DecoderState.class );
private static final DecimalFormat mFrequencyFormatter =
new DecimalFormat( "0.000000" );
private module.decode.p25.message.tsbk.osp.control.NetworkStatusBroadcast mNetworkStatus;
private NetworkStatusBroadcastExtended mNetworkStatusExtended;
private ProtectionParameterBroadcast mProtectionParameterBroadcast;
private RFSSStatusBroadcast mRFSSStatusMessage;
private RFSSStatusBroadcastExtended mRFSSStatusMessageExtended;
private SNDCPDataChannelAnnouncementExplicit mSNDCPDataChannel;
private HashMap<String,AdjacentStatusBroadcast> mNeighborMap =
new HashMap<String,AdjacentStatusBroadcast>();
private Set<module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast> mSecondaryControlChannels =
new TreeSet<>();
private HashMap<Integer,IdentifierUpdate> mBands =
new HashMap<Integer,IdentifierUpdate>();
private HashMap<String,Long> mRegistrations = new HashMap<String,Long>();
private String mLastCommandEventID;
private String mLastPageEventID;
private String mLastQueryEventID;
private String mLastRegistrationEventID;
private String mLastResponseEventID;
private String mNAC;
private String mSystem;
private String mSite;
private String mSiteAlias;
private String mFromTalkgroup;
private Alias mFromAlias;
private String mToTalkgroup;
private Alias mToAlias;
private String mCurrentChannel = "CURRENT";
private long mCurrentChannelFrequency = 0;
private P25CallEvent mCurrentCallEvent;
private ChannelType mChannelType;
private Modulation mModulation;
public P25DecoderState( AliasList aliasList,
ChannelType channelType,
Modulation modulation )
{
super( aliasList );
mChannelType = channelType;
mModulation = modulation;
}
public Modulation getModulation()
{
return mModulation;
}
@Override
public DecoderType getDecoderType()
{
return DecoderType.P25_PHASE1;
}
@Override
public void start()
{
}
@Override
public void stop()
{
}
/**
* Performs a full reset to prepare this object for reuse on a new channel
*/
@Override
public void reset()
{
resetState();
updateNAC( null );
updateSite( null );
updateSystem( null );
}
/**
* Resets any temporal state details
*/
private void resetState()
{
updateFrom( null );
updateTo( null );
}
/**
* Performs any initialization operations to prepare for use
*/
@Override
public void init()
{
}
/**
* Primary message processing method.
*/
public void receive( Message message )
{
if( message instanceof P25Message )
{
updateNAC( ( (P25Message)message ).getNAC() );
/* Voice Vocoder messages */
if( message instanceof LDUMessage )
{
processLDU( (LDUMessage)message );
}
/* Terminator Data Unit with Link Control Message */
else if( message instanceof TDULinkControlMessage )
{
processTDULC( (TDULinkControlMessage)message );
}
/* Trunking Signalling Messages */
else if( message instanceof TSBKMessage )
{
processTSBK( (TSBKMessage)message );
}
/* Header Data Unit Message - preceeds voice LDUs */
else if( message instanceof HDUMessage )
{
processHDU( (HDUMessage)message );
}
/* Packet Data Unit Messages */
else if( message instanceof PDUMessage )
{
processPDU( (PDUMessage)message );
}
/* Terminator Data Unit, or default message if CRC failed */
else if( message instanceof TDUMessage )
{
processTDU( (TDUMessage)message );
}
}
}
/**
* Terminator Data Unit, or default message if the CRC failed for a longer
* message. We process these as continuation events.
*/
private void processTDU( TDUMessage tdu )
{
broadcast( new DecoderStateEvent( this, Event.CONTINUATION, State.CONTROL ) );
}
/**
* Header Data Unit - first message in a call sequence.
*/
private void processHDU( HDUMessage hdu )
{
if( hdu.isValid() )
{
State state = State.CALL;
if( hdu.isEncrypted() )
{
state = State.ENCRYPTED;
}
broadcast( new DecoderStateEvent( this, Event.START, state ) );
updateTo( hdu.getToID() );
if( mChannelType == ChannelType.STANDARD )
{
StringBuilder sb = new StringBuilder();
CallEventType type = CallEventType.CALL;
if( hdu.isEncrypted() )
{
type = CallEventType.ENCRYPTED_CALL;
sb.append( "ENCRYPTED WITH " );
sb.append( hdu.getEncryption().name() );
sb.append( " KEY:" );
sb.append( hdu.getKeyID() );
}
P25CallEvent event = new P25CallEvent.Builder( type )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "Trigger:HDU" )
.frequency( mCurrentChannelFrequency )
.to( hdu.getToID() )
.details( sb.toString() )
.build();
mCurrentCallEvent = event;
broadcast( event );
}
}
}
/**
* Terminator Data Unit with Link Control - indicates an end of the call
* sequences with embedded link control messages
*/
private void processTDULC( TDULinkControlMessage tdulc )
{
broadcast( new DecoderStateEvent( this, Event.END, State.END ) );
switch( tdulc.getOpcode() )
{
case ADJACENT_SITE_STATUS_BROADCAST:
if( tdulc instanceof AdjacentSiteStatusBroadcast )
{
AdjacentSiteStatusBroadcast assb =
(AdjacentSiteStatusBroadcast)tdulc;
updateSystem( assb.getSystemID() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case ADJACENT_SITE_STATUS_BROADCAST_EXPLICIT:
/* This message doesn't provide anything we need for channel state */
break;
case CALL_ALERT:
if( tdulc instanceof module.decode.p25.message.tdu.lc.CallAlert )
{
module.decode.p25.message.tdu.lc.CallAlert ca =
(module.decode.p25.message.tdu.lc.CallAlert)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( ca.getSourceAddress() )
.to( ca.getTargetAddress() )
.details( "CALL ALERT" )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case CALL_TERMINATION_OR_CANCELLATION:
break;
case CHANNEL_IDENTIFIER_UPDATE:
//TODO: does the activity summary need this message?
/* This message is handled by the P25MessageProcessor and
* inserted into any channels needing frequency band info */
break;
case CHANNEL_IDENTIFIER_UPDATE_EXPLICIT:
//TODO: does the activity summary need this message?
/* This message is handled by the P25MessageProcessor and
* inserted into any channels needing frequency band info */
break;
case EXTENDED_FUNCTION_COMMAND:
if( tdulc instanceof module.decode.p25.message.tdu.lc.ExtendedFunctionCommand )
{
module.decode.p25.message.tdu.lc.ExtendedFunctionCommand efc =
(module.decode.p25.message.tdu.lc.ExtendedFunctionCommand)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( efc.getTargetAddress() )
.details( "FUNCTION:" + efc.getExtendedFunction().getLabel() +
" ARG:" + efc.getArgument() )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case GROUP_AFFILIATION_QUERY:
if( tdulc instanceof module.decode.p25.message.tdu.lc.GroupAffiliationQuery )
{
module.decode.p25.message.tdu.lc.GroupAffiliationQuery gaq =
(module.decode.p25.message.tdu.lc.GroupAffiliationQuery)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "GROUP AFFILIATION QUERY" )
.from( gaq.getSourceAddress() )
.to( gaq.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case GROUP_VOICE_CHANNEL_UPDATE:
/* Reflects other call activity on the system: CALL DETECT */
if( mChannelType == ChannelType.STANDARD &&
tdulc instanceof GroupVoiceChannelUpdate )
{
GroupVoiceChannelUpdate gvcu = (GroupVoiceChannelUpdate)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( gvcu.getChannelA() )
.details( ( gvcu.isEncrypted() ? "ENCRYPTED" : "" ) )
.frequency( gvcu.getDownlinkFrequencyA() )
.from( gvcu.getGroupAddressA() )
.to( gvcu.getGroupAddressB() )
.build() );
}
break;
case GROUP_VOICE_CHANNEL_UPDATE_EXPLICIT:
/* Reflects other call activity on the system: CALL DETECT */
if( mChannelType == ChannelType.STANDARD &&
tdulc instanceof GroupVoiceChannelUpdateExplicit )
{
GroupVoiceChannelUpdateExplicit gvcue =
(GroupVoiceChannelUpdateExplicit)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( gvcue.getTransmitChannel() )
.details( ( gvcue.isEncrypted() ? "ENCRYPTED" : "" ) )
.frequency( gvcue.getDownlinkFrequency() )
.to( gvcue.getGroupAddress() )
.build() );
}
break;
case GROUP_VOICE_CHANNEL_USER:
if( mChannelType == ChannelType.STANDARD &&
tdulc instanceof module.decode.p25.message.tdu.lc.GroupVoiceChannelUser )
{
module.decode.p25.message.tdu.lc.GroupVoiceChannelUser gvcuser =
(module.decode.p25.message.tdu.lc.GroupVoiceChannelUser)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( ( gvcuser.isEncrypted() ? "ENCRYPTED" : "" ) +
( gvcuser.isEmergency() ? " EMERGENCY" : "") )
.frequency( mCurrentChannelFrequency )
.from( gvcuser.getSourceAddress() )
.to( gvcuser.getGroupAddress() )
.build() );
}
break;
case MESSAGE_UPDATE:
if( tdulc instanceof module.decode.p25.message.tdu.lc.MessageUpdate )
{
module.decode.p25.message.tdu.lc.MessageUpdate mu =
(module.decode.p25.message.tdu.lc.MessageUpdate)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.SDM )
.aliasList( getAliasList() )
.from( mu.getSourceAddress() )
.to( mu.getTargetAddress() )
.details( "MSG: " + mu.getShortDataMessage() )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case NETWORK_STATUS_BROADCAST:
if( tdulc instanceof NetworkStatusBroadcast )
{
updateSystem( ((NetworkStatusBroadcast)tdulc).getSystem() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case NETWORK_STATUS_BROADCAST_EXPLICIT:
if( tdulc instanceof NetworkStatusBroadcastExplicit )
{
updateSystem( ((NetworkStatusBroadcastExplicit)tdulc).getSystem() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case PROTECTION_PARAMETER_BROADCAST:
if( tdulc instanceof module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast )
{
module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast ppb =
(module.decode.p25.message.tdu.lc.ProtectionParameterBroadcast)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( ppb.getTargetAddress() )
.details( "ENCRYPTION: " +
ppb.getEncryption().name() + " KEY:" +
ppb.getEncryptionKey() )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case RFSS_STATUS_BROADCAST:
if( tdulc instanceof module.decode.p25.message.tdu.lc.RFSSStatusBroadcast )
{
module.decode.p25.message.tdu.lc.RFSSStatusBroadcast rfsssb =
(module.decode.p25.message.tdu.lc.RFSSStatusBroadcast)tdulc;
updateSystem( rfsssb.getSystem() );
String site = rfsssb.getRFSubsystemID() + "-" +
rfsssb.getSiteID();
updateSite( site );
if( mCurrentChannel == null ||
!mCurrentChannel.contentEquals( rfsssb.getChannel() ) )
{
mCurrentChannel = rfsssb.getChannel();
mCurrentChannelFrequency = rfsssb.getDownlinkFrequency();
}
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case RFSS_STATUS_BROADCAST_EXPLICIT:
if( tdulc instanceof module.decode.p25.message.tdu.lc.RFSSStatusBroadcastExplicit )
{
module.decode.p25.message.tdu.lc.RFSSStatusBroadcastExplicit rfsssbe =
(module.decode.p25.message.tdu.lc.RFSSStatusBroadcastExplicit)tdulc;
String site = rfsssbe.getRFSubsystemID() + "-" +
rfsssbe.getSiteID();
updateSite( site );
if( mCurrentChannel == null ||
!mCurrentChannel.contentEquals( rfsssbe.getTransmitChannel() ) )
{
mCurrentChannel = rfsssbe.getTransmitChannel();
mCurrentChannelFrequency = rfsssbe.getDownlinkFrequency();
}
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case SECONDARY_CONTROL_CHANNEL_BROADCAST:
if( tdulc instanceof SecondaryControlChannelBroadcast )
{
SecondaryControlChannelBroadcast sccb =
(SecondaryControlChannelBroadcast)tdulc;
String site = sccb.getRFSubsystemID() + "-" +
sccb.getSiteID();
updateSite( site );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case SECONDARY_CONTROL_CHANNEL_BROADCAST_EXPLICIT:
if( tdulc instanceof SecondaryControlChannelBroadcastExplicit )
{
SecondaryControlChannelBroadcastExplicit sccb =
(SecondaryControlChannelBroadcastExplicit)tdulc;
String site = sccb.getRFSubsystemID() + "-" +
sccb.getSiteID();
updateSite( site );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case STATUS_QUERY:
if( tdulc instanceof module.decode.p25.message.tdu.lc.StatusQuery )
{
module.decode.p25.message.tdu.lc.StatusQuery sq =
(module.decode.p25.message.tdu.lc.StatusQuery)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "STATUS QUERY" )
.from( sq.getSourceAddress() )
.to( sq.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case STATUS_UPDATE:
if( tdulc instanceof module.decode.p25.message.tdu.lc.StatusUpdate )
{
module.decode.p25.message.tdu.lc.StatusUpdate su =
(module.decode.p25.message.tdu.lc.StatusUpdate)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.STATUS )
.aliasList( getAliasList() )
.details( "STATUS UNIT:" + su.getUnitStatus() +
" USER:" + su.getUserStatus() )
.from( su.getSourceAddress() )
.to( su.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case SYSTEM_SERVICE_BROADCAST:
/* This message doesn't provide anything we need for channel state */
break;
case TELEPHONE_INTERCONNECT_ANSWER_REQUEST:
if( tdulc instanceof module.decode.p25.message.tdu.lc.TelephoneInterconnectAnswerRequest )
{
module.decode.p25.message.tdu.lc.TelephoneInterconnectAnswerRequest tiar =
(module.decode.p25.message.tdu.lc.TelephoneInterconnectAnswerRequest)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( tiar.getTelephoneNumber() )
.to( tiar.getTargetAddress() )
.details( "TELEPHONE CALL ALERT" )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_USER:
if( mChannelType == ChannelType.STANDARD &&
tdulc instanceof module.decode.p25.message.tdu.lc.TelephoneInterconnectVoiceChannelUser )
{
module.decode.p25.message.tdu.lc.TelephoneInterconnectVoiceChannelUser tivcu =
(module.decode.p25.message.tdu.lc.TelephoneInterconnectVoiceChannelUser)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "TELEPHONE INTERCONNECT " +
( tivcu.isEncrypted() ? "ENCRYPTED" : "" ) +
( tivcu.isEmergency() ? " EMERGENCY" : "") )
.frequency( mCurrentChannelFrequency )
.from( null )
.to( tivcu.getAddress() )
.build() );
}
break;
case UNIT_AUTHENTICATION_COMMAND:
if( tdulc instanceof module.decode.p25.message.tdu.lc.UnitAuthenticationCommand )
{
module.decode.p25.message.tdu.lc.UnitAuthenticationCommand uac =
(module.decode.p25.message.tdu.lc.UnitAuthenticationCommand)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( uac.getCompleteTargetAddress() )
.details( "AUTHENTICATE" )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case UNIT_REGISTRATION_COMMAND:
if( tdulc instanceof module.decode.p25.message.tdu.lc.UnitRegistrationCommand )
{
module.decode.p25.message.tdu.lc.UnitRegistrationCommand urc =
(module.decode.p25.message.tdu.lc.UnitRegistrationCommand)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( urc.getCompleteTargetAddress() )
.details( "REGISTER" )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case UNIT_TO_UNIT_ANSWER_REQUEST:
if( tdulc instanceof module.decode.p25.message.tdu.lc.UnitToUnitAnswerRequest )
{
module.decode.p25.message.tdu.lc.UnitToUnitAnswerRequest uuar =
(module.decode.p25.message.tdu.lc.UnitToUnitAnswerRequest)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( uuar.getSourceAddress() )
.to( uuar.getTargetAddress() )
.details( "UNIT TO UNIT CALL ALERT" )
.build() );
}
else
{
logAlternateVendorMessage( tdulc );
}
break;
case UNIT_TO_UNIT_VOICE_CHANNEL_USER:
if( mChannelType == ChannelType.STANDARD &&
tdulc instanceof module.decode.p25.message.tdu.lc.UnitToUnitVoiceChannelUser )
{
module.decode.p25.message.tdu.lc.UnitToUnitVoiceChannelUser uuvcu =
(module.decode.p25.message.tdu.lc.UnitToUnitVoiceChannelUser)tdulc;
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( ( uuvcu.isEncrypted() ? "ENCRYPTED" : "" ) +
( uuvcu.isEmergency() ? " EMERGENCY" : "" ) )
.frequency( mCurrentChannelFrequency )
.from( uuvcu.getSourceAddress() )
.to( uuvcu.getTargetAddress() )
.build() );
}
break;
default:
break;
}
}
/**
* Log optional vendor format messages that we don't yet support so that we
* can understand those messages and eventually add support.
*/
private void logAlternateVendorMessage( P25Message p25 )
{
if( p25 instanceof TDULinkControlMessage )
{
TDULinkControlMessage tdulc = (TDULinkControlMessage)p25;
mLog.debug( "TDULC - VENDOR [" + tdulc.getVendor() +
"] SPECIFIC FORMAT FOR " + tdulc.getVendorOpcode().getLabel() +
" " + tdulc.getBinaryMessage() );
}
else if( p25 instanceof LDU1Message )
{
LDU1Message ldu1 = (LDU1Message)p25;
mLog.debug( "LDU1 - VENDOR [" + ldu1.getVendor() +
"] SPECIFIC FORMAT FOR " + ldu1.getVendorOpcode().getLabel() +
" " + ldu1.getBinaryMessage() );
}
else if( p25 instanceof PDUMessage )
{
PDUMessage pdu = (PDUMessage)p25;
mLog.debug( "PDU - VENDOR [" + pdu.getVendor() +
"] SPECIFIC FORMAT FOR " + pdu.getVendorOpcode().getLabel() +
" " + pdu.getBinaryMessage() );
}
else
{
mLog.debug( "P25 - ALTERNATE VENDOR MESSAGE [" + p25.getClass() + "]" );
}
}
private void processLDU( LDUMessage ldu )
{
State state = ( ldu.isValid() && ldu.isEncrypted() ) ?
State.ENCRYPTED : State.CALL;
broadcast( new DecoderStateEvent( this, Event.CONTINUATION, state ) );
if( ldu instanceof LDU1Message )
{
switch( ((LDU1Message)ldu).getOpcode() )
{
case ADJACENT_SITE_STATUS_BROADCAST:
if( ldu instanceof module.decode.p25.message.ldu.lc.AdjacentSiteStatusBroadcast )
{
module.decode.p25.message.ldu.lc.AdjacentSiteStatusBroadcast assb =
(module.decode.p25.message.ldu.lc.AdjacentSiteStatusBroadcast)ldu;
updateSystem( assb.getSystemID() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case ADJACENT_SITE_STATUS_BROADCAST_EXPLICIT:
/* This message doesn't provide anything we need for channel state */
break;
case CALL_ALERT:
if( ldu instanceof module.decode.p25.message.ldu.lc.CallAlert )
{
module.decode.p25.message.ldu.lc.CallAlert ca =
(module.decode.p25.message.ldu.lc.CallAlert)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( ca.getSourceAddress() )
.to( ca.getTargetAddress() )
.details( "CALL ALERT" )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case CALL_TERMINATION_OR_CANCELLATION:
broadcast( new DecoderStateEvent( this, Event.END, State.END ) );
mCurrentCallEvent = null;
if( !( ldu instanceof CallTermination ) )
{
logAlternateVendorMessage( ldu );
}
break;
case CHANNEL_IDENTIFIER_UPDATE:
//TODO: do we need this for the activity summary?
/* This message is handled by the P25MessageProcessor and
* inserted into any channels needing frequency band info */
break;
case CHANNEL_IDENTIFIER_UPDATE_EXPLICIT:
//TODO: do we need this for the activity summary?
/* This message is handled by the P25MessageProcessor and
* inserted into any channels needing frequency band info */
break;
case EXTENDED_FUNCTION_COMMAND:
if( ldu instanceof module.decode.p25.message.ldu.lc.ExtendedFunctionCommand )
{
module.decode.p25.message.ldu.lc.ExtendedFunctionCommand efc =
(module.decode.p25.message.ldu.lc.ExtendedFunctionCommand)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( efc.getTargetAddress() )
.details( "FUNCTION:" + efc.getExtendedFunction().getLabel() +
" ARG:" + efc.getArgument() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case GROUP_AFFILIATION_QUERY:
if( mChannelType == ChannelType.STANDARD &&
ldu instanceof module.decode.p25.message.ldu.lc.GroupAffiliationQuery )
{
module.decode.p25.message.ldu.lc.GroupAffiliationQuery gaq =
(module.decode.p25.message.ldu.lc.GroupAffiliationQuery)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "GROUP AFFILIATION QUERY" )
.from( gaq.getSourceAddress() )
.to( gaq.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case GROUP_VOICE_CHANNEL_UPDATE:
if( mChannelType == ChannelType.STANDARD &&
ldu instanceof module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate )
{
module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate gvcu =
(module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdate)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( gvcu.getChannelA() )
.details( ( gvcu.isEncrypted() ? "ENCRYPTED" : "" ) )
.frequency( gvcu.getDownlinkFrequencyA() )
.to( gvcu.getGroupAddressA() )
.build() );
String userB = gvcu.getGroupAddressB();
if( userB != null && !userB.contentEquals( "0000" ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( gvcu.getChannelB() )
.details( ( gvcu.isEncrypted() ? "ENCRYPTED" : "" ) )
.frequency( gvcu.getDownlinkFrequencyB() )
.to( userB )
.build() );
}
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case GROUP_VOICE_CHANNEL_UPDATE_EXPLICIT:
if( mChannelType == ChannelType.STANDARD &&
ldu instanceof module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit )
{
module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit gvcue =
(module.decode.p25.message.ldu.lc.GroupVoiceChannelUpdateExplicit)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.CALL_DETECT )
.aliasList( getAliasList() )
.channel( gvcue.getTransmitChannel() )
.details( ( gvcue.isEncrypted() ? "ENCRYPTED" : "" ) )
.frequency( gvcue.getDownlinkFrequency() )
.to( gvcue.getGroupAddress() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case GROUP_VOICE_CHANNEL_USER:
/* Indicates the current user of the current channel */
if( mChannelType == ChannelType.STANDARD &&
ldu instanceof module.decode.p25.message.ldu.lc.GroupVoiceChannelUser )
{
module.decode.p25.message.ldu.lc.GroupVoiceChannelUser gvcuser =
(module.decode.p25.message.ldu.lc.GroupVoiceChannelUser)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "Trigger:LDU-GROUP_VOICE_CHANNEL_USER " +
( gvcuser.isEncrypted() ? "ENCRYPTED" : "" ) +
( gvcuser.isEmergency() ? " EMERGENCY" : "") )
.frequency( mCurrentChannelFrequency )
.from( gvcuser.getSourceAddress() )
.to( gvcuser.getGroupAddress() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case MESSAGE_UPDATE:
if( ldu instanceof module.decode.p25.message.ldu.lc.MessageUpdate )
{
module.decode.p25.message.ldu.lc.MessageUpdate mu =
(module.decode.p25.message.ldu.lc.MessageUpdate)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.SDM )
.aliasList( getAliasList() )
.from( mu.getSourceAddress() )
.to( mu.getTargetAddress() )
.details( "MSG: " + mu.getShortDataMessage() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case NETWORK_STATUS_BROADCAST:
if( ldu instanceof module.decode.p25.message.ldu.lc.NetworkStatusBroadcast )
{
updateSystem( ((module.decode.p25.message.ldu.lc.NetworkStatusBroadcast)ldu).getSystem() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case NETWORK_STATUS_BROADCAST_EXPLICIT:
if( ldu instanceof module.decode.p25.message.ldu.lc.NetworkStatusBroadcastExplicit )
{
updateSystem( ((module.decode.p25.message.ldu.lc.NetworkStatusBroadcastExplicit)ldu).getSystem() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case PROTECTION_PARAMETER_BROADCAST:
if( ldu instanceof module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast )
{
module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast ppb =
(module.decode.p25.message.ldu.lc.ProtectionParameterBroadcast)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( ppb.getTargetAddress() )
.details( "ENCRYPTION: " +
ppb.getEncryption().name() + " KEY:" +
ppb.getEncryptionKey() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case RFSS_STATUS_BROADCAST:
if( ldu instanceof module.decode.p25.message.ldu.lc.RFSSStatusBroadcast )
{
module.decode.p25.message.ldu.lc.RFSSStatusBroadcast rfsssb =
(module.decode.p25.message.ldu.lc.RFSSStatusBroadcast)ldu;
updateSystem( rfsssb.getSystem() );
String site = rfsssb.getRFSubsystemID() + "-" +
rfsssb.getSiteID();
updateSite( site );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case RFSS_STATUS_BROADCAST_EXPLICIT:
if( ldu instanceof module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit )
{
module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit rfsssbe =
(module.decode.p25.message.ldu.lc.RFSSStatusBroadcastExplicit)ldu;
String site = rfsssbe.getRFSubsystemID() + "-" +
rfsssbe.getSiteID();
updateSite( site );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case SECONDARY_CONTROL_CHANNEL_BROADCAST:
if( ldu instanceof module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast )
{
module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast sccb =
(module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcast)ldu;
String site = sccb.getRFSubsystemID() + "-" +
sccb.getSiteID();
updateSite( site );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case SECONDARY_CONTROL_CHANNEL_BROADCAST_EXPLICIT:
if( ldu instanceof module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit )
{
module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit sccb =
(module.decode.p25.message.ldu.lc.SecondaryControlChannelBroadcastExplicit)ldu;
String site = sccb.getRFSubsystemID() + "-" +
sccb.getSiteID();
updateSite( site );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case STATUS_QUERY:
if( ldu instanceof module.decode.p25.message.ldu.lc.StatusQuery )
{
module.decode.p25.message.ldu.lc.StatusQuery sq =
(module.decode.p25.message.ldu.lc.StatusQuery)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "STATUS QUERY" )
.from( sq.getSourceAddress() )
.to( sq.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case STATUS_UPDATE:
if( ldu instanceof module.decode.p25.message.ldu.lc.StatusUpdate )
{
module.decode.p25.message.ldu.lc.StatusUpdate su =
(module.decode.p25.message.ldu.lc.StatusUpdate)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.STATUS )
.aliasList( getAliasList() )
.details( "STATUS UNIT:" + su.getUnitStatus() +
" USER:" + su.getUserStatus() )
.from( su.getSourceAddress() )
.to( su.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case SYSTEM_SERVICE_BROADCAST:
/* This message doesn't provide anything we need for channel state */
break;
case TELEPHONE_INTERCONNECT_ANSWER_REQUEST:
if( ldu instanceof module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest )
{
module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest tiar =
(module.decode.p25.message.ldu.lc.TelephoneInterconnectAnswerRequest)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( tiar.getTelephoneNumber() )
.to( tiar.getTargetAddress() )
.details( "TELEPHONE CALL ALERT" )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_USER:
/* Indicates the current user of the current channel */
if( mChannelType == ChannelType.STANDARD &&
ldu instanceof TelephoneInterconnectVoiceChannelUser )
{
TelephoneInterconnectVoiceChannelUser tivcu =
(TelephoneInterconnectVoiceChannelUser)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "Trigger: LDU-TEL_INT_VOIC_CHAN_USER " +
"TELEPHONE INTERCONNECT " +
( tivcu.isEncrypted() ? "ENCRYPTED" : "" ) +
( tivcu.isEmergency() ? " EMERGENCY" : "") )
.frequency( mCurrentChannelFrequency )
.from( null )
.to( tivcu.getAddress() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case UNIT_AUTHENTICATION_COMMAND:
if( ldu instanceof module.decode.p25.message.ldu.lc.UnitAuthenticationCommand )
{
module.decode.p25.message.ldu.lc.UnitAuthenticationCommand uac =
(module.decode.p25.message.ldu.lc.UnitAuthenticationCommand)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( uac.getCompleteTargetAddress() )
.details( "AUTHENTICATE" )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case UNIT_REGISTRATION_COMMAND:
if( ldu instanceof module.decode.p25.message.ldu.lc.UnitRegistrationCommand )
{
module.decode.p25.message.ldu.lc.UnitRegistrationCommand urc =
(module.decode.p25.message.ldu.lc.UnitRegistrationCommand)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.to( urc.getCompleteTargetAddress() )
.details( "REGISTER" )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case UNIT_TO_UNIT_ANSWER_REQUEST:
if( ldu instanceof module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest )
{
module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest uuar =
(module.decode.p25.message.ldu.lc.UnitToUnitAnswerRequest)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( uuar.getSourceAddress() )
.to( uuar.getTargetAddress() )
.details( "UNIT TO UNIT CALL ALERT" )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
case UNIT_TO_UNIT_VOICE_CHANNEL_USER:
if( mChannelType == ChannelType.STANDARD &&
ldu instanceof UnitToUnitVoiceChannelUser )
{
UnitToUnitVoiceChannelUser uuvcu =
(UnitToUnitVoiceChannelUser)ldu;
broadcast( new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "Trigger:LDU-U2U_VOICE_CHAN_USER " +
( uuvcu.isEncrypted() ? "ENCRYPTED" : "" ) +
( uuvcu.isEmergency() ? " EMERGENCY" : "" ) )
.frequency( mCurrentChannelFrequency )
.from( uuvcu.getSourceAddress() )
.to( uuvcu.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( ldu );
}
break;
default:
break;
}
}
}
/**
* Process a Trunking Signalling Block message
*/
private void processTSBK( TSBKMessage tsbk )
{
/* Trunking Signalling Block Messages - indicates Control Channel */
broadcast( new DecoderStateEvent( this, Event.START, State.CONTROL ) );
if( tsbk.getVendor() == Vendor.STANDARD )
{
switch( tsbk.getOpcode() )
{
case ADJACENT_STATUS_BROADCAST:
AdjacentStatusBroadcast neighborMessage =
(AdjacentStatusBroadcast)tsbk;
mNeighborMap.put( neighborMessage.getUniqueID(), neighborMessage );
break;
case ACKNOWLEDGE_RESPONSE:
processTSBKResponse( tsbk );
break;
case AUTHENTICATION_COMMAND:
processTSBKCommand( tsbk );
break;
case CALL_ALERT:
processTSBKPage( tsbk );
break;
case DENY_RESPONSE:
processTSBKResponse( tsbk );
break;
case EXTENDED_FUNCTION_COMMAND:
processTSBKCommand( tsbk );
break;
case GROUP_AFFILIATION_QUERY:
processTSBKQuery( tsbk );
break;
case GROUP_AFFILIATION_RESPONSE:
processTSBKResponse( tsbk );
break;
case GROUP_DATA_CHANNEL_ANNOUNCEMENT:
case GROUP_DATA_CHANNEL_ANNOUNCEMENT_EXPLICIT:
processTSBKDataChannelAnnouncement( tsbk);
break;
case GROUP_DATA_CHANNEL_GRANT:
case GROUP_VOICE_CHANNEL_GRANT:
case GROUP_VOICE_CHANNEL_GRANT_UPDATE:
case GROUP_VOICE_CHANNEL_GRANT_UPDATE_EXPLICIT:
case INDIVIDUAL_DATA_CHANNEL_GRANT:
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT:
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE:
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT:
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE:
processTSBKChannelGrant( tsbk );
break;
case IDENTIFIER_UPDATE_NON_VUHF:
case IDENTIFIER_UPDATE_VHF_UHF_BANDS:
IdentifierUpdate iu = (IdentifierUpdate)tsbk;
if( !mBands.containsKey( iu.getIdentifier() ) )
{
mBands.put( iu.getIdentifier(), iu );
}
break;
case LOCATION_REGISTRATION_RESPONSE:
case UNIT_DEREGISTRATION_ACKNOWLEDGE:
processTSBKResponse( tsbk );
break;
case MESSAGE_UPDATE:
processTSBKMessage( tsbk );
break;
case NETWORK_STATUS_BROADCAST:
mNetworkStatus = (module.decode.p25.message.tsbk.osp
.control.NetworkStatusBroadcast)tsbk;
break;
case PROTECTION_PARAMETER_UPDATE:
processTSBKResponse( tsbk );
break;
case QUEUED_RESPONSE:
processTSBKResponse( tsbk );
break;
case RADIO_UNIT_MONITOR_COMMAND:
processTSBKCommand( tsbk );
break;
case RFSS_STATUS_BROADCAST:
processTSBKRFSSStatus( (RFSSStatusBroadcast)tsbk );
break;
case ROAMING_ADDRESS_COMMAND:
processTSBKCommand( tsbk );
break;
case SECONDARY_CONTROL_CHANNEL_BROADCAST:
module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast sccb =
(module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast)tsbk;
if( sccb.getDownlinkFrequency1() > 0 )
{
mSecondaryControlChannels.add( sccb );
}
break;
case SNDCP_DATA_CHANNEL_ANNOUNCEMENT_EXPLICIT:
mSNDCPDataChannel = (SNDCPDataChannelAnnouncementExplicit)tsbk;
break;
case SNDCP_DATA_CHANNEL_GRANT:
processTSBKChannelGrant( tsbk );
break;
case STATUS_QUERY:
processTSBKQuery( tsbk );
break;
case STATUS_UPDATE:
processTSBKResponse( tsbk );
break;
case TELEPHONE_INTERCONNECT_ANSWER_REQUEST:
case UNIT_TO_UNIT_ANSWER_REQUEST:
processTSBKPage( tsbk );
break;
case UNIT_REGISTRATION_COMMAND:
processTSBKCommand( tsbk );
break;
case UNIT_REGISTRATION_RESPONSE:
processTSBKResponse( tsbk );
break;
default:
break;
}
}
}
/**
* Process a Packet Data Unit message
*/
private void processPDU( PDUMessage pdu )
{
broadcast( new DecoderStateEvent( this, Event.CONTINUATION, State.DATA ) );
if( pdu instanceof NetworkStatusBroadcastExtended )
{
mNetworkStatusExtended = (NetworkStatusBroadcastExtended)pdu;
}
else if( pdu instanceof ProtectionParameterBroadcast )
{
mProtectionParameterBroadcast =
(ProtectionParameterBroadcast)pdu;
}
else if( pdu instanceof RFSSStatusBroadcastExtended )
{
mRFSSStatusMessageExtended = (RFSSStatusBroadcastExtended)pdu;
}
if( pdu instanceof PDUConfirmedMessage )
{
PDUConfirmedMessage pduc = (PDUConfirmedMessage)pdu;
switch( pduc.getPDUType() )
{
case SN_ACTIVATE_TDS_CONTEXT_ACCEPT:
SNDCPActivateTDSContextAccept satca =
(SNDCPActivateTDSContextAccept)pduc;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "ACTIVATE SNDCP USE IP:" + satca.getIPAddress() )
.frequency( mCurrentChannelFrequency )
.to( satca.getLogicalLinkID() )
.build() );
break;
case SN_ACTIVATE_TDS_CONTEXT_REJECT:
SNDCPActivateTDSContextReject satcr =
(SNDCPActivateTDSContextReject)pduc;
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "REJECT: SNDCP CONTEXT ACTIVATION "
+ "REASON:" + satcr.getReason().getLabel() )
.frequency( mCurrentChannelFrequency )
.to( satcr.getLogicalLinkID() )
.build() );
break;
case SN_ACTIVATE_TDS_CONTEXT_REQUEST:
SNDCPActivateTDSContextRequest satcreq =
(SNDCPActivateTDSContextRequest)pduc;
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "REQUEST SNDCP USE IP:" + satcreq.getIPAddress() )
.frequency( mCurrentChannelFrequency )
.from( satcreq.getLogicalLinkID() )
.build() );
break;
case SN_DEACTIVATE_TDS_CONTEXT_ACCEPT:
SNDCPDeactivateTDSContext sdtca =
(SNDCPDeactivateTDSContext)pduc;
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "ACCEPT DEACTIVATE SNDCP CONTEXT" )
.frequency( mCurrentChannelFrequency )
.from( sdtca.getLogicalLinkID() )
.build() );
break;
case SN_DEACTIVATE_TDS_CONTEXT_REQUEST:
SNDCPDeactivateTDSContext sdtcreq =
(SNDCPDeactivateTDSContext)pduc;
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "REQUEST DEACTIVATE SNDCP CONTEXT" )
.frequency( mCurrentChannelFrequency )
.from( sdtcreq.getLogicalLinkID() )
.build() );
break;
case SN_RF_CONFIRMED_DATA:
SNDCPUserData sud = (SNDCPUserData)pduc;
StringBuilder sbFrom = new StringBuilder();
StringBuilder sbTo = new StringBuilder();
sbFrom.append( sud.getSourceIPAddress() );
sbTo.append( sud.getDestinationIPAddress() );
if( sud.getIPProtocol() == IPProtocol.UDP )
{
sbFrom.append( ":" );
sbFrom.append( sud.getUDPSourcePort() );
sbTo.append( ":" );
sbTo.append( sud.getUDPDestinationPort() );
}
broadcast( new DecoderStateEvent( this, Event.START, State.DATA ) );
broadcast( new P25CallEvent.Builder( CallEventType.DATA_CALL )
.aliasList( getAliasList() )
.channel( mCurrentChannel )
.details( "DATA: " + sud.getPayload() +
" RADIO IP:" + sbTo.toString() )
.frequency( mCurrentChannelFrequency )
.from( sbFrom.toString() )
.to( pduc.getLogicalLinkID() )
.build() );
break;
default:
mLog.debug( "PDUC - Unrecognized Message: " + pduc.toString() );
break;
}
}
else
{
/* These are alternate trunking control blocks in PDU format */
switch( pdu.getOpcode() )
{
case ADJACENT_STATUS_BROADCAST:
AdjacentStatusBroadcastExtended asbe =
(AdjacentStatusBroadcastExtended)pdu;
updateSystem( asbe.getSystemID() );
break;
case CALL_ALERT:
if( pdu instanceof CallAlertExtended )
{
CallAlertExtended ca = (CallAlertExtended)pdu;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( ca.getWACN() + "-" + ca.getSystemID() + "-" +
ca.getSourceID() )
.to( ca.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case GROUP_AFFILIATION_QUERY:
if( pdu instanceof GroupAffiliationQueryExtended )
{
GroupAffiliationQueryExtended gaqe =
(GroupAffiliationQueryExtended)pdu;
if( mLastQueryEventID == null || !gaqe.getTargetAddress()
.contentEquals( mLastQueryEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "GROUP AFFILIATION" )
.from( gaqe.getWACN() + "-" + gaqe.getSystemID() +
"-" + gaqe.getSourceID() )
.to( gaqe.getTargetAddress() )
.build() );
mLastQueryEventID = gaqe.getToID();
}
}
break;
case GROUP_AFFILIATION_RESPONSE:
if( pdu instanceof GroupAffiliationResponseExtended )
{
GroupAffiliationResponseExtended gar =
(GroupAffiliationResponseExtended)pdu;
if( mLastResponseEventID == null || !gar.getTargetAddress()
.contentEquals( mLastResponseEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "AFFILIATION:" + gar.getResponse().name() +
" FOR GROUP:" + gar.getGroupWACN() + "-" +
gar.getGroupSystemID() + "-" +
gar.getGroupID() + " ANNOUNCEMENT GROUP:" +
gar.getAnnouncementGroupID() )
.from( gar.getSourceWACN() + "-" +
gar.getSourceSystemID() + "-" +
gar.getSourceID() )
.to( gar.getTargetAddress() )
.build() );
mLastResponseEventID = gar.getTargetAddress();
}
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case GROUP_DATA_CHANNEL_GRANT:
if( pdu instanceof GroupDataChannelGrantExtended )
{
GroupDataChannelGrantExtended gdcge =
(GroupDataChannelGrantExtended)pdu;
CallEvent callEvent = new P25CallEvent.Builder( CallEventType.DATA_CALL )
.aliasList( getAliasList() )
.channel( gdcge.getTransmitChannel() )
.details( ( gdcge.isEncrypted() ? "ENCRYPTED" : "" ) +
( gdcge.isEmergency() ? " EMERGENCY" : "") )
.frequency( gdcge.getDownlinkFrequency() )
.from( gdcge.getSourceAddress() )
.to( gdcge.getGroupAddress() )
.build();
broadcast( new TrafficChannelAllocationEvent( this, callEvent ) );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case GROUP_VOICE_CHANNEL_GRANT:
if( pdu instanceof GroupVoiceChannelGrantExplicit )
{
GroupVoiceChannelGrantExplicit gvcge =
(GroupVoiceChannelGrantExplicit)pdu;
CallEvent callEvent = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( gvcge.getTransmitChannel() )
.details( ( gvcge.isEncrypted() ? "ENCRYPTED" : "" ) +
( gvcge.isEmergency() ? " EMERGENCY" : "") )
.frequency( gvcge.getDownlinkFrequency() )
.from( gvcge.getSourceAddress() )
.to( gvcge.getGroupAddress() )
.build();
broadcast( new TrafficChannelAllocationEvent( this, callEvent ) );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case INDIVIDUAL_DATA_CHANNEL_GRANT:
if( pdu instanceof IndividualDataChannelGrantExtended )
{
IndividualDataChannelGrantExtended idcge =
(IndividualDataChannelGrantExtended)pdu;
CallEvent callEvent = new P25CallEvent.Builder( CallEventType.DATA_CALL )
.aliasList( getAliasList() )
.channel( idcge.getTransmitChannel() )
.details( ( idcge.isEncrypted() ? "ENCRYPTED" : "" ) +
( idcge.isEmergency() ? " EMERGENCY" : "") )
.frequency( idcge.getDownlinkFrequency() )
.from( idcge.getSourceWACN() + "-" +
idcge.getSourceSystemID() + "-" +
idcge.getSourceAddress() )
.to( idcge.getTargetAddress() )
.build();
broadcast( new TrafficChannelAllocationEvent( this, callEvent ) );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case MESSAGE_UPDATE:
if( pdu instanceof MessageUpdateExtended )
{
MessageUpdateExtended mu = (MessageUpdateExtended)pdu;
broadcast( new P25CallEvent.Builder( CallEventType.SDM )
.aliasList( getAliasList() )
.details( "MESSAGE: " + mu.getMessage() )
.from( mu.getSourceWACN() + "-" + mu.getSourceSystemID() +
"-" + mu.getSourceID() )
.to( mu.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case RFSS_STATUS_BROADCAST:
if( pdu instanceof RFSSStatusBroadcastExtended )
{
RFSSStatusBroadcastExtended rsbe = (RFSSStatusBroadcastExtended)pdu;
updateNAC( rsbe.getNAC() );
updateSystem( rsbe.getSystemID() );
updateSite( rsbe.getRFSubsystemID() + "-" + rsbe.getSiteID() );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case ROAMING_ADDRESS_UPDATE:
if( pdu instanceof RoamingAddressUpdateExtended )
{
RoamingAddressUpdateExtended raue =
(RoamingAddressUpdateExtended)pdu;
StringBuilder sb = new StringBuilder();
sb.append( "ROAMING ADDRESS STACK A:" );
sb.append( raue.getWACNA() + "-" + raue.getSystemIDA() );
if( raue.isFormat2() )
{
sb.append( " B:" );
sb.append( raue.getWACNB() + "-" + raue.getSystemIDB() );
sb.append( " C:" );
sb.append( raue.getWACNC() + "-" + raue.getSystemIDC() );
sb.append( " D:" );
sb.append( raue.getWACND() + "-" + raue.getSystemIDD() );
}
if( raue.isFormat3() )
{
sb.append( " E:" );
sb.append( raue.getWACNE() + "-" + raue.getSystemIDE() );
sb.append( " F:" );
sb.append( raue.getWACNF() + "-" + raue.getSystemIDF() );
sb.append( " G:" );
sb.append( raue.getWACNG() + "-" + raue.getSystemIDG() );
}
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( sb.toString() )
.from( raue.getSourceID() )
.to( raue.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case STATUS_QUERY:
if( pdu instanceof StatusQueryExtended )
{
StatusQueryExtended sq = (StatusQueryExtended)pdu;
if( mLastQueryEventID == null || !sq.getTargetAddress()
.contentEquals( mLastQueryEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "STATUS QUERY" )
.from( sq.getSourceWACN() + "-" +
sq.getSourceSystemID() + "-" +
sq.getSourceID() )
.to( sq.getTargetAddress() )
.build() );
mLastQueryEventID = sq.getToID();
}
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case STATUS_UPDATE:
if( pdu instanceof StatusUpdateExtended )
{
StatusUpdateExtended su = (StatusUpdateExtended)pdu;
if( mLastResponseEventID == null || !mLastResponseEventID
.contentEquals( su.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "STATUS USER: " + su.getUserStatus() +
" UNIT: " + su.getUnitStatus() )
.from( su.getSourceWACN() + "-" +
su.getSourceSystemID() + "-" +
su.getSourceID() )
.to( su.getTargetAddress() )
.build() );
mLastResponseEventID = su.getTargetAddress();
}
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT:
TelephoneInterconnectChannelGrantExplicit ticge =
(TelephoneInterconnectChannelGrantExplicit)pdu;
CallEvent callEvent = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( ticge.getTransmitChannel() )
.details( "Trigger: PDU-TEL_INT_V_CH_GRNT " +
"TELEPHONE CALL " +
( ticge.isEncrypted() ? "ENCRYPTED" : "" ) +
( ticge.isEmergency() ? " EMERGENCY" : "") +
" CALL TIMER:" + ticge.getCallTimer() )
.frequency( ticge.getDownlinkFrequency() )
.from( ticge.getAddress() )
.build();
broadcast( new TrafficChannelAllocationEvent( this, callEvent ) );
break;
case UNIT_REGISTRATION_RESPONSE:
if( pdu instanceof UnitRegistrationResponseExtended )
{
UnitRegistrationResponseExtended urr =
(UnitRegistrationResponseExtended)pdu;
if( urr.getResponse() == Response.ACCEPT )
{
mRegistrations.put( urr.getAssignedSourceAddress(),
System.currentTimeMillis() );
}
if( mLastRegistrationEventID == null || !mLastRegistrationEventID
.contentEquals( urr.getAssignedSourceAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.REGISTER )
.aliasList( getAliasList() )
.details( "REGISTRATION:" + urr.getResponse().name() +
" FOR EXTERNAL SYSTEM ADDRESS: " +
urr.getWACN() + "-" +
urr.getSystemID() + "-" +
urr.getSourceAddress() +
" SOURCE ID: " + urr.getSourceID() )
.from( urr.getAssignedSourceAddress() )
.build() );
mLastRegistrationEventID = urr.getAssignedSourceAddress();
}
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case UNIT_TO_UNIT_ANSWER_REQUEST:
if( pdu instanceof UnitToUnitAnswerRequestExplicit )
{
UnitToUnitAnswerRequestExplicit utuare =
(UnitToUnitAnswerRequestExplicit)pdu;
if( mLastPageEventID == null || !mLastPageEventID
.contentEquals( utuare.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.details( ( utuare.isEmergency() ? "EMERGENCY" : "" ) )
.from( utuare.getWACN() + "-" +
utuare.getSystemID() + "-" +
utuare.getSourceID() )
.to( utuare.getTargetAddress() )
.build() );
mLastPageEventID = utuare.getTargetAddress();
}
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT:
if( pdu instanceof UnitToUnitVoiceChannelGrantExtended )
{
UnitToUnitVoiceChannelGrantExtended uuvcge =
(UnitToUnitVoiceChannelGrantExtended)pdu;
CallEvent uuCallEvent = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( uuvcge.getTransmitChannel() )
.details( "Trigger:PDU-U2U_V-CH_GRNT " +
( uuvcge.isEncrypted() ? "ENCRYPTED" : "" ) +
( uuvcge.isEmergency() ? " EMERGENCY" : "") )
.frequency( uuvcge.getDownlinkFrequency() )
.from( uuvcge.getSourceWACN() + "-" +
uuvcge.getSourceSystemID() + "-" +
uuvcge.getSourceID() )
.to( uuvcge.getTargetAddress() )
.build();
broadcast( new TrafficChannelAllocationEvent( this, uuCallEvent ) );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE:
if( pdu instanceof UnitToUnitVoiceChannelGrantUpdateExtended )
{
UnitToUnitVoiceChannelGrantUpdateExtended uuvcgue =
(UnitToUnitVoiceChannelGrantUpdateExtended)pdu;
broadcast( new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( uuvcgue.getTransmitChannel() )
.details( "Trigger: PDU-U2U_V_CH_G_U " +
( uuvcgue.isEncrypted() ? "ENCRYPTED" : "" ) +
( uuvcgue.isEmergency() ? " EMERGENCY" : "") )
.frequency( uuvcgue.getDownlinkFrequency() )
.from( uuvcgue.getSourceWACN() + "-" +
uuvcgue.getSourceSystemID() + "-" +
uuvcgue.getSourceID() )
.to( uuvcgue.getTargetAddress() )
.build() );
}
else
{
logAlternateVendorMessage( pdu );
}
break;
default:
break;
}
}
}
private void processTSBKCommand( TSBKMessage message )
{
switch( message.getOpcode() )
{
case AUTHENTICATION_COMMAND:
AuthenticationCommand ac = (AuthenticationCommand)message;
if( mLastCommandEventID == null || !mLastCommandEventID
.contentEquals( ac.getFullTargetID() ))
{
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.details( "AUTHENTICATE" )
.to( ac.getWACN() + "-" + ac.getSystemID() + "-" +
ac.getTargetID() )
.build() );
mLastCommandEventID = ac.getFullTargetID();
}
break;
case EXTENDED_FUNCTION_COMMAND:
ExtendedFunctionCommand efc = (ExtendedFunctionCommand)message;
if( mLastCommandEventID == null || !mLastCommandEventID
.contentEquals( efc.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.FUNCTION )
.aliasList( getAliasList() )
.details( "EXTENDED FUNCTION: " +
efc.getExtendedFunction().getLabel() )
.from( efc.getSourceAddress() )
.to( efc.getTargetAddress() )
.build() );
mLastCommandEventID = efc.getTargetAddress();
}
break;
case RADIO_UNIT_MONITOR_COMMAND:
RadioUnitMonitorCommand rumc = (RadioUnitMonitorCommand)message;
if( mLastCommandEventID == null || !mLastCommandEventID
.contentEquals( rumc.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.details( "RADIO UNIT MONITOR" )
.from( rumc.getSourceAddress() )
.to( rumc.getTargetAddress() )
.build() );
mLastCommandEventID = rumc.getTargetAddress();
}
break;
case ROAMING_ADDRESS_COMMAND:
RoamingAddressCommand rac = (RoamingAddressCommand)message;
if( mLastCommandEventID == null || !mLastCommandEventID
.contentEquals( rac.getTargetID() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.details( rac.getStackOperation().name() +
" ROAMING ADDRESS " + rac.getWACN() + "-" +
rac.getSystemID() )
.to( rac.getTargetID() )
.build() );
mLastCommandEventID = rac.getTargetID();
}
break;
case UNIT_REGISTRATION_COMMAND:
UnitRegistrationCommand urc = (UnitRegistrationCommand)message;
if( mLastCommandEventID == null || !mLastCommandEventID
.contentEquals( urc.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.COMMAND )
.aliasList( getAliasList() )
.details( "REGISTER" )
.from( urc.getSourceAddress() )
.to( urc.getTargetAddress() )
.build() );
mLastCommandEventID = urc.getTargetAddress();
}
break;
default:
break;
}
}
private void processTSBKMessage( TSBKMessage message )
{
MessageUpdate mu = (MessageUpdate)message;
broadcast( new P25CallEvent.Builder( CallEventType.SDM )
.aliasList( getAliasList() )
.details( "MESSAGE: " + mu.getMessage() )
.from( mu.getSourceAddress() )
.to( mu.getTargetAddress() )
.build() );
}
private void processTSBKQuery( TSBKMessage message )
{
switch( message.getOpcode() )
{
case GROUP_AFFILIATION_QUERY:
GroupAffiliationQuery gaq = (GroupAffiliationQuery)message;
if( mLastQueryEventID == null || !mLastQueryEventID
.contentEquals( gaq.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "GROUP AFFILIATION" )
.from( gaq.getSourceAddress() )
.to( gaq.getTargetAddress() )
.build() );
}
break;
case STATUS_QUERY:
StatusQuery sq = (StatusQuery)message;
if( mLastQueryEventID == null || !mLastQueryEventID
.contentEquals( sq.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.QUERY )
.aliasList( getAliasList() )
.details( "STATUS QUERY" )
.from( sq.getSourceAddress() )
.to( sq.getTargetAddress() )
.build() );
}
break;
default:
break;
}
}
private void processTSBKResponse( TSBKMessage message )
{
CallEvent event = null;
switch( message.getOpcode() )
{
case ACKNOWLEDGE_RESPONSE:
AcknowledgeResponse ar = (AcknowledgeResponse)message;
if( mLastResponseEventID == null || !ar.getTargetAddress()
.contentEquals( mLastResponseEventID ) )
{
String to = ar.getTargetAddress();
if( ar.hasAdditionalInformation() && ar.hasExtendedAddress() )
{
to = ar.getWACN() + "-" + ar.getSystemID() + "-" +
ar.getTargetAddress();
}
String from = null;
if( ar.hasAdditionalInformation() && !ar.hasExtendedAddress() )
{
from = ar.getFromID();
}
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "ACKNOWLEDGE" )
.from( from )
.to( to )
.build() );
mLastResponseEventID = ar.getTargetAddress();
}
break;
case DENY_RESPONSE:
DenyResponse dr = (DenyResponse)message;
if( mLastResponseEventID == null || !dr.getTargetAddress()
.contentEquals( mLastResponseEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "DENY REASON: " + dr.getReason().name() +
" REQUESTED: " + dr.getServiceType().name() )
.from( dr.getSourceAddress() )
.to( dr.getTargetAddress() )
.build() );
mLastResponseEventID = dr.getTargetAddress();
}
break;
case GROUP_AFFILIATION_RESPONSE:
GroupAffiliationResponse gar = (GroupAffiliationResponse)message;
if( mLastResponseEventID == null || !gar.getTargetAddress()
.contentEquals( mLastResponseEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "AFFILIATION:" + gar.getResponse().name() +
" FOR " + gar.getAffiliationScope() +
" GROUP:" + gar.getGroupAddress() +
" ANNOUNCEMENT GROUP:" +
gar.getAnnouncementGroupAddress() )
.to( gar.getTargetAddress() )
.build() );
mLastResponseEventID = gar.getTargetAddress();
}
break;
case LOCATION_REGISTRATION_RESPONSE:
LocationRegistrationResponse lrr =
(LocationRegistrationResponse)message;
if( lrr.getResponse() == Response.ACCEPT )
{
mRegistrations.put( lrr.getTargetAddress(),
System.currentTimeMillis() );
}
if( mLastRegistrationEventID == null ||
!mLastRegistrationEventID.contentEquals( lrr.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.REGISTER )
.aliasList( getAliasList() )
.details( "REGISTRATION:" + lrr.getResponse().name() +
" SITE: " + lrr.getRFSSID() + "-" +
lrr.getSiteID() )
.from( lrr.getTargetAddress() )
.to( lrr.getGroupAddress() )
.build() );
mLastRegistrationEventID = lrr.getTargetAddress();
}
break;
case PROTECTION_PARAMETER_UPDATE:
ProtectionParameterUpdate ppu = (ProtectionParameterUpdate)message;
if( mLastResponseEventID == null || !ppu.getTargetAddress()
.contentEquals( mLastResponseEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "USE ENCRYPTION ALGORITHM:" +
ppu.getAlgorithm().name() + " KEY:" +
ppu.getKeyID() )
.to( ppu.getTargetAddress() )
.build() );
mLastResponseEventID = ppu.getTargetAddress();
}
break;
case QUEUED_RESPONSE:
QueuedResponse qr = (QueuedResponse)message;
if( mLastResponseEventID == null || !qr.getTargetAddress()
.contentEquals( mLastResponseEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "QUEUED REASON: " + qr.getReason().name() +
" REQUESTED: " + qr.getServiceType().name() )
.from( qr.getSourceAddress() )
.to( qr.getTargetAddress() )
.build() );
mLastResponseEventID = qr.getTargetAddress();
}
break;
case STATUS_UPDATE:
StatusUpdate su = (StatusUpdate)message;
if( mLastResponseEventID == null || !su.getTargetAddress()
.contentEquals( mLastResponseEventID ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.RESPONSE )
.aliasList( getAliasList() )
.details( "STATUS USER: " + su.getUserStatus() +
" UNIT: " + su.getUnitStatus() )
.from( su.getSourceAddress() )
.to( su.getTargetAddress() )
.build() );
mLastResponseEventID = su.getTargetAddress();
}
break;
case UNIT_REGISTRATION_RESPONSE:
UnitRegistrationResponse urr = (UnitRegistrationResponse)message;
if( urr.getResponse() == Response.ACCEPT )
{
mRegistrations.put( urr.getSourceAddress(),
System.currentTimeMillis() );
}
if( mLastRegistrationEventID == null ||
!mLastRegistrationEventID.contentEquals( urr.getSourceAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.REGISTER )
.aliasList( getAliasList() )
.details( "REGISTRATION:" + urr.getResponse().name() +
" SYSTEM: " + urr.getSystemID() +
" SOURCE ID: " + urr.getSourceID() )
.from( urr.getSourceAddress() )
.build() );
mLastRegistrationEventID = urr.getSourceAddress();
}
break;
case UNIT_DEREGISTRATION_ACKNOWLEDGE:
UnitDeregistrationAcknowledge udr =
(UnitDeregistrationAcknowledge)message;
if( mLastRegistrationEventID == null ||
!mLastRegistrationEventID.contentEquals( udr.getSourceID() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.DEREGISTER )
.aliasList( getAliasList() )
.from( udr.getSourceID() )
.build() );
List<String> keysToRemove = new ArrayList<String>();
/* Remove this radio from the registrations set */
for( String key: mRegistrations.keySet() )
{
if( key.startsWith( udr.getSourceID() ) )
{
keysToRemove.add( key );
}
}
for( String key: keysToRemove )
{
mRegistrations.remove( key );
}
mLastRegistrationEventID = udr.getSourceID();
}
break;
default:
break;
}
}
private void processTSBKRFSSStatus( RFSSStatusBroadcast message )
{
mRFSSStatusMessage = message;
updateNAC( message.getNAC() );
updateSystem( message.getSystemID() );
updateSite( message.getRFSubsystemID() + "-" + message.getSiteID() );
}
private void processTSBKDataChannelAnnouncement( TSBKMessage message )
{
switch( message.getOpcode() )
{
case GROUP_DATA_CHANNEL_ANNOUNCEMENT:
GroupDataChannelAnnouncement gdca = (GroupDataChannelAnnouncement)message;
broadcast( new P25CallEvent.Builder( CallEventType.ANNOUNCEMENT )
.aliasList( getAliasList() )
.channel( gdca.getChannel1() )
.details( ( gdca.isEncrypted() ? "ENCRYPTED" : "" ) +
( gdca.isEmergency() ? " EMERGENCY" : "") )
.frequency( gdca.getDownlinkFrequency1() )
.to( gdca.getGroupAddress1() )
.build() );
if( gdca.hasChannelNumber2() )
{
broadcast( new P25CallEvent.Builder( CallEventType.ANNOUNCEMENT )
.aliasList( getAliasList() )
.channel( gdca.getChannel2() )
.details( ( gdca.isEncrypted() ? "ENCRYPTED" : "" ) +
( gdca.isEmergency() ? " EMERGENCY" : "") )
.frequency( gdca.getDownlinkFrequency2() )
.to( gdca.getGroupAddress2() )
.build() );
}
break;
case GROUP_DATA_CHANNEL_ANNOUNCEMENT_EXPLICIT:
GroupDataChannelAnnouncementExplicit gdcae =
(GroupDataChannelAnnouncementExplicit)message;
broadcast( new P25CallEvent.Builder( CallEventType.DATA_CALL )
.aliasList( getAliasList() )
.channel( gdcae.getTransmitChannel() )
.details( ( gdcae.isEncrypted() ? "ENCRYPTED" : "" ) +
( gdcae.isEmergency() ? " EMERGENCY" : "") )
.frequency( gdcae.getDownlinkFrequency() )
.to( gdcae.getGroupAddress() )
.build() );
break;
default:
break;
}
}
/**
* Process a traffic channel allocation message
*/
private void processTSBKChannelGrant( TSBKMessage message )
{
P25CallEvent event = null;
switch( message.getOpcode() )
{
case GROUP_DATA_CHANNEL_GRANT:
GroupDataChannelGrant gdcg = (GroupDataChannelGrant)message;
event = new P25CallEvent.Builder( CallEventType.DATA_CALL )
.aliasList( getAliasList() )
.channel( gdcg.getChannel() )
.details( ( gdcg.isEncrypted() ? "ENCRYPTED" : "" ) +
( gdcg.isEmergency() ? " EMERGENCY" : "") )
.frequency( gdcg.getDownlinkFrequency() )
.from( gdcg.getSourceAddress() )
.to( gdcg.getGroupAddress() )
.build();
break;
case GROUP_VOICE_CHANNEL_GRANT:
GroupVoiceChannelGrant gvcg = (GroupVoiceChannelGrant)message;
event = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( gvcg.getChannel() )
.details( "Trigger: TSBK-G_V_CH_GRNT " +
( gvcg.isEncrypted() ? "ENCRYPTED" : "" ) +
( gvcg.isEmergency() ? " EMERGENCY" : "") )
.frequency( gvcg.getDownlinkFrequency() )
.from( gvcg.getSourceAddress() )
.to( gvcg.getGroupAddress() )
.build();
break;
case GROUP_VOICE_CHANNEL_GRANT_UPDATE:
GroupVoiceChannelGrantUpdate gvcgu =
(GroupVoiceChannelGrantUpdate)message;
event = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( gvcgu.getChannel1() )
.details( "Trigger: TSBK-G_V_CH_GRNT_UP " +
( gvcgu.isEncrypted() ? "ENCRYPTED" : "" ) +
( gvcgu.isEmergency() ? " EMERGENCY" : "") )
.frequency( gvcgu.getDownlinkFrequency1() )
.to( gvcgu.getGroupAddress1() )
.build();
if( gvcgu.hasChannelNumber2() )
{
/* We handle this channel grant independent of the first event */
P25CallEvent event2 = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( gvcgu.getChannel2() )
.details( "Trigger: TSBK-G_V_CH_GRNT_UP#2 " +
( gvcgu.isEncrypted() ? "ENCRYPTED" : "" ) +
( gvcgu.isEmergency() ? " EMERGENCY" : "") )
.frequency( gvcgu.getDownlinkFrequency2() )
.to( gvcgu.getGroupAddress2() )
.build();
broadcast( new TrafficChannelAllocationEvent( this, event2 ) );
}
break;
case GROUP_VOICE_CHANNEL_GRANT_UPDATE_EXPLICIT:
GroupVoiceChannelGrantUpdateExplicit gvcgue =
(GroupVoiceChannelGrantUpdateExplicit)message;
event = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( gvcgue.getTransmitChannelIdentifier() + "-" +
gvcgue.getTransmitChannelNumber() )
.details( "Trigger: TSBK-G_V_CH_GRNT_U_E " +
( gvcgue.isEncrypted() ? "ENCRYPTED" : "" ) +
( gvcgue.isEmergency() ? " EMERGENCY" : "") )
.frequency( gvcgue.getDownlinkFrequency() )
.to( gvcgue.getGroupAddress() )
.build();
break;
case INDIVIDUAL_DATA_CHANNEL_GRANT:
IndividualDataChannelGrant idcg = (IndividualDataChannelGrant)message;
event = new P25CallEvent.Builder( CallEventType.DATA_CALL )
.aliasList( getAliasList() )
.channel( idcg.getChannel() )
.details( "Trigger: TSBK-IND_D_CH_GRNT " +
( idcg.isEncrypted() ? "ENCRYPTED" : "" ) +
( idcg.isEmergency() ? " EMERGENCY" : "") )
.frequency( idcg.getDownlinkFrequency() )
.from( idcg.getSourceAddress() )
.to( idcg.getTargetAddress() )
.build();
break;
case SNDCP_DATA_CHANNEL_GRANT:
SNDCPDataChannelGrant sdcg = (SNDCPDataChannelGrant)message;
event = new P25CallEvent.Builder( CallEventType.DATA_CALL )
.aliasList( getAliasList() )
.channel( sdcg.getTransmitChannel() )
.details( "Trigger: TSBK-SN_D_CH_GRNT " +
"SNDCP DATA NSAPI:" + sdcg.getNSAPI() )
.frequency( sdcg.getDownlinkFrequency() )
.to( sdcg.getTargetAddress() )
.build();
break;
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT:
TelephoneInterconnectVoiceChannelGrant tivcg =
(TelephoneInterconnectVoiceChannelGrant)message;
event = new P25CallEvent.Builder( CallEventType.TELEPHONE_CALL )
.aliasList( getAliasList() )
.channel( tivcg.getChannel() )
.details( "Trigger: TSBK-T_INT_V_CH_GRNT " +
( tivcg.isEncrypted() ? "ENCRYPTED" : "" ) +
( tivcg.isEmergency() ? " EMERGENCY" : "") +
" CALL TIMER:" + tivcg.getCallTimer() )
.frequency( tivcg.getDownlinkFrequency() )
.from( tivcg.getAddress() )
.build();
break;
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE:
TelephoneInterconnectVoiceChannelGrantUpdate tivcgu =
(TelephoneInterconnectVoiceChannelGrantUpdate)message;
event = new P25CallEvent.Builder( CallEventType.TELEPHONE_CALL )
.aliasList( getAliasList() )
.channel( tivcgu.getChannelIdentifier() + "-" +
tivcgu.getChannelNumber() )
.details( "Trigger: TSBK-T_INT_V_CH_G_UP " +
( tivcgu.isEncrypted() ? "ENCRYPTED" : "" ) +
( tivcgu.isEmergency() ? " EMERGENCY" : "") )
.frequency( tivcgu.getDownlinkFrequency() )
.from( tivcgu.getAddress() )
.build();
break;
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT:
UnitToUnitVoiceChannelGrant uuvcg =
(UnitToUnitVoiceChannelGrant)message;
event = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( uuvcg.getChannelIdentifier() + "-" +
uuvcg.getChannelNumber() )
.details( "Trigger: TSBK-U2U_V_CH_GRNT " +
( uuvcg.isEncrypted() ? "ENCRYPTED" : "" ) +
( uuvcg.isEmergency() ? " EMERGENCY" : "") )
.frequency( uuvcg.getDownlinkFrequency() )
.from( uuvcg.getSourceAddress() )
.to( uuvcg.getTargetAddress() )
.build();
break;
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE:
UnitToUnitVoiceChannelGrantUpdate uuvcgu =
(UnitToUnitVoiceChannelGrantUpdate)message;
event = new P25CallEvent.Builder( CallEventType.CALL )
.aliasList( getAliasList() )
.channel( uuvcgu.getChannelIdentifier() + "-" +
uuvcgu.getChannelNumber() )
.details( "Trigger: TSBK-U2U_V_CH_G_UP " +
( uuvcgu.isEncrypted() ? "ENCRYPTED" : "" ) +
( uuvcgu.isEmergency() ? " EMERGENCY" : "") )
.frequency( uuvcgu.getDownlinkFrequency() )
.from( uuvcgu.getSourceAddress() )
.to( uuvcgu.getTargetAddress() )
.build();
break;
default:
break;
}
if( event != null )
{
broadcast( new TrafficChannelAllocationEvent( this, event ) );
}
}
/**
* Broadcasts an update for the TO group or unit address
*/
private void updateTo( String to )
{
if( to != null &&
!to.contentEquals( "0000" ) &&
!to.contentEquals( "000000" ) &&
( mToTalkgroup == null || !mToTalkgroup.contentEquals( to ) ) )
{
mToTalkgroup = to;
broadcast( ChangedAttribute.TO_TALKGROUP );
if( hasAliasList() )
{
mToAlias = getAliasList().getTalkgroupAlias( to );
}
else
{
mToAlias = null;
}
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
}
}
/**
* Broadcasts an update for the FROM group or unit address
*/
private void updateFrom( String from )
{
if( from != null &&
!from.contentEquals( "0000" ) &&
!from.contentEquals( "000000" ) &&
( mFromTalkgroup == null || !mFromTalkgroup.contentEquals( from ) ) )
{
mFromTalkgroup = from;
broadcast( ChangedAttribute.FROM_TALKGROUP );
if( hasAliasList() )
{
mFromAlias = getAliasList().getTalkgroupAlias( from );
}
else
{
mFromAlias = null;
}
broadcast( ChangedAttribute.FROM_TALKGROUP_ALIAS );
}
}
/**
* Broadcasts an update to the NAC
*/
private void updateNAC( String nac )
{
if( mNAC == null || ( nac != null && !mNAC.contentEquals( nac ) ) )
{
mNAC = nac;
broadcast( ChangedAttribute.NAC );
}
}
/**
* Updates the site information
*/
private void updateSite( String site )
{
if( mSite == null || ( site != null && !mSite.contentEquals( site ) ) )
{
mSite = site;
broadcast( ChangedAttribute.SITE );
if( hasAliasList() )
{
Alias alias = getAliasList().getSiteID( mSite );
if( alias != null )
{
mSiteAlias = alias.getName();
}
else
{
mSiteAlias = null;
}
}
broadcast( ChangedAttribute.SITE_ALIAS );
}
}
private void updateSystem( String system )
{
if( mSystem == null || ( system != null && !mSystem.contentEquals( system ) ) )
{
mSystem = system;
broadcast( ChangedAttribute.SYSTEM );
}
}
/**
* Process a unit paging event message
*/
private void processTSBKPage( TSBKMessage message )
{
switch( message.getOpcode() )
{
case CALL_ALERT:
CallAlert ca = (CallAlert)message;
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.from( ca.getSourceID() )
.to( ca.getTargetAddress() )
.build() );
break;
case UNIT_TO_UNIT_ANSWER_REQUEST:
UnitToUnitAnswerRequest utuar = (UnitToUnitAnswerRequest)message;
if( mLastPageEventID == null || !mLastPageEventID
.contentEquals( utuar.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.details( ( utuar.isEmergency() ? "EMERGENCY" : "" ) )
.from( utuar.getSourceAddress() )
.to( utuar.getTargetAddress() )
.build() );
mLastPageEventID = utuar.getTargetAddress();
}
break;
case SNDCP_DATA_PAGE_REQUEST:
SNDCPDataPageRequest sdpr = (SNDCPDataPageRequest)message;
if( mLastPageEventID == null || !mLastPageEventID
.contentEquals( sdpr.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.details( "SNDCP DATA DAC: " +
sdpr.getDataAccessControl() +
" NSAPI:" + sdpr.getNSAPI() )
.to( sdpr.getTargetAddress() )
.build() );
mLastPageEventID = sdpr.getTargetAddress();
}
break;
case TELEPHONE_INTERCONNECT_ANSWER_REQUEST:
TelephoneInterconnectAnswerRequest tiar =
(TelephoneInterconnectAnswerRequest)message;
if( mLastPageEventID == null || !mLastPageEventID
.contentEquals( tiar.getTargetAddress() ) )
{
broadcast( new P25CallEvent.Builder( CallEventType.PAGE )
.aliasList( getAliasList() )
.details( ( "TELEPHONE INTERCONNECT" ) )
.from( tiar.getTelephoneNumber() )
.to( tiar.getTargetAddress() )
.build() );
mLastPageEventID = tiar.getTargetAddress();
}
break;
default:
break;
}
}
@Override
public String getActivitySummary()
{
StringBuilder sb = new StringBuilder();
sb.append( "Activity Summary\n" );
sb.append( "Decoder:\tP25\n" );
sb.append( "===================== THIS SITE ======================" );
if( mNetworkStatus != null )
{
sb.append( "\nNAC:\t" + mNetworkStatus.getNAC() );
sb.append( "\nWACN-SYS:\t" + mNetworkStatus.getWACN() );
sb.append( "-" + mNetworkStatus.getSystemID() );
sb.append( " [" );
sb.append( mNetworkStatus.getNetworkCallsign() );
sb.append( "]" );
sb.append( "\nLRA:\t" + mNetworkStatus.getLocationRegistrationArea() );
}
else if( mNetworkStatusExtended != null )
{
sb.append( "\nNAC:\t" + mNetworkStatusExtended.getNAC() );
sb.append( "\nWACN-SYS:\t" + mNetworkStatusExtended.getWACN() );
sb.append( "-" + mNetworkStatusExtended.getSystemID() );
sb.append( " [" );
sb.append( mNetworkStatusExtended.getNetworkCallsign() );
sb.append( "]" );
sb.append( "\nLRA:\t" + mNetworkStatusExtended.getLocationRegistrationArea() );
}
String site = null;
if( mRFSSStatusMessage != null )
{
site = mRFSSStatusMessage.getRFSubsystemID() + "-" + mRFSSStatusMessage.getSiteID();
}
else if( mRFSSStatusMessageExtended != null )
{
site = mRFSSStatusMessageExtended.getRFSubsystemID() + "-" +
mRFSSStatusMessageExtended.getSiteID();
}
sb.append( "\nRFSS-SITE:\t" + site );
if( hasAliasList() )
{
Alias siteAlias = getAliasList().getSiteID( site );
if( siteAlias != null )
{
sb.append( " " + siteAlias.getName() );
}
}
if( mNetworkStatus != null )
{
sb.append( "\nSERVICES:\t" + SystemService.toString(
mNetworkStatus.getSystemServiceClass() ) );
sb.append( "\nPCCH:\tDNLINK " + mFrequencyFormatter.format(
(double)mNetworkStatus.getDownlinkFrequency() / 1E6d ) +
" [" + mNetworkStatus.getIdentifier() + "-" +
mNetworkStatus.getChannel() + "]\n" );
sb.append( "\tUPLINK " + mFrequencyFormatter.format(
(double)mNetworkStatus.getUplinkFrequency() / 1E6d ) + " [" +
mNetworkStatus.getIdentifier() + "-" +
mNetworkStatus.getChannel() + "]\n" );
}
else if( mNetworkStatusExtended != null )
{
sb.append( "\nSERVICES:\t" + SystemService.toString(
mNetworkStatusExtended.getSystemServiceClass() ) );
sb.append( "\nPCCH:\tDNLINK " + mFrequencyFormatter.format(
(double)mNetworkStatusExtended.getDownlinkFrequency() / 1E6d ) +
" [" + mNetworkStatusExtended.getTransmitIdentifier() + "-" +
mNetworkStatusExtended.getTransmitChannel() + "]\n" );
sb.append( "\tUPLINK " + mFrequencyFormatter.format(
(double)mNetworkStatusExtended.getUplinkFrequency() / 1E6d ) +
" [" + mNetworkStatusExtended.getReceiveIdentifier() + "-" +
mNetworkStatusExtended.getReceiveChannel() + "]" );
}
if( mSecondaryControlChannels.isEmpty() )
{
sb.append( "\nSCCH:\tNONE" );
}
else
{
for( module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast
sec: mSecondaryControlChannels )
{
sb.append( "\nSCCH:\tDNLINK " + mFrequencyFormatter.format(
(double)sec.getDownlinkFrequency1() / 1E6d ) +
" [" + sec.getIdentifier1() + "-" + sec.getChannel1() + "]\n" );
sb.append( "\tUPLINK " + mFrequencyFormatter.format(
(double)sec.getUplinkFrequency1() / 1E6d ) + " [" +
sec.getIdentifier1() + "-" + sec.getChannel1() + "]\n" );
if( sec.hasChannel2() )
{
sb.append( "\nSCCH:\tDNLINK " + mFrequencyFormatter.format(
(double)sec.getDownlinkFrequency2() / 1E6d ) +
" [" + sec.getIdentifier2() + "-" + sec.getChannel2() + "]\n" );
sb.append( "\tUPLINK " + mFrequencyFormatter.format(
(double)sec.getUplinkFrequency2() / 1E6d ) + " [" +
sec.getIdentifier2() + "-" + sec.getChannel2() + "]" );
}
}
}
if( mSNDCPDataChannel != null )
{
sb.append( "\nSNDCP:" );
sb.append( "\tDNLINK " + mFrequencyFormatter.format(
(double)mSNDCPDataChannel.getDownlinkFrequency()/1E6D ) +
" [" + mSNDCPDataChannel.getTransmitChannel() + "]" );
sb.append( "\tUPLINK " + mFrequencyFormatter.format(
(double)mSNDCPDataChannel.getUplinkFrequency()/1E6D ) +
" [" + mSNDCPDataChannel.getReceiveChannel() + "]" );
}
if( mProtectionParameterBroadcast != null )
{
sb.append( "\nENCRYPTION:" );
sb.append( "\nTYPE:\t" + mProtectionParameterBroadcast
.getEncryptionType().name() );
sb.append( "\nALGORITHM:\t" + mProtectionParameterBroadcast
.getAlgorithmID() );
sb.append( "\nKEY:\t" + mProtectionParameterBroadcast.getKeyID() );
sb.append( "\nINBOUND IV:\t" + mProtectionParameterBroadcast
.getInboundInitializationVector() );
sb.append( "\nOUTBOUND IV:\t" + mProtectionParameterBroadcast
.getOutboundInitializationVector() );
}
List<Integer> identifiers = new ArrayList<>( mBands.keySet() );
Collections.sort( identifiers );
sb.append( "\nFREQUENCY BANDS:" );
for( Integer id: identifiers )
{
IBandIdentifier band = mBands.get( id );
sb.append( "\n\t" + id );
sb.append( "- BASE: " + mFrequencyFormatter.format(
(double)band.getBaseFrequency() / 1E6d ) );
sb.append( " CHANNEL SIZE: " + mFrequencyFormatter.format(
(double)band.getChannelSpacing() / 1E6d ) );
sb.append( " UPLINK OFFSET: " + mFrequencyFormatter.format(
(double)band.getTransmitOffset() / 1E6D ) );
}
sb.append( "\n\n=================== NEIGHBORS ======================" );
if( mNeighborMap.isEmpty() )
{
sb.append( "\n\tNONE\n" );
sb.append( "\n----------------------------------------------------" );
}
else
{
for( AdjacentStatusBroadcast neighbor: mNeighborMap.values() )
{
sb.append( "\nNAC:\t" + neighbor.getNAC() );
sb.append( "\nSYSTEM:\t" + neighbor.getSystemID() );
sb.append( "\nLRA:\t" + neighbor.getLocationRegistrationArea() );
String neighborID = neighbor.getRFSS() + "-" + neighbor.getSiteID();
sb.append( "\nRFSS-SITE:\t" + neighborID );
if( hasAliasList() )
{
Alias siteAlias = getAliasList().getSiteID( neighborID );
if( siteAlias != null )
{
sb.append( " " + siteAlias.getName() );
}
}
sb.append( "\nPCCH:\tDNLINK " + mFrequencyFormatter.format(
(double)neighbor.getDownlinkFrequency() / 1E6d ) +
" [" + neighbor.getIdentifier() + "-" + neighbor.getChannel() + "]" );
sb.append( "\n\tUPLINK:" + mFrequencyFormatter.format(
(double)neighbor.getUplinkFrequency() / 1E6d ) + "\n" );
sb.append( "\nSERVICES:\t" + Service.getServices( neighbor.getSystemServiceClass() ) );
sb.append( "\n----------------------------------------------------" );
}
}
return sb.toString();
}
public String getNAC()
{
return mNAC;
}
public String getSystem()
{
return mSystem;
}
public String getSiteAlias()
{
return mSiteAlias;
}
public String getSite()
{
return mSite;
}
public String getFromTalkgroup()
{
return mFromTalkgroup;
}
public Alias getFromAlias()
{
return mFromAlias;
}
public String getToTalkgroup()
{
return mToTalkgroup;
}
public Alias getToAlias()
{
return mToAlias;
}
@Override
public void receiveDecoderStateEvent( DecoderStateEvent event )
{
switch( event.getEvent() )
{
case RESET:
resetState();
break;
case SOURCE_FREQUENCY:
mCurrentChannelFrequency = event.getFrequency();
break;
case TRAFFIC_CHANNEL_ALLOCATION:
if( event.getSource() != P25DecoderState.this )
{
if( event instanceof TrafficChannelAllocationEvent )
{
TrafficChannelAllocationEvent allocationEvent =
(TrafficChannelAllocationEvent)event;
mCurrentChannel = allocationEvent.getCallEvent().getChannel();
broadcast( ChangedAttribute.CHANNEL_NUMBER );
mCurrentChannelFrequency = allocationEvent.getCallEvent().getFrequency();
broadcast( ChangedAttribute.SOURCE );
mFromTalkgroup = allocationEvent.getCallEvent().getFromID();
broadcast( ChangedAttribute.FROM_TALKGROUP );
mToTalkgroup = allocationEvent.getCallEvent().getToID();
broadcast( ChangedAttribute.TO_TALKGROUP );
}
}
break;
default:
break;
}
}
}
| [
"dennissheirer2002@yahoo.com"
] | dennissheirer2002@yahoo.com |
7dc3cd62c64bad259bd07dd1d9067f2bb8bb8fea | b9f8bc4becc3cc2265b77c94cfeb8a7e0060ef27 | /src/com/scribdroid/android/PictureGalleryActivity.java | 808ec2f9d833c0900aaf08400e62c973114798a6 | [] | no_license | sahhhm/Scribdroid | dafd26a2db1dce764e5a363386b890ed1f4a30ca | f0b0d603a005baec720d0ceeafcefba6e897fec2 | refs/heads/master | 2016-08-04T08:42:16.017640 | 2013-01-26T20:28:14 | 2013-01-26T20:28:14 | 1,225,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,585 | java | package com.scribdroid.android;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
public class PictureGalleryActivity extends Activity {
// Debugging
private static final String TAG = "PictureGalleryActivity";
private static final boolean D = false;
private Gallery gallery;
private ImageAdapter adapter;
private String selectedName;
private int selectedPosition;
private String sdState;
private boolean sdAvailable;
private TextView header;
private Button buttonSaveSD;
private Button buttonDelete;
private Button buttonTakeAnother;
private MyApp appState;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.picturegallery);
appState = (MyApp) getApplicationContext();
// populate ui elements
header = (TextView) findViewById(R.id.textView_gallery_header);
buttonSaveSD = (Button) findViewById(R.id.button_save_picture_SD);
buttonDelete = (Button) findViewById(R.id.button_delete_picture);
buttonTakeAnother = (Button) findViewById(R.id.button_take_another_picture);
gallery = (Gallery) findViewById(R.id.gallery_picture);
// create adapter for gallery
adapter = new ImageAdapter(this);
// set adapter and onselect listener for gallery
gallery.setAdapter(adapter);
gallery.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView parent, View view, int position, long id) {
// persist information we need to save/delete/etc.
selectedPosition = position;
selectedName = fileList()[position];
header.setText(selectedName);
// show save and delete buttons
buttonDelete.setVisibility(View.VISIBLE);
buttonSaveSD.setVisibility(View.VISIBLE);
}
@Override
public void onNothingSelected(AdapterView parent) {
selectedName = "";
selectedPosition = -1;
header.setText(getResources().getString(R.string.no_pictures));
// hide save and delete buttons
buttonDelete.setVisibility(View.INVISIBLE);
buttonSaveSD.setVisibility(View.INVISIBLE);
}
});
// Check to see if external storage is available
sdState = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(sdState)) {
sdAvailable = true;
buttonSaveSD.setEnabled(true);
} else {
sdAvailable = false;
buttonSaveSD.setEnabled(false);
}
// onclick listener for buttonSaveSd
buttonSaveSD.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (sdAvailable && selectedPosition != -1) {
String path = Environment.getExternalStorageDirectory().toString()
+ File.separator + selectedName;
FileOutputStream out;
try {
Bitmap bmp = BitmapFactory.decodeFile(getFilesDir().toString()
+ File.separator + fileList()[selectedPosition].toString());
out = new FileOutputStream(path);
bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);
Toast.makeText(getBaseContext(),
getResources().getString(R.string.success_external_save),
Toast.LENGTH_LONG).show();
} catch (FileNotFoundException e) {
if (D) Log.e(TAG, e.getMessage());
Toast
.makeText(getBaseContext(),
getResources().getString(R.string.error_external_save),
Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(getBaseContext(),
getResources().getString(R.string.error_external_save), Toast.LENGTH_LONG)
.show();
}
}
});
// onclick listener for deleting picture
buttonDelete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// make sure we have something selected before deleting
if (selectedName != "") {
AlertDialog.Builder builder = new AlertDialog.Builder(
PictureGalleryActivity.this);
builder
.setMessage(
String.format(getResources().getString(R.string.confirm_delete),
selectedName)).setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// delete only if user confirms
Boolean deleted = deleteFile(selectedName);
if (deleted) {
Toast.makeText(getBaseContext(),
getResources().getString(R.string.successful_deleting),
Toast.LENGTH_LONG).show();
adapter.notifyDataSetChanged();
gallery.dispatchSetSelected(true); // needed to update
// header
} else {
Toast.makeText(getBaseContext(),
getResources().getString(R.string.error_deleting),
Toast.LENGTH_LONG).show();
}
}
}).setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
} else {
if (D) Log.e(TAG, "Nothing selected to delete");
Toast.makeText(getBaseContext(),
getResources().getString(R.string.error_deleting), Toast.LENGTH_LONG)
.show();
}
}
});
// onClick listener fir takeAnotherPicture
buttonTakeAnother.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (appState.getScribbler().isConnected()) {
Intent pictureIntent = new Intent(getBaseContext(), PictureActivity.class);
startActivity(pictureIntent);
} else {
MainTabWidget.emphasizeConnectivity();
}
}
});
}
@Override
protected void onResume() {
super.onResume();
if (fileList().length <= 0) {
// let the user know there is nothing to see yet
header.setText(getResources().getString(R.string.no_pictures));
selectedName = "";
buttonDelete.setVisibility(View.INVISIBLE);
buttonSaveSD.setVisibility(View.INVISIBLE);
} else {
// Update the adapter
adapter.notifyDataSetChanged();
}
}
public class ImageAdapter extends BaseAdapter {
int mGalleryItemBackground;
private Context mContext;
public ImageAdapter(Context c) {
mContext = c;
TypedArray attr = mContext.obtainStyledAttributes(R.styleable.PictureGallery);
mGalleryItemBackground = attr.getResourceId(
R.styleable.PictureGallery_android_galleryItemBackground, 0);
attr.recycle();
}
public int getCount() {
return fileList().length;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView = new ImageView(mContext);
imageView.setImageBitmap(BitmapFactory.decodeFile(getFilesDir().toString()
+ File.separator + fileList()[position].toString()));
imageView.setLayoutParams(new Gallery.LayoutParams(256, 192));
imageView.setBackgroundResource(mGalleryItemBackground);
return imageView;
}
}
}
| [
"sam.asghari@gatech.edu"
] | sam.asghari@gatech.edu |
3a5ea54545078296290771a93917cbf328eb3987 | 7eb5efd151453ddc644212c0d8603d9cc6c23e0e | /src/main/java/org/cheng/pojo/JSONResult.java | 1de93abd898d6463d42e2154dfd84b8a9c7b8872 | [] | no_license | zchengi/springboot-starter | 93c9696991a8701c71633e3c35466410cbf52c91 | 62b40266ddf65edc14533ff0f4a059ed1061d43d | refs/heads/master | 2020-03-13T15:07:41.218897 | 2018-08-04T12:07:06 | 2018-08-04T12:07:06 | 131,171,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,310 | java | package org.cheng.pojo;
import java.util.List;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* @author leechenxiang
* @version V1.0
* @Title JSONResult.java
* @Package com.cheng.pojo
* @Description ่ชๅฎไนๅๅบๆฐๆฎ็ปๆ
* ่ฟไธช็ฑปๆฏๆไพ็ป้จๆท๏ผios๏ผๅฎๅ๏ผๅพฎไฟกๅๅ็จ็
* ้จๆทๆฅๅๆญค็ฑปๆฐๆฎๅ้่ฆไฝฟ็จๆฌ็ฑป็ๆนๆณ่ฝฌๆขๆๅฏนไบ็ๆฐๆฎ็ฑปๅๆ ผๅผ๏ผ็ฑป๏ผๆ่
list๏ผ
* ๅ
ถไป่ช่กๅค็
* 200๏ผ่กจ็คบๆๅ
* 500๏ผ่กจ็คบ้่ฏฏ๏ผ้่ฏฏไฟกๆฏๅจmsgๅญๆฎตไธญ
* 501๏ผbean้ช่ฏ้่ฏฏ๏ผไธ็ฎกๅคๅฐไธช้่ฏฏ้ฝไปฅmapๅฝขๅผ่ฟๅ
* 502๏ผๆฆๆชๅจๆฆๆชๅฐ็จๆทtokenๅบ้
* 555๏ผๅผๅธธๆๅบไฟกๆฏ
* Copyright: Copyright (c) 2016
* Company:Nathan.Lee.Salvatore
* @date 2016ๅนด4ๆ22ๆฅ ไธๅ8:33:36
*/
public class JSONResult {
// ๅฎไนjacksonๅฏน่ฑก
private static final ObjectMapper MAPPER = new ObjectMapper();
// ๅๅบไธๅก็ถๆ
private Integer status;
// ๅๅบๆถๆฏ
private String msg;
// ๅๅบไธญ็ๆฐๆฎ
private Object data;
private String ok; // ไธไฝฟ็จ
public static JSONResult build(Integer status, String msg, Object data) {
return new JSONResult(status, msg, data);
}
public static JSONResult ok(Object data) {
return new JSONResult(data);
}
public static JSONResult ok() {
return new JSONResult(null);
}
public static JSONResult errorMsg(String msg) {
return new JSONResult(500, msg, null);
}
public static JSONResult errorMap(Object data) {
return new JSONResult(501, "error", data);
}
public static JSONResult errorTokenMsg(String msg) {
return new JSONResult(502, msg, null);
}
public static JSONResult errorException(String msg) {
return new JSONResult(555, msg, null);
}
public JSONResult() {
}
// public static LeeJSONResult build(Integer status, String msg) {
// return new LeeJSONResult(status, msg, null);
// }
public JSONResult(Integer status, String msg, Object data) {
this.status = status;
this.msg = msg;
this.data = data;
}
public JSONResult(Object data) {
this.status = 200;
this.msg = "OK";
this.data = data;
}
public Boolean isOK() {
return this.status == 200;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
/**
* @param jsonData
* @param clazz
* @return
* @Description ๅฐjson็ปๆ้่ฝฌๅไธบLeeJSONResultๅฏน่ฑก
* ้่ฆ่ฝฌๆข็ๅฏน่ฑกๆฏไธไธช็ฑป
* @author leechenxiang
* @date 2016ๅนด4ๆ22ๆฅ ไธๅ8:34:58
*/
public static JSONResult formatToPojo(String jsonData, Class<?> clazz) {
try {
if (clazz == null) {
return MAPPER.readValue(jsonData, JSONResult.class);
}
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (clazz != null) {
if (data.isObject()) {
obj = MAPPER.readValue(data.traverse(), clazz);
} else if (data.isTextual()) {
obj = MAPPER.readValue(data.asText(), clazz);
}
}
return build(jsonNode.get("status").intValue(), jsonNode.get("msg").asText(), obj);
} catch (Exception e) {
return null;
}
}
/**
* @param json
* @return
* @Description ๆฒกๆobjectๅฏน่ฑก็่ฝฌๅ
* @author leechenxiang
* @date 2016ๅนด4ๆ22ๆฅ ไธๅ8:35:21
*/
public static JSONResult format(String json) {
try {
return MAPPER.readValue(json, JSONResult.class);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* @param jsonData
* @param clazz
* @return
* @Description Objectๆฏ้ๅ่ฝฌๅ
* ้่ฆ่ฝฌๆข็ๅฏน่ฑกๆฏไธไธชlist
* @author leechenxiang
* @date 2016ๅนด4ๆ22ๆฅ ไธๅ8:35:31
*/
public static JSONResult formatToList(String jsonData, Class<?> clazz) {
try {
JsonNode jsonNode = MAPPER.readTree(jsonData);
JsonNode data = jsonNode.get("data");
Object obj = null;
if (data.isArray() && data.size() > 0) {
obj = MAPPER.readValue(data.traverse(),
MAPPER.getTypeFactory().constructCollectionType(List.class, clazz));
}
return build(jsonNode.get("status").intValue(), jsonNode.get("msg").asText(), obj);
} catch (Exception e) {
return null;
}
}
public String getOk() {
return ok;
}
public void setOk(String ok) {
this.ok = ok;
}
}
| [
"792702352@qq.com"
] | 792702352@qq.com |
1f7e3909ce0ac30a79c7937f31d5757b5fbf951d | c4a44d20a35f464f24172de275f71341a4ffcb0c | /src/main/java/org/crm/tlcrmspa/domain/util/FixedH2Dialect.java | 4147e506c0b6bd6149fa0e569dfc21b46ba8aa43 | [] | no_license | simondstewart/tlcrmspa | f30af7d7286927b7f3cb3de414b945d2b29107b0 | 8a2cd328c4ef2590274f40c70e4f15c3e7b853a9 | refs/heads/master | 2020-12-25T09:08:40.360906 | 2016-08-12T12:38:21 | 2016-08-12T12:38:21 | 60,622,482 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package org.crm.tlcrmspa.domain.util;
import java.sql.Types;
import org.hibernate.dialect.H2Dialect;
public class FixedH2Dialect extends H2Dialect {
public FixedH2Dialect() {
super();
registerColumnType(Types.FLOAT, "real");
}
}
| [
"SimonStewart@deltek.com"
] | SimonStewart@deltek.com |
d35724ccbc6b2dbfbfa9fc10ba326399972af99e | 9dba60ae1595276b3743f4c24512c193be1d918a | /app/src/main/java/com/mohitvirmani/quiz/AnswerUpload.java | 5aef5bc6412749d1e5939710019690c456e79fdc | [
"MIT"
] | permissive | mohitvirmani49/DreamIIT | 43ae6bd2de38fa062b8540e4741c7de42cc6ce8f | dd029e8b9363e585b9b62e4525b2f47853b28d18 | refs/heads/master | 2022-11-23T06:32:25.461286 | 2020-07-25T15:02:37 | 2020-07-25T15:02:37 | 262,062,612 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,718 | java | package com.mohitvirmani.quiz;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import android.app.Notification;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.view.View;
import android.webkit.MimeTypeMap;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import com.airbnb.lottie.LottieAnimationView;
import com.google.android.gms.tasks.Continuation;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.StorageTask;
import com.google.firebase.storage.UploadTask;
import com.squareup.picasso.Picasso;
import ozaydin.serkan.com.image_zoom_view.ImageViewZoom;
import static com.mohitvirmani.quiz.App.CHANNEL_1_ID;
public class AnswerUpload extends AppCompatActivity {
private static final int PICK_IMAGE_REQUEST = 1;
EditText main_ans;
ImageButton prev_img_qs;
Button submit_ans;
TextView prev_ans_txt;
Button attach_ans_img;
ImageViewZoom imageView;
private int answersum = 0;
private NotificationManagerCompat notificationManager;
private ImageButton back;
private Uri mImageUri;
private LottieAnimationView progress;
private StorageReference mStorageRef;
private DatabaseReference mDatabaseRef;
private StorageTask mUploadTask;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main18);
main_ans = (EditText) findViewById(R.id.main_answers);
prev_img_qs = (ImageButton) findViewById(R.id.answer_are_question_image);
submit_ans = (Button) findViewById(R.id.submit_ans);
prev_ans_txt = (TextView) findViewById(R.id.answer_are_text);
attach_ans_img = (Button) findViewById(R.id.attach_answer);
imageView = (ImageViewZoom) findViewById(R.id.verify_image);
back = (ImageButton) findViewById(R.id.back);
notificationManager = NotificationManagerCompat.from(this);
progress = (LottieAnimationView) findViewById(R.id.my_progress);
mStorageRef = FirebaseStorage.getInstance().getReference("uploads");
mDatabaseRef = FirebaseDatabase.getInstance().getReference("uploads");
attach_ans_img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openFileChooser();
}
});
submit_ans.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mUploadTask != null && mUploadTask.isInProgress()) {
Toast.makeText(AnswerUpload.this, "Upload in progress", Toast.LENGTH_LONG).show();
} else {
uploadFile();
progress.setVisibility(View.VISIBLE);
submit_ans.setVisibility(View.INVISIBLE);
//
//
}
}
});
}
private void openFileChooser() {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, PICK_IMAGE_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK
&& data != null && data.getData() != null) {
mImageUri = data.getData();
Picasso.get().load(mImageUri).into(imageView);
}
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(AnswerUpload.this, AnswerPage.class));
}
});
}
private String getFileExtension(Uri uri) {
ContentResolver cR = getContentResolver();
MimeTypeMap mime = MimeTypeMap.getSingleton();
return mime.getExtensionFromMimeType(cR.getType(uri));
}
private void uploadFile() {
if (mImageUri != null) {
FirebaseAuth firebaseAuth;
firebaseAuth = FirebaseAuth.getInstance();
final FirebaseUser user = firebaseAuth.getCurrentUser();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
}
}, 100);
if (user.getDisplayName() != null) {
SharedPreferences result = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
final String txt = result.getString("txt", "1");
final StorageReference fileReference = mStorageRef.child(System.currentTimeMillis()
+ "." + getFileExtension(mImageUri));
fileReference.putFile(mImageUri).continueWithTask(
new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {
@Override
public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {
if (!task.isSuccessful()) {
throw task.getException();
}
return fileReference.getDownloadUrl();
}
})
.addOnCompleteListener(new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task) {
if (task.isSuccessful()) {
final Uri downloadUri = task.getResult();
String username = user.getDisplayName();
Uri pic = user.getPhotoUrl();
FirebaseAuth firebaseAuth;
firebaseAuth = FirebaseAuth.getInstance();
FirebaseUser user2 = firebaseAuth.getCurrentUser();
Ans_Upload ans_upload = new Ans_Upload(main_ans.getText().toString(), downloadUri.toString(), user2.getDisplayName(), "", "");
DatabaseReference solution = FirebaseDatabase.getInstance().getReference("solv");
solution.child(txt).push().setValue(ans_upload);
openImagesActivity();
// Query query = FirebaseDatabase.getInstance().getReference().child("uploads");
// query.orderByChild("mName").equalTo(txt).addValueEventListener(new ValueEventListener() {
// @Override
// public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
// for (DataSnapshot foodSnapshot : dataSnapshot.getChildren()) {
// FirebaseAuth firebaseAuth;
// firebaseAuth = FirebaseAuth.getInstance();
// FirebaseUser user2 = firebaseAuth.getCurrentUser();
//
// String key = foodSnapshot.getKey();
// System.out.println(":::::::::::::" + key);
// DatabaseReference fbdatabase = FirebaseDatabase.getInstance().getReference().child("uploads").child(key);
// Map<String, Object> updates = new HashMap<String, Object>();
// if (main_ans.getText().toString().matches("")) {
// updates.put("mAnswer", "");
// updates.put("mAnsImage", downloadUri.toString());
// updates.put("mAnsDisName", user2.getDisplayName());
//
// } else {
// updates.put("mAnswer", main_ans.getText().toString());
// updates.put("mAnsImage", downloadUri.toString());
// updates.put("mAnsDisName", user2.getDisplayName());
// }
//// updates.put("mDisplayImage",user2.getPhotoUrl());
// fbdatabase.updateChildren(updates);
//
// }
//
// }
//
// @Override
// public void onCancelled(@NonNull DatabaseError databaseError) {
//
// }
// });
Toast.makeText(AnswerUpload.this, "Upload successful", Toast.LENGTH_LONG).
show();
} else {
Toast.makeText(AnswerUpload.this, "upload failed: " + task.getException().getMessage(), Toast.LENGTH_LONG).show();
}
}
}).
addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(AnswerUpload.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
});
}
} else {
SharedPreferences result = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
final String txt = result.getString("txt", "1");
FirebaseAuth firebaseAuth;
firebaseAuth = FirebaseAuth.getInstance();
FirebaseUser user2 = firebaseAuth.getCurrentUser();
answersum = answersum + 1;
// TotalAns count = new TotalAns(String.valueOf(answersum));
// DatabaseReference rankings = FirebaseDatabase.getInstance().getReference("rankans").child(user2.getUid());
// rankings.child(main_ans.getText().toString()).push().setValue(count);
// final AnswerNumber answerNumber = new AnswerNumber(String.valueOf(answersum));
// DatabaseReference dbr = FirebaseDatabase.getInstance().getReference("answercount").child(user2.getUid());
// dbr.push().setValue(answerNumber);
Ans_Upload ans_upload = new Ans_Upload(main_ans.getText().toString(), "", user2.getDisplayName(), "", "");
DatabaseReference solution = FirebaseDatabase.getInstance().getReference("solv");
solution.child(txt).push().setValue(ans_upload);
Sum sum = new Sum(String.valueOf(answersum));
DatabaseReference rank = FirebaseDatabase.getInstance().getReference("rankans").child(user2.getUid());
rank.child(main_ans.getText().toString()).push().setValue(sum);
// Query query = FirebaseDatabase.getInstance().getReference().child("uploads");
// query.orderByChild("mName").equalTo(txt).addValueEventListener(new ValueEventListener() {
// @Override
// public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
// for (DataSnapshot foodSnapshot : dataSnapshot.getChildren()) {
// FirebaseAuth firebaseAuth;
// firebaseAuth = FirebaseAuth.getInstance();
//
//
// FirebaseUser user2 = firebaseAuth.getCurrentUser();
//
// // DatabaseReference fbdatabase = FirebaseDatabase.getInstance().getReference().child("uploads").child(key);
////
//// Map<String, Object> updates = new HashMap<String, Object>();
//// updates.put("mAnswer", main_ans.getText().toString());
//// updates.put("mAnsDisName", user2.getDisplayName());
////// updates.put("mAnsDisImg",user2.getPhotoUrl());
////
//// fbdatabase.updateChildren(updates);
////
//// }
//// }
////
//// @Override
//// public void onCancelled(@NonNull DatabaseError databaseError) {
////
//// }
//// });
Toast.makeText(AnswerUpload.this, "Upload successful", Toast.LENGTH_LONG).show();
openImagesActivity();
}
}
private void openImagesActivity() {
Intent intent = new Intent(this, AnswerPage.class);
startActivity(intent);
}
private void notify_person() {
Notification notification = new NotificationCompat.Builder(AnswerUpload.this, CHANNEL_1_ID)
.setSmallIcon(R.drawable.mohitpic)
.setContentTitle("New Comment")
.setContentText("Your question has been answered")
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setOnlyAlertOnce(true)
.setAutoCancel(true)
.build();
// System.out.println("Dekh Bhai " + result.getString("comm","0"));
notificationManager.notify(1, notification);
}
@Override
public void onBackPressed() {
super.onBackPressed();
startActivity(new Intent(this, AnswerPage.class));
}
} | [
"contact.mohitvirmani@gmail.com"
] | contact.mohitvirmani@gmail.com |
9d569e2241fff2608545ac0cf14f07654603c457 | 8e1a554590777e52f57087649bd06d8ce20dec85 | /build/generated/source/r/debug/com/github/javiersantos/materialstyleddialogs/R.java | 73fe687a30c3222deda685795efc0cf3d97ebdca | [] | no_license | nicewoong/woongmemeber | 99ad3c5da60070377a8d9a81f685b42a360efb07 | d673465cf47c24f9a6ff14c0391a02a5ed0f5fe3 | refs/heads/master | 2021-07-20T04:22:24.398193 | 2017-10-29T12:24:30 | 2017-10-29T12:24:30 | 108,539,049 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 123,666 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package com.github.javiersantos.materialstyleddialogs;
public final class R {
public static final class anim {
public static final int abc_fade_in = 0x7f050000;
public static final int abc_fade_out = 0x7f050001;
public static final int abc_grow_fade_in_from_bottom = 0x7f050002;
public static final int abc_popup_enter = 0x7f050003;
public static final int abc_popup_exit = 0x7f050004;
public static final int abc_shrink_fade_out_from_bottom = 0x7f050005;
public static final int abc_slide_in_bottom = 0x7f050006;
public static final int abc_slide_in_top = 0x7f050007;
public static final int abc_slide_out_bottom = 0x7f050008;
public static final int abc_slide_out_top = 0x7f050009;
public static final int decelerate_cubic = 0x7f05000a;
public static final int md_styled_slide_down_fast = 0x7f050013;
public static final int md_styled_slide_down_normal = 0x7f050014;
public static final int md_styled_slide_down_slow = 0x7f050015;
public static final int md_styled_slide_up_fast = 0x7f050016;
public static final int md_styled_slide_up_normal = 0x7f050017;
public static final int md_styled_slide_up_slow = 0x7f050018;
public static final int md_styled_zoom_in = 0x7f050019;
public static final int md_styled_zoom_out = 0x7f05001a;
public static final int popup_enter = 0x7f05001b;
public static final int popup_exit = 0x7f05001c;
}
public static final class attr {
public static final int actionBarDivider = 0x7f01006b;
public static final int actionBarItemBackground = 0x7f01006c;
public static final int actionBarPopupTheme = 0x7f010065;
public static final int actionBarSize = 0x7f01006a;
public static final int actionBarSplitStyle = 0x7f010067;
public static final int actionBarStyle = 0x7f010066;
public static final int actionBarTabBarStyle = 0x7f010061;
public static final int actionBarTabStyle = 0x7f010060;
public static final int actionBarTabTextStyle = 0x7f010062;
public static final int actionBarTheme = 0x7f010068;
public static final int actionBarWidgetTheme = 0x7f010069;
public static final int actionButtonStyle = 0x7f010086;
public static final int actionDropDownStyle = 0x7f010082;
public static final int actionLayout = 0x7f010126;
public static final int actionMenuTextAppearance = 0x7f01006d;
public static final int actionMenuTextColor = 0x7f01006e;
public static final int actionModeBackground = 0x7f010071;
public static final int actionModeCloseButtonStyle = 0x7f010070;
public static final int actionModeCloseDrawable = 0x7f010073;
public static final int actionModeCopyDrawable = 0x7f010075;
public static final int actionModeCutDrawable = 0x7f010074;
public static final int actionModeFindDrawable = 0x7f010079;
public static final int actionModePasteDrawable = 0x7f010076;
public static final int actionModePopupWindowStyle = 0x7f01007b;
public static final int actionModeSelectAllDrawable = 0x7f010077;
public static final int actionModeShareDrawable = 0x7f010078;
public static final int actionModeSplitBackground = 0x7f010072;
public static final int actionModeStyle = 0x7f01006f;
public static final int actionModeWebSearchDrawable = 0x7f01007a;
public static final int actionOverflowButtonStyle = 0x7f010063;
public static final int actionOverflowMenuStyle = 0x7f010064;
public static final int actionProviderClass = 0x7f010128;
public static final int actionViewClass = 0x7f010127;
public static final int activityChooserViewStyle = 0x7f01008e;
public static final int alertDialogButtonGroupStyle = 0x7f0100b2;
public static final int alertDialogCenterButtons = 0x7f0100b3;
public static final int alertDialogStyle = 0x7f0100b1;
public static final int alertDialogTheme = 0x7f0100b4;
public static final int allowStacking = 0x7f0100cd;
public static final int alpha = 0x7f0100ea;
public static final int arrowHeadLength = 0x7f0100fc;
public static final int arrowShaftLength = 0x7f0100fd;
public static final int autoCompleteTextViewStyle = 0x7f0100b9;
public static final int background = 0x7f010031;
public static final int backgroundSplit = 0x7f010033;
public static final int backgroundStacked = 0x7f010032;
public static final int backgroundTint = 0x7f010188;
public static final int backgroundTintMode = 0x7f010189;
public static final int barLength = 0x7f0100fe;
public static final int borderlessButtonStyle = 0x7f01008b;
public static final int buttonBarButtonStyle = 0x7f010088;
public static final int buttonBarNegativeButtonStyle = 0x7f0100b7;
public static final int buttonBarNeutralButtonStyle = 0x7f0100b8;
public static final int buttonBarPositiveButtonStyle = 0x7f0100b6;
public static final int buttonBarStyle = 0x7f010087;
public static final int buttonGravity = 0x7f01017d;
public static final int buttonPanelSideLayout = 0x7f010046;
public static final int buttonStyle = 0x7f0100ba;
public static final int buttonStyleSmall = 0x7f0100bb;
public static final int buttonTint = 0x7f0100eb;
public static final int buttonTintMode = 0x7f0100ec;
public static final int checkboxStyle = 0x7f0100bc;
public static final int checkedTextViewStyle = 0x7f0100bd;
public static final int closeIcon = 0x7f010141;
public static final int closeItemLayout = 0x7f010043;
public static final int collapseContentDescription = 0x7f01017f;
public static final int collapseIcon = 0x7f01017e;
public static final int color = 0x7f0100f8;
public static final int colorAccent = 0x7f0100a9;
public static final int colorBackgroundFloating = 0x7f0100b0;
public static final int colorButtonNormal = 0x7f0100ad;
public static final int colorControlActivated = 0x7f0100ab;
public static final int colorControlHighlight = 0x7f0100ac;
public static final int colorControlNormal = 0x7f0100aa;
public static final int colorPrimary = 0x7f0100a7;
public static final int colorPrimaryDark = 0x7f0100a8;
public static final int colorSwitchThumbNormal = 0x7f0100ae;
public static final int commitIcon = 0x7f010146;
public static final int contentInsetEnd = 0x7f01003c;
public static final int contentInsetEndWithActions = 0x7f010040;
public static final int contentInsetLeft = 0x7f01003d;
public static final int contentInsetRight = 0x7f01003e;
public static final int contentInsetStart = 0x7f01003b;
public static final int contentInsetStartWithNavigation = 0x7f01003f;
public static final int controlBackground = 0x7f0100af;
public static final int customNavigationLayout = 0x7f010034;
public static final int defaultQueryHint = 0x7f010140;
public static final int dialogPreferredPadding = 0x7f010080;
public static final int dialogTheme = 0x7f01007f;
public static final int displayOptions = 0x7f01002a;
public static final int divider = 0x7f010030;
public static final int dividerHorizontal = 0x7f01008d;
public static final int dividerPadding = 0x7f010113;
public static final int dividerVertical = 0x7f01008c;
public static final int drawableSize = 0x7f0100fa;
public static final int drawerArrowStyle = 0x7f010000;
public static final int dropDownListViewStyle = 0x7f01009f;
public static final int dropdownListPreferredItemHeight = 0x7f010083;
public static final int editTextBackground = 0x7f010094;
public static final int editTextColor = 0x7f010093;
public static final int editTextStyle = 0x7f0100be;
public static final int elevation = 0x7f010041;
public static final int expandActivityOverflowButtonDrawable = 0x7f010045;
public static final int gapBetweenBars = 0x7f0100fb;
public static final int goIcon = 0x7f010142;
public static final int height = 0x7f010001;
public static final int hideOnContentScroll = 0x7f01003a;
public static final int homeAsUpIndicator = 0x7f010085;
public static final int homeLayout = 0x7f010035;
public static final int icon = 0x7f01002e;
public static final int iconifiedByDefault = 0x7f01013e;
public static final int imageButtonStyle = 0x7f010095;
public static final int indeterminateProgressStyle = 0x7f010037;
public static final int initialActivityCount = 0x7f010044;
public static final int isLightTheme = 0x7f010002;
public static final int itemPadding = 0x7f010039;
public static final int layout = 0x7f01013d;
public static final int layoutManager = 0x7f010135;
public static final int listChoiceBackgroundIndicator = 0x7f0100a6;
public static final int listDividerAlertDialog = 0x7f010081;
public static final int listItemLayout = 0x7f01004a;
public static final int listLayout = 0x7f010047;
public static final int listMenuViewStyle = 0x7f0100c6;
public static final int listPopupWindowStyle = 0x7f0100a0;
public static final int listPreferredItemHeight = 0x7f01009a;
public static final int listPreferredItemHeightLarge = 0x7f01009c;
public static final int listPreferredItemHeightSmall = 0x7f01009b;
public static final int listPreferredItemPaddingLeft = 0x7f01009d;
public static final int listPreferredItemPaddingRight = 0x7f01009e;
public static final int logo = 0x7f01002f;
public static final int logoDescription = 0x7f010182;
public static final int maxButtonHeight = 0x7f01017c;
public static final int md_background_color = 0x7f010003;
public static final int md_btn_negative_selector = 0x7f010004;
public static final int md_btn_neutral_selector = 0x7f010005;
public static final int md_btn_positive_selector = 0x7f010006;
public static final int md_btn_ripple_color = 0x7f010007;
public static final int md_btn_stacked_selector = 0x7f010008;
public static final int md_btnstacked_gravity = 0x7f010009;
public static final int md_buttons_gravity = 0x7f01000a;
public static final int md_content_color = 0x7f01000b;
public static final int md_content_gravity = 0x7f01000c;
public static final int md_dark_theme = 0x7f01000d;
public static final int md_divider = 0x7f01000e;
public static final int md_divider_color = 0x7f01000f;
public static final int md_icon = 0x7f010010;
public static final int md_icon_limit_icon_to_default_size = 0x7f010011;
public static final int md_icon_max_size = 0x7f010012;
public static final int md_item_color = 0x7f010013;
public static final int md_items_gravity = 0x7f010014;
public static final int md_link_color = 0x7f010015;
public static final int md_list_selector = 0x7f010016;
public static final int md_medium_font = 0x7f010017;
public static final int md_negative_color = 0x7f010018;
public static final int md_neutral_color = 0x7f010019;
public static final int md_positive_color = 0x7f01001a;
public static final int md_reduce_padding_no_title_no_buttons = 0x7f010114;
public static final int md_regular_font = 0x7f01001b;
public static final int md_title_color = 0x7f01001c;
public static final int md_title_gravity = 0x7f01001d;
public static final int md_widget_color = 0x7f01001e;
public static final int measureWithLargestChild = 0x7f010111;
public static final int mpb_progressStyle = 0x7f010120;
public static final int mpb_setBothDrawables = 0x7f010121;
public static final int mpb_showTrack = 0x7f010123;
public static final int mpb_tintMode = 0x7f010124;
public static final int mpb_useIntrinsicPadding = 0x7f010122;
public static final int multiChoiceItemLayout = 0x7f010048;
public static final int navigationContentDescription = 0x7f010181;
public static final int navigationIcon = 0x7f010180;
public static final int navigationMode = 0x7f010029;
public static final int overlapAnchor = 0x7f010131;
public static final int paddingBottomNoButtons = 0x7f010133;
public static final int paddingEnd = 0x7f010186;
public static final int paddingStart = 0x7f010185;
public static final int paddingTopNoTitle = 0x7f010134;
public static final int panelBackground = 0x7f0100a3;
public static final int panelMenuListTheme = 0x7f0100a5;
public static final int panelMenuListWidth = 0x7f0100a4;
public static final int popupMenuStyle = 0x7f010091;
public static final int popupTheme = 0x7f010042;
public static final int popupWindowStyle = 0x7f010092;
public static final int preserveIconSpacing = 0x7f010129;
public static final int progressBarPadding = 0x7f010038;
public static final int progressBarStyle = 0x7f010036;
public static final int queryBackground = 0x7f010148;
public static final int queryHint = 0x7f01013f;
public static final int radioButtonStyle = 0x7f0100bf;
public static final int ratingBarStyle = 0x7f0100c0;
public static final int ratingBarStyleIndicator = 0x7f0100c1;
public static final int ratingBarStyleSmall = 0x7f0100c2;
public static final int reverseLayout = 0x7f010137;
public static final int searchHintIcon = 0x7f010144;
public static final int searchIcon = 0x7f010143;
public static final int searchViewStyle = 0x7f010099;
public static final int seekBarStyle = 0x7f0100c3;
public static final int selectableItemBackground = 0x7f010089;
public static final int selectableItemBackgroundBorderless = 0x7f01008a;
public static final int showAsAction = 0x7f010125;
public static final int showDividers = 0x7f010112;
public static final int showText = 0x7f010155;
public static final int showTitle = 0x7f01004b;
public static final int singleChoiceItemLayout = 0x7f010049;
public static final int spanCount = 0x7f010136;
public static final int spinBars = 0x7f0100f9;
public static final int spinnerDropDownItemStyle = 0x7f010084;
public static final int spinnerStyle = 0x7f0100c4;
public static final int splitTrack = 0x7f010154;
public static final int srcCompat = 0x7f010051;
public static final int stackFromEnd = 0x7f010138;
public static final int state_above_anchor = 0x7f010132;
public static final int subMenuArrow = 0x7f01012a;
public static final int submitBackground = 0x7f010149;
public static final int subtitle = 0x7f01002b;
public static final int subtitleTextAppearance = 0x7f010175;
public static final int subtitleTextColor = 0x7f010184;
public static final int subtitleTextStyle = 0x7f01002d;
public static final int suggestionRowLayout = 0x7f010147;
public static final int switchMinWidth = 0x7f010152;
public static final int switchPadding = 0x7f010153;
public static final int switchStyle = 0x7f0100c5;
public static final int switchTextAppearance = 0x7f010151;
public static final int textAllCaps = 0x7f010055;
public static final int textAppearanceLargePopupMenu = 0x7f01007c;
public static final int textAppearanceListItem = 0x7f0100a1;
public static final int textAppearanceListItemSmall = 0x7f0100a2;
public static final int textAppearancePopupMenuHeader = 0x7f01007e;
public static final int textAppearanceSearchResultSubtitle = 0x7f010097;
public static final int textAppearanceSearchResultTitle = 0x7f010096;
public static final int textAppearanceSmallPopupMenu = 0x7f01007d;
public static final int textColorAlertDialogListItem = 0x7f0100b5;
public static final int textColorSearchUrl = 0x7f010098;
public static final int theme = 0x7f010187;
public static final int thickness = 0x7f0100ff;
public static final int thumbTextPadding = 0x7f010150;
public static final int thumbTint = 0x7f01014b;
public static final int thumbTintMode = 0x7f01014c;
public static final int tickMark = 0x7f010052;
public static final int tickMarkTint = 0x7f010053;
public static final int tickMarkTintMode = 0x7f010054;
public static final int title = 0x7f01001f;
public static final int titleMargin = 0x7f010176;
public static final int titleMarginBottom = 0x7f01017a;
public static final int titleMarginEnd = 0x7f010178;
public static final int titleMarginStart = 0x7f010177;
public static final int titleMarginTop = 0x7f010179;
public static final int titleMargins = 0x7f01017b;
public static final int titleTextAppearance = 0x7f010174;
public static final int titleTextColor = 0x7f010183;
public static final int titleTextStyle = 0x7f01002c;
public static final int toolbarNavigationButtonStyle = 0x7f010090;
public static final int toolbarStyle = 0x7f01008f;
public static final int track = 0x7f01014d;
public static final int trackTint = 0x7f01014e;
public static final int trackTintMode = 0x7f01014f;
public static final int voiceIcon = 0x7f010145;
public static final int windowActionBar = 0x7f010056;
public static final int windowActionBarOverlay = 0x7f010058;
public static final int windowActionModeOverlay = 0x7f010059;
public static final int windowFixedHeightMajor = 0x7f01005d;
public static final int windowFixedHeightMinor = 0x7f01005b;
public static final int windowFixedWidthMajor = 0x7f01005a;
public static final int windowFixedWidthMinor = 0x7f01005c;
public static final int windowMinWidthMajor = 0x7f01005e;
public static final int windowMinWidthMinor = 0x7f01005f;
public static final int windowNoTitle = 0x7f010057;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs = 0x7f0b0000;
public static final int abc_allow_stacked_button_bar = 0x7f0b0002;
public static final int abc_config_actionMenuItemAllCaps = 0x7f0b0003;
public static final int abc_config_closeDialogWhenTouchOutside = 0x7f0b0004;
public static final int abc_config_showMenuShortcutsWhenKeyboardPresent = 0x7f0b0005;
public static final int md_is_tablet = 0x7f0b0001;
}
public static final class color {
public static final int abc_background_cache_hint_selector_material_dark = 0x7f0d019d;
public static final int abc_background_cache_hint_selector_material_light = 0x7f0d019e;
public static final int abc_btn_colored_borderless_text_material = 0x7f0d019f;
public static final int abc_btn_colored_text_material = 0x7f0d01a0;
public static final int abc_color_highlight_material = 0x7f0d01a1;
public static final int abc_hint_foreground_material_dark = 0x7f0d01a2;
public static final int abc_hint_foreground_material_light = 0x7f0d01a3;
public static final int abc_input_method_navigation_guard = 0x7f0d0001;
public static final int abc_primary_text_disable_only_material_dark = 0x7f0d01a4;
public static final int abc_primary_text_disable_only_material_light = 0x7f0d01a5;
public static final int abc_primary_text_material_dark = 0x7f0d01a6;
public static final int abc_primary_text_material_light = 0x7f0d01a7;
public static final int abc_search_url_text = 0x7f0d01a8;
public static final int abc_search_url_text_normal = 0x7f0d0002;
public static final int abc_search_url_text_pressed = 0x7f0d0003;
public static final int abc_search_url_text_selected = 0x7f0d0004;
public static final int abc_secondary_text_material_dark = 0x7f0d01a9;
public static final int abc_secondary_text_material_light = 0x7f0d01aa;
public static final int abc_tint_btn_checkable = 0x7f0d01ab;
public static final int abc_tint_default = 0x7f0d01ac;
public static final int abc_tint_edittext = 0x7f0d01ad;
public static final int abc_tint_seek_thumb = 0x7f0d01ae;
public static final int abc_tint_spinner = 0x7f0d01af;
public static final int abc_tint_switch_thumb = 0x7f0d01b0;
public static final int abc_tint_switch_track = 0x7f0d01b1;
public static final int accent_material_dark = 0x7f0d0006;
public static final int accent_material_light = 0x7f0d0007;
public static final int background_floating_material_dark = 0x7f0d0008;
public static final int background_floating_material_light = 0x7f0d0009;
public static final int background_material_dark = 0x7f0d000a;
public static final int background_material_light = 0x7f0d000b;
public static final int bright_foreground_disabled_material_dark = 0x7f0d000c;
public static final int bright_foreground_disabled_material_light = 0x7f0d000d;
public static final int bright_foreground_inverse_material_dark = 0x7f0d000e;
public static final int bright_foreground_inverse_material_light = 0x7f0d000f;
public static final int bright_foreground_material_dark = 0x7f0d0010;
public static final int bright_foreground_material_light = 0x7f0d0011;
public static final int button_material_dark = 0x7f0d0012;
public static final int button_material_light = 0x7f0d0013;
public static final int dim_foreground_disabled_material_dark = 0x7f0d003a;
public static final int dim_foreground_disabled_material_light = 0x7f0d003b;
public static final int dim_foreground_material_dark = 0x7f0d003c;
public static final int dim_foreground_material_light = 0x7f0d003d;
public static final int foreground_material_dark = 0x7f0d003e;
public static final int foreground_material_light = 0x7f0d003f;
public static final int highlighted_text_material_dark = 0x7f0d0040;
public static final int highlighted_text_material_light = 0x7f0d0041;
public static final int material_blue_grey_800 = 0x7f0d0042;
public static final int material_blue_grey_900 = 0x7f0d0043;
public static final int material_blue_grey_950 = 0x7f0d0044;
public static final int material_deep_teal_200 = 0x7f0d0045;
public static final int material_deep_teal_500 = 0x7f0d0046;
public static final int material_grey_100 = 0x7f0d005f;
public static final int material_grey_300 = 0x7f0d0060;
public static final int material_grey_50 = 0x7f0d0061;
public static final int material_grey_600 = 0x7f0d0062;
public static final int material_grey_800 = 0x7f0d0063;
public static final int material_grey_850 = 0x7f0d0064;
public static final int material_grey_900 = 0x7f0d0065;
public static final int md_btn_selected = 0x7f0d009b;
public static final int md_btn_selected_dark = 0x7f0d009c;
public static final int md_divider_black = 0x7f0d00d1;
public static final int md_divider_white = 0x7f0d00d2;
public static final int md_edittext_error = 0x7f0d00d3;
public static final int md_material_blue_600 = 0x7f0d012f;
public static final int md_material_blue_800 = 0x7f0d0130;
public static final int notification_action_color_filter = 0x7f0d0000;
public static final int notification_icon_bg_color = 0x7f0d0186;
public static final int notification_material_background_media_default_color = 0x7f0d0187;
public static final int primary_dark_material_dark = 0x7f0d018a;
public static final int primary_dark_material_light = 0x7f0d018b;
public static final int primary_material_dark = 0x7f0d018d;
public static final int primary_material_light = 0x7f0d018e;
public static final int primary_text_default_material_dark = 0x7f0d018f;
public static final int primary_text_default_material_light = 0x7f0d0190;
public static final int primary_text_disabled_material_dark = 0x7f0d0191;
public static final int primary_text_disabled_material_light = 0x7f0d0192;
public static final int ripple_material_dark = 0x7f0d0193;
public static final int ripple_material_light = 0x7f0d0194;
public static final int secondary_text_default_material_dark = 0x7f0d0195;
public static final int secondary_text_default_material_light = 0x7f0d0196;
public static final int secondary_text_disabled_material_dark = 0x7f0d0197;
public static final int secondary_text_disabled_material_light = 0x7f0d0198;
public static final int switch_thumb_disabled_material_dark = 0x7f0d0199;
public static final int switch_thumb_disabled_material_light = 0x7f0d019a;
public static final int switch_thumb_material_dark = 0x7f0d01b4;
public static final int switch_thumb_material_light = 0x7f0d01b5;
public static final int switch_thumb_normal_material_dark = 0x7f0d019b;
public static final int switch_thumb_normal_material_light = 0x7f0d019c;
}
public static final class dimen {
public static final int abc_action_bar_content_inset_material = 0x7f090010;
public static final int abc_action_bar_content_inset_with_nav = 0x7f090011;
public static final int abc_action_bar_default_height_material = 0x7f090001;
public static final int abc_action_bar_default_padding_end_material = 0x7f090012;
public static final int abc_action_bar_default_padding_start_material = 0x7f090013;
public static final int abc_action_bar_elevation_material = 0x7f090025;
public static final int abc_action_bar_icon_vertical_padding_material = 0x7f090026;
public static final int abc_action_bar_overflow_padding_end_material = 0x7f090027;
public static final int abc_action_bar_overflow_padding_start_material = 0x7f090028;
public static final int abc_action_bar_progress_bar_size = 0x7f090002;
public static final int abc_action_bar_stacked_max_height = 0x7f090029;
public static final int abc_action_bar_stacked_tab_max_width = 0x7f09002a;
public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f09002b;
public static final int abc_action_bar_subtitle_top_margin_material = 0x7f09002c;
public static final int abc_action_button_min_height_material = 0x7f09002d;
public static final int abc_action_button_min_width_material = 0x7f09002e;
public static final int abc_action_button_min_width_overflow_material = 0x7f09002f;
public static final int abc_alert_dialog_button_bar_height = 0x7f090000;
public static final int abc_button_inset_horizontal_material = 0x7f090030;
public static final int abc_button_inset_vertical_material = 0x7f090031;
public static final int abc_button_padding_horizontal_material = 0x7f090032;
public static final int abc_button_padding_vertical_material = 0x7f090033;
public static final int abc_cascading_menus_min_smallest_width = 0x7f090034;
public static final int abc_config_prefDialogWidth = 0x7f090005;
public static final int abc_control_corner_material = 0x7f090035;
public static final int abc_control_inset_material = 0x7f090036;
public static final int abc_control_padding_material = 0x7f090037;
public static final int abc_dialog_fixed_height_major = 0x7f090006;
public static final int abc_dialog_fixed_height_minor = 0x7f090007;
public static final int abc_dialog_fixed_width_major = 0x7f090008;
public static final int abc_dialog_fixed_width_minor = 0x7f090009;
public static final int abc_dialog_list_padding_bottom_no_buttons = 0x7f090038;
public static final int abc_dialog_list_padding_top_no_title = 0x7f090039;
public static final int abc_dialog_min_width_major = 0x7f09000a;
public static final int abc_dialog_min_width_minor = 0x7f09000b;
public static final int abc_dialog_padding_material = 0x7f09003a;
public static final int abc_dialog_padding_top_material = 0x7f09003b;
public static final int abc_dialog_title_divider_material = 0x7f09003c;
public static final int abc_disabled_alpha_material_dark = 0x7f09003d;
public static final int abc_disabled_alpha_material_light = 0x7f09003e;
public static final int abc_dropdownitem_icon_width = 0x7f09003f;
public static final int abc_dropdownitem_text_padding_left = 0x7f090040;
public static final int abc_dropdownitem_text_padding_right = 0x7f090041;
public static final int abc_edit_text_inset_bottom_material = 0x7f090042;
public static final int abc_edit_text_inset_horizontal_material = 0x7f090043;
public static final int abc_edit_text_inset_top_material = 0x7f090044;
public static final int abc_floating_window_z = 0x7f090045;
public static final int abc_list_item_padding_horizontal_material = 0x7f090046;
public static final int abc_panel_menu_list_width = 0x7f090047;
public static final int abc_progress_bar_height_material = 0x7f090048;
public static final int abc_search_view_preferred_height = 0x7f090049;
public static final int abc_search_view_preferred_width = 0x7f09004a;
public static final int abc_seekbar_track_background_height_material = 0x7f09004b;
public static final int abc_seekbar_track_progress_height_material = 0x7f09004c;
public static final int abc_select_dialog_padding_start_material = 0x7f09004d;
public static final int abc_switch_padding = 0x7f09001f;
public static final int abc_text_size_body_1_material = 0x7f09004e;
public static final int abc_text_size_body_2_material = 0x7f09004f;
public static final int abc_text_size_button_material = 0x7f090050;
public static final int abc_text_size_caption_material = 0x7f090051;
public static final int abc_text_size_display_1_material = 0x7f090052;
public static final int abc_text_size_display_2_material = 0x7f090053;
public static final int abc_text_size_display_3_material = 0x7f090054;
public static final int abc_text_size_display_4_material = 0x7f090055;
public static final int abc_text_size_headline_material = 0x7f090056;
public static final int abc_text_size_large_material = 0x7f090057;
public static final int abc_text_size_medium_material = 0x7f090058;
public static final int abc_text_size_menu_header_material = 0x7f090059;
public static final int abc_text_size_menu_material = 0x7f09005a;
public static final int abc_text_size_small_material = 0x7f09005b;
public static final int abc_text_size_subhead_material = 0x7f09005c;
public static final int abc_text_size_subtitle_material_toolbar = 0x7f090003;
public static final int abc_text_size_title_material = 0x7f09005d;
public static final int abc_text_size_title_material_toolbar = 0x7f090004;
public static final int circular_progress_border = 0x7f090089;
public static final int disabled_alpha_material_dark = 0x7f0900a8;
public static final int disabled_alpha_material_light = 0x7f0900a9;
public static final int highlight_alpha_material_colored = 0x7f0900aa;
public static final int highlight_alpha_material_dark = 0x7f0900ab;
public static final int highlight_alpha_material_light = 0x7f0900ac;
public static final int hint_alpha_material_dark = 0x7f0900ad;
public static final int hint_alpha_material_light = 0x7f0900ae;
public static final int hint_pressed_alpha_material_dark = 0x7f0900af;
public static final int hint_pressed_alpha_material_light = 0x7f0900b0;
public static final int item_touch_helper_max_drag_scroll_per_frame = 0x7f0900b1;
public static final int item_touch_helper_swipe_escape_max_velocity = 0x7f0900b2;
public static final int item_touch_helper_swipe_escape_velocity = 0x7f0900b3;
public static final int md_action_corner_radius = 0x7f0900fe;
public static final int md_bg_corner_radius = 0x7f0900ff;
public static final int md_button_frame_vertical_padding = 0x7f090100;
public static final int md_button_height = 0x7f090101;
public static final int md_button_inset_horizontal = 0x7f090102;
public static final int md_button_inset_vertical = 0x7f090103;
public static final int md_button_min_width = 0x7f090104;
public static final int md_button_padding_frame_side = 0x7f090105;
public static final int md_button_padding_horizontal = 0x7f090106;
public static final int md_button_padding_horizontal_internalexternal = 0x7f090107;
public static final int md_button_padding_vertical = 0x7f090108;
public static final int md_button_textpadding_horizontal = 0x7f090109;
public static final int md_button_textsize = 0x7f09010a;
public static final int md_content_padding_bottom = 0x7f09010b;
public static final int md_content_padding_top = 0x7f09010c;
public static final int md_content_textsize = 0x7f09010d;
public static final int md_dialog_frame_margin = 0x7f09010e;
public static final int md_divider_height = 0x7f09010f;
public static final int md_icon_margin = 0x7f090110;
public static final int md_icon_max_size = 0x7f090111;
public static final int md_listitem_control_margin = 0x7f090112;
public static final int md_listitem_height = 0x7f090113;
public static final int md_listitem_margin_left = 0x7f090114;
public static final int md_listitem_textsize = 0x7f090115;
public static final int md_listitem_vertical_margin = 0x7f090116;
public static final int md_listitem_vertical_margin_choice = 0x7f090117;
public static final int md_neutral_button_margin = 0x7f090118;
public static final int md_notitle_vertical_padding = 0x7f090119;
public static final int md_notitle_vertical_padding_more = 0x7f09011a;
public static final int md_simplelistitem_padding_top = 0x7f09011b;
public static final int md_styled_dialog_header = 0x7f09000c;
public static final int md_styled_pic_size = 0x7f09000d;
public static final int md_styled_text_description = 0x7f09000e;
public static final int md_styled_text_title = 0x7f09000f;
public static final int md_title_frame_margin_bottom = 0x7f09011c;
public static final int md_title_frame_margin_bottom_less = 0x7f09011d;
public static final int md_title_textsize = 0x7f09011e;
public static final int notification_action_icon_size = 0x7f09011f;
public static final int notification_action_text_size = 0x7f090120;
public static final int notification_big_circle_margin = 0x7f090121;
public static final int notification_content_margin_start = 0x7f090020;
public static final int notification_large_icon_height = 0x7f090122;
public static final int notification_large_icon_width = 0x7f090123;
public static final int notification_main_column_padding_top = 0x7f090021;
public static final int notification_media_narrow_margin = 0x7f090022;
public static final int notification_right_icon_size = 0x7f090124;
public static final int notification_right_side_padding_top = 0x7f09001e;
public static final int notification_small_icon_background_padding = 0x7f090125;
public static final int notification_small_icon_size_as_large = 0x7f090126;
public static final int notification_subtext_size = 0x7f090127;
public static final int notification_top_pad = 0x7f090128;
public static final int notification_top_pad_large_text = 0x7f090129;
}
public static final class drawable {
public static final int abc_ab_share_pack_mtrl_alpha = 0x7f020000;
public static final int abc_action_bar_item_background_material = 0x7f020001;
public static final int abc_btn_borderless_material = 0x7f020002;
public static final int abc_btn_check_material = 0x7f020003;
public static final int abc_btn_check_to_on_mtrl_000 = 0x7f020004;
public static final int abc_btn_check_to_on_mtrl_015 = 0x7f020005;
public static final int abc_btn_colored_material = 0x7f020006;
public static final int abc_btn_default_mtrl_shape = 0x7f020007;
public static final int abc_btn_radio_material = 0x7f020008;
public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f020009;
public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f02000a;
public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f02000b;
public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f02000c;
public static final int abc_cab_background_internal_bg = 0x7f02000d;
public static final int abc_cab_background_top_material = 0x7f02000e;
public static final int abc_cab_background_top_mtrl_alpha = 0x7f02000f;
public static final int abc_control_background_material = 0x7f020010;
public static final int abc_dialog_material_background = 0x7f020011;
public static final int abc_edit_text_material = 0x7f020012;
public static final int abc_ic_ab_back_material = 0x7f020013;
public static final int abc_ic_arrow_drop_right_black_24dp = 0x7f020014;
public static final int abc_ic_clear_material = 0x7f020015;
public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f020016;
public static final int abc_ic_go_search_api_material = 0x7f020017;
public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f020018;
public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f020019;
public static final int abc_ic_menu_overflow_material = 0x7f02001a;
public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f02001b;
public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f02001c;
public static final int abc_ic_menu_share_mtrl_alpha = 0x7f02001d;
public static final int abc_ic_search_api_material = 0x7f02001e;
public static final int abc_ic_star_black_16dp = 0x7f02001f;
public static final int abc_ic_star_black_36dp = 0x7f020020;
public static final int abc_ic_star_black_48dp = 0x7f020021;
public static final int abc_ic_star_half_black_16dp = 0x7f020022;
public static final int abc_ic_star_half_black_36dp = 0x7f020023;
public static final int abc_ic_star_half_black_48dp = 0x7f020024;
public static final int abc_ic_voice_search_api_material = 0x7f020025;
public static final int abc_item_background_holo_dark = 0x7f020026;
public static final int abc_item_background_holo_light = 0x7f020027;
public static final int abc_list_divider_mtrl_alpha = 0x7f020028;
public static final int abc_list_focused_holo = 0x7f020029;
public static final int abc_list_longpressed_holo = 0x7f02002a;
public static final int abc_list_pressed_holo_dark = 0x7f02002b;
public static final int abc_list_pressed_holo_light = 0x7f02002c;
public static final int abc_list_selector_background_transition_holo_dark = 0x7f02002d;
public static final int abc_list_selector_background_transition_holo_light = 0x7f02002e;
public static final int abc_list_selector_disabled_holo_dark = 0x7f02002f;
public static final int abc_list_selector_disabled_holo_light = 0x7f020030;
public static final int abc_list_selector_holo_dark = 0x7f020031;
public static final int abc_list_selector_holo_light = 0x7f020032;
public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f020033;
public static final int abc_popup_background_mtrl_mult = 0x7f020034;
public static final int abc_ratingbar_indicator_material = 0x7f020035;
public static final int abc_ratingbar_material = 0x7f020036;
public static final int abc_ratingbar_small_material = 0x7f020037;
public static final int abc_scrubber_control_off_mtrl_alpha = 0x7f020038;
public static final int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f020039;
public static final int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f02003a;
public static final int abc_scrubber_primary_mtrl_alpha = 0x7f02003b;
public static final int abc_scrubber_track_mtrl_alpha = 0x7f02003c;
public static final int abc_seekbar_thumb_material = 0x7f02003d;
public static final int abc_seekbar_tick_mark_material = 0x7f02003e;
public static final int abc_seekbar_track_material = 0x7f02003f;
public static final int abc_spinner_mtrl_am_alpha = 0x7f020040;
public static final int abc_spinner_textfield_background_material = 0x7f020041;
public static final int abc_switch_thumb_material = 0x7f020042;
public static final int abc_switch_track_mtrl_alpha = 0x7f020043;
public static final int abc_tab_indicator_material = 0x7f020044;
public static final int abc_tab_indicator_mtrl_alpha = 0x7f020045;
public static final int abc_text_cursor_material = 0x7f020046;
public static final int abc_text_select_handle_left_mtrl_dark = 0x7f020047;
public static final int abc_text_select_handle_left_mtrl_light = 0x7f020048;
public static final int abc_text_select_handle_middle_mtrl_dark = 0x7f020049;
public static final int abc_text_select_handle_middle_mtrl_light = 0x7f02004a;
public static final int abc_text_select_handle_right_mtrl_dark = 0x7f02004b;
public static final int abc_text_select_handle_right_mtrl_light = 0x7f02004c;
public static final int abc_textfield_activated_mtrl_alpha = 0x7f02004d;
public static final int abc_textfield_default_mtrl_alpha = 0x7f02004e;
public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f02004f;
public static final int abc_textfield_search_default_mtrl_alpha = 0x7f020050;
public static final int abc_textfield_search_material = 0x7f020051;
public static final int abc_vector_test = 0x7f020052;
public static final int md_btn_selected = 0x7f020076;
public static final int md_btn_selected_dark = 0x7f020077;
public static final int md_btn_selector = 0x7f020078;
public static final int md_btn_selector_dark = 0x7f020079;
public static final int md_btn_selector_ripple = 0x7f02007a;
public static final int md_btn_selector_ripple_dark = 0x7f02007b;
public static final int md_btn_shape = 0x7f02007c;
public static final int md_item_selected = 0x7f02007d;
public static final int md_item_selected_dark = 0x7f02007e;
public static final int md_nav_back = 0x7f02007f;
public static final int md_selector = 0x7f020080;
public static final int md_selector_dark = 0x7f020081;
public static final int md_transparent = 0x7f020082;
public static final int notification_action_background = 0x7f02008a;
public static final int notification_bg = 0x7f02008c;
public static final int notification_bg_low = 0x7f02008d;
public static final int notification_bg_low_normal = 0x7f02008e;
public static final int notification_bg_low_pressed = 0x7f02008f;
public static final int notification_bg_normal = 0x7f020090;
public static final int notification_bg_normal_pressed = 0x7f020091;
public static final int notification_icon_background = 0x7f020092;
public static final int notification_template_icon_bg = 0x7f020097;
public static final int notification_template_icon_low_bg = 0x7f020098;
public static final int notification_tile_bg = 0x7f020093;
public static final int notify_panel_notification_icon_bg = 0x7f020094;
}
public static final class id {
public static final int action0 = 0x7f0f00f1;
public static final int action_bar = 0x7f0f007f;
public static final int action_bar_activity_content = 0x7f0f0000;
public static final int action_bar_container = 0x7f0f007e;
public static final int action_bar_root = 0x7f0f007a;
public static final int action_bar_spinner = 0x7f0f0001;
public static final int action_bar_subtitle = 0x7f0f005d;
public static final int action_bar_title = 0x7f0f005c;
public static final int action_container = 0x7f0f00ee;
public static final int action_context_bar = 0x7f0f0080;
public static final int action_divider = 0x7f0f00f5;
public static final int action_image = 0x7f0f00ef;
public static final int action_menu_divider = 0x7f0f0002;
public static final int action_menu_presenter = 0x7f0f0003;
public static final int action_mode_bar = 0x7f0f007c;
public static final int action_mode_bar_stub = 0x7f0f007b;
public static final int action_mode_close_button = 0x7f0f005e;
public static final int action_text = 0x7f0f00f0;
public static final int actions = 0x7f0f00fe;
public static final int activity_chooser_view_content = 0x7f0f005f;
public static final int add = 0x7f0f003a;
public static final int alertTitle = 0x7f0f0073;
public static final int always = 0x7f0f0055;
public static final int beginning = 0x7f0f0051;
public static final int bottom = 0x7f0f0042;
public static final int buttonPanel = 0x7f0f0066;
public static final int cancel_action = 0x7f0f00f2;
public static final int center = 0x7f0f0028;
public static final int checkbox = 0x7f0f0076;
public static final int chronometer = 0x7f0f00fa;
public static final int circular = 0x7f0f0053;
public static final int collapseActionView = 0x7f0f0056;
public static final int contentPanel = 0x7f0f0069;
public static final int custom = 0x7f0f0070;
public static final int customPanel = 0x7f0f006f;
public static final int decor_content_parent = 0x7f0f007d;
public static final int default_activity_button = 0x7f0f0062;
public static final int disableHome = 0x7f0f002e;
public static final int edit_query = 0x7f0f0081;
public static final int end = 0x7f0f0029;
public static final int end_padder = 0x7f0f0104;
public static final int expand_activities_button = 0x7f0f0060;
public static final int expanded_menu = 0x7f0f0075;
public static final int home = 0x7f0f0006;
public static final int homeAsUp = 0x7f0f002f;
public static final int horizontal = 0x7f0f0054;
public static final int icon = 0x7f0f0064;
public static final int icon_group = 0x7f0f00ff;
public static final int ifRoom = 0x7f0f0057;
public static final int image = 0x7f0f0061;
public static final int info = 0x7f0f00fb;
public static final int item_touch_helper_previous_elevation = 0x7f0f0008;
public static final int line1 = 0x7f0f0100;
public static final int line3 = 0x7f0f0102;
public static final int listMode = 0x7f0f002b;
public static final int list_item = 0x7f0f0063;
public static final int main_content = 0x7f0f0105;
public static final int md_buttonDefaultNegative = 0x7f0f00e9;
public static final int md_buttonDefaultNeutral = 0x7f0f00e8;
public static final int md_buttonDefaultPositive = 0x7f0f00ea;
public static final int md_content = 0x7f0f00df;
public static final int md_contentListViewFrame = 0x7f0f00e4;
public static final int md_contentRecyclerView = 0x7f0f00e5;
public static final int md_contentScrollView = 0x7f0f00de;
public static final int md_control = 0x7f0f00e7;
public static final int md_customViewFrame = 0x7f0f00e2;
public static final int md_icon = 0x7f0f00ed;
public static final int md_label = 0x7f0f00eb;
public static final int md_minMax = 0x7f0f00e3;
public static final int md_promptCheckbox = 0x7f0f00e0;
public static final int md_root = 0x7f0f00e1;
public static final int md_styled_dialog_custom_view = 0x7f0f010b;
public static final int md_styled_dialog_description = 0x7f0f010a;
public static final int md_styled_dialog_divider = 0x7f0f010c;
public static final int md_styled_dialog_title = 0x7f0f0109;
public static final int md_styled_header = 0x7f0f0107;
public static final int md_styled_header_color = 0x7f0f0106;
public static final int md_styled_header_pic = 0x7f0f0108;
public static final int md_title = 0x7f0f00e6;
public static final int md_titleFrame = 0x7f0f00ec;
public static final int media_actions = 0x7f0f00f4;
public static final int middle = 0x7f0f0052;
public static final int multiply = 0x7f0f003b;
public static final int never = 0x7f0f0058;
public static final int none = 0x7f0f0030;
public static final int normal = 0x7f0f002c;
public static final int notification_background = 0x7f0f00fc;
public static final int notification_main_column = 0x7f0f00f7;
public static final int notification_main_column_container = 0x7f0f00f6;
public static final int parentPanel = 0x7f0f0068;
public static final int progress_circular = 0x7f0f001f;
public static final int progress_horizontal = 0x7f0f0020;
public static final int radio = 0x7f0f0078;
public static final int right_icon = 0x7f0f00fd;
public static final int right_side = 0x7f0f00f8;
public static final int screen = 0x7f0f003c;
public static final int scrollIndicatorDown = 0x7f0f006e;
public static final int scrollIndicatorUp = 0x7f0f006a;
public static final int scrollView = 0x7f0f006b;
public static final int search_badge = 0x7f0f0083;
public static final int search_bar = 0x7f0f0082;
public static final int search_button = 0x7f0f0084;
public static final int search_close_btn = 0x7f0f0089;
public static final int search_edit_frame = 0x7f0f0085;
public static final int search_go_btn = 0x7f0f008b;
public static final int search_mag_icon = 0x7f0f0086;
public static final int search_plate = 0x7f0f0087;
public static final int search_src_text = 0x7f0f0088;
public static final int search_voice_btn = 0x7f0f008c;
public static final int select_dialog_listview = 0x7f0f008d;
public static final int shortcut = 0x7f0f0077;
public static final int showCustom = 0x7f0f0031;
public static final int showHome = 0x7f0f0032;
public static final int showTitle = 0x7f0f0033;
public static final int spacer = 0x7f0f0067;
public static final int split_action_bar = 0x7f0f0021;
public static final int src_atop = 0x7f0f003d;
public static final int src_in = 0x7f0f003e;
public static final int src_over = 0x7f0f003f;
public static final int start = 0x7f0f002a;
public static final int status_bar_latest_event_content = 0x7f0f00f3;
public static final int submenuarrow = 0x7f0f0079;
public static final int submit_area = 0x7f0f008a;
public static final int tabMode = 0x7f0f002d;
public static final int text = 0x7f0f0103;
public static final int text2 = 0x7f0f0101;
public static final int textSpacerNoButtons = 0x7f0f006d;
public static final int textSpacerNoTitle = 0x7f0f006c;
public static final int time = 0x7f0f00f9;
public static final int title = 0x7f0f0065;
public static final int titleDividerNoCustom = 0x7f0f0074;
public static final int title_template = 0x7f0f0072;
public static final int top = 0x7f0f0048;
public static final int topPanel = 0x7f0f0071;
public static final int up = 0x7f0f0026;
public static final int useLogo = 0x7f0f0034;
public static final int withText = 0x7f0f0059;
public static final int wrap_content = 0x7f0f0040;
}
public static final class integer {
public static final int abc_config_activityDefaultDur = 0x7f0c0001;
public static final int abc_config_activityShortDur = 0x7f0c0002;
public static final int cancel_button_image_alpha = 0x7f0c0005;
public static final int status_bar_notification_info_maxnum = 0x7f0c0008;
}
public static final class layout {
public static final int abc_action_bar_title_item = 0x7f040000;
public static final int abc_action_bar_up_container = 0x7f040001;
public static final int abc_action_bar_view_list_nav_layout = 0x7f040002;
public static final int abc_action_menu_item_layout = 0x7f040003;
public static final int abc_action_menu_layout = 0x7f040004;
public static final int abc_action_mode_bar = 0x7f040005;
public static final int abc_action_mode_close_item_material = 0x7f040006;
public static final int abc_activity_chooser_view = 0x7f040007;
public static final int abc_activity_chooser_view_list_item = 0x7f040008;
public static final int abc_alert_dialog_button_bar_material = 0x7f040009;
public static final int abc_alert_dialog_material = 0x7f04000a;
public static final int abc_alert_dialog_title_material = 0x7f04000b;
public static final int abc_dialog_title_material = 0x7f04000c;
public static final int abc_expanded_menu_layout = 0x7f04000d;
public static final int abc_list_menu_item_checkbox = 0x7f04000e;
public static final int abc_list_menu_item_icon = 0x7f04000f;
public static final int abc_list_menu_item_layout = 0x7f040010;
public static final int abc_list_menu_item_radio = 0x7f040011;
public static final int abc_popup_menu_header_item_layout = 0x7f040012;
public static final int abc_popup_menu_item_layout = 0x7f040013;
public static final int abc_screen_content_include = 0x7f040014;
public static final int abc_screen_simple = 0x7f040015;
public static final int abc_screen_simple_overlay_action_mode = 0x7f040016;
public static final int abc_screen_toolbar = 0x7f040017;
public static final int abc_search_dropdown_item_icons_2line = 0x7f040018;
public static final int abc_search_view = 0x7f040019;
public static final int abc_select_dialog_material = 0x7f04001a;
public static final int md_dialog_basic = 0x7f04004c;
public static final int md_dialog_basic_check = 0x7f04004d;
public static final int md_dialog_custom = 0x7f04004e;
public static final int md_dialog_input = 0x7f04004f;
public static final int md_dialog_input_check = 0x7f040050;
public static final int md_dialog_list = 0x7f040051;
public static final int md_dialog_list_check = 0x7f040052;
public static final int md_dialog_progress = 0x7f040053;
public static final int md_dialog_progress_indeterminate = 0x7f040054;
public static final int md_dialog_progress_indeterminate_horizontal = 0x7f040055;
public static final int md_listitem = 0x7f040056;
public static final int md_listitem_multichoice = 0x7f040057;
public static final int md_listitem_singlechoice = 0x7f040058;
public static final int md_stub_actionbuttons = 0x7f040059;
public static final int md_stub_progress = 0x7f04005a;
public static final int md_stub_progress_indeterminate = 0x7f04005b;
public static final int md_stub_progress_indeterminate_horizontal = 0x7f04005c;
public static final int md_stub_titleframe = 0x7f04005d;
public static final int md_stub_titleframe_lesspadding = 0x7f04005e;
public static final int notification_action = 0x7f04005f;
public static final int notification_action_tombstone = 0x7f040060;
public static final int notification_media_action = 0x7f040061;
public static final int notification_media_cancel_action = 0x7f040062;
public static final int notification_template_big_media = 0x7f040063;
public static final int notification_template_big_media_custom = 0x7f040064;
public static final int notification_template_big_media_narrow = 0x7f040065;
public static final int notification_template_big_media_narrow_custom = 0x7f040066;
public static final int notification_template_custom_big = 0x7f040067;
public static final int notification_template_icon_group = 0x7f040068;
public static final int notification_template_lines_media = 0x7f040069;
public static final int notification_template_media = 0x7f04006a;
public static final int notification_template_media_custom = 0x7f04006b;
public static final int notification_template_part_chronometer = 0x7f04006c;
public static final int notification_template_part_time = 0x7f04006d;
public static final int select_dialog_item_material = 0x7f04006e;
public static final int select_dialog_multichoice_material = 0x7f04006f;
public static final int select_dialog_singlechoice_material = 0x7f040070;
public static final int style_dialog_header_icon = 0x7f040071;
public static final int style_dialog_header_title = 0x7f040072;
public static final int support_simple_spinner_dropdown_item = 0x7f040073;
}
public static final class string {
public static final int abc_action_bar_home_description = 0x7f080000;
public static final int abc_action_bar_home_description_format = 0x7f080001;
public static final int abc_action_bar_home_subtitle_description_format = 0x7f080002;
public static final int abc_action_bar_up_description = 0x7f080003;
public static final int abc_action_menu_overflow_description = 0x7f080004;
public static final int abc_action_mode_done = 0x7f080005;
public static final int abc_activity_chooser_view_see_all = 0x7f080006;
public static final int abc_activitychooserview_choose_application = 0x7f080007;
public static final int abc_capital_off = 0x7f080008;
public static final int abc_capital_on = 0x7f080009;
public static final int abc_font_family_body_1_material = 0x7f080017;
public static final int abc_font_family_body_2_material = 0x7f080018;
public static final int abc_font_family_button_material = 0x7f080019;
public static final int abc_font_family_caption_material = 0x7f08001a;
public static final int abc_font_family_display_1_material = 0x7f08001b;
public static final int abc_font_family_display_2_material = 0x7f08001c;
public static final int abc_font_family_display_3_material = 0x7f08001d;
public static final int abc_font_family_display_4_material = 0x7f08001e;
public static final int abc_font_family_headline_material = 0x7f08001f;
public static final int abc_font_family_menu_material = 0x7f080020;
public static final int abc_font_family_subhead_material = 0x7f080021;
public static final int abc_font_family_title_material = 0x7f080022;
public static final int abc_search_hint = 0x7f08000a;
public static final int abc_searchview_description_clear = 0x7f08000b;
public static final int abc_searchview_description_query = 0x7f08000c;
public static final int abc_searchview_description_search = 0x7f08000d;
public static final int abc_searchview_description_submit = 0x7f08000e;
public static final int abc_searchview_description_voice = 0x7f08000f;
public static final int abc_shareactionprovider_share_with = 0x7f080010;
public static final int abc_shareactionprovider_share_with_application = 0x7f080011;
public static final int abc_toolbar_collapse_description = 0x7f080012;
public static final int define_materialstyleddialogs = 0x7f08002b;
public static final int library_materialstyleddialogs_author = 0x7f080059;
public static final int library_materialstyleddialogs_authorWebsite = 0x7f08005a;
public static final int library_materialstyleddialogs_isOpenSource = 0x7f08005b;
public static final int library_materialstyleddialogs_libraryDescription = 0x7f08005c;
public static final int library_materialstyleddialogs_libraryName = 0x7f08005d;
public static final int library_materialstyleddialogs_libraryWebsite = 0x7f08005e;
public static final int library_materialstyleddialogs_licenseId = 0x7f08005f;
public static final int library_materialstyleddialogs_repositoryLink = 0x7f080060;
public static final int search_menu_title = 0x7f080013;
public static final int status_bar_notification_info_overflow = 0x7f080014;
}
public static final class style {
public static final int AlertDialog_AppCompat = 0x7f0a00c0;
public static final int AlertDialog_AppCompat_Light = 0x7f0a00c1;
public static final int Animation_AppCompat_Dialog = 0x7f0a00c2;
public static final int Animation_AppCompat_DropDownUp = 0x7f0a00c3;
public static final int Base_AlertDialog_AppCompat = 0x7f0a00c5;
public static final int Base_AlertDialog_AppCompat_Light = 0x7f0a00c6;
public static final int Base_Animation_AppCompat_Dialog = 0x7f0a00c7;
public static final int Base_Animation_AppCompat_DropDownUp = 0x7f0a00c8;
public static final int Base_DialogWindowTitleBackground_AppCompat = 0x7f0a00cb;
public static final int Base_DialogWindowTitle_AppCompat = 0x7f0a00ca;
public static final int Base_TextAppearance_AppCompat = 0x7f0a0058;
public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f0a0059;
public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f0a005a;
public static final int Base_TextAppearance_AppCompat_Button = 0x7f0a003c;
public static final int Base_TextAppearance_AppCompat_Caption = 0x7f0a005b;
public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f0a005c;
public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f0a005d;
public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f0a005e;
public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f0a005f;
public static final int Base_TextAppearance_AppCompat_Headline = 0x7f0a0060;
public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f0a0014;
public static final int Base_TextAppearance_AppCompat_Large = 0x7f0a0061;
public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f0a0015;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0a0062;
public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0a0063;
public static final int Base_TextAppearance_AppCompat_Medium = 0x7f0a0064;
public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f0a0016;
public static final int Base_TextAppearance_AppCompat_Menu = 0x7f0a0065;
public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f0a00cc;
public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0a0066;
public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f0a0067;
public static final int Base_TextAppearance_AppCompat_Small = 0x7f0a0068;
public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f0a0017;
public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f0a0069;
public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f0a0018;
public static final int Base_TextAppearance_AppCompat_Title = 0x7f0a006a;
public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f0a0019;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0a00b4;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0a006b;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0a006c;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0a006d;
public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0a006e;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0a006f;
public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0a0070;
public static final int Base_TextAppearance_AppCompat_Widget_Button = 0x7f0a0071;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0a00bc;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0a00bd;
public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0a00b5;
public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0a00cd;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0a0072;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0a0073;
public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0a0074;
public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f0a0075;
public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0a0076;
public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0a00ce;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0a0077;
public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0a0078;
public static final int Base_ThemeOverlay_AppCompat = 0x7f0a00d3;
public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f0a00d4;
public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f0a00d5;
public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0a00d6;
public static final int Base_ThemeOverlay_AppCompat_Dialog = 0x7f0a0020;
public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0a0021;
public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f0a00d7;
public static final int Base_Theme_AppCompat = 0x7f0a0079;
public static final int Base_Theme_AppCompat_CompactMenu = 0x7f0a00cf;
public static final int Base_Theme_AppCompat_Dialog = 0x7f0a001a;
public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f0a0002;
public static final int Base_Theme_AppCompat_Dialog_Alert = 0x7f0a001b;
public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f0a00d0;
public static final int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f0a001c;
public static final int Base_Theme_AppCompat_Light = 0x7f0a007a;
public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f0a00d1;
public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f0a001d;
public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f0a0003;
public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f0a001e;
public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f0a00d2;
public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0a001f;
public static final int Base_V11_ThemeOverlay_AppCompat_Dialog = 0x7f0a0024;
public static final int Base_V11_Theme_AppCompat_Dialog = 0x7f0a0022;
public static final int Base_V11_Theme_AppCompat_Light_Dialog = 0x7f0a0023;
public static final int Base_V12_Widget_AppCompat_AutoCompleteTextView = 0x7f0a0038;
public static final int Base_V12_Widget_AppCompat_EditText = 0x7f0a0039;
public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 0x7f0a007f;
public static final int Base_V21_Theme_AppCompat = 0x7f0a007b;
public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f0a007c;
public static final int Base_V21_Theme_AppCompat_Light = 0x7f0a007d;
public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f0a007e;
public static final int Base_V22_Theme_AppCompat = 0x7f0a00b2;
public static final int Base_V22_Theme_AppCompat_Light = 0x7f0a00b3;
public static final int Base_V23_Theme_AppCompat = 0x7f0a00b6;
public static final int Base_V23_Theme_AppCompat_Light = 0x7f0a00b7;
public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 0x7f0a00dc;
public static final int Base_V7_Theme_AppCompat = 0x7f0a00d8;
public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f0a00d9;
public static final int Base_V7_Theme_AppCompat_Light = 0x7f0a00da;
public static final int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f0a00db;
public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f0a00dd;
public static final int Base_V7_Widget_AppCompat_EditText = 0x7f0a00de;
public static final int Base_Widget_AppCompat_ActionBar = 0x7f0a00df;
public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f0a00e0;
public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f0a00e1;
public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f0a0080;
public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f0a0081;
public static final int Base_Widget_AppCompat_ActionButton = 0x7f0a0082;
public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f0a0083;
public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f0a0084;
public static final int Base_Widget_AppCompat_ActionMode = 0x7f0a00e2;
public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f0a00e3;
public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f0a003a;
public static final int Base_Widget_AppCompat_Button = 0x7f0a0085;
public static final int Base_Widget_AppCompat_ButtonBar = 0x7f0a0089;
public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0a00e5;
public static final int Base_Widget_AppCompat_Button_Borderless = 0x7f0a0086;
public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f0a0087;
public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0a00e4;
public static final int Base_Widget_AppCompat_Button_Colored = 0x7f0a00b8;
public static final int Base_Widget_AppCompat_Button_Small = 0x7f0a0088;
public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f0a008a;
public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f0a008b;
public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f0a00e6;
public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f0a0000;
public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f0a00e7;
public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f0a008c;
public static final int Base_Widget_AppCompat_EditText = 0x7f0a003b;
public static final int Base_Widget_AppCompat_ImageButton = 0x7f0a008d;
public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f0a00e8;
public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f0a00e9;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0a00ea;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f0a008e;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0a008f;
public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f0a0090;
public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f0a0091;
public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0a0092;
public static final int Base_Widget_AppCompat_ListMenuView = 0x7f0a00eb;
public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f0a0093;
public static final int Base_Widget_AppCompat_ListView = 0x7f0a0094;
public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f0a0095;
public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f0a0096;
public static final int Base_Widget_AppCompat_PopupMenu = 0x7f0a0097;
public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f0a0098;
public static final int Base_Widget_AppCompat_PopupWindow = 0x7f0a00ec;
public static final int Base_Widget_AppCompat_ProgressBar = 0x7f0a0025;
public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f0a0026;
public static final int Base_Widget_AppCompat_RatingBar = 0x7f0a0099;
public static final int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f0a00b9;
public static final int Base_Widget_AppCompat_RatingBar_Small = 0x7f0a00ba;
public static final int Base_Widget_AppCompat_SearchView = 0x7f0a00ed;
public static final int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f0a00ee;
public static final int Base_Widget_AppCompat_SeekBar = 0x7f0a009a;
public static final int Base_Widget_AppCompat_SeekBar_Discrete = 0x7f0a00ef;
public static final int Base_Widget_AppCompat_Spinner = 0x7f0a009b;
public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f0a0004;
public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f0a009c;
public static final int Base_Widget_AppCompat_Toolbar = 0x7f0a00f0;
public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0a009d;
public static final int MD_ActionButton = 0x7f0a00f6;
public static final int MD_ActionButtonStacked = 0x7f0a00f8;
public static final int MD_ActionButton_Text = 0x7f0a00f7;
public static final int MD_Dark = 0x7f0a0027;
public static final int MD_Light = 0x7f0a0028;
public static final int MD_WindowAnimation = 0x7f0a00f9;
public static final int MaterialStyledDialogs_Description = 0x7f0a010d;
public static final int MaterialStyledDialogs_DialogAnimationFast = 0x7f0a010e;
public static final int MaterialStyledDialogs_DialogAnimationNormal = 0x7f0a010f;
public static final int MaterialStyledDialogs_DialogAnimationSlow = 0x7f0a0110;
public static final int MaterialStyledDialogs_Divider = 0x7f0a0111;
public static final int MaterialStyledDialogs_Title = 0x7f0a0112;
public static final int MaterialStyledDialogs_TitleHeader = 0x7f0a0113;
public static final int Platform_AppCompat = 0x7f0a0033;
public static final int Platform_AppCompat_Light = 0x7f0a0034;
public static final int Platform_ThemeOverlay_AppCompat = 0x7f0a00a4;
public static final int Platform_ThemeOverlay_AppCompat_Dark = 0x7f0a00a5;
public static final int Platform_ThemeOverlay_AppCompat_Light = 0x7f0a00a6;
public static final int Platform_V11_AppCompat = 0x7f0a0035;
public static final int Platform_V11_AppCompat_Light = 0x7f0a0036;
public static final int Platform_V14_AppCompat = 0x7f0a003d;
public static final int Platform_V14_AppCompat_Light = 0x7f0a003e;
public static final int Platform_V21_AppCompat = 0x7f0a00a7;
public static final int Platform_V21_AppCompat_Light = 0x7f0a00a8;
public static final int Platform_V25_AppCompat = 0x7f0a00be;
public static final int Platform_V25_AppCompat_Light = 0x7f0a00bf;
public static final int Platform_Widget_AppCompat_Spinner = 0x7f0a0037;
public static final int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f0a0048;
public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f0a0049;
public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f0a004a;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f0a004b;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f0a004c;
public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f0a004d;
public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f0a0053;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f0a004e;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f0a004f;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f0a0050;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f0a0051;
public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f0a0052;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f0a0054;
public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f0a0055;
public static final int TextAppearance_AppCompat = 0x7f0a0118;
public static final int TextAppearance_AppCompat_Body1 = 0x7f0a0119;
public static final int TextAppearance_AppCompat_Body2 = 0x7f0a011a;
public static final int TextAppearance_AppCompat_Button = 0x7f0a011b;
public static final int TextAppearance_AppCompat_Caption = 0x7f0a011c;
public static final int TextAppearance_AppCompat_Display1 = 0x7f0a011d;
public static final int TextAppearance_AppCompat_Display2 = 0x7f0a011e;
public static final int TextAppearance_AppCompat_Display3 = 0x7f0a011f;
public static final int TextAppearance_AppCompat_Display4 = 0x7f0a0120;
public static final int TextAppearance_AppCompat_Headline = 0x7f0a0121;
public static final int TextAppearance_AppCompat_Inverse = 0x7f0a0122;
public static final int TextAppearance_AppCompat_Large = 0x7f0a0123;
public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f0a0124;
public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f0a0125;
public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f0a0126;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0a0127;
public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0a0128;
public static final int TextAppearance_AppCompat_Medium = 0x7f0a0129;
public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f0a012a;
public static final int TextAppearance_AppCompat_Menu = 0x7f0a012b;
public static final int TextAppearance_AppCompat_Notification = 0x7f0a003f;
public static final int TextAppearance_AppCompat_Notification_Info = 0x7f0a00a9;
public static final int TextAppearance_AppCompat_Notification_Info_Media = 0x7f0a00aa;
public static final int TextAppearance_AppCompat_Notification_Line2 = 0x7f0a012c;
public static final int TextAppearance_AppCompat_Notification_Line2_Media = 0x7f0a012d;
public static final int TextAppearance_AppCompat_Notification_Media = 0x7f0a00ab;
public static final int TextAppearance_AppCompat_Notification_Time = 0x7f0a00ac;
public static final int TextAppearance_AppCompat_Notification_Time_Media = 0x7f0a00ad;
public static final int TextAppearance_AppCompat_Notification_Title = 0x7f0a0040;
public static final int TextAppearance_AppCompat_Notification_Title_Media = 0x7f0a00ae;
public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0a012e;
public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f0a012f;
public static final int TextAppearance_AppCompat_Small = 0x7f0a0130;
public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f0a0131;
public static final int TextAppearance_AppCompat_Subhead = 0x7f0a0132;
public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f0a0133;
public static final int TextAppearance_AppCompat_Title = 0x7f0a0134;
public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f0a0135;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0a0136;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0a0137;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0a0138;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0a0139;
public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0a013a;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0a013b;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f0a013c;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0a013d;
public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f0a013e;
public static final int TextAppearance_AppCompat_Widget_Button = 0x7f0a013f;
public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0a0140;
public static final int TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0a0141;
public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0a0142;
public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0a0143;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0a0144;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0a0145;
public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0a0146;
public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f0a0147;
public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0a0148;
public static final int TextAppearance_StatusBar_EventContent = 0x7f0a0041;
public static final int TextAppearance_StatusBar_EventContent_Info = 0x7f0a0042;
public static final int TextAppearance_StatusBar_EventContent_Line2 = 0x7f0a0043;
public static final int TextAppearance_StatusBar_EventContent_Time = 0x7f0a0044;
public static final int TextAppearance_StatusBar_EventContent_Title = 0x7f0a0045;
public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0a0150;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0a0151;
public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0a0152;
public static final int ThemeOverlay_AppCompat = 0x7f0a0167;
public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f0a0168;
public static final int ThemeOverlay_AppCompat_Dark = 0x7f0a0169;
public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0a016a;
public static final int ThemeOverlay_AppCompat_Dialog = 0x7f0a016b;
public static final int ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0a016c;
public static final int ThemeOverlay_AppCompat_Light = 0x7f0a016d;
public static final int Theme_AppCompat = 0x7f0a0153;
public static final int Theme_AppCompat_CompactMenu = 0x7f0a0154;
public static final int Theme_AppCompat_DayNight = 0x7f0a000d;
public static final int Theme_AppCompat_DayNight_DarkActionBar = 0x7f0a000e;
public static final int Theme_AppCompat_DayNight_Dialog = 0x7f0a000f;
public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f0a0012;
public static final int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f0a0010;
public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f0a0011;
public static final int Theme_AppCompat_DayNight_NoActionBar = 0x7f0a0013;
public static final int Theme_AppCompat_Dialog = 0x7f0a0155;
public static final int Theme_AppCompat_DialogWhenLarge = 0x7f0a0158;
public static final int Theme_AppCompat_Dialog_Alert = 0x7f0a0156;
public static final int Theme_AppCompat_Dialog_MinWidth = 0x7f0a0157;
public static final int Theme_AppCompat_Light = 0x7f0a0159;
public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f0a015a;
public static final int Theme_AppCompat_Light_Dialog = 0x7f0a015b;
public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f0a015e;
public static final int Theme_AppCompat_Light_Dialog_Alert = 0x7f0a015c;
public static final int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0a015d;
public static final int Theme_AppCompat_Light_NoActionBar = 0x7f0a015f;
public static final int Theme_AppCompat_NoActionBar = 0x7f0a0160;
public static final int Widget_AppCompat_ActionBar = 0x7f0a016e;
public static final int Widget_AppCompat_ActionBar_Solid = 0x7f0a016f;
public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f0a0170;
public static final int Widget_AppCompat_ActionBar_TabText = 0x7f0a0171;
public static final int Widget_AppCompat_ActionBar_TabView = 0x7f0a0172;
public static final int Widget_AppCompat_ActionButton = 0x7f0a0173;
public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f0a0174;
public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f0a0175;
public static final int Widget_AppCompat_ActionMode = 0x7f0a0176;
public static final int Widget_AppCompat_ActivityChooserView = 0x7f0a0177;
public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f0a0178;
public static final int Widget_AppCompat_Button = 0x7f0a0179;
public static final int Widget_AppCompat_ButtonBar = 0x7f0a017f;
public static final int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0a0180;
public static final int Widget_AppCompat_Button_Borderless = 0x7f0a017a;
public static final int Widget_AppCompat_Button_Borderless_Colored = 0x7f0a017b;
public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0a017c;
public static final int Widget_AppCompat_Button_Colored = 0x7f0a017d;
public static final int Widget_AppCompat_Button_Small = 0x7f0a017e;
public static final int Widget_AppCompat_CompoundButton_CheckBox = 0x7f0a0181;
public static final int Widget_AppCompat_CompoundButton_RadioButton = 0x7f0a0182;
public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f0a0183;
public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f0a0184;
public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f0a0185;
public static final int Widget_AppCompat_EditText = 0x7f0a0186;
public static final int Widget_AppCompat_ImageButton = 0x7f0a0187;
public static final int Widget_AppCompat_Light_ActionBar = 0x7f0a0188;
public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f0a0189;
public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f0a018a;
public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0a018b;
public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f0a018c;
public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f0a018d;
public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0a018e;
public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f0a018f;
public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f0a0190;
public static final int Widget_AppCompat_Light_ActionButton = 0x7f0a0191;
public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f0a0192;
public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f0a0193;
public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f0a0194;
public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f0a0195;
public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f0a0196;
public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f0a0197;
public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f0a0198;
public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f0a0199;
public static final int Widget_AppCompat_Light_PopupMenu = 0x7f0a019a;
public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0a019b;
public static final int Widget_AppCompat_Light_SearchView = 0x7f0a019c;
public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f0a019d;
public static final int Widget_AppCompat_ListMenuView = 0x7f0a019e;
public static final int Widget_AppCompat_ListPopupWindow = 0x7f0a019f;
public static final int Widget_AppCompat_ListView = 0x7f0a01a0;
public static final int Widget_AppCompat_ListView_DropDown = 0x7f0a01a1;
public static final int Widget_AppCompat_ListView_Menu = 0x7f0a01a2;
public static final int Widget_AppCompat_NotificationActionContainer = 0x7f0a00af;
public static final int Widget_AppCompat_NotificationActionText = 0x7f0a00b0;
public static final int Widget_AppCompat_PopupMenu = 0x7f0a01a3;
public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f0a01a4;
public static final int Widget_AppCompat_PopupWindow = 0x7f0a01a5;
public static final int Widget_AppCompat_ProgressBar = 0x7f0a01a6;
public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f0a01a7;
public static final int Widget_AppCompat_RatingBar = 0x7f0a01a8;
public static final int Widget_AppCompat_RatingBar_Indicator = 0x7f0a01a9;
public static final int Widget_AppCompat_RatingBar_Small = 0x7f0a01aa;
public static final int Widget_AppCompat_SearchView = 0x7f0a01ab;
public static final int Widget_AppCompat_SearchView_ActionBar = 0x7f0a01ac;
public static final int Widget_AppCompat_SeekBar = 0x7f0a01ad;
public static final int Widget_AppCompat_SeekBar_Discrete = 0x7f0a01ae;
public static final int Widget_AppCompat_Spinner = 0x7f0a01af;
public static final int Widget_AppCompat_Spinner_DropDown = 0x7f0a01b0;
public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f0a01b1;
public static final int Widget_AppCompat_Spinner_Underlined = 0x7f0a01b2;
public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f0a01b3;
public static final int Widget_AppCompat_Toolbar = 0x7f0a01b4;
public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0a01b5;
public static final int Widget_MaterialProgressBar_ProgressBar = 0x7f0a0046;
public static final int Widget_MaterialProgressBar_ProgressBar_Horizontal = 0x7f0a0047;
public static final int Widget_MaterialProgressBar_ProgressBar_Horizontal_NoPadding = 0x7f0a01bf;
public static final int Widget_MaterialProgressBar_ProgressBar_Large = 0x7f0a01c0;
public static final int Widget_MaterialProgressBar_ProgressBar_Large_NoPadding = 0x7f0a01c1;
public static final int Widget_MaterialProgressBar_ProgressBar_NoPadding = 0x7f0a01c2;
public static final int Widget_MaterialProgressBar_ProgressBar_Small = 0x7f0a01c3;
public static final int Widget_MaterialProgressBar_ProgressBar_Small_NoPadding = 0x7f0a01c4;
}
public static final class styleable {
public static final int[] ActionBar = { 0x7f010001, 0x7f01001f, 0x7f010029, 0x7f01002a, 0x7f01002b, 0x7f01002c, 0x7f01002d, 0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031, 0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035, 0x7f010036, 0x7f010037, 0x7f010038, 0x7f010039, 0x7f01003a, 0x7f01003b, 0x7f01003c, 0x7f01003d, 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041, 0x7f010042, 0x7f010085 };
public static final int[] ActionBarLayout = { 0x010100b3 };
public static final int ActionBarLayout_android_layout_gravity = 0;
public static final int ActionBar_background = 10;
public static final int ActionBar_backgroundSplit = 12;
public static final int ActionBar_backgroundStacked = 11;
public static final int ActionBar_contentInsetEnd = 21;
public static final int ActionBar_contentInsetEndWithActions = 25;
public static final int ActionBar_contentInsetLeft = 22;
public static final int ActionBar_contentInsetRight = 23;
public static final int ActionBar_contentInsetStart = 20;
public static final int ActionBar_contentInsetStartWithNavigation = 24;
public static final int ActionBar_customNavigationLayout = 13;
public static final int ActionBar_displayOptions = 3;
public static final int ActionBar_divider = 9;
public static final int ActionBar_elevation = 26;
public static final int ActionBar_height = 0;
public static final int ActionBar_hideOnContentScroll = 19;
public static final int ActionBar_homeAsUpIndicator = 28;
public static final int ActionBar_homeLayout = 14;
public static final int ActionBar_icon = 7;
public static final int ActionBar_indeterminateProgressStyle = 16;
public static final int ActionBar_itemPadding = 18;
public static final int ActionBar_logo = 8;
public static final int ActionBar_navigationMode = 2;
public static final int ActionBar_popupTheme = 27;
public static final int ActionBar_progressBarPadding = 17;
public static final int ActionBar_progressBarStyle = 15;
public static final int ActionBar_subtitle = 4;
public static final int ActionBar_subtitleTextStyle = 6;
public static final int ActionBar_title = 1;
public static final int ActionBar_titleTextStyle = 5;
public static final int[] ActionMenuItemView = { 0x0101013f };
public static final int ActionMenuItemView_android_minWidth = 0;
public static final int[] ActionMenuView = { };
public static final int[] ActionMode = { 0x7f010001, 0x7f01002c, 0x7f01002d, 0x7f010031, 0x7f010033, 0x7f010043 };
public static final int ActionMode_background = 3;
public static final int ActionMode_backgroundSplit = 4;
public static final int ActionMode_closeItemLayout = 5;
public static final int ActionMode_height = 0;
public static final int ActionMode_subtitleTextStyle = 2;
public static final int ActionMode_titleTextStyle = 1;
public static final int[] ActivityChooserView = { 0x7f010044, 0x7f010045 };
public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1;
public static final int ActivityChooserView_initialActivityCount = 0;
public static final int[] AlertDialog = { 0x010100f2, 0x7f010046, 0x7f010047, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b };
public static final int AlertDialog_android_layout = 0;
public static final int AlertDialog_buttonPanelSideLayout = 1;
public static final int AlertDialog_listItemLayout = 5;
public static final int AlertDialog_listLayout = 2;
public static final int AlertDialog_multiChoiceItemLayout = 3;
public static final int AlertDialog_showTitle = 6;
public static final int AlertDialog_singleChoiceItemLayout = 4;
public static final int[] AppCompatImageView = { 0x01010119, 0x7f010051 };
public static final int AppCompatImageView_android_src = 0;
public static final int AppCompatImageView_srcCompat = 1;
public static final int[] AppCompatSeekBar = { 0x01010142, 0x7f010052, 0x7f010053, 0x7f010054 };
public static final int AppCompatSeekBar_android_thumb = 0;
public static final int AppCompatSeekBar_tickMark = 1;
public static final int AppCompatSeekBar_tickMarkTint = 2;
public static final int AppCompatSeekBar_tickMarkTintMode = 3;
public static final int[] AppCompatTextHelper = { 0x01010034, 0x0101016d, 0x0101016e, 0x0101016f, 0x01010170, 0x01010392, 0x01010393 };
public static final int AppCompatTextHelper_android_drawableBottom = 2;
public static final int AppCompatTextHelper_android_drawableEnd = 6;
public static final int AppCompatTextHelper_android_drawableLeft = 3;
public static final int AppCompatTextHelper_android_drawableRight = 4;
public static final int AppCompatTextHelper_android_drawableStart = 5;
public static final int AppCompatTextHelper_android_drawableTop = 1;
public static final int AppCompatTextHelper_android_textAppearance = 0;
public static final int[] AppCompatTextView = { 0x01010034, 0x7f010055 };
public static final int AppCompatTextView_android_textAppearance = 0;
public static final int AppCompatTextView_textAllCaps = 1;
public static final int[] AppCompatTheme = { 0x01010057, 0x010100ae, 0x7f010056, 0x7f010057, 0x7f010058, 0x7f010059, 0x7f01005a, 0x7f01005b, 0x7f01005c, 0x7f01005d, 0x7f01005e, 0x7f01005f, 0x7f010060, 0x7f010061, 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066, 0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a, 0x7f01006b, 0x7f01006c, 0x7f01006d, 0x7f01006e, 0x7f01006f, 0x7f010070, 0x7f010071, 0x7f010072, 0x7f010073, 0x7f010074, 0x7f010075, 0x7f010076, 0x7f010077, 0x7f010078, 0x7f010079, 0x7f01007a, 0x7f01007b, 0x7f01007c, 0x7f01007d, 0x7f01007e, 0x7f01007f, 0x7f010080, 0x7f010081, 0x7f010082, 0x7f010083, 0x7f010084, 0x7f010085, 0x7f010086, 0x7f010087, 0x7f010088, 0x7f010089, 0x7f01008a, 0x7f01008b, 0x7f01008c, 0x7f01008d, 0x7f01008e, 0x7f01008f, 0x7f010090, 0x7f010091, 0x7f010092, 0x7f010093, 0x7f010094, 0x7f010095, 0x7f010096, 0x7f010097, 0x7f010098, 0x7f010099, 0x7f01009a, 0x7f01009b, 0x7f01009c, 0x7f01009d, 0x7f01009e, 0x7f01009f, 0x7f0100a0, 0x7f0100a1, 0x7f0100a2, 0x7f0100a3, 0x7f0100a4, 0x7f0100a5, 0x7f0100a6, 0x7f0100a7, 0x7f0100a8, 0x7f0100a9, 0x7f0100aa, 0x7f0100ab, 0x7f0100ac, 0x7f0100ad, 0x7f0100ae, 0x7f0100af, 0x7f0100b0, 0x7f0100b1, 0x7f0100b2, 0x7f0100b3, 0x7f0100b4, 0x7f0100b5, 0x7f0100b6, 0x7f0100b7, 0x7f0100b8, 0x7f0100b9, 0x7f0100ba, 0x7f0100bb, 0x7f0100bc, 0x7f0100bd, 0x7f0100be, 0x7f0100bf, 0x7f0100c0, 0x7f0100c1, 0x7f0100c2, 0x7f0100c3, 0x7f0100c4, 0x7f0100c5, 0x7f0100c6 };
public static final int AppCompatTheme_actionBarDivider = 23;
public static final int AppCompatTheme_actionBarItemBackground = 24;
public static final int AppCompatTheme_actionBarPopupTheme = 17;
public static final int AppCompatTheme_actionBarSize = 22;
public static final int AppCompatTheme_actionBarSplitStyle = 19;
public static final int AppCompatTheme_actionBarStyle = 18;
public static final int AppCompatTheme_actionBarTabBarStyle = 13;
public static final int AppCompatTheme_actionBarTabStyle = 12;
public static final int AppCompatTheme_actionBarTabTextStyle = 14;
public static final int AppCompatTheme_actionBarTheme = 20;
public static final int AppCompatTheme_actionBarWidgetTheme = 21;
public static final int AppCompatTheme_actionButtonStyle = 50;
public static final int AppCompatTheme_actionDropDownStyle = 46;
public static final int AppCompatTheme_actionMenuTextAppearance = 25;
public static final int AppCompatTheme_actionMenuTextColor = 26;
public static final int AppCompatTheme_actionModeBackground = 29;
public static final int AppCompatTheme_actionModeCloseButtonStyle = 28;
public static final int AppCompatTheme_actionModeCloseDrawable = 31;
public static final int AppCompatTheme_actionModeCopyDrawable = 33;
public static final int AppCompatTheme_actionModeCutDrawable = 32;
public static final int AppCompatTheme_actionModeFindDrawable = 37;
public static final int AppCompatTheme_actionModePasteDrawable = 34;
public static final int AppCompatTheme_actionModePopupWindowStyle = 39;
public static final int AppCompatTheme_actionModeSelectAllDrawable = 35;
public static final int AppCompatTheme_actionModeShareDrawable = 36;
public static final int AppCompatTheme_actionModeSplitBackground = 30;
public static final int AppCompatTheme_actionModeStyle = 27;
public static final int AppCompatTheme_actionModeWebSearchDrawable = 38;
public static final int AppCompatTheme_actionOverflowButtonStyle = 15;
public static final int AppCompatTheme_actionOverflowMenuStyle = 16;
public static final int AppCompatTheme_activityChooserViewStyle = 58;
public static final int AppCompatTheme_alertDialogButtonGroupStyle = 94;
public static final int AppCompatTheme_alertDialogCenterButtons = 95;
public static final int AppCompatTheme_alertDialogStyle = 93;
public static final int AppCompatTheme_alertDialogTheme = 96;
public static final int AppCompatTheme_android_windowAnimationStyle = 1;
public static final int AppCompatTheme_android_windowIsFloating = 0;
public static final int AppCompatTheme_autoCompleteTextViewStyle = 101;
public static final int AppCompatTheme_borderlessButtonStyle = 55;
public static final int AppCompatTheme_buttonBarButtonStyle = 52;
public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 99;
public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 100;
public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 98;
public static final int AppCompatTheme_buttonBarStyle = 51;
public static final int AppCompatTheme_buttonStyle = 102;
public static final int AppCompatTheme_buttonStyleSmall = 103;
public static final int AppCompatTheme_checkboxStyle = 104;
public static final int AppCompatTheme_checkedTextViewStyle = 105;
public static final int AppCompatTheme_colorAccent = 85;
public static final int AppCompatTheme_colorBackgroundFloating = 92;
public static final int AppCompatTheme_colorButtonNormal = 89;
public static final int AppCompatTheme_colorControlActivated = 87;
public static final int AppCompatTheme_colorControlHighlight = 88;
public static final int AppCompatTheme_colorControlNormal = 86;
public static final int AppCompatTheme_colorPrimary = 83;
public static final int AppCompatTheme_colorPrimaryDark = 84;
public static final int AppCompatTheme_colorSwitchThumbNormal = 90;
public static final int AppCompatTheme_controlBackground = 91;
public static final int AppCompatTheme_dialogPreferredPadding = 44;
public static final int AppCompatTheme_dialogTheme = 43;
public static final int AppCompatTheme_dividerHorizontal = 57;
public static final int AppCompatTheme_dividerVertical = 56;
public static final int AppCompatTheme_dropDownListViewStyle = 75;
public static final int AppCompatTheme_dropdownListPreferredItemHeight = 47;
public static final int AppCompatTheme_editTextBackground = 64;
public static final int AppCompatTheme_editTextColor = 63;
public static final int AppCompatTheme_editTextStyle = 106;
public static final int AppCompatTheme_homeAsUpIndicator = 49;
public static final int AppCompatTheme_imageButtonStyle = 65;
public static final int AppCompatTheme_listChoiceBackgroundIndicator = 82;
public static final int AppCompatTheme_listDividerAlertDialog = 45;
public static final int AppCompatTheme_listMenuViewStyle = 114;
public static final int AppCompatTheme_listPopupWindowStyle = 76;
public static final int AppCompatTheme_listPreferredItemHeight = 70;
public static final int AppCompatTheme_listPreferredItemHeightLarge = 72;
public static final int AppCompatTheme_listPreferredItemHeightSmall = 71;
public static final int AppCompatTheme_listPreferredItemPaddingLeft = 73;
public static final int AppCompatTheme_listPreferredItemPaddingRight = 74;
public static final int AppCompatTheme_panelBackground = 79;
public static final int AppCompatTheme_panelMenuListTheme = 81;
public static final int AppCompatTheme_panelMenuListWidth = 80;
public static final int AppCompatTheme_popupMenuStyle = 61;
public static final int AppCompatTheme_popupWindowStyle = 62;
public static final int AppCompatTheme_radioButtonStyle = 107;
public static final int AppCompatTheme_ratingBarStyle = 108;
public static final int AppCompatTheme_ratingBarStyleIndicator = 109;
public static final int AppCompatTheme_ratingBarStyleSmall = 110;
public static final int AppCompatTheme_searchViewStyle = 69;
public static final int AppCompatTheme_seekBarStyle = 111;
public static final int AppCompatTheme_selectableItemBackground = 53;
public static final int AppCompatTheme_selectableItemBackgroundBorderless = 54;
public static final int AppCompatTheme_spinnerDropDownItemStyle = 48;
public static final int AppCompatTheme_spinnerStyle = 112;
public static final int AppCompatTheme_switchStyle = 113;
public static final int AppCompatTheme_textAppearanceLargePopupMenu = 40;
public static final int AppCompatTheme_textAppearanceListItem = 77;
public static final int AppCompatTheme_textAppearanceListItemSmall = 78;
public static final int AppCompatTheme_textAppearancePopupMenuHeader = 42;
public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 67;
public static final int AppCompatTheme_textAppearanceSearchResultTitle = 66;
public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 41;
public static final int AppCompatTheme_textColorAlertDialogListItem = 97;
public static final int AppCompatTheme_textColorSearchUrl = 68;
public static final int AppCompatTheme_toolbarNavigationButtonStyle = 60;
public static final int AppCompatTheme_toolbarStyle = 59;
public static final int AppCompatTheme_windowActionBar = 2;
public static final int AppCompatTheme_windowActionBarOverlay = 4;
public static final int AppCompatTheme_windowActionModeOverlay = 5;
public static final int AppCompatTheme_windowFixedHeightMajor = 9;
public static final int AppCompatTheme_windowFixedHeightMinor = 7;
public static final int AppCompatTheme_windowFixedWidthMajor = 6;
public static final int AppCompatTheme_windowFixedWidthMinor = 8;
public static final int AppCompatTheme_windowMinWidthMajor = 10;
public static final int AppCompatTheme_windowMinWidthMinor = 11;
public static final int AppCompatTheme_windowNoTitle = 3;
public static final int[] ButtonBarLayout = { 0x7f0100cd };
public static final int ButtonBarLayout_allowStacking = 0;
public static final int[] ColorStateListItem = { 0x010101a5, 0x0101031f, 0x7f0100ea };
public static final int ColorStateListItem_alpha = 2;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_android_color = 0;
public static final int[] CompoundButton = { 0x01010107, 0x7f0100eb, 0x7f0100ec };
public static final int CompoundButton_android_button = 0;
public static final int CompoundButton_buttonTint = 1;
public static final int CompoundButton_buttonTintMode = 2;
public static final int[] DrawerArrowToggle = { 0x7f0100f8, 0x7f0100f9, 0x7f0100fa, 0x7f0100fb, 0x7f0100fc, 0x7f0100fd, 0x7f0100fe, 0x7f0100ff };
public static final int DrawerArrowToggle_arrowHeadLength = 4;
public static final int DrawerArrowToggle_arrowShaftLength = 5;
public static final int DrawerArrowToggle_barLength = 6;
public static final int DrawerArrowToggle_color = 0;
public static final int DrawerArrowToggle_drawableSize = 2;
public static final int DrawerArrowToggle_gapBetweenBars = 3;
public static final int DrawerArrowToggle_spinBars = 1;
public static final int DrawerArrowToggle_thickness = 7;
public static final int[] LinearLayoutCompat = { 0x010100af, 0x010100c4, 0x01010126, 0x01010127, 0x01010128, 0x7f010030, 0x7f010111, 0x7f010112, 0x7f010113 };
public static final int[] LinearLayoutCompat_Layout = { 0x010100b3, 0x010100f4, 0x010100f5, 0x01010181 };
public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0;
public static final int LinearLayoutCompat_Layout_android_layout_height = 2;
public static final int LinearLayoutCompat_Layout_android_layout_weight = 3;
public static final int LinearLayoutCompat_Layout_android_layout_width = 1;
public static final int LinearLayoutCompat_android_baselineAligned = 2;
public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3;
public static final int LinearLayoutCompat_android_gravity = 0;
public static final int LinearLayoutCompat_android_orientation = 1;
public static final int LinearLayoutCompat_android_weightSum = 4;
public static final int LinearLayoutCompat_divider = 5;
public static final int LinearLayoutCompat_dividerPadding = 8;
public static final int LinearLayoutCompat_measureWithLargestChild = 6;
public static final int LinearLayoutCompat_showDividers = 7;
public static final int[] ListPopupWindow = { 0x010102ac, 0x010102ad };
public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0;
public static final int ListPopupWindow_android_dropDownVerticalOffset = 1;
public static final int[] MDRootLayout = { 0x7f010114 };
public static final int MDRootLayout_md_reduce_padding_no_title_no_buttons = 0;
public static final int[] MaterialProgressBar = { 0x01010121, 0x7f010120, 0x7f010121, 0x7f010122, 0x7f010123, 0x7f010124 };
public static final int MaterialProgressBar_android_tint = 0;
public static final int MaterialProgressBar_mpb_progressStyle = 1;
public static final int MaterialProgressBar_mpb_setBothDrawables = 2;
public static final int MaterialProgressBar_mpb_showTrack = 4;
public static final int MaterialProgressBar_mpb_tintMode = 5;
public static final int MaterialProgressBar_mpb_useIntrinsicPadding = 3;
public static final int[] MenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 };
public static final int MenuGroup_android_checkableBehavior = 5;
public static final int MenuGroup_android_enabled = 0;
public static final int MenuGroup_android_id = 1;
public static final int MenuGroup_android_menuCategory = 3;
public static final int MenuGroup_android_orderInCategory = 4;
public static final int MenuGroup_android_visible = 2;
public static final int[] MenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x7f010125, 0x7f010126, 0x7f010127, 0x7f010128 };
public static final int MenuItem_actionLayout = 14;
public static final int MenuItem_actionProviderClass = 16;
public static final int MenuItem_actionViewClass = 15;
public static final int MenuItem_android_alphabeticShortcut = 9;
public static final int MenuItem_android_checkable = 11;
public static final int MenuItem_android_checked = 3;
public static final int MenuItem_android_enabled = 1;
public static final int MenuItem_android_icon = 0;
public static final int MenuItem_android_id = 2;
public static final int MenuItem_android_menuCategory = 5;
public static final int MenuItem_android_numericShortcut = 10;
public static final int MenuItem_android_onClick = 12;
public static final int MenuItem_android_orderInCategory = 6;
public static final int MenuItem_android_title = 7;
public static final int MenuItem_android_titleCondensed = 8;
public static final int MenuItem_android_visible = 4;
public static final int MenuItem_showAsAction = 13;
public static final int[] MenuView = { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x7f010129, 0x7f01012a };
public static final int MenuView_android_headerBackground = 4;
public static final int MenuView_android_horizontalDivider = 2;
public static final int MenuView_android_itemBackground = 5;
public static final int MenuView_android_itemIconDisabledAlpha = 6;
public static final int MenuView_android_itemTextAppearance = 1;
public static final int MenuView_android_verticalDivider = 3;
public static final int MenuView_android_windowAnimationStyle = 0;
public static final int MenuView_preserveIconSpacing = 7;
public static final int MenuView_subMenuArrow = 8;
public static final int[] PopupWindow = { 0x01010176, 0x010102c9, 0x7f010131 };
public static final int[] PopupWindowBackgroundState = { 0x7f010132 };
public static final int PopupWindowBackgroundState_state_above_anchor = 0;
public static final int PopupWindow_android_popupAnimationStyle = 1;
public static final int PopupWindow_android_popupBackground = 0;
public static final int PopupWindow_overlapAnchor = 2;
public static final int[] RecycleListView = { 0x7f010133, 0x7f010134 };
public static final int RecycleListView_paddingBottomNoButtons = 0;
public static final int RecycleListView_paddingTopNoTitle = 1;
public static final int[] RecyclerView = { 0x010100c4, 0x010100f1, 0x7f010135, 0x7f010136, 0x7f010137, 0x7f010138 };
public static final int RecyclerView_android_descendantFocusability = 1;
public static final int RecyclerView_android_orientation = 0;
public static final int RecyclerView_layoutManager = 2;
public static final int RecyclerView_reverseLayout = 4;
public static final int RecyclerView_spanCount = 3;
public static final int RecyclerView_stackFromEnd = 5;
public static final int[] SearchView = { 0x010100da, 0x0101011f, 0x01010220, 0x01010264, 0x7f01013d, 0x7f01013e, 0x7f01013f, 0x7f010140, 0x7f010141, 0x7f010142, 0x7f010143, 0x7f010144, 0x7f010145, 0x7f010146, 0x7f010147, 0x7f010148, 0x7f010149 };
public static final int SearchView_android_focusable = 0;
public static final int SearchView_android_imeOptions = 3;
public static final int SearchView_android_inputType = 2;
public static final int SearchView_android_maxWidth = 1;
public static final int SearchView_closeIcon = 8;
public static final int SearchView_commitIcon = 13;
public static final int SearchView_defaultQueryHint = 7;
public static final int SearchView_goIcon = 9;
public static final int SearchView_iconifiedByDefault = 5;
public static final int SearchView_layout = 4;
public static final int SearchView_queryBackground = 15;
public static final int SearchView_queryHint = 6;
public static final int SearchView_searchHintIcon = 11;
public static final int SearchView_searchIcon = 10;
public static final int SearchView_submitBackground = 16;
public static final int SearchView_suggestionRowLayout = 14;
public static final int SearchView_voiceIcon = 12;
public static final int[] Spinner = { 0x010100b2, 0x01010176, 0x0101017b, 0x01010262, 0x7f010042 };
public static final int Spinner_android_dropDownWidth = 3;
public static final int Spinner_android_entries = 0;
public static final int Spinner_android_popupBackground = 1;
public static final int Spinner_android_prompt = 2;
public static final int Spinner_popupTheme = 4;
public static final int[] SwitchCompat = { 0x01010124, 0x01010125, 0x01010142, 0x7f01014b, 0x7f01014c, 0x7f01014d, 0x7f01014e, 0x7f01014f, 0x7f010150, 0x7f010151, 0x7f010152, 0x7f010153, 0x7f010154, 0x7f010155 };
public static final int SwitchCompat_android_textOff = 1;
public static final int SwitchCompat_android_textOn = 0;
public static final int SwitchCompat_android_thumb = 2;
public static final int SwitchCompat_showText = 13;
public static final int SwitchCompat_splitTrack = 12;
public static final int SwitchCompat_switchMinWidth = 10;
public static final int SwitchCompat_switchPadding = 11;
public static final int SwitchCompat_switchTextAppearance = 9;
public static final int SwitchCompat_thumbTextPadding = 8;
public static final int SwitchCompat_thumbTint = 3;
public static final int SwitchCompat_thumbTintMode = 4;
public static final int SwitchCompat_track = 5;
public static final int SwitchCompat_trackTint = 6;
public static final int SwitchCompat_trackTintMode = 7;
public static final int[] TextAppearance = { 0x01010095, 0x01010096, 0x01010097, 0x01010098, 0x0101009a, 0x01010161, 0x01010162, 0x01010163, 0x01010164, 0x7f010055 };
public static final int TextAppearance_android_shadowColor = 5;
public static final int TextAppearance_android_shadowDx = 6;
public static final int TextAppearance_android_shadowDy = 7;
public static final int TextAppearance_android_shadowRadius = 8;
public static final int TextAppearance_android_textColor = 3;
public static final int TextAppearance_android_textColorHint = 4;
public static final int TextAppearance_android_textSize = 0;
public static final int TextAppearance_android_textStyle = 2;
public static final int TextAppearance_android_typeface = 1;
public static final int TextAppearance_textAllCaps = 9;
public static final int[] Toolbar = { 0x010100af, 0x01010140, 0x7f01001f, 0x7f01002b, 0x7f01002f, 0x7f01003b, 0x7f01003c, 0x7f01003d, 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010042, 0x7f010174, 0x7f010175, 0x7f010176, 0x7f010177, 0x7f010178, 0x7f010179, 0x7f01017a, 0x7f01017b, 0x7f01017c, 0x7f01017d, 0x7f01017e, 0x7f01017f, 0x7f010180, 0x7f010181, 0x7f010182, 0x7f010183, 0x7f010184 };
public static final int Toolbar_android_gravity = 0;
public static final int Toolbar_android_minHeight = 1;
public static final int Toolbar_buttonGravity = 21;
public static final int Toolbar_collapseContentDescription = 23;
public static final int Toolbar_collapseIcon = 22;
public static final int Toolbar_contentInsetEnd = 6;
public static final int Toolbar_contentInsetEndWithActions = 10;
public static final int Toolbar_contentInsetLeft = 7;
public static final int Toolbar_contentInsetRight = 8;
public static final int Toolbar_contentInsetStart = 5;
public static final int Toolbar_contentInsetStartWithNavigation = 9;
public static final int Toolbar_logo = 4;
public static final int Toolbar_logoDescription = 26;
public static final int Toolbar_maxButtonHeight = 20;
public static final int Toolbar_navigationContentDescription = 25;
public static final int Toolbar_navigationIcon = 24;
public static final int Toolbar_popupTheme = 11;
public static final int Toolbar_subtitle = 3;
public static final int Toolbar_subtitleTextAppearance = 13;
public static final int Toolbar_subtitleTextColor = 28;
public static final int Toolbar_title = 2;
public static final int Toolbar_titleMargin = 14;
public static final int Toolbar_titleMarginBottom = 18;
public static final int Toolbar_titleMarginEnd = 16;
public static final int Toolbar_titleMarginStart = 15;
public static final int Toolbar_titleMarginTop = 17;
public static final int Toolbar_titleMargins = 19;
public static final int Toolbar_titleTextAppearance = 12;
public static final int Toolbar_titleTextColor = 27;
public static final int[] View = { 0x01010000, 0x010100da, 0x7f010185, 0x7f010186, 0x7f010187 };
public static final int[] ViewBackgroundHelper = { 0x010100d4, 0x7f010188, 0x7f010189 };
public static final int ViewBackgroundHelper_android_background = 0;
public static final int ViewBackgroundHelper_backgroundTint = 1;
public static final int ViewBackgroundHelper_backgroundTintMode = 2;
public static final int[] ViewStubCompat = { 0x010100d0, 0x010100f2, 0x010100f3 };
public static final int ViewStubCompat_android_id = 0;
public static final int ViewStubCompat_android_inflatedId = 2;
public static final int ViewStubCompat_android_layout = 1;
public static final int View_android_focusable = 1;
public static final int View_android_theme = 0;
public static final int View_paddingEnd = 3;
public static final int View_paddingStart = 2;
public static final int View_theme = 4;
}
}
| [
"thoughtscode@gmail.com"
] | thoughtscode@gmail.com |
e274b5b726125f0a64b55a75a50f7d295a0fa80b | ea6655a6471ff9aac6f500ecfb9ebcd05447242a | /src/main/java/servlet/IndexServ.java | 226f4c3788b7d68b0e0722afea756fcf6c265ef5 | [] | no_license | kunisue/kuniJenkins | 4f442b1e3b39141e47ac35e407e308541daeb2d0 | dddac9bb391dab809287224331b6c632c2dfe3b6 | refs/heads/master | 2021-01-22T21:07:04.838066 | 2017-03-19T09:57:45 | 2017-03-19T09:57:45 | 85,392,512 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 808 | java | package servlet;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import util.KuniUtils;
public class IndexServ extends HttpServlet {
private static final long serialversionUID = -1L;
/**
* doget
* @param req req
* @param res res
* @throws ServletException ServletException
* @throws IOException IOException
*/
public void doget(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
System.out.println(KuniUtils.getMsg("abc"));
String disp = "/index.jsp";
RequestDispatcher dispatch = req.getRequestDispatcher(disp);
dispatch.forward(req, res);
}
}
| [
"kunitatu777@gmail.com"
] | kunitatu777@gmail.com |
1a08a09180d7e48237b5265edab83c14e4bd04e1 | 0da97d140179cf72c408c1da530a72eeb5e64830 | /msgpack-java-modified/src/main/java/org/msgpack/template/CharacterTemplate.java | ed1a58ca155bded3ac1e130f8554bce342b75b11 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | bachden/msgpack-java-modified | b69044a76cdf1c1ce82b02962b6f088b2f606cd4 | 2ca437b4d989895c9861f59041522680bc2d93e4 | refs/heads/master | 2021-01-20T14:58:57.957891 | 2018-09-10T11:02:11 | 2018-09-10T11:02:11 | 90,699,563 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,613 | java | //
// MessagePack for Java
//
// Copyright (C) 2009 - 2013 FURUHASHI Sadayuki
//
// 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.msgpack.template;
import java.io.IOException;
import org.msgpack.MessageTypeException;
import org.msgpack.packer.Packer;
import org.msgpack.unpacker.Unpacker;
/**
* CharacterTemplate<br/>
*
* @author watabiki
*/
public class CharacterTemplate extends AbstractTemplate<Character> {
private CharacterTemplate() {
}
@Override
public void write(Packer pk, Character target, boolean required) throws IOException {
if (target == null) {
if (required) {
throw new MessageTypeException("Attempted to write null");
}
pk.writeNil();
return;
}
pk.write((int) (char) target);
}
@Override
public Character read(Unpacker u, Character to, boolean required) throws IOException {
if (!required && u.trySkipNil()) {
return null;
}
return (char) u.readInt();
}
static public CharacterTemplate getInstance() {
return instance;
}
static final CharacterTemplate instance = new CharacterTemplate();
}
| [
"hoangbach.bk@gmail.com"
] | hoangbach.bk@gmail.com |
b174b79ff6d98ae0d547035706f9cd192569903b | 4d0f2d62d1c156d936d028482561585207fb1e49 | /Ma nguon/zcs-8.0.2_GA_5570-src/ZimbraSoap/src/java/com/zimbra/soap/voice/message/GetVoiceFeaturesResponse.java | 5e6fc285c6b56a6ffcf9301d5dc49c908e50d5df | [] | no_license | vuhung/06-email-captinh | e3f0ff2e84f1c2bc6bdd6e4167cd7107ec42c0bd | af828ac73fc8096a3cc096806c8080e54d41251f | refs/heads/master | 2020-07-08T09:09:19.146159 | 2013-05-18T12:57:24 | 2013-05-18T12:57:24 | 32,319,083 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,714 | java | /*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2012 Zimbra, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.zimbra.com/license.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* ***** END LICENSE BLOCK *****
*/
package com.zimbra.soap.voice.message;
import com.google.common.base.Objects;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.zimbra.common.soap.VoiceConstants;
import com.zimbra.soap.voice.type.PhoneVoiceFeaturesInfo;
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name=VoiceConstants.E_GET_VOICE_FEATURES_RESPONSE)
public class GetVoiceFeaturesResponse {
/**
* @zm-api-field-description Phone voice feature information
*/
@XmlElement(name=VoiceConstants.E_PHONE /* phone */, required=false)
private PhoneVoiceFeaturesInfo phone;
public GetVoiceFeaturesResponse() {
}
public void setPhone(PhoneVoiceFeaturesInfo phone) { this.phone = phone; }
public PhoneVoiceFeaturesInfo getPhone() { return phone; }
public Objects.ToStringHelper addToStringInfo(Objects.ToStringHelper helper) {
return helper
.add("phone", phone);
}
@Override
public String toString() {
return addToStringInfo(Objects.toStringHelper(this)).toString();
}
}
| [
"vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931"
] | vuhung16plus@gmail.com@ec614674-f94a-24a8-de76-55dc00f2b931 |
764d579e4944822b18a0f88d11782a74639a3ce8 | 3186c0750b0eb76ea7ddddaf706f7e6fe91ed331 | /animsurfacedemo/src/main/java/com/bruce/open/animationsurfaceview/lib/IAnimationStrategy.java | 4b5b5617f293d77ceafa750ffd3a03a66c7aac2f | [] | no_license | AsaLynn/Fishpond | 9506d0beae4604762f7ec2e4a548e94e3e518840 | b9a92e407a0a45eb98d00db425612b3aac8c2e44 | refs/heads/master | 2023-06-09T20:34:10.597859 | 2021-07-05T06:56:34 | 2021-07-05T06:56:34 | 370,896,466 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package com.bruce.open.animationsurfaceview.lib;
/**
* Created by qizhenghao on 15-11-9.
*/
public interface IAnimationStrategy {
void compute();
boolean doing();
void start();
double getX();
double getY();
void cancel();
}
| [
"zhangxiaoning@ubetween.com"
] | zhangxiaoning@ubetween.com |
9b4e206c739a57fc6960aceea0ac4142894d4e95 | 82fc0df9d0faed1cb7e8d00bc25dee7ae496c537 | /yingu-poc-common/src/main/java/com/yingu/poc/common/utils/JaxbDateSerializer.java | d099384ec711e5e9a3f3ed44de3d9bf831b6715f | [] | no_license | yezhihun/poc | e74dec49c5847e46d995361c300d6f2b5befd4a1 | 03b68b00b2d9ce55ee294f35e44b52963517990e | refs/heads/master | 2020-01-23T21:58:59.776011 | 2016-11-25T02:59:08 | 2016-11-25T02:59:09 | 74,719,876 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package com.yingu.poc.common.utils;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class JaxbDateSerializer extends XmlAdapter<String, Date>{
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Override
public Date unmarshal(String date) throws Exception {
return dateFormat.parse(date);
}
@Override
public String marshal(Date date) throws Exception {
return dateFormat.format(date);
}
}
| [
"tianye3@yingu.com"
] | tianye3@yingu.com |
71d976ac86fcd21c8b6377eaf75cc6077e81451f | fe0edab66c7bf301658f00588b2b669a4bae1460 | /Crypto HQ/app/src/main/java/drapps/cryptoheadquarters/models/GeneralResponse.java | f47c43a2c603a5605888ddbe5931ebbb6bc899dc | [] | no_license | DiogoR93/Project | c9a6d5ba243b7f53276f6c66613ab141b028a54c | 339d5b06bdb838c92ce4affe8f1f9256a29d164d | refs/heads/master | 2021-04-28T02:46:22.598884 | 2018-03-09T00:25:30 | 2018-03-09T00:25:30 | 122,121,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | package drapps.cryptoheadquarters.models;
import org.json.JSONObject;
/**
* Created by Diogo on 02/02/2018.
*/
public class GeneralResponse {
JSONObject result;
public JSONObject getResult() {
return result;
}
}
| [
"diogo@petable.care"
] | diogo@petable.care |
5a694d42e025399a05a948949a499450f0a0fab2 | 6bac7e67ee89008df5fc536f9a5baa7a86c4f867 | /src/by/it/moiseyenko/calculator/Var.java | 0744015529f13e47216119ea2c0118cb932b3e57 | [] | no_license | HutnikMaksim/forMaxim | 68ae3dcd284b763c74ef9849e04584e0d0e21d69 | 78929763c6b0c11e89d3f2a87ff04c9aa8895700 | refs/heads/master | 2023-07-02T07:25:41.272877 | 2021-08-01T20:18:37 | 2021-08-01T20:18:37 | 340,015,431 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,584 | java | package by.it.moiseyenko.calculator;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public abstract class Var implements Operation {
private static Map<String, Var> varMap = new HashMap<>();
static Var createVar(String strVar) {
if (strVar.matches(Patterns.SCALAR)) {
return new Scalar(strVar);
} else if (strVar.matches(Patterns.VECTOR)) {
return new Vector(strVar);
} else if (strVar.matches(Patterns.MATRIX)) {
return new Matrix(strVar);
} else {
Var var = varMap.get(strVar);
if (Objects.isNull(var)) {
System.out.println("Unknow variable: " + strVar);
}
return var;
}
}
public static Var save(String name, Var value) {
varMap.put(name, value);
return value;
}
@Override
public Var add(Var other) {
//TODO create exception
System.out.printf("Operation %s + %s impossible\n", this, other);
return null;
}
@Override
public Var sub(Var other) {
System.out.printf("Operation %s - %s impossible\n", this, other);
return null;
}
@Override
public Var mul(Var other) {
System.out.printf("Operation %s * %s impossible\n", this, other);
return null;
}
@Override
public Var div(Var other) {
System.out.printf("Operation %s / %s impossible\n", this, other);
return null;
}
@Override
public String toString() {
return "abstract Var";
}
}
| [
"5700753@gmail.com"
] | 5700753@gmail.com |
cb486d99184ea814178d92ad74077abb23ef79ae | 622259e01d8555d552ddeba045fafe6624d80312 | /edu.harvard.i2b2.eclipse.plugins.querytool/src/edu/harvard/i2b2/eclipse/plugins/querytool/z/tests/CustomExpandBar.java | 14a04ee4d73f0920ea29a4da685cdf2f1553d960 | [] | no_license | kmullins/i2b2-workbench-old | 93c8e7a3ec7fc70b68c4ce0ae9f2f2c5101f5774 | 8144b0b62924fa8a0e4076bf9672033bdff3b1ff | refs/heads/master | 2021-05-30T01:06:11.258874 | 2015-11-05T18:00:58 | 2015-11-05T18:00:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,987 | java | package edu.harvard.i2b2.eclipse.plugins.querytool.z.tests;
import java.util.Random;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import edu.harvard.i2b2.eclipse.plugins.querytool.ui.utils.Colors;
import edu.harvard.i2b2.eclipse.plugins.querytool.ui.utils.DaemonThreadFactory;
import edu.harvard.i2b2.eclipse.plugins.querytool.ui.utils.FormDataMaker;
public class CustomExpandBar extends Composite
{
private static final Random RANDOM = new Random();
private ScheduledExecutorService myAnimationExecutor = Executors.newSingleThreadScheduledExecutor( new DaemonThreadFactory() );
private ScheduledFuture <?> myFuture = null;
private boolean isMoving = false;
private Label myLabel;
private boolean isExpanded = false;
private int contractedHeight = 0;
private int expandedHeight = 0;
public CustomExpandBar(Composite parent, int style, String name)
{
super(parent, style);
setupUI( name );
attachListeners();
}
private void setupUI( String name )
{
this.setBackground( Colors.DARK_GRAY );
this.setLayout( new FormLayout() );
Composite labelComposite = new Composite( this, SWT.NONE );
labelComposite.setLayout( new FormLayout() );
labelComposite.setLayoutData( FormDataMaker.makeFormData(0, (Integer)null, 0, 100));
myLabel = new Label( labelComposite, SWT.NONE );
myLabel.setText( name );
//myLabel.setBackground( Colors.DUCKLING_FEATHER );
myLabel.setForeground( Colors.BLACK );
myLabel.setLayoutData( FormDataMaker.makeFormData(0, 0, (Integer)null, 0, 0, 0, 100, 0) );
contractedHeight = myLabel.computeSize( SWT.DEFAULT, SWT.DEFAULT).y;
int numComps = RANDOM.nextInt(4) + 1;
Control previousControl = labelComposite;
for ( int i = 0; i < numComps; i++ )
{
Composite comp = new Composite( this, SWT.BORDER );
FormData compFD = FormDataMaker.makeFormData( previousControl, 2, (Integer)null, 0, 0, 30, 100, -4);
compFD.height = 30;
comp.setLayoutData( compFD );
comp.setBackground( Colors.WHITE );
previousControl = comp;
}
myLabel.setText( name + " (" + numComps + ")" );
expandedHeight = this.computeSize( SWT.DEFAULT, SWT.DEFAULT).y;
}
private void attachListeners()
{
MouseAdapter clicker = new MouseAdapter()
{
@Override
public void mouseDown(MouseEvent e)
{
if ( isMoving )
return; // don't do anything if it's already expanding/contracting
isMoving = true;
if (isExpanded)
contract();
else
expand();
}
};
this.addMouseListener( clicker );
myLabel.addMouseListener( clicker );
}
public int getPreferredContractedHeight()
{ return this.contractedHeight; }
public void expand()
{
isExpanded = true;
final Runnable expandAction = new Runnable()
{
int counter = 0;
@Override
public void run()
{
Display.getDefault().asyncExec( new Runnable()
{
@Override
public void run()
{
FormData fd = (FormData)CustomExpandBar.this.getLayoutData();
if ( fd.height >= expandedHeight )
{
myFuture.cancel( true );
isMoving = false;
counter = 0;
return;
}
int distance = (int)(expandedHeight/(Math.pow(2, counter+1)));
fd.height = Math.min( (fd.height + distance), expandedHeight);
CustomExpandBar.this.getParent().layout();
if ( counter < 9)
counter++;
else
counter = 0;
}
});
}
};
myFuture = myAnimationExecutor.scheduleAtFixedRate( expandAction, 0, 30, TimeUnit.MILLISECONDS );
}
public void contract()
{
isExpanded = false;
final Runnable contractAction = new Runnable()
{
int contractionStep = (expandedHeight - contractedHeight)/4 + 1;
@Override
public void run()
{
Display.getDefault().asyncExec( new Runnable()
{
@Override
public void run()
{
FormData fd = (FormData)CustomExpandBar.this.getLayoutData();
if ( fd.height <= contractedHeight )
{
myFuture.cancel( true );
isMoving = false;
return;
}
fd.height = Math.max( fd.height - contractionStep, contractedHeight);
CustomExpandBar.this.getParent().layout();
}
});
}
};
myFuture = myAnimationExecutor.scheduleAtFixedRate( contractAction, 0, 30, TimeUnit.MILLISECONDS );
}
}
| [
"Janice@phs000774.partners.org"
] | Janice@phs000774.partners.org |
9a56c5ed570b4ed4a1157b729ce44c05f00059ed | dfa447387b9f1897a95649af8ba6e89104818fbe | /app/src/main/java/com/marina/empresas/DadosEmpresas.java | 9adb0775c021cd1858700226341727076c0c0e73 | [] | no_license | alcantaara/Empresa | 2c27e5cf43e81713d00eee6d8a456c2f26466be6 | 79940818500559cf6c12cd8a34cd4253fac9c179 | refs/heads/master | 2020-03-28T06:30:56.935242 | 2018-09-07T15:16:08 | 2018-09-07T15:16:08 | 147,840,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | package com.marina.empresas;
import android.content.Intent;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toolbar;
public class DadosEmpresas extends AppCompatActivity {
private TextView dados;
private String detalhesEmpresa;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dados_empresas);
dados = (TextView) findViewById(R.id.textoEmpresa);
detalhesEmpresa = getIntent().getStringExtra("descricao").toString();
dados.setText(detalhesEmpresa);
final ActionBar toolbar = getSupportActionBar();
toolbar.setBackgroundDrawable(getResources().getDrawable(R.drawable.gradiente));
toolbar.setTitle(getIntent().getStringExtra("nome").toString());
toolbar.setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onOptionsItemSelected(MenuItem menu) {
Intent i = new Intent(getApplicationContext(), HomeActivity.class);
finish();
return true;
}
}
| [
"mari.alcantaara@gmail.com"
] | mari.alcantaara@gmail.com |
0afd1e55c7fc8ba31406f61cd62125bfa2aa4e31 | 93246556077149d41b4e6c8d526772737dd86b4d | /tekArchMarDemo/src/assignments/Test.java | f9c47f241c7834d02e0637ac1f087732fa974385 | [] | no_license | jyothip15/TeKArchMarDemo | 8ab93935f55ddc8e0079946daab6971605600596 | aaeceb3f3ab0155e1a549daa6ee8f81f1527f041 | refs/heads/master | 2023-05-15T19:05:53.458284 | 2021-06-15T02:46:07 | 2021-06-15T02:46:07 | 377,015,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package assignments;
/*
* Q16. Write a method that will remove given character from the String?
package hackathon;
*/
import java.util.Arrays;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner inputScan = new Scanner(System.in);
System.out.println("enter the string");
String str = inputScan.nextLine();
System.out.println("enter the char");
String ch = inputScan.nextLine();
if(str.contains(ch)) {
str = str.replace(ch, "");
System.out.println(str);
}
else {
System.out.println("The given character "+ch+" is Not present");
}
}
}
| [
"ananthsanoj@gmail.com"
] | ananthsanoj@gmail.com |
c866ea64989b2ac0291195dbecb8c023b4f8f1b2 | 23e86cb2e07cd6713f9efa58eac408ba9259d3bb | /src/main/java/com/gak/hospital/repository/MedicalRepository.java | 00de693db08e7ca61050e5e833162bc920e5730f | [] | no_license | silkmeloni/hospital-1 | 13e4ef504b5bc3257e13c0c1e355101c77c91834 | 602fe578998f2890a62c869f44da50b7c4dc3124 | refs/heads/master | 2023-06-18T03:51:11.175894 | 2021-07-08T16:50:07 | 2021-07-08T16:50:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package com.gak.hospital.repository;
import com.gak.hospital.entity.Medical;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
public interface MedicalRepository extends JpaRepository<Medical, Integer> {
Page<Medical> findMedicalByMedicalNameLike(String medicalName, Pageable pageable);
@Transactional
void deleteMedicalByMedicalIdIn(List<Integer> ids);
Medical findMedicalByMedicalId(int id);
}
| [
"930926134@qq.com"
] | 930926134@qq.com |
2e54dde3ac9bf6b2ec5a7be4f02c950f9e60a945 | ec54227838066a55a7258002d23c0ec79b509da4 | /app/src/main/java/com/osama/retrofitexample/model/Movie.java | a3de6b00645b3d2c1588ecd38c5895f97d1cca8a | [] | no_license | osama1malik/RetrofitExample | e402af313b1e98d066774c1bd57bbac3c9415125 | 2635e9ad45a8186319aa782b4b01e624d729bb48 | refs/heads/master | 2022-12-01T17:15:51.910257 | 2020-08-05T02:07:41 | 2020-08-05T02:07:41 | 285,150,281 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,620 | java | package com.osama.retrofitexample.model;
import java.util.ArrayList;
import java.util.List;
public class Movie {
private String posterPath;
private boolean adult;
private String overview;
private String releaseDate;
private List<Integer> genreIds = new ArrayList<Integer>();
private Integer id;
private String originalTitle;
private String originalLanguage;
private String title;
private String backdropPath;
private Double popularity;
private Integer voteCount;
private Boolean video;
private Double voteAverage;
public Movie(String posterPath, boolean adult, String overview, String releaseDate, List<Integer> genreIds, Integer id, String originalTitle, String originalLanguage, String title, String backdropPath, Double popularity, Integer voteCount, Boolean video, Double voteAverage) {
this.posterPath = posterPath;
this.adult = adult;
this.overview = overview;
this.releaseDate = releaseDate;
this.genreIds = genreIds;
this.id = id;
this.originalTitle = originalTitle;
this.originalLanguage = originalLanguage;
this.title = title;
this.backdropPath = backdropPath;
this.popularity = popularity;
this.voteCount = voteCount;
this.video = video;
this.voteAverage = voteAverage;
}
public String getPosterPath() {
return posterPath;
}
public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
public boolean isAdult() {
return adult;
}
public void setAdult(boolean adult) {
this.adult = adult;
}
public String getOverview() {
return overview;
}
public void setOverview(String overview) {
this.overview = overview;
}
public String getReleaseDate() {
return releaseDate;
}
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public List<Integer> getGenreIds() {
return genreIds;
}
public void setGenreIds(List<Integer> genreIds) {
this.genreIds = genreIds;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOriginalTitle() {
return originalTitle;
}
public void setOriginalTitle(String originalTitle) {
this.originalTitle = originalTitle;
}
public String getOriginalLanguage() {
return originalLanguage;
}
public void setOriginalLanguage(String originalLanguage) {
this.originalLanguage = originalLanguage;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBackdropPath() {
return backdropPath;
}
public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}
public Double getPopularity() {
return popularity;
}
public void setPopularity(Double popularity) {
this.popularity = popularity;
}
public Integer getVoteCount() {
return voteCount;
}
public void setVoteCount(Integer voteCount) {
this.voteCount = voteCount;
}
public Boolean getVideo() {
return video;
}
public void setVideo(Boolean video) {
this.video = video;
}
public Double getVoteAverage() {
return voteAverage;
}
public void setVoteAverage(Double voteAverage) {
this.voteAverage = voteAverage;
}
}
| [
"osamamumtaz96@gmail.com"
] | osamamumtaz96@gmail.com |
dccc72d4844cdde28e9ab8e3d454411e82ad4499 | c5882608d17b3d056b94108f10a615930563e3be | /src/summary/haesung/example/chapter07/InterfaceTest.java | 50eafc4748c93dd222b8dda7e4fb90f52667db56 | [] | no_license | javastudy20200322/JavaStudy | 91c16f6157845feb4e90e42656534b128b23d430 | a7510573071969682ae2144260245260b29173a4 | refs/heads/master | 2021-04-13T00:49:47.706374 | 2020-06-28T04:46:17 | 2020-06-28T04:46:17 | 249,120,949 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package summary.haesung.example.chapter07;
class A
{
// I๋ฅผ ์์๋ฐ์ ํด๋์ค๋ค์ ๋งค๊ฐ๋ณ์๋ก ์ฌ์ฉํ ์ ์๋ค.
public void autoPlay(I i)
{
i.play();
}
}
interface I
{
public abstract void play();
}
class B implements I
{
public void play()
{
System.out.println("Play in B class");
}
}
class C implements I
{
public void play()
{
System.out.println("Play in C class");
}
}
public class InterfaceTest
{
public static void main(String[] args)
{
A a = new A();
a.autoPlay(new B());
a.autoPlay(new C());
}
}
| [
"pureboyz@DESKTOP-IHF2NE4"
] | pureboyz@DESKTOP-IHF2NE4 |
3d7285bc39b1f75b6c14f5993cfdf8d16b2fcfc2 | 1f65915fd2ff2efb8a6f853855611eeca16b7029 | /src/test/java/de/angermueller/logging/test/LoggerNameFilterTest.java | 6a22793548dc02640159d158bfeadba7f01cf2d1 | [
"Apache-2.0"
] | permissive | angermueller/loggername-filter | 8e8ba7f8b269492334f50ff1c90add4a618485dc | 339741749d7f70a1b8007f6ad1808c8c659227b4 | refs/heads/master | 2020-05-29T15:12:34.643976 | 2016-08-07T18:29:37 | 2016-08-07T18:29:37 | 65,139,908 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,551 | java | package de.angermueller.logging.test;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import de.angermueller.logging.LoggerNameFilter;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.LoggerFactory;
/**
* Test for LoggerNameFilter.<br>
*
* @see de.angermueller.logging.LoggerNameFilter
* @author Stefan Angermüller
*/
public class LoggerNameFilterTest {
private LoggerContext lc;
private QueueAppender queueAppender;
/**
* Setup LoggerContext and QueueAppender
*/
@Before
public void setUp() {
lc = (LoggerContext) LoggerFactory.getILoggerFactory();
lc.start();
queueAppender = new QueueAppender();
queueAppender.setContext(lc);
queueAppender.start();
}
/**
* Stop QueueAppender and LoggerContext
*/
@After
public void tearDown() {
queueAppender.stop();
lc.stop();
}
/**
* Build a logger based on a name.<br>
* Add the queue appender and set level to TRACE.<br>
*
* @param name The name
* @return Logger with the given name
*/
private Logger getLogger(String name) {
Logger logger = (Logger) LoggerFactory.getLogger(name);
logger.addAppender(queueAppender);
logger.setLevel(Level.TRACE);
return logger;
}
/**
* Build a logger based on a class.
* @param clazz The class
* @return The logger
*/
private Logger getLogger(Class<?> clazz) {
Logger logger = (Logger) LoggerFactory.getLogger(clazz);
logger.addAppender(queueAppender);
logger.setLevel(Level.TRACE);
return logger;
}
/**
* Build a LoggerNameFilter with the given overrideLevel and pattern.<br>
* Adds this filter to the QueueAppender and uses the current LoggerContext.<br>
*
* @param overrideLevel The override level
* @param pattern The pattern
* @return The Filter
*/
private LoggerNameFilter buildLoggerNameFilter(Level overrideLevel, String pattern) {
LoggerNameFilter filter = new LoggerNameFilter();
filter.setContext(lc);
filter.setOverrideLevel(overrideLevel);
filter.setRegex(pattern);
queueAppender.addFilter(filter);
filter.start();
return filter;
}
@Test
public void testFilter() throws Exception {
buildLoggerNameFilter(Level.INFO, "de.angermueller.logging.test.*");
Logger privateLogger = getLogger(LoggerNameFilterTest.class);
Logger externalLogger = getLogger(Object.class);
privateLogger.trace("This should be logged");
Assert.assertEquals("privateLogger.trace has NOT been logged", 1, queueAppender.size());
privateLogger.debug("This should be logged");
Assert.assertEquals("privateLogger.debug has NOT been logged", 2, queueAppender.size());
privateLogger.info("This should be logged");
Assert.assertEquals("privateLogger.info has NOT been logged", 3, queueAppender.size());
privateLogger.warn("This should be logged");
Assert.assertEquals("privateLogger.warn has NOT been logged", 4, queueAppender.size());
privateLogger.error("This should be logged");
Assert.assertEquals("privateLogger.error has NOT been logged", 5, queueAppender.size());
externalLogger.trace("This should NOT be logged");
Assert.assertEquals("externalLogger.trace HAS been logged", 5, queueAppender.size());
externalLogger.debug("This should NOT be logged");
Assert.assertEquals("externalLogger.debug HAS been logged", 5, queueAppender.size());
externalLogger.info("This should be logged");
Assert.assertEquals("externalLogger.info has NOT been logged", 6, queueAppender.size());
externalLogger.warn("This should be logged");
Assert.assertEquals("externalLogger.warn has NOT been logged", 7, queueAppender.size());
externalLogger.error("This should be logged");
Assert.assertEquals("externalLogger.error has NOT been logged", 8, queueAppender.size());
}
@Test
public void testSetup() throws Exception {
buildLoggerNameFilter(Level.INFO, ".*");
Logger privateLogger = getLogger(LoggerNameFilterTest.class);
privateLogger.trace("Hello world");
Assert.assertEquals("Setup not working, nothing in queue found", 1, queueAppender.size());
}
}
| [
"stefan.angermueller@data-it-solutions.de"
] | stefan.angermueller@data-it-solutions.de |
7db4aa468acab130c88fcf35ebd36f75bfece871 | f445ac7f2e7963e2a41920d686024f68e7c2278a | /rpc-common/src/main/java/org/cyka/codec/RpcDecoder.java | 6ddd014d9c26b72fe4f5eec18bb186e89ebf5cb5 | [
"WTFPL"
] | permissive | 18801284571/nettyAll | dc204ee5da5bf6c0bbc6f6ca5f0c6a31f3e0f903 | 20817a7340703a5d4145bad917990dc6d7e5b1ce | refs/heads/master | 2023-04-14T08:45:43.488995 | 2021-03-25T06:02:16 | 2021-03-25T06:02:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,075 | java | package org.cyka.codec;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import lombok.extern.slf4j.Slf4j;
import org.cyka.serializer.RpcSerializer;
import java.util.List;
@Slf4j
public class RpcDecoder extends ByteToMessageDecoder {
private final RpcSerializer serializer;
private final Class<?> clazz;
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
if (in.readableBytes() < 4) {
return;
}
in.markReaderIndex();
int dataLength = in.readInt();
if (in.readableBytes() < dataLength) {
// data length is not enough to decode to RpcRequest object
in.resetReaderIndex();
return;
}
byte[] decodeObject = new byte[dataLength];
in.readBytes(decodeObject);
Object data = serializer.deserialize(decodeObject, clazz);
out.add(data);
}
public RpcDecoder(RpcSerializer serializer, Class<?> clazz) {
this.serializer = serializer;
this.clazz = clazz;
}
}
| [
"1354250064mdzz@gmail.com"
] | 1354250064mdzz@gmail.com |
ff1c46a211c9290c133a320c966b49c026d555ca | 2c3aeb8217b7793cfd14cf3f885393113f115a29 | /def/Item.java | 497d57e3b327dea8b7c16ffbe785c2762f517d74 | [] | no_license | epswb/Crinemaft | 282af9005fb5ced1529f170b88ccf9c63f0a9e3e | 948a0124cc89e5ff7f53d01c87617e9123691bdb | refs/heads/master | 2020-04-05T22:49:06.765610 | 2011-11-03T16:37:34 | 2011-11-03T16:37:34 | 2,672,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 164 | java | package def;
class Item
{
public int blockID, anzahl, invPos;
public Item(int b, int q, int iP)
{
blockID = b;
anzahl = q;
invPos = iP;
}
} | [
"FabianHarfst@web.de"
] | FabianHarfst@web.de |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.