query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
TODO Autogenerated method stub
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id) { switch(position) { case 0 : intent = new Intent(HighRankWidget.this,ListViewActivity.class); startActivity(intent); break; case 1 : intent = new Intent(HighRankWidget.this,GalleryActivity.class); startActivity(intent); break; case 2 : intent = new Intent(HighRankWidget.this,GridViewActivity.class); startActivity(intent); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Ctor, initialized with a rng and the order to use
public FqMontgomeryBigInteger(Random random, BigInteger order) { super(random, order); divTwo = order.add(BigInteger.ONE).shiftRight(1); divFour = divTwo.shiftRight(1); qn = order.shiftLeft(order.bitLength()); R = BigInteger.ZERO.setBit(256); n0 = order.negate().modInverse(R); one = R.mod(order); two = multiplyMontgomery(BigInteger.valueOf(2), BigInteger.ONE).mod(order); rBitLen = R.bitLength(); nonmontgomery = new FqBigInteger(rnd, order); single_recycler = new RecycleBin<FqBigIntegerElement, BigInteger>( new FqBigIntegerElement[50], new SingleCreator()); double_recycler = new RecycleBin<FqDoubleBigIntegerElement, BigInteger>( new FqDoubleBigIntegerElement[20], new DoubleCreator()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CellularAutomatonRNG()\n {\n this(DefaultSeedGenerator.getInstance().generateSeed(SEED_SIZE_BYTES));\n }", "public DuelistRNG() {\n this((long) ((Math.random() - 0.5) * 0x10000000000000L)\n ^ (long) (((Math.random() - 0.5) * 2.0) * 0x8000000000000000L),\n (long) ((Math.random() - 0.5) * 0x10000000000000L)\n ^ (long) (((Math.random() - 0.5) * 2.0) * 0x8000000000000000L));\n }", "public RNGRandomImpl() {\n\t\tsetRand(new Random());\n\t}", "public CrossoverOrder() {\n\t\tthis.randomGenerator = new Random(System.currentTimeMillis());\n\t}", "public Randomizer()\r\n {\r\n }", "public Random() {\n real = new UniversalGenerator();\n twister = new MersenneTwister();\n }", "public GSRandom() {\r\n\t\t\r\n\t}", "public Rng() {\n\t\tr = new Random();\n\t}", "public GameNode(Random rng) {\n this.number = rng.nextInt(8) + 1;\n this.next = null;\n }", "public void random_init()\r\n\t{\r\n\t\tRandom random_generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0;i<chromosome_size;i++)\r\n\t\t{\r\n\t\t\tchromosome[i] = random_generator.nextInt(num_colors)+1;\r\n\t\t}\r\n\t}", "private PRNG() {\n java.util.Random r = new java.util.Random();\n seed = r.nextInt();\n mersenne = new MersenneTwister(seed);\n }", "public Generator(){}", "public GridSimRandom() {\n // empty\n }", "public RandomizedCollection() {\n nums = new ArrayList<>();\n num2Index = new HashMap<>();\n rand = new Random();\n }", "public RandomizedSet() {\n nums = new ArrayList<Integer>();\n location = new HashMap<Integer, Integer>();\n }", "public Generator() {\n identificationNumbers = new int[100][31];\n }", "public RandomizedSet() {\n }", "public SequenceNumberTest() {}", "private RandomLocationGen() {}", "public RandomizedCollection() {\n map = new HashMap<>();\n arr = new ArrayList<>();\n }", "public ProcessGenerator(int numProcesses, int RandomSeed) {\n // initialise instance variables\n this.numProcesses = numProcesses;\n processArrayList = new ArrayList<>();\n this.RandomSeed = RandomSeed;\n\n }", "private UniqueChromosomeReconstructor() { }", "public XorShiftRandom() {\n\t\tthis(System.nanoTime());\n\t}", "public RandomizedSet() {\n // public RandomizedSet1() {\n lst = new ArrayList<>();\n rand = new Random();\n map = new HashMap<>();\n }", "public void initialize() {\n\t\tinitialize(seedValue0, seedValue1);\n\t}", "@Override\r\n\tpublic void initialize() {\n\t\tRandom randomGenerator = new Random();\r\n\t\tthis.size = Helper.getRandomInRange(1, 9, randomGenerator);\r\n\t\tif (this.size % 2 == 0)\r\n\t\t\tthis.size--;\r\n\t}", "public SequenceImpl() {\n super();\n initSequence();\n }", "public RandomizedCollection() {\n\n }", "public RandomizedCollection() {\n map=new HashMap();\n li=new ArrayList();\n rand=new Random();\n }", "public static void randomInit(int r) { }", "public Rng(long seed) {\n\t\tr = new Random(seed);\n\t}", "private static void InitRandBag()\n {\n int k=(int)Math.floor(Math.random()*50);\n R[0]=k;\n\n //Generate the rest of the numbers\n for(int i=1;i<950;i++)\n {\n k=k+(int)Math.floor(Math.random()*50);\n R[i]=k;\n }\n\n //Shuffle the list\n for(int i=0;i<950;i++)\n {\n int temp = R[i];\n k = (int)Math.floor(Math.random()*950);\n R[i]=R[k];\n R[k]=temp;\n }\n }", "public LabOrder generateOrder() {\n LabOrder order = new LabOrder();\n Random r = new Random();\n Date date = getDate(r);\n order.insertts = date; //randbetween 1388534400 <-> 1420070400\n order.ordernr = \"O\" + r.nextInt();\n order.patientnr = \"P\" + r.nextInt(10000); //1 mil / 100 = 10 000\n order.visitNr = \"V\" + r.nextInt(); //unique;\n order.specimens.add(generateSpecimen(order));\n order.specimens.add(generateSpecimen(order));\n return order;\n }", "public NameGenerator() {\n this.rand = new Random();\n }", "public ICMGenerator() {\n super(Registry.ICM_PRNG);\n }", "public Generator(String[] words, Random rng)\n throws NullPointerException, IllegalArgumentException {\n if (rng == null) {\n throw new NullPointerException(NULL_RNG_MESSAGE);\n }\n if (words == null) {\n throw new NullPointerException(NULL_WORDS_MESSAGE);\n }\n if (words.length == 0) {\n throw new IllegalArgumentException(EMPTY_WORDS_MESSAGE);\n }\n Set<String> pool = new HashSet<>();\n for (String word : words) {\n word = word.toLowerCase();\n if (!pool.contains(word)) {\n pool.add(word);\n }\n }\n this.words = pool.toArray(new String[pool.size()]);\n this.rng = rng;\n }", "public ProbabilityDistribution() {\n\t\trandom_ = new Random();\n\t\titemProbs_ = new MutableKeyMap<T, Double>();\n\t}", "RandomizedIterator(String className, TypeTree tree) {\n\t super(init(className, tree));\n\t}", "@Override\n\n //-----------------\n\n public void init() {\n //test(); // <---------------- Uncomment to TEST!\n\n // %-distribution of RED, BLUE and NONE\n double[] dist = {0.49, 0.49, 0.02};\n\n // Number of locations (places) in world (square)\n int nLocations = 950;\n\n Actor[] distArray = distribution(nLocations, dist); //Generates array with correct distribution.\n distArray = shuffle(distArray); //Shuffles array\n world = toMatrix(distArray, nLocations, world); //Generates the start world.\n // Should be last\n fixScreenSize(nLocations);\n }", "public void setRNG(long seed);", "private CandidateGenerator() {\n\t}", "public RandomizedSet() {\n m = new HashMap<>();\n l = new ArrayList<>();\n }", "public Mazealgo() {\n Random number = new Random();\n long i = number.nextLong();\n this.random = new Random(i);\n this.seed = i;\n }", "public GseqFactoryImpl() {\n\t\tsuper();\n\t}", "public RandomIA() {\n\t\trandom = new Random();\n\t}", "public PatternCacheRandom()\r\n/* 26: */ {\r\n/* 27:118 */ this(20);\r\n/* 28: */ }", "public Random(long seed) {\n real = new UniversalGenerator(seed);\n twister = new MersenneTwister(seed);\n }", "public RandomizedQueue() { }", "public RandomizedSet() {\n data=new ArrayList<>();\n valueIndex=new HashMap<>();\n random=new Random();\n }", "public Orbiter() {\n }", "public RandomizedSet() {\n list = new ArrayList<>();\n map = new HashMap<>();\n }", "protected Agent(){\n\t\trand = SeededRandom.getGenerator();\n\t}", "public BernoulliDistribution(){\n\t\tthis(0.5);\n\t}", "public Sequence(){\n\n }", "public NormalGen (RandomStream s) {\n this (s, 0.0, 1.0);\n }", "@Override\n\tpublic void initialize(Bootstrap<SeqNumConfiguration> bootstrap) {\n\t}", "public RandomizedSet() {\n data = new ArrayList<>();\n val2Index = new HashMap<>();\n }", "public CellularAutomatonRNG(byte[] seed)\n {\n if (seed == null || seed.length != SEED_SIZE_BYTES)\n {\n throw new IllegalArgumentException(\"Cellular Automaton RNG requires a 32-bit (4-byte) seed.\");\n }\n this.seed = seed.clone();\n\n // Set initial cell states using seed.\n cells[AUTOMATON_LENGTH - 1] = seed[0] + 128;\n cells[AUTOMATON_LENGTH - 2] = seed[1] + 128;\n cells[AUTOMATON_LENGTH - 3] = seed[2] + 128;\n cells[AUTOMATON_LENGTH - 4] = seed[3] + 128;\n\n int seedAsInt = BinaryUtils.convertBytesToInt(seed, 0);\n if (seedAsInt != 0xFFFFFFFF)\n {\n seedAsInt++;\n }\n for (int i = 0; i < AUTOMATON_LENGTH - 4; i++)\n {\n cells[i] = 0x000000FF & (seedAsInt >> (i % 32));\n }\n\n // Evolve automaton before returning integers.\n for (int i = 0; i < AUTOMATON_LENGTH * AUTOMATON_LENGTH / 4; i++)\n {\n next(32);\n }\n }", "public RandomizedSet() {\n map = new HashMap<>();\n }", "public RandomizedQueue() {\n count = 0;\n N = 2;\n }", "@Override\n\t\tTruerandomness newInstance() {\n\t\t\treturn null;\n\t\t}", "public GeometricSequenceGenerator(int init, int ratio, int size) {\r\n // check for the precondition: size > 0, throws an IllegalArgumentException if this precondition\r\n // is not satisfied\r\n if (size <= 0)\r\n throw new IllegalArgumentException(\"WARNING: CANNOT create a sequence with size <= zero.\");\r\n // check for the validity of init (>=0) and ratio (>0), throw an IllegalArgumentException\r\n // if these two parameters are not valid\r\n if (init <= 0 || ratio <= 0)\r\n throw new IllegalArgumentException(\"WARNING: The starting element and the common ratio for a \"\r\n + \"geometric progression should be STRICTLY POSITIVE.\");\r\n\r\n // set the instance fields\r\n this.SIZE = size;\r\n this.INIT = init;\r\n this.RATIO = ratio;\r\n next = init; // initializes next to the first element in this arithmetic progression\r\n generatedCount = 0; // the number of elements that have been traversed is 0\r\n }", "public GridSimRandom(long seed, double lessFactorIO, double moreFactorIO,\n double lessFactorExec, double moreFactorExec)\n {\n random_.setSeed(seed);\n lessFactorIO_ = lessFactorIO;\n moreFactorIO_ = moreFactorIO;\n lessFactorExec_ = lessFactorExec;\n moreFactorExec_ = moreFactorExec;\n }", "public RandomizedSet() {\n\n\n sub =new ArrayList<Integer>();\n hm=new HashMap<Integer,Integer>();\n rand =new Random();\n\n }", "public MarkovZero() {\n\t\tmyRandom = new Random();\n\t}", "public void init() {\n\t\tinit(\"1,0 3,0 5,0 7,0 9,0 0,1 2,1 4,1 6,1 8,1 1,2 3,2 5,2 7,2 9,2 0,3 2,3 4,3 6,3 8,3\", \n\t\t\t \"1,6 3,6 5,6 7,6 9,6 0,7 2,7 4,7 6,7 8,7 1,8 3,8 5,8 7,8 9,8 0,9 2,9 4,9 6,9 8,9\"); \n }", "public PoissonGenerator() {\n\t}", "public RandomizedSet() {\n set = new HashMap<>();\n list = new ArrayList<>();\n }", "RandomValuePatternComponent(final long lowerBound, final long upperBound,\n final long seed, final String formatString)\n {\n if (lowerBound == upperBound)\n {\n this.lowerBound = lowerBound;\n\n span = 1L;\n }\n else if (lowerBound > upperBound)\n {\n this.lowerBound = upperBound;\n\n span = lowerBound - upperBound + 1;\n }\n else\n {\n this.lowerBound = lowerBound;\n\n span = upperBound - lowerBound + 1;\n }\n\n seedRandom = new Random(seed);\n random = new ThreadLocal<Random>();\n\n this.formatString = formatString;\n decimalFormat = new ThreadLocal<DecimalFormat>();\n }", "public RandomVaries(String name, int probability, float minUnits, float maxUnits){\n super(name);\n this.probability=probability;\n if(minUnits<0)generator=true;\n this.minUnits=Math.abs(minUnits);\n this.maxUnits=Math.abs(maxUnits);\n }", "private RandomStringUtils() {\r\n\t\tsuper();\r\n\t}", "public ToZeroRampGenerator() { \r\n }", "public RandomizedQueue2() {\n first = null;\n last = null;\n size = 0;\n }", "public RandomizedSet() {\n map = new HashMap<Integer, Integer>();\n set = new ArrayList<Integer>();\n int validLength = 0;\n }", "public Generateur() {\n }", "abstract Truerandomness newInstance();", "public RandomizedSet() {\n this.valueToIndex = new HashMap<>();\n this.values = new ArrayList<>();\n this.random = new Random();\n }", "PermutationGenerator(Random random) {\n\t\tm_random = random;\n\t}", "public ArtItemBuilder(){\n this.r = new Random();\n }", "public RandomizedSet() {\n set = new HashSet<Integer>();\n }", "public Genetic() {\r\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private Range() {}", "public VShuffling()\n {\n }", "public RngObject() {\n\t\t\n\t}", "public OrderExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public DayTradeStrategy(int seed) {\r\n /* If you need some initialization of e.g., instance variables\r\n write here.\r\n */\r\n\r\n fRandom = new Random(seed); // Initialization of random sequence.\r\n }", "private UniqueIdGenerator() {\n\n }", "public HypergeometricDistribution(){\n\t\tthis(100, 50, 10);\n\t}", "public Rng(int sides, long seed) {\n\t\tthis.sides = sides;\n\t\tr = new Random(seed);\n\t}", "public TestSequence() {\n }", "public void initChanceDeck() {\n\t\tchanceDeck = new Deck();\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tchanceDeck.addCard(new Card(i));\n\t\t}\n\t\t//shuffled to make the order random\n\t\tchanceDeck.shuffle();\n\t}", "Sequence createSequence();", "private void init() {\r\n\t\tx = (float) (Math.random() * 2 - 1);\r\n\t\ty = (float) (Math.random() * 2 - 1);\r\n\t\tz[0] = (float) (Math.random() * 3f);\r\n\t\tz[1] = z[0];\r\n\t}", "public Sequence(){\r\n \r\n }", "public RandomNeighborhoodOperator(int nbRelaxedVars, long seed)\n{\n\trandom = new Random(seed);\n\tthis.nbRelaxedVars = nbRelaxedVars;\n\tselected = new TIntHashSet();\n}", "public OrderHeadExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public BorderedStrategy() {\n\t\tsuper();\n\t}", "RandomArrayGenerator() {\n this.defaultLaenge = 16;\n }", "public RandomResource(int instances_, long mgSeed_, long lcgSeed_) {\n super(instances_);\n stream = new UniformStream(0.0, 1.0, 0, mgSeed_, lcgSeed_);\n waitingList = new Vector();\n }", "public WeibullGen (RandomStream s, double alpha) {\n this (s, alpha, 1.0, 0.0);\n }" ]
[ "0.6329462", "0.63013214", "0.6225742", "0.61870956", "0.60823315", "0.60542375", "0.6025505", "0.60017484", "0.5898913", "0.58109397", "0.5785919", "0.57759625", "0.5763103", "0.57107306", "0.5683894", "0.56747884", "0.56598717", "0.56332207", "0.56293726", "0.559618", "0.55919373", "0.55911386", "0.55781984", "0.55778337", "0.5574424", "0.5570233", "0.55421084", "0.5518213", "0.5506807", "0.54894686", "0.5467294", "0.54518795", "0.5445917", "0.53959715", "0.5381799", "0.53803813", "0.5379129", "0.5368992", "0.53607106", "0.53466743", "0.53450364", "0.53036845", "0.5300575", "0.53004396", "0.529916", "0.5296317", "0.5291464", "0.5290726", "0.52868384", "0.52720064", "0.52701485", "0.5268074", "0.5245858", "0.52308553", "0.522927", "0.52179307", "0.52171624", "0.5190535", "0.5186267", "0.5181523", "0.5164119", "0.51584506", "0.5156763", "0.51550287", "0.51506764", "0.51469904", "0.5130801", "0.51290524", "0.5125285", "0.5116542", "0.5110262", "0.51020664", "0.5101049", "0.50976586", "0.50966597", "0.5091898", "0.5086149", "0.5084983", "0.5080951", "0.50774884", "0.5075961", "0.5068764", "0.5066026", "0.50636417", "0.50635356", "0.5056402", "0.50563", "0.5052225", "0.50486165", "0.5043562", "0.5035565", "0.50285435", "0.5026565", "0.5020267", "0.5018842", "0.5017891", "0.501191", "0.50098115", "0.50015455", "0.49884382", "0.4978933" ]
0.0
-1
there might be more efficient ways, but sqrt() is noncritical..
@Override public FqElement<BigInteger> sqrtMutable() { value = multiplyMontgomery(value, BigInteger.ONE).mod(order); if(IntegerUtil.legendreSymbol(value, order) != 1) return null; BigInteger e1 = order.subtract(BigInteger.ONE).shiftRight(1); BigInteger e1tmp = e1; BigInteger e2 = order.subtract(BigInteger.ONE); int s; for(s = 0; !e1.testBit(s); s++); BigInteger k = e1.shiftRight(s); BigInteger tmp; for(int i = 1; i <= s; i++) { e1 = e1.shiftRight(1); e2 = e2.shiftRight(1); tmp = value.modPow(e1, order).multiply(getNqr().modPow(e2, order)) .subtract(order); if(tmp.equals(BigInteger.ONE.negate())) e2 = e2.add(e1tmp); } BigInteger m = k.subtract(BigInteger.ONE).shiftRight(1); value = value.modPow(m.add(BigInteger.ONE), order).multiply(getNqr() .modPow(e2.shiftRight(1), order)).mod(order); value = value.multiply(R).mod(order); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double sqrt(double d) {\n\t\t\treturn 0;\n\t\t}", "public T sqrt(T value);", "public static BigInteger sqrt(BigInteger n) {\n BigInteger xi = n.divide(primes.get(0));\n for (int i = 0; i < 3; i++) {\n xi = xi.subtract(xi.pow(2).subtract(n).divide(xi.multiply(new\n BigInteger(\"2\"))));\n }\n return (xi.pow(2).compareTo(n) > 0) ? xi : xi.add(ONE);\n }", "public static double sqrt(double x)\n {\n double root = x, guess=0;\n\n if(x<0) return NaN;\n\n // the accuarcy test is percentual\n for(int i=0; (i<16) && ((guess > x*(1+5e-7f)) || (guess < x*(1-5e-7f))); i++)\n {\n root = (root+x/root)*0.5f; // a multiplication is faster than a division\n guess=root*root; // cache the square to the test\n }\n return root;\n }", "public int sqrt(int x) {\n if(x==0) return 0;\n if(x<0) return -1;\n double y=(double)x/2;\n while(Math.abs(y*y-x)>0.00001){\n y=(y+x/y)/2;\n }\n return (int)y;\n }", "private static double sqrtPiSqr() {\n\t\tfinal double PI = Math.PI;\n\t\tfinal int POWER = 2;\n\n\t\t// Solving equation and return value\n\t\treturn Math.sqrt(Math.pow(PI*PI,POWER));\n\t}", "public double sqrt(int n) {\n\t\tif(n<0)\n\t\t\treturn Double.NaN;\n\t\treturn Math.sqrt(n);\n\t}", "private static void badApproach() {\n\t\t\n\t\tList<Double> result = new ArrayList<>();\n\t\t\n\t\tThreadLocalRandom.current()\n\t\t\t.doubles(10_000).boxed()\n\t\t\t.forEach(\n\t\t\t\t\td -> NewMath.inv(d)\n\t\t\t\t\t\t.ifPresent(\n\t\t\t\t\t\t\tinv -> NewMath.sqrt(inv)\n\t\t\t\t\t\t\t\t.ifPresent(\n\t\t\t\t\t\t\t\t\t\tsqrt -> result.add(sqrt)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\n\t\tSystem.out.println(\"# result = \"+result.size());\n\t\t\n\t}", "public static float sqrt(float a, int iterations) {\n float x = 0.5f * (a + 1);\n for (int i = 0; i < iterations; i++) {\n x = 0.5f * (x + a / x);\n }\n return x;\n }", "public MyDouble norm() {\r\n\t\tMyDouble aSquar = this.getReal().square();\r\n\t\tMyDouble bSquare = this.getImag().square();\r\n\t\tMyDouble sum = aSquar.add(bSquare);\r\n\t\tMyDouble result = sum.sqrt();\r\n\t\treturn result;\r\n\t}", "public double r() { return Math.sqrt(x*x + y*y); }", "@Test\n\tpublic void testSquare() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble expResult = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomNegativeNumbers();\n\t\t\texpResult = Math.sqrt(tmpRndVal);\n\t\t\tassertEquals(ac.square(tmpRndVal), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomPositiveNumbers(); \n\t\t\texpResult = Math.sqrt(tmpRndVal);\n\t\t\tassertEquals(ac.square(tmpRndVal), expResult, 0);\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\texpResult = Math.sqrt(zero);\n\t\t\tassertEquals(ac.square(zero), expResult, 0);\n\t\t}\n\t\t\n\t}", "public int sqrt(int x) {\n if(x>=0)\n {\n long left=0;\n long right=x;\n long mid=0;\n while(left<=right)\n {\n mid=left+(right-left)/2;\n long tmp=mid*mid;\n if(tmp<mid){\n right=mid-1;\n }\n else if(tmp==x){\n return (int)mid;\n }\n else if(tmp<x){\n left=mid+1;\n }\n else{\n right=mid-1;\n }\n \n }\n return (int)right;\n }\n return -1;\n }", "public final void sqrt() throws ArithmeticException {\n\t\tif ((mksa&_LOG) != 0) throw new ArithmeticException\n\t\t(\"****Unit: log(\" + symbol + \")\") ;\n\t\tif ((mksa&0x0101010101010101L)!=0) throw new ArithmeticException\n\t\t(\"****Unit: sqrt(\" + symbol + \") is impossible\");\n\t\tvalue = Math.sqrt(value);\n\t\tfactor = Math.sqrt(factor);\n\t\tmksa = (mksa+underScore)>>1;\n\t\t/* Try to remove the squared edition */\n\t\tif ((symbol != null) && (symbol.length()>1)) {\n\t\t\tParsing t = new Parsing(symbol);\n\t\t\tint i=0;\n\t\t\tint pow=0;\n\t\t\tpow = getPower(t);\n\t\t\tif ((pow&1) != 0) \t// Odd power not possible\n\t\t\t\tpow = 0;\n\t\t\tif (t.a[0] == '(') { i = 1; t.advance(-1); }\n\t\t\tif (pow == 2) symbol = symbol.substring(i, t.pos);\n\t\t\telse if (pow != 0) {\n\t\t\t\tpow /= 2;\n\t\t\t\tsymbol = toExpr(symbol.substring(i,t.pos)) + pow;\n\t\t\t}\n\t\t\tif ((pow == 0) && (t.length>0)) symbol = \"sqrt(\" + symbol + \")\";\n\t\t}\n\t}", "public static double sqrt(double num) {\r\n\t\tif (num<0)throw new IllegalArgumentException(\"This method cannot find the square root of a ngeative number.\");\r\n\t\tdouble educatedGuess = num/2;\r\n\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\teducatedGuess = (num/educatedGuess+educatedGuess)/2;\r\n\t\t}\r\n\t\tint ans = (int) (((educatedGuess+.005)*100)/100);\r\n\t\treturn ans;\r\n\t\t}", "public static float BAKSH_sqrt(float x) {\n float a;\n float x0 = 1f;\n\n int n = (int) (x % 5) + DEFAULT_ACCURACY >> 1;\n for (int i = 0; i < n; i++) {\n a = 0.5f * (x - x0 * x0) / x0;\n x0 = (x0 * x0 + 2f * a * x0 + a * a * 0.5f) / (x0 + a);\n }\n return x0;\n }", "double getSquareDistance();", "public static int sqrt(final int a) {\n return (int) sqrt(a, 0, a);\n }", "static double bSearchSqrt(double t){\n\t\tdouble l = 0.0, r = t, res = -1.0;\n\t\twhile(Math.abs(r - l) > 1e-7){ //guaranteed 6 \"good\" digits\n\t\t\tdouble m = l + (r - l) / 2.0;\n\t\t\tif(m * m <= t){\n\t\t\t\tl = m;\n\t\t\t\tres = m;\n\t\t\t}else{\n\t\t\t\tr = m;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "float norm();", "public int mySqrt(int x) {\n if(x < 2)\n return x;\n\n int tmp = x / 2;\n\n while(x / tmp < tmp) {\n tmp /= 2;\n }\n\n int l = tmp;\n int r = 2 * tmp;\n\n while(l <= r) {\n int mid = l + (r - l) / 2;\n\n tmp = x / mid;\n\n if(mid == tmp)\n return mid;\n\n if(tmp < mid)\n r = mid - 1;\n else\n l = mid + 1;\n }\n\n return r;\n }", "public static double sqrt_safe(double x) {\n return Math.sqrt(Util.max(x, 0));\n }", "public double norm() {\n\t\treturn Math.sqrt(x * x + y * y + z * z);\n\t}", "private double norm(double x1, double y1, double x2, double y2)\n {\n return Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));\n }", "float norm2();", "int main()\n{\n float s1,s2;\n scanf(\"%f%f\",&s1,&s2);\n printf(\"%.2f\",sqrt((s1*s1)+(s2*s2)));\n \n return 0;\n}", "public static int mySqrt(int x) {\n\t\tif (x <= 1) return x;\n\t\t\n double x1 = 0, x2 = 1;\n while (Math.abs(x1 - x2) > 0.000001) {\n x1 = x2;\n x2 = (x1 + x/x1) / 2;\n }\n return (int)x1;\n\t}", "public static double sumSqrt(double[] a) {\n\t\tdouble sum = 0.0;\n\t\tfor(int i = 0; i<a.length; i++) {\n\t\t\tsum = sum + Math.sqrt(a[i]);\n\t\t}\n\t\treturn sum;\n\t}", "public static int sqrt(int x) {\n\t\treturn (int) precomputedSqrt.charAt(x);\n\t}", "public static Matrix sqrt(Matrix mat)\n {\n double[][] M = mat.getArray();\n int row = mat.getRowDimension();\n int col = mat.getColumnDimension();\n Matrix X = new Matrix(row, col);\n double[][] C = X.getArray();\n for (int i = 0; i < row; i++)\n {\n for (int j = 0; j < col; j++)\n {\n if (M[i][j] < 0.0)\n {\n // C[i][j] = Double.NaN;\n throw new ConditionalException(\"sqrt : Found a negative number.\");\n }\n else\n {\n C[i][j] = Math.sqrt(M[i][j]);\n }\n }\n }\n return X;\n }", "public Optional<LongMod> sqrt() {\n long a = n();\n long p = mod();\n\n if (a == 0) {\n return Optional.of(zero(p));\n } else if (p == 2) {\n return Optional.of(this);\n } else if (legendreSymbol(a, mod()) == -1) {\n return Optional.empty();\n } else if (p % 4 == 3) {\n return Optional.of(pow((p + 1) / 4));\n }\n\n long s = p - 1;\n long e = 0;\n while (s % 2 == 0) {\n s /= 2;\n e++;\n }\n\n long n = 2;\n while (legendreSymbol(n, p) != -1) {\n n++;\n }\n\n long x = powMod(a, (s + 1) / 2, p);\n long b = powMod(a, s, p);\n long g = powMod(n, s, p);\n long r = e;\n\n while (true) {\n long t = b;\n long m = 0;\n for (; m < r; m++) {\n if (t == 1) {\n break;\n }\n t = powMod(t, 2, p);\n }\n\n if (m == 0) {\n return Optional.of(create(x, p));\n }\n\n long gs = powMod(g, 1L << (r - m - 1), p);\n g = (gs * gs) % p;\n x = (x * gs) % p;\n b = (b * g) % p;\n r = m;\n }\n }", "static double sqrt(double number) {\n\t\tdouble answer = number / 2;\r\n\t\tif (number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no negative square roots\"); \r\n=======\n\tpublic static double sqrt(int number) { //gonna be honest here: idk??\r\n\t\tint div = number*number;\r\n\t\tif(number < 0) {\r\n\t\t\tthrow new IllegalArgumentException(\"no square roots of negative numbers\");\r\n>>>>>>> branch 'master' of https://github.com/henryhoover/APCS4Fall.git\n\t\t}\r\n\t\twhile (((answer * answer) - number) >= .005 || ((answer * answer) - number) <= -.005) {\r\n\t\t\tanswer = 0.5 * (number / answer + answer);\r\n\t\t}\r\n\t\treturn round2(answer);\r\n\t}\r\n\t\r\n\tpublic static String quadForm(int a, int b, int c) { //need round2 so uhhhhh\r\n\t\tif(b == 0) {\r\n\t\t\tSystem.out.println(round2(c));\r\n\t\t}\r\n\r\n\t\tif(discriminant(a, b, c) == 0) {\r\n\t\t\treturn(\"Roots: \" + round2((b * -1) / (2 *a)));\t\r\n\t\t}\r\n\t\t\r\n\t\tif(discriminant(a, b, c) > 0) {\r\n\t\t\treturn(\"Roots: \" + round2(b * -1) + (sqrt(b * b - (4 * a * c))));\r\n\t\t}\r\n\t\t\r\n\t\treturn(\"no real roots\");\r\n\t}\r\n}", "public static float Q_sqrt(float x) {\n float min = ((x * 2f) * (1f / (x + 1f)));\n float max = (x + 1f) / 2f;\n float guess = 0.5f * max + 0.5f * min;\n\n int n = (int) (x % 5) + DEFAULT_ACCURACY >> 1;\n for (int i = 0; i < n; i++) {\n if (guess * guess > x)\n max = guess;\n else\n min = guess;\n\n guess = 0.5f * max + 0.5f * min;\n }\n return guess;\n }", "public double squareRoot (double firstNumber){\n\t\tif (firstNumber < 0) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Invalid Input \", \"Error message\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn -1111.1111;\n\t\t}\n\t\tdouble result = Math.sqrt(firstNumber);\n\t\treturn result;\n\t}", "public Double squareRoot(Double advNum1) {\n answer = Math.sqrt(advNum1);\n return answer;\n }", "public double getMagnitud(){\n return Math.sqrt(x*x+y*y);\n }", "public double norm() {\n\t\thomogenize();\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}", "private void sqrt() throws Exception{\n\t\tif(stackEmpty()) throw new Exception(\"Stack ist leer\");\n\t\telse{\n\t\t\tvalue1 = stack.pop();\n\t\t\tstack.push(Math.sqrt(value1));\n\t\t}\n\t\t\n\t}", "public float lengthSquared ( );", "public double norm() {\r\n return Math.sqrt(innerProduct(this));\r\n }", "public static final int sqrt(int x) \n\t {\n\t int xn;\n\n\t if (x >= 0x10000) {\n\t if (x >= 0x1000000) {\n\t if (x >= 0x10000000) {\n\t if (x >= 0x40000000) {\n\t xn = table[x >> 24] << 8;\n\t } else {\n\t xn = table[x >> 22] << 7;\n\t }\n\t } else {\n\t if (x >= 0x4000000) {\n\t xn = table[x >> 20] << 6;\n\t } else {\n\t xn = table[x >> 18] << 5;\n\t }\n\t }\n\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\t return ((xn * xn) > x) ? --xn : xn;\n\t } else {\n\t if (x >= 0x100000) {\n\t if (x >= 0x400000) {\n\t xn = table[x >> 16] << 4;\n\t } else {\n\t xn = table[x >> 14] << 3;\n\t }\n\t } else {\n\t if (x >= 0x40000) {\n\t xn = table[x >> 12] << 2;\n\t } else {\n\t xn = table[x >> 10] << 1;\n\t }\n\t }\n\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\n\t return ((xn * xn) > x) ? --xn : xn;\n\t }\n\t } else {\n\t if (x >= 0x100) {\n\t if (x >= 0x1000) {\n\t if (x >= 0x4000) {\n\t xn = (table[x >> 8]) + 1;\n\t } else {\n\t xn = (table[x >> 6] >> 1) + 1;\n\t }\n\t } else {\n\t if (x >= 0x400) {\n\t xn = (table[x >> 4] >> 2) + 1;\n\t } else {\n\t xn = (table[x >> 2] >> 3) + 1;\n\t }\n\t }\n\n\t return ((xn * xn) > x) ? --xn : xn;\n\t } else {\n\t if (x >= 0) {\n\t return table[x] >> 4;\n\t }\n\t }\n\t }\n\t \n\t //illegalArgument();\n\t return -1;\n\t }", "public double sqrMagnitude()\n {\n return ((x*x) + (y*y) + (z*z) + (w * w));\n }", "public abstract void squareRootThis();", "public static double findSquareRoot(double num) {\n\t\tif(num>0)\n\t\t\treturn Math.sqrt(num);\n\t\telse \n\t\t\treturn 0;\n\t}", "public double norm2();", "static double squareRoot(double num){\n double epsilon=.01;\n double ans=0;\n double increment=.001;\n int count=0;\n while(Math.abs(ans*ans-num)>epsilon){\n System.out.println(ans);\n ans+=increment;\n }\n if (Math.abs(ans*ans-num)<epsilon){\n System.out.println(\"Found square at count: \"+count+\" It is: \"+ans);\n return ans;\n }\n else {\n System.out.println(\"Failed to find square root\");\n return ans;\n }\n }", "public int mySqrt(int x) {\n int exp100 = 0;\n int divBy100 = x;\n while (divBy100 >= 100) {\n exp100++;\n divBy100 /= 100;\n }\n\n long sqrt = 1;\n while (exp100-- > 0) sqrt *= 10;\n\n // When `int` sqrt = 46341, sqrt*sqrt becomes negative.\n // Integer.MAX_VALUE = 2,147,483,647\n while (sqrt * sqrt <= x) {\n sqrt++;\n }\n\n return (int)sqrt - 1;\n }", "private Double euclidean(LatitudeLongitude point1, LatitudeLongitude point2) {\n return Double.valueOf(Math.sqrt(Math.pow(point1.getLatitude() - point2.getLatitude(), 2)\n + Math.pow(point1.getLongitude() - point2.getLongitude(), 2)));\n }", "public static double signedSqrt(double value) {\n return Math.copySign(value * value, value);\n }", "public static void squareRoot()\n\t{\n\t\tSystem.out.println(\"enter a non-negative number\");\n\t\tint c = scanner.nextInt();\n\t\tdouble epsilon = 1e-15; \n\t\tdouble t = c;\n\t\t\n\t\t while (Math.abs(t - c/t) > epsilon*t) \n\t\t\t{\n\t\t t = (c/t + t) / 2.0;\n\t\t } \n\t\tSystem.out.println(t);\n\t}", "double getSquareNumber();", "@Test\n public void test36() throws Throwable {\n Complex complex0 = new Complex((-699.847402808), (-699.847402808));\n Complex complex1 = complex0.tanh();\n Complex complex2 = complex1.sqrt1z();\n Complex complex3 = complex0.tanh();\n Complex complex4 = complex0.sin();\n int int0 = complex0.hashCode();\n Complex complex5 = complex1.exp();\n boolean boolean0 = complex1.equals(complex1);\n Complex complex6 = complex1.log();\n Complex complex7 = complex6.add(complex0);\n double double0 = complex7.getArgument();\n Complex complex8 = complex1.atan();\n Complex complex9 = complex0.cosh();\n Complex complex10 = complex7.subtract(complex1);\n Complex complex11 = complex8.conjugate();\n Complex complex12 = complex7.add(complex0);\n double double1 = complex0.abs();\n Complex complex13 = complex7.multiply(0.0);\n Complex complex14 = complex11.multiply(complex13);\n Complex complex15 = complex11.sqrt1z();\n Complex complex16 = complex8.tan();\n double double2 = complex12.getArgument();\n Complex complex17 = complex0.divide(complex12);\n try { \n complex12.nthRoot(0);\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: 0\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }", "public static BigDecimal sqrt(BigDecimal A, final int SCALE) {\n BigDecimal x0 = new BigDecimal(\"0\");\n BigDecimal x1 = new BigDecimal(Math.sqrt(A.doubleValue()));\n while (!x0.equals(x1)) {\n x0 = x1;\n x1 = A.divide(x0, SCALE, ROUND_HALF_UP);\n x1 = x1.add(x0);\n x1 = x1.divide(TWO, SCALE, ROUND_HALF_UP);\n }\n return x1;\n }", "@Test\n public void test34() throws Throwable {\n Complex complex0 = new Complex(11.0, 11.0);\n double double0 = complex0.abs();\n Complex complex1 = complex0.sqrt1z();\n Complex complex2 = complex0.tanh();\n List<Complex> list0 = complex2.nthRoot(266);\n Complex complex3 = complex0.sinh();\n Complex complex4 = complex3.multiply(0.11764700710773468);\n Complex complex5 = complex3.log();\n Complex complex6 = complex2.conjugate();\n Complex complex7 = complex3.log();\n Complex complex8 = complex0.sinh();\n boolean boolean0 = complex0.equals(complex2);\n Complex complex9 = complex4.conjugate();\n Complex complex10 = complex0.tan();\n double double1 = complex3.getImaginary();\n Complex complex11 = complex0.cosh();\n Complex complex12 = complex7.tan();\n Complex complex13 = complex3.multiply(complex6);\n try { \n complex10.nthRoot(0);\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: 0\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }", "abstract double getLengthSquared();", "public double mod() \n\t{\n if (x!=0 || y!=0) {\n return Math.sqrt(x*x+y*y); //distance formular\n } else {\n return 0.0D;\n }\n }", "public static int mySqrt2(int x) {\n if (x < 2) return x;\n\n long num;\n int pivot, left = 2, right = x / 2;\n while (left <= right) {\n pivot = left + (right - left) / 2;\n num = (long)pivot * pivot;\n if (num > x) right = pivot - 1;\n else if (num < x) left = pivot + 1;\n else return pivot;\n }\n\n return right;\n }", "public double normSqr(double x1, double y1, double z1, double x2, double y2, double z2)\r\n\t{\r\n\t\treturn (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) + (z1 - z2)*(z1 - z2);\r\n\t}", "public static void main(String[] args) {\n\n double[] arr = new double[100];\n Random rn = new Random();\n // initialize the array with random doubles\n for (int i = 0; i < arr.length; i++){\n arr[i] = Math.ceil(rn.nextDouble()*10);\n }\n\n for (double db: arr) {\n System.out.println(db +\"sqrt --> \" + Math.sqrt(db));\n }\n\n }", "public boolean isSquared(){\n double sq = Math.sqrt(value);\n return (sq - Math.floor(sq)) == 0;\n }", "public static float hypotenuse(float... fValues) {\n double sum = 0.0;\n for (float value : fValues) {\n sum += value * value;\n }\n\n float result = (float) Math.sqrt(sum);\n assert result >= 0.0 : result;\n return result;\n }", "public static native double norm(double a[]);", "public double squareMagnitude() {\n\t\treturn x*x + y*y + z*z;\n\t}", "public static int mySqrt(int x) {\n int res = 0;\n\t\twhile(true){\n\t\t\tif(res * res <= x){\n\t\t\t\tres ++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn res - 1;\n\t\t\t}\n\t\t}\n }", "@Test\n public void test20() throws Throwable {\n Complex complex0 = new Complex(0.0, 0.0);\n Complex complex1 = complex0.tan();\n Complex complex2 = complex0.log();\n Complex complex3 = complex2.atan();\n Complex complex4 = (Complex)complex2.readResolve();\n Complex complex5 = complex1.tan();\n Complex complex6 = complex0.atan();\n Complex complex7 = complex3.sin();\n Complex complex8 = complex0.negate();\n Complex complex9 = complex6.createComplex(2846.5, 0.0);\n Complex complex10 = complex0.add(complex1);\n Complex complex11 = complex1.sqrt1z();\n boolean boolean0 = complex6.equals(complex10);\n Complex complex12 = complex3.sqrt();\n double double0 = complex2.getArgument();\n Complex complex13 = complex1.sinh();\n try { \n complex9.nthRoot((-4646));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -4,646\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }", "public static void main(String[] args) {\n\t\tboolean found = false;\n\t\tint size = 1001;\n\t\tdouble[] squares = new double[size];\n\t\tint index = 0;\n\t\tfor (int i = 1; i <= size - 1; i++) {\n\t\t\tsquares[index] = i * i;\n\t\t\tindex++;\n\t\t}\n\t\tfor (int i = size; i >= 0; i--) {\n\t\t\tdouble c = squares[i - 1];\n\t\t\t// System.out.println(\"i=\" + i);\n\t\t\t// System.out.println(\" c = \" + c);\n\t\t\tfor (int j = 0; j < size - 1; j++) {\n\t\t\t\t// System.out.println(\"j=\" + j);\n\t\t\t\tdouble b = squares[j];\n\t\t\t\t// System.out.println(\" b = \" + b);\n\t\t\t\tfor (int k = size - 2; k >= 0; k--) {\n\t\t\t\t\t// System.out.println(\"k=\" + k);\n\t\t\t\t\tif (k == j) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdouble a = squares[k];\n\t\t\t\t\t// System.out.println(\" a = \" + a);\n\t\t\t\t\tif (a + b == c) {\n\n\t\t\t\t\t\t// System.out.println(Math.sqrt(a) + \" \" + Math.sqrt(b) + \" \" + Math.sqrt(c));\n\t\t\t\t\t\tif (Math.sqrt(a) + Math.sqrt(b) + Math.sqrt(c) == 1000) {\n\t\t\t\t\t\t\tSystem.out.println(a + \" \" + b + \" \" + c);\n\t\t\t\t\t\t\tSystem.out.println(\"a=\" + Math.sqrt(a) + \" b=\" + Math.sqrt(b) + \" c=\" + Math.sqrt(c));\n\t\t\t\t\t\t\tSystem.out.printf(\"%f\", Math.sqrt(a) * Math.sqrt(b) * Math.sqrt(c));\n\t\t\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t\t\t\tSystem.out.println(\"found\");\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (found) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (found) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public int mySqrt2(int x) {\n\t\tif (x <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t// Binary Search. \n\t\tint left = 1, right = x;\n\t\twhile (left <= right) {\n\t\t\tint mid = left + (right - left) / 2;\n\t\t\t// Be careful with inequalities. \n\t\t\tif (mid <= x / mid && mid + 1 > x / (mid + 1)) {\n\t\t\t\treturn mid;\n\t\t\t}\n\n\t\t\tif (mid > x / mid) {\n\t\t\t\tright = mid - 1;\n\t\t\t} else {\n\t\t\t\tleft = mid + 1;\n\t\t\t}\t\t\t\n\t\t}\n\n\t\treturn left;\n\t}", "public int mySqrt(int x) {\n\t\t// If x is less than 1, it is corner case. \n\t\tif (x < 2) {\n\t\t\treturn x;\n\t\t}\n\n\t\tlong squared;\n\t\tint guess, left = 1, right = x;\n\t\twhile (left <= right) {\n\t\t\tguess = left + (right - left) / 2;\n\t\t\tsquared = (long) guess * guess;\n\t\t\tif (squared == x) {\n\t\t\t\treturn guess;\n\t\t\t}\n\n\t\t\tif (squared > x) {\n\t\t\t\tright = guess - 1;\n\t\t\t} else {\n\t\t\t\tleft = guess + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn left - 1;\n\t}", "@Test\n public void lengthSq() {\n float result = 0.0f;\n float[] a = new float[] {1.001f, 2.002f, 2.0f, 3.0f, 4.0f, 6.0f}; \n float expect = 65.0f;\n // 1)\n result = Vec4f.lengthSq(a, 2);\n assertTrue(Math.abs(result-expect) < 1E-6f);\n \n //2)\n float[] a2 = new float[] {2.0f, 3.0f, 4.0f, 6.0f}; \n float result2 = Vec4f.lengthSq(a2);\n assertTrue(Math.abs(result2-expect) < 1E-6f);\n }", "public double vectorSquareSumRoot()\n\t{\n\t\tdouble sum =0;\n\t\tfor(int i=0;i<vector.size();i++)\n\t\t{\n\t\t\tsum += (vector.get(i)*vector.get(i));\n\t\t}\n\t\treturn Math.sqrt(sum);\n\t}", "public static int mySqrt3(int x) {\n if (x < 2) return x;\n\n int left = mySqrt3(x >> 2) << 1;\n int right = left + 1;\n return (long)right * right > x ? left : right;\n }", "public double sqrt(double number, double precision){\n\t\t\n\t\t//if the number is less than 0, throw an exception.\n\t\tif(number <0)\n\t\t\tthrow new IllegalArgumentException(\"Give a value greater than 0:\"+number);\n\t\t//if the number is the same as 0 or 1 return the same number.\n\t\tif(number==0 ||number ==1)\n\t\t\treturn number;\n\t\telse if (number >0 && number <1){\n\t\t\treturn 1/(sqrt((1/number),precision));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//else begin a typical binary search\n\t\t\t//set start =0, end = number\n\t\t\tdouble start =0, mid =0, end = number;\n\t\t\tdouble midSq =0;\n\t\t\t\n\t\t\t//do while end -start is greater than precision.\n\t\t\twhile (end - start> precision)\n\t\t\t{\n\t\t\t\t// get average.\n\t\t\t\tmid = (start+end)/2;\n\t\t\t\t\n\t\t\t\t//calculate the product of the average.\n\t\t\t\tmidSq = mid * mid;\n\t\t\t\t\n\t\t\t\t//if the product equals the number, return the average.\n\t\t\t\tif(midSq == number)\n\t\t\t\t\treturn mid;\n\t\t\t\t//if you fall lesser than the number, set start to mid\n\t\t\t\telse if(midSq < number)\n\t\t\t\t\tstart = mid;\n\t\t\t\t//else set end to mid\n\t\t\t\telse\n\t\t\t\t\tend = mid;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn mid;\n\t\t\t\n\t\t}\n\t\n\t\t\n\t}", "private static double square (double x)\r\n\t{\r\n\t\treturn x * x;\r\n\t}", "public static int mySqrt1(int x) {\n if (x < 2) return x;\n int l = (int)Math.pow(Math.E, 0.5*Math.log(x));\n int r = l + 1;\n return (long)r*r > x ? l : r;\n }", "private double distanceResult(double preLng, double preLat, double nextLng, double nextLat) {\n\t\treturn Math.sqrt((preLng - nextLng) * (preLng - nextLng) + (preLat - nextLat) * (preLat - nextLat));\n\t}", "public static float norm(float[] array) {\n float retval = 0;\n for (int i = 0; i < array.length; i++) {\n retval += array[i] * array[i];\n }\n return (float) Math.sqrt(retval);\n }", "public double sqRoot(double num) {\n double base = 0;\n while (base < num) {\n base++;\n if ((base * base) == num) {\n return base;\n }\n }\n\n double termInSequence = ((base * base) + num) / (2 * base);\n for (int i = 0; i < 10; i++) {\n termInSequence = ((termInSequence * termInSequence) + num) / (2 * termInSequence);\n }\n return Double.parseDouble(String.format(\"%.9f\", termInSequence));\n }", "public static int mySqrt(int x) {\n\t\tif (x == 0)\n\t\t\treturn 0;\n\n\t\tint left = 1;\n\t\tint right = x / 2;\n\t\tint result = 1;\n\n\t\twhile (left <= right) {\n\t\t\tlong mid = (left + right) / 2;\n\n\t\t\tif (mid * mid > x) {\n\t\t\t\tright = (int) mid - 1;\n\t\t\t} else {\n\t\t\t\tif ((mid + 1) * (mid + 1) > x) {\n\t\t\t\t\tresult = (int) mid;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tleft = (int) mid + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "private double norm(IDictionary<String, Double> vector) {\n\t\t double output = 0.0;\n\t\t for (KVPair<String, Double> pair : vector) {\n\t\t\t double score = pair.getValue();\n\t\t output = output + (score * score);\n\t\t }\n\t return Math.sqrt(output);\t \n }", "@Test\n public void test16() throws Throwable {\n Complex complex0 = new Complex(0.0, 236.4);\n Complex complex1 = complex0.asin();\n Complex complex2 = complex1.atan();\n Complex complex3 = complex0.sin();\n Complex complex4 = (Complex)complex0.readResolve();\n double double0 = complex0.abs();\n Complex complex5 = complex0.log();\n Complex complex6 = complex1.sin();\n Complex complex7 = complex0.cos();\n String string0 = complex3.toString();\n Complex complex8 = complex1.multiply(complex2);\n try { \n complex3.nthRoot((-1));\n } catch(IllegalArgumentException e) {\n //\n // cannot compute nth root for null or negative n: -1\n //\n assertThrownBy(\"org.apache.commons.math.MathRuntimeException\", e);\n }\n }", "public static final int accurateSqrt(int x) \n\t {\n\t int xn;\n\n\t if (x >= 0x10000) {\n\t if (x >= 0x1000000) {\n\t if (x >= 0x10000000) {\n\t if (x >= 0x40000000) {\n\t xn = table[x >> 24] << 8;\n\t } else {\n\t xn = table[x >> 22] << 7;\n\t }\n\t } else {\n\t if (x >= 0x4000000) {\n\t xn = table[x >> 20] << 6;\n\t } else {\n\t xn = table[x >> 18] << 5;\n\t }\n\t }\n\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\t return adjustment(x, xn);\n\t } else {\n\t if (x >= 0x100000) {\n\t if (x >= 0x400000) {\n\t xn = table[x >> 16] << 4;\n\t } else {\n\t xn = table[x >> 14] << 3;\n\t }\n\t } else {\n\t if (x >= 0x40000) {\n\t xn = table[x >> 12] << 2;\n\t } else {\n\t xn = table[x >> 10] << 1;\n\t }\n\t }\n\n\t xn = (xn + 1 + (x / xn)) >> 1;\n\n\t return adjustment(x, xn);\n\t }\n\t } else {\n\t if (x >= 0x100) {\n\t if (x >= 0x1000) {\n\t if (x >= 0x4000) {\n\t xn = (table[x >> 8]) + 1;\n\t } else {\n\t xn = (table[x >> 6] >> 1) + 1;\n\t }\n\t } else {\n\t if (x >= 0x400) {\n\t xn = (table[x >> 4] >> 2) + 1;\n\t } else {\n\t xn = (table[x >> 2] >> 3) + 1;\n\t }\n\t }\n\n\t return adjustment(x, xn);\n\t } else {\n\t if (x >= 0) {\n\t return adjustment(x, table[x] >> 4);\n\t }\n\t }\n\t }\n\t \n\t //illegalArgument();\n\t return -1;\n\t }", "private double snrm( int n, double sx[], int itol ) {\n int isamax;\n double ans;\n\n if (itol <= 3) {\n ans = 0.0;\n for( int i = 0; i < n; i++ )\n ans += sx[i] * sx[i];\n return Math.sqrt(ans);\n } else {\n isamax = 0;\n for( int i = 0; i < n; i++ ) {\n if (Math.abs(sx[i]) > Math.abs(sx[isamax]))\n isamax = i;\n }\n return Math.abs(sx[isamax]);\n }\n }", "private static double sq (double x) {\n return Math.pow(x, 2);\n }", "protected static float getSquareDistance(PVector p1, PVector p2) {\n\t\tfloat dx = p1.x - p2.x;\n\t\tfloat dy = p1.y - p2.y;\n\n\t\treturn dx * dx + dy * dy;\n\t}", "public static final int fastSqrt(int x) \n\t {\n\t if (x >= 0x10000) {\n\t if (x >= 0x1000000) {\n\t if (x >= 0x10000000) {\n\t if (x >= 0x40000000) {\n\t return (table[x >> 24] << 8);\n\t } else {\n\t return (table[x >> 22] << 7);\n\t }\n\t } else if (x >= 0x4000000) {\n\t return (table[x >> 20] << 6);\n\t } else {\n\t return (table[x >> 18] << 5);\n\t }\n\t } else if (x >= 0x100000) {\n\t if (x >= 0x400000) {\n\t return (table[x >> 16] << 4);\n\t } else {\n\t return (table[x >> 14] << 3);\n\t }\n\t } else if (x >= 0x40000) {\n\t return (table[x >> 12] << 2);\n\t } else {\n\t return (table[x >> 10] << 1);\n\t }\n\t } else if (x >= 0x100) {\n\t if (x >= 0x1000) {\n\t if (x >= 0x4000) {\n\t return (table[x >> 8]);\n\t } else {\n\t return (table[x >> 6] >> 1);\n\t }\n\t } else if (x >= 0x400) {\n\t return (table[x >> 4] >> 2);\n\t } else {\n\t return (table[x >> 2] >> 3);\n\t }\n\t } else if (x >= 0) {\n\t return table[x] >> 4;\n\t }\n\t //illegalArgument();\n\t return -1;\n\t }", "double distanceSq (double px, double py);", "public float lengthSquared ()\n {\n return (x*x + y*y);\n }", "public double distancesq(Point pt1, Point pt2) throws Exception {\r\n\t\t//test_ef4ggt - Success\r\n\t\tif (pt1.getlength() != pt2.getlength()) {throw new Exception(\"The points are not in the same dimension\");}\r\n\t\tdouble dissq=0;\r\n\t\tfor (int i=0;i<pt1.getlength();i++) {\r\n\t\t\tdissq+=pow(pt1.getcoordinates()[i]-pt2.getcoordinates()[i],2);\r\n\t\t}\r\n\t\t//test_34jfGR - Success\r\n\t\treturn dissq;\r\n\t}", "public double lengthsq()\n {\n return Math.pow(this.x, 2) + Math.pow(this.y, 2);\n }", "public static UNumber squareRoot(UNumber input) {\r\n\t\t\t\r\n\t\t\t\t\tUNumber theValue = new UNumber(input,numSignificantDigits);\t\t\t\t\t\r\n\t\t\t\t\tUNumber two = new UNumber(\"2.0\", 1, true, 40);\t\t\t\t\r\n\t\t\t\t\tUNumber newGuess = new UNumber(theValue,40);\t\t\t\t// Compute the estimate\r\n\t\t\t\t\tnewGuess.div(two);\r\n\t\t\t\t\tUNumber oldGuess = null;\t\t\t\t\t\t\t\t\t\t// Temporary value for determining when to terminate the loop\r\n\t\t\t\t\tint digitsMatch = 0;\r\n\t\t\t\t\tdo {\r\n\t\t\t\t\t\toldGuess = newGuess;\t\t\t\t\t\t\t\t// Save the old guess\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNumber temp = new UNumber(theValue,numSignificantDigits);\r\n\t\t\t\t\t\ttemp.div(oldGuess);\r\n\t\t\t\t\t\ttemp.add(oldGuess);\r\n\t\t\t\t\t\ttemp.div(two);\r\n\t\t\t\t\t\tnewGuess = new UNumber(temp, 40);\r\n\r\n\t\t\t\t\t\tdigitsMatch = howManyDigitsMatch(newGuess, oldGuess);\r\n\t\t\t\t\t} while (digitsMatch < numSignificantDigits);\t\t\t// Determine if the old and the new guesses are \"close enough\"\r\n\r\n\t\t\t\t\t//System.out.println(newGuess);\r\n\t\t\t\t\treturn newGuess;\r\n\t\t\t\t\r\n\t\t\t}", "private boolean isSquare(int i) {\n\t\tdouble s = Math.sqrt(i);\n\t\tif (Math.floor(s) - s == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static Vector<Double> norm(Vector<Double> a) {\n\t\tdouble x = TransEInitializer.vec_len(a);\n\t\tif (x > 1){\n\t\t\t\n\t\t\tfor (int ii = 0; ii < a.size(); ii++)\n\t\t\t\ta.set(ii, a.get(ii) / x);\n\t\t\n\n\t\t}\n\n//\t\tif(x > 1)\n//\t\t\treturn true;\n//\t\treturn false;\n\t\treturn a;\n\t}", "public float squared(){\r\n\t\treturn this.dottedWith( this );\r\n\t}", "private double square(double x) {\r\n return x * x;\r\n }", "private void squareRoot()\n\t{\n\t\tif(Fun == null)\n\t\t{\n\t\t\tsetLeftValue();\n\t\t\tresult = calc.squareRoot ();\n\t\t\tupdateText();\n\t\t\tsetLeftValue();\n\t\t}\n\t}", "private double d(Point a, Point b){\n\t\treturn Math.sqrt(Math.pow(b.getX()-a.getX(),2) + Math.pow(a.getY() - b.getY(), 2));\r\n\t}", "private static double getSinSquare(Double value){\r\n\t\treturn Math.pow(Math.sin(value/2), 2);\r\n\r\n }", "private static int Sqrt(double d) {\n\t\treturn 0;\n\t}", "public T magnitudeSquared();", "private static double calculaDistancia(double[] param1, double[] param2){\n\t\tdouble res1= Math.pow((param1[0]-param2[0]), 2);\n\t\tdouble res2= Math.pow((param1[1]-param2[1]), 2);\n\t\tdouble res3= Math.pow((param1[2]-param2[2]), 2);\n\t\tdouble res4= res1 + res2 + res3;\n\t\tdouble res5= res4/3;\n\t\tdouble res6= Math.sqrt(res5);\n\t\treturn res6;\n\t}" ]
[ "0.78138006", "0.7651869", "0.7418027", "0.73828065", "0.73470604", "0.7324791", "0.731228", "0.7085209", "0.7048305", "0.6980342", "0.69627297", "0.69237876", "0.69078404", "0.69035906", "0.6902992", "0.6860938", "0.68053174", "0.67599493", "0.67506593", "0.674765", "0.6659061", "0.6657197", "0.66210675", "0.6615394", "0.6572788", "0.6566644", "0.65530026", "0.6545062", "0.65392333", "0.65373415", "0.653636", "0.6530841", "0.64784503", "0.64704955", "0.6460873", "0.6460151", "0.6451615", "0.6419133", "0.640298", "0.637461", "0.63694054", "0.63511395", "0.63308376", "0.63111824", "0.63068175", "0.6298172", "0.62952834", "0.62741774", "0.6214747", "0.6207175", "0.62023187", "0.62007517", "0.6198598", "0.6178944", "0.61718965", "0.6169768", "0.6167941", "0.6158505", "0.615767", "0.6152561", "0.61415493", "0.6124364", "0.6112593", "0.6109183", "0.6095679", "0.6090672", "0.608187", "0.60323346", "0.6021434", "0.60201174", "0.6012068", "0.6004073", "0.5992002", "0.59904975", "0.59754086", "0.5974856", "0.5967429", "0.59520257", "0.5947015", "0.59428793", "0.5939594", "0.5925874", "0.5904591", "0.58915526", "0.5874288", "0.5835319", "0.5820631", "0.58131266", "0.58109176", "0.58106315", "0.58050877", "0.5801663", "0.58003736", "0.5797462", "0.5794911", "0.5788206", "0.5777929", "0.5774677", "0.57706046", "0.57699084" ]
0.6462095
34
Resets the array to its original configuration and return it.
public int[] reset() { return originalArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[] reset() {\n return Arrays.copyOf(origin, origin.length);\n }", "public int[] reset() {\r\n return reset;\r\n }", "public int[] reset() \n {\n return reset;\n }", "public int[] reset() {\n return store;\n }", "private int[] reset() {\n return data;\n }", "public int[] reset() {\n return nums.clone();\n }", "private T[] modifyArray(T[] array) {\n array[index] = null;\n return array;\n }", "@SuppressWarnings({\"unused\", \"RedundantSuppression\"})\n public void resetArray() {\n Utils.postToMainLoop(new Runnable() {\n @Override\n public void run() {\n mBaseCacheAdapter.resetArray();\n mBaseRecyclerViewAdapter.notifyDataSetChanged();\n }\n\n @NonNull\n @Override\n public String toString() {\n return \"BaseCacheAdapterWrapper.resetArray()\";\n }\n });\n }", "public static int[] reset() {\n nums = Arrays.copyOf(numsBackUp, numsBackUp.length);\n return nums;\n }", "@Override\n public void clear() {\n array.reset();\n }", "public void compact()\n {\n array = toArray();\n }", "void reset() {\n for (int i = 0; i < array.length; i++) {\n array[i] = -1;\n }\n }", "public int[] reset() {\n\t\treturn memos;\n\t}", "private void reset(){\n int j=0;\n for(int i=0; i<array.length; i++){\n if(j == itemCount) {return;}\n if(array[i]!=null){\n temp[j] = array[i];\n j++;\n }\n }\n }", "public int[] reset() {\n System.out.println(Arrays.toString(soluzioneIniziale));\n return soluzioneIniziale;\n }", "private void restartArray() {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n Start.shemaArray[i][j].baseModel.state = 0;\n }\n }\n }", "public int[] reset() {\r\n return nums;\r\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public int[] reset() {\n return nums;\n }", "public GoLBoard reset()\n\t{\n\t\treturn reset(new GoLRandomInitializer(setSize));\n\t}", "void reset()\n {\n reset(values);\n }", "public int[] clone()\n\t{\t\n\t\tint[] newArray = new int[array.length];\n\t\tfor (int index = 0; index < arraySize; index++)\n\t\t{\n\t\t\tnewArray[index] = array[index];\n\t\t}\n\t\treturn newArray;\n\t}", "public int[] reset() {\r\n\t\t\treturn this.initNums;\r\n\t\t}", "@Override\r\n\tpublic void reset() {\r\n\t\tthis.priorityElements = Lists.newArrayList(originalElements);\r\n\t\tCollections.shuffle(priorityElements);\r\n\t\tthis.currentElements = Lists.newArrayListWithExpectedSize(2 * originalElements.size());\r\n\t\tthis.currentElements.addAll(originalElements);\r\n\t}", "public void restore() {\n currentIm= originalIm.copy();\n }", "public void resetChangeableArrays(int[] reg)\n {\n valList = new LinkedList<Integer>();\n possibilityList = new LinkedList<Point>();\n for(int j = 0; j<accumulator.length; j ++)Arrays.fill(accumulator[j],0);\n //accumulator = zeroAccumulator;\n region = reg;\n \n }", "private int[] cloneArr(final int[] origArr) {\n return Arrays.copyOf(origArr, origArr.length);\n }", "public void reset_array() {\r\n\t\tfor(int i=0;i<9;i++) {\r\n\t\t\ts[i]=\"\";\r\n\t\t}\r\n\t}", "public Array<T> compactClone()\n {\n Array<T> out = Array.fromUnsafe(new Object[next], next);\n System.arraycopy(array, 0, out.array, 0, next);\n return out;\n }", "public int[] shuffle() {\n\t\t\tif (originalArr == null)\n\t\t\t\treturn null;\n\t\t\tint randomArr[] = originalArr.clone();\n\t\t\tfor (int i = 1; i < originalArr.length; i++) {\n\t\t\t\tint newIndex = random.nextInt(i + 1);\n\t\t\t\tswap(i, newIndex, randomArr);\n\t\t\t}\n\t\t\treturn randomArr;\n\t\t}", "public void reset() {\n for (int i = 0; i < this.numRows; i++) {\n this.rows[i] = new int[0];\n }\n for (int k = 0; k < this.numCols; k++) {\n this.cols[k] = new IntOpenHashSet();\n }\n }", "public UnorderedArray cloneArray(){\r\n UnorderedArray clone = new UnorderedArray(maxSize);\r\n clone.mArray = mArray.clone();\r\n clone.numItems = numItems;\r\n return clone;\r\n }", "public OccList reset()\n {\n size = 0;\n return this;\n }", "private void reset() {\n\t\tdata.clear();\n\t}", "public void reSize() {\n int newSize = arr.length * 2;\n arr = Arrays.copyOf(arr, newSize);\n }", "public void reset() {\n this.setIndex(0);\n }", "private void resetMask() {\n maskArray = new int [][]{\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0}\n };\n }", "public void reset() {\n this.predictor.reset();\n for(int i=0; i<this.predictedIntraday.length; i++) {\n this.predictedIntraday[i] = 0;\n }\n }", "public void reset() {\n\t\tlength = 0;\n\t}", "@Override\n public void resetAllValues() {\n }", "private static void modifyArray(int[] array) {\n\t\t\n\t\tarray[0] = 99;\n\t\t\n\t\tarray = new int[5] ;\n\t\treturn;\n\t}", "public GoLBoard reset(GoLInitializer myInitializer)\n\t{\n \tmyGoLCell = myInitializer.getCellArray();\n \treturn this;\n\t}", "protected void recycleArray(Bitmap[][] array)\n\t{\n\t\tint length = array.length;\n\t\tfor(int i = 0; i < length; i++)\n\t\t{\n\t\t\tif(array[i] != null)\n\t\t\t{\n\t\t\t\tint length2 = array[i].length;\n\t\t\t\tfor(int j = 0; j < length2; j++)\n\t\t\t\t{\n\t\t\t\t\tif(array[i][j] != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray[i][j].recycle();\n\t\t\t\t\t\tarray[i][j] = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void resetGrid() {\n grid = new byte[grid.length];\n }", "public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}", "@Override\n public void clear() {\n array = null;\n }", "@Override\n\tpublic void resetToExisting() {\n\t\t\n\t}", "private void reallocate() {\n capacity = 2 * capacity;\n ElementType[] newData = (ElementType[]) new Object[DEFAULT_INIT_LENGTH];\n System.arraycopy(elements, 0, newData, 0, size);\n elements = newData;\n }", "public static void fillArray() {\r\n\t\tfor (int i = 0; i < myOriginalArray.length - 1; i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tmyOriginalArray[i] = rand.nextInt(250);\r\n\t\t}\r\n\t\t// Copies original array 4 times for algorithm arrays\r\n\t\tmyBubbleArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmySelectionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyInsertionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyQuickArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t}", "public void reset() {\n this.index = this.startIndex;\n }", "protected void recycleArray(Bitmap[] array)\n\t{\n\t\tint length = array.length;\n\t\tfor(int i = 0; i < length; i++)\n\t\t{\n\t\t\tif(array[i] != null)\n\t\t\t{\n\t\t\t\tarray[i].recycle();\n\t\t\t\tarray[i] = null;\n\t\t\t}\n\t\t}\n\t}", "public DynamicArray<E> copy(DynamicArray<E> array) {\n synchronized (this) {\n return this.array;\n }\n }", "public void reset() {\n\t\t\t\t\r\n\t\t\t}", "public void reset() {\n\t\tfor (int i=0; i < this.WAYS; i++) {\n\t\t\tthis.cache[i] = new Line(this.alpha[i], REPL_VAL);\n\t\t}\n\t\t// set mru\n\t\tthis.cache[this.WAYS-1].state = INSERT_VAL;\n\t}", "public int[] cloneMemory(){\n return memory.clone();\n }", "public void reset () {\n\t\topen();\n\t\ttry {\n\t\t\tcontainer.setLength(0);\n\t\t\treservedBitMap.setLength(0);\n\t\t\tupdatedBitMap.setLength(0);\n\t\t\tfreeList.setLength(0);\n\t\t\tsize = 0;\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t}\n\t}", "public void resetField() {\n setFields(new boolean[getLength()][getHeight()]);\n }", "@Override\r\n\t\t\tpublic void reset() {\n\t\t\t\t\r\n\t\t\t}", "public void newArray() {\n\t\t\n\t\tE[] newArray= (E[]) new Object[list.length * 2]; //Holds the old elements from the list array while new list array is being made\n\t\t\n\t\tfor(int i = 0; i < list.length; i++) {\n\t\t\t\n\t\t\tnewArray[i] = list[i]; //Copy the old list array into the newArray\n\t\t}\n\t\t\n\t\tlist = newArray; //Point the old array at the newArray starting memory location\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n public final T[] obtainArrayCopy() {\n final T[] localArray = array;\n if (localArray == null) return (T[]) Array.newInstance(clazz, 0);\n\n return Arrays.copyOf(localArray, localArray.length);\n }", "private void trimArray()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"[INFO] <RADIOBUTTON_PANEL_BUILDER> Running trimArray\");\r\n\t\t\t\r\n\t\t\tJRadioButton[] newArray = new JRadioButton[nextRadioButtonLocation]; // Create a new array of the correct size\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < nextRadioButtonLocation; i++) // For each object in the array\r\n\t\t\t{\r\n\t\t\t\tnewArray[i] = radioButtons[i]; // Copy the object\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tradioButtons = newArray; // Store the new trimmed array in components\r\n\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void reset() {\n\t\t\t\t\n\t\t\t}", "private void reallocate(){\n capacity = 2 * capacity;\n theData = Arrays.copyOf(theData, capacity);\n }", "public void reset () {}", "public void reset() {\n\n\t}", "@Override\r\n\tpublic void reset()\r\n\t{\r\n\t}", "@Override\n\t\tprotected void reset()\n\t\t{\n\t\t}", "private final void restoreOriginalGraph() {\n // Safeguard against multiple restores\n if (startIndex == -1) return;\n \n markEdgesFrom(startIndex, false);\n markEdgesFrom(endIndex, false);\n markHasEdgeToGoal(false);\n nOutgoingEdgess[endIndex] = endOriginalSize;\n nOutgoingEdgess[startIndex] = startOriginalSize;\n nEdges = originalNEdges;\n\n nNodes = originalSize;\n startIndex = -1;\n endIndex = -1;\n }", "public ResizingArray() {\r\n super();\r\n this.aObjects = new Object[ResizingArray.DEFAULT_SIZE];\r\n this.aFreeElements = new int[ResizingArray.DEFAULT_SIZE];\r\n }", "public void reallocate()\r\n\t{\r\n\t\tE[] newArray = (E[]) new Object[capacity * 2];\r\n\t\tint i = 0;\r\n\t\tfor(i = 0; i < this.size(); i++)\r\n\t\t{\r\n\t\t\tnewArray[i] = innerArray[(front + i) % capacity];\r\n\t\t\tSystem.out.println((front + i) % capacity);\r\n\t\t}\r\n\t\tfront = 0;\r\n\t\trear = this.size() - 1;\r\n\t\tcapacity = capacity * 2;\r\n\t\tinnerArray = newArray;\r\n\t}", "public void reset(final byte[] treeData) {\n \t\traw = treeData;\n \t\trawPtr = 0;\n \t}", "protected abstract void reset();", "public void reset() {\r\n\t\tcards.addAll(dealt);\r\n\t\tdealt.clear();\r\n\t}", "public void reset() {\n\n }", "public OpRewriter reset() {\n result = OpSequence.create();\n return this;\n }", "public static int[] copy(int[] theArray) {\n\n return theArray.clone();\n }", "private static void resetGroupLineArrays() {\n // Reset the arrays to make sure that we have uptodate information in them\n itemsArray = null;\n itemsArrayForAlterations = null;\n itemsArrayForOpenDeposit = null;\n }", "public T[] toArray() {\n return null;\n }", "@Override\n public void reset() \n {\n\n }", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();" ]
[ "0.697118", "0.6904059", "0.68361205", "0.6714145", "0.6640303", "0.64434683", "0.6318128", "0.6288678", "0.62609303", "0.6259935", "0.6196086", "0.6185046", "0.6129283", "0.60915095", "0.601098", "0.60055953", "0.5967921", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.59418577", "0.5872889", "0.5870918", "0.57786286", "0.5768219", "0.57543355", "0.5716322", "0.5685787", "0.56746763", "0.5663266", "0.5663077", "0.56539774", "0.5636272", "0.56317455", "0.5601983", "0.55621237", "0.5538473", "0.55365205", "0.5524326", "0.55232364", "0.5515195", "0.5507188", "0.54990935", "0.54981965", "0.54725003", "0.54724085", "0.54705334", "0.54596317", "0.54540956", "0.542261", "0.54031897", "0.5390596", "0.53796774", "0.5376527", "0.53748786", "0.53740066", "0.53673774", "0.5346156", "0.5341975", "0.53368694", "0.53350514", "0.5333946", "0.5333095", "0.53167206", "0.53167206", "0.53167206", "0.53167206", "0.5314903", "0.53133017", "0.52908844", "0.5282181", "0.5277244", "0.52719283", "0.52713454", "0.5267086", "0.52567065", "0.5256291", "0.5249986", "0.5246228", "0.5242759", "0.5241111", "0.52362406", "0.52356803", "0.52347755", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565", "0.5230565" ]
0.7683946
0
Returns a random shuffling of the array.
public int[] shuffle() { if (originalArr == null) return null; int randomArr[] = originalArr.clone(); for (int i = 1; i < originalArr.length; i++) { int newIndex = random.nextInt(i + 1); swap(i, newIndex, randomArr); } return randomArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int[] shuffle() {\n int len = data_random.length;\n Random rand = new Random();\n for (int i = 0; i < len; i++) {\n int r = rand.nextInt(len);\n int temp = data_random[i];\n data_random[i] = data_random[r];\n data_random[r]=temp;\n }\n return data_random;\n }", "public int[] shuffle() {\n int[] result = reset();\n\n Random rand = new Random();\n for (int i = 0; i < result.length; i++) {\n int j = rand.nextInt(result.length - i) + i;\n int tmp = result[i];\n result[i] = result[j];\n result[j] = tmp;\n }\n return result;\n }", "private static void shuffleArray(int[] array)\n {\n int index, temp;\n Random random = new Random();\n for (int i = array.length - 1; i > 0; i--)\n {\n index = random.nextInt(i + 1);\n temp = array[index];\n array[index] = array[i];\n array[i] = temp;\n }\n }", "Actor[] shuffle(Actor[] array) {\n for (int i = array.length; i > 0; i--) {\n int k = rand.nextInt(i);\n Actor tmp = array[k];\n array[k] = array[i - 1];\n array[i - 1] = tmp;\n }\n return array;\n }", "public static <T> void shuffle(T[] array){\n Random rnd = ThreadLocalRandom.current();\n for (int i = array.length - 1; i > 0; i--)\n {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n T a = array[index];\n array[index] = array[i];\n array[i] = a;\n }\n }", "public static <T> void shuffle(T[] array){\n Random rnd = ThreadLocalRandom.current();\n for (int i = array.length - 1; i > 0; i--)\n {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n T a = array[index];\n array[index] = array[i];\n array[i] = a;\n }\n }", "private static void shuffleArray(final int[] a) {\n for (int i = 1; i < a.length; i++) {\n int j = random.nextInt(i);\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }\n }", "private static void shuffleArray(int[] ar) {\n Random rnd = ThreadLocalRandom.current();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n int a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public void shuffle();", "public int[] shuffle() {\r\n if (nums == null) return nums;\r\n int tmp = 0;\r\n \r\n int[] newNums = nums.clone();\r\n \r\n for (int i=1; i<newNums.length; i++) {\r\n int selectPos = rd.nextInt(i+1);\r\n tmp = newNums[i];\r\n newNums[i] = newNums[selectPos];\r\n newNums[selectPos] = tmp;\r\n }\r\n \r\n return newNums;\r\n }", "public int[] shuffle() {\r\n int max = nums.length - 1;\r\n for (int i = 0; i < nums.length; i++) {\r\n int index = new Random().nextInt(max)%(max - i + 1) + i;\r\n int tmp = nums[i];\r\n nums[i] = nums[index];\r\n nums[index] = tmp;\r\n }\r\n return nums;\r\n }", "public static void shuffle(int[] array)\n {\n int n = array.length;\n for (int i = 0; i < n; i++)\n {\n // choose index uniformly in [0, i]\n //explicit conversion to int\n int r = (int) (Math.random() * (i + 1));\n swap(array,r,i);\n }\n }", "public int[] shuffle() {\n for (int i = nums.length - 1; i >= 0; i--) {\n swap(i, rnd.nextInt(i + 1));\n }\n \n return nums;\n }", "void shuffleArray(String[] ar) {\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n String a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "void shuffle();", "void shuffle();", "private static char[] shuffle(char[] array) {\n\t\tRandom rand = new Random();\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tint randIndex = rand.nextInt(array.length - 1);\n\t\t\tchar temp = array[i];\n\t\t\tarray[i] = array[randIndex];\n\t\t\tarray[randIndex] = temp;\n\t\t}\n\t\treturn array;\n\t}", "public static void shuffle(int[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n int temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public void shuffle() {\n for (int i = size - 1; i > 0; i--) {\n swap(i, (int)(Math.random() * (i + 1)));\n }\n }", "public static void shuffle( int[] a ) {\n int N = a.length;\n \n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public static int[] shuffle() {\n Random random = new Random();\n for (int i = 0; i < len; i++) {\n int j = random.nextInt(len);\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n }\n return nums;\n }", "static void shuffleArray(String[] ar)\r\n {\n Random rnd = ThreadLocalRandom.current();\r\n for (int i = ar.length - 1; i > 0; i--)\r\n {\r\n int index = rnd.nextInt(i + 1);\r\n // Simple swap\r\n String a = ar[index];\r\n ar[index] = ar[i];\r\n ar[i] = a;\r\n }\r\n }", "public int[] shuffle() {\n if (nums == null) {\n return null;\n }\n int[] a = nums.clone();\n for (int j = 1; j < a.length; j++) {\n // 类似蓄水池采样算法\n // i == j -> 1/(1+j)\n // j != j -> (1 - 1/(1+j)) * (1/j) = 1/(1/j)\n int i = random.nextInt(j + 1);\n swap(a, i, j);\n }\n return a;\n }", "public int[] shuffle() {\n int[] shuffle = nums.clone();\n for(int i = 0; i < shuffle.length; i++){\n int index = random.nextInt(i + 1);\n swap(shuffle,i,index);\n }\n return shuffle;\n }", "public int[] shuffle() {\n int i = random.nextInt(nums.length);\n int j = random.nextInt(nums.length);\n swap(temp, i , j);\n return temp;\n }", "public int[] shuffle() {\n int[] shuffle = new int[nums.length];\n int[] clone = nums.clone();\n int last = clone.length - 1;\n for(int i = 0; i < clone.length; i++){\n int index = random.nextInt(last + 1);\n shuffle[i] = clone[index];\n clone[index] = clone[last--];\n }\n return shuffle;\n }", "public int[] shuffle() {\n int[] res = new int[nums.length];\n int r;\n for (int i = 0; i < nums.length; i++) {\n r = random.nextInt(i + 1);\n res[i] = res[r];\n res[r] = nums[i];\n }\n\n\n return res;\n }", "static void shuffleArray(int[] ar) {\n Random rnd = new Random();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n int a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public int[] shuffle() {\n int[] random = new int[nums.length];\n for (int i = 0; i < nums.length; i++) {\n // generate a random between 0 ~ i\n int r = (int)(Math.random() * (i + 1));\n random[i] = random[r];\n random[r] = nums[i];\n }\n return random;\n }", "public static void shuffle( Object[] a ) {\n int N = a.length;\n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n Object temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public int[] shuffle() {\n\t\tRandom r = new Random();\n\t\tfor (int i = 0; i < this.nums.length; i++) {\n\t\t\tint index = r.nextInt(this.nums.length);\n\t\t\tif (i != index) {\n\t\t\t\tnums[i] = nums[i] ^ nums[index];\n\t\t\t\tnums[index] = nums[i] ^ nums[index];\n\t\t\t\tnums[i] = nums[i] ^ nums[index];\n\t\t\t}\n\t\t}\n\t\treturn nums;\n\t}", "public void shuffle() {\n for (int i = 0; i < this.cards.length ; i++ ) {\n double x = Math.floor(Math.random() * ((double)this.cards.length - (double)0)) + (double)0;\n Card temp = this.cards[i];\n this.cards[i]= this.cards[(int)x];\n this.cards[(int)x]= temp;\n }\n }", "public static int[] selectionShuffle(int[] arr) { \n int temp;\n int idx;\n for(int i = 0; i < arr.length; i ++){\n idx = (int) (Math.random() * arr.length);\n temp = arr[i];\n arr[i] = arr[idx];\n arr[idx] = temp;\n }\n return arr;\n }", "public static void shuffle(Object[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n Object temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public int[] shuffle() {\n int[] shuffled = Arrays.copyOf(origin, origin.length);\n \n for (int i = shuffled.length - 1; i > 0; i--) {\n int index = random.nextInt(i + 1);\n int temp = shuffled[i];\n shuffled[i] = shuffled[index];\n shuffled[index] = temp;\n }\n return shuffled;\n }", "public static void shuffle(double[] a) {\r\n int N = a.length;\r\n for (int i = 0; i < N; i++) {\r\n int r = i + uniform(N-i); // between i and N-1\r\n double temp = a[i];\r\n a[i] = a[r];\r\n a[r] = temp;\r\n }\r\n }", "public static void shuffle( double[] a ) {\n int N = a.length;\n \n for ( int i = 0; i < N; i++ ) {\n int r = i + uniform( N - i ); // between i and N-1\n double temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "public static void shuffle(String[] arrayList){\n int num=arrayList.length; \n for(int j=0;j<60;j++){ // the number of shuffling>50 times, so I choose 60 times\n for(int i=0;i<num;i++){ \n int index=(int)(Math.random()*num);\n //Swap the position of elements in the array at that index with the first element\n String temp=arrayList[i]; \n arrayList[i]=arrayList[index];\n arrayList[index]=temp;\n }}}", "public void shuffle()\r\n\t{\r\n\t\tRandom rand = ThreadLocalRandom.current();\r\n\t\t\r\n\t\tfor (int i = topCard; i > 0; i--)\r\n\t\t{\r\n\t\t\tint index = rand.nextInt(i + 1);\r\n\t\t\tString temp = cards[index];\r\n\t\t\tcards[index] = cards[i];\r\n\t\t\tcards[i] = temp;\r\n\t\t}\r\n\t}", "public int[] shuffle() {\n int[] shuffled = new int[length];\n for (int i = 0; i < length; i++)\n shuffled[i] = nums[i];\n for (int i = 0; i < length; i++) {\n int randomIndex = (int) (Math.random() * length);\n int temp = shuffled[i];\n shuffled[i] = shuffled[randomIndex];\n shuffled[randomIndex] = temp;\n }\n return shuffled;\n }", "static public <T> void shuffle(T[] a, RNG rng) {\r\n\r\n for (int i = a.length - 1; i > 0; i--) {\r\n int j = (int) rng.random((i + 1));\r\n //System.out.println(j);\r\n T x = a[i];\r\n a[i] = a[j];\r\n a[j] = x;\r\n }\r\n \r\n }", "private static void scrambleArray(int[] a, boolean randomize) {\n\t\tfor (int k = 0; k < a.length; k++)\n\t\t\ta[k] = k;\n\t\tif (randomize) // use unpredictable random shuffle\n\t\t{\n\t\t\tRandom gen = new Random();\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, gen.nextInt(a.length));\n\t\t\t}\n\t\t} else // use repeatable math formula for shuffle\n\t\t{\n\t\t\tint cell = (int) (a.length * 3.14159) % a.length;\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, cell);\n\t\t\t\tcell = (int) (cell * 3.14159) % a.length;\n\t\t\t}\n\t\t}\n\n\t}", "public static void shuffle(int data[]) {\n\n }", "public static int[] shuffle(int[] deck){\n\t\tRandom rnd = new Random();\n\t for (int i = deck.length - 1; i > 0; i--)\n\t {\n\t int index = rnd.nextInt(i + 1);\n\t int a = deck[index];\n\t deck[index] = deck[i];\n\t deck[i] = a;\n\t }\n\t return deck;\n\t}", "public int[] shuffle() {\r\n\t\t\tRandom r = new Random();\r\n\t\t\tint[] shuffle = new int[this.nums.length];\r\n\t\t\tint i = 0;\r\n\t\t\tMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();\r\n\t\t\twhile (i < this.nums.length) {\r\n\t\t\t\tint count = r.nextInt(this.nums.length);\r\n\t\t\t\tif (map.get(count) != null && map.get(count)) {\r\n\t\t\t\t} else {\r\n\t\t\t\t\tshuffle[i] = this.nums[count];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tmap.put(count, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn shuffle;\r\n\t\t}", "public void shuffle() {\n\t\tCollections.shuffle(inds);\n\t}", "public void shuffle() {\n\t\tCollections.shuffle(Arrays.asList(reel));\n\t}", "@Override\n public <T> T[] shuffle(T[] elements) {\n return super.shuffle(elements);\n }", "public void shuffle() {\n Collections.shuffle(this);\n }", "public void shuffle() {\r\n for (int i = 0; i < this.numCards; i++) {\r\n int spot = (int) (Math.random() * ((this.numCards - 1) - i + 1) + i);\r\n Card temp = cards[i];\r\n cards[i] = cards[spot];\r\n cards[spot] = temp;\r\n\r\n\r\n }\r\n }", "public paintIntegers[] shuffle(paintIntegers[] arr){\n paintIntegers[] arrayNew = new paintIntegers[arr.length];\n paintIntegers.initPaint(arrayNew);\n //updates n\n n = arr.length;\n for(int i = 0; i < arrayNew.length; i++){\n arrayNew[i].val = i + 1;\n }//init the array with 0 to n;\n for(int i = 0; i < arrayNew.length; i++){ // shuffles the array\n //random index past current -> thats why random\n int ridx = i + rand.nextInt(arrayNew.length - i);\n //swap values\n int temp = arrayNew[ridx].val;\n arrayNew[ridx].val = arrayNew[i].val;\n arrayNew[i].val = temp;\n }\n // new origarray array\n return arrayNew.clone();\n }", "static void shuffleArray(String[] ar) {\n Random rnd = new Random();\n for (int i = ar.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i + 1);\n // Simple swap\n String a = ar[index];\n ar[index] = ar[i];\n ar[i] = a;\n }\n }", "public static void scrambledArray(int[] array){\n Random rand=new Random();// use java.util.random method to scramble the index number\n for(int i=0;i<array.length;i++){\n int num=rand.nextInt(15);\n // swap the two different positioned values by swaping their index number \n int temp=array[i];\n array[i]=array[num];\n array[num]=temp; }\n }", "public abstract void shuffled();", "public Deck randomShuffle(){\n\t\tshuffleOnceRandom();\n\t\tshuffleOnceRandom();\n\t\treturn ourDeck;\n\t}", "public static List arrayShuffle(List arrayToShuffle)\n\t{\n\t\tCollections.shuffle(arrayToShuffle);\n\t\treturn arrayToShuffle;\n\t}", "public int[] shuffle() \n {\n List<Integer> al = new ArrayList(reset.length);\n //push all values of the original array onto an arraylist\n for(int i = 0; i < reset.length; i++)\n {\n al.add(reset[i]);\n }\n //shuffles the arraylist\n Collections.shuffle(al);\n return al.stream().mapToInt(Integer::intValue).toArray();\n }", "public void shuffle() {\n\t\tfor (int i = deck.length - 1; i > 0; i--) {\n\t\t\tint rand = (int) (Math.random() * (i + 1));\n\t\t\tCard temp = deck[i];\n\t\t\tdeck[i] = deck[rand];\n\t\t\tdeck[rand] = temp;\n\t\t}\n\t\tcardsUsed = 0;\n\t}", "void myshuffleArray(String[] ar1, String[] ar2) {\n for (int i = ar1.length - 1; i > 0; i--) {\n int index = rnd.nextInt(i+1);\n // Simple swap\n String a1 = ar1[index];\n String a2 = ar2[index];\n ar1[index] = ar1[i];\n ar2[index] = ar2[i];\n ar1[i]=a1;\n ar2[i]=a2;\n }\n }", "public void shuffle() {\n\t\tfor (int i = 51; i > 0; i--) {\n\t\t\tint rand = (int) (Math.random() * (i + 1));\n\t\t\tint temp = deck[i];\n\t\t\tdeck[i] = deck[rand];\n\t\t\tdeck[rand] = temp;\n\t\t}\n\t\tcurrentPosition = 0;\n\t}", "public static void knuthShuffle(Comparable[] a) {\n int r, n = a.length;\n for (int i = 1; i < n; i++) {\n r = randInt(0, i);\n exch(a, i, r);\n }\n }", "public void Shuffle() {\n\t\tCollections.shuffle(cards);\n\t}", "public void shuffle()\n\t{\n\t\tHashSet<Integer> usedRandoms = new HashSet<Integer>();\n\t\tthis.currentCard = 0;\n\t\tint i= 0;\n\t\twhile (i < deck.length)\n\t\t{\n\t\t\tint another = this.rand.nextInt(NUMBER_OF_CARDS);\n\t\t\tif(!usedRandoms.contains(another))\n\t\t\t{\n\t\t\t\tCard temp = this.deck[i];\n\t\t\t\tthis.deck[i] = this.deck[another];\n\t\t\t\tthis.deck[another] = temp;\n\t\t\t\ti++;\n\t\t\t\tusedRandoms.add(another);\n\t\t\t}\n\t\t}\n\t}", "public int[] shuffle() {\n Collections.shuffle(list);\n int[] temp = new int[list.size()];\n for (int i = 0; i < list.size(); i++) {\n temp[i] = list.get(i);\n }\n return temp;\n }", "public void scramble(){\r\n for (int i = 0; i < data.length / 2; i++){\r\n int randomIndex1 = (int)(Math.random()*(data.length - 1));\r\n int randomIndex2 = (int)(Math.random()*(data.length - 1));\r\n swap(randomIndex1, randomIndex2);\r\n }\r\n }", "public void shuffle() {\r\n\t\tCollections.shuffle(cards);\r\n\t\t// : Shuffle with random seed each time, then we can save the seed\r\n\t\t// Collections.shuffle(cards, new Random(10));\r\n\t}", "public void shuffle(){\r\n Collections.shuffle(cards);\r\n }", "public void shuffle() {\r\n\t\tCollections.shuffle(cards);\r\n\t}", "private static void scrambleArray(Integer[] a, boolean randomize) {\n\t\tfor (int k = 0; k < a.length; k++)\n\t\t\ta[k] = k;\n\t\tif (randomize) {\n\t\t\tRandom gen = new Random();\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, gen.nextInt(a.length));\n\t\t\t}\n\t\t} else {\n\t\t\tint cell = (int) (a.length * 3.14159) % a.length;\n\t\t\tfor (int k = 0; k < a.length; k++) {\n\t\t\t\tswap(a, k, cell);\n\t\t\t\tcell = (int) (cell * 3.14159) % a.length;\n\t\t\t}\n\t\t}\n\n\t}", "public static String [] randomizeArray(String[] array){\n Random rgen = new Random(); // Random number generator\n\n for (int i=0; i<array.length; i++) {\n int randomPosition = rgen.nextInt(array.length);\n String temp = array[i];\n array[i] = array[randomPosition];\n array[randomPosition] = temp;\n }\n\n return array;\n }", "public void shuffle() {\n\t\tCollections.shuffle(Shoe);\n\t}", "public void shuffle() {\n\t\tCollections.shuffle(cards);\n\t}", "public final <T> T random(T[] array) {\n return array[random(0, array.length)];\n }", "public void shuffle()\r\n {\r\n // We will start from the last element and swap the cards one by one. We actually\r\n // don't need to swap the last element.\r\n for (int i = valid - 1; i > 0; i --) { \r\n \r\n // By using Math.random, we will get a random integer from 0 to i\r\n int j = (int) ( (i+1) * Math.random()); \r\n \r\n // Swapping with the help of temp instance of Card Class.\r\n Card temp = cards[i]; \r\n cards[i] = cards[j]; \r\n cards[j] = temp; \r\n } \r\n // Prints the random array \r\n }", "public void shuffle(){\n Collections.shuffle(Arrays.asList(this.deck));\n }", "public void shuffle() {\n\n\tcardsLeft = cards.length;\n\tfor (int i=cards.length-1; i>=0; --i) {\n\n\t int r = (int)(Math.random()*(i+1)); // pick a random pos <= i\n\n\t Card t = cards[i];\n\t cards[i] = cards[r];\n\t cards[r] = t;\n\n\t}\n }", "public void shuffle() {\n\t\t\t/*\n\t\t\t * This is very different from the sort method because:\n\t\t\t * @ we decant the cards into an array list;\n\t\t\t * @ we use a library function to do the work;\n\t\t\t * The implementation you write for the sort method should\n\t\t\t * have *neither* of these characteristics.\n\t\t\t */\n\t\t\tList<Card> cards = new ArrayList<Card>();\n\t\t\twhile (!isEmpty()) {\n\t\t\t\tcards.add(draw());\n\t\t\t}\n\t\t\tCollections.shuffle(cards);\n\t\t\tfor (Card c: cards) {\n\t\t\t\tadd(c);\n\t\t\t}\n\t\t}", "public void shuffle() {\n Collections.shuffle(this.plateau);\n }", "public void shuffle() {\n Random rand = new Random();\n for(int i = 0; i < deck.length; i++) {\n // get random index past current index\n int randomVal = i + rand.nextInt(deck.length - i);\n // swaps randomly selected card with card at index i\n Card swap = deck[randomVal];\n deck[randomVal] = deck[i];\n deck[i] = swap;\n }\n }", "public void shuffle() {\n\t\tRandom randIndex = new Random();\n\t\tint size = cards.size();\n\t\t\n\t\tfor(int shuffles = 1; shuffles <= 20; ++shuffles)\n\t\t\tfor (int i = 0; i < size; i++) \n\t\t\t\tCollections.swap(cards, i, randIndex.nextInt(size));\n\t\t\n\t}", "public static String[] randomizeHand(String[] arrayShuffle){\n String[] combine=new String[5];\n int k=-1;\n for(int i=0;i<5;i++){\n int j=(int)(Math.random()*52);\n if(j==k){continue;} // use if statements to avoid from picking up the same item twice\n else{combine[i]=arrayShuffle[j];k=j;\n }}\n return combine;}", "public void shuffle() {\n\t\tfor (int i = 0; i < cards.size(); i++){\n\t\t\t//exchange card i with the random card from i to cards.size() - 1\n\t\t\tint j = Randoms.randomIntInRange(i, cards.size() - 1);\n\t\t\tT c1 = cards.get(i);\n\t\t\tT c2 = cards.get(j);\n\t\t\tcards.set(i, c2);\n\t\t\tcards.set(j, c1);\n\t\t}\n\t}", "public void shuffle(){\n Collections.shuffle(this.deckOfCards);\n }", "private void shuffle(ArrayList<Product> dataSet) {\n\t\tfor (int i = 0; i < dataSet.size(); i++) {\n\t\t\tint k = rand(0, i);\n\t\t\tProduct temp = dataSet.get(k);\n\t\t\tdataSet.set(k, dataSet.get(i));\n\t\t\tdataSet.set(i, temp);\n\t\t}\t\n\t}", "public static void shuffle(int[] deck){\n //temporary variable for swapping the values\n int storage = 0;\n //random integer\n int randomInt;\n for(int i = 0; i < deck.length; i++){\n //set the variable equal to a random integer every time\n randomInt = (int) (Math.random() * (deck.length));\n //store the original deck[i] in storage\n //swap deck[i] and deck[randomInt]\n storage = deck[i];\n deck[i] = deck[randomInt];\n deck[randomInt] = storage;\n }\n }", "public int[] shuffle() {\n\n Random random = new Random();\n int posizioneRandom;\n int i = 0;\n int[] shuffleArray = new int[soluzione.length];\n\n while(i < soluzione.length){\n\n posizioneRandom = random.nextInt(soluzione.length);\n\n if(shuffleArray[posizioneRandom] == 0){\n\n shuffleArray[posizioneRandom] = soluzione[i];\n i++;\n }\n\n continue;\n\n\n }\n\n soluzione = shuffleArray;\n\n return soluzione;\n\n }", "public void shuffle()\n\t{\n\t\tCollections.shuffle(card);\n\t}", "public static void arraySwaping(int array[]) {\r\n\r\n\t\tint temp, randInt;\r\n\r\n\t\tRandom rand = new Random();\r\n\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\r\n\t\t\trandInt = rand.nextInt(array.length);\r\n\r\n\t\t\ttemp = array[i];\r\n\t\t\tarray[i] = array[randInt];\r\n\t\t\tarray[randInt] = temp;\r\n\r\n\t\t}\r\n\r\n\t}", "public void shuffle() {\n Collections.shuffle((List<Nummer>) this.albumNummers);\n }", "public JumbleBoard shuffle()\n {\n\n for (int i = 0; i < dice.length; i++)\n {\n for (int j = 0; j < dice[i].length; j++)\n {\n int a = random.nextInt(dice.length);\n int b = random.nextInt(dice[i].length);\n\n char c = dice[i][j];\n dice[i][j] = dice[a][b];\n dice[a][b] = c;\n\n }\n }\n\n return this;\n\n }", "public void shuffle() {\n Collections.shuffle(deck);\n }", "public void shuffle() {\n Collections.shuffle(deck);\n }", "public void shuffle(){\n //After shuffling dealing starts at deck[0] again\n currentCard = 0;\n //for each card , pick another random card and swap them\n for(int first = 0; first < deck.length; first++){\n int second = randomNumbers.nextInt(NUMBER_OF_CARDS);\n\n //Swap Method to swap current card with randomly selected card\n Card temp = deck[first];\n deck[first] = deck[second];\n deck[second] = temp;\n }\n }", "public void shuffle() {\n List<Card> shuffledCards = new ArrayList<>(52);\n while (cards.size() > 0) {\n int index = random.nextInt(cards.size());\n shuffledCards.add(cards.remove(index));\n }\n cards = shuffledCards;\n }", "private static void __exercise37(final int[] a) {\n final int N = a.length;\n for (int i = 0; i < N; ++i) {\n final int r = StdRandom.uniform(N);\n final int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "private static void __exercise36(final int[] a) {\n final int N = a.length;\n for (int i = 0; i < N; ++i) {\n final int r = i + StdRandom.uniform(N - i);\n final int temp = a[i];\n a[i] = a[r];\n a[r] = temp;\n }\n }", "private void shuffleCards(final ICard[] myCards) {\r\n ICard tmp;\r\n int rand;\r\n for (int i = ZERO; i < myCards.length; i++) {\r\n rand = rmd.nextInt(myCards.length);\r\n tmp = myCards[i];\r\n myCards[i] = myCards[rand];\r\n myCards[rand] = tmp;\r\n }\r\n }", "public static int[] shuffleArray(int[] array) {\n\t\tList<Integer> list = new ArrayList<>();\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tlist.add(array[i]);\n\t\t}\n\t\tCollections.shuffle(list, rand);\n\t\treturn list.stream().mapToInt(i->i).toArray();\n\t}", "void shuffleDeck() {\n\t\tfor(int index = 0; index < this.getNumberOfCards(); index++) {\n\t\t\tint randomNumber = index + (int)(Math.random() * (this.getNumberOfCards() - index));\n\t\t\tCard temp = this.cardsInDeck[randomNumber];\n\t\t\tthis.cardsInDeck[randomNumber] = this.cardsInDeck[index];\n\t\t\tthis.cardsInDeck[index] = temp;\n\t\t}\n\t}", "static void randomize(int arr[], Random r) {\n for (int i = arr.length - 1; i > 0; i--) {\n\n // Pick a random index from 0 to i\n int j = r.nextInt(i);\n\n // Swap arr[i] with the element at random index\n int temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n\n }" ]
[ "0.79378474", "0.77558976", "0.7748851", "0.769553", "0.7656073", "0.7656073", "0.764616", "0.7633283", "0.7544139", "0.74743384", "0.745568", "0.7454164", "0.74540776", "0.74223113", "0.7409494", "0.7409494", "0.73869467", "0.73639935", "0.73605025", "0.7356231", "0.73261786", "0.7321312", "0.7306085", "0.7276382", "0.72729564", "0.72695166", "0.7260634", "0.7243679", "0.7204779", "0.7203283", "0.7188711", "0.7155403", "0.7130805", "0.7122232", "0.7105189", "0.7098895", "0.7080142", "0.7075019", "0.7061934", "0.7054396", "0.7047806", "0.7045515", "0.7018579", "0.7004252", "0.7003321", "0.7000025", "0.6998794", "0.69971424", "0.6967456", "0.6964762", "0.69614476", "0.69488674", "0.69469607", "0.69213086", "0.69037575", "0.6841731", "0.6837485", "0.6814215", "0.6774359", "0.6764662", "0.6762832", "0.67605084", "0.67281485", "0.6720151", "0.6690804", "0.66904813", "0.66734195", "0.66725683", "0.6637918", "0.66316605", "0.6630798", "0.662338", "0.6614134", "0.66097707", "0.659406", "0.6593723", "0.658347", "0.65531224", "0.65498453", "0.654241", "0.6530047", "0.652262", "0.65125597", "0.65095896", "0.6500389", "0.647457", "0.6454686", "0.6451233", "0.64396155", "0.642977", "0.64169085", "0.64169085", "0.64026725", "0.63826126", "0.6369169", "0.6360915", "0.63487357", "0.63424647", "0.6330985", "0.63300604" ]
0.778238
1
X Y in range?
protected boolean isValidAvailableField(int x, int y) { if (x < 0 || x >= 8) return false; if (y < 0 || y >= 8) return false; // Is field enabled? if (! _board.isFieldEnabled(x, y)) return false; // If we cannot travel over the same cell, return if (_board.getGame().hasGameOption(Game.GAMEOPTION_TRACEMOVES) && _board.hasTraveled(x, y)) { return false; } // Cell free? Piece dst_piece = _board.getPieceFromXY(x, y); if (dst_piece == null) return true; // Same color in cell, if (dst_piece.getColor() == getColor()) return false; // We can overtake if (_board.getGame().hasGameOption(Game.GAMEOPTION_CANOVERTAKE)) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int inRange(int x, int y) {\n\t\tif (x > 3 && y > 3 && x < max_x - 3 && y < max_y - 3) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "int getBoundsX();", "public int getXY(int x, int y);", "public Range getXRange() {\r\n\t\treturn xRange;\r\n\t}", "int getRange();", "double getXPosition();", "public Range getRangeX(double lowerPercent, double upperPercent, \n PlotRenderingInfo info, Point2D source) {\n \t\t\n \t double start = super.getDomainAxis().getRange().getLowerBound();\n double length = super.getDomainAxis().getRange().getLength();\n Range adjusted = null;\n if (super.getDomainAxis().isInverted()) {\n adjusted = new Range(start + (length * (1 - upperPercent)), \n start + (length * (1 - lowerPercent))); \n }\n else {\n adjusted = new Range(start + length * lowerPercent, \n start + length * upperPercent);\n }\n return adjusted;\n }", "public double getRange(double x1, double y1, double x2, double y2) {\r\n\t\tdouble xo = x2 - x1;\r\n\t\tdouble yo = y2 - y1;\r\n\t\tdouble h = Math.sqrt(xo * xo + yo * yo);\r\n\t\treturn h;\r\n\t}", "float getX();", "float getX();", "float getX();", "float getX();", "float getX();", "float getX();", "int getXMin();", "private Point convertToLogical(int x, int y)\n {\n // convert to next lowest multiple of agentGUISize using int division\n int agentGUISize = Parameters.getAgentGUISize();\n int newX = (x - viewportX) / agentGUISize;\n int newY = (y - viewportY) / agentGUISize;\n\n return new Point(newX, newY);\n }", "double getPositionX();", "double getPositionX();", "double getPositionX();", "double getStartX();", "private double getRangeCenter(int lowerBound, int upperBound) {\n return (lowerBound + upperBound) / 2.0;\n }", "double getX();", "double getX();", "double getX();", "double getX();", "double getX();", "double getX();", "double getX();", "double getX();", "double getX();", "double getX();", "public double[] getRange();", "public double getXRangeIncr() {\n return xRangeIncr;\n }", "public double getXRangeMin() {\n return xRangeMin;\n }", "private double getStartX() {\n\t\treturn Math.min(x1, x2);\n\t}", "protected abstract R toRange(D lower, D upper);", "private int getX(int arg) {\n\n\t\targ = (arg * Width) / 1000;\n\n\t\treturn arg;\n\t}", "private int getX(int arg) {\n\n\t\targ = (arg * Width) / 1000;\n\n\t\treturn arg;\n\t}", "public double getRange(){\n\t\treturn range;\n\t}", "double getEndX();", "public double getX();", "float getXStepMin();", "IntervalTupleList evaluate(double low, double high);", "public int getX(){ return xPosition; }", "public float getX();", "public float getX();", "public boolean checkCoordinatesInRange(int x1, int y1) {\n\n if (x1 < minRow || y1 < minCol || x1 > maxRow || y1 > maxCol) {\n return false;\n }\n\n return true;\n }", "public Iterable<Point2D> range(RectHV rect)\n {\n Stack<Point2D> pointsInRect = new Stack<Point2D>();\n range(root, rect, pointsInRect);\n return pointsInRect;\n }", "public int getX()\r\n {\r\n return xCoord;\r\n }", "Float getX();", "float getXStepMax();", "float yMin();", "private boolean isBetweenBounds(int x, int y, int[] bounds) {\n return x >= bounds[0] && x <= bounds[2] && y >= bounds[1] && y <= bounds[3];\n }", "public ArrayList<Integer> pointsInRange( int min, int max )\n {\n ArrayList<Integer> points = new ArrayList<Integer>();\n _root.findPoints( min, max, points );\n return points;\n }", "public int getXPos();", "long getX();", "public float getX() { return xCoordinate;}", "Coordinate getMinX();", "public double getXRangeMax() {\n return xRangeMax;\n }", "int getX();", "int getX();", "int getX();", "int getX();", "int getX();", "int getX();", "int getX();", "public double getX() { return _width<0? _x + _width : _x; }", "@Override\r\n\tpublic String getNotationExample()\r\n\t{\r\n\t\treturn \"(in-subrange 'X1-number', 'Y1-number', 'X2-number', 'Y2-number')\";\r\n\t}", "public double getX() { return x; }", "@Override\n public boolean contain(int x, int y) {\n return(x>=this.x && y>=this.y && x<=this.x+(int)a && y<=this.y+(int)b);\n }", "public double get(int y, int x);", "int getX_coordinate(){\n return x_coordinate;\n }", "int getY();", "int getY();", "int getY();", "int getY();", "int getY();", "double getStartY();", "Range createRange();", "private double transform(Point_dt range, double x, Point_dt new_range) {\n\t\tdouble dx1 = range.y() - range.x();\n\t\tdouble dx2 = new_range.y() - new_range.x();\n\n\t\tdouble scale = (x - range.x()) / dx1;\n\t\tdouble ans = new_range.x() + dx2 * scale;\n\t\treturn ans;\n\t}", "double getX() { return pos[0]; }", "@Override\n public boolean inBounds(int x, int y) {\n return x >= 0 && y >= 0 && x < this.bounds.width\n && y < this.bounds.height;\n }", "public int getQuadrante(int x, int y){\n if(x>=0 && x<=2){\n if(y>=0 && y<=2)\n return 1;\n if(y>=3 && y<=5)\n return 2;\n if(y>=6 && y<=8)\n return 3;\n }\n\n if(x>=3 && x<=5){\n if(y>=0 && y<=2)\n return 4;\n if(y>=3 && y<=5)\n return 5;\n if(y>=6 && y<=8)\n return 6;\n }\n\n if(x>=6 && x<=8){\n if(y>=0 && y<=2)\n return 7;\n if(y>=3 && y<=5)\n return 8;\n if(y>=6 && y<=8)\n return 9;\n }\n return -1;\n }", "private double transformY(Point_dt range, double x, Point_dt new_range) {\n\t\tdouble dy1 = range.y() - range.x();\n\t\tdouble dy2 = new_range.y() - new_range.x();\n\n\t\tdouble scale = (x - range.x()) / dy1;\n\t\tdouble ans = new_range.y() - dy2 * scale;\n\t\treturn ans;\n\t}", "public int resta(){\r\n return x-y;\r\n }", "public int getX() { return position.x; }", "private boolean between(int x1, int x2, int x3) {\n return (x1 >= x3 && x1 <= x2) || (x1 <= x3 && x1 >= x2);\n }", "static Boolean pointInPgm(int x, int y) {\n return (x >= 0 ) && (y >= 0) && (x <= pgmInf.width) && (y <= pgmInf.height);\n }", "public double getMaximumX () {\n return minimumX + width;\n }", "int getX() {\n return xPos;\n }", "public Iterable<Point2D> range(RectHV rect) {\n\n if (rect == null)\n throw new IllegalArgumentException(\"Got null object in range()\");\n \n Queue<Point2D> pointsInside = new Queue<>();\n \n for (Point2D p : point2DSET) {\n \n double x = p.x();\n double y = p.y();\n if (x >= rect.xmin() && x <= rect.xmax() &&\n y >= rect.ymin() && y <= rect.ymax())\n pointsInside.enqueue(p);\n \n }\n \n return pointsInside;\n }", "public int getX();", "public double getEndX()\n {\n return endxcoord; \n }", "public Iterable<Point2D> range(RectHV rect) {\n SET<Point2D> point_list = new SET<Point2D>();\n rangesearch(root, rect, point_list);\n return point_list;\n }", "public void setXDataRange(float min, float max);", "public double getYRangeMin() {\n return yRangeMin;\n }", "public int getX() {\n return xCoord;\n }", "public void testFindRangeBounds() {\n XYBlockRenderer renderer = new XYBlockRenderer();\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series = new XYSeries(\"S1\");\n series.add(1.0, null);\n dataset.addSeries(series);\n Range r = renderer.findRangeBounds(dataset);\n }", "public int getX() {\n\treturn baseXCoord;\n}", "public void setEndX(double x)\n {\n endxcoord=x; \n }", "public int getBound();" ]
[ "0.7156311", "0.669788", "0.6670553", "0.65193015", "0.6468628", "0.6434918", "0.63361377", "0.6268542", "0.6248141", "0.6248141", "0.6248141", "0.6248141", "0.6248141", "0.6248141", "0.6244225", "0.62164736", "0.61762005", "0.61762005", "0.61762005", "0.6170639", "0.6157897", "0.61241835", "0.61241835", "0.61241835", "0.61241835", "0.61241835", "0.61241835", "0.61241835", "0.61241835", "0.61241835", "0.61241835", "0.6119925", "0.61102104", "0.610871", "0.60967195", "0.603452", "0.602077", "0.602077", "0.59948", "0.59942985", "0.59887093", "0.59812105", "0.5961008", "0.59250206", "0.5902242", "0.5902242", "0.5893869", "0.58917594", "0.5890515", "0.58882606", "0.5879777", "0.5879318", "0.58747387", "0.5873889", "0.5868039", "0.58671093", "0.583897", "0.58378804", "0.58322495", "0.58232063", "0.58232063", "0.58232063", "0.58232063", "0.58232063", "0.58232063", "0.58232063", "0.58208174", "0.58165663", "0.58126974", "0.58075845", "0.57989657", "0.5784004", "0.57784927", "0.57784927", "0.57784927", "0.57784927", "0.57784927", "0.5774872", "0.57745004", "0.57660365", "0.5757236", "0.574983", "0.5737425", "0.5732842", "0.5728372", "0.5725898", "0.5719921", "0.57129145", "0.57118565", "0.5708988", "0.57028896", "0.57021135", "0.56981885", "0.56969106", "0.5696233", "0.5695677", "0.56916237", "0.5686575", "0.56815577", "0.5675053", "0.56724584" ]
0.0
-1
Mark the piece as moveable or not. When not moveable, a user cannot select this piece to be moved.
public void setMoveable(boolean moveable) { _moveable = moveable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean setMove(boolean movable)\n {\n canMove = movable;\n return true;\n }", "public void setPieceCanMove(final Boolean theCanItMove) {\n myPieceCanMove = theCanItMove;\n }", "public void setMovable(boolean movable){\n\t\tthis.movable = movable;\n\t}", "public native void setMoveable(boolean value) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso.moveable = value;\n }-*/;", "public boolean isMoveable() {\n\t\treturn _moveable;\n\t}", "public abstract boolean canMove();", "@Override\r\n\tpublic boolean canMove() {\r\n\t\treturn false;\r\n\t}", "public abstract boolean changeMove();", "public void setMovable(boolean b) {\r\n movable = b;\r\n }", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "@objid (\"7f09cb7d-1dec-11e2-8cad-001ec947c8cc\")\n public boolean allowsMove() {\n return true;\n }", "public boolean allowMove(Point p, int pos);", "public boolean canMove()\n {\n return canMove;\n }", "void setMoving(boolean isMoving);", "boolean canMove();", "public boolean isMovable() {\r\n return movable;\r\n }", "public void toggleMovable() {\r\n\t\tmovable = !movable;\r\n\t}", "public native boolean isMoveable() /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\treturn jso.moveable;\n }-*/;", "public boolean checkMoveable(int x, int y) {\n\t\t\n \tif(!((y < dungeon.getHeight() - 1) && (y >= 0)))\treturn false;\n \tif(!((x < dungeon.getWidth() - 1) && (x >= 0)))\t\treturn false;\n \t\n \tArrayList<Entity> list = dungeon.getEntity(x, y);\n if(!list.isEmpty()) {\n \tfor (Entity e: list) {\n \t\tif(! e.movable(this)) return false;\n \t\tif(e instanceof Switch) {\n \t\t\te.interact(this);\n \t\t}\n }\n }\n return true;\n }", "@Override\n public boolean setPossibleMove(Worker worker) {\n return super.setPossibleMove(worker);\n }", "protected boolean isPieceOfFurnitureMovable(HomePieceOfFurniture piece) {\n return true;\n }", "@Override\n public boolean canMovePieceAtPoint(Point point) {\n return (getPiece(point) != null);\n }", "@Override\n\tpublic boolean movable(Entity obj) {\n\t\treturn true;\n\t}", "@Override\n public boolean isMoveDoable(final ScoreDirector scoreDirector) {\n return true;\n }", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Can Move\");\n\t}", "public void movePiece(int row, int column, BiFunction<Integer, Integer, Boolean> canMove) \r\n\t\t\tthrows IllegalMoveException {\r\n\t\tif(row < 0 || row > 7 || column < 0 || column > 7 ||\r\n\t\t\t\t!canMove.apply(row, column)){\r\n\t\t\tthrow new IllegalMoveException();\r\n\t\t}\r\n\t\tif(this.row == row && this.column == column){\r\n\t\t\tthrow new IllegalMoveException();\r\n\t\t}\r\n\t\tthis.row = row;\r\n\t\tthis.column = column;\r\n\t\tthis.moved = true;\r\n\t}", "@Override\n public boolean canMove(double x, double y) {\n return !getOwner().isDead();\n }", "boolean canMove(Tile t);", "public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "public abstract boolean canMove(Board board, Spot from, Spot to);", "private boolean movePiece(Tile fromTile) {\r\n\t\tgetBoard().setToTile(tile);\r\n\t\tmakeBackup();\r\n\r\n\t\ttile.setPiece(fromTile.getPiece());\r\n\r\n\t\t// League wins the game if the piece carrying the flag returns to its territory\r\n\t\tif (tile.getPiece().getHasEnemyFlag() == true && tile.getPiece().getLEAGUE().toString().toLowerCase()\r\n\t\t\t\t.equals(tile.getTer().territoryName().toLowerCase())) {\r\n\t\t\tGame.getInstance().setGameOver(true);\r\n\t\t}\r\n\r\n\t\t// reset the old position\r\n\t\tfromTile.setPiece(null);\r\n\t\tgetBoard().setFromTile(null);\r\n\r\n\t\t// reset the selection\r\n\t\tgetBoard().setPieceSelected(false);\r\n\r\n\t\t// fromTile = null;\r\n\t\tgetBoard().setToTile(null);\r\n\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean isMovable() {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void startMove(PieceType pieceType, boolean isFree, boolean allowDisconnected) {\n\t\t\r\n\t}", "public boolean moveOn() {\n\t\t\n\t}", "public abstract boolean canMoveTo(Case Location);", "protected void setMove(int _move)\t\t{\tmove = _move;\t\t}", "@Override\n\tpublic boolean movable(Entity obj) {\n\t\tif (!(obj instanceof Player)) return false;\n\t\tPlayer player = (Player) obj;\n\t\t\n\t\tint futureX = this.getX();\n\t\tint futureY = this.getY();\n\t\t\n\t\t\n\t\tint playerX = player.getX();\n\t\tint playerY = player.getY();\n\t\t\n\t\tif (playerX == this.getX()) {\n\t\t\t// player moving either up or down\n\t\t\tif (playerY > this.getY()) {\n\t\t\t\t// player moving up so check what's up of boulder\n\t\t\t\tfutureY = this.getY() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving down ''\n\t\t\t\tfutureY = this.getY() + 1;\n\t\t\t}\n\t\t} else if (playerY == this.getY()) {\n\t\t\t// player moving either left or right\n\t\t\tif (playerX > this.getX()) {\n\t\t\t\t// player moving left ''\n\t\t\t\tfutureX = this.getX() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving right ''\n\t\t\t\tfutureX = this.getX() + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean result = checkMoveable(futureX, futureY);\n\t\treturn result;\n\t}", "public boolean isMovable() {\n\t\treturn false;\n\t}", "boolean makeMove();", "@Override\n boolean canMove(Cell source, Cell destination) {\n return true;\n }", "boolean canMoveTo(Vector2d position);", "public void setMoved() {\r\n\t\tmoved = true;\r\n\t}", "public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }", "public boolean setPlayerToMove(Player aNewPlayerToMove)\n {\n boolean wasSet = false;\n if (aNewPlayerToMove != null)\n {\n playerToMove = aNewPlayerToMove;\n wasSet = true;\n }\n return wasSet;\n }", "private boolean canMove(Point piece){\r\n // direction -1: red pieces +1: black pieces\r\n int dir = isRed(piece)? -1:+1;\r\n // normal movement\r\n Point left = new Point(piece.getFirst() + dir, piece.getSecond() - 1);\r\n Point right = new Point(piece.getFirst() + dir, piece.getSecond() + 1);\r\n // check for normal movements\r\n if(isValidPosition(left) && isEmpty(left)) return true;\r\n if(isValidPosition(right) && isEmpty(right)) return true;\r\n // if is a queen\r\n if(isQueen(piece)){\r\n // compute queen move points (invert direction)\r\n Point leftQ = new Point(piece.getFirst() - dir, piece.getSecond() - 1);\r\n Point rightQ = new Point(piece.getFirst() - dir, piece.getSecond() + 1);\r\n // check for down movements\r\n if(isValidPosition(leftQ) && isEmpty(leftQ)) return true;\r\n if(isValidPosition(rightQ) && isEmpty(rightQ)) return true;\r\n }\r\n return false;\r\n }", "public boolean move();", "public void move(){\n System.out.println(\"I can't move...\");\n }", "@Override\n\tvoid movableInteraction(Tile t) {\n\t\tif (t.hasMovable()){\n\t\t\tthis.triggered = true;\n\t\t} else {\n\t\t\tthis.triggered = false;\n\t\t}\n\t}", "public abstract boolean canMove(int originX, int originY, int destX, int destY);", "public boolean canMoveTo(int x, int y) {\n if (x < 0 || x >= dungeon.getWidth() || y < 0 || y >= dungeon.getHeight() || characterStatus.equals(CharacterStatus.DEAD))\n return false;\n boolean canMove = true;\n for (Entity entity : dungeon.getEntities(x, y)) {\n if (entity instanceof FieldObject)\n ((FieldObject) entity).interact(this);\n if (entity instanceof FieldObject && ((FieldObject) entity).isObstacle()) {\n canMove = false;\n break;\n }\n }\n return canMove;\n }", "public void setMoved(boolean moved) {\n this.moved = moved;\n }", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "protected boolean move(int m, boolean player)\n { int status = game.move(m, player);\n if ( status == TicGame.NOMOVE )\n return false;\n repaint();\n if ( status == TicGame.WIN_X ||\n status == TicGame.WIN_O )\n winner(); \n return true;\n }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "public boolean canMove() {\n\n if (workers.size() == 0) return true;\n\n return workerCanMove(0) || workerCanMove(1);\n }", "public boolean canMove ()\n {\n return ((ActiveAdvancer)_advancer).canMove();\n }", "public void setHasItMovedYet(boolean x) {\n hasItMovedYet = x;\n }", "public void applyMove(Move move, boolean setMoved)\r\n\t{\r\n\t\tboolean isNextMoveRochade = isNextMoveRochade(move); //Check before any changes to the board are made\r\n\t\tboolean isNextMoveEnPassentCapture = !isNextMoveRochade && isNextMoveEnPassentCapture(move);\r\n\t\t\r\n\t\tField to = move.to;\r\n\t\tField from = move.from;\r\n\t\t\r\n\t\tObjects.requireNonNull(from.piece);\r\n\t\tif (isNextMoveEnPassentCapture)\r\n\t\t{\r\n\t\t\tint enPassentX = to.coordinate.x;\r\n\t\t\tint enPassentY = from.coordinate.y;\r\n\t\t\tfields[enPassentX][enPassentY].piece = null;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tmove.capture = to.piece;\r\n\t\t}\r\n\t\t\r\n\t\t//TODO write test for this\r\n\t\tif (move.promotion != null)\r\n\t\t{\r\n\t\t\tto.piece = move.promotion;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tto.piece = from.piece;\r\n\t\t}\r\n\t\t\r\n\t\tfrom.piece = null;\r\n\t\tif (setMoved) to.piece.setMoved();\r\n\t\tappliedMoves.add(move);\r\n\t\t\r\n\t\tif (isNextMoveRochade)\r\n\t\t{\r\n\t\t\tif (to.coordinate.x == 6)\r\n\t\t\t{\r\n\t\t\t\tField rookRochadeField = fields[5][to.coordinate.y];\r\n\t\t\t\tField rookBeforeRochadeField = fields[7][to.coordinate.y];\r\n\t\t\t\trookRochadeField.piece = rookBeforeRochadeField.piece;\r\n\t\t\t\trookBeforeRochadeField.piece = null;\r\n\t\t\t\tif (setMoved) rookRochadeField.piece.setMoved();\r\n\t\t\t}\r\n\t\t\telse if (to.coordinate.x == 2)\r\n\t\t\t{\r\n\t\t\t\tField rookRochadeField = fields[3][to.coordinate.y];\r\n\t\t\t\tField rookBeforeRochadeField = fields[0][to.coordinate.y];\r\n\t\t\t\trookRochadeField.piece = rookBeforeRochadeField.piece;\r\n\t\t\t\trookBeforeRochadeField.piece = null;\r\n\t\t\t\tif (setMoved) rookRochadeField.piece.setMoved();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tincrementPositionCount();\r\n\t}", "private boolean canMove(String direction) {\n\t\tif (currentPiece.getLocation() == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (Loc loc : currentPiece.getLocation()) {\n\t\t\tLoc nextPoint = nextPoint(loc, direction);\n\t\t\tif (nextPoint == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// if there's someone else's piece blocking you\n\t\t\tif ((new Loc(nextPoint.row, nextPoint.col).isOnBoard())\n\t\t\t\t\t&& boardTiles[nextPoint.row][nextPoint.col] != backgroundColor && !isMyPiece(nextPoint)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "public boolean GetMove();", "public void makeMove(Move m) {\n \tPieceColor moved = m.getSource().getColor();\n\n \t//before the move is made, record the move in the movelist\n \tupdateMoveList(m);\n \t\n \t//store locations\n \tint sx = m.getSource().getLocation().getX();\n \tint sy = m.getSource().getLocation().getY();\n \tint dx = m.getDest().getLocation().getX();\n \tint dy = m.getDest().getLocation().getY();\n \tString name_moved = m.getSource().getName();\n \t\n \t//store new king location if it moved\n \tif(name_moved.equals(\"King\")) {\n \t\tif(moved == PieceColor.White) {\n \t\t\twKing = m.getDest().getLocation();\n \t\t\t\n \t\t\t//remove castle rights on both sides\n \t\t\tcastle[0] = false;\n \t\t\tcastle[1] = false;\n \t\t}\n \t\telse if(moved == PieceColor.Black) {\n \t\t\tbKing = m.getDest().getLocation();\n \t\t\t\n \t\t\t//remove castle rights on both sides\n \t\t\tcastle[2] = false;\n \t\t\tcastle[3] = false;\n \t\t}\n \t\telse System.exit(0);\n \t}\n \t\n \t//rook check for castling rights\n \tif(name_moved.equals(\"Rook\")) {\n \t\tif(moved == PieceColor.White) {\n \t\t\tif(sx == 0 && sy == 0) removeCastle(moved, false);\n \t\t\tif(sx == 7 && sy == 0) removeCastle(moved, true);\n \t\t}\n \t\t\n \t\telse if(moved == PieceColor.Black) {\n \t\t\tif(sx == 0 && sy == 7) removeCastle(moved, false);\n \t\t\tif(sx == 7 && sy == 7) removeCastle(moved, true);\n \t\t}\n \t}\n \t\n \tPiece temp = getPiece(sx, sy);\n \t\n \tsetPiece(sx, sy, new NoPiece(sx, sy));\n \t\n \tif(temp.getName().equals(\"Pawn\") && ((Pawn)temp).getPromo() == dy) {\n \t\ttemp = new Queen(dx, dy, temp.getColor(), this);\n \t}\n \t\n \t\n \ttemp.setLocation(new Square(dx, dy));\n \t\n \t//check for en passant\n \tif(name_moved.equals(\"Pawn\")) {\n \t\tint loc = ((Pawn)temp).advance();\n \t\t((Pawn)temp).setMoved(moveList.size());\n \t\t\n \t\t//only a valid en passant move if the pawn moves diagonally\n \t\t//and the destination square is empty\n \t\tif(sx != dx && getPiece(dx, dy).getName().equals(\"None\")) {\n \t\t\tsetPiece(dx, dy-loc, new NoPiece(dx, dy-loc));\n \t\t}\n \t}\n \t\n \tsetPiece(dx, dy, temp);\n \t\n \tif(turn == PieceColor.White) turn = PieceColor.Black;\n \telse turn = PieceColor.White;\n \t\n \t//check if the move was a castle\n \tif(name_moved.equals(\"King\")) {\n \t\t\n \t\tif(moved == PieceColor.White) { \n\t \t\t//if king moved positive x, then moved king side\n\t \t\tif(dx - sx == 2) {\n\t \t\t\ttemp = getPiece(7, 0);\n\t \t\t\tsetPiece(7, 0, new NoPiece(7, 0));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(5,0));\n\t \t\t\tsetPiece(5, 0, temp);\n\t \t\t}\n\t \t\t\n\t \t\telse if(sx - dx == 2) {\n\t \t\t\ttemp = getPiece(0, 0);\n\t \t\t\tsetPiece(0, 0, new NoPiece(0, 0));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(3, 0));\n\t \t\t\tsetPiece(3, 0, temp);\n\t \t\t}\n \t\t}\n \t\t\n \t\tif(moved == PieceColor.Black) { \n\t \t\t//if king moved positive x, then moved king side\n\t \t\tif(dx - sx == 2) {\n\t \t\t\ttemp = getPiece(7, 7);\n\t \t\t\tsetPiece(7, 7, new NoPiece(7, 7));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(5, 7));\n\t \t\t\tsetPiece(5, 7, temp);\n\t \t\t}\n\t \t\t\n\t \t\telse if(sx - dx == 2) {\n\t \t\t\ttemp = getPiece(0, 7);\n\t \t\t\tsetPiece(0, 7, new NoPiece(0, 7));\n\t \t\t\t\n\t \t\t\ttemp.setLocation(new Square(3, 7));\n\t \t\t\tsetPiece(3, 7, temp);\n\t \t\t}\n \t\t}\n \t}\n }", "boolean doMove();", "public boolean tryMove(Move m) {\n \tif(m.getSource().getColor() != turn) return false;\n \treturn m.getSource().move(m);\n }", "boolean prepareToMove();", "public boolean canMove(int dir) {\n return true;\n }", "private boolean moveContinues(Point piece){\r\n boolean result = canEats(piece);\r\n // if move continues, next move has to start with the same piece\r\n model.setCheckPiece((result)?piece:null);\r\n return result;\r\n }", "private boolean makeMove(Move move) {\n\n // Moving piece from Cell\n Piece sourcePiece = move.getStart().getCurrentPiece();\n\n // Valid Move? Calling Piece actual implementation\n if (!sourcePiece.canMove(board, move.getStart(), move.getEnd())) {\n System.out.println(\"Invalid Move, sourcePiece is \" + sourcePiece);\n }\n\n // Killed other player Piece?\n Piece destPiece = move.getEnd().getCurrentPiece();\n if (destPiece != null) {\n destPiece.setKilled(true);\n move.setPieceKilled(destPiece);\n }\n\n // castling?\n if (sourcePiece instanceof King\n && sourcePiece.isCastlingMove()) {\n move.setCastlingMove(true);\n }\n\n // Store the Move\n movesPlayed.add(move);\n\n // If move is VALID, set piece=null at start cell and new piece at dest cell\n move.getEnd().setCurrentPiece(sourcePiece);\n move.getStart().setCurrentPiece(null);\n\n // Game Win or not\n if (destPiece instanceof King) {\n if (move.getPlayedBy().isWhiteSide()) {\n this.setStatus(GameStatus.WHITE_WIN);\n } else {\n this.setStatus(GameStatus.BLACK_WIN);\n }\n\n }\n\n return true;\n }", "@Override\n\tpublic boolean isLegalMove(Square newPosition) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void onMovableChanged(Movable movable) {\r\n\t\tControllerEventSource.notifyMovableChanged(movable);\r\n\t}", "public interface Moveable {\n\n void move();\n\n}", "private void doMoveIfPossible() {\r\n if (selected != null) {\r\n if (picked != null) {\r\n if (picked.doMove(selected.getX(), selected.getY())) {\r\n client1.write(ClientMessages.Move, picked.getPositionInArray(), selected.getX(), selected.getY());\r\n client2.write(ClientMessages.Move, picked.getPositionInArray(), selected.getX(), selected.getY());\r\n }\r\n if (picked.doCapture(selected.getX(), selected.getY())) {\r\n client1.write(ClientMessages.Capture, picked.getPositionInArray(), selected.getX(), selected.getY());\r\n client2.write(ClientMessages.Capture, picked.getPositionInArray(), selected.getX(), selected.getY());\r\n }\r\n CastlingMove castl;\r\n if (picked.getClass() == King.class && ((King) picked).doCastling(castl = getCastlingMove())) {\r\n client1.write(ClientMessages.Castling, castl.getRook().getPositionInArray(), castl.getRookX(), selected.getX());\r\n client2.write(ClientMessages.Castling, castl.getRook().getPositionInArray(), castl.getRookX(), selected.getX());\r\n }\r\n }\r\n }\r\n }", "public void setMoving(boolean isMoving) {\r\n\t\tthis.isMoving = isMoving;\r\n\t}", "@Override\n\tpublic boolean move(int col, int row, piece[][] board) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}", "private void disableMoves() {\n\t\tList<String> disabledMoves = RemoRaids.getRestraintsConfig().get(RestraintsConfig.DISABLED_PLAYER_MOVES);\n\t\tfor (PixelmonWrapper wrapper : this.controlledPokemon) {\n\t\t\tfor (Attack attack : wrapper.getMoveset().attacks) {\n\t\t\t\tif (attack != null) {\n\t\t\t\t\tif (attack.isAttack(disabledMoves))\n\t\t\t\t\t\tattack.setDisabled(true, wrapper);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic boolean canMove(int x, int y, Tile[][] tiles) {\r\n\t\treturn false;\r\n\t}", "public boolean move() {\n\t\tint nextDirection;\n\t\tint pacmanX = parent.getPacManX();\n\t\tint pacmanY = parent.getPacManY();\n\t\t\n\t\tint[] directionPriority = new int[4];\n\t\t/** The direction is added to the priority in order to achieve it once the move is chosen */\n\t\tdirectionPriority[0]=(pacmanX-pixelLocationX)*(10)*state+GameCharacter.RIGHT;\n\t\tdirectionPriority[1]=((pacmanX-pixelLocationX)*(-10)*state+GameCharacter.LEFT);\n\t\tdirectionPriority[2]=(pacmanY-pixelLocationY)*(10)*state+GameCharacter.DOWN;\n\t\tdirectionPriority[3]=((pacmanY-pixelLocationY)*(-10)*state+GameCharacter.UP);\n\t\tArrays.sort(directionPriority);\n\t\t\n\t\tint i=3;\n\t\t\n\t\tdo {\n\t\t\tnextDirection = directionPriority[i]%10;\n\t\t\tif (nextDirection < 0) {\n\t\t\t\tnextDirection += 10;\n\t\t\t}\n\t\t\tif(isLegalMove(nextDirection) && (Math.abs(nextDirection-currentDirection) != 2) || i==0) {\n\t\t\t\tsetDirection(nextDirection);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti--;\n\t\t}\n\t\twhile (i>=0);\n\t\treturn super.move();\n\t}", "public boolean attemptMove(int x, int y)\n {\n return setPosition(x, y);\n }", "public void makesNotHere(){this.piece.unAffect();}", "public void stopMovement() {\r\n this.canMove = false;\r\n }", "@Override\n\tpublic boolean canMoveTo(Integer row, Integer col, ChessBoard board) {\n\t\tif((0<=(this.row - row)<=1 && 0<=(this.col - col)<=1) && (1==(this.row - row) || (this.col - col)==1));\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t\tfor(int i=0; i<=1 i++) {\n\t\t\tfor(int j=0, j<=1, j++) {\n\t\t\t\tif((i=0) && (j=0))\n\t\t\t\t\t\tcontinue;\n\t\t\t\tboard.pieceAt(row, col);\n\t\t\t}\n\t\t}\n\t\tboard.pieceAt(row, col)\n\t\t\n\t\telse if()\n\t}\n\n\t@Override\n\tpublic void moveTo(Integer row, Integer col) {\n\t\t\n\t\t\n\t}\n\n\t@Override\n\tpublic PieceType getType() {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}\n}", "@Test\n void checkNoEffectMove() {\n assertTrue(abilities.checkCanMove(turn, board.getCellFromCoords(0, 1)));\n abilities.doMove(turn, board.getCellFromCoords(0, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(0, 1));\n }", "boolean isLegal(Move move) {\r\n return isLegal(move.from(), move.to());\r\n }", "@Test\r\n public void callingMovePossibleWhenTryingToTakeAnOpponentPieceWith2MarkersOnShouldReturnFalse() {\n player1.movePiece(12, 11, board);\r\n player1.movePiece(12, 11, board);\r\n\r\n player2.movesLeft.moves.add(2);\r\n\r\n // Then\r\n assertFalse(player2.isMovePossible(13, 11, board));\r\n }", "protected void addMoveable(Movable m){\n\t\ttemp.add(m);\n\t}", "public void setMove(int move){\n this.move = move;\n }", "private boolean checkMove(boolean[][] moves, Piece piece, int i, int j) {\r\n\t\tif (moves[i][j]) {\r\n\t\t\t// Moving piece \r\n\t\t\tthis.board[piece.getY()][piece.getX()] = null;\r\n\t\t\t\r\n\t\t\tPiece savePiece = this.board[i][j]; // Piece at i and j\r\n\t\t\tint saveX = piece.getX();\r\n\t\t\tint saveY = piece.getY();\r\n\t\t\t\r\n\t\t\tthis.board[i][j] = piece;\r\n\t\t\tpiece.setXY(j, i);\r\n\t\t\t\r\n\t\t\tif (savePiece != null) {\r\n\t\t\t\tkillPiece(savePiece);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean check = checkForCheck(piece.getPlayer());\r\n\t\t\t\r\n\t\t\t// return pieces to original states\r\n\t\t\tsetBack(i, j, savePiece, saveX, saveY);\r\n\t\t\tif (!check) {\r\n\t\t\t\t// There is a viable move to get out of check\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void setAssignable(boolean assignable) {\n isAssignable = assignable;\n }", "public void setValidMoves(){\r\n int row = (int)this.space.getX();\r\n int column = (int)this.space.getY();\r\n int max = puzzleSize-1;\r\n if (row < max)\r\n this.validMoves.add(new Point(row+1, column));\r\n if (row > 0)\r\n this.validMoves.add(new Point(row-1, column));\r\n if (column < max)\r\n this.validMoves.add(new Point(row, column+1));\r\n if (column > 0)\r\n this.validMoves.add(new Point(row, column-1));\r\n }", "@Test\n void checkDoMove() {\n abilities.doMove(turn, board.getCellFromCoords(1, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(1, 1));\n Worker forcedWorker = turn.getWorker();\n for (Worker other : turn.getOtherWorkers()) {\n if (other.getCell() == board.getCellFromCoords(2, 2)) {\n forcedWorker = other;\n }\n }\n\n assertEquals(forcedWorker.getCell(), board.getCellFromCoords(2, 2));\n\n // Can't move anymore after having already moved\n assertFalse(abilities.checkCanMove(turn, board.getCellFromCoords(0, 0)));\n }", "public boolean isNotPosibleMove(final int type) {\n switch (type) {\n case KeyEvent.VK_LEFT:\n isNotPossible = pacman.existWall(pacman.getX() - SIZE_ELEMENT, pacman.getY());\n break;\n case KeyEvent.VK_RIGHT:\n isNotPossible = pacman.existWall(pacman.getX() + SIZE_ELEMENT, pacman.getY());\n break;\n case KeyEvent.VK_UP:\n isNotPossible = pacman.existWall(pacman.getX(), pacman.getY() - SIZE_ELEMENT);\n break;\n case KeyEvent.VK_DOWN:\n isNotPossible = pacman.existWall(pacman.getX(), pacman.getY() + SIZE_ELEMENT);\n break;\n default:\n break;\n }\n return isNotPossible;\n }", "public void setMove(int move) {\n this.move = move;\n }", "public boolean canMove()\n\t{\n\t\tif(delayMove>compareSpeed())\n\t\t{\n\t\t\tdelayMove=0;\n\t\t\treturn true;\n\t\t\t\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "public void InvalidMove();", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "public void move() {\n\t\tSystem.out.println(\"Robot Can Move\");\n\t}", "public abstract boolean doComputerMove(Player player);" ]
[ "0.77795637", "0.7671417", "0.7348182", "0.72602904", "0.7179761", "0.70241773", "0.6982692", "0.6870503", "0.6867614", "0.68322206", "0.6821774", "0.68087244", "0.67069125", "0.6647463", "0.65981394", "0.659323", "0.6574258", "0.6513925", "0.6492372", "0.6448895", "0.63957286", "0.63721716", "0.6369765", "0.6360919", "0.6346446", "0.63263285", "0.6311923", "0.6285827", "0.6281608", "0.6243725", "0.6186854", "0.61672777", "0.61659193", "0.61602116", "0.61557996", "0.61467415", "0.6123502", "0.61147505", "0.6089491", "0.60811126", "0.60620844", "0.60345256", "0.6033388", "0.6019144", "0.60093457", "0.5988135", "0.5986033", "0.59609145", "0.59399027", "0.593242", "0.5918845", "0.59132576", "0.5910744", "0.5906626", "0.5902999", "0.59025335", "0.5900428", "0.587862", "0.5877452", "0.5871521", "0.5860882", "0.58569884", "0.5847616", "0.5838166", "0.5835292", "0.58276063", "0.58240217", "0.5810855", "0.5808202", "0.58074224", "0.5799965", "0.5799635", "0.57964367", "0.57940936", "0.57935846", "0.57909274", "0.5788943", "0.5785272", "0.57801586", "0.57798797", "0.5778649", "0.5760585", "0.5756761", "0.5755825", "0.57553625", "0.5752347", "0.57441807", "0.5740523", "0.57394516", "0.5730345", "0.5724779", "0.5718225", "0.5716938", "0.5716609", "0.5712906", "0.5708952", "0.5707378", "0.5705092", "0.57033914", "0.57031757" ]
0.78504163
0
Returns wether or not the piece is moveable or not
public boolean isMoveable() { return _moveable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean canMove();", "public boolean canMove()\n {\n return canMove;\n }", "public abstract boolean canMove();", "boolean canMove(Tile t);", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "public native boolean isMoveable() /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\treturn jso.moveable;\n }-*/;", "private boolean canMove(Point piece){\r\n // direction -1: red pieces +1: black pieces\r\n int dir = isRed(piece)? -1:+1;\r\n // normal movement\r\n Point left = new Point(piece.getFirst() + dir, piece.getSecond() - 1);\r\n Point right = new Point(piece.getFirst() + dir, piece.getSecond() + 1);\r\n // check for normal movements\r\n if(isValidPosition(left) && isEmpty(left)) return true;\r\n if(isValidPosition(right) && isEmpty(right)) return true;\r\n // if is a queen\r\n if(isQueen(piece)){\r\n // compute queen move points (invert direction)\r\n Point leftQ = new Point(piece.getFirst() - dir, piece.getSecond() - 1);\r\n Point rightQ = new Point(piece.getFirst() - dir, piece.getSecond() + 1);\r\n // check for down movements\r\n if(isValidPosition(leftQ) && isEmpty(leftQ)) return true;\r\n if(isValidPosition(rightQ) && isEmpty(rightQ)) return true;\r\n }\r\n return false;\r\n }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "public boolean canMove()\n\t{\n\t\tif(delayMove>compareSpeed())\n\t\t{\n\t\t\tdelayMove=0;\n\t\t\treturn true;\n\t\t\t\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "boolean isMoving();", "private boolean isMove() {\n return this.getMoves().size() != 0;\n }", "public boolean GetMove();", "public boolean checkMoveable(int x, int y) {\n\t\t\n \tif(!((y < dungeon.getHeight() - 1) && (y >= 0)))\treturn false;\n \tif(!((x < dungeon.getWidth() - 1) && (x >= 0)))\t\treturn false;\n \t\n \tArrayList<Entity> list = dungeon.getEntity(x, y);\n if(!list.isEmpty()) {\n \tfor (Entity e: list) {\n \t\tif(! e.movable(this)) return false;\n \t\tif(e instanceof Switch) {\n \t\t\te.interact(this);\n \t\t}\n }\n }\n return true;\n }", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "@Override\r\n\tpublic boolean canMove() {\r\n\t\treturn false;\r\n\t}", "public boolean canMove ()\n {\n return ((ActiveAdvancer)_advancer).canMove();\n }", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "private boolean canMove(String direction) {\n\t\tif (currentPiece.getLocation() == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (Loc loc : currentPiece.getLocation()) {\n\t\t\tLoc nextPoint = nextPoint(loc, direction);\n\t\t\tif (nextPoint == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// if there's someone else's piece blocking you\n\t\t\tif ((new Loc(nextPoint.row, nextPoint.col).isOnBoard())\n\t\t\t\t\t&& boardTiles[nextPoint.row][nextPoint.col] != backgroundColor && !isMyPiece(nextPoint)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public boolean canMovePieceAtPoint(Point point) {\n return (getPiece(point) != null);\n }", "public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }", "public boolean canMove() {\n\n if (workers.size() == 0) return true;\n\n return workerCanMove(0) || workerCanMove(1);\n }", "public boolean isMoving() {\n return moving;\n }", "public final boolean isMoving() {\r\n\t\treturn moveStart > 0;\r\n\t}", "@objid (\"7f09cb7d-1dec-11e2-8cad-001ec947c8cc\")\n public boolean allowsMove() {\n return true;\n }", "protected boolean isPieceOfFurnitureMovable(HomePieceOfFurniture piece) {\n return true;\n }", "public abstract boolean canMove(Board board, Spot from, Spot to);", "public boolean isMoving() {\n\t\treturn moveProgress > 0;\n\t}", "public boolean isMoving() {\r\n\t\treturn moving;\r\n\t}", "public boolean isMovable() {\r\n return movable;\r\n }", "private boolean isThereValidMove() {\n\t\treturn true;\n\t}", "public boolean isMoving() {\n return this.movementComposer.isMoving();\n }", "boolean hasMove(Piece side) {\r\n List<Move> listOfLegalMoves = legalMoves(side);\r\n return listOfLegalMoves != null;\r\n }", "boolean makeMove();", "boolean doMove();", "boolean canMoveTo(Vector2d position);", "@Override\n public boolean isMoving() {\n return _movementTask != null && !_movementTask.isDone();\n }", "@Override\n public boolean canMove(double x, double y) {\n return !getOwner().isDead();\n }", "public boolean isMoving()\n\t{\n\t\treturn (mode == MotorPort.FORWARD || mode == MotorPort.BACKWARD);\n\t}", "public boolean isMoveLegal() {\n if (!getGame().getBoard().contains(getFinalCoords())) {\n return false;\n }\n\n // for aero units move must use up all their velocity\n if (getEntity() instanceof Aero) {\n Aero a = (Aero) getEntity();\n if (getLastStep() == null) {\n if ((a.getCurrentVelocity() > 0) && !getGame().useVectorMove()) {\n return false;\n }\n } else {\n if ((getLastStep().getVelocityLeft() > 0) && !getGame().useVectorMove()\n && !(getLastStep().getType() == MovePath.MoveStepType.FLEE\n || getLastStep().getType() == MovePath.MoveStepType.EJECT)) {\n return false;\n }\n }\n }\n\n if (getLastStep() == null) {\n return true;\n }\n\n if (getLastStep().getType() == MoveStepType.CHARGE) {\n return getSecondLastStep().isLegal();\n }\n if (getLastStep().getType() == MoveStepType.RAM) {\n return getSecondLastStep().isLegal();\n }\n return getLastStep().isLegal();\n }", "public boolean isMoving() {\n\t\treturn state.getDirection() != Direction.STATIONARY;\n\t}", "public boolean allowMove(Point p, int pos);", "private boolean isLegalMove(String move) {\n\t\tString[] moveParts = move.split(\";\");\n\n\t\tint fromRow = Integer.parseInt(moveParts[0].charAt(0) + \"\");\n\t\tint fromCol = Integer.parseInt(moveParts[0].charAt(1) + \"\");\n\n\t\tint toRow = Integer.parseInt(moveParts[1].charAt(0) + \"\");\n\t\tint toCol = Integer.parseInt(moveParts[1].charAt(1) + \"\");\n\n\t\tint minRow = Math.min(fromRow, toRow);\n\t\tint minCol = Math.min(fromCol, toCol);\n\n\t\tint maxRow = Math.max(fromRow, toRow);\n\t\tint maxCol = Math.max(fromCol, toCol);\n\n\t\tint piece = board[fromRow][fromCol];//Integer.parseInt(moveParts[2]);\n\t\tint pieceType = Math.abs(piece);\n\t\tint team = Math.round(Math.signum(piece));\n\n\t\tif (team == Math.round(Math.signum(board[toRow][toCol]))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (toRow < 0 || toRow > 7 && toCol < 0 && toCol > 7) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (team > 0) { // WHITE\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isWhiteCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { //BLACK\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isBlackCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (pieceType == 1) { //Pawn\n\t\t\treturn ((board[toRow][toCol] != 0 && toRow == fromRow + team && (toCol == fromCol + 1 || toCol == fromCol - 1)) || (toCol == fromCol && board[toRow][toCol] == 0 && ((toRow == fromRow + team) || (((fromRow == 1 && team == 1) || (fromRow == 6 && team == -1)) ? toRow == fromRow + 2*team && board[fromRow + team][fromCol] == 0 : false))));\n\t\t} else if (pieceType == 2) { //Rook\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (pieceType == 3) { //Knight\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy == 5;\n\t\t} else if (pieceType == 4) { //Bishop\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\tint m = dy/dx;\n\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && board[i][startCol + m*(i - minRow)] != 7) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (pieceType == 5) { //Queen\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tint dx = toRow - fromRow;\n\t\t\t\tint dy = toCol - fromCol;\n\t\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\t\tint m = dy/dx;\n\t\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && Math.abs(board[i][startCol + m*(i - minRow)]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (pieceType == 6) { //King\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy <= 2;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean canMove(int dir) {\n return true;\n }", "boolean legalMove(Move mov) {\n if (mov == null || !validSquare(mov.toIndex())\n || !validSquare(mov.fromIndex())) {\n throw new IllegalArgumentException(\"Illegal move\");\n }\n PieceColor from = get(mov.fromIndex());\n PieceColor to = get(mov.toIndex());\n if (!mov.isJump() && jumpPossible()) {\n return false;\n }\n if (from != _whoseMove) {\n return false;\n } else if (mov.isJump()) {\n return checkJump(mov, false);\n } else if (from == BLACK && row(mov.fromIndex()) == '1') {\n return false;\n } else if (from == WHITE && row(mov.fromIndex()) == '5') {\n return false;\n } else if (mov.isLeftMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Right\");\n } else if (mov.isRightMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Left\");\n } else if (from == BLACK) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.fromIndex() - mov.toIndex() == SIDE\n || mov.fromIndex() - mov.toIndex() == SIDE - 1\n || mov.fromIndex() - mov.toIndex() == SIDE + 1;\n } else {\n return mov.fromIndex() - mov.toIndex() == SIDE && to == EMPTY;\n }\n } else if (from == WHITE) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.toIndex() - mov.fromIndex() == SIDE\n || mov.toIndex() - mov.fromIndex() == SIDE + 1\n || mov.toIndex() - mov.fromIndex() == SIDE - 1;\n } else {\n return mov.toIndex() - mov.fromIndex() == SIDE && to == EMPTY;\n }\n }\n return false;\n }", "public abstract boolean canMove(int originX, int originY, int destX, int destY);", "boolean isLegal(Move move) {\n int c = move.getCol0();\n int r = move.getRow0();\n int[] vector = move.unit();\n Piece p;\n for(int i = 0; i <= vector[2]; i++) {\n p = get(c, r);\n if (p != null && p.side() != _turn) {\n return false;\n }\n }\n return true;\n\n }", "public boolean canMove() {\n ArrayList<Location> valid = canMoveInit();\n if (valid == null || valid.isEmpty()) {\n return false;\n }\n ArrayList<Location> lastCross = crossLocation.peek();\n for (Location loc : valid) {\n Actor actor = (Actor) getGrid().get(loc);\n if (actor instanceof Rock && actor.getColor().equals(Color.RED)) {\n next = loc;\n isEnd = true;\n return false;\n }\n if (!lastCross.contains(loc)) {\n lastCross.add(loc);\n next = loc;\n ArrayList<Location> nextCross = new ArrayList<>();\n nextCross.add(next);\n nextCross.add(last);\n crossLocation.push(nextCross);\n return probabilityAdd();\n }\n }\n next = lastCross.get(1);\n crossLocation.pop();\n return probabilitySub();\n }", "@Override\n\tpublic boolean movable(Entity obj) {\n\t\tif (!(obj instanceof Player)) return false;\n\t\tPlayer player = (Player) obj;\n\t\t\n\t\tint futureX = this.getX();\n\t\tint futureY = this.getY();\n\t\t\n\t\t\n\t\tint playerX = player.getX();\n\t\tint playerY = player.getY();\n\t\t\n\t\tif (playerX == this.getX()) {\n\t\t\t// player moving either up or down\n\t\t\tif (playerY > this.getY()) {\n\t\t\t\t// player moving up so check what's up of boulder\n\t\t\t\tfutureY = this.getY() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving down ''\n\t\t\t\tfutureY = this.getY() + 1;\n\t\t\t}\n\t\t} else if (playerY == this.getY()) {\n\t\t\t// player moving either left or right\n\t\t\tif (playerX > this.getX()) {\n\t\t\t\t// player moving left ''\n\t\t\t\tfutureX = this.getX() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving right ''\n\t\t\t\tfutureX = this.getX() + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean result = checkMoveable(futureX, futureY);\n\t\treturn result;\n\t}", "private boolean canGetOutOfCheck(boolean[][] moves, Piece piece) {\r\n\t\tfor (int i = 0; i < this.SIZE; i++) {\r\n\t\t\tfor (int j = 0; j < this.SIZE; j++) {\r\n\t\t\t\tif(checkMove(moves, piece, i, j)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isNotPosibleMove(final int type) {\n switch (type) {\n case KeyEvent.VK_LEFT:\n isNotPossible = pacman.existWall(pacman.getX() - SIZE_ELEMENT, pacman.getY());\n break;\n case KeyEvent.VK_RIGHT:\n isNotPossible = pacman.existWall(pacman.getX() + SIZE_ELEMENT, pacman.getY());\n break;\n case KeyEvent.VK_UP:\n isNotPossible = pacman.existWall(pacman.getX(), pacman.getY() - SIZE_ELEMENT);\n break;\n case KeyEvent.VK_DOWN:\n isNotPossible = pacman.existWall(pacman.getX(), pacman.getY() + SIZE_ELEMENT);\n break;\n default:\n break;\n }\n return isNotPossible;\n }", "public void setPieceCanMove(final Boolean theCanItMove) {\n myPieceCanMove = theCanItMove;\n }", "@Override\n public Position[] getCanMoves() {\n PieceWay way = new PieceWay(getPosition());\n Position[] PawnWay = way.waysPawnPos(color);\n return PawnWay;\n }", "public boolean isMovable(Position p){\r\n try {\r\n if (mazeData[p.getX()][p.getY()] == MOVABLE)\r\n return true;\r\n }catch(ArrayIndexOutOfBoundsException e){}\r\n return false;\r\n }", "public boolean move();", "boolean isLegal(String move) {\n int[][] theStatusBoard;\n if (_playerOnMove == ORANGE) {\n theStatusBoard = _orangeStatusBoard;\n } else {\n theStatusBoard = _violetStatusBoard;\n }\n Pieces thispiece = new Pieces();\n String piecename = move.substring(0, 1);\n int col = getCoordinate(move.substring(1, 2));\n int row = getCoordinate(move.substring(2, 3));\n int ori = Integer.parseInt(move.substring(3, 4));\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n if (row + depth - 1 > 13 || col + length - 1 > 13) {\n System.out.println(\"Your move makes your piece out of the board, try again!\");\n return false;\n }\n\n boolean has1 = false;\n boolean no2 = true;\n\n int i, j;\n for (i = 0; i < depth; i++) {\n for (j = 0; j < length; j++) {\n if (finalPositions[i][j] == 1) {\n if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 1) {\n has1 = true;\n } else if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 2) {\n return false;\n }\n }\n }\n }\n System.out.println(\"has1: \" + has1);\n return has1;\n }", "public boolean setMove(boolean movable)\n {\n canMove = movable;\n return true;\n }", "@Override\n public boolean isMoveDoable(final ScoreDirector scoreDirector) {\n return true;\n }", "public boolean moveOn() {\n\t\t\n\t}", "public abstract boolean canMoveTo(Case Location);", "public abstract boolean changeMove();", "public boolean canMoveTo(int x, int y) {\n for (Cell c : this.board) {\n if (c.x == x && c.y == y) {\n return !c.isFlooded;\n }\n }\n return false;\n }", "private boolean canMove() {\n\t\tif (System.currentTimeMillis() - lastTrunTime < 300) {// move time is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 300ms before\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last move\n\t\t\treturn false;\n\t\t}\n\t\tboolean status = false;\n\t\tif(stage == 1){\n\t\t\tmap = GameView.map;\n\t\t}else if(stage == 2){\n\t\t\tmap = GameViewStage2.map;\n\t\t}else {\n\t\t\tmap = GameViewStage3.map;\n\t\t}\n\t\tif (direction == UP) {// when tank moves up\n\t\t\tif (centerPoint.getY() - speed >= 0) {\n\t\t\t\tif (map[(centerPoint.getY() - speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == DOWN) {\n\t\t\tif (centerPoint.getY() + tankBmp.getHeight() + speed < screenHeight) {\n\t\t\t\tif (map[(centerPoint.getY() + 2 * UNIT + speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == LEFT) {\n\n\t\t\tif (centerPoint.getX() - speed >= 0) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX() - speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == RIGHT) {\n\t\t\tif (centerPoint.getX() + tankBmp.getWidth() + speed < screenWidth) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX()\n\t\t\t\t\t\t+ 2 * UNIT + speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (status)\n\t\t\tlastTrunTime = System.currentTimeMillis();\n\t\treturn status;\n\t}", "public boolean canMove() {\n\t\tArrayList<Location> loc = getValid(getLocation());\n\t\tif (loc.isEmpty()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tpath.add(getLocation());\n\t\t\tif (loc.size() >= 2) {\n\t\t\t\tcrossLocation.push(path);\n\t\t\t\tpath = new ArrayList<Location>();\n\t\t\t\tnext = betterDir(loc);\n\t\t\t}\n\t\t\tnext = loc.get(0);\n\t\t}\n\t\treturn true;\n\t}", "public boolean canEndTurn(){\n\t\treturn moved;\n\n\t}", "public boolean isMovement() {\n return isMovementEvent;\n }", "public Boolean isValidMovement(int x, int y){\n\t\tif ( x < 0 || x > 7 || y < 0 || y > 7 \n\t\t\t\t|| this.board.getPiece(x, y).getColor().equalsIgnoreCase(this.color))\n\t\t\treturn false;\n\t\t\n\t\tint distX = Math.abs(this.posX - x);\n\t\tint distY = Math.abs(this.posY - y);\n\t\t\n\t\tif (distX != distY)\n\t\t\treturn false;\n\t\t\n\t\tif (this.posX > x && this.posY > y){\n\t\t\tfor (int i = 1; i < distX ; i ++){\n\t\t\t\tif (!this.board.getPiece(this.posX - i, this.posY - i).isEmpty())\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (this.posX < x && this.posY > y){\n\t\t\tfor (int i = 1; i < distX ; i ++){\n\t\t\t\tif (!this.board.getPiece(this.posX + i, this.posY - i).isEmpty())\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (this.posX > x && this.posY < y){\n\t\t\tfor (int i = 1; i < distX ; i ++){\n\t\t\t\tif (!this.board.getPiece(this.posX - i, this.posY + i).isEmpty())\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (this.posX < x && this.posY < y){\n\t\t\tfor (int i = 1; i < distX ; i ++){\n\t\t\t\tif (!this.board.getPiece(this.posX + i, this.posY + i).isEmpty())\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean isMoveLegal(Move move){\n return legalMoves.contains(move);\n }", "public void setMoveable(boolean moveable) {\n\t\t_moveable = moveable;\n\t}", "private boolean moveContinues(Point piece){\r\n boolean result = canEats(piece);\r\n // if move continues, next move has to start with the same piece\r\n model.setCheckPiece((result)?piece:null);\r\n return result;\r\n }", "public boolean move() {\n\t\tint nextDirection;\n\t\tint pacmanX = parent.getPacManX();\n\t\tint pacmanY = parent.getPacManY();\n\t\t\n\t\tint[] directionPriority = new int[4];\n\t\t/** The direction is added to the priority in order to achieve it once the move is chosen */\n\t\tdirectionPriority[0]=(pacmanX-pixelLocationX)*(10)*state+GameCharacter.RIGHT;\n\t\tdirectionPriority[1]=((pacmanX-pixelLocationX)*(-10)*state+GameCharacter.LEFT);\n\t\tdirectionPriority[2]=(pacmanY-pixelLocationY)*(10)*state+GameCharacter.DOWN;\n\t\tdirectionPriority[3]=((pacmanY-pixelLocationY)*(-10)*state+GameCharacter.UP);\n\t\tArrays.sort(directionPriority);\n\t\t\n\t\tint i=3;\n\t\t\n\t\tdo {\n\t\t\tnextDirection = directionPriority[i]%10;\n\t\t\tif (nextDirection < 0) {\n\t\t\t\tnextDirection += 10;\n\t\t\t}\n\t\t\tif(isLegalMove(nextDirection) && (Math.abs(nextDirection-currentDirection) != 2) || i==0) {\n\t\t\t\tsetDirection(nextDirection);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti--;\n\t\t}\n\t\twhile (i>=0);\n\t\treturn super.move();\n\t}", "public boolean canMoveTo(int x, int y) {\n if (x < 0 || x >= dungeon.getWidth() || y < 0 || y >= dungeon.getHeight() || characterStatus.equals(CharacterStatus.DEAD))\n return false;\n boolean canMove = true;\n for (Entity entity : dungeon.getEntities(x, y)) {\n if (entity instanceof FieldObject)\n ((FieldObject) entity).interact(this);\n if (entity instanceof FieldObject && ((FieldObject) entity).isObstacle()) {\n canMove = false;\n break;\n }\n }\n return canMove;\n }", "public boolean isSuccessiveMove() {\n return successiveMove;\n }", "public boolean isSolvable() {\n return moves != -1;\n }", "private boolean validMove(int xi, int yi, int xf, int yf) {\n\t\tPiece prevP = pieceAt(xi, yi);\n\t\tPiece nextP = pieceAt(xf, yf);\n\n\t\tif (prevP.isKing()) {\n\t\t\tif (((xf - xi) == 1 || (xi - xf) == 1) && ((yf - yi) == 1 || (yi - yf) == 1)) \n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t} else \n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (prevP.isFire()) \n\t\t{\n\t\t\tif (((xf - xi) == 1 || (xi - xf) == 1) && (yf - yi) == 1) \n\t\t\t{\n\t\t\t\tif (nextP != null && !nextP.isFire()) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\telse if ((xf - xi) == 2 && (yf - yi) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi+1, yi+1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} \n\t\t\telse if ((xi - xf) == 2 && (yf - yi) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi-1, yi+1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else \n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else \n\t\t{\n\t\t\tif (((xf - xi) == 1 || (xi - xf) == 1) && (yi - yf) == 1) \n\t\t\t{\n\t\t\t\tif (nextP != null && nextP.isFire()) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\telse if ((xf - xi) == 2 && (yi - yf) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi+1, yi-1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} \n\t\t\telse if ((xi - xf) == 2 && (yi - yf) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi-1, yi-1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean canMove(double x, double y) {\n double xr = this.x, yr = this.y - 32; //subtract y to get more accurate results\n //the thing is, subract to 32 (sprite size), so if we add 1 tile we get the next pixel tile with this\n //we avoid the shaking inside tiles with the help of steps\n if (direction == 0) {\n yr += sprite.getSize() - 1;\n xr += sprite.getSize() / 2;\n }\n if (direction == 1) {\n yr += sprite.getSize() / 2;\n xr += 1;\n }\n if (direction == 2) {\n xr += sprite.getSize() / 2;\n yr += 1;\n }\n if (direction == 3) {\n xr += sprite.getSize() - 1;\n yr += sprite.getSize() / 2;\n }\n int xx = Coordinates.pixelToTile(xr) + (int) x;\n int yy = Coordinates.pixelToTile(yr) + (int) y;\n Entity a = Board.getInstance().getEntity(xx, yy, this); //entity of the position we want to go\n return !a.collide(this);\n }", "public boolean isProvidesMovement() {\n\t\treturn providesMovement;\n\t}", "private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public boolean atDestination() {\n return myMovable.atDestination();\n }", "private boolean isSquareMovable(BoardSquareInfo target, int state, boolean isKing) {\n\t\tLog.d(LOG_TAG, String.format(\"Is square movable (recursive) square: %s, state: %s, isKing: %s\",target,state,isKing));\n\n\t\t// No need to check in opposite direction\n\t\tif (!isKing && state != activeState)\n\t\t\treturn false;\n\n\t\tif(ensureSquareMovable(target, state, isKing, /*backwards*/ true)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif(ensureSquareMovable(target, state, isKing, /*backwards*/ false)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean hasMoves() {\n if(color != 0){\n activePieces = getPiece();\n\n for(int i = 0; i < activePieces.size(); i++){\n Piece curr = activePieces.get(i);\n\n if(curr.possibleMoves(state).size() > 0){\n //curr.printSpecial();\n return true;\n }\n }\n return false;\n }\n System.out.println(\"Empty stop error\");\n return false;\n }", "boolean isLegal(Move move) {\r\n return isLegal(move.from(), move.to());\r\n }", "@Override\n public boolean canMove() {\n return storage.isRampClosed();\n }", "public boolean canMoveTo (Coordinate c)\n\t{\n\t\tif (c.x < 0 || c.x >= GRID_SIZE){\n\t\t\treturn false;\n\t\t}\n\t\tif (c.y < 0 || c.y >= GRID_SIZE) {\n\t\t\treturn false;\n\t\t}\n\t\tif (grid[c.x][c.y] == GridChar.AVAILABLE || grid[c.x][c.y] == GridChar.END){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isLegalMove() {\n return iterator().hasNext();\n }", "private boolean makeMove(Move move) {\n\n // Moving piece from Cell\n Piece sourcePiece = move.getStart().getCurrentPiece();\n\n // Valid Move? Calling Piece actual implementation\n if (!sourcePiece.canMove(board, move.getStart(), move.getEnd())) {\n System.out.println(\"Invalid Move, sourcePiece is \" + sourcePiece);\n }\n\n // Killed other player Piece?\n Piece destPiece = move.getEnd().getCurrentPiece();\n if (destPiece != null) {\n destPiece.setKilled(true);\n move.setPieceKilled(destPiece);\n }\n\n // castling?\n if (sourcePiece instanceof King\n && sourcePiece.isCastlingMove()) {\n move.setCastlingMove(true);\n }\n\n // Store the Move\n movesPlayed.add(move);\n\n // If move is VALID, set piece=null at start cell and new piece at dest cell\n move.getEnd().setCurrentPiece(sourcePiece);\n move.getStart().setCurrentPiece(null);\n\n // Game Win or not\n if (destPiece instanceof King) {\n if (move.getPlayedBy().isWhiteSide()) {\n this.setStatus(GameStatus.WHITE_WIN);\n } else {\n this.setStatus(GameStatus.BLACK_WIN);\n }\n\n }\n\n return true;\n }", "boolean checkLegalMove(int posx, int posy) {\n\t\tBoolean bool;\n\t\tint change;\n\t\tchange = curPlayer > 1 ? (change = 1) : (change = -1);\n\t\tif (kingJumping(posx, posy, change)){\n\t\t\tbool = true;\n\t\t} else if (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\tSystem.out.println(\"Normal move\");\n\t\t\tbool = true;\n\t\t} else if (jump(posx, posy, prevPiece) && (prevPosX == posx + (change * 2) && (prevPosY == posy - 2 || prevPosY == posy + 2))) {\n\t\t\tbool = true;\n\t\t} else if (((JLabel)prevComp).getIcon().equals(Playboard.rKing) || ((JLabel)prevComp).getIcon().equals(Playboard.bKing) || ((JLabel)prevComp).getIcon().equals(Playboard.blackSKing) || ((JLabel)prevComp).getIcon().equals(Playboard.redSKing)){\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\t\tbool = true;\n\t\t\t} else\n\t\t\t\tbool = false;\n\t\t} else if (prevPiece == 4 && (prevPosX == posx + 1 || prevPosX == posx -1) && (prevPosY == posy - 1 || prevPosY == posy +1)) { // King moves\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1))\n\t\t\t\tbool = true;\n\t\t\telse\n\t\t\t\tbool = false;\n\t\t} else {\n\t\t\tbool = false;\n\t\t}\n\t\treturn bool;\n\t}", "private boolean moveCheck(Piece p, List<Move> m, int fC, int fR, int tC, int tR) {\n if (null == p) {\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // Continue checking for moves.\n return false;\n }\n if (p.owner != whoseTurn) {\n // Enemy sighted!\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // No more moves!\n }\n return true;\n }", "boolean isValidMove(int move)\n\t{\n\t\treturn move >= 0 && move <= state.size() - 1 && state.get(move) == 0;\n\t}", "@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }", "private boolean isValidMove(int pressedHole) {\n return getPlayerHole(pressedHole).getKorgools() != 0;\n }", "public boolean isMoveDown() {\n return moveDown;\n }", "public boolean isHere(){ return this.piece.isAffected();}", "public boolean canCastle(int direction){\n\t\tPiece rook;\n\t\t\n\t\tif(!((getColor().equals(\"White\") && getSquare().getCol() == 4 && getSquare().getRow() == 7 ) ||\n\t\t\t\t(getColor().equals(\"Black\") && getSquare().getCol() == 4 && getSquare().getRow() == 0 )))\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tif(direction == 1){\n\t\t\trook = getSquare().getEast().getEast().getEast().getOccupant();\n\t\t\tif(rook == null || !rook.getColor().equals(this.getColor()) || !rook.getType().equals(\"Rook\") || rook.hasMoved() || this.hasMoved())\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getEast().getEast().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getEast().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif(getColor().equals(\"White\")){\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"Black\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 75 || location == 76){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"White\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 5 || location == 6){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\telse if (direction == -1){//East\n\t\t\trook = getSquare().getWest().getWest().getWest().getWest().getOccupant();\n\t\t\tif(rook == null || !rook.getColor().equals(this.getColor()) || !rook.getType().equals(\"Rook\") || rook.hasMoved() || this.hasMoved())\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getWest().getWest().getWest().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getWest().getWest().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getWest().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif(getColor().equals(\"White\")){\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"Black\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 73 || location == 72 || location == 71){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"White\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 3 || location == 2 || location == 1){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public boolean isMovable() {\n\t\treturn false;\n\t}", "public boolean hasMoved(){\n\t\treturn getGame().getCurrentPlayer().hasMoved();\n\t}", "public boolean isFreeMoving() {\n\t\treturn _freeMoving;\n\t}", "public boolean requestMove() {\r\n if (game != null) {\r\n player.getMove();\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean canMoveTo(Position position){\n return !isOccupied(position);\n }" ]
[ "0.8134188", "0.794264", "0.79032594", "0.7892004", "0.7740318", "0.7689686", "0.7663459", "0.7631385", "0.75931615", "0.7537546", "0.75072706", "0.7490839", "0.74837434", "0.748002", "0.74147636", "0.7400863", "0.7399189", "0.7384653", "0.7355211", "0.7339436", "0.73366356", "0.7310736", "0.7309605", "0.72727275", "0.7268949", "0.72124565", "0.72084653", "0.72002333", "0.71924216", "0.71383834", "0.7100592", "0.709283", "0.7082474", "0.70821923", "0.7081281", "0.70732224", "0.7050916", "0.7030627", "0.70239747", "0.7015755", "0.69874614", "0.6961466", "0.6944276", "0.69404775", "0.693718", "0.69283724", "0.692526", "0.69025236", "0.6882879", "0.68736035", "0.686426", "0.6849426", "0.6842374", "0.683414", "0.6817809", "0.6814535", "0.6804528", "0.67993903", "0.679589", "0.6795801", "0.6783739", "0.6767468", "0.6755023", "0.6742301", "0.6741769", "0.67121077", "0.67116773", "0.6711287", "0.6708055", "0.67040527", "0.669169", "0.6684303", "0.6682689", "0.66785985", "0.6676072", "0.6671225", "0.6663577", "0.6653581", "0.6652742", "0.664759", "0.6644095", "0.6641786", "0.6641159", "0.66362387", "0.66351247", "0.66330457", "0.6622516", "0.6616751", "0.6613104", "0.6610694", "0.6608317", "0.6606195", "0.6605203", "0.659852", "0.6589374", "0.65872705", "0.656806", "0.6563808", "0.6560784", "0.65601254" ]
0.81163263
1
TODO Autogenerated method stub
@Override public void getSupplierSkuId(Map<String, String> skuMap) throws ServiceException { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void handleEmail(OrderDTO orderDTO) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Constructor that loads all of the queryresponse mappings into the hashMap.
public StubGoogleAPIWrapper() { queryMap.put(case1URLQuery, case1JSONResponseStandardResponse); queryMap.put(case2URLQuery, case2JSONResponseStressTest); queryMap.put(case3URLQuery, case3JSONResponseConnectionFailedThrowIOException); queryMap.put(case4URLQuery, case4JSONResponseGoogleReturnsNoResults); queryMap.put(case5URLQuery, case5JSONResponseGoogleDeniesRequest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void initializeCache() {\n if (cacheResults && initialized) {\n dataCache = new HashMap<String, Map<String, Map<String, BaseAttribute>>>();\n }\n }", "public Response() {\n objectMap = new JSONObject<>();\n }", "public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }", "public MyHashMap() {\n map = new HashMap();\n }", "protected HashMap initReqFailedMap() {\n return new HashMap();\n }", "public MapResult() {\n }", "public MyHashMap() {\n\n }", "public MagicDictionary() {\n this.map = new HashMap<>();\n }", "public MapBuilder() {\r\n map = new Map();\r\n json = new Gson();\r\n }", "@Override\n public Map<String, String> initializeCommonQuery() {\n\n Map<String, String> commonQueryMap = new HashMap<>();\n\n commonQueryMap.put(SELECT_BY_ID_QUERY_KEY, SELECT_BY_ID_QUERY);\n commonQueryMap.put(SELECT_ALL_QUERY_KEY, SELECT_ALL_QUERY);\n commonQueryMap.put(INSERT_ENTITY_QUERY_KEY, INSERT_ENTITY_QUERY);\n commonQueryMap.put(UPDATE_ENTITY_QUERY_KEY, UPDATE_ENTITY_QUERY);\n commonQueryMap.put(DELETE_BY_ID_QUERY_KEY, DELETE_BY_ID_QUERY);\n\n return commonQueryMap;\n }", "public QueryRegistry() {\r\n }", "protected Map<String,List<PageViewVO>> initializePageMap() {\n\t\tMap<String,List<PageViewVO>> pm = new HashMap<>();\n\t\tfor (Section sect : Section.values()) {\n\t\t\tpm.put(sect.name(), new ArrayList<>());\n\t\t}\n\t\treturn pm;\n\t}", "private SearchResponseBuilder(Class<T> responseClass, Class<ST> annotatedClass,\n BiMap<String, P> solrField2ParamEnumMap,\n BiMap<String, String> solrField2javaPropertiesMap) {\n this.responseClass = responseClass;\n this.annotatedClass = annotatedClass;\n this.solrField2ParamEnumMap = solrField2ParamEnumMap;\n this.solrField2javaPropertiesMap = solrField2javaPropertiesMap;\n keyField = getKeyField(annotatedClass);\n }", "protected MapImpl() {\n }", "public MyHashMap() {\n hashMap = new ArrayList<>();\n }", "public Map() {\n\n\t\t}", "public Q706DesignHashMap() {\n keys = new ArrayList<>();\n values = new ArrayList<>();\n\n }", "public ObservableHashMap()\n {\n super();\n }", "public HashEntityMap()\n\t\t{\n\t\t\tmapNameToValue = new HashMap<String, Integer>();\n\t\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashMap()\r\n\t{\r\n\t\ttable = new MapEntry[7];\r\n\t\tcount = 0;\r\n\t\tmaxCount = table.length - table.length/3;\r\n\t\tDUMMY = new MapEntry<>(null, null);\r\n\t}", "public q677() {\n hm = new HashMap<>();\n words = new HashMap<>();\n }", "public RepositoryParser() {\n pageElementsMap = new HashMap<String, Map<String, PageElement>>();\n }", "public QueryResponse(Query q) {\n this.q = q;\n this.docIDs = new HashSet<>();\n }", "public MyHashMap() {\n\n }", "public ArrayHashMap() {\n super();\n }", "public DictionaryAdapter(Map<String,String> dict) {\n mData = new ArrayList();\n mData.addAll(dict.entrySet());\n }", "private Response() {\n initFields();\n }", "private void init() {\n UNIGRAM = new HashMap<>();\n }", "private void init() {\n\t\tmap = new LinkedHashMap<String, HeaderData>();\r\n\t\tList<HeaderData> list = config.getColumns();\r\n\t\tfor(HeaderData info: list){\r\n\t\t\tString id = info.getId();\r\n\t\t\tif(id == null) throw new IllegalArgumentException(\"Null id found for \"+info.getClass().getName());\r\n\t\t\t// Map the id to info\r\n\t\t\tmap.put(info.getId(), info);\r\n\t\t}\r\n\t}", "@Override\n protected Map<String, String> initializeCommonQueries() {\n Map<String, String> commonQueries = new HashMap<>();\n\n commonQueries.put(SELECT_ALL_QUERY_KEY, SELECT_ALL_QUERY);\n commonQueries.put(SELECT_BY_ID_QUERY_KEY, SELECT_BY_ID_QUERY);\n commonQueries.put(DELETE_BY_ID_QUERY_KEY, DELETE_BY_ID_QUERY);\n commonQueries.put(INSERT_ENTITY_QUERY_KEY, INSERT_ENTITY_QUERY);\n commonQueries.put(UPDATE_ENTITY_QUERY_KEY, UPDATE_ENTITY_QUERY);\n\n return commonQueries;\n }", "public DictionaryHandler() {\n\t}", "private static void initializeMaps()\n\t{\n\t\taddedPoints = new HashMap<String,String[][][]>();\n\t\tpopulatedList = new HashMap<String,Boolean>();\n\t\tloadedAndGenerated = new HashMap<String,Boolean>();\n\t}", "protected void initialize() {\n // Attribute Load\n this.attributeMap.clear();\n this.attributeMap.putAll(this.loadAttribute());\n // RuleUnique Load\n this.unique = this.loadRule();\n // Marker Load\n this.marker = this.loadMarker();\n // Reference Load\n this.reference = this.loadReference();\n }", "QueryResult(String... queries) {\n results = new ConcurrentHashMap<>(queries.length);\n for (String query : queries)\n results.put(query.hashCode(), new int[0]);\n }", "public Headers()\n\t{\n\t\tthis.headers = new HashMap<>();\n\t\tthis.originalCasing = new HashMap<>();\n\t\tthis.acceptHeaders = new HashMap<>();\n\t}", "public void init()\n {\n this.tripDict = new HashMap<String, Set<Trip>>();\n this.routeDict = new HashMap<String, Double>();\n this.tripList = new LinkedList<Trip>();\n this.computeAllPaths();\n this.generateDictionaries();\n }", "private void fillMap(String[] querys) {\r\n\r\n\t\tLOG.info(\"fillMap\");\r\n\r\n\t\tquerysMap = new HashMap<String, String>();\r\n\t\t\r\n\t\tfor (String query : querys) {\r\n\t\t\t\r\n\t\t\tString[] temp = getStringArray(query, START_QUERY_PATTERN);\r\n\t\t\t\r\n\t\t\tif (temp != null && temp.length == 2) {\r\n\t\t\t\t\r\n\t\t\t\ttemp[0] = temp[0].replaceAll(\"\\\\P{Alnum}\", \"\");\r\n\t\t\t\tquerysMap.put(temp[0], temp[1].trim());\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tLOG.error(\"El array es nulo o la longitud no es la esperada\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tLOG.info(\"END fillMap\");\r\n\r\n\t}", "public MagicDictionary() {\n\n }", "public HashMultiSet() {\r\n\t\tbaseMap = new HashMap<>();\r\n\t}", "public MetadataResponse() {\n data = new HashMap<String, Object>();\n }", "@Override\n public void init(HashMap<String, Object> map) {\n this.title = (String) map.get(\"title\");\n this.url = (String) map.get(\"url\");\n }", "public EncodingMap() {}", "public Map initMap(){\n\t\tif (map == null){\n\t\t\tmap = createMap();\n\t\t}\n\t\treturn map;\n\t}", "public QueryResponseInner() {\n }", "public Response(JSONObject<String, Object> map) {\n objectMap = map;\n }", "public void initMap() {\n\t\tmap = new Map();\n\t\tmap.clear();\n\t\tphase = new Phase();\n\t\tmap.setPhase(phase);\n\t\tmapView = new MapView();\n\t\tphaseView = new PhaseView();\n\t\tworldDomiView = new WorldDominationView();\n\t\tcardExchangeView = new CardExchangeView();\n\t\tphase.addObserver(phaseView);\n\t\tphase.addObserver(cardExchangeView);\n\t\tmap.addObserver(worldDomiView);\n\t\tmap.addObserver(mapView);\n\t}", "@Before\n public void initialize()\n {\n map = new MapAdapter();\n }", "private SolrIndexer()\n {\n fieldMap = new HashMap<String, String[]>();\n transMapMap = new HashMap<String, Map<String, String>>();\n customMethodMap = new HashMap<String, Method>();\n customMixinMap = new HashMap<String, SolrIndexerMixin>();\n indexDate = new Date();\n }", "private void init() {\n\t\tinitProtocol();\n\t\tinitResultStorage();\n\t}", "private void initMaps()\r\n\t{\r\n\t\tenergiesForCurrentKOppParity = new LinkedHashMap<Integer, Double>();\r\n\t\tinputBranchWithJ = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedR = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedP = new LinkedHashMap<Integer, Double>();\r\n\t\tassociatedQ = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularP = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularQ = new LinkedHashMap<Integer, Double>();\r\n\t\ttriangularR = new LinkedHashMap<Integer, Double>();\r\n\t\tupperEnergyValuesWithJ = new LinkedHashMap<Integer, Double>();\r\n\t}", "public Map() {\n\t\t//intially empty\n\t}", "public ScopedMap() {\n\t\tmap = new ArrayList<HashMap<K, V>>();\n\n\t}", "public MyHashMap() {\n keys = new MapNode[n];\n vals = new MapNode[n];\n for (int i=0; i < n ; ++i) {\n keys[i] = new MapNode();\n vals[i] = new MapNode();\n }\n }", "public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}", "static void createResultHashMap(Set<String> fields, FetchValue.Response response,\n HashMap<String, ByteIterator>resultHashMap) {\n // If everything went fine, then a result must be given. Such an object is a hash table containing the (field,\n // value) pairs based on the requested fields. Note that in a read operation, ONLY ONE OBJECT IS RETRIEVED!\n // The following line retrieves the previously serialized table which was store with an insert transaction.\n byte[] responseFieldsAndValues = response.getValues().get(0).getValue().getValue();\n\n // Deserialize the stored response table.\n HashMap<String, ByteIterator> deserializedTable = new HashMap<>();\n deserializeTable(responseFieldsAndValues, deserializedTable);\n\n // If only specific fields are requested, then only these should be put in the result object!\n if (fields != null) {\n // Populate the HashMap to provide as result.\n for (Object field : fields.toArray()) {\n // Comparison between a requested field and the ones retrieved. If they're equal (i.e. the get() operation\n // DOES NOT return a null value), then proceed to store the pair in the resultHashMap.\n ByteIterator value = deserializedTable.get(field);\n\n if (value != null) {\n resultHashMap.put((String) field, value);\n }\n }\n } else {\n // If, instead, no field is specified, then all those retrieved must be provided as result.\n for (String field : deserializedTable.keySet()) {\n resultHashMap.put(field, deserializedTable.get(field));\n }\n }\n }", "public ResponseSummaries() {\n }", "public MyHashMap() {\r\n\t\tloadFactor = DEFAULT_LOAD_FACTOR;\r\n\t\tcapacity = DEFAULT_CAPACITY;\r\n\t\thashMapArray = new LinkedList[capacity];\r\n\t}", "private static void initializeMap() {\n\t\tmap = new HashMap<String, MimeTransferEncoding>();\n\t\tfor (MimeTransferEncoding mte : MimeTransferEncoding.values()) {\n\t\t\tmap.put(mte.string, mte);\n\t\t}\n\t}", "public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }", "public void buildMap(){\n this.map = new HashMap<String, String>();\n map.put(\"user\", \"user\");\n map.put(\"pw\", \"pass\");\n map.put(\"quit\", \"quit\");\n map.put(\"features\", \"feat\");\n map.put(\"cd\", \"cwd\");\n map.put(\"dir\", \"list\");\n map.put(\"get\", \"retr\");\n }", "public Translator() {\n\t\tdictionary = new Dictionary();\n\t}", "public OwnMap() {\n super();\n keySet = new OwnSet();\n }", "protected WumpusMap() {\n\t\t\n\t}", "public AttributeMap()\r\n\t{\r\n\t\tsuper();\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashTableMap() {\r\n\t\tK = new LinkedList[10];\r\n\t\tV = new LinkedList[10];\r\n\t}", "public CaseInsensitiveDictionary() {\n words = new HashSet<>();\n }", "private void initialize() {\n first = null;\n last = null;\n size = 0;\n dictionary = new Hashtable();\n }", "private void registerCaches(){\n // Initialize region arraylist\n prisoners = new HashMap<>();\n regions = QueryManager.getRegions();\n prisonBlocks = QueryManager.getPrisonBlocks();\n portals = QueryManager.getPortals();\n }", "public void initializeDictionary() {\n\t\tmyDictionary = new SLogoDictionary();\n\t}", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "public MyHashMap() {\n\t\tthis(INIT_CAPACITY);\n\t}", "public HitCounter() {\n map = new HashMap<Integer, Integer>();\n }", "public Twitter() {\n map = new HashMap<>();\n }", "public void initMap()\r\n/* */ {\r\n///* 36 */ putHandler(\"vwkgcode\", PDWkHeadTailVWkgcodeHandler.class);\r\n///* 37 */ putHandler(\"fcapacitycalc\", PDWkHeadTailFcapacitycalcHandler.class);\r\n///* 38 */ putHandler(\"bprodline\", PDWkHeadTailBprodlineHandler.class);\r\n/* */ }", "protected ForwardingMap() {}", "public HashMapStack()\n {\n this.hashMap = new HashMap<>();\n }", "public Parser() {\n\t\tpopulateMaps();\n\t}", "void setHashMap();", "private DictionaryReader() {}", "public MyHashMap() {\n this.key_space = 2069;\n this.hash_table = new ArrayList<Bucket>();\n for (int i = 0; i < this.key_space; ++i) {\n this.hash_table.add(new Bucket());\n }\n }", "public WMS100MapRequest() {\n\n }", "private HashMap<String,String> createQueryMap() {\n\t\t\n\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\n\t\t// Only include Pages with the CenterNet Event template\n\t\tmap.put(\"type\",\"cq:Page\");\n\t\tmap.put(\"path\", Constants.EVENTS);\n\t\tmap.put(\"property\",\"jcr:content/cq:template\");\n\t map.put(\"property.value\", Constants.EVENT_TEMPLATE);\n\n\t if (tags != null) {\n\t \tmap = addTagFilter(map);\n\t }\n\n\t // Only include Events whose start time is in the future\n\t map.put(\"relativedaterange.property\", PN_QUERY_START_TIME);\n\t map.put(\"relativedaterange.lowerBound\", \"-0d\");\n\t \n\t // Include all hits\n\t //map.put(\"p.limit\", maxNum.toString());\n\t map.put(\"p.limit\", maxNum);\n\t map.put(\"p.guessTotal\", \"true\");\n\t \n\t // Order by Start Time\n\t map.put(\"orderby\", PN_QUERY_START_TIME);\n\t map.put(\"orderby.sort\", \"asc\");\n\t \n\t\treturn map;\n\t\t\n\t}", "@PostConstruct\r\n public void init() {\n List<Person> personList = personRepository.findAll();\r\n for(Person person:personList)\r\n personHashMap.put(person.getId(),person);\r\n }", "public BasePresenter() {\n if (sHashMaps == null) {\n sHashMaps = new LinkedList<>();\n }\n }", "void init() throws ResultException, DmcValueException, DmcNameClashException {\n globallyUniqueMAP \t\t\t\t= new HashMap<DotName,DmsDefinition>();\n clashMAP\t\t\t\t= new HashMap<DotName, ArrayList<DmsDefinition>>();\n \n // We default to use ourselves as the clash resolver\n currentResolver\t\t\t\t= this;\n \n// enumDefs \t\t\t\t\t= new HashMap<DefinitionName,EnumDefinition>();\n enumDefinitions\t\t\t\t= new DmcDefinitionSet<EnumDefinition>();\n typeDefs \t\t\t\t= new HashMap<DefinitionName,TypeDefinition>();\n internalTypeDefs \t\t= new HashMap<DefinitionName,TypeDefinition>();\n \n attributeDefinitions\t\t= new DmcDefinitionSet<AttributeDefinition>();\n classDefinitions\t\t\t= new DmcDefinitionSet<ClassDefinition>();\n \n attrByID\t\t\t\t\t= new TreeMap<Integer, AttributeDefinition>();\n classesByID\t\t\t\t\t= new TreeMap<Integer, ClassDefinition>();\n classesByJavaClass\t\t\t= new TreeMap<String, ClassDefinition>();\n actionDefs \t\t\t\t= new HashMap<DefinitionName,ActionDefinition>();\n// classDefs \t\t\t\t= new HashMap<DefinitionName,ClassDefinition>();\n complexTypeDefs \t\t\t= new HashMap<DefinitionName,ComplexTypeDefinition>();\n extendedReferenceTypeDefs = new HashMap<DefinitionName,ExtendedReferenceTypeDefinition>();\n sliceDefs \t\t\t\t= new HashMap<DefinitionName,SliceDefinition>();\n ruleCategoryDefs \t\t\t= new HashMap<DefinitionName,RuleCategory>();\n ruleCategoriesByID\t\t\t= new TreeMap<Integer, RuleCategory>();\n ruleDefs \t\t\t\t\t= new HashMap<DefinitionName,RuleDefinition>();\n ruleDefsByDot \t\t\t= new HashMap<DotName, RuleDefinition>();\n ruleData\t\t\t\t\t= new TreeMap<RuleName, RuleData>();\n schemaDefs \t\t\t\t= new TreeMap<DefinitionName,SchemaDefinition>();\n definitionModuleDefs \t\t= new TreeMap<DefinitionName,DSDefinitionModule>();\n classAbbrevs\t\t\t\t= new HashMap<DefinitionName,ClassDefinition>();\n attrAbbrevs \t\t\t\t= new HashMap<DefinitionName,AttributeDefinition>();\n hierarchicObjects\t\t\t= null;\n \n extensions\t\t\t\t= new TreeMap<String, SchemaExtensionIF>();\n \n performIDChecks = true;\n \n\n // Create the global metaschema\n if (MetaSchema._metaSchema == null){\n meta = new MetaSchema();\n \n }\n else\n meta = MetaSchema._metaSchema;\n \n // Manage the meta schema so that we have a starting point for schema management\n manageSchemaInternal(meta);\n \n resolveReferences(meta,this);\n\n // Now that everything's resolved, we have some unfinished business to take care of\n \tIterator<AttributeDefinition> adl = meta.getAttributeDefList();\n \tresolveNameTypes(adl);\n }", "public DictionaryModuleImpl() {\r\n }", "public TransliterationManager()\n\t{\n\t\tmap = new HashMap<String, ITransliterator>();\n\t\tcodings = new HashSet<String>();\n\t}", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "private CallResponse() {\n initFields();\n }", "public Twitter() {\n u_map = new HashMap<>();\n }", "public void init() {\n\t\tinitResponse();\n\t\tmResponseIndex = 0;\n\t\tmMsgHandler.postDelayed(mInitRunnable, 100);\n\t}", "@Override\n public void initialize() {\n emissary.core.MetadataDictionary.initialize();\n }", "@Override\n protected void initializeImpl() {\n // init templates map\n this.httpRequestTemplateMap = new HashMap<String, String>();\n\n String[] templateNames = new String[] {\n FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_FAX_JOB_TEMPLATE_PROPERTY_KEY.toString(),\n FaxJob2HTTPRequestConverterConfigurationConstants.SUSPEND_FAX_JOB_TEMPLATE_PROPERTY_KEY.toString(),\n FaxJob2HTTPRequestConverterConfigurationConstants.RESUME_FAX_JOB_TEMPLATE_PROPERTY_KEY.toString(),\n FaxJob2HTTPRequestConverterConfigurationConstants.CANCEL_FAX_JOB_TEMPLATE_PROPERTY_KEY.toString(),\n FaxJob2HTTPRequestConverterConfigurationConstants.GET_FAX_JOB_STATUS_TEMPLATE_PROPERTY_KEY.toString() };\n\n // get templates amount\n int amount = templateNames.length;\n\n // get template encoding value\n String encoding = this.getConfigurationValue(\n FaxJob2HTTPRequestConverterConfigurationConstants.TEMPLATE_ENCODING_PROPERTY_KEY);\n\n String templateName = null;\n String urlStr = null;\n URL url = null;\n String template = null;\n for (int index = 0; index < amount; index++) {\n // get next element\n templateName = templateNames[index];\n\n // get URL string\n urlStr = this.getConfigurationValue(templateName);\n\n if (urlStr != null) {\n try {\n // create URL\n url = new URL(urlStr);\n\n // read template\n InputStream stream = url.openStream();\n Reader reader = IOHelper.createReader(stream, encoding);\n template = IOHelper.readTextStream(reader);\n\n // cache template\n this.httpRequestTemplateMap.put(templateName, template);\n } catch (Throwable throwable) {\n throw new FaxException(\"Unable to load template for URL: \" + urlStr, throwable);\n }\n }\n }\n }", "IcedHM() { _m = new NonBlockingHashMap<>(); }", "public HitCounter() {\n map = new TreeMap<>();\n }", "private void initialize() {\n\t\tplayerMap = new HashMap<>();\n\t\ttypeMap = new HashMap<>();\n\t\tfor (ProductType type : ProductType.values()) {\n\t\t\tMap<ProductState, Map<Integer, Set<Product>>> stateMap = new HashMap<>();\n\t\t\tfor (ProductState state : ProductState.values()) {\n\t\t\t\tMap<Integer, Set<Product>> map = new HashMap<>();\n\t\t\t\tstateMap.put(state, map);\n\t\t\t}\n\t\t\ttypeMap.put(type, stateMap);\n\t\t}\n\t}", "public PostalCodeDataBase()\n {\n codeToCityMap = new HashMap<String, Set<String>>();\n // additional instance variable(s) to be initialized in part (b)\n }", "public TimeMap2() {\n map = new HashMap<>();\n }", "public void initEvaluatorMap() {\n putObject(CoreConstants.EVALUATOR_MAP, new HashMap());\n }", "ReviewService() {queryMap.put(PAGE_QUERY_PARAM, \"1\");}" ]
[ "0.6110422", "0.6060894", "0.60059595", "0.59535503", "0.593525", "0.5902521", "0.5877572", "0.5843218", "0.58058023", "0.580253", "0.57374907", "0.5699981", "0.5690806", "0.5651583", "0.5635029", "0.5627501", "0.5618209", "0.56107646", "0.5608969", "0.5607792", "0.5597461", "0.5585203", "0.55810314", "0.55799705", "0.55682844", "0.5553017", "0.55472696", "0.5528589", "0.55071735", "0.54682064", "0.54456526", "0.54421514", "0.54381627", "0.5426106", "0.5424512", "0.54103696", "0.5400902", "0.5392983", "0.5390736", "0.53872305", "0.53818893", "0.53660136", "0.5343194", "0.53403145", "0.5336846", "0.5320379", "0.530442", "0.5289028", "0.5286365", "0.52805173", "0.5279122", "0.52771497", "0.5275305", "0.5266849", "0.52641726", "0.5254476", "0.52537304", "0.52511686", "0.5235733", "0.5233206", "0.5229363", "0.5228003", "0.52210796", "0.52160966", "0.5213893", "0.5213042", "0.5207494", "0.5196303", "0.5193932", "0.5193248", "0.51908475", "0.5189395", "0.5188236", "0.51852113", "0.5183408", "0.517411", "0.5169781", "0.51643175", "0.51586914", "0.5153637", "0.51518846", "0.51318735", "0.5127351", "0.512523", "0.51119924", "0.51090264", "0.5094226", "0.50939363", "0.5090025", "0.50862354", "0.50856316", "0.5084726", "0.50790066", "0.5078967", "0.50732976", "0.5056201", "0.50554776", "0.5053972", "0.50508994", "0.5048567" ]
0.5744211
10
private static final String //QUASTIONDOES NOT IGNORES CASE! = null;
public static void main(String[] args) { // LENGTH(); // String str="Syntax";----------------------- // int lengthOfString=str.length(); // System.out.println(lengthOfString); // String name="Timmy";--------------------- // int lengthOfString=name.length(); // System.out.println(lengthOfString); // String name1=" Syntex Technolody ";------------------ // int lengthOfString1=name1.length(); // System.out.println(name1.length()); // String str2="Welcome, students!";----------------------- // System.out.println(str2.length()); // UPPER LOWER cases; // String str3="Hello"; // String newString=str3.toUpperCase(); // System.out.println(newString); // String lowerCaseString=newString.toLowerCase(); // System.out.println(lowerCaseString); // String love="Peionies will bring me Love"; // String caseString=love.toUpperCase(); // System.out.println(love.toUpperCase()); // String job="GOOD JOB IS SECCSESS IN LIFE"; // String newString1=job.toLowerCase(); // System.out.println(newString1); // //equality; // String p1="The Hight is 5 inches"; // String p2="The hight is 5 inches"; //QUASTION---DOES NOT IGNORES CASE! // boolean equality=p1.equalsIgnoreCase(p2); // System.out.println(equality); String word1 = "syntaxsolutions"; String word2 = "SYNTAXSOLUTIONS"; String case1 =word1.toUpperCase(); System.out.println(case1); String case2 = word2.toLowerCase(); System.out.println(case2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Strings()\n\t{\n\t}", "private Strings()\n\t{\n\t}", "private static String valueOf(Object str3Sg) {\n\t\treturn null;\r\n\t}", "private static String m23463a() {\n return \"\";\n }", "private StringUtilities() {\n // nothing to do\n }", "private Constantes() {\r\n\t\t// No way\r\n\t}", "public static void setNewStatic(String value) {\n }", "private USBConstant() {\r\n\r\n\t}", "private MainConst() {\n super(\"\");\n }", "public String method_211() {\r\n return null;\r\n }", "String constant();", "private StringAssert() {\n }", "String getDefaultNull();", "private Const() {\n }", "private LevelConstants() {\n\t\t\n\t}", "private Strings() {\n }", "public interface InterfaceWithStaticFinalField {\r\n\tstatic final String MY_STRING = \"My value\";\r\n}", "private String getString() {\n\t\treturn null;\n\t}", "private static void m9058c(String str) {\n StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[3];\n String className = stackTraceElement.getClassName();\n String methodName = stackTraceElement.getMethodName();\n throw ((IllegalArgumentException) m9050a(new IllegalArgumentException(\"Parameter specified as non-null is null: method \" + className + \".\" + methodName + \", parameter \" + str)));\n }", "@Override\n\tpublic InterpreteConstants constant() {\n\t\treturn null;\n\t}", "@Test\n\tpublic void caseNameWithNull() {\n\t\tString caseName = \"null\";\n\t\ttry {\n\t\t\tStringNumberUtil.stringUtil(caseName);\n\t\t\tfail();\n\t\t} catch (StringException e) {\n\n\t\t}\n\t}", "public static void main(String[] args) {\n// System.out.println(Parent2.str);//public static String str = \"hello world\";\n\n// hello world\n System.out.println(Parent2.a);//public static final String str = \"hello world\";\n }", "private GPSConst()\n\t{\n\t\t\n\t}", "StringConstant createStringConstant();", "abstract String mo1747a(String str);", "public void testSponsorTypeNameConstant() {\n assertEquals(\"SPONSOR_TYPE_NAME is incorrect\", UserConstants.SPONSOR_TYPE_NAME, \"sponsor\");\n }", "public interface Constants {\n String NA = \"NA\";\n}", "public abstract String mo13682d();", "abstract String mo1748c();", "public String mo9226aA() {\n return null;\n }", "public interface ConstString\n{\n\tString STRING_ENCODING_UTF8 = \"UTF-8\";\n\tString APPLICATION_XML = \"application/xml\";\n\tString APPLICATION_JSON = \"application/json\";\n\tString APP_JSON_UTF_8 = \"application/json;charset=UTF-8\";\n\tString APP_XML_UTF_8 = \"application/xml;charset=UTF-8\";\n}", "@Override\n public String visit(EnumConstantDeclaration n, Object arg) {\n return null;\n }", "PTString() \n {\n _str = \"\";\n }", "default String getPattern() {\n return null;\n }", "private static Object Stringbuilder() {\n\t\treturn null;\n\t}", "default String notRequired() {\n return \"Default implementation\";\n }", "public void m23077a(String str) {\n }", "private stendhal() {\n\t}", "private Constants() {\n }", "private Constants() {\n }", "private NullSafe()\n {\n super();\n }", "private final String m43294b(String str) {\n return str != null ? str : ManagerWebServices.PARAM_TEXT;\n }", "void m6862a(String str) {\n this.f5230a = str;\n }", "public String mo5145a() {\n throw null;\n }", "public static /* synthetic */ String m109037a(String str) {\n return str;\n }", "public abstract String mo41079d();", "private Constants() {\n\n }", "public abstract void mo70704a(String str);", "private Constants() {\n\t\tthrow new AssertionError();\n\t}", "FPNode_Strings(){\r\n\t\t\r\n\t}", "private LoggerConstants() {\n\t\tsuper();\n\t}", "public void mo4331a(String str) {\n if (this.f3134D == null) {\n super.mo4331a(str);\n }\n }", "public abstract String mo118046b();", "protected String getTokenConstant() {\r\n return null;\r\n }", "public void setName(String newName) { throw new NotImplementedException(\"Variable names are final!\"); }", "protected String compString() {\n\t\treturn null;\n\t}", "public void mo21792Q() {\n }", "public String func_176882_c() {\n/* */ return this.field_176891_j;\n/* */ }", "public void mo3901c(String str) {\n this.f773e = str;\n }", "@Override\n\tpublic String monHoc() {\n\t\treturn null;\n\t}", "@Test\n\tvoid testCheckString4() {\n\t\tassertFalse(DataChecker.checkString((String)null));\n\t}", "public static void main(String[] args) {\nfinal String str=\"Hello\";//constant variables CANT BE change;\n// name=\"School\";\n\n\t}", "public abstract String mo24851a(String str);", "public Enum() \n { \n set(\"\");\n }", "private WebStringUtils() {}", "public void testPlayerTypeNameConstant() {\n assertEquals(\"PLAYER_TYPE_NAME is incorrect\", UserConstants.PLAYER_TYPE_NAME, \"player\");\n }", "interface TestConstants {\n /** Address that passes the email REGEX validation. */\n String GOOD_EMAIL = \"[email protected]\";\n \n /** 10 digit phone number that meets our phone REGEX validation. */\n String GOOD_PHONE = \"5551112222\";\n \n /** There is no REGEX for real names, it just needs to not be blank. */\n String GOOD_NAME = \"Jim Bob\";\n \n /** int for testing good values in Job. */\n int GOOD_INT = 3;\n \n /** int for testing bad values in Job. */\n int BAD_INT = -5;\n \n /** String null value to test for catching cast errors */\n String BAD_STRING = null;\n \n /** String value to test for sunny day string */\n String GOOD_STRING = \"STRING\";\n \n /** Park null value to test for catching cast errors */\n Park P_NULL = null;\n}", "public String limpiar()\r\n/* 509: */ {\r\n/* 510:529 */ return null;\r\n/* 511: */ }", "public abstract void mo4373a(String str);", "@Override\r\n\tpublic String swim() {\n\t\treturn null;\r\n\t}", "String getConstant();", "@Test\n public void nonNullString() {\n }", "public abstract String getString();", "public abstract String getString();", "private Rekenhulp()\n\t{\n\t}", "public T caseExpression_String(Expression_String object)\r\n {\r\n return null;\r\n }", "private CommonUIConstants()\n {\n }", "static String m3302v() throws C1108a {\n if (f3067ki != null) {\n return f3067ki;\n }\n throw new C1108a();\n }", "private void fixSingletonIncluded() {\n if (included_strings != null && included_strings.size() == 1) {\n str = included_strings.iterator().next();\n included_strings = null;\n flags &= ~STR;\n }\n }", "private SecurityConsts()\r\n\t{\r\n\r\n\t}", "private void m50366E() {\n }", "@SuppressWarnings(\"UnusedDeclaration\")\n public static void __staticInitializer__() {\n }", "@Test(expected = NullPointerException.class)\n\tpublic void testNull() {\n\n\t\tString str = null;\n\t\tstr.toUpperCase();\n\t}", "public String NullSave()\n {\n return \"null\";\n }", "void mo1935c(String str);", "String mo38972c();", "public String getString(String name)\n/* */ {\n/* 827 */ return getString(name, null);\n/* */ }", "public void method_4270() {}", "private Utility() {\n\t}", "static void sm() {\n }", "private StringUtil() {\n\t\tsuper();\n\t}", "public String editar()\r\n/* 441: */ {\r\n/* 442:445 */ return null;\r\n/* 443: */ }", "public final synchronized void mo39724b(String str) {\n if (str == null) {\n str = \"\";\n }\n this.f40741w = str;\n }", "private Constants(){\n }", "public static void m9057b(String str) {\n m9054a(\"lateinit property \" + str + \" has not been initialized\");\n }", "public void m23080b(String str) {\n }", "public String getSecretWord() {\r\n return \"DEFAULT\";\r\n }", "public None()\n {\n \n }", "public void m19078a(String str) {\n if (str != null) {\n this.f20368f = str;\n return;\n }\n throw new NullPointerException();\n }", "public abstract String mo11611b();", "public void Case18(){\n\n }" ]
[ "0.62489796", "0.62489796", "0.61749506", "0.6160835", "0.6005665", "0.59713477", "0.5926752", "0.59192944", "0.59092474", "0.5897678", "0.5881825", "0.58638877", "0.5860305", "0.58363986", "0.58125734", "0.5799069", "0.5778747", "0.5778536", "0.5748907", "0.57192045", "0.5715254", "0.57071817", "0.569279", "0.5691135", "0.56705314", "0.5667533", "0.56530726", "0.5649416", "0.5643151", "0.5628598", "0.5619815", "0.5606581", "0.55882794", "0.558416", "0.558206", "0.55591184", "0.5541939", "0.5537205", "0.5534597", "0.5534597", "0.5524965", "0.5524064", "0.55201966", "0.5519793", "0.5519465", "0.55022866", "0.5501241", "0.5494677", "0.5488866", "0.54675704", "0.544957", "0.5443475", "0.5438058", "0.54322606", "0.5418595", "0.5417346", "0.5404795", "0.539953", "0.5394946", "0.5386769", "0.5385176", "0.5385087", "0.53829783", "0.5380346", "0.5378767", "0.5377613", "0.5377112", "0.53717005", "0.5370354", "0.53701514", "0.5357999", "0.53530174", "0.53484595", "0.53484595", "0.5347521", "0.5346185", "0.5336697", "0.53363883", "0.5334441", "0.5330476", "0.5329807", "0.5329476", "0.5328555", "0.53276616", "0.5325719", "0.5322914", "0.53213936", "0.53205913", "0.5318667", "0.53176665", "0.5313842", "0.53097254", "0.5309365", "0.5308659", "0.529405", "0.5294011", "0.5293881", "0.528754", "0.52854156", "0.52852994", "0.528241" ]
0.0
-1
Empty Mapper for naming preoccupancy
public interface PageResourceMapper { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mapping() {\n\t\t\n\t}", "public static Mapper<String> name() {\n return NAME;\n }", "private void initMapNameMapping() {\n mMapNameMapping.clear();\n\n // Load the name mapping from the config\n ConfigurationSection mappingSection = getConfig().getConfigurationSection(MappingSectionName);\n if (mappingSection != null) {\n // Load and check the mapping found in the config\n Map<String, Object> configMap = mappingSection.getValues(false);\n for (Map.Entry<String, Object> entry : configMap.entrySet()) {\n mMapNameMapping.put(entry.getKey(), (String) entry.getValue());\n }\n } else {\n getLogger().warning(String.format(\"[%s] found no configured mapping, creating a default one.\", mPdfFile.getName()));\n }\n\n // If there are new worlds in the server add them to the mapping\n List<World> serverWorlds = getServer().getWorlds();\n for (World w : serverWorlds) {\n if (!mMapNameMapping.containsKey(w.getName())) {\n mMapNameMapping.put(w.getName(), w.getName());\n }\n }\n\n // Set the new mapping in the config\n getConfig().createSection(MappingSectionName, mMapNameMapping);\n }", "private void renameMapNames () {\n if (mappingNum == 0) {\n mapNames = null;\n return;\n }\n this.mapNames = new String[mappingNum];\n for (int i = 0; i < mappingNum; i++) {\n mapNames[i] = GBSHDF5Constants.MAPBASE + this.getThreeFigureString(i);\n }\n }", "protected AusschreibungMapper() {\r\n\t}", "public Mapper(String name) {\n this(name, null, null);\n }", "private OwBootstrapToIdMapping()\r\n {\r\n\r\n }", "@Mapper(withIoC = IoC.SPRING, withIgnoreMissing = IgnoreMissing.ALL)\npublic interface RemainMapper extends SelmaObjectMapper<RemainTadbir, Remain> {\n}", "private void processNameToObjectMap() {\r\n for (int i = 0; i < this.getObjectGroupCount(); i++) {\r\n ObjectGroup g = this.objectGroups.get(i);\r\n this.objectGroupNameToOffset.put(g.name, i);\r\n HashMap<String, Integer> nameToObjectMap = new HashMap<String, Integer>();\r\n for (int ib = 0; ib < this.getObjectCount(i); ib++) {\r\n nameToObjectMap.put(this.getObjectName(i, ib), ib);\r\n }\r\n g.setObjectNameMapping(nameToObjectMap);\r\n }\r\n }", "protected void performMapping_() throws IllegalActionException,\r\n\t\t\tNameDuplicationException {\r\n\r\n\t\t// Getting all producers where lifelines can be mapped\r\n\t\tproducers_ = getproducers_();\r\n\t\tint amountOfProducers = producers_.size();\r\n\r\n\t\t// Goes through the list of producers and checks their positions on the\r\n\t\t// mesh to find out the NoC dimensions\r\n\r\n\t\tfor (int i = 0; i < amountOfProducers; i++) {\r\n\r\n\t\t\tProducer p = (Producer) producers_.get(i);\r\n\t\t\tint x = p.getAddressX();\r\n\t\t\tint y = p.getAddressY();\r\n\r\n\t\t\tif (x > xdimension)\r\n\t\t\t\txdimension = x;\r\n\t\t\tif (y > ydimension)\r\n\t\t\t\tydimension = y;\r\n\r\n\t\t}\r\n\r\n\t\t// Creates a hashtable indexing all lifelines by their UML names,\r\n\t\t// which is the name entered by the model designer\r\n\t\t//\r\n\r\n\t\tHashtable lifelinesByUMLName = new Hashtable();\r\n\t\tEnumeration lifelines = lifelinesDirector_.keys();\r\n\r\n\t\twhile (lifelines.hasMoreElements()) {\r\n\r\n\t\t\tLifeline l = (Lifeline) lifelines.nextElement();\r\n\r\n\t\t\tString name = l.getUMLName();\r\n\t\t\tif (!(lifelinesByUMLName.get(name) instanceof Vector))\r\n\t\t\t\tlifelinesByUMLName.put(name, new Vector());\r\n\t\t\t((Vector) lifelinesByUMLName.get(name)).addElement(l);\r\n\t\t}\r\n\r\n\t\t// Reads the contents of the \"lifelines\" parameter and parses\r\n\t\t// the substrings separated by a comma\r\n\r\n\t\tString s = orderOfLifelines.stringValue();\r\n\t\tStringTokenizer st = new StringTokenizer(s, \",\");\r\n\r\n\t\t// Fetches each lifeline of the list and maps it sequentially to a\r\n\t\t// producer\r\n\t\twhile (st.hasMoreTokens()) {\r\n\r\n\t\t\tVector b = (Vector) lifelinesByUMLName.get(st.nextToken());\r\n\t\t\tProducer p = nextProducer(); // must be called even if the lifeline\r\n\t\t\t\t\t\t\t\t\t\t\t// doesn't exist, to enable a\r\n\t\t\t\t\t\t\t\t\t\t\t// \"no map\"\r\n\t\t\tif (b != null) {\r\n\t\t\t\tfor (int i = 0; i < b.size(); i++) {\r\n\r\n\t\t\t\t\tLifeline bl = (Lifeline) b.elementAt(i);\r\n\t\t\t\t\tlifelinesProducer_.put(bl, p);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "protected WumpusMap() {\n\t\t\n\t}", "@Override\r\n\tpublic Object getMapper() {\n\t\treturn null;\r\n\t}", "protected Mapping(String name) {\n this.name = name;\n }", "@Override\n\tpublic Object getMapper() {\n\t\treturn null;\n\t}", "public String[] getFieldNameMapping() {\r\n return null;\r\n }", "@Override\r\n\tpublic Mapper<Keyword> getMapper() {\n\t\treturn null;\r\n\t}", "public Mapping() { this(null); }", "public interface Mapper {\n\n\t/**\n\t * A {@link Mapper} is uniquely identified with a {@link String}. This\n\t * helps differentiating mapping XMLs produced with different mappers.\n\t * \n\t * @return the unique identifier of this mapper\n\t */\n\tpublic abstract String getMapperId();\n\t\n\t/**\n\t * Maps the cores from the APCG to the nodes from the NoC.\n\t * \n\t * @see MappingType\n\t * \n\t * @return a array of Strings containing the mappings (specially for multi-objective case) XML\n\t * \n\t * @throws TooFewNocNodesException\n\t */\n\tpublic abstract String[] map() throws TooFewNocNodesException;\n\n}", "public Mapper() {\n\t\t\n\t\tmirMap = scanMapFile(\"mirMap.txt\");\n\t\tgeneMap = scanMapFile(\"geneMap.txt\");\n\t\t\n\t}", "public void setMappedName(final String mappedName) {\n this.mappedName = checkEmpty(mappedName);\n }", "@Mapper\npublic interface SpiderMapper {\n \n}", "@Override\n public HashMap<String, List<String>> initializeMapping(HashMap<String, List<String>> mapping) {\n mapping.put(\"xEncoder\", Arrays.asList(\"outtakeMotor1\", \"outtake1\"));\n mapping.put(\"yEncoder\", Arrays.asList(\"wobbleMotor\"));\n\n return mapping;\n }", "public ResultSetMapper() {\n registerAttributeConverters();\n this.fieldNamingStrategy = new IdentityFieldNamingStrategy();\n logger.info(\"No specific field naming strategy has been set. It will default to the {} field naming strategy.\", this.fieldNamingStrategy);\n }", "public ImageFileNameMap()\r\n {\r\n prevMap = null;\r\n }", "public String toString(PrefixMapping pmap) \n {\n return null;\n }", "@Override\n\tprotected Mapping getMapping() {\n\t\treturn new Mapping()\n\t\t\t.add(\"firstname\", driver.getFirstName())\n\t\t\t.add(\"lastname\", driver.getLastName())\n\t\t\t.add(\"dateofbirth\", driver.getDateOfBirth())\n\t\t\t.add(\"gender\", driver.getGender())\n\t\t\t.add(\"age\", computeAge())\n\t\t\t.add(\"numberOfAccidents\", driver.getNumberOfAccidents())\n\t\t\t.add(\"numberOfTickets\", driver.getNumberOfTickets());\n\t}", "public String getPropertyNameMapped(String aName) { return aName; }", "private Map<Integer, Integer> buildRenaming() {\n\t\tMap<Integer, Integer> map = new HashMap<>();\n\n\t\tfor(int i = 0; i < this.dimension; i++){\n\t\t\tfor(int j = 0; j < this.dimension; j++)\n\t\t\t\tmap.put(board_p[i][j].var(), board[i][j].var());\n\t\t}\n\n\t\treturn map;\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface Owner3Mapper extends EntityMapper <Owner3DTO, Owner3> {\n \n @Mapping(target = \"car3S\", ignore = true)\n Owner3 toEntity(Owner3DTO owner3DTO); \n default Owner3 fromId(Long id) {\n if (id == null) {\n return null;\n }\n Owner3 owner3 = new Owner3();\n owner3.setId(id);\n return owner3;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ProgrammePropMapper extends EntityMapper<ProgrammePropDTO, ProgrammeProp> {\n\n\n\n default ProgrammeProp fromId(Long id) {\n if (id == null) {\n return null;\n }\n ProgrammeProp programmeProp = new ProgrammeProp();\n programmeProp.setId(id);\n return programmeProp;\n }\n}", "public Map() {\n\t\t//intially empty\n\t}", "private Mapper() {\n\n }", "private BeanMapping createMapping(Object bean, String name) {\n // first\n BeanMapping mapping = new BeanMapping(name);\n return mapping;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EmploymentTypeMapper extends EntityMapper<EmploymentTypeDTO, EmploymentType> {\n\n\n @Mapping(target = \"people\", ignore = true)\n EmploymentType toEntity(EmploymentTypeDTO employmentTypeDTO);\n\n default EmploymentType fromId(Long id) {\n if (id == null) {\n return null;\n }\n EmploymentType employmentType = new EmploymentType();\n employmentType.setId(id);\n return employmentType;\n }\n}", "public ObjectMappers() {\n\t\tthis.objectMappers = ImmutableList.of();\n\t}", "@Override\n public String mapping() {\n return StringUtils.lines(\n \"foo.bar.Baz -> foo.bar.Baz:\", \" java.lang.Object f1 -> a\", \" java.lang.String f2 -> a\");\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MisteriosoMapper extends EntityMapper<MisteriosoDTO, Misterioso> {\n\n \n\n \n\n default Misterioso fromId(Long id) {\n if (id == null) {\n return null;\n }\n Misterioso misterioso = new Misterioso();\n misterioso.setId(id);\n return misterioso;\n }\n}", "ReferenceContainer<E> remap(UnaryOperator<PropertySymbol> mapper);", "public void setMapName(String mapname) {\n this.mapName = mapname;\n }", "@Mapper(componentModel = \"spring\")\npublic interface FrecuenciaMapper extends AbstractMapper<FrecuenciaVO, Frecuencia> {\n}", "@Mapper\npublic interface TeacherMapper extends BaseMapper<TeacherEmpty> {\n TeacherEmpty selectByName(@Param(\"userName\") String userName);\n\n TeacherEmpty gerTeacherById(@Param(\"id\") long id);\n}", "@Test\n\tpublic void testMapper() {\n\n\t\t/*\n\t\t * For this test, the mapper's input will be \"1 cat cat dog\" \n\t\t */\n\t\tmapDriver.withInput(new LongWritable(1), new Text(swedenHealth));\n\n\t\t/*\n\t\t * The expected output is \"cat 1\", \"cat 1\", and \"dog 1\".\n\t\t */\n\t\tmapDriver.withOutput(new Text(\"Sweden\"), new Text(\"1745.09564282 5218.86073424\"));\n\t\t/*\n\t\t * Run the test.\n\t\t */\n\t\tmapDriver.runTest();\n\t}", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, })\npublic interface PeopleMapper extends EntityMapper <PeopleDTO, People> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.firstName\", target = \"userFirstName\")\n @Mapping(source = \"user.lastName\", target = \"userLastName\")\n PeopleDTO toDto(People people);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(target = \"seminarsPresenteds\", ignore = true)\n @Mapping(target = \"seminarsAttendeds\", ignore = true)\n @Mapping(target = \"specialGuestAts\", ignore = true)\n People toEntity(PeopleDTO peopleDTO);\n default People fromId(Long id) {\n if (id == null) {\n return null;\n }\n People people = new People();\n people.setId(id);\n return people;\n }\n\n default String peopleName(People people) {\n String name = \"\";\n if (people == null) {\n return null;\n }\n if (people.getUser() == null) {\n return null;\n }\n String firstName = people.getUser().getFirstName();\n if (firstName != null) {\n name += firstName;\n }\n String lastName = people.getUser().getLastName();\n if (lastName != null) {\n name += \" \" + lastName;\n }\n return name;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ArquivoAnexoMapper.class})\npublic interface ProcessoAnexoMapper{\n\n ProcessoAnexoDTO processoAnexoToProcessoAnexoDTO(ProcessoAnexo processoAnexo);\n\n List<ProcessoAnexoDTO> processoAnexosToProcessoAnexoDTOs(List<ProcessoAnexo> processoAnexos);\n\n @Mapping(target = \"processo\", ignore = true)\n ProcessoAnexo processoAnexoDTOToProcessoAnexo(ProcessoAnexoDTO processoAnexoDTO);\n\n List<ProcessoAnexo> processoAnexoDTOsToProcessoAnexos(List<ProcessoAnexoDTO> processoAnexoDTOs);\n\n\n}", "@Override\n public boolean isMapped() {\n return false;\n }", "public abstract String[] map() throws TooFewNocNodesException;", "private void createMaps() {\r\n\t\tint SIZE = 100;\r\n\t\tint x = 0, y = -1;\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tif (i % 10 == 0) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 1;\r\n\t\t\t}\r\n\t\t\tshipStateMap.put(new Point(x, y), 0);\r\n\t\t\tshipTypeMap.put(new Point(x, y), 0);\r\n\t\t\tx++;\r\n\t\t}\r\n\t}", "private static void createTypeMap() {\n\n }", "private ImageMappings() {}", "@Override\n\tprotected String getListMapper() {\n\t\treturn null;\n\t}", "private void generateMaps() {\r\n\t\tthis.tablesLocksMap = new LinkedHashMap<>();\r\n\t\tthis.blocksLocksMap = new LinkedHashMap<>();\r\n\t\tthis.rowsLocksMap = new LinkedHashMap<>();\r\n\t\tthis.waitMap = new LinkedHashMap<>();\r\n\t}", "protected void createMappingAnnotations() {\n\t\tString source = \"http://www.polarsys.org/capella/MNoE/CapellaLike/Mapping\";\t\n\t\taddAnnotation\n\t\t (blockArchitecturePkgEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (blockArchitectureEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Package\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedRequirementPkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which RequirementsPkg stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which AbstractCapabilityPkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which InterfacePkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which DataPkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_ProvisionedArchitectureAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_ProvisioningArchitectureAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_AllocatedArchitectures(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlockArchitecture_AllocatingArchitectures(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (blockEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::BehavioredClassifier\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedAbstractCapabilityPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"Descendants are mapped to SysML::Blocks::Block, which cannot contain a Package.\\r\\nTherefore, store these AbstractCapabilityPackages in the nearest available package.\",\n\t\t\t \"constraints\", \"Multiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedInterfacePkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which InterfacePkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedDataPkg(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which DataPkg stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [0..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getBlock_OwnedStateMachines(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::BehavioredClassifier::ownedBehavior\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::BehavioredClassifier::ownedBehavior elements on which StateMachine stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentArchitectureEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Class\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedInterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::NamedElement::clientDependency elements on which InterfaceUse stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_UsedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedInterfaceImplementations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::BehavioredClassifier::interfaceRealization\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Order must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaceLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ImplementedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvisionedComponentAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvisioningComponentAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatedComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_AllocatingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_ContainedPhysicalPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalPath(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"SysML::Blocks::Block cannot contain PhysicalPath\\'s equivalent, hence we find the nearest available package to store them.\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponent_OwnedPhysicalLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::StructuredClassifier::ownedConnector\",\n\t\t\t \"explanation\", \"since PhysicalLink is mapped to uml::Connector\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractActorEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"SysML::Blocks::Block\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (partEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"should be mapped to uml::Property, but one of its concrete ancestors already is (Property), so avoid redefining it\\r\\nat this level to avoid profile generation issue\",\n\t\t\t \"constraints\", \"information::Property must have as base metaclass uml::Property\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_ProvidedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_RequiredInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_OwnedDeploymentLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_DeployedParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPart_DeployingParts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (architectureAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Realization\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getArchitectureAllocation_AllocatedArchitecture(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getArchitectureAllocation_AllocatingArchitecture(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::ComponentRealization or uml::InterfaceRealization regarding the baseMetaClass of the realized element\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponentAllocation_AllocatedComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getComponentAllocation_AllocatingComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (systemComponentEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_DataComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_DataType(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getSystemComponent_ParticipationsInCapabilityRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfacePkgEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Package\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which Interface stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfacePkg_OwnedInterfacePkgs(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Package::nestedPackage#uml::Package::packagedElement\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Package::nestedPackage elements on which InterfacePkg stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Interface\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_Mechanism(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ImplementorComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_UserComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceImplementations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Opposite reference of uml::InterfaceRealization::contract\",\n\t\t\t \"constraints\", \"uml::Element::ownedElement elements on which InterfaceImplementation stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_InterfaceUses(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Opposite reference of uml::Dependency::supplier\",\n\t\t\t \"constraints\", \"uml::Element::ownedElement elements on which InterfaceUse stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvisioningInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_AllocatingInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_AllocatingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ExchangeItems(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_OwnedExchangeItemAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RequiringComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RequiringComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvidingComponents(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_ProvidingComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizingLogicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizedContextInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizingPhysicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterface_RealizedLogicalInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceImplementationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::InterfaceRealization\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_InterfaceImplementor(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceImplementation_ImplementedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::InterfaceRealization::contract\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceUseEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Usage\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_InterfaceUser(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::client\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceUse_UsedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::supplier\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Multiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (providedInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::InterfaceRealization\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getProvidedInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::InterfaceRealization::contract\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (requiredInterfaceLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Usage\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getRequiredInterfaceLink_Interface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::supplier\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Dependency::supplier elements on which Interface stereotype or any stereotype that inherits from it is applied\\r\\nMultiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocation_AllocatedInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocation_AllocatingInterfaceAllocator(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (interfaceAllocatorEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Classifier\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_OwnedInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Some elements on which InterfaceAllocation stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_ProvisionedInterfaceAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getInterfaceAllocator_AllocatedInterfaces(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (actorCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Dependency\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (systemComponentCapabilityRealizationInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Dependency\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (componentContextEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (exchangeItemAllocationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Realization\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_SendProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_ReceiveProtocol(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_AllocatedItem(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getExchangeItemAllocation_AllocatingInterface(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (deployableElementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::NamedElement\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeployableElement_DeployingLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Opposite reference of uml::Dependency::supplier\",\n\t\t\t \"constraints\", \"Order must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (deploymentTargetEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::DeploymentTarget\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getDeploymentTarget_DeploymentLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::NamedElement::clientDependency\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::DeploymentTarget::deployment elements on which AbstractDeployment stereotype or any stereotype that inherits from it is applied\\r\\nOrder must be computed\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractDeploymentLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"uml::Dependency,could be mapped on uml::Deployment, but dependencies diagram allows to \\\"deploy\\\" more capella element types.\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_DeployedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::supplier\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"Multiplicity must be [1..1]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractDeploymentLink_Location(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Dependency::client\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::Dependency::client elements on which DeploymentTarget stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPathInvolvedElementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalArtifactEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractPhysicalArtifact_AllocatorConfigurationItems(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalLinkEndEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getAbstractPhysicalLinkEnd_InvolvedLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (abstractPhysicalPathLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Connector\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_LinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::specific\",\n\t\t\t \"explanation\", \"first need to create ConnectorEnds pointing to the Ports, and then reference them in uml::Connector::end\",\n\t\t\t \"constraints\", \"cardinality must be [2..2]\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedComponentExchangeFunctionalExchangeAllocations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::nearestpackage\",\n\t\t\t \"explanation\", \"Elements are contained in the nearest possible parent container.\",\n\t\t\t \"constraints\", \"some elements on which ComponentFunctionalExchangeAllocation stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedPhysicalLinkEnds(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::Connector::end\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_OwnedPhysicalLinkRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_SourcePhysicalPort(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLink_TargetPhysicalPort(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkEndEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::ConnectorEnd\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Port(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::ConnectorEnd::role\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"uml::ConnectorEnd::role elements on which PhysicalPort stereotype or any stereotype that inherits from it is applied\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalLinkEnd_Part(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"uml::ConnectorEnd::partWithPort\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalLinkRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"uml::Class\",\n\t\t\t \"explanation\", \"_todo_\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_InvolvedLinks(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_OwnedPhysicalPathInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_FirstPhysicalPathInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPath_OwnedPhysicalPathRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathInvolvementEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_NextInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_PreviousInvolvements(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_InvolvedElement(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathInvolvement_InvolvedComponent(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathReferenceEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPathReference_ReferencedPhysicalPath(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPathRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPortEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"SysML::PortAndFlows::FlowPort\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_OwnedPhysicalPortRealizations(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (getPhysicalPort_AllocatedComponentPorts(), \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"keyword::none\",\n\t\t\t \"explanation\", \"Derived and transient\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\t\n\t\taddAnnotation\n\t\t (physicalPortRealizationEClass, \n\t\t source, \n\t\t new String[] {\n\t\t\t \"UML/SysML semantic equivalences\", \"\",\n\t\t\t \"base metaclass in UML/SysML profile \", \"none\",\n\t\t\t \"explanation\", \"none\",\n\t\t\t \"constraints\", \"none\"\n\t\t });\n\t}", "public Map() {\n\n\t\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface PerformerMapper extends EntityMapper<PerformerDTO, Performer> {\n\n\n\n default Performer fromId(Long id) {\n if (id == null) {\n return null;\n }\n Performer performer = new Performer();\n performer.setId(id);\n return performer;\n }\n}", "public OrderedNameMap() {\r\n\t\tthis(CASE_SENSITIVE);\r\n\t}", "protected String getKeymapName() {\n String nm = getClass().getName();\n int index = nm.lastIndexOf('.');\n if (index >= 0) {\n nm = nm.substring(index+1);\n }\n return nm;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface Record25HerfinancieeringMapper extends EntityMapper<Record25HerfinancieeringDTO, Record25Herfinancieering> {\n\n\n\n default Record25Herfinancieering fromId(Long id) {\n if (id == null) {\n return null;\n }\n Record25Herfinancieering record25Herfinancieering = new Record25Herfinancieering();\n record25Herfinancieering.setId(id);\n return record25Herfinancieering;\n }\n}", "public Mapper(String name, Parser parser, Oag oag) {\n this.name = name;\n this.parser = parser;\n this.oag = oag;\n this.logParsing = null;\n this.logAttribution = null;\n this.errorHandler = null;\n }", "@Override\n\tpublic Map<String, Object> preProccess() {\n\t\treturn null;\n\t}", "public MapTest(String name) {\n\t\tsuper(name);\n\t}", "@Mapper(componentModel = \"spring\", uses = {OperationMapper.class, PecStatusChangeMatrixMapper.class, StatusPecMapper.class,})\npublic interface RaisonPecMapper extends EntityMapper <RaisonPecDTO, RaisonPec> {\n\n @Mapping(source = \"operation.id\", target = \"operationId\")\n @Mapping(source = \"operation.label\", target = \"operationLabel\")\n @Mapping(source = \"statusPec.id\", target = \"statusPecId\")\n @Mapping(source = \"statusPec.label\", target = \"statusPecLabel\")\n\n \n @Mapping(source = \"pecStatusChangeMatrix.id\", target = \"pecStatusChangeMatrixId\")\n @Mapping(source = \"pecStatusChangeMatrix.label\", target = \"pecStatusChangeMatrixLabel\")\n \n RaisonPecDTO toDto(RaisonPec raisonPec); \n\n @Mapping(source = \"operationId\", target = \"operation\")\n\n\n\n @Mapping(source = \"statusPecId\", target = \"statusPec\")\n\n \n @Mapping(source = \"pecStatusChangeMatrixId\", target = \"pecStatusChangeMatrix\")\n\n RaisonPec toEntity(RaisonPecDTO raisonPecDTO); \n default RaisonPec fromId(Long id) {\n if (id == null) {\n return null;\n }\n RaisonPec raisonPec = new RaisonPec();\n raisonPec.setId(id);\n return raisonPec;\n }\n}", "public ProcessDataMapper() {\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ExerciseFamilyMapper {\n\n ExerciseFamilyDTO exerciseFamilyToExerciseFamilyDTO(ExerciseFamily exerciseFamily);\n\n List<ExerciseFamilyDTO> exerciseFamiliesToExerciseFamilyDTOs(List<ExerciseFamily> exerciseFamilies);\n\n @Mapping(target = \"exercises\", ignore = true)\n ExerciseFamily exerciseFamilyDTOToExerciseFamily(ExerciseFamilyDTO exerciseFamilyDTO);\n\n List<ExerciseFamily> exerciseFamilyDTOsToExerciseFamilies(List<ExerciseFamilyDTO> exerciseFamilyDTOs);\n}", "public void init() throws IllegalArgumentException {\r\n\t\tthis.listItemMapper = ListItemMapper.listitemMapper();\r\n\t\tthis.itemMapper = ItemMapper.itemMapper();\r\n\t\tthis.personMapper = PersonMapper.personMapper();\r\n\t\tthis.shoppingListMapper = ShoppingListMapper.shoppinglistMapper();\r\n\t\tthis.storeMapper = StoreMapper.storeMapper();\r\n\t\tthis.groupMapper = GroupMapper.groupMapper();\r\n\t\tthis.responsibilityMapper = ResponsibilityMapper.responsibilityMapper();\r\n\t\tthis.favoriteItemMapper = FavoriteItemMapper.favoriteItemMapper();\r\n\r\n\t}", "public void setMapNm(String mapNm) {\n\t\tthis.mapNm = mapNm;\n\t}", "public abstract Builder mappingName(String paramString);", "private void ini_MapPaks()\r\n\t{\r\n\r\n\t}", "@Test\n public void shouldIgnorePartialAutoMappingBehavior_ExternalNestedResultMap() {\n AutomappingTest.sqlSessionFactory.getConfiguration().setAutoMappingBehavior(PARTIAL);\n SqlSession sqlSession = AutomappingTest.sqlSessionFactory.openSession();\n try {\n Mapper mapper = sqlSession.getMapper(Mapper.class);\n User user = mapper.getUserWithPets_External(2);\n Assert.assertEquals(Integer.valueOf(2), user.getId());\n Assert.assertEquals(\"User2\", user.getName());\n Assert.assertNull(\"should not inherit auto-mapping\", user.getPets().get(0).getPetName());\n Assert.assertEquals(\"John\", user.getPets().get(0).getBreeder().getBreederName());\n } finally {\n sqlSession.close();\n }\n }", "public String getMapNm() {\n\t\treturn this.mapNm;\n\t}", "public abstract AnnotationMap mo30683d();", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface MilestoneMapper extends EntityMapper<MilestoneDTO, Milestone> {\n\n\n\n default Milestone fromId(Long id) {\n if (id == null) {\n return null;\n }\n Milestone milestone = new Milestone();\n milestone.setId(id);\n return milestone;\n }\n}", "private RowMapper<Object[]> getInitalWorkerMapper () {\n\t\treturn new RowMapper<Object[]>() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Object[] mapRow(ResultSet rs, int rowIndex) throws SQLException {\n\t\t\t\t\n\t\t\t\tResultSetMetaData rsMeta = rs.getMetaData();\n\t\t\t\t\n\t\t\t\tcolCount = rsMeta.getColumnCount() ;\n\t\t\t\tObject[] retval = new Object[colCount];\n\t\t\t\tanalizeQueryResultMetaData(rsMeta, metaData.getDecimalColumns()); \n\t\t\t\tsetRowMapper(getNormalWorkerMapper());\n\t\t\t\tfor ( int i=0 ; i < colCount;i++){\n\t\t\t\t\tretval[i] = rs.getObject(i+1);\n\t\t\t\t}\n\t\t\t\treturn retval;\n\t\t\t}\n\t\t};\n\t}", "public void setMapName(String mapName) {\n this.mapName = mapName;\n }", "private ModuleMapper() {\n mapper = new HashMap<String, String>();\n mapper.put(\"accounts\", \"Accounts\");\n mapper.put(\"acl_actions\", \"ACLActions\");\n mapper.put(\"acl_roles\", \"ACLRoles\");\n mapper.put(\"bugs\", \"Bugs\");\n mapper.put(\"calls\", \"Calls\");\n mapper.put(\"campaign_log\", \"CampaignLog\");\n mapper.put(\"campaign_trkrs\", \"CampaignTrackers\");\n mapper.put(\"campaigns\", \"Campaigns\");\n mapper.put(\"cases\", \"Cases\");\n mapper.put(\"contacts\", \"Contacts\");\n mapper.put(\"currencies\", \"Currencies\");\n mapper.put(\"document_revisions\", \"DocumentRevisions\");\n mapper.put(\"documents\", \"Documents\");\n mapper.put(\"eapm\", \"EAPM\");\n mapper.put(\"email_addresses\", \"EmailAddresses\");\n mapper.put(\"email_marketing\", \"EmailMarketing\");\n mapper.put(\"email_templates\", \"EmailTemplates\");\n mapper.put(\"emailman\", \"EmailMan\");\n mapper.put(\"emails\", \"Emails\");\n mapper.put(\"inbound_email\", \"InboundEmail\");\n mapper.put(\"job_queue\", \"SchedulersJobs\");\n mapper.put(\"leads\", \"Leads\");\n mapper.put(\"meetings\", \"Meetings\");\n mapper.put(\"notes\", \"Notes\");\n mapper.put(\"oauth_consumer\", \"OAuthKeys\");\n mapper.put(\"oauth_tokens\", \"OAuthTokens\");\n mapper.put(\"opportunities\", \"Opportunities\");\n mapper.put(\"project\", \"Project\");\n mapper.put(\"project_task\", \"ProjectTask\");\n mapper.put(\"prospect_lists\", \"ProspectLists\");\n mapper.put(\"prospects\", \"Prospects\");\n mapper.put(\"releases\", \"Releases\");\n mapper.put(\"roles\", \"Roles\");\n mapper.put(\"saved_search\", \"SavedSearch\");\n mapper.put(\"schedulers\", \"Schedulers\");\n mapper.put(\"sugarfeed\", \"SugarFeed\");\n mapper.put(\"tasks\", \"Tasks\");\n mapper.put(\"users\", \"Users\");\n }", "protected void createMaps() {\n\t\tBlueSchellingCell bCell = new BlueSchellingCell();\n\t\tOrangeSchellingCell oCell = new OrangeSchellingCell();\n\t\tEmptyCell eCell = new EmptyCell();\n\t\tTreeCell tCell = new TreeCell();\n\t\tBurningTreeCell bTCell = new BurningTreeCell();\n\t\tEmptyLandCell eLCell = new EmptyLandCell();\n\n\t\tLiveCell lCell = new LiveCell();\n\t\tDeadCell dCell = new DeadCell();\n\t\tGreenRPSCell gcell = new GreenRPSCell();\n\t\tRedRPSCell rcell = new RedRPSCell();\n\t\tBlueRPSCell blcell = new BlueRPSCell();\n\t\tWhiteRPSCell wcell = new WhiteRPSCell();\n\n\t\tFishCell fCell = new FishCell();\n\t\tSharkCell sCell = new SharkCell();\n\n\t\tAntGroupCell aCell = new AntGroupCell();\n\n\t\tsegregation.put('b', bCell);\n\t\tsegregation.put('o', oCell);\n\t\tsegregation.put('e', eCell);\n\n\t\tgameOfLife.put('l', lCell);\n\t\tgameOfLife.put('d', dCell);\n\n\t\trps.put('g', gcell);\n\t\trps.put('r', rcell);\n\t\trps.put('b', blcell);\n\t\trps.put('w', wcell);\n\n\t\tspreadingWildfire.put('t', tCell);\n\t\tspreadingWildfire.put('b', bTCell);\n\t\tspreadingWildfire.put('e', eLCell);\n\n\t\twaTor.put('f', fCell);\n\t\twaTor.put('s', sCell);\n\t\twaTor.put('e', eCell);\n\n\t\tforagingAnts.put('a', aCell);\n\t\tforagingAnts.put('e', eCell);\n\t\tinitExportMap();\n\n\t\tinitCountMap();\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TipoTelaMapper {\n\n @Mapping(source = \"direccionamientoTela.id\", target = \"direccionamientoTelaId\")\n @Mapping(source = \"direccionamientoTela.nombre\", target = \"direccionamientoTelaNombre\")\n TipoTelaDTO tipoTelaToTipoTelaDTO(TipoTela tipoTela);\n\n @Mapping(source = \"direccionamientoTelaId\", target = \"direccionamientoTela\")\n @Mapping(target = \"telaCrudas\", ignore = true)\n TipoTela tipoTelaDTOToTipoTela(TipoTelaDTO tipoTelaDTO);\n\n default DireccionamientoTela direccionamientoTelaFromId(Long id) {\n if (id == null) {\n return null;\n }\n DireccionamientoTela direccionamientoTela = new DireccionamientoTela();\n direccionamientoTela.setId(id);\n return direccionamientoTela;\n }\n}", "public ImageFileNameMap(FileNameMap map)\r\n {\r\n prevMap = map;\r\n }", "@Mapper(componentModel = \"spring\", uses = {UtilisateurMapper.class, DepotMapper.class})\npublic interface UtilisateurDepotPKMapper extends EntityMapper<UtilisateurDepotPKDTO, UtilisateurDepotPK> {\n\n @Mapping(source = \"utilisateur.id\", target = \"utilisateurId\")\n @Mapping(source = \"depot.id\", target = \"depotId\")\n UtilisateurDepotPKDTO toDto(UtilisateurDepotPK utilisateurDepotPK);\n\n @Mapping(source = \"utilisateurId\", target = \"utilisateur\")\n @Mapping(source = \"depotId\", target = \"depot\")\n UtilisateurDepotPK toEntity(UtilisateurDepotPKDTO utilisateurDepotPKDTO);\n\n default UtilisateurDepotPK fromId(Long id) {\n if (id == null) {\n return null;\n }\n UtilisateurDepotPK utilisateurDepotPK = new UtilisateurDepotPK();\n utilisateurDepotPK.setId(id);\n return utilisateurDepotPK;\n }\n}", "private void mapSetUp() {\n\t\tfor (int i = 0; i < allChar.length; i++) {\n\t\t\tmap.put(allChar[i], shuffledChar[i]);\n\t\t}\n\t}", "public PrefixMapping(String prefix, String uri) {\r\n this.prefix = (prefix != null)? prefix : \"\";\r\n this.uri = (uri != null)? uri : \"\"; \r\n }", "private void initMapper() {\n final BeanPropertyFilter filterOutAllExcept =\n SimpleBeanPropertyFilter.filterOutAllExcept(\"fname\", \"executionTimeNano\");\n this.mapper.addMixInAnnotations(\n PortalEvent.class, PortletRenderExecutionEventFilterMixIn.class);\n final SimpleFilterProvider filterProvider = new SimpleFilterProvider();\n filterProvider.addFilter(\n PortletRenderExecutionEventFilterMixIn.FILTER_NAME, filterOutAllExcept);\n this.portletEventWriter = this.mapper.writer(filterProvider);\n }", "public AutoIndexMap()\n\t\t{\n\t\t\t// Initialise instance variables\n\t\t\tindices = new IdentityHashMap<>();\n\t\t}", "public void generateRandomMap() {\n\n\t}", "public void printMiniMap() { }", "private HashMap name2() {\n\n\t HashMap hm = new HashMap();\n\t hm.put(\"firstName\", \"SIMA\");\n\t hm.put(\"middleName\", \"MISHRA\");\n\t hm.put(\"lastName\", \"ARADHANA\");\n\t hm.put(\"firstYearInOffice\", \"1981\");\n\t hm.put(\"lastYearInOffice\", \"1989\");\n\t return hm;\n\n\t }", "private void buildMap(int count, char type, String typeName) {\r\n\t\tfor (int i = 1; i <= count; i++) {\r\n\t\t\toriginalMaps.add(new MapType(\"map_\" + type + i, typeName, \"colony/map_\" + type + i));\r\n\t\t}\r\n\t}", "public static void createTempMapsetName() {\r\n UUID id;\r\n String tmpPrefix;\r\n String tmpSuffix;\r\n String tmpBase;\r\n String tmpFolder;\r\n\r\n id = UUID.randomUUID();\r\n tmpPrefix = new String(GrassUtils.TEMP_PREFIX);\r\n tmpSuffix = new String(\"_\" + id);\r\n tmpBase = new String(System.getProperty(\"java.io.tmpdir\"));\r\n if (tmpBase.endsWith(File.separator)) {\r\n tmpFolder = new String(tmpBase + tmpPrefix + tmpSuffix.replace('-', '_') + File.separator + \"user\");\r\n }\r\n else {\r\n tmpFolder = new String(tmpBase + File.separator + tmpPrefix + tmpSuffix.replace('-', '_') + File.separator + \"user\");\r\n }\r\n m_sGrassTempMapsetFolder = tmpFolder;\r\n\r\n }", "private static PDFName getDefaultMappingFor(final String fo,\n final PDFObject parent) {\n final Mapper mapper = DEFAULT_MAPPINGS.get(fo);\n if (mapper != null) {\n return mapper.getStructureType(parent);\n } else {\n return NON_STRUCT;\n }\n }", "public MapperBase() {\r\n }", "public String getMapName() {\n return mapName;\n }", "@Mapper\npublic interface TestMapper extends MyMapper<Person1> {\n //List<Person1> findAll();\n}", "private static void fillupmap(Map<String, Object> m) {\n\t\tRectangle r =new Rectangle(\"A\",2,3);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tr =new Rectangle(\"B\",4,1);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tCircle c =new Circle(\"C\",3);\r\n\t\tm.put(c.getCname(),c);\r\n\t\tc =new Circle(\"D\",4);\r\n\t\tm.put(c.getCname(),c);\r\n\t\t\r\n\t}", "private Document createMapping() {\n return getIndexOperations().createMapping();\n }", "Mapper<T, T2> ignoring(Ignorable ignorable);", "public abstract void createMap();", "private MapmmSPInstruction(Operator op, CPOperand in1, CPOperand in2, CPOperand out, CacheType type,\n\t\t\t\t\t\t\t boolean outputEmpty, SparkAggType aggtype, String opcode, String istr, boolean isSpecial,\n\t\t\t\t\t\t\t boolean needCache, String preOutputName) {\n\t\tsuper(SPType.MAPMM, op, in1, in2, out, opcode, istr);\n\t\t_type = type;\n\t\t_outputEmpty = outputEmpty;\n\t\t_aggtype = aggtype;\n\t\t_needCache = needCache;\n\t\t_preOutputName = preOutputName;\n\t}", "public FMap(String rute) {\n super(rute);\n init(rute);\n }", "@Mapper\npublic interface WorkGroupMapper extends BaseMapper<WorkGroup> {\n}", "public void updateMapModuleName() {\n\t\tgetMapModule().rename();\n\t\taddToOrChangeInMapModules(getMapModule().toString(), getMapModule());\n\t\tsetMapModule(getMapModule(), getMapModule().getMode());\n\t}", "@Override\n public void initialize() {\n int numReduceTasks = conf.getNumReduceTasks();\n String jobID = taskAttemptID.getJobID();\n File mapOutputFolder = new File(\"mapoutput\");\n if (!mapOutputFolder.exists()) {\n mapOutputFolder.mkdir();\n }\n for (int reduceID = 0; reduceID < numReduceTasks; reduceID++) {\n outputFiles.add(\"mapoutput/\" + jobID + \"_r-\" + reduceID + \"_\" + this.partition);\n }\n }", "@Mapper\npublic interface TableMapper extends BaseMapper<Table> {\n void clear();\n}" ]
[ "0.62497133", "0.6110582", "0.59484476", "0.59344035", "0.59273124", "0.5760698", "0.57575274", "0.57125694", "0.5703748", "0.5560554", "0.55577564", "0.55522555", "0.5527634", "0.5502896", "0.5489565", "0.5471106", "0.5463647", "0.54288244", "0.5416536", "0.5415297", "0.53271973", "0.5305637", "0.5303463", "0.52965647", "0.52901196", "0.5266061", "0.5262501", "0.5258806", "0.5236333", "0.52261865", "0.52252305", "0.52238804", "0.52096266", "0.5207708", "0.51892287", "0.5185876", "0.51618683", "0.51583546", "0.51529646", "0.514648", "0.5135025", "0.5131795", "0.5130906", "0.51211536", "0.5117223", "0.5115798", "0.5112839", "0.5106044", "0.5102408", "0.50966805", "0.5094887", "0.5089852", "0.50889015", "0.5087757", "0.50764894", "0.50615984", "0.50589114", "0.50569755", "0.5051277", "0.50318545", "0.5031033", "0.5030499", "0.50229925", "0.5018516", "0.50166553", "0.5014801", "0.5009027", "0.49903584", "0.49903557", "0.4984955", "0.49799275", "0.4979003", "0.4978893", "0.4978282", "0.49768022", "0.4972238", "0.49681562", "0.4966077", "0.49651268", "0.49625307", "0.49583364", "0.49580342", "0.49575704", "0.49437475", "0.49352056", "0.49329346", "0.49274638", "0.4926868", "0.49256968", "0.4924785", "0.49220598", "0.49172065", "0.49158975", "0.49155527", "0.49117532", "0.49068478", "0.4903861", "0.48985696", "0.489821", "0.48932254", "0.48913604" ]
0.0
-1
Liefert die TurnierEditor Constraints
public TournamentEditorConstraints getTournamentEditorConstraints();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void defineConstraints();", "@DISPID(1610940427) //= 0x6005000b. The runtime will prefer the VTID if present\n @VTID(33)\n Constraints constraints();", "@DISPID(1611006036) //= 0x60060054. The runtime will prefer the VTID if present\n @VTID(111)\n boolean constraintsInGeometry();", "private void applyConstraints(android.support.constraint.solver.LinearSystem r31, boolean r32, android.support.constraint.solver.SolverVariable r33, android.support.constraint.solver.SolverVariable r34, android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour r35, boolean r36, android.support.constraint.solver.widgets.ConstraintAnchor r37, android.support.constraint.solver.widgets.ConstraintAnchor r38, int r39, int r40, int r41, int r42, float r43, boolean r44, boolean r45, int r46, int r47, int r48, float r49, boolean r50) {\n /*\n r30 = this;\n r0 = r30;\n r10 = r31;\n r11 = r33;\n r12 = r34;\n r13 = r37;\n r14 = r38;\n r1 = r41;\n r2 = r42;\n r9 = r10.createObjectVariable(r13);\n r8 = r10.createObjectVariable(r14);\n r6 = r37.getTarget();\n r7 = r10.createObjectVariable(r6);\n r6 = r38.getTarget();\n r6 = r10.createObjectVariable(r6);\n r14 = r10.graphOptimizer;\n r15 = 1;\n if (r14 == 0) goto L_0x0066;\n L_0x002e:\n r14 = r37.getResolutionNode();\n r14 = r14.state;\n r13 = 1;\n if (r14 != r13) goto L_0x0066;\n L_0x0037:\n r14 = r38.getResolutionNode();\n r14 = r14.state;\n if (r14 != r13) goto L_0x0066;\n L_0x003f:\n r1 = android.support.constraint.solver.LinearSystem.getMetrics();\n if (r1 == 0) goto L_0x004e;\n L_0x0045:\n r1 = android.support.constraint.solver.LinearSystem.getMetrics();\n r2 = r1.resolvedWidgets;\n r2 = r2 + r15;\n r1.resolvedWidgets = r2;\n L_0x004e:\n r1 = r37.getResolutionNode();\n r1.addResolvedValue(r10);\n r1 = r38.getResolutionNode();\n r1.addResolvedValue(r10);\n if (r45 != 0) goto L_0x0065;\n L_0x005e:\n if (r32 == 0) goto L_0x0065;\n L_0x0060:\n r1 = 0;\n r2 = 6;\n r10.addGreaterThan(r12, r8, r1, r2);\n L_0x0065:\n return;\n L_0x0066:\n r13 = android.support.constraint.solver.LinearSystem.getMetrics();\n if (r13 == 0) goto L_0x0075;\n L_0x006c:\n r13 = android.support.constraint.solver.LinearSystem.getMetrics();\n r11 = r13.nonresolvedWidgets;\n r11 = r11 + r15;\n r13.nonresolvedWidgets = r11;\n L_0x0075:\n r11 = r37.isConnected();\n r12 = r38.isConnected();\n r13 = r0.mCenter;\n r13 = r13.isConnected();\n if (r11 == 0) goto L_0x0087;\n L_0x0085:\n r14 = 1;\n goto L_0x0088;\n L_0x0087:\n r14 = 0;\n L_0x0088:\n if (r12 == 0) goto L_0x008c;\n L_0x008a:\n r14 = r14 + 1;\n L_0x008c:\n if (r13 == 0) goto L_0x0090;\n L_0x008e:\n r14 = r14 + 1;\n L_0x0090:\n r21 = r6;\n if (r44 == 0) goto L_0x0096;\n L_0x0094:\n r6 = 3;\n goto L_0x0098;\n L_0x0096:\n r6 = r46;\n L_0x0098:\n r15 = android.support.constraint.solver.widgets.ConstraintWidget.AnonymousClass1.$SwitchMap$android$support$constraint$solver$widgets$ConstraintWidget$DimensionBehaviour;\n r16 = r35.ordinal();\n r15 = r15[r16];\n r3 = 4;\n switch(r15) {\n case 1: goto L_0x00a4;\n case 2: goto L_0x00a4;\n case 3: goto L_0x00a4;\n case 4: goto L_0x00a6;\n default: goto L_0x00a4;\n };\n L_0x00a4:\n r15 = 0;\n goto L_0x00aa;\n L_0x00a6:\n if (r6 != r3) goto L_0x00a9;\n L_0x00a8:\n goto L_0x00a4;\n L_0x00a9:\n r15 = 1;\n L_0x00aa:\n r3 = r0.mVisibility;\n r22 = r14;\n r14 = 8;\n if (r3 != r14) goto L_0x00b5;\n L_0x00b2:\n r3 = 0;\n r15 = 0;\n goto L_0x00b7;\n L_0x00b5:\n r3 = r40;\n L_0x00b7:\n if (r50 == 0) goto L_0x00d4;\n L_0x00b9:\n if (r11 != 0) goto L_0x00c5;\n L_0x00bb:\n if (r12 != 0) goto L_0x00c5;\n L_0x00bd:\n if (r13 != 0) goto L_0x00c5;\n L_0x00bf:\n r14 = r39;\n r10.addEquality(r9, r14);\n goto L_0x00d4;\n L_0x00c5:\n if (r11 == 0) goto L_0x00d4;\n L_0x00c7:\n if (r12 != 0) goto L_0x00d4;\n L_0x00c9:\n r14 = r37.getMargin();\n r23 = r13;\n r13 = 6;\n r10.addEquality(r9, r7, r14, r13);\n goto L_0x00d7;\n L_0x00d4:\n r23 = r13;\n r13 = 6;\n L_0x00d7:\n if (r15 != 0) goto L_0x0100;\n L_0x00d9:\n if (r36 == 0) goto L_0x00f1;\n L_0x00db:\n r13 = 3;\n r14 = 0;\n r10.addEquality(r8, r9, r14, r13);\n if (r1 <= 0) goto L_0x00e7;\n L_0x00e2:\n r13 = 6;\n r10.addGreaterThan(r8, r9, r1, r13);\n goto L_0x00e8;\n L_0x00e7:\n r13 = 6;\n L_0x00e8:\n r3 = 2147483647; // 0x7fffffff float:NaN double:1.060997895E-314;\n if (r2 >= r3) goto L_0x00f4;\n L_0x00ed:\n r10.addLowerThan(r8, r9, r2, r13);\n goto L_0x00f4;\n L_0x00f1:\n r10.addEquality(r8, r9, r3, r13);\n L_0x00f4:\n r27 = r47;\n r14 = r48;\n r24 = r7;\n L_0x00fa:\n r2 = r22;\n L_0x00fc:\n r16 = 4;\n goto L_0x01cc;\n L_0x0100:\n r2 = -2;\n r14 = r47;\n if (r14 != r2) goto L_0x0109;\n L_0x0105:\n r14 = r48;\n r13 = r3;\n goto L_0x010c;\n L_0x0109:\n r13 = r14;\n r14 = r48;\n L_0x010c:\n if (r14 != r2) goto L_0x010f;\n L_0x010e:\n r14 = r3;\n L_0x010f:\n if (r13 <= 0) goto L_0x011a;\n L_0x0111:\n r2 = 6;\n r10.addGreaterThan(r8, r9, r13, r2);\n r3 = java.lang.Math.max(r3, r13);\n goto L_0x011b;\n L_0x011a:\n r2 = 6;\n L_0x011b:\n if (r14 <= 0) goto L_0x0124;\n L_0x011d:\n r10.addLowerThan(r8, r9, r14, r2);\n r3 = java.lang.Math.min(r3, r14);\n L_0x0124:\n r2 = 1;\n if (r6 != r2) goto L_0x013c;\n L_0x0127:\n if (r32 == 0) goto L_0x012f;\n L_0x0129:\n r2 = 6;\n r10.addEquality(r8, r9, r3, r2);\n goto L_0x01a2;\n L_0x012f:\n if (r45 == 0) goto L_0x0137;\n L_0x0131:\n r2 = 4;\n r10.addEquality(r8, r9, r3, r2);\n goto L_0x01a2;\n L_0x0137:\n r2 = 1;\n r10.addEquality(r8, r9, r3, r2);\n goto L_0x01a2;\n L_0x013c:\n r2 = 2;\n if (r6 != r2) goto L_0x01a2;\n L_0x013f:\n r2 = r37.getType();\n r24 = r7;\n r7 = android.support.constraint.solver.widgets.ConstraintAnchor.Type.TOP;\n if (r2 == r7) goto L_0x0171;\n L_0x0149:\n r2 = r37.getType();\n r7 = android.support.constraint.solver.widgets.ConstraintAnchor.Type.BOTTOM;\n if (r2 != r7) goto L_0x0152;\n L_0x0151:\n goto L_0x0171;\n L_0x0152:\n r2 = r0.mParent;\n r7 = android.support.constraint.solver.widgets.ConstraintAnchor.Type.LEFT;\n r2 = r2.getAnchor(r7);\n r2 = r10.createObjectVariable(r2);\n r7 = r0.mParent;\n r25 = r2;\n r2 = android.support.constraint.solver.widgets.ConstraintAnchor.Type.RIGHT;\n r2 = r7.getAnchor(r2);\n r2 = r10.createObjectVariable(r2);\n r18 = r2;\n r19 = r25;\n goto L_0x018f;\n L_0x0171:\n r2 = r0.mParent;\n r7 = android.support.constraint.solver.widgets.ConstraintAnchor.Type.TOP;\n r2 = r2.getAnchor(r7);\n r2 = r10.createObjectVariable(r2);\n r7 = r0.mParent;\n r26 = r2;\n r2 = android.support.constraint.solver.widgets.ConstraintAnchor.Type.BOTTOM;\n r2 = r7.getAnchor(r2);\n r2 = r10.createObjectVariable(r2);\n r18 = r2;\n r19 = r26;\n L_0x018f:\n r15 = r31.createRow();\n r16 = r8;\n r17 = r9;\n r20 = r49;\n r2 = r15.createRowDimensionRatio(r16, r17, r18, r19, r20);\n r10.addConstraint(r2);\n r15 = 0;\n goto L_0x01a4;\n L_0x01a2:\n r24 = r7;\n L_0x01a4:\n if (r15 == 0) goto L_0x01c8;\n L_0x01a6:\n r2 = r22;\n r7 = 2;\n if (r2 == r7) goto L_0x01c4;\n L_0x01ab:\n r16 = 4;\n if (r44 != 0) goto L_0x01c1;\n L_0x01af:\n r3 = java.lang.Math.max(r13, r3);\n if (r14 <= 0) goto L_0x01b9;\n L_0x01b5:\n r3 = java.lang.Math.min(r14, r3);\n L_0x01b9:\n r27 = r13;\n r13 = 6;\n r10.addEquality(r8, r9, r3, r13);\n r15 = 0;\n goto L_0x01cc;\n L_0x01c1:\n r27 = r13;\n goto L_0x01cc;\n L_0x01c4:\n r27 = r13;\n goto L_0x00fc;\n L_0x01c8:\n r27 = r13;\n goto L_0x00fa;\n L_0x01cc:\n if (r50 == 0) goto L_0x0313;\n L_0x01ce:\n if (r45 == 0) goto L_0x01db;\n L_0x01d0:\n r0 = r8;\n r5 = r9;\n r1 = 0;\n r3 = 6;\n r4 = r34;\n r6 = 2;\n r11 = r33;\n goto L_0x031c;\n L_0x01db:\n r13 = 5;\n if (r11 != 0) goto L_0x01f2;\n L_0x01de:\n if (r12 != 0) goto L_0x01f2;\n L_0x01e0:\n if (r23 != 0) goto L_0x01f2;\n L_0x01e2:\n if (r32 == 0) goto L_0x01eb;\n L_0x01e4:\n r2 = 0;\n r5 = r34;\n r10.addGreaterThan(r5, r8, r2, r13);\n goto L_0x01ed;\n L_0x01eb:\n r5 = r34;\n L_0x01ed:\n r0 = r8;\n L_0x01ee:\n r1 = 0;\n r3 = 6;\n goto L_0x030b;\n L_0x01f2:\n r2 = 0;\n r5 = r34;\n if (r11 == 0) goto L_0x01ff;\n L_0x01f7:\n if (r12 != 0) goto L_0x01ff;\n L_0x01f9:\n if (r32 == 0) goto L_0x01ed;\n L_0x01fb:\n r10.addGreaterThan(r5, r8, r2, r13);\n goto L_0x01ed;\n L_0x01ff:\n if (r11 != 0) goto L_0x0216;\n L_0x0201:\n if (r12 == 0) goto L_0x0216;\n L_0x0203:\n r1 = r38.getMargin();\n r1 = -r1;\n r4 = r21;\n r3 = 6;\n r10.addEquality(r8, r4, r1, r3);\n if (r32 == 0) goto L_0x01ed;\n L_0x0210:\n r3 = r33;\n r10.addGreaterThan(r9, r3, r2, r13);\n goto L_0x01ed;\n L_0x0216:\n r4 = r21;\n r3 = r33;\n if (r11 == 0) goto L_0x01ed;\n L_0x021c:\n if (r12 == 0) goto L_0x01ed;\n L_0x021e:\n if (r15 == 0) goto L_0x027f;\n L_0x0220:\n if (r32 == 0) goto L_0x0228;\n L_0x0222:\n if (r1 != 0) goto L_0x0228;\n L_0x0224:\n r1 = 6;\n r10.addGreaterThan(r8, r9, r2, r1);\n L_0x0228:\n if (r6 != 0) goto L_0x0252;\n L_0x022a:\n if (r14 > 0) goto L_0x0232;\n L_0x022c:\n if (r27 <= 0) goto L_0x022f;\n L_0x022e:\n goto L_0x0232;\n L_0x022f:\n r1 = 6;\n r2 = 0;\n goto L_0x0234;\n L_0x0232:\n r1 = 4;\n r2 = 1;\n L_0x0234:\n r6 = r37.getMargin();\n r11 = r24;\n r10.addEquality(r9, r11, r6, r1);\n r6 = r38.getMargin();\n r6 = -r6;\n r10.addEquality(r8, r4, r6, r1);\n if (r14 > 0) goto L_0x024c;\n L_0x0247:\n if (r27 <= 0) goto L_0x024a;\n L_0x0249:\n goto L_0x024c;\n L_0x024a:\n r1 = 0;\n goto L_0x024d;\n L_0x024c:\n r1 = 1;\n L_0x024d:\n r16 = r2;\n r12 = 1;\n r14 = 5;\n goto L_0x0286;\n L_0x0252:\n r11 = r24;\n r12 = 1;\n if (r6 != r12) goto L_0x025c;\n L_0x0257:\n r1 = 1;\n r14 = 6;\n L_0x0259:\n r16 = 1;\n goto L_0x0286;\n L_0x025c:\n r1 = 3;\n if (r6 != r1) goto L_0x027d;\n L_0x025f:\n if (r44 != 0) goto L_0x026a;\n L_0x0261:\n r1 = r0.mResolvedDimensionRatioSide;\n r2 = -1;\n if (r1 == r2) goto L_0x026a;\n L_0x0266:\n if (r14 > 0) goto L_0x026a;\n L_0x0268:\n r1 = 6;\n goto L_0x026b;\n L_0x026a:\n r1 = 4;\n L_0x026b:\n r2 = r37.getMargin();\n r10.addEquality(r9, r11, r2, r1);\n r2 = r38.getMargin();\n r2 = -r2;\n r10.addEquality(r8, r4, r2, r1);\n r1 = 1;\n r14 = 5;\n goto L_0x0259;\n L_0x027d:\n r1 = 0;\n goto L_0x0283;\n L_0x027f:\n r11 = r24;\n r12 = 1;\n r1 = 1;\n L_0x0283:\n r14 = 5;\n r16 = 0;\n L_0x0286:\n if (r1 == 0) goto L_0x02cf;\n L_0x0288:\n r6 = r37.getMargin();\n r17 = r38.getMargin();\n r1 = r31;\n r2 = r9;\n r7 = r3;\n r3 = r11;\n r18 = r4;\n r4 = r6;\n r6 = r5;\n r5 = r43;\n r12 = r6;\n r28 = r18;\n r6 = r28;\n r13 = r11;\n r11 = r7;\n r7 = r8;\n r0 = r8;\n r8 = r17;\n r12 = r9;\n r9 = r14;\n r1.addCentering(r2, r3, r4, r5, r6, r7, r8, r9);\n r1 = r37;\n r2 = 1;\n r3 = r1.mTarget;\n r3 = r3.mOwner;\n r3 = r3 instanceof android.support.constraint.solver.widgets.Barrier;\n r4 = r38;\n r5 = r4.mTarget;\n r5 = r5.mOwner;\n r5 = r5 instanceof android.support.constraint.solver.widgets.Barrier;\n if (r3 == 0) goto L_0x02c5;\n L_0x02be:\n if (r5 != 0) goto L_0x02c5;\n L_0x02c0:\n r2 = r32;\n r3 = 1;\n r5 = 6;\n goto L_0x02dd;\n L_0x02c5:\n if (r3 != 0) goto L_0x02d9;\n L_0x02c7:\n if (r5 == 0) goto L_0x02d9;\n L_0x02c9:\n r3 = r32;\n r5 = 5;\n r29 = 6;\n goto L_0x02df;\n L_0x02cf:\n r28 = r4;\n r0 = r8;\n r12 = r9;\n r13 = r11;\n r1 = r37;\n r4 = r38;\n r11 = r3;\n L_0x02d9:\n r2 = r32;\n r3 = r2;\n r5 = 5;\n L_0x02dd:\n r29 = 5;\n L_0x02df:\n if (r16 == 0) goto L_0x02e4;\n L_0x02e1:\n r5 = 6;\n r6 = 6;\n goto L_0x02e7;\n L_0x02e4:\n r6 = r5;\n r5 = r29;\n L_0x02e7:\n if (r15 != 0) goto L_0x02eb;\n L_0x02e9:\n if (r2 != 0) goto L_0x02ed;\n L_0x02eb:\n if (r16 == 0) goto L_0x02f4;\n L_0x02ed:\n r1 = r37.getMargin();\n r10.addGreaterThan(r12, r13, r1, r5);\n L_0x02f4:\n if (r15 != 0) goto L_0x02f8;\n L_0x02f6:\n if (r3 != 0) goto L_0x02fa;\n L_0x02f8:\n if (r16 == 0) goto L_0x0304;\n L_0x02fa:\n r1 = r38.getMargin();\n r1 = -r1;\n r2 = r28;\n r10.addLowerThan(r0, r2, r1, r6);\n L_0x0304:\n if (r32 == 0) goto L_0x01ee;\n L_0x0306:\n r1 = 0;\n r3 = 6;\n r10.addGreaterThan(r12, r11, r1, r3);\n L_0x030b:\n if (r32 == 0) goto L_0x0312;\n L_0x030d:\n r4 = r34;\n r10.addGreaterThan(r4, r0, r1, r3);\n L_0x0312:\n return;\n L_0x0313:\n r0 = r8;\n r5 = r9;\n r1 = 0;\n r3 = 6;\n r4 = r34;\n r11 = r33;\n r6 = 2;\n L_0x031c:\n if (r2 >= r6) goto L_0x0326;\n L_0x031e:\n if (r32 == 0) goto L_0x0326;\n L_0x0320:\n r10.addGreaterThan(r5, r11, r1, r3);\n r10.addGreaterThan(r4, r0, r1, r3);\n L_0x0326:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.constraint.solver.widgets.ConstraintWidget.applyConstraints(android.support.constraint.solver.LinearSystem, boolean, android.support.constraint.solver.SolverVariable, android.support.constraint.solver.SolverVariable, android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour, boolean, android.support.constraint.solver.widgets.ConstraintAnchor, android.support.constraint.solver.widgets.ConstraintAnchor, int, int, int, int, float, boolean, boolean, int, int, int, float, boolean):void\");\n }", "Constraint createConstraint();", "Constraint createConstraint();", "public void changeConstraintsToMoreThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getLB() <= Double.NEGATIVE_INFINITY) {\n rangedExpression.setBounds(-rangedExpression.getLB(), Double.POSITIVE_INFINITY);\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "public List<Constraint> getConstraints();", "public interface WiresBoundsConstraintControl extends WiresMoveControl {\n\n void setBoundsConstraint(BoundingBox boundingBox);\n\n boolean isOutOfBounds(double dx, double dy);\n\n}", "@Override\n\tpublic void CheckBounds() {\n\t\t\n\t}", "@Override\n\tpublic void validation() throws EditorException\n\t{\n\t}", "boolean hasInputConstraints();", "private void constrain(ArrayList<InputGroup> groups) {\n\n\t\tint longest = 0;\n\t\tfor (InputGroup group : groups) {\n\t\t\tString text = group.getDescriptor().getText();\n\t\t\tif (text.length() > longest) {\n\t\t\t\tlongest = text.length();\n\t\t\t}\n\t\t}\n\t\tfor (InputGroup group : groups) {\n\t\t\tColumnConstraints label = new ColumnConstraints(7 * longest);\n\t\t\tgroup.getColumnConstraints().add(new ColumnConstraints());\n\t\t\tgroup.getColumnConstraints().add(label);\n\t\t}\n\t}", "@DISPID(1611006036) //= 0x60060054. The runtime will prefer the VTID if present\n @VTID(112)\n void constraintsInGeometry(\n boolean oDisplayed);", "protected void addConstraints() throws IloException {\n// Constrain (2)\n for (int i = 0; i < m; i++) {\n IloLinearNumExpr expr_2 = model.linearNumExpr();\n for (int j = 0; j < n; j++) {\n expr_2.addTerm(x[i][j], 1);\n }\n model.addLe(expr_2, supply[i]);\n }\n\n // Constrain (3)\n for (int j = 0; j < n; j++) {\n IloLinearNumExpr expr_3 = model.linearNumExpr();\n for (int i = 0; i < m; i++) {\n expr_3.addTerm(x[i][j], 1);\n }\n model.addEq(expr_3, demands[j]);\n }\n }", "public LinearConstraint() {\n\n }", "private void setupAdjustViewBoundsField() {\n // The following two settings don't work when defined in XML (possible Android bug?)\n mBind.adjustViewBoundsEdit.setKeyListener(null); // Make field non-editable\n mBind.adjustViewBoundsEdit.setSelectAllOnFocus(false); // Disable selectAllOnFocus\n\n // Create the popup window showing the possible \"true\" and \"false\" inputs\n ListPopupWindow popup = new ListPopupWindow(this);\n popup.setAnchorView(mBind.adjustViewBoundsEdit);\n popup.setModal(true);\n popup.setVerticalOffset(-25);\n popup.setAdapter(new ArrayAdapter<>(this, LAYOUT_DROPDOWN_ITEM, Data.ARR_BOOL));\n // If an item is clicked, put the corresponding text in the text field\n popup.setOnItemClickListener((parent, view, position, id) -> {\n mBind.adjustViewBoundsEdit.setText(Data.ARR_BOOL[position]);\n popup.dismiss();\n });\n\n // Open the popup window on clicking inside the area of the right compound drawable\n mBind.adjustViewBoundsEdit.setOnTouchListener((view, event) -> {\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\n int textFieldWidth = mBind.adjustViewBoundsEdit.getWidth();\n int iconWidth = mBind.adjustViewBoundsEdit.getCompoundDrawables()[2].getBounds().width();\n if (event.getX() >= textFieldWidth - iconWidth) {\n mBind.adjustViewBoundsEdit.requestFocus();\n popup.show();\n }\n }\n return false;\n });\n\n // If \"true\" is selected, enable the maxWidth and maxHeight fields, and vice versa\n mBind.adjustViewBoundsEdit.addTextChangedListener(new MyTextWatcher() {\n @Override\n public void afterTextChanged(Editable s) {\n if (mBind.adjustViewBoundsEdit.getText().toString().equals(Data.TRUE)) {\n // Enable labels\n mBind.maxWidthLabel.setEnabled(true);\n mBind.maxHeightLabel.setEnabled(true);\n // Enable text fields\n mBind.maxWidthEdit.setEnabled(true);\n mBind.maxHeightEdit.setEnabled(true);\n }\n else {\n // Disable labels\n mBind.maxWidthLabel.setEnabled(false);\n mBind.maxHeightLabel.setEnabled(false);\n // Disable text fields\n mBind.maxWidthEdit.setEnabled(false);\n mBind.maxHeightEdit.setEnabled(false);\n }\n }\n });\n }", "public interface GridConstraint {\n\n\t/**\n\t * Length of the grid.\n\t */\n\tpublic static final int GRID_X_SIZE = 5;\n\n\t/**\n\t * Width of the grid.\n\t */\n\tpublic static final int GRID_Y_SIZE = 5;\n\n\t/**\n\t * Checks whether the given x and y values are on the grid and not off the grid.\n\t * \n\t * @param xValue\n\t * x coordinate\n\t * @param yValue\n\t * y coordinate\n\t * @return true if on the grid and false if off the grid\n\t */\n\tpublic boolean onGrid(int xValue, int yValue);\n}", "public CheckConstraints() {\n this(DSL.name(\"CHECK_CONSTRAINTS\"), null);\n }", "private boolean hasValidBounds() {\n\n\n\n return false;\n }", "public interface UserDefinedConstraints extends EObject {\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _NC_SingeltonSystem(SystemTimer system1, SystemTimer system2);\n\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _NC_SingeltonCurrentSem(Semester sem2, Semester sem1);\n\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _NC_NoTwoEnrollmentsWithSameID(Enrollment en1, Enrollment en2);\n\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _NC_NoTwoEntriesWithSameID(GradeFormular gf);\n\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _NC_onlyOneRecordForModuleOfferAndExam(Enrollment en);\n\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _XNC_onlyOneCMOPerExam(Enrollment en);\n\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _NC_OnlyOneRegPerEnrollment(Record rec2, Record rec1);\n\n\t/**\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\n\t * \n\t * @model\n\t * @generated\n\t */\n\tvoid _NC_NoCompetingBookings(Room room);\n\t// <-- [user code injected with eMoflon]\n\n\t// [user code injected with eMoflon] -->\n}", "public List<ViewConstrainsEnum> getViewConstrainsUIComponent();", "default Rectangle2D constrainRectangle( Figure f, Rectangle2D r) {\n return translateRectangle(f, r, DIRECTION_NEAREST);\n }", "public boolean checkConstraints(ContentValues contentValues) {\n\t\treturn true;\n\t}", "public void changeConstraintsToLessThan() throws IloException {\n /*\n IloRange notes:\n for expr == rhs, set lb = ub = rhs\n for expr <= rhs, set lb = -infinity and ub = rhs\n for expr >= rhs, set lb = rhs and ub = infinity\n */\n for (int i = 0; i < matrix.getNrows(); i++) {\n IloRange rangedExpression = matrix.getRange(i);\n if (rangedExpression.getUB() >= Double.POSITIVE_INFINITY) {\n rangedExpression.setBounds(Double.NEGATIVE_INFINITY, -rangedExpression.getUB());\n for (int j = 0; j < matrix.getNrows(); j++) {\n matrix.setNZ(i, j, -matrix.getNZ(i, j));\n }\n }\n }\n }", "@Override\n\tConstraintFinder findConstraints();", "public List<Constraint> getConstraints() {\r\n\t\treturn constraints;\r\n\t}", "void addConstraintRelation(IViewRelation relation);", "public void reshapeEditor() {\n if (getEditedText() != null) {\n // Update the size to fit the new document - note that it is a 2 stage process\n Dimension prefSize = getEditor().getPreferredSize();\n\n Insets pInsets = getEditedText().getInsets();\n Insets jInsets = getEditor().getInsets();\n\n int width = (getEditedText().getConstrainWidthToTextWidth()) ? (int) prefSize.getWidth() : (int) (getEditedText().getWidth() - pInsets.left - pInsets.right\n + jInsets.left + jInsets.right);\n prefSize.setSize(width, prefSize.getHeight());\n getEditor().setSize(prefSize);\n\n prefSize = getEditor().getPreferredSize();\n int height = (getEditedText().getConstrainHeightToTextHeight()) ? (int) prefSize.getHeight() : (int) (getEditedText().getHeight() - pInsets.top - pInsets.bottom\n + jInsets.top + jInsets.bottom);\n\n prefSize.setSize(width, height);\n getEditor().setSize(prefSize);\n\n // need some twiddling to make the width dance together with an editor...\n if (enforceWidth) {\n if (getWidth() < width + getPedding().getRight() - getPedding().getLeft()) {\n width = width + getPedding().getRight() - getPedding().getLeft();\n } else {\n width = width + getPedding().getLeft();\n }\n setMinConstraint(new PDimension(width, height));\n } else {\n setMinConstraint(new PDimension(0, 0));\n }\n\n reshape(false); // reshaping this component\n getCanvas().repaint();\n }\n }", "@Override\n public boolean dropConstraints() {\n return false;\n }", "int getConstraintsCount();", "public void setLowerBound (int lowerBound) throws ModelException;", "com.microsoft.schemas.crm._2011.contracts.ArrayOfConstraintRelation addNewConstraints();", "protected Command createChangeConstraintCommand( EditPart child, Object constraint ) {\n return null;\r\n }", "void addConstraintEntity(IViewEntity entity);", "public void initConstraints() {\n\n\t\tfor (int i = 0; i < Sudoku.ROWS; i++) {\n\t\t\tfor (int j = 0; j < Sudoku.COLUMNS; j++) {\n\t\t\t\t// set row constraints\n\t\t\t\tfor (int row = 0; row < Sudoku.ROWS; row++) {\n\t\t\t\t\tif (row != j)\n\t\t\t\t\t\tSudoku.grid[i][j].constraints.add(new Constraint(i, row));\n\t\t\t\t}\n\t\t\t\t// set column constraints\n\t\t\t\tfor (int col = 0; col < Sudoku.COLUMNS; ++col) {\n\t\t\t\t\tif (col != i)\n\t\t\t\t\t\tSudoku.grid[i][j].constraints.add(new Constraint(col, j));\n\t\t\t\t}\n\n\t\t\t\t// set box constraints\n\t\t\t\tint top_row = (i/3) * 3;\n\t\t\t\tint bottom_row = top_row + 3;\n\t\t\t\tint left_col = (j/3) * 3;\n\t\t\t\tint right_col = left_col + 3;\n\t\t\t\tfor (int row_unit = top_row; row_unit < bottom_row; row_unit++) {\n\t\t\t\t\tfor (int col_unit = left_col; col_unit < right_col; col_unit++) {\n\t\t\t\t\t\tif (row_unit != i && col_unit != j) {\n\t\t\t\t\t\t\tSudoku.grid[i][j].constraints.add(new Constraint(row_unit, col_unit));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "boolean isSetConstraints();", "void setConstraints(com.microsoft.schemas.crm._2011.contracts.ArrayOfConstraintRelation constraints);", "LengthConstraint createLengthConstraint();", "@Override\n\tpublic Clause getConstraints() {\n\t\treturn null;\n\t}", "public void correcto( Editor<Tipo> editor );", "@Override\n protected void createEditPolicies() {\n if (!getEditor().isReadOnly()) {\n if (isLayoutEnabled()) {\n if (getEditPolicy(EditPolicy.CONTAINER_ROLE) == null && isColumnDragAndDropSupported()) {\n installEditPolicy(EditPolicy.CONTAINER_ROLE, new AttributeConnectionEditPolicy(this));\n installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AttributeDragAndDropEditPolicy(this));\n }\n }\n getDiagram().getModelAdapter().installPartEditPolicies(this);\n }\n }", "public interface IHardConstraint {\n\t\n\tpublic boolean isConstraintViolated(List<Job> jobs, List<Resource> resources, Plan plan);\n\t\t\n}", "public abstract void printConstraint();", "public static void validateInitialConstraints(Constraints constraints) \n throws InvalidInputDataException, ArrayIndexOutOfBoundsException { \n \t\n \tint[][] constraintsArray = Utilities.convertSolutionToArray(constraints);\n \t//check that no non-zero number appears twice in a row\n \tfor (int x=0; x<constraints.getDimSq(); x++) {\n \t\tList<Integer> cellList = new ArrayList<Integer>();\n \t\tfor(int y=0; y<constraints.getDimSq(); y++) {\n \tif (constraintsArray[x][y] != 0){\n \t\tif ((constraintsArray[x][y] < 0) || (constraintsArray[x][y] > constraints.getDimSq())) {\n \t\t\tthrow new InvalidInputDataException(\"Out-of-range value \" + constraintsArray[x][y] + \" found at cell x = \" + x + \" y = \" + y);\n \t\t}\n \t\tInteger currentValue = new Integer(constraintsArray[x][y]);\n \t\tif (cellList.contains(currentValue)){\n \t\t\tthrow new InvalidInputDataException(\"Value \" + currentValue.intValue() + \" found twice in row \" + x);\n \t\t}\n \t\tcellList.add(currentValue);\n \t}\n }\n }\n //check that non-zero number appears twice in a column\n for (int y=0; y<constraints.getDimSq(); y++) {\n List<Integer> cellList = new ArrayList<Integer>();\n for(int x=0; x<constraints.getDimSq(); x++) {\n \tif (constraintsArray[x][y] != 0){\n \t\tInteger currentValue = new Integer(constraintsArray[x][y]);\n \t\tif (cellList.contains(currentValue)) {\n \t\t\tthrow new InvalidInputDataException(\"Value \" + currentValue.intValue() + \" found twice in column \" + y);\n \t\t}\n \t\tcellList.add(currentValue);\n \t}\n }\n }\n //check that no non-zero number appears twice in the same box\n for (int bx=0;bx<constraints.getDim();bx++){\n for (int by=0;by<constraints.getDim();by++) {\n \tList<Integer> cellList = new ArrayList<Integer>();\n \tfor (int x=0; x<constraints.getDimSq(); x++) {\n \t for(int y=0; y<constraints.getDimSq(); y++) {\n \t \tif ((x / constraints.getDim() == bx) && (y / constraints.getDim() == by)){\n \t \tif (constraintsArray[x][y] != 0){\n \t \t\tInteger currentValue = new Integer(constraintsArray[x][y]);\n \t \t\tif (cellList.contains(currentValue)) {\n \t \t\t\tthrow new InvalidInputDataException(\"Value \" + currentValue.intValue() + \" found twice in box \" + bx + \" \" + by);\n \t \t\t}\n \t \t\tcellList.add(currentValue);\n \t \t}\n \t \t}\n \t }\n \t}\n }\n }\n }", "List<IViewRelation> getConstraintRelations();", "public boolean dropConstraints() {\n \t\treturn true;\n \t}", "public void reactivateEqConstraints() {\n\t\t// NOP\n\t}", "public void layoutContainer(Container parent) {\n if ((constraints != null) && (! constraints.isEmpty())) {\n Rectangle alloc = getVisibleEditorRect();\n if (alloc != null) {\n Document doc = editor.getDocument();\n if (doc instanceof AbstractDocument) {\n ((AbstractDocument)doc).readLock();\n }\n try {\n rootView.setSize(alloc.width, alloc.height);\n Enumeration<Component> components = constraints.keys();\n while (components.hasMoreElements()) {\n Component comp = components.nextElement();\n View v = (View) constraints.get(comp);\n Shape ca = calculateViewPosition(alloc, v);\n if (ca != null) {\n Rectangle compAlloc = (ca instanceof Rectangle) ?\n (Rectangle) ca : ca.getBounds();\n comp.setBounds(compAlloc);\n }\n }\n } finally {\n if (doc instanceof AbstractDocument) {\n ((AbstractDocument)doc).readUnlock();\n }\n }\n }\n }\n }", "public static Constraints updateConstraints(Constraints constraints,\n Cell cell,\n Set<Integer> allowedValues){\n cell.setValues(allowedValues);\n constraints.getCells().add(cell);\n return constraints;\n }", "ValueRangeConstraint createValueRangeConstraint();", "protected void createMimoentslotconstraintsAnnotations() {\n\t\tString source = \"mimo-ent-slot-constraints\";\n\t\taddAnnotation\n\t\t (getInvoice_InvoiceStatuses(),\n\t\t source,\n\t\t new String[] {\n\t\t\t \"statusDate\", \"*NOW\"\n\t\t });\n\t}", "private void setComponentBounds() {\n float width = this.getWidth();\n float height = this.getHeight();\n\n int fontSize = height / 30 > 16 ? 16 : (int) (height / 30);\n int buttonWidth = width / 4.5 > 200 ? 200 : (int) (width / 4.5);\n int buttonHeight = height / 14.15 > 35 ? 35 : (int) (height / 14.15);\n int horMargin = (int) (width / 38.15);\n int verMargin = (int) (height / 21.2);\n\n registerButton.setBounds(horMargin, verMargin, buttonWidth, buttonHeight);\n registerButton.setFont(new Font(\"Arial\", Font.BOLD, fontSize));\n\n editButton.setBounds(horMargin + buttonWidth + 30, verMargin, buttonWidth, buttonHeight);\n editButton.setFont(new Font(\"Arial\", Font.BOLD, fontSize));\n\n deleteButton.setBounds((int) (width - (horMargin + buttonWidth)), verMargin, buttonWidth, buttonHeight);\n deleteButton.setFont(new Font(\"Arial\", Font.BOLD, fontSize));\n\n partidaScrollPane.setBounds(horMargin, (int) (height / 7), (int) (width - (horMargin * 2)), (int) (height - ((height / 21.2 * 3) + (height / 14.15))));\n partidaTable.setFont(new Font(\"Arial\", Font.PLAIN, fontSize));\n partidaTable.packAll();\n }", "public RemoteMethodControl setConstraints(MethodConstraints constraints) \n {\n\tRemoteMethodControl rmc = (RemoteMethodControl) getSource(); \n\tJavaSpace spaceProxy = (JavaSpace) rmc.setConstraints(constraints);\n\treturn new ConstrainableOutriggerAvailabilityEvent(\n\t\tspaceProxy,\n\t\tgetID(),\n\t\tgetSequenceNumber(),\n\t\tgetRegistrationInstance(),\n\t\tisVisibilityTransition(),\n\t\tgetEntryRep()\n\t);\n }", "@Override\r\n public Dimension2D preferredSize(Graphics2D g2, Rectangle2D bounds, \r\n Map<String, Object> constraints) {\r\n Insets insets = getInsets();\r\n double width = insets.left + insets.right;\r\n double height = insets.top + insets.bottom;\r\n double maxRowWidth = 0.0;\r\n int elementCount = this.elements.size();\r\n int i = 0;\r\n while (i < elementCount) {\r\n // get one row of elements...\r\n List<ElementInfo> elementsInRow = rowOfElements(i, g2, \r\n bounds);\r\n double rowHeight = calcRowHeight(elementsInRow);\r\n double rowWidth = calcRowWidth(elementsInRow, this.hgap);\r\n maxRowWidth = Math.max(rowWidth, maxRowWidth);\r\n height += rowHeight;\r\n i = i + elementsInRow.size();\r\n }\r\n width += maxRowWidth;\r\n return new ElementDimension(width, height); \r\n }", "@Override\n\tpublic void addConstraint(String constraint) {\n\n\t}", "public void validate() {\n\t\tClass<?> clazz = this.getModelObject().getClass();\n\t\tif (!ArenaUtils.isObservable(clazz)) {\n\t\t\tthrow new RuntimeException(\"La clase \" + clazz.getName() + \" no tiene alguna de estas annotations \" + ArenaUtils.getRequiredAnnotationForModels() + \" que son necesarias para ser modelo de una vista en Arena\");\n\t\t}\n\t\t// TODO: Validate children bindings?\n\t}", "private static boolean optimizableMatchConstraint(android.support.constraint.solver.widgets.ConstraintWidget r3, int r4) {\n /*\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r0 = r3.mListDimensionBehaviors\n r0 = r0[r4]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r1 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT\n r2 = 0\n if (r0 == r1) goto L_0x000a\n return r2\n L_0x000a:\n float r0 = r3.mDimensionRatio\n r1 = 0\n int r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1))\n r1 = 1\n if (r0 == 0) goto L_0x0020\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r3 = r3.mListDimensionBehaviors\n if (r4 != 0) goto L_0x0017\n goto L_0x0018\n L_0x0017:\n r1 = r2\n L_0x0018:\n r3 = r3[r1]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r4 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT\n if (r3 != r4) goto L_0x001f\n return r2\n L_0x001f:\n return r2\n L_0x0020:\n if (r4 != 0) goto L_0x0030\n int r4 = r3.mMatchConstraintDefaultWidth\n if (r4 == 0) goto L_0x0027\n return r2\n L_0x0027:\n int r4 = r3.mMatchConstraintMinWidth\n if (r4 != 0) goto L_0x002f\n int r3 = r3.mMatchConstraintMaxWidth\n if (r3 == 0) goto L_0x003e\n L_0x002f:\n return r2\n L_0x0030:\n int r4 = r3.mMatchConstraintDefaultHeight\n if (r4 == 0) goto L_0x0035\n return r2\n L_0x0035:\n int r4 = r3.mMatchConstraintMinHeight\n if (r4 != 0) goto L_0x003f\n int r3 = r3.mMatchConstraintMaxHeight\n if (r3 == 0) goto L_0x003e\n goto L_0x003f\n L_0x003e:\n return r1\n L_0x003f:\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.constraint.solver.widgets.Optimizer.optimizableMatchConstraint(android.support.constraint.solver.widgets.ConstraintWidget, int):boolean\");\n }", "@FXML\n private void onAjouterPressed(ActionEvent event) throws IOException, SQLException {\n if(DPendDate.isVisible()){\n check3=false;\n if(DPendDate.getValue()== null){\n erreurFin.setOpacity(1);\n }else if(DPendDate.getValue().isBefore(DPchoosedDate.getValue())){\n erreurFin.setOpacity(1);\n }else{\n check3 = true;\n erreurFin.setOpacity(0);\n }\n }\n if(DPchoosedDate.getValue()== null){\n erreurConstruit.setOpacity(0);\n erreurChamp.setOpacity(1);\n check = false;\n }else if(user.getData().isWeekConstruct(DPchoosedDate.getValue())){\n erreurConstruit.setOpacity(1);\n erreurChamp.setOpacity(0);\n }else{\n check = true;\n erreurConstruit.setOpacity(0);\n }\n if(CR11.isSelected()|CR12.isSelected()|CR21.isSelected()|CR22.isSelected()){\n check2 = true;\n }else{\n erreurChamp.setOpacity(1);\n check2 = false;\n }\n if(check && check2 && check3){\n ArrayList<Constraint> theCo;\n theCo = user.getData().getAllConstraintsFromId(this.id);\n user.getData().removeConstraintFamily(this.id);\n erreurChamp.setOpacity(0);\n System.out.println(\"Lancement de la procédure d'ajout de la contrainte\");\n if(CBduree.getValue().toString().equals(\"Unique\")){\n System.out.println(\"unique\");\n int beginHourTemp = 0;\n int endHourTemp = 0;\n int hours = 0; //entre 0 et \n int extendedHours;\n boolean extend = true;\n boolean overwriteError = false;\n ArrayList<Constraint> coList = new ArrayList<>();\n \n for (hours = 0 ; hours != 4 ; hours++){\n if(getThisShittyCheckBox(hours).isSelected()){\n beginHourTemp = hours;\n endHourTemp = hours;\n for(extendedHours = hours ; extend ; extendedHours++){\n if(hours != 4){\n if(getThisShittyCheckBox(hours+1).isSelected()){\n endHourTemp++;\n hours = extendedHours+1;\n }else extend = false;\n }\n }\n Constraint co = new Constraint(getThisShittyConstraintType(CBtype.getValue().toString()), DPchoosedDate.getValue(), nomTextField.getText(), util.getComplicateHoursFromSimple(beginHourTemp), util.getComplicateHoursFromSimple(endHourTemp), 0 , user.getData().getNewGeneratedIdSame());\n coList.add(co);\n if(user.getData().isOverwrite(co)) overwriteError = true;\n }\n }\n if(overwriteError){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Erreur\");\n alert.setHeaderText(\"Une ou plusieurs contraintes déjà ajoutées pour ce ce/ces créneaux\");\n String textOverwrite = \"\";\n for(Constraint aConstraint : coList){\n for(String overwriteConstraintTitle : user.getData().checkOverwrite(aConstraint)){\n textOverwrite += overwriteConstraintTitle + \", \";\n }\n }\n alert.setContentText(\"La/Les contrainte(s) : \" + textOverwrite + \"empêche(nt) l'ajout de votre contrainte.\");\n alert.showAndWait();\n for(Constraint coco : theCo) user.getData().addConstraint(coco);\n }else{\n for(Constraint aConstraint : coList) user.getData().addConstraint(aConstraint);\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Ajout de la contrainte réussi\");\n alert.setHeaderText(null);\n alert.setContentText(\"L'ajout de votre contrainte a bien été pris en compte !\");\n alert.showAndWait();\n }\n }else if(CBduree.getValue().toString().equals(\"Définitive\")){\n System.out.println(\"Définitive\");\n int beginHourTemp = 0;\n int endHourTemp = 0;\n int hours = 0; //entre 0 et \n int extendedHours;\n int id_same[] = {user.getData().getNewGeneratedIdSame() , user.getData().getNewGeneratedIdSame()};\n int indice_idSame;\n int occurence_Type = 1;\n boolean extend = true;\n boolean overwriteError = false;\n ArrayList<Constraint> coList = new ArrayList<>();\n LocalDate dateTempForConstraint = DPchoosedDate.getValue();\n \n while(!overwriteError && dateTempForConstraint.isBefore(user.getData().getLastweekEndDate())){\n indice_idSame = 0;\n for (hours = 0 ; hours != 4 ; hours++){\n if(getThisShittyCheckBox(hours).isSelected()){\n beginHourTemp = hours;\n endHourTemp = hours;\n for(extendedHours = hours ; extend ; extendedHours++){\n if(hours != 4){\n if(getThisShittyCheckBox(hours+1).isSelected()){\n endHourTemp++;\n hours = extendedHours+1;\n }else extend = false;\n }\n }\n if(CBtousLes.getValue().toString().equals(\"Tous les jours\")){\n occurence_Type = 1;\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les semaines\")){\n occurence_Type = 2;\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 2 semaines\")){\n occurence_Type = 3;\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 4 semaines\")){\n occurence_Type = 4;\n }\n Constraint co = new Constraint(getThisShittyConstraintType(CBtype.getValue().toString()), dateTempForConstraint , nomTextField.getText(), util.getComplicateHoursFromSimple(beginHourTemp), util.getComplicateHoursFromSimple(endHourTemp), occurence_Type , id_same[indice_idSame]);\n coList.add(co);\n indice_idSame++;\n if(indice_idSame == 2) indice_idSame = 0;\n if(user.getData().isOverwrite(co)) overwriteError = true;\n }\n }\n if(CBtousLes.getValue().toString().equals(\"Tous les jours\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(1);\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les semaines\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(7);\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 2 semaines\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(14);\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 4 semaines\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(28);\n }\n \n System.out.println(dateTempForConstraint.toString());\n }\n \n if(overwriteError){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Erreur\");\n alert.setHeaderText(\"Une ou plusieurs contraintes déjà ajoutées pour ce ce/ces créneaux\");\n String textOverwrite = \"\";\n for(Constraint aConstraint : coList){\n for(String overwriteConstraintTitle : user.getData().checkOverwrite(aConstraint)){\n textOverwrite += overwriteConstraintTitle + \", \";\n }\n }\n alert.setContentText(\"La/Les contrainte(s) : \" + textOverwrite + \"empêche(nt) l'ajout de votre contrainte.\");\n alert.showAndWait();\n for(Constraint coco : theCo) user.getData().addConstraint(coco);\n }else{\n for(Constraint aConstraint : coList) user.getData().addConstraint(aConstraint);\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Ajout de la contrainte réussi\");\n alert.setHeaderText(null);\n alert.setContentText(\"L'ajout de votre contrainte a bien été pris en compte !\");\n alert.showAndWait();\n }\n }else if(CBduree.getValue().toString().equals(\"Jusqu'au\")){\n System.out.println(\"Jusqu'au\");\n if(DPendDate.getValue().isAfter(user.getData().getLastweekEndDate())){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Erreur\");\n alert.setHeaderText(\"Date de fin de répétition invalide !\");\n alert.setContentText(\"La date de fin de répétition de la contrainte est en dehors de l'année en cours.\");\n alert.showAndWait();\n }else if(DPendDate.getValue().isBefore(user.getData().getFirstweekBeginDate())){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Erreur\");\n alert.setHeaderText(\"Date de fin de répétition invalide !\");\n alert.setContentText(\"La date de fin de répétition de la contrainte est antérieure à l'année en cours.\");\n alert.showAndWait();\n }else if(DPendDate.getValue().isBefore(DPchoosedDate.getValue())){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Erreur\");\n alert.setHeaderText(\"Date de fin de répétition invalide !\");\n alert.setContentText(\"La date de fin de répétition de la contrainte est antérieure à celle du début de celle-ci.\");\n alert.showAndWait();\n }else{\n int beginHourTemp = 0;\n int endHourTemp = 0;\n int hours = 0; //entre 0 et \n int extendedHours;\n int id_same[] = {user.getData().getNewGeneratedIdSame() , user.getData().getNewGeneratedIdSame()};\n int indice_idSame;\n int occurence_Type = 1;\n boolean extend = true;\n boolean overwriteError = false;\n ArrayList<Constraint> coList = new ArrayList<>();\n LocalDate dateTempForConstraint = DPchoosedDate.getValue();\n \n while(!overwriteError && dateTempForConstraint.isBefore(DPendDate.getValue())){\n indice_idSame = 0;\n for (hours = 0 ; hours != 4 ; hours++){\n if(getThisShittyCheckBox(hours).isSelected()){\n beginHourTemp = hours;\n endHourTemp = hours;\n for(extendedHours = hours ; extend ; extendedHours++){\n if(hours != 4){\n if(getThisShittyCheckBox(hours+1).isSelected()){\n endHourTemp++;\n hours = extendedHours+1;\n }else extend = false;\n }\n }\n if(CBtousLes.getValue().toString().equals(\"Tous les jours\")){\n occurence_Type = 5;\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les semaines\")){\n occurence_Type = 6;\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 2 semaines\")){\n occurence_Type = 7;\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 4 semaines\")){\n occurence_Type = 8;\n }\n Constraint co = new Constraint(getThisShittyConstraintType(CBtype.getValue().toString()), dateTempForConstraint , nomTextField.getText(), util.getComplicateHoursFromSimple(beginHourTemp), util.getComplicateHoursFromSimple(endHourTemp), occurence_Type , id_same[indice_idSame]);\n coList.add(co);\n indice_idSame++;\n if(indice_idSame == 2) indice_idSame = 0;\n if(user.getData().isOverwrite(co)) overwriteError = true;\n }\n }\n if(CBtousLes.getValue().toString().equals(\"Tous les jours\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(1);\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les semaines\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(7);\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 2 semaines\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(14);\n }else if(CBtousLes.getValue().toString().equals(\"Toutes les 4 semaines\")){\n dateTempForConstraint = dateTempForConstraint.plusDays(28);\n }\n \n System.out.println(dateTempForConstraint.toString());\n }\n \n if(overwriteError){\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Erreur\");\n alert.setHeaderText(\"Une ou plusieurs contraintes déjà ajoutées pour ce ce/ces créneaux\");\n String textOverwrite = \"\";\n for(Constraint aConstraint : coList){\n for(String overwriteConstraintTitle : user.getData().checkOverwrite(aConstraint)){\n textOverwrite += overwriteConstraintTitle + \", \";\n }\n }\n alert.setContentText(\"La/Les contrainte(s) : \" + textOverwrite + \"empêche(nt) l'ajout de votre contrainte.\");\n alert.showAndWait();\n for(Constraint coco : theCo) user.getData().addConstraint(coco);\n }else{\n for(Constraint aConstraint : coList) user.getData().addConstraint(aConstraint);\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Ajout de la contrainte réussi\");\n alert.setHeaderText(null);\n alert.setContentText(\"L'ajout de votre contrainte a bien été pris en compte !\");\n alert.showAndWait();\n }\n }\n }\n onAnnulerPressed(event);\n }\n }", "@Test\n\tpublic void testaConstrutor() {\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", \"Disciplina 1\",\n\t\t\t\tminitElimBai_1.getNome());\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", 5,\n\t\t\t\tminitElimBai_1.getQtdProvas());\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", 0, minitElimBai_1\n\t\t\t\t.getPosRequisitos().size());\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", 1,\n\t\t\t\tminitElimBai_1.getQtdMinitestesAEliminar());\n\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", \"Disciplina 2\",\n\t\t\t\tminitElimBai_2.getNome());\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", 10,\n\t\t\t\tminitElimBai_2.getQtdProvas());\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", 3, minitElimBai_2\n\t\t\t\t.getPosRequisitos().size());\n\t\tAssert.assertEquals(\"Erro no Contrutor.\", 2,\n\t\t\t\tminitElimBai_2.getQtdMinitestesAEliminar());\n\n\t\tAssert.assertTrue(minitElimBai_2.getPosRequisitos().contains(\n\t\t\t\t\"Disciplina 3\"));\n\t\tAssert.assertTrue(minitElimBai_2.getPosRequisitos().contains(\n\t\t\t\t\"Disciplina 4\"));\n\t\tAssert.assertTrue(minitElimBai_2.getPosRequisitos().contains(\n\t\t\t\t\"Disciplina 5\"));\n\t}", "@Override\n protected View getConstraintLayout() {\n return mConstraintLayout;\n }", "public void setConstraint(int constraint) {\n mConstraint = constraint;\n }", "public void editTypeCard() {\n SpringLayout editLayout = new SpringLayout();\n JLabel editLabel = new JLabel(\"Edit Account Type\");\n JPanel editUserForm = new JPanel();\n\n editUserForm.setLayout(editLayout);\n editUserForm.setBackground(Color.white);\n JLabel userIDLabel = new JLabel(\"User ID\");\n JLabel accountTypeEditLabel = new JLabel(\"Account Type\");\n\n userIDInput = new JTextField(25);\n accountTypeEdit = new JComboBox(userTypes);\n accountTypeEdit.setSelectedIndex(1);\n accountTypeEdit.addActionListener(this);\n\n editAccTypeBtn = new JButton(\"SUBMIT\");\n\n buttonStyle(editAccTypeBtn);\n\n editUserForm.add(editLabel);\n editUserForm.add(userIDLabel);\n editUserForm.add(userIDInput);\n editUserForm.add(accountTypeEditLabel);\n editUserForm.add(accountTypeEdit);\n editUserForm.add(editAccTypeBtn);\n editAccTypeBtn.addActionListener(this);\n\n editLayout.putConstraint(SpringLayout.NORTH, editLabel, 50, SpringLayout.NORTH, editUserForm);\n editLayout.putConstraint(SpringLayout.WEST, editLabel, 50, SpringLayout.WEST, editUserForm);\n\n editLayout.putConstraint(SpringLayout.NORTH, userIDLabel, 100, SpringLayout.NORTH, editUserForm);\n editLayout.putConstraint(SpringLayout.WEST, userIDLabel, 50, SpringLayout.WEST, editUserForm);\n editLayout.putConstraint(SpringLayout.NORTH, userIDInput, 90, SpringLayout.NORTH, editUserForm);\n editLayout.putConstraint(SpringLayout.WEST, userIDInput, 80, SpringLayout.EAST, userIDLabel);\n\n editLayout.putConstraint(SpringLayout.NORTH, accountTypeEditLabel, 50, SpringLayout.NORTH, userIDLabel);\n editLayout.putConstraint(SpringLayout.WEST, accountTypeEditLabel, 50, SpringLayout.WEST, editUserForm);\n editLayout.putConstraint(SpringLayout.NORTH, accountTypeEdit, 50, SpringLayout.NORTH, userIDInput);\n editLayout.putConstraint(SpringLayout.WEST, accountTypeEdit, 50, SpringLayout.EAST, accountTypeEditLabel);\n\n editLayout.putConstraint(SpringLayout.NORTH, editAccTypeBtn, 60, SpringLayout.NORTH, accountTypeEditLabel);\n editLayout.putConstraint(SpringLayout.WEST, editAccTypeBtn, 80, SpringLayout.EAST, accountTypeEditLabel);\n\n functions.add(editUserForm, \"Edit\");\n }", "public void updateBounds(){\r\n\t\tRectangle bounds = new Rectangle(super.getBounds());\r\n\t\tint preferredHeight = 0;\r\n\t\tfor(Object child : getChildren()){\r\n\t\t\tIFigure figure = (IFigure)child;\r\n\t\t\tpreferredHeight += figure.getPreferredSize().height;\r\n\t\t}\r\n\t\tif (preferredHeight == 0) preferredHeight = 200;\r\n\t\tbounds.setHeight(preferredHeight+20);\r\n\t\tsetBounds(bounds);\r\n\t}", "public ModelElement getConstraints() {\n\tmodelElement.clearConstraint();\n\tjava.util.Iterator iterator = getPnlDataSelector().getObjects().iterator();\n\ttry {\n\t\twhile (iterator.hasNext()) {\n\t\t\tObject eleo=iterator.next();\n\t\t\tConstraintDef constraintDef = null;\n\t\t\tif(eleo instanceof NlsString){\n\t\t\t\t// new constraint\n\t\t\t\tConstraintExpression expression = new ConstraintExpression();\n\t\t\t\texpression.setSyntax((NlsString)eleo);\n\t\t\t\tconstraintDef = (ConstraintDef)ElementFactory.createObject(ConstraintDef.class);\n\t\t\t\tconstraintDef.setBody(expression);\n\t\t\t}else{\n\t\t\t\t// existing constraint\n\t\t\t\tconstraintDef = (ConstraintDef)eleo;\n\t\t\t}\n\t\t\tmodelElement.addConstraint(constraintDef);\n\t\t}\n\t} catch(Throwable e) {\n\t\thandleException(e);\n\t}\n\treturn modelElement;\n}", "public DefaultValueAxisEditor(ValueAxis axis) {\n/* 125 */ super(axis);\n/* */ \n/* 127 */ this.autoRange = axis.isAutoRange();\n/* 128 */ this.minimumValue = axis.getLowerBound();\n/* 129 */ this.maximumValue = axis.getUpperBound();\n/* 130 */ this.autoTickUnitSelection = axis.isAutoTickUnitSelection();\n/* */ \n/* 132 */ this.gridPaintSample = new PaintSample(Color.blue);\n/* 133 */ this.gridStrokeSample = new StrokeSample(new BasicStroke(1.0F));\n/* */ \n/* 135 */ this.availableStrokeSamples = new StrokeSample[3];\n/* 136 */ this.availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0F));\n/* */ \n/* 138 */ this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0F));\n/* */ \n/* 140 */ this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0F));\n/* */ \n/* */ \n/* 143 */ JTabbedPane other = getOtherTabs();\n/* */ \n/* 145 */ JPanel range = new JPanel(new LCBLayout(3));\n/* 146 */ range.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));\n/* */ \n/* 148 */ range.add(new JPanel());\n/* 149 */ this.autoRangeCheckBox = new JCheckBox(localizationResources.getString(\"Auto-adjust_range\"), this.autoRange);\n/* */ \n/* 151 */ this.autoRangeCheckBox.setActionCommand(\"AutoRangeOnOff\");\n/* 152 */ this.autoRangeCheckBox.addActionListener(this);\n/* 153 */ range.add(this.autoRangeCheckBox);\n/* 154 */ range.add(new JPanel());\n/* */ \n/* 156 */ range.add(new JLabel(localizationResources.getString(\"Minimum_range_value\")));\n/* */ \n/* 158 */ this.minimumRangeValue = new JTextField(Double.toString(this.minimumValue));\n/* */ \n/* 160 */ this.minimumRangeValue.setEnabled(!this.autoRange);\n/* 161 */ this.minimumRangeValue.setActionCommand(\"MinimumRange\");\n/* 162 */ this.minimumRangeValue.addActionListener(this);\n/* 163 */ this.minimumRangeValue.addFocusListener(this);\n/* 164 */ range.add(this.minimumRangeValue);\n/* 165 */ range.add(new JPanel());\n/* */ \n/* 167 */ range.add(new JLabel(localizationResources.getString(\"Maximum_range_value\")));\n/* */ \n/* 169 */ this.maximumRangeValue = new JTextField(Double.toString(this.maximumValue));\n/* */ \n/* 171 */ this.maximumRangeValue.setEnabled(!this.autoRange);\n/* 172 */ this.maximumRangeValue.setActionCommand(\"MaximumRange\");\n/* 173 */ this.maximumRangeValue.addActionListener(this);\n/* 174 */ this.maximumRangeValue.addFocusListener(this);\n/* 175 */ range.add(this.maximumRangeValue);\n/* 176 */ range.add(new JPanel());\n/* */ \n/* 178 */ other.add(localizationResources.getString(\"Range\"), range);\n/* */ \n/* 180 */ other.add(localizationResources.getString(\"TickUnit\"), \n/* 181 */ createTickUnitPanel());\n/* */ }", "public java.util.List<Constraint> getConstraint() { \n\t\tif (myConstraint == null) {\n\t\t\tmyConstraint = new java.util.ArrayList<Constraint>();\n\t\t}\n\t\treturn myConstraint;\n\t}", "public void colapse(){\n\t\tsetBounds(getX(), getY(), getDefaultWidth(), getHeight());\n\t\tcollisionBounds.setWidth(getDefaultWidth());\n\t}", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "private static boolean optimizableMatchConstraint(android.support.constraint.solver.widgets.ConstraintWidget r4, int r5) {\n /*\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r0 = r4.mListDimensionBehaviors\n r0 = r0[r5]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r1 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT\n r2 = 0\n if (r0 == r1) goto L_0x000a\n return r2\n L_0x000a:\n float r0 = r4.mDimensionRatio\n r1 = 0\n r3 = 1\n int r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1))\n if (r0 == 0) goto L_0x0020\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour[] r0 = r4.mListDimensionBehaviors\n if (r5 != 0) goto L_0x0017\n goto L_0x0018\n L_0x0017:\n r3 = 0\n L_0x0018:\n r0 = r0[r3]\n android.support.constraint.solver.widgets.ConstraintWidget$DimensionBehaviour r1 = android.support.constraint.solver.widgets.ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT\n if (r0 != r1) goto L_0x001f\n return r2\n L_0x001f:\n return r2\n L_0x0020:\n if (r5 != 0) goto L_0x0030\n int r0 = r4.mMatchConstraintDefaultWidth\n if (r0 == 0) goto L_0x0027\n return r2\n L_0x0027:\n int r0 = r4.mMatchConstraintMinWidth\n if (r0 != 0) goto L_0x002f\n int r0 = r4.mMatchConstraintMaxWidth\n if (r0 == 0) goto L_0x003e\n L_0x002f:\n return r2\n L_0x0030:\n int r0 = r4.mMatchConstraintDefaultHeight\n if (r0 == 0) goto L_0x0035\n return r2\n L_0x0035:\n int r0 = r4.mMatchConstraintMinHeight\n if (r0 != 0) goto L_0x003f\n int r0 = r4.mMatchConstraintMaxHeight\n if (r0 == 0) goto L_0x003e\n goto L_0x003f\n L_0x003e:\n return r3\n L_0x003f:\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.constraint.solver.widgets.Optimizer.optimizableMatchConstraint(android.support.constraint.solver.widgets.ConstraintWidget, int):boolean\");\n }", "public void configure(T aView) { aView.setMinSize(80,22); }", "private void geometry()\r\n\t\t{\r\n\t\t//default : spinners are at min and max value, so that the user\r\n\t\t//know what range he can work through at first glance\r\n\t\tspinMin = createRangedSpinner(min, min, max);\r\n\t\tspinMax = createRangedSpinner(max, min, max);\r\n\r\n\t\t//prepare internal grid layout\r\n\t\tgridLayout = new GridLayout(2, 2);\r\n\t\tthis.setLayout(gridLayout);\r\n\r\n\t\t//add components to grid pannel\r\n\t\tthis.add(new JCenter(new JLabel(descMinspinner)));\r\n\t\tthis.add(new JCenter(spinMin));\r\n\t\tthis.add(new JCenter(new JLabel(descMaxspinner)));\r\n\t\tthis.add(new JCenter(spinMax));\r\n\r\n\t\t}", "void checkBoundsAndUpdateRect(InputEvent e) {\n\t\tRotatedTextBox checkRect = new RotatedTextBox(currRect);\n\t\t\n\t\tif (e instanceof MouseWheelEvent) {\n\t\t\tint notches = ((MouseWheelEvent)e).getWheelRotation();\n\t\t\tdouble theta = currRect.getTheta() + notches*THETA_DELTA;\n\t\t\ttheta %= 2*Math.PI;\n\t\t\tcheckRect.setRotation(theta);\n\t\t}\n\t\telse if (e instanceof MouseEvent) {\n\t\t\tMouseEvent m = (MouseEvent)e;\n\t\t\tint x = m.getX();\n\t\t\tint y = m.getY();\n\t\t\tcheckRect.setSize(x - currRect.x,\n\t\t\t\t\ty - currRect.y);\n\t\t}\n\t\telse if (e instanceof KeyEvent) {\n\t\t\tint n = ((KeyEvent)e).getKeyCode();\n\t\t\t\n\t\t\tint mult = 1;\n\t\t\tif (e.isShiftDown()) mult = 5;\n\t\t\tif (e.isControlDown()) mult = 20;\n\t\t\t\n\t\t\tif (n == KeyEvent.VK_W)\t \t\t\tcheckRect.grow(0,mult*RECT_SIZE_DELTA);\n\t\t\telse if (n == KeyEvent.VK_S) \t\tcheckRect.grow(0,-mult*RECT_SIZE_DELTA);\n\t\t\telse if (n == KeyEvent.VK_D)\t\tcheckRect.grow(mult*RECT_SIZE_DELTA,0);\n\t\t\telse if (n == KeyEvent.VK_A)\t\tcheckRect.grow(-mult*RECT_SIZE_DELTA,0);\n\n\t\t\tif (n == KeyEvent.VK_LEFT) \t\t\tcheckRect.translate(-mult*RECT_TRANSL_DELTA, 0);\n\t\t\telse if (n == KeyEvent.VK_RIGHT) \tcheckRect.translate(mult*RECT_TRANSL_DELTA, 0);\n\t\t\telse if (n == KeyEvent.VK_UP) \t\tcheckRect.translate(0,-mult*RECT_TRANSL_DELTA);\n\t\t\telse if (n == KeyEvent.VK_DOWN) \tcheckRect.translate(0,mult*RECT_TRANSL_DELTA);\n\t\t\t\n\t\t\telse if (n == KeyEvent.VK_ENTER || n == KeyEvent.VK_T) {\n\t\t\t\tsaveCurrRectToStack(combo.getSelectedItem());\n\t\t\t}\n\t\t\telse if (n == KeyEvent.VK_G) {\n\t\t\t\tcombo.setSelectedIndex(Math.max(combo.getSelectedIndex()-1, 0));\n\t\t\t}\n\t\t\telse if (n == KeyEvent.VK_B) {\n\t\t\t\tcombo.setSelectedIndex(Math.min(combo.getSelectedIndex()+1,combo.getItemCount()-1));\n\t\t\t}\n\t\t\telse if (n == KeyEvent.VK_Z) {\n\t\t\t\tsaveHandler();\n\t\t\t}\n\t\t}\n\n\t\tcheckRect.ensurePositiveSizeAndUpdateRotation();\n\n\t\tif (currImageBounds.contains(checkRect.getBounds())) {\n\t\t\tcurrRect = checkRect;\n\t\t}\n\t\t\n\t\tif (autoOCRcheckbox.isSelected()) {\n\t\t\tcropCurrRect();\n\t\t}\n\t\t\n\t\trepaint();\n\t\tframe.requestFocusInWindow();\n\t}", "Range controlLimits();", "@Override\n protected void validateEdit(Fornecedor post) {\n\n }", "void provideBounds(DiagramDescription diagram);", "private void objectWidth(TableColumn col,int min,int max){\r\n col.setMinWidth(min); //Establece el valor minimo\r\n col.setMaxWidth(max); //Establece el valor maximo\r\n }", "void setNilConstraints();", "@Override\n\tprotected void getConstraintFromNetlistConstraintFile() {\n\n\t}", "@DISPID(1611006004) //= 0x60060034. The runtime will prefer the VTID if present\n @VTID(79)\n boolean constraintsNodeInTree();", "private boolean constraintChecker(Norm norm1, Norm norm2) {\n\t\tif (norm1.getActivationConstraint() == null || norm1.getDeactivationConstraint() == null ||\n\t\t\tnorm2.getActivationConstraint() == null || norm2.getDeactivationConstraint() == null) {\n\t\t\t\n\t\t\tnorm1.setActivationConstraint(null);\n\t\t\tnorm2.setActivationConstraint(null);\n\t\t\tnorm1.setDeactivationConstraint(null);\n\t\t\tnorm2.setDeactivationConstraint(null);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tConstraintType na1 = norm1.getActivationConstraint().getConstraintType();\n\t\tConstraintType nd1 = norm1.getDeactivationConstraint().getConstraintType();\n\t\t\n\t\tConstraintType na2 = norm2.getActivationConstraint().getConstraintType();\n\t\tConstraintType nd2 = norm2.getDeactivationConstraint().getConstraintType();\n\t\t\n\t\t//it is necessary only 3 tests\n\t\tif (!na1.equals(nd1) || !na2.equals(nd2) || !na1.equals(na2)) {\n\t\t\tnorm1.setActivationConstraint(null);\n\t\t\tnorm2.setActivationConstraint(null);\n\t\t\tnorm1.setDeactivationConstraint(null);\n\t\t\tnorm2.setDeactivationConstraint(null);\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// If the activation conditions are actions\n\t\tif (norm1.getActivationConstraint().getConstraintType().equals(ConstraintType.ACTIONTYPE)\n\t\t\t\t&& norm1.getActivationConstraint().getConstraintType().equals(ConstraintType.ACTIONTYPE)) {\n\n\t\t\t//todo...o tratamento vai ser realizado no futuro, caso necessário\n\t\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t//\n\t\t//at this moment the constrainttype are both DATETYPE, so it is not necessary more comparisons\n\t\t//\n\t\t\n\t\tDateTime d1Begin = ((ConstraintDate) norm1.getActivationConstraint()).getDate();\n\t\tDateTime d1End = ((ConstraintDate) norm1.getDeactivationConstraint()).getDate();\n\t\tDateTime d2Begin = ((ConstraintDate) norm2.getActivationConstraint()).getDate();\n\t\tDateTime d2End = ((ConstraintDate) norm2.getDeactivationConstraint()).getDate();\n\t\t\n\t\tboolean r = this.compareDateIntervals(d1Begin, d1End, d2Begin, d2End);\n\t\treturn r;\n\t}", "com.microsoft.schemas.crm._2011.contracts.ArrayOfConstraintRelation getConstraints();", "public void validate()\n\t{\t\t\n\t\t// calculate the corner position\n\t\tsetCorner(\n\t\t\t\tcalculateCornerPosition(\n\t\t\t\t\t\tgetCentrePosition(),\n\t\t\t\t\t\tgetHorizontalSpanVector(),\n\t\t\t\t\t\tgetVerticalSpanVector()\n\t\t\t\t\t)\n\t\t\t);\n\t}", "public String[] getRoomConstraint(){\r\n return roomConstraint.clone();\r\n }", "private void init() {\r\n setTitle(\"Crop Boundary Pixels\");\r\n setSize(350, 230);\r\n setForeground(Color.black);\r\n\r\n Box contentBox = new Box(BoxLayout.Y_AXIS);\r\n JPanel optionPanel = new JPanel();\r\n\r\n // make border\r\n optionPanel.setBorder(buildTitledBorder(\"Pixels Around Image\"));\r\n contentBox.add(optionPanel);\r\n\r\n // set layout\r\n GridBagLayout gbl = new GridBagLayout();\r\n GridBagConstraints gbc = new GridBagConstraints();\r\n optionPanel.setLayout(gbl);\r\n\r\n gbc.anchor = GridBagConstraints.NORTHWEST;\r\n // make content, place into layout\r\n\r\n // left\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n JLabel leftSideLabel = new JLabel(\"Pixels on the left side:\");\r\n leftSideLabel.setFont(serif12);\r\n leftSideLabel.setForeground(Color.black);\r\n leftSideLabel.setRequestFocusEnabled(false);\r\n gbc.gridwidth = 2;\r\n gbl.setConstraints(leftSideLabel, gbc);\r\n optionPanel.add(leftSideLabel);\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n leftSideInput = new JTextField(\"0\", 4);\r\n leftSideInput.addActionListener(this);\r\n MipavUtil.makeNumericsOnly(leftSideInput, false);\r\n\r\n gbc.gridwidth = GridBagConstraints.REMAINDER;\r\n gbl.setConstraints(leftSideInput, gbc);\r\n optionPanel.add(leftSideInput);\r\n\r\n // right\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n JLabel rightSideLabel = new JLabel(\"Pixels on the right side:\");\r\n rightSideLabel.setFont(serif12);\r\n rightSideLabel.setForeground(Color.black);\r\n rightSideLabel.setRequestFocusEnabled(false);\r\n gbc.gridwidth = 2;\r\n gbl.setConstraints(rightSideLabel, gbc);\r\n optionPanel.add(rightSideLabel);\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n rightSideInput = new JTextField(\"0\", 4);\r\n rightSideInput.addActionListener(this);\r\n MipavUtil.makeNumericsOnly(rightSideInput, false);\r\n\r\n gbc.gridwidth = GridBagConstraints.REMAINDER;\r\n gbl.setConstraints(rightSideInput, gbc);\r\n optionPanel.add(rightSideInput);\r\n\r\n // top\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n JLabel topLabel = new JLabel(\"Pixels on top:\");\r\n topLabel.setFont(serif12);\r\n topLabel.setForeground(Color.black);\r\n topLabel.setRequestFocusEnabled(false);\r\n gbc.gridwidth = 2;\r\n gbl.setConstraints(topLabel, gbc);\r\n optionPanel.add(topLabel);\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n topInput = new JTextField(\"0\", 4);\r\n topInput.addActionListener(this);\r\n MipavUtil.makeNumericsOnly(topInput, false);\r\n gbc.gridwidth = GridBagConstraints.REMAINDER;\r\n gbl.setConstraints(topInput, gbc);\r\n optionPanel.add(topInput);\r\n\r\n // bottom\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n JLabel bottomLabel = new JLabel(\"Pixels on bottom:\");\r\n bottomLabel.setFont(serif12);\r\n bottomLabel.setForeground(Color.black);\r\n bottomLabel.setRequestFocusEnabled(false);\r\n gbc.gridwidth = 2;\r\n gbl.setConstraints(bottomLabel, gbc);\r\n optionPanel.add(bottomLabel);\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n bottomInput = new JTextField(\"0\", 4);\r\n bottomInput.addActionListener(this);\r\n MipavUtil.makeNumericsOnly(bottomInput, false);\r\n gbc.gridwidth = GridBagConstraints.REMAINDER;\r\n gbl.setConstraints(bottomInput, gbc);\r\n optionPanel.add(bottomInput);\r\n\r\n // front\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n JLabel frontLabel = new JLabel(\"Slices at the front of image:\");\r\n frontLabel.setFont(serif12);\r\n frontLabel.setForeground(Color.black);\r\n frontLabel.setRequestFocusEnabled(false);\r\n gbc.gridwidth = 2; // GridBagConstraints.RELATIVE;\r\n gbl.setConstraints(frontLabel, gbc);\r\n optionPanel.add(frontLabel);\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n frontInput = new JTextField(\"0\", 4);\r\n frontInput.addActionListener(this);\r\n MipavUtil.makeNumericsOnly(frontInput, false);\r\n gbc.gridwidth = GridBagConstraints.REMAINDER;\r\n gbl.setConstraints(frontInput, gbc);\r\n optionPanel.add(frontInput);\r\n\r\n // back\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n\r\n JLabel backLabel = new JLabel(\"Slices at the back of image:\");\r\n backLabel.setFont(serif12);\r\n backLabel.setForeground(Color.black);\r\n backLabel.setRequestFocusEnabled(false);\r\n gbc.gridwidth = 2; // GridBagConstraints.RELATIVE;\r\n gbl.setConstraints(backLabel, gbc);\r\n optionPanel.add(backLabel);\r\n optionPanel.add(Box.createHorizontalStrut(10));\r\n backInput = new JTextField(\"0\", 4);\r\n backInput.addActionListener(this);\r\n MipavUtil.makeNumericsOnly(backInput, false);\r\n gbc.gridwidth = GridBagConstraints.REMAINDER;\r\n gbl.setConstraints(backInput, gbc);\r\n optionPanel.add(backInput);\r\n\r\n // image destination select\r\n JPanel destPanel = new JPanel(); // panel carries no content but box & border\r\n destPanel.setBorder(buildTitledBorder(\"Select Destination\"));\r\n\r\n Box destinationBox = new Box(BoxLayout.Y_AXIS);\r\n\r\n destinationGroup = new ButtonGroup();\r\n newImage = new JRadioButton(\"New Image\", true);\r\n newImage.setFont(serif12);\r\n newImage.addActionListener(this);\r\n destinationGroup.add(newImage);\r\n destinationBox.add(newImage);\r\n newImage.setEnabled(true);\r\n\r\n replaceImage = new JRadioButton(\"Replace Image\", false);\r\n replaceImage.setFont(serif12);\r\n replaceImage.addActionListener(this);\r\n destinationGroup.add(replaceImage);\r\n destinationBox.add(replaceImage);\r\n replaceImage.setEnabled(true);\r\n destPanel.add(destinationBox);\r\n contentBox.add(destPanel);\r\n\r\n // test speed panel (choice 1: algo has personal buff, imported into img,\r\n // choice 2: algo calcs where to insert a row. methinks fewer loops)\r\n /*\r\n * JPanel loopingTestPanel = new JPanel(); loopingTestPanel.setBorder(buildTitledBorder(\"Looping test\")); Box\r\n * loopingTestBox = new Box(BoxLayout.Y_AXIS); loopingGroup = new ButtonGroup(); noBuffer = new JRadioButton(\"No\r\n * Buffer\", true); noBuffer.setFont(serif12); noBuffer.addActionListener(this); loopingGroup.add(noBuffer);\r\n * loopingTestBox.add(noBuffer); usingBuffer = new JRadioButton(\"Uses Buffer\", false);\r\n * usingBuffer.setFont(serif12); usingBuffer.addActionListener(this); loopingGroup.add(usingBuffer);\r\n * loopingTestBox.add(usingBuffer); loopingTestPanel.add(loopingTestBox); contentBox.add(loopingTestPanel);\r\n */\r\n // end looping test display\r\n\r\n /*\r\n * JPanel OKCancelPanel = new JPanel(new FlowLayout()); OKButton = buildOKButton(); OKCancelPanel.add(OKButton);\r\n *\r\n * cancelButton = buildCancelButton(); OKCancelPanel.add(cancelButton); contentBox.add(OKCancelPanel);\r\n */\r\n contentBox.add(buildButtons());\r\n\r\n // if this is a 2D image, turn off slice margins\r\n if (image.getNDims() == 2) {\r\n frontLabel.setEnabled(false);\r\n frontInput.setEnabled(false);\r\n backLabel.setEnabled(false);\r\n backInput.setEnabled(false);\r\n }\r\n\r\n mainDialogPanel.add(contentBox);\r\n getContentPane().add(mainDialogPanel);\r\n\r\n pack();\r\n setVisible(true);\r\n }", "private void tablesice() {\n //Modificamos los tamaños de las columnas.\n tablastock.getColumnModel().getColumn(0).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(1).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(2).setMinWidth(100);\n tablastock.getColumnModel().getColumn(3).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(4).setMaxWidth(70);\n tablastock.getColumnModel().getColumn(5).setMaxWidth(70);\n }", "@Generated\n @Selector(\"isConstrained\")\n public native boolean isConstrained();", "@objid (\"db7f3c97-1871-4855-958d-3659b2211f8a\")\n protected Object getConstraint() {\n return this.constraint;\n }", "public ConstraintDefinition(String name) {\n\t\tm_parameters = new ArrayList<ConstraintParameter>();\n\t\tm_parameterString = \"\";\n\t\tsetName(name);\n\t\tsetThresholdMultiplier(1.0);\n\t}", "protected void calcMinMax() {\n }", "protected abstract Object validateParameter(Object constraintParameter);", "void setMyWidth()\n\t{\n\t\tfor(int i =0 ; i<editRow.getChildCount();i++)\n\t\t{\n\t\t\t\n\t\t\t((EditText)editRow.getChildAt(i)).setMinWidth(colWidth[i]);\n\t\t\t((EditText)editRow.getChildAt(i)).setMaxWidth(colWidth[i]);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void setMaxPaddleLength(){\n myRectangle.setWidth(myScreenWidth - SIDEBAR_WIDTH);\n }", "public Exo2_Editeurpolylignes() {\n valeur_maximum = 5;\n initComponents();\n Tools.windowsInit(this);\n Tools.setIcone(\"./src/Icones/Icone_Lines.bmp\", this);\n this.setTitle(\"Editeur de poly-Lignes\");\n etat = Etat.Init;\n //rien\n initNombrePoints();\n\n }", "public ElementDefinitionDt setConstraint(java.util.List<Constraint> theValue) {\n\t\tmyConstraint = theValue;\n\t\treturn this;\n\t}", "public void checkBounds(Scope scope) {\n}", "public void setComponentBounds(){\n spelerIDLabel.setBounds(40,10,100,40);\n typeLabel.setBounds(40,60,100,40);\n codeLabel.setBounds(40,110,200,40);\n heeftBetaaldLabel.setBounds(40, 160, 200, 40);\n\n spelerIDField.setBounds(250, 10, 100, 40);\n typeField.setBounds(250, 60, 100, 40);\n codeField.setBounds(250, 110, 100, 40);\n heeftBetaaldField.setBounds(250, 160, 100, 40);\n\n terugButton.setBounds(300,260,75,40);\n klaarButton.setBounds(200,260,100,40);\n\n\n\n\n }", "private Dimension calculateTranslate() {\n \t\n \tint maxx=50;\n \tint minx=0;\n \tint maxy=50;\n \tint miny=0;\n \t\n \tVector v=Selector.getInstance().getAllEntitiesOnPanel();\n \tfor (int i=0; i<v.size(); i++) {\n \t\tEntity e =(Entity)v.elementAt(i);\n \t\tmaxx=Math.max(maxx,e.getX()+e.getWidth()+20);\n \t\tmaxy=Math.max(maxy,e.getY()+e.getHeight()+20);\n \t\tminx=Math.min(minx,e.getX()-20);\n \t\tminy=Math.min(miny,e.getY()-20);\n \t}\n \treturn new Dimension(minx,miny);\n }", "@Override\r\n public void validate()\r\n {\r\n List<Connection> connections = model.getConnections();\r\n List<String> connectionsRelation = new ArrayList<>();\r\n\r\n for (Connection c : connections)\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n sb.append(c.getSource().getId());\r\n sb.append(\"-\");\r\n sb.append(c.getTarget().getId());\r\n connectionsRelation.add(sb.toString());\r\n }\r\n\r\n List<String> answerRelations = Arrays.asList(task.getAnswerRelations().split(\";\"));\r\n\r\n if (connectionsRelation.isEmpty())\r\n {\r\n connectionsRelation.add(\"\");\r\n }\r\n\r\n if (ModelUtils.areEqualLists(connectionsRelation, answerRelations))\r\n {\r\n quizBean.setPoints(quizBean.getPoints() + 1);\r\n }\r\n\r\n quizBean.game();\r\n }", "public Constraint addConstraint() {\n\t\tConstraint newType = new Constraint();\n\t\tgetConstraint().add(newType);\n\t\treturn newType; \n\t}" ]
[ "0.6594172", "0.62683547", "0.593428", "0.5799639", "0.5780846", "0.5780846", "0.57691216", "0.5702045", "0.56977916", "0.5641755", "0.5578002", "0.557554", "0.555179", "0.55069435", "0.5497998", "0.5497329", "0.5467802", "0.5449548", "0.54258376", "0.5331847", "0.53298044", "0.53239983", "0.5323564", "0.5304849", "0.5279553", "0.5279548", "0.5275608", "0.527249", "0.52660006", "0.5253786", "0.52507085", "0.52294344", "0.52167237", "0.52080303", "0.520161", "0.51963824", "0.5191191", "0.5165256", "0.51648945", "0.51568055", "0.51440424", "0.5144039", "0.5122466", "0.51200724", "0.51119494", "0.510835", "0.5102988", "0.50960994", "0.5091741", "0.50737286", "0.50682145", "0.5062903", "0.5059908", "0.5050417", "0.5041126", "0.50303763", "0.50284237", "0.5011178", "0.5003062", "0.49995586", "0.4996857", "0.49937454", "0.49936464", "0.4988746", "0.49877846", "0.49819952", "0.49759668", "0.4963582", "0.4960998", "0.4955131", "0.4942683", "0.49331436", "0.49318656", "0.49220952", "0.4921651", "0.49213603", "0.49185887", "0.4917589", "0.4916878", "0.49160445", "0.4912333", "0.4911606", "0.4908116", "0.49066603", "0.4905858", "0.49039385", "0.4901971", "0.48961592", "0.48923427", "0.48826438", "0.48824215", "0.48788226", "0.48736453", "0.4869472", "0.48663905", "0.4864239", "0.48592958", "0.48582536", "0.48443156", "0.48414463" ]
0.68780714
0
Konstruktor des Players, in ihm werden die Attribute server und connection mit vom ClientListererThread uebergebenen Werten Instanziiert. ComIn und comOut initialisiert.
public Player(Server loginServer, Socket socket) { super("Player"); server = loginServer; connection = socket; try { connection.setSoTimeout(0); comOut = new ObjectOutputStream(connection.getOutputStream()); comOut.flush(); } catch (IOException e) { System.err.println("Couldn't getOutputStream"); try { connection.close(); } catch (IOException e1) { System.err.println("Closing Failed"); e1.printStackTrace(); } e.printStackTrace(); } try { comIn = new ObjectInputStream(connection.getInputStream()); } catch (IOException e) { try { connection.close(); } catch (IOException e1) { System.err.println("Closing Failed"); e1.printStackTrace(); } System.err.println("Couldn't getInputStream"); e.printStackTrace(); } name = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GameServerClient(){\r\n\t\tinitComponents();\r\n\t\t}", "public GameHandler(Socket cs) {\r\n try {\r\n ous = new ObjectOutputStream(cs.getOutputStream());\r\n ois = new ObjectInputStream(cs.getInputStream());\r\n try {\r\n Request request = (Request) ois.readObject();\r\n if (request.getType() == Setting.REG || request.getType() == Setting.LOGIN || request.getType() == Setting.FBLOG) {\r\n user = (User) request.getObject();\r\n if (request.getType() == Setting.LOGIN) {\r\n user = UserController.login(user);\r\n\r\n } else if (request.getType() == Setting.REG) {\r\n user = UserController.register(user);\r\n\r\n } else if (request.getType() == Setting.FBLOG) {\r\n user = UserController.fbLogin(user);\r\n System.out.println(\"\" + user.getImg());\r\n Image image = new Image(user.getImg());\r\n saveToFile(image, \"\" + image.toString(), user);\r\n }\r\n\r\n if (user.getId() != 0 && !checkAlreadyLogin(user)) {\r\n\r\n clientsVector.add(this);\r\n // if register or login is ok send list off available players to client \r\n this.ous.flush();\r\n this.ous.reset();\r\n user.setStatus(Setting.AVAILABLE);\r\n //////////// Update server list ////////////////\r\n if (request.getType() == Setting.REG) {\r\n Platform.runLater(() -> {\r\n try {\r\n ServerTicTacServer.items.add(user);\r\n } catch (Exception e) {\r\n System.out.println(\"servertictacserver items \");\r\n e.printStackTrace();\r\n }\r\n });\r\n }\r\n if (request.getType() == Setting.LOGIN) {\r\n ServerTicTacServer.updateServerList(user);\r\n }\r\n ServerTicTacServer.usersList.refresh();\r\n ////////////////////////////////////////////////\r\n request.setType(Setting.REG_OK);\r\n\r\n List availablePlayerList = new ArrayList<User>();\r\n for (GameHandler gameHandler : clientsVector) {\r\n if (gameHandler.user != null && gameHandler.user.getId() != user.getId()) {\r\n availablePlayerList.add(gameHandler.user);\r\n }\r\n }\r\n Object[] objects = {availablePlayerList, user};\r\n request.setObject(objects);\r\n System.out.println(\"ssssssssssssss :\" + user.getName());\r\n this.ous.writeObject(request);\r\n this.ous.flush();\r\n this.ous.reset();\r\n request.setType(Setting.ADD_PLAYER_TO_AVAILABLE_LIST);\r\n request.setObject(user);\r\n brodCast(request);\r\n start();\r\n } else {\r\n\r\n // error in registration or login >> send to client error message\r\n if (request.getType() == Setting.REG) {\r\n\r\n request.setType(Setting.REG_NO);\r\n request.setObject(\"email already exist\");\r\n } else if (checkAlreadyLogin(user)) {\r\n request.setType(Setting.LOGIN_NO);\r\n request.setObject(\"That account is already login\");\r\n } else if (request.getType() == Setting.LOGIN) {\r\n request.setType(Setting.LOGIN_NO);\r\n request.setObject(\"incorrect username or passsword\");\r\n\r\n }\r\n\r\n this.ous.writeObject(request);\r\n this.ous.flush();\r\n this.ous.reset();\r\n ous.close();\r\n ois.close();\r\n cs.close();\r\n }\r\n }\r\n } catch (ClassNotFoundException ex) {\r\n System.out.println(\"construct gamehandler exception\");\r\n //Logger.getLogger(GameHandler.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public ServerPlayers() {\n sockets = new ArrayList<Socket>();\n }", "public static interface Client\n\t{\n\n\t\t/**\n\t\t * Server notify the client to refresh the player list.\n\t\t * @param playerList New player list.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid refreshPlayerList(Map<String, IPlayerConfig> playerList) throws RpcException;\n\n\t\t/**\n\t\t * Server notify the client to refresh the game config. Client is expected to display it in GameCreation panel.\n\t\t * @param gameCfg New game config.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid refreshGameConfig(GameConfig gameCfg) throws RpcException;\n\t\t\n\t\t/**\n\t\t * Server broadcast game creation message from another player.\n\t\t * @param fromPlayer Sender player. \n\t\t * @param msg Message.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receiveGameCreationMessage(String fromPlayer, String msg) throws RpcException;\n\n\t\t/**\n\t\t * Server broadcast running game message from another player.\n\t\t * @param fromPlayer Sender player. \n\t\t * @param msg Message.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receiveRunningGameMessage(String fromPlayer, String msg) throws RpcException;\n\t\t\n\t\t/**\n\t\t * Server broadcast paused game message from another player.\n\t\t * @param fromPlayer Sender player. \n\t\t * @param msg Message.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receivePausedGameMessage(String fromPlayer, String msg) throws RpcException;\n\t\t\n\t\t/**\n\t\t * Server broadcast new turn events.\n\t\t * Client should process these events on local gameboard.\n\t\t * If there is an error processins events on local gameboard, then it means local gameboard and server gameboard view for this player are out of sync.\n\t\t * In that case, client should call {@link ServerRunningGame#getEntireGameLog()} methods to recreate a fresh local gameboard.\n\t\t * @param newTurnEvents Events generated on turn resolution.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receiveNewTurnGameBoard(List<IGameEvent> newTurnEvents) throws RpcException;\n\t}", "public Server(){\r\n \r\n this.m_Clients = new TeilnehmerListe();\r\n this.m_Port = 7575;\r\n }", "public interface GameClient {\r\n\r\n /**\r\n * Connect the client to a server\r\n * @param server ServerEntry the server entry of the server to connect to\r\n * @param name String the name of this client\r\n * @throws Exception\r\n */\r\n void connect(ServerEntry server, String name) throws Exception;\r\n\r\n /**\r\n * Disconnect from the current server\r\n * @throws Exception\r\n */\r\n void disconnect() throws Exception;\r\n\r\n /**\r\n * Checks if the client is connected to a server.\r\n * @return boolean is it connected or not?\r\n */\r\n boolean isConnected();\r\n\r\n /**\r\n * Returns the server represented by a server entry.\r\n * @return ServerEntry the server\r\n */\r\n ServerEntry getServer();\r\n\r\n /**\r\n * Starts a local server on the client machine.\r\n * @param port int the port on which the server should listen\r\n * @throws Exception\r\n */\r\n void startServer(int port) throws Exception;\r\n\r\n /**\r\n * Shuts down a local server on the client machine if one is running.\r\n * @throws Exception\r\n */\r\n void shutDownServer() throws Exception;\r\n\r\n /**\r\n * Returns true, is a local server is running on this client machine.\r\n * @return boolean is it?\r\n */\r\n boolean runsServer();\r\n \r\n BlueThunderServer getServerImpl();\r\n \r\n void ready(boolean isReady);\r\n \r\n boolean isReady();\r\n \r\n MapList getMapList();\r\n \r\n void addBot();\r\n \r\n int getMapNumber();\r\n \r\n NetState getState();\r\n \r\n void logout(int cid, PlayerInfo player);\r\n \r\n List<String> getPlayers();\r\n \r\n List<MapInfo> getSelectedMaps();\r\n\r\n int getClientID();\r\n \r\n void startSinglePlayer();\r\n \r\n /**\r\n * Shuts down the client and everything...\r\n */\r\n void quit();\r\n}", "public void connectToServerPVP() {\n\n\t\ttry \n\t\t{\n\t\t\tSocket socket = new Socket(host, 8001);\n\t\t\tfromServer = new DataInputStream(socket.getInputStream());\n\t\t\ttoServer = new DataOutputStream(socket.getOutputStream());\n\n\t\t\ttoServer.writeInt(vsPLAYER);\n\n\t\t} catch (IOException ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t}\n\n\t\tThread thread = new Thread(new clientHandlingPlayer(fromServer, toServer));\n\t\tthread.start();\n\t}", "ServerClient(ChatServer serv, Socket cl, String user){\n this.server = serv;\n this.client = cl;\n this.username = user;\n this.clientConnected = true;\n this.room = serv.name;\n }", "private void serverConfigurations() {\n\n client = new Client();\n client.start();\n\n Network.register(client);\n\n client.addListener(new Listener() {\n public void connected(Connection connection) {\n }\n\n public void received(Connection connection, Object object) {\n if (object instanceof IsFull)\n transitionTo(mainMenu);\n if (object instanceof Abort) {\n //\n }\n\n if (object instanceof CanStart)\n Platform.runLater(() -> transitionTo(mainGame));\n\n if (object instanceof WhoseTurn) {\n WhoseTurn whoseTurn = (WhoseTurn) object;\n Platform.runLater(() -> setTurnLabel(whoseTurn.name));\n }\n if (object instanceof ConnectedPlayers) {\n System.out.println(\"CONNECTED PLAYERS\");\n ConnectedPlayers players = (ConnectedPlayers) object;\n Platform.runLater(() -> {\n textArea.clear();\n for (String name : players.names)\n textArea.appendText(name + \"\\n\");\n }\n );\n }\n\n if (object instanceof ReadyForShips)\n Platform.runLater(() -> transitionTo(setShips));\n\n if (object instanceof OthersSpecs) {\n OthersSpecs othersSpecs = (OthersSpecs) object;\n\n Platform.runLater(() -> {\n\n ene1.serverID = othersSpecs.ene1;\n ene1.name = othersSpecs.ene1n;\n ene1.labeln.setText(ene1.name);\n cWl1.setText(ene1.name);\n\n ene2.serverID = othersSpecs.ene2;\n ene2.name = othersSpecs.ene2n;\n ene2.labeln.setText(ene2.name);\n cWl2.setText(ene2.name);\n\n });\n\n }\n\n if (object instanceof YourBoardToPaint)\n //System.out.println(\"MY BOARD TO PAINT\");\n Platform.runLater(() -> mGSelfBoard.updateTiles(((YourBoardToPaint) object).board));\n\n if (object instanceof EnemiesBoardsToPaint) {\n //System.out.println(\"ENEMIES BOARDS TO PAINT\");\n Platform.runLater(() -> {\n ene1.b.startTiles(((EnemiesBoardsToPaint) object).board1);\n ene2.b.startTiles(((EnemiesBoardsToPaint) object).board2);\n });\n }\n\n if (object instanceof EnemyBoardToPaint) {\n Platform.runLater(() -> {\n EnemyBoardToPaint ebp = (EnemyBoardToPaint) object;\n updateEnemyBoard(ebp.id, ebp.newAttackedBoard);\n System.out.println(\"ENEMY BOARD TO PAINT WITH INDEX \" + ebp.id);\n });\n }\n\n if (object instanceof AnAttackResponse) {\n Platform.runLater(() -> {\n lastAttacked.b.updateTiles(((AnAttackResponse) object).newAttackedBoard);\n iCanAttack = ((AnAttackResponse) object).again;\n doSounds(((AnAttackResponse) object).actualHit, ((AnAttackResponse) object).shipHit);\n });\n }\n\n if (object instanceof YourTurn) {\n Platform.runLater(() -> {\n iCanAttack = true;\n setTurnLabel(\"My TURN!!\");\n });\n }\n\n if (object instanceof YouDead) {\n Platform.runLater(() -> {\n lost(\"You died a horrible death. RIP you\");\n transitionTo(mainMenu);\n });\n }\n\n if (object instanceof PlayerDied) {\n Platform.runLater(() -> {\n removeEnemy(((PlayerDied) object).who);\n });\n }\n\n if (object instanceof YouWon) {\n Platform.runLater(() -> {\n Alert lost = new Alert(Alert.AlertType.CONFIRMATION);\n lost.setContentText(\"YOU BEAT THEM ALL\");\n lost.showAndWait();\n won();\n });\n }\n\n if (object instanceof ChatMessage) {\n Platform.runLater(() -> {\n EnemyLocal toUpdate = ene1;\n if (((ChatMessage) object).saidIt == ene2.serverID) {\n toUpdate = ene2;\n }\n toUpdate.conversation.setText(toUpdate.conversation.getText() + ((ChatMessage) object).message);\n });\n }\n }\n });\n\n }", "public Client() {\n initComponents();\n play = new Play(SIZE);\n sendButton.setEnabled(false);\n moveButton.setEnabled(false);\n reprintField();\n }", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "@Override\n public void initClient(final String hostName, final String serverAddr, \n final int serverPort) {\n final GameBoard gameBoard = new GameBoard(Controller.DEFAULT_GRID_SIZE);\n gameBoard.setVisible(true);\n gameBoard.toConsole(\"Hello \" + hostName);\n gameBoard.toConsole(\"Connecting to server...\");\n \n SwingWorker socketWorker = new SwingWorker<Socket, Integer>() {\n\n @Override\n protected Socket doInBackground() throws Exception {\n \n Socket socket = null;\n try {\n //attempt to connect to the server\n socket = new Socket(serverAddr, serverPort);\n \n gameBoard.toConsole(\"Connection successful!!\");\n gameBoard.toConsole(\"Waiting for opponent...\");\n \n /* Open an input stream to read messages from the server.\n * If we are the first of two players attempting a connection\n * then we will get two messages from the server - one to \n * let us know the server is waiting for an opponent and \n * another to let us know two clients are connected. There\n * is also the possibility that the \n */\n \n DataInputStream in = new DataInputStream(socket.getInputStream());\n \n int messageCode = in.readInt();\n String controlFlag = Controller.GO_SECOND;\n \n if(messageCode == WAITING_CODE) {\n gameBoard.toConsole(\"Waiting for opponent...\");\n messageCode = in.readInt();\n controlFlag = Controller.GO_FIRST;\n }\n\n if(messageCode == ALL_OPPONENTS_READY) {\n \n new Controller(hostName, controlFlag, socket, gameBoard);\n }\n else if(messageCode == ERROR_CODE){\n //get the error message\n gameBoard.toConsole(in.readUTF());\n }\n \n }\n catch(UnknownHostException e) {\n gameBoard.toConsole(e.toString());\n }\n catch(IOException e) {\n System.out.println(e);\n }\n \n return socket;\n }\n \n };\n \n socketWorker.execute();\n \n }", "public interface IClient extends Remote {\n /**\n * Gets called by the server to start game if desired number of player (2,3,4) in registration is achieved\n * @param playerList\n * @param player\n * @throws IClientException\n * @throws RemoteException\n */\n public boolean startGame(ArrayList<RemotePlayer> playerList, RemotePlayer player) throws IClientException, RemoteException;\n\t\n /**\n * Gets called for propagating a move to the other players\n * @param player \n * @param prisoner\n * @param roworCol\n * @param row\n * @param col\n * @throws IClientException\n * @throws RemoteException\n */\n public boolean doMoveRemote(Player player, Prisoner prisoner, int rowOrCol, int row, int col) throws IClientException, RemoteException;\n}", "public PlayerServices(){\n playerList = new ArrayList<>();\n }", "public void inizializeMultiplayer() {\r\n\t\t\r\n\t\tthis.client = new Client(); //inzializzo connessione con il server\r\n\t\tmultiplayerPanel = new MultiplayerPanel(this);\r\n\t\tm.setVisible(false);\r\n\t\tgameFrame.add(multiplayerPanel);\r\n\t\tgameFrame.pack();\r\n\t\tgameFrame.setVisible(true);\r\n\t\tgameFrame.repaint();\r\n\t}", "private void addClient () {\n ArrayList<String> info = loadOnePlayerInfo();\n Ntotal++;\n Nnow++;\n\n System.out.println(\"Vai ser inicializado o utilizador \" + info.get(0));\n initThread(info.get(0), info.get(1));\n }", "public void initMultiPlayer() {\r\n\t\tnew ConnectThread().start();\r\n\t}", "public GameClient() {\r\n super(new Client(Config.WRITE_BUFFER_SIZE, Config.OBJECT_BUFFER_SIZE), null, null);\r\n }", "public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }", "public void startserver()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tSocket clientsocket = serversocket.accept();\r\n\t\t\t\tif(clientsocket.isConnected())\r\n\t\t\t\t{\r\n\t\t\t\t\tDataOutputStream wdata = new DataOutputStream(clientsocket.getOutputStream());\r\n\t\t\t\t\tDataInputStream rdata = new DataInputStream(clientsocket.getInputStream());\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t// read message from client and add new player\r\n\t\t\t\t\tJsonObject newplayrejson = gson.fromJson(rdata.readUTF(), JsonObject.class);\r\n\t\t\t\t\tint mode = newplayrejson.get(\"mode\").getAsInt();\r\n\t\t\t\t\tclientaddresslist.get(mode).add(clientsocket.getInetAddress());\r\n\t\t\t\t\tString profession = newplayrejson.get(\"profession\").getAsString();\r\n\t\t\t\t\tString teamname;\r\n\t\t\t\t\tif(mode == 0)\r\n\t\t\t\t\t\tteamname = \"deathMatch\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(teamcount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tteamname = \"teamBlue\";\r\n\t\t\t\t\t\t\tif(king[0] == -1)\r\n\t\t\t\t\t\t\t\tking[0] = idcount[mode];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tteamname = \"teamRed\";\r\n\t\t\t\t\t\t\tif(king[1] == -1)\r\n\t\t\t\t\t\t\t\tking[1] = idcount[mode];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tteamcount = !teamcount;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcdc.collideObjectManager[mode].addCharacter(collideObjecctClass.valueOf(profession), idcount[mode], randposition(), newplayrejson.get(\"name\").getAsString(), TeamName.valueOf(teamname));\r\n\t\t\t\t\tclientidlist.get(mode).add(idcount[mode]);\r\n\t\t\t\t\t++idcount[mode];\r\n\t\t\t\t\t++playercount[mode];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// sending collideobject list to client\r\n\t\t\t\t\twdata.writeInt(idcount[mode] - 1);\r\n\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tfor(CollideObject object : cdc.collideObjectManager[mode].collideObjectList)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twdata.writeUTF(object.getClass().getName());\r\n\t\t\t\t\t\twdata.writeUTF(gson.toJson(object));\r\n\t\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\twdata.writeUTF(\"done\");\r\n\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// send king id if mode is kingkill\r\n\t\t\t\t\tif(mode == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twdata.writeInt(king[0]);\r\n\t\t\t\t\t\twdata.writeInt(king[1]);\r\n\t\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tThread thread = new Thread(new clientmanager(clientsocket , this , mode));\r\n\t\t\t\t\tthread.start();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void connect()\n {\n System.out.println(\"CLIENT partito in esecuzione\");\n try\n {\n //Initialize socket variables and json formatter\n socket = new Socket(serverIP, serverPort);\n outputStream = new DataOutputStream(socket.getOutputStream());\n inputStream = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n gson = new Gson();\n \n receiverThread = new ClientReceiver(this);\n } \n catch (UnknownHostException e)\n {\n System.out.println(e.getMessage());\n System.out.println(\"Host sconosciuto\");\n System.exit(1);\n }\n catch (ConnectException e)\n {\n System.out.println(e.getMessage());\n System.out.println(\"Non c'è posto per te, mi spiace\");\n System.exit(1);\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "public static void main( String[] args )\n { \n \t\n \t\n \tString endPoint;\n \tif (args[0].equals(\"H\"))\n \t{\n \t\tplayer = new Hunter(timetoWall,maxWalls);\n \t endPoint = hunterEndpoint;}\n \t\n \telse\n \t{\n \t\tplayer= new Prey();\n \t\t endPoint = preyEndpoint;}\n \t\n \ttimetoWall = Integer.parseInt(args[1]);\n \tmaxWalls = Integer.parseInt(args[2]);\n\t\tSession session;\n try {\n messageLatch = new CountDownLatch(100);\n\n final ClientEndpointConfig cec = ClientEndpointConfig.Builder.create().build();\n\n ClientManager client = ClientManager.createClient();\n ClientManager client2 = ClientManager.createClient();\n \n Endpoint playersocket = new Endpoint() {\n\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onOpen(Session session, EndpointConfig arg1) {\n\t\t\t\t//\ttry {\n session.addMessageHandler(new MessageHandler.Whole<String>() {\n public void onMessage(String message) {\n System.out.println(\"Received message: \"+message);\n process(message);\n \n messageLatch.countDown();\n }\n });\n\n// }\n\t\t\t\t\t\n\t\t\t\t}\n };\n \n \n Endpoint publisher = new Endpoint() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onOpen(Session session, EndpointConfig arg1) {\n\t\t\t\t//\ttry {\n session.addMessageHandler(new MessageHandler.Whole<String>() {\n public void onMessage(String message) {\n System.out.println(\"Received message: \"+message);\n //System.out.println(\"Prey.java pos:\" + getpreypos(message));\n messageLatch.countDown();\n }\n });\n // SENT_MESSAGE = getPositionsCommand();\n // session.getBasicRemote().sendText(SENT_MESSAGE);\n // SENT_MESSAGE = getWallsCommand();\n // session.getBasicRemote().sendText(SENT_MESSAGE);\n // } catch (IOException e) {\n // e.printStackTrace();\n // }\n\n\t\t\t\t}\n };\n\n \n \t session= client.connectToServer(playersocket, cec, new URI(endPoint));\n \n\n\n client2.connectToServer(publisher, cec, new URI(publisherEndpoint));\n messageLatch.await(100, TimeUnit.SECONDS);\n\n\n\t\t\twhile (true)\n\t\t\t{\n\t\t\t\tSENT_MESSAGE = getPositionsCommand();\n\t\t\t\ttry {\n\t\t\t\t\tsession.getBasicRemote().sendText(SENT_MESSAGE);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tSENT_MESSAGE = player. makeMove(hunterPos,preyPos);\n\t\t\t\ttry {\n\t\t\t\t\tsession.getBasicRemote().sendText(SENT_MESSAGE);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n \n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n\n\n \n }", "ClientThread(Server server, Socket socket) {\n // a unique id\n id = ++uniqueId;\n this.socket = socket;\n //Creating both Data Stream\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\n try {\n\n sOutput = new DataOutputStream(socket.getOutputStream());\n sInput = new DataInputStream(socket.getInputStream());\n // read the username\n username = sInput.readUTF();\n\n for(ClientThread clientThread : clientThreads){\n if(username.equals(clientThread.getUsername())){\n username = username +\n uniqueId +\n uniqueId / 2 +\n uniqueId * 3;\n }\n }\n\n\n/*\n for(int i = 0 ; i < clientThreads.size() ; i++){\n if(username.equals(clientThreads.get(i).getUsername())){\n writeMsg(\"choose another username: \");\n username = sInput.readUTF();\n i = 0;\n }\n }\n\n */\n\n\n\n server.broadcast(notification + username + \" has joined the chat room.\" + notification, getClientThreads());\n } catch (IOException e) {\n server.display(\"Exception creating new Input/output Streams: \" + e);\n return;\n }\n date = new Date().toString() + \"\\n\";\n }", "public Multi_Player()\r\n {\r\n \r\n }", "public interface IClient {\n\n public void onLogin(String authToken, String username);\n\n public void onRegister(String authToken, String username);\n\n public void displayError(String message);\n\n void claimedRoute(Integer player, String routeID);\n\n public void promptRenewSession();\n\n public void onCreateGame(Game game);\n\n public void onJoinGame(Game game);\n\n public void onLeaveGame();\n\n public void onGameStarted();\n\n public void onGetServerGameList(Game[] games);\n\n public void addGametoList(Game game);\n\n public void removeGameFromList(String gameID);\n\n public void updateGame(Game game);\n\n public void receiveMessage(GameHistory gameHistory);\n\n public void drawTrainCards(Integer player, Integer numCards, TrainCard[] cards, Integer deckSize);\n\n public void discardTrainCards(Integer player, Integer numCards, int[] pos, Integer deckSize);\n\n public void drawDestCards(Integer player, Integer numCards, DestinationCard[] cards, Integer deckSize);\n\n public void discardDestCards(Integer player, Integer numCards, int[] pos, Integer deckSize);\n\n public void swapFaceUpCards(int[] pos, TrainCard[] cards, Integer deckSize);\n\n public void onGameEnded();\n\n public void setTurn(Integer player);\n\n public void setLastTurn();\n\n public void updateAllPlayerFinalPoints(FinalGamePoints[] allFinalPoints);\n\n void promptRestoreGame(Game game);\n}", "public void gameSetupMultiplayer() {\r\n\t\t\r\n\t\tmultiplayerScreen = new MultiplayerScreen(this, playerNumber, playerIndex ); \r\n\t\t\r\n\t\t// creo giocatore\r\n\t\tfor (int i=0; i<playerNumber; i++) {\r\n\t\t\tplayers.add(new Player());\r\n\r\n\t\t}\t\r\n\t\tmultiplayerScreen.addPlayers(players); //creazione schermo di gioco multiplayer\r\n\t\t\r\n\t\tmultiplayerScreen.setMusic(music);\r\n\t\t\r\n\t\tmultiplayerScreen.setLevel(level);\r\n\t\t\r\n\t\tclient.startThread(multiplayerScreen);\r\n\t\t\r\n\t\tgameFrame.add(multiplayerScreen);\r\n\t\tgameFrame.requestFocusInWindow();\r\n\r\n\t\t// aggiungo controllo da tastiera\r\n\t\tgameFrame.addKeyListener(players.get(playerIndex).getInputHandler());\r\n\t\tgameFrame.pack();\r\n\t\tgameFrame.setVisible(true);\r\n\t\t\t\t\r\n\t\t// avvio ciclo di gioco\r\n\t\tnew Thread(multiplayerScreen).start();\r\n\t\tmultiplayerScreen.setVisible(true);\r\n\t}", "public void init() {\n\t\ttry {\n\t\t\tthis.is = new ObjectInputStream(clientSocket.getInputStream());\n\t\t\tthis.os = new ObjectOutputStream(clientSocket.getOutputStream());\n\t\t\twhile (this.readCommand()) {}\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic Player getClient() {\n\t\treturn client;\n\t}", "private JavashipsServer() {\n\t\ttry {\n\t\t\tServerSocket server = new ServerSocket(PORT);\n\n\t\t\tSystem.out.println(new Date().toString() + \" - Now accepting clients.\");\n\n\t\t\t/* Listen for connecting players */\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.println(\"Waiting for 2 players to connect.\");\n\n\t\t\t\t/* Intercept the first player. */\n\t\t\t\tPlayer player1 = new Player(server.accept(), \"Player 1\");\n\t\t\t\tSystem.out.println(new Date().toString() +\n\t\t\t\t\t\t\" - First player has been found: \" +\n\t\t\t\t\t\tplayer1.playerSocket.getInetAddress().getHostAddress() +\n\t\t\t\t\t\t\"/\" +\n\t\t\t\t\t\tplayer1.playerSocket.getPort());\n\n\t\t\t\tplayer1.setFirstAttacker();\n\n\t\t\t\t/* Intercept the second player. */\n\t\t\t\tPlayer player2 = new Player(server.accept(), \"Player 2\");\n\t\t\t\tSystem.out.println(new Date().toString() +\n\t\t\t\t\t\t\" - Second player has been found: \" +\n\t\t\t\t\t\tplayer2.playerSocket.getInetAddress().getHostAddress() +\n\t\t\t\t\t\t\"/\" +\n\t\t\t\t\t\tplayer2.playerSocket.getPort());\n\n\t\t\t\t/* Let the players know who to talk to when talking to their opponent. */\n\t\t\t\tplayer1.setOpponent(player2);\n\t\t\t\tplayer2.setOpponent(player1);\n\n\t\t\t\tplayer1.start();\n\t\t\t\tplayer2.start();\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run(){\r\n boolean nameGet = false;\r\n try{\r\n ObjectInputStream ois = new ObjectInputStream(mySocket.getInputStream());\r\n oos = new ObjectOutputStream(mySocket.getOutputStream());\r\n\r\n //Listen for messages and RollRequest objects.\r\n while(true){\r\n DataWrapper dw = (DataWrapper) ois.readObject();\r\n //Get the name from the InputStream if not retrieved already\r\n if(!nameGet){\r\n //Store the client's first message, which is always in the format \"<name> connected.\"\r\n String line = \"\";\r\n if(dw.getType() == DataWrapper.STRINGCODE){\r\n line = dw.getMessage();\r\n }\r\n consoleAppend(line);\r\n\r\n /*\r\n * Extract the alias from the String by getting the substring from 0 to the last index of whitespace,\r\n * effectively removing the \" connected.\" part of the String.\r\n */\r\n String alias = line.substring(0, line.lastIndexOf(\" \"));\r\n\r\n //Disconnect the client if the name is already in use\r\n if(getIndex(alias) != -1){\r\n oos.writeObject(\r\n new DataWrapper(\r\n DataWrapper.STRINGCODE, \"Sorry, that name is in use. Disconnecting..\", false));\r\n oos.flush();\r\n mySocket.close();\r\n }\r\n\r\n this.setName(alias);\r\n turnQueue.add(alias);\r\n nameGet = true;\r\n\r\n //If the first client\r\n if(clientThreads.get(0) == this) {\r\n //send the boardLayout for them to unpack\r\n oos.writeObject(new DataWrapper(DataWrapper.BICODE, boardLayout));\r\n }\r\n //If not the first client\r\n if(clientThreads.get(0) != this) {\r\n //request a board from the first client and wait until the updated board is received\r\n requestBoard();\r\n synchronized (waitForBoardLock) {\r\n while (!boardUpdated) {\r\n// System.out.println(\"Thread \" + this.getName() + \" waiting\");\r\n waitForBoardLock.wait();\r\n }\r\n }\r\n oos.writeObject(new DataWrapper(DataWrapper.BICODE, boardLayout));\r\n boardUpdated = false;\r\n }\r\n\r\n //Instruct all clients to add the new player\r\n sendCTToAll(new ControlToken(ControlToken.ADDCODE, alias, rand.nextInt(8)));\r\n\r\n }\r\n //Handle DataWrapper objects\r\n switch(dw.getType()){\r\n //Ensure all clients see each others' messages\r\n case DataWrapper.STRINGCODE:\r\n //Send incoming client chat messages to all clients, and append sender name\r\n String fmtMessage = String.format(\"%s: %s\", this.getName(), dw.getMessage());\r\n sendToAll(fmtMessage);\r\n consoleAppend(fmtMessage);\r\n break;\r\n\r\n //Receive updated board information from the first client in the client list\r\n case DataWrapper.BICODE:\r\n boardLayout = dw.getBoardInformation();\r\n System.out.println(\"Received an updated BoardInformation.\");\r\n System.out.println(boardLayout.toString());\r\n synchronized(waitForBoardLock){\r\n boardUpdated = true;\r\n waitForBoardLock.notify();\r\n// System.out.println(\"Thread \" + this.getName() + \" notified because of receiving a BoardInformation.\");\r\n }\r\n break;\r\n\r\n //Handle ControlToken objects\r\n case DataWrapper.CTCODE:\r\n //Client informs server that they are finished with their turn\r\n if(dw.getCT().getCode() == ControlToken.TURNFINISHEDCODE){\r\n synchronized(turnFinishedLock) {\r\n turnFinished = true;\r\n turnFinishedLock.notify();\r\n }\r\n// System.out.println(\"Thread \" + this.getName() + \" notified because of receiving a turnFinished.\");\r\n }\r\n //Client asks to roll the dice, Server returns a random value from 1-6\r\n if(dw.getCT().getCode() == ControlToken.ROLLREQUESTCODE) {\r\n //Generate the roll result\r\n int rolledResult = rollResult();\r\n //Send it as a game message to all clients\r\n String rolledResultString = String.format(\"%s rolled a %d!\",\r\n dw.getCT().getPlayerName(), rolledResult);\r\n sendGMToAll(rolledResultString);\r\n //Instruct the clients to move the player on all boards\r\n sendCTToAll(new ControlToken(ControlToken.MOVECODE, this.getName(), rolledResult, true));\r\n }\r\n break;\r\n\r\n //Default case\r\n default:\r\n consoleAppend(\"Error: invalid DataWrapper.type\");\r\n break;\r\n } //end of switch statement\r\n } //end of while loop\r\n } catch(ClassNotFoundException cnfe) {\r\n System.err.println(\"Error: class not found \" + cnfe.getMessage());\r\n } catch(SocketException | EOFException se) {\r\n handleDisconnect();\r\n } catch(IOException ioe) {\r\n ioe.printStackTrace();\r\n } catch (InterruptedException ioe) {\r\n ioe.printStackTrace();\r\n }\r\n }", "void addListeners() {\n\n loginButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n // TODO add loading bar\n String name = loginNameBox.getText();\n\n if (name.contains(\"Enter\")) {\n name = \"n00b\";\n }\n\n if(name.contains(\" \")){\n name = name.replace(' ','_');\n }\n try {\n loginBar.setVisible(true);\n //TODO add loading thread\n\n client = new Client(name);\n\n frame.setTitle(\"Player \" + client.getId() + \": (\" + client.getName() + \")\");\n frame.loginScreen.setVisible(false);\n frame.menuScreen.setVisible(true);\n\n updateThread = new Thread(new Runnable() { // TODO thread to update game state\n @Override\n public void run() {\n try {\n while (true) {\n frame.updateState();\n Thread.sleep(1000);\n }\n } catch (Exception e) {\n // e.printStackTrace();\n }\n }\n });\n\n String[] playerBall = client.whoIsBall();\n frame.ballState(false, playerBall[0]);\n updateThread.start();\n } catch (Exception error) {\n JOptionPane.showMessageDialog(null, error.getMessage());\n }\n\n }\n });\n\n loginNameBox.addKeyListener(new KeyAdapter() {\n @Override\n public void keyPressed(KeyEvent k) {\n if (loginNameBox.getText().contains(\"Enter\")) {\n loginNameBox.setText(\"\");\n }\n }\n });\n\n menuThrowButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n client.throwToPlayer(menuPlayersComboBox.getSelectedItem().toString());\n }\n });\n\n menuRefreshButton.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n updateComboBox();\n }\n\n });\n\n this.addWindowListener(new WindowAdapter() { // Executes when window is closed\n public void windowClosing(WindowEvent e) {\n // closes client connection if window closed\n try {\n if (updateThread.isAlive()) {\n updateThread.interrupt();\n }\n } catch (Exception ex) {\n }\n\n try {\n client.close();\n } catch (Exception ex) {\n }\n\n System.out.println(\"Goodbye\");\n }\n });\n }", "public Chess(String inTitle, int client)\n {\n super(inTitle);\n setLayout(new FlowLayout());\n\n // The panel for the chess board\n JPanel board = new JPanel(new GridLayout(ROWS + 2, COLUMNS));\n int row, col;\n player = client;\n // If it is the red client\n if (client == 1)\n {\n other = 2;\n playerURL = getClass().getResource(\"/images/red.jpg\");\n otherURL = getClass().getResource(\"/images/yellow.jpg\");\n // Construct 2 sockets for the red client\n theClient = new ClientServerSocket(\"127.0.0.1\", 45000);\n theClientChat = new ClientServerSocket(\"127.0.0.1\", 45001);\n out.println(\"Red Clinent connected.\");\n }\n // If it is the yellow client\n else\n {\n other = 1;\n playerURL = getClass().getResource(\"/images/yellow.jpg\");\n otherURL = getClass().getResource(\"/images/red.jpg\");\n // Construct 2 sockets for the yellow client\n theClient = new ClientServerSocket(\"127.0.0.1\", 45002);\n theClientChat = new ClientServerSocket(\"127.0.0.1\", 45003);\n out.println(\"Yellow Clinent connected.\");\n }\n // Start the client\n theClient.startClient();// Start the client\n theClientChat.startClient();\n\n // Initialize the chess board to empty, 0\n for (row = 0; row < ROWS; row++ )\n {\n for (col = 0; col < COLUMNS; col++ )\n {\n chessBoard[row][col] = 0;\n }\n }\n\n // Add \"Drop\" Buttons and add listeners on them\n for (col = 0; col < COLUMNS; col++ )\n {\n drop[col] = new JButton(\"Drop\");\n drop[col].addActionListener(putChess);\n board.add(drop[col]);\n }\n\n // Add labels for arrows\n for (col = 0; col < COLUMNS; col++ )\n {\n arrow[col] = new JLabel(new ImageIcon(arrURL));\n board.add(arrow[col]);\n }\n\n // Add pictures on grids, and initialize the chess board to empty\n for (row = 0; row < ROWS; row++ )\n {\n for (col = 0; col < COLUMNS; col++ )\n {\n grid[row][col] = new JLabel(new ImageIcon(imgURL));\n board.add(grid[row][col]);\n }\n }\n // Add the panel\n add(board);\n\n // The panel for the player chat\n JPanel chat = new JPanel(new BorderLayout());\n // Add the text area\n chat.add(record, BorderLayout.NORTH);\n // The panel for the text field and the button\n JPanel send = new JPanel(new FlowLayout());\n // Add the text field\n send.add(dialog);\n // Add action listener to the send button\n sendButton.addActionListener(playerChat);\n // add the button\n send.add(sendButton);\n // Add the panel\n chat.add(send, BorderLayout.SOUTH);\n // Add the panel\n add(chat);\n }", "public static void main(String[] args) {\n \n try {\n boolean useGUI = false;\n int i = -1;\n\n // Parse options. Add additional options here if you have to. Do not\n // forget to mention their usage in the help-string!\n while(args[++i].startsWith(\"-\")) {\n if(args[i].toLowerCase().equals(\"-help\")) {\n System.out.println(USAGE + String.format(\"%n%nwhere options include:\", args));\n System.out.println(\" -help Show this text.\");\n System.out.println(\" -gui Show a graphical user interface.\");\n System.exit(0);\n }\n else if(args[i].toLowerCase().equals(\"-gui\")) {\n useGUI = true;\n }\n }\n \n String mode = args[i++];\n String connectionType = args[i++];\n\n if(mode.toLowerCase().equals(\"server\"))\n {\n int port = Integer.parseInt(args[i++]);\n \n // Start server\n if(connectionType.toLowerCase().equals(\"tcp\"))\n {\n try\n {\n Player player = new Player();\n Server server = new ConnectionServerTCP(port, player);\n \n Thread cs = new Thread(server);\n cs.start();\n Log.log(\"Main: Starting Thread ConnectionServer (\"+cs.getName()+\")\");\n \n cs.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"udp\"))\n {\n try\n {\n Player player = new Player();\n Server server = new ConnectionServerTCP(port, player);\n \n Thread cs = new Thread(server);\n cs.start();\n Log.log(\"Main: Starting Thread ConnectionServer (\"+cs.getName()+\")\");\n \n cs.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"mc\"))\n {\n try\n {\n Player player = new Player();\n Server server = new ConnectionServerMC(port, player);\n \n Thread cs = new Thread(server);\n cs.start();\n Log.log(\"Main: Starting Thread ConnectionServer (\"+cs.getName()+\")\");\n \n cs.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n }\n }\n else if(mode.toLowerCase().equals(\"client\"))\n {\n String host = args[i++];\n int port = Integer.parseInt(args[i++]);\n String username = args[i++];\n \n // Start client\n if(connectionType.toLowerCase().equals(\"tcp\"))\n {\n try\n {\n ClientGUI gui = new ClientGUI();\n RadioClientTCP client = new RadioClientTCP(gui);\n gui.setContext(client);\n \n Thread rc = new Thread(client);\n new Thread(gui).start();\n rc.start();\n Log.log(\"Main: Starting Thread RadioClient (\"+rc.getName()+\")\");\n \n //client.connect(new InetSocketAddress(host, port));\n \n rc.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"udp\"))\n {\n try\n {\n ClientGUI gui = new ClientGUI();\n RadioClientUDP client = new RadioClientUDP(gui);\n gui.setContext(client);\n \n Thread rc = new Thread(client);\n new Thread(gui).start();\n rc.start();\n Log.log(\"Main: Starting Thread RadioClient (\"+rc.getName()+\")\");\n \n //client.connect(new InetSocketAddress(host, port));\n \n rc.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n } else if(connectionType.toLowerCase().equals(\"mc\"))\n {\n try\n {\n ClientGUI gui = new ClientGUI();\n RadioClientMC client = new RadioClientMC(gui);\n gui.setContext(client);\n \n Thread rc = new Thread(client);\n new Thread(gui).start();\n rc.start();\n Log.log(\"Main: Starting Thread RadioClient (\"+rc.getName()+\")\");\n \n //client.connect(new InetSocketAddress(host, port));\n \n rc.join();\n \n Log.notice(\"Main: shuting down\");\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n }\n \n else\n throw new IllegalArgumentException(\"Illegal connection method\");\n }\n else\n throw new IllegalArgumentException(\"Illegal program mode\");\n }\n catch(ArrayIndexOutOfBoundsException e) {\n System.err.println(USAGE);\n }\n catch(NumberFormatException e) {\n System.err.println(USAGE);\n }\n catch(IllegalArgumentException e) {\n System.err.println(USAGE);\n }\n }", "public ServeurGestion(int portClient){\r\n try {\r\n ecoute=new ServerSocket(portClient);\r\n appels=new Vector<>();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ServeurGestion.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void getPlayerList() {\n if (connected == true) {\n try {\n write(\"get playerlist\");\n } catch (IOException e) {\n System.out.println(\"No connecting with server:ServerCommunication:getPlayerList()\");\n }\n }\n }", "public void connect() {\n try {\n socket = new Socket(serverAddress, serverPort);\n outputStream = new ObjectOutputStream(socket.getOutputStream());\n inputStream = new ObjectInputStream(socket.getInputStream());\n //A thread which will constantly listen for updates from the server and forward them to Client\n new Thread(() -> {\n while (socket.isConnected()) {\n try {\n Renderable message = (Renderable) inputStream.readObject();\n if(message != null) {\n //logger.info(\"Received \" + message.getClass().getSimpleName() + \" from server.\");\n renderablePublisher.submit(message);\n }\n } catch (IOException | ClassNotFoundException e) {\n renderablePublisher.submit(new ServerOfflineUpdate());\n break;\n }\n }\n }).start();\n } catch (IOException e) {\n renderablePublisher.submit(new ServerOfflineUpdate());\n }\n }", "@Override\n\tpublic void run() \n\t{\n\t\tcommunicator = com.zeroc.Ice.Util.initialize();\n GameServerPrx clientPrx = GameServerPrx.checkedCast(\n communicator.stringToProxy(\"client:default -h 58.167.142.74 -p 10002\")).ice_twoway().ice_secure(false).ice_collocationOptimized(false).ice_compress(true);\n\n if(clientPrx == null)\n {\n //If connection is failed due to server problems\n System.err.println(\"SB Connect: \" + \"Invalid proxy\");\n return;\n }\n System.out.println(\"SB Connect: \" + \"Connected\");\n Server server = new Server();\n server.address = ServerInfo.ADDRESS;\n server.UUID = ServerInfo.UUID;\n server.port = ServerInfo.PORT;\n server.name = ServerInfo.NAME;\n server.players = (short) players;\n\t\tclientPrx.sendServerDetails(server);\n\t\tSystem.out.println(\"SB Connect: \" + \"Data sent\");\n\t}", "public ClientMenu(String host, int port, Client c) {\n\n\t\tsuper(\"Chat Client\");\n\t\tdefaultPort = port;\n\t\tdefaultHost = host;\n\t\tclient = c;\n\n\t\t// The NorthPanel with:\n\t\tJPanel northPanel = new JPanel(new GridLayout(3, 1));\n\t\t// the server name and the port number\n\t\tJPanel serverAndPort = new JPanel(new GridLayout(1, 5, 1, 3));\n\t\t// the two JTextField with default value for server address and port number\n\t\ttfServer = new JTextField(host);\n\t\ttfPort = new JTextField(\"\" + port);\n\t\ttfPort.setHorizontalAlignment(SwingConstants.RIGHT);\n\n\t\tserverAndPort.add(new JLabel(\"Server Address: \"));\n\t\tserverAndPort.add(tfServer);\n\t\tserverAndPort.add(new JLabel(\"Port Number: \"));\n\t\tserverAndPort.add(tfPort);\n\t\t// serverAndPort.add(new JLabel(\"\"));\n\t\t// adds the Server an port field to the GUI\n\t\t// northPanel.add(serverAndPort);\n\n\t\t// the Label and the TextField\n\t\tlabel = new JLabel(\"Username:\", SwingConstants.CENTER);\n\t\tserverAndPort.add(label);\n\t\tun = new JTextField(\"Anonymous\");\n\t\ttf = new JTextField(\"\");\n\t\ttf.setBackground(Color.WHITE);\n\t\tun.setBackground(Color.WHITE);\n\t\tserverAndPort.add(un);\n\t\tnorthPanel.add(serverAndPort);\n\n\t\tadd(northPanel, BorderLayout.NORTH);\n\n\t\t// The CenterPanel which is the chat room\n\t\tta = new JTextArea(\"Welcome to the Chat room\\n\", 80, 80);\n\t\tJPanel centerPanel = new JPanel(new GridLayout(1, 1));\n\t\tcenterPanel.add(new JScrollPane(ta));\n\t\tta.setEditable(false);\n\t\tadd(centerPanel, BorderLayout.CENTER);\n\n\t\t// the 3 buttons\n\t\tlogin = new JButton(\"Connect\");\n\t\tlogin.setActionCommand(\"Connect\");\n\t\tlogin.addActionListener(this);\n\t\tsend = new JButton(\"Send\");\n\t\tsend.setActionCommand(\"Send\");\n\t\tsend.addActionListener(this);\n\t\t// logout = new JButton(\"Logout\");\n\t\t// logout.addActionListener(this);\n\t\t// logout.setEnabled(false); // you have to login before being able to logout\n\n\t\tJPanel southPanel = new JPanel(new GridLayout(1, 3, 5, 5));\n\t\tserverAndPort.add(login);\n\t\t// southPanel.add(logout);\n\t\tsouthPanel.add(tf);\n\t\tsouthPanel.add(send);\n\t\tadd(southPanel, BorderLayout.SOUTH);\n\n\t\tuserListModel = new DefaultListModel<String>();\n\t\tuserList = new JList<String>(userListModel);\n\t\tuserList.setPreferredSize(new Dimension(100, 400));\n\t\tuserList.addListSelectionListener(this);\n\t\tusers_label = new JLabel(\"Users:\");\n\n\t\tJPanel eastPanel = new JPanel();\n\t\teastPanel.setPreferredSize(new Dimension(100, 50));\n\t\tusers_label.setPreferredSize(new Dimension(100, 20));\n\t\teastPanel.add(users_label);\n\t\teastPanel.add(userList);\n\t\tadd(eastPanel, BorderLayout.EAST);\n\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\t\tsetSize(600, 600);\n\t\tsetVisible(true);\n\t\ttf.requestFocus();\n\n\t}", "public Client() {\n // Naming the client window Player\n super(\"Player\");\n\n // Setting up the textField. Must press enter to start the game.\n textField = new JTextField(\"Please press enter to start...\");\n\n // Adding the ActionListener\n textField.addActionListener(\n event -> {\n try // create and send packet\n {\n // get message from textfield\n String message = event.getActionCommand();\n\n // convert to bytes\n byte[] data = message.getBytes();\n\n // create sendPacket\n DatagramPacket sendPacket = new DatagramPacket(data,\n data.length, InetAddress.getLocalHost(), 5000);\n\n // sending packet to Server\n socket.send(sendPacket);\n\n // Displaying the message in \"Player: Message\" Format\n displayArea.setCaretPosition(\n displayArea.getText().length());\n } catch (IOException ioException) {\n displayMessage(ioException + \"\\n\");\n ioException.printStackTrace();\n }\n }\n );\n add(textField, BorderLayout.NORTH);\n\n // Creating and Adding the Display Area text box.\n displayArea = new JTextArea();\n add(new JScrollPane(displayArea), BorderLayout.CENTER);\n\n // Making the Window for Client\n setSize(400, 300); // set window size\n setVisible(true); // show window\n\n try // create DatagramSocket for sending and receiving packets\n {\n socket = new DatagramSocket();\n } catch (SocketException socketException) {\n socketException.printStackTrace();\n System.exit(1);\n }\n }", "public void connectToServerComp() {\n\n\t\ttry \n\t\t{\n\t\t\tSocket socket = new Socket(host, 8001);\n\t\t\tfromServer = new DataInputStream(socket.getInputStream());\n\t\t\ttoServer = new DataOutputStream(socket.getOutputStream());\n\n\t\t\ttoServer.writeInt(vsCOMPUTER);\n\n\t\t} catch (IOException ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t}\n\n\t\tThread thread = new Thread(new clientHandlingComputer(fromServer, toServer));\n\t\tthread.start();\n\n\t}", "public RemotePlayerServer(Player p) {\n this.localPlayer = p;\n }", "public void run() throws IOException {\n @SuppressWarnings(\"resource\")\n //Listens for a connection on the port number.\n ServerSocket s0 = new ServerSocket(PORT_NUMBER);\n Socket s = s0.accept();\n\n //Sets up the buffers to read and to write on the socket.\n BufferedReader r = new BufferedReader(new InputStreamReader(\n s.getInputStream(), StandardCharsets.UTF_8));\n BufferedWriter w = new BufferedWriter(new OutputStreamWriter(\n s.getOutputStream(), StandardCharsets.UTF_8));\n \n \n String command;\n\n //Reads the commands wrote on the socket line per line\n while ((command = r.readLine()) != null) {\n String[] msg = split(' ', command);\n\n switch (JassCommand.valueOf(msg[COMMAND_INDEX])) {\n\n case PLRS:\n \n //Creates the players map with the arguments and calls the setPlayers function of the underlyingPlayer.\n Map<PlayerId, String> players = new HashMap<>();\n for (int i = 0; i < PlayerId.COUNT; i++) {\n players.put(PlayerId.ALL.get(i),\n deserializeString(split(',', msg[ARG_2_INDEX])[i]));\n }\n localPlayer.setPlayers(PlayerId.ALL.get(deserializeInt(msg[ARG_1_INDEX])),\n players);\n break;\n\n case CARD:\n \n //Calls the cardToPlay function of the underlying function with the arguments of the message.\n String[] st = split(',', msg[ARG_1_INDEX]);\n TurnState state = TurnState.ofPackedComponents(\n deserializeLong(st[ARG_0_INDEX]), deserializeLong(st[ARG_1_INDEX]),\n deserializeInt(st[ARG_2_INDEX]));\n Card c = localPlayer.cardToPlay(state,\n CardSet.ofPacked(deserializeLong(msg[ARG_2_INDEX])));\n w.write(serializeInt(c.packed()));\n w.newLine();\n w.flush();\n break;\n\n case HAND: \n localPlayer\n .updateHand(CardSet.ofPacked(deserializeLong(msg[ARG_1_INDEX])));\n break;\n\n case TRMP:\n localPlayer.setTrump(Color.ALL.get(deserializeInt(msg[ARG_1_INDEX])));\n break;\n\n case SCOR:\n localPlayer\n .updateScore(Score.ofPacked(deserializeLong(msg[ARG_1_INDEX])));\n break;\n\n case TRCK:\n localPlayer.updateTrick(Trick.ofPacked(deserializeInt(msg[ARG_1_INDEX])));\n break;\n\n case WINR:\n localPlayer\n .setWinningTeam(TeamId.ALL.get(deserializeInt(msg[ARG_1_INDEX])));\n break;\n\n default:\n }\n }\n }", "public ServerConnecter() {\r\n\r\n\t}", "public Client(){\r\n\t\t// ask the user for a host, port, and user name\r\n\t\tString host = JOptionPane.showInputDialog(\"Host address:\");\r\n\t\t\r\n\t\tString port = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\tboolean shouldRepeat = true;\r\n\t\tint portNum = 0;\r\n\t\twhile(shouldRepeat){\r\n\t\t\ttry{\r\n\t\t\tportNum = Integer.parseInt(port);\r\n\t\t\tshouldRepeat = false;\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e){\r\n\t\t\t\tport = JOptionPane.showInputDialog(\"Host port:\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tclientName = JOptionPane.showInputDialog(\"User name:\");\r\n\t\t\r\n\t\tif (host == null || port == null || clientName == null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\ttry{\r\n\t\t\t// Open a connection to the server\r\n\t\t\tserver = new Socket(host, portNum);\r\n\t\t\tout = new ObjectOutputStream(server.getOutputStream());\r\n\t\t\tin = new ObjectInputStream(server.getInputStream());\r\n\t\t\t\r\n\t\t\tout.writeObject(clientName);\r\n\t\t\t\r\n\t\t\tsetupGUI();\r\n\t\t\t\r\n\t\t\t// start a thread for handling server events\r\n\t\t\tnew Thread(new ServerHandler()).start();\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void run() {\n try {\n //clientSocket only writes to MainServer\n //establish the inputStream\n DataInputStream inputFromClient = new DataInputStream(\n clientSocket.getInputStream());\n\n //Instance of Reunion\n ObjectInputStream objectFromClient=new ObjectInputStream(\n clientSocket.getInputStream());\n\n //Questionable\n ObjectOutputStream objectOutputToClient = new ObjectOutputStream(\n clientSocket.getOutputStream());\n\n //get from the client the port that was established for the client server\n String receivedInfo = inputFromClient.readUTF();\n\n //parse the receivedInfo into port number and clientName\n clientName = receivedInfo.split(\":\")[1];\n int portToConnect = Integer.valueOf(receivedInfo.split(\":\")[0]);\n\n System.out.println(\"port: \" +portToConnect + \" Name: \" + clientName);\n\n //create a connection socket to the clientServer\n Socket toCServerSocket = new Socket(\"localhost\",portToConnect);\n\n //create an output stream to the clientServer Socket\n DataOutputStream outputToClient = new DataOutputStream(\n toCServerSocket.getOutputStream());\n\n //store client and socket info into Administrador dictionary\n ArrayList<Socket> holder = new ArrayList<>();\n holder.add(clientSocket);\n holder.add(toCServerSocket);\n //[0] socket that listens to client\n //[1] socket that writes to clientServer\n mServer.Administrador.put(clientName,holder);\n\n //TODO: we need to determine a proper way to handle listening events\n while (true) {\n //String type = inputFromClient.readUTF();\n //outputToClient.writeUTF(type);\n\n Reunion reunionReceived=(Reunion) objectFromClient.readObject();\n\n System.out.println(reunionReceived.toString());\n\n\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "public PlayersHolder() {\n randomRoomPlayers = new LinkedBlockingQueue<>();\n freePlayersRoom = new FreePlayers();\n }", "@Override\n public void run() {\n new Thread(() -> {\n int port = config.getPort();\n try (ServerSocket server = new ServerSocket(port)) {\n List<ClientConnection> clientlist = new ArrayList<>();\n System.out.println(\"Game Server waiting on Port \" + port + \"!\");\n while (true) {\n Socket client = server.accept();\n\n synchronized (clientlist) {\n ClientConnection cc = new ClientConnection(client, playerId);\n int playerNr = (int) (playerId % 2) + 1;\n cc.start();\n\n clientlist.add(cc);\n System.out.println(\"Client \" + playerNr + \" (playerID: \" + playerId + \") accepted!\");\n\n playerId++; // increase playerId;\n if (clientlist.size() == 2) {\n synchronized (games) { // TODO no sync needed?\n Game game = new Game(clientlist);\n game.start();\n games.add(game);\n clientlist.clear(); // wait for two new clients\n }\n }\n }\n }\n\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }).start();\n }", "public BigTwoClient() {\n\t\tgameEndedNicely = false;\n\t\t\n\t\tnumOfPlayers = 4;\n\t\tcurrentIdx = -1;\n\t\t\n\t\tplayerList = new ArrayList<CardGamePlayer>();\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tplayerList.add(new CardGamePlayer());\n\t\t}\n\t\t\n\t\tplayerID = -1;\n\t\tplayerName = (String) JOptionPane.showInputDialog(\"Enter your name: \");\n\t\tif(playerName == null || playerName.trim().isEmpty()) {\n\t\t\tplayerName = \"Guest\";\n\t\t}\n\t\t\n\t\tserverIP = \"127.0.0.1\";\n\t\tserverPort = 2396;\n\t\t\n\t\ttable = new BigTwoTable(this);\n\t\ttable.disable();\n\t\t\n\t\thandsOnTable = new ArrayList<Hand>();\n\t\t\n\t\tmakeConnection();\n\t\ttable.repaint();\n\t}", "public void processConnection() {\n\t\texecutorService.execute(() -> {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t String msg = input.readLine();\n\t \n\t if (msg != null) {\n\t\t if(msg.startsWith(Constants.GAMESTART)) {\t\t\t\t\t// Makes the gameClientUIController if the message\n\t\t \tPlatform.runLater(() -> {\t\t\t\t\t\t\t\t// \"gamestart\" is recived from the gameserver.\n\t\t \t\tint n = Integer.parseInt(msg.substring(10, 11));\t// and sets the connection to the game controller\n\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t \t\t\tFXMLLoader loader = new FXMLLoader();\n\t \t\t\ttry {\n\t\t \t\t\tfor (int i=0; i<Main.gameTabs.getTabs().size(); i++) {\n\t\t \t\t\t\tif (Main.gameTabs.getTabs().get(i).getId().equals(hostName)) {\n\t\t \t\t\t\t\tMain.gameTabs.getTabs().get(i).setContent(\n\t\t \t\t\t\t\t\t\tloader.load(getClass().getResource(\"GameClient.fxml\").openStream()));\n\t\t \t\t\t\t\tgameClientUIController = loader.getController();\n\t\t\t \t\t\t\tgameClientUIController.setConnetion(output, input);\n\t\t\t \t\t\t\tgameClientUIController.setPlayer(n);\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t \t\t\t} catch (IOException e) {\n\t \t\t\t\tMain.LOGGER.log(Level.WARNING, \"Unable to receive message from server\", e);\n\t \t\t\t}\t\n\t\t \t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.GAMENAME)) {\n\t\t\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\t\t\tint n = Integer.parseInt(msg.substring(9, 10));\n\t \t\t\tString tmpNavn = msg.substring(10, msg.length());\n\t \t\t\tgameClientUIController.setPlayerName(n, tmpNavn); \t\t\n\t\t\t\t\t\t\t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.DICEVALUE)) {\n\t\t\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\t\t\tint diceVal = Integer.parseInt(msg.substring(10,11));\n\t \t\t\tint player = Integer.parseInt(msg.substring(11,12));\n\t\t\t \tint pawn = Integer.parseInt(msg.substring(12,13));\n\t\t\t \tgameClientUIController.getDiceValue(diceVal, player, pawn);\n\t\t \t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.DISCONNECT)) {\n\t\t \tPlatform.runLater(() -> {\n\t\t \t\tint player = Integer.parseInt(msg.substring(11,12));\n\t\t \t\tgameClientUIController.setPlayerDisconnect(player);\n\t\t \t});\n\t\t }\n\t\t else if(msg.startsWith(Constants.GAMEOVER)) {\n\t\t\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\t\t\tgameClientUIController.gameover();\t\n\t\t \t});\n\t\t }\n\t\t else if (msg.startsWith(Constants.JOIN)) {\n\t\t \tif (!msg.substring(5).equals(hostName.substring(4))) {\n\t\t \t\tPlatform.runLater(() -> {\n\t\t\t\t \tswitch (caseNr) {\n\t\t\t\t \tcase 1: \t\t\t\t\t\n\t\t\t\t \t\tcreateGameLobbyController.cleanUp(msg.substring(5));\t// Adds the player name to the lobby\n\t\t\t\t \t\tbreak;\n\t\t\t\t \tcase 2: \n\t\t\t\t\t\t\t\t\t\thostGameLobbyController.cleanUp(msg.substring(5));\n\t\t\t\t \t\tbreak;\n\t\t\t\t \tcase 3: \n\t\t\t\t\t\t\t\t\t\tplayerGameLobbyController.cleanUp(msg.substring(5));\t\n\t\t\t\t \t\tbreak;\n\t\t\t\t \tdefault: break;\n\t\t\t\t \t}\n\t\t \t\t});\n\t\t \t}\n\t\t }\n\t\t else if (msg.startsWith(Constants.LEAVEGAME)) {\n\t\t \tPlatform.runLater(() -> {\n\t\t\t \tswitch (caseNr) {\n\t\t\t \tcase 1: \t\t\t\t\t\n\t\t\t \t\tcreateGameLobbyController.cleanRemove(msg.substring(10));\t//removes the player from lobby\n\t\t\t \t\tbreak;\n\t\t\t \tcase 2: \n\t\t\t\t\t\t\t\t\thostGameLobbyController.cleanRemove(msg.substring(10));\n\t\t\t \t\tbreak;\n\t\t\t \tcase 3: \n\t\t\t\t\t\t\t\t\tplayerGameLobbyController.cleanRemove(msg.substring(10));\t\n\t\t\t \t\tbreak;\n\t\t\t \tdefault: break;\n\t\t\t \t}\n\t \t\t});\n\t\t }\n\t\t else if (msg.equals(Constants.QUITGAME)) {\n\t\t \tfor (int i=0; i<Main.gameHandler.size(); i++) {\n\t\t \t\tif (Main.gameHandler.get(i).getHostName().equals(hostName)) {\n\t\t \t\t\tMain.gameHandler.get(i).closeTab();\n\t\t\t\t }\n\t\t \t}\n\t\t }\n\t\t Thread.sleep(250);\n\t } \n\t } catch (IOException ioe) {\n\t \tMain.LOGGER.log(Level.WARNING, \"Unable to receive message from server\", ioe);\n\t } catch (Exception e) {\n\t\t\t\t\tMain.LOGGER.log(Level.WARNING, \"Unable to sleep\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "ClientProcess(Socket socket)\r\n {\r\n\r\n id = IDCounter++;\r\n this.socket = socket;\r\n\r\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\r\n try\r\n {\r\n //set up i/o\r\n out = new ObjectOutputStream(socket.getOutputStream());\r\n in = new ObjectInputStream(socket.getInputStream());\r\n\r\n username = (String) in.readObject();\r\n displayMessage(\"***username + \" + \"JUST CONNECTED***\");\r\n userNames.add(username);\r\n }\r\n catch (IOException e) {\r\n displayMessage(\"Exception creating new Input/output Streams: \" + e);\r\n return;\r\n }\r\n\r\n\r\n catch (ClassNotFoundException e) {\r\n }\r\n\r\n System.out.println(\"complete\");\r\n }", "public Client() {\n initComponents();\n \n Server server = new Server();\n server.start();\n \n }", "public UmiClient() {\r\n\t\tButton b;\r\n\t\tf = new Frame();// to show the window of the entire client info\r\n\t\tp = new Panel();// to show the buttons and the sea\r\n\t\tp.setLayout(new BorderLayout());\r\n\r\n\t\t\r\n\t\tb = new Button(\"up\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"up\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.NORTH);\r\n\r\n\t\tb = new Button(\"left\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"left\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.WEST);\r\n\r\n\t\tb = new Button(\"right\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"right\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.EAST);\r\n\r\n\t\tb = new Button(\"down\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tsendCommand(\"down\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tp.add(b, BorderLayout.SOUTH);\r\n\r\n\t\t// generate the Canvas to show the sea\r\n\t\tc = new Canvas();\r\n\t\tc.setSize(256, 256);// set the size of the sea\r\n\t\t// set the GUI widgets\r\n\t\tp.add(c);\r\n\t\tf.add(p);\r\n\r\n\t\t// add login button on frame f\r\n\t\tb = new Button(\"login\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// press login button...then... \r\n\t\t\t\t// if the server hasn't been set up, then execute the handling part\r\n\t\t\t\tif (server == null)\r\n\t\t\t\t\tlogin();\r\n\t\t\t}\r\n\t\t});\r\n\t\tf.add(b, BorderLayout.NORTH);\r\n\r\n\t\tb = new Button(\"logout\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tlogout();\r\n\t\t\t}\r\n\t\t});\r\n\t\tf.add(b, BorderLayout.SOUTH);\r\n\r\n\t\t// to show frame f\r\n\t\tf.setSize(335, 345);\r\n\t\tf.show();\r\n\t}", "public void run() {\n\t\t\tSystem.out.println(\"Thread running\");\n\t\t\tPackage p;\n\t\t\ttry {\n\t\t\t\t// Waiting for package from the client.\n\t\t\t\twhile ((p = (Package) in.readObject()) != null) {\n\t\t\t\t\tSystem.out.println(\"Get package from \"+name+\": \"+p.getType());\n\t\t\t\t\t/*\t\n\t\t\t\t\t * Handling QUIT package: \n\t\t\t\t\t * call quit() for the player, then break the loop then the run() will end.\n\t\t\t\t\t */\n\t\t\t\t\tif (p.getType().equals(\"QUIT\")) {\n\t\t\t\t\t\tquit();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * Handling REGISTER package:\n\t\t\t\t\t * Record the client's name and add it the waiting list.\n\t\t\t\t\t */\n\t\t\t\t\tif (p.getType().equals(\"REGISTER\")) {\n\t\t\t\t\t\tname = (String) p.getObject();\n\t\t\t\t\t\twaitingPlayers.add(this);\n\t\t\t\t\t\tview.writeLog(\"Player: \" + name + \" is registered and waiting.\");\n\t\t\t\t\t\tview.changeWait(waitingPlayers.size());\t\t\t\t\t\t\n\t\t\t\t\t\tstatusCheck();\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * Handling DRAW package:\n\t\t\t\t\t * Call the cardToOne method to draw and send a card to this player.\n\t\t\t\t\t */\n\t\t\t\t\tif (p.getType().equals(\"DRAW\")) {\n\t\t\t\t\t\tcardToOne(this);\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * Handling PASS package:\n\t\t\t\t\t * Update the passCounter variable and check whether all clients have chosen to pass.\n\t\t\t\t\t */\n\t\t\t\t\tif (p.getType().equals(\"PASS\")) {\n\t\t\t\t\t\tif(dealer == this) {\n\t\t\t\t\t\t\tclearingResult();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpassCounter ++;\n\t\t\t\t\t\tview.writeLog(name + \" stop drawing cards (pass).\");\n\t\t\t\t\t\tif(passCounter >= players.size()-1) {\n\t\t\t\t\t\t\tdealerTurn();\t//If all remaining clients choose to pass, start the dealer's turn.\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * Handling OUT package:\n\t\t\t\t\t * A client sends OUT means he got more than 21 points. Move him from player list to waiting list.\n\t\t\t\t\t */\n\t\t\t\t\tif (p.getType().equals(\"OUT\")) {\n\t\t\t\t\t\tif(dealer == this) {\n\t\t\t\t\t\t\tdealerOut();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tArrayList<ClientThread> delList = new ArrayList<ClientThread>();\n\t\t\t\t\t\tdelList.add(this);\n\t\t\t\t\t\tplayers.removeAll(delList);\n\t\t\t\t\t\twaitingPlayers.add(this);\n\t\t\t\t\t\tview.writeLog(name + \" is OUT of the game.\");\n\t\t\t\t\t\tview.changeInAndWait(players.size(), waitingPlayers.size());\n\t\t\t\t\t\t//Inform the dealer that this player explodes. \n\t\t\t\t\t\tdealer.send(new Package(\"EXPLODE\",name));\n\t\t\t\t\t\tif(players.size() == 1) {\n\t\t\t\t\t\t\tdealer.send(new Package(\"MESSAGE\",\"All other players are out of game. Congrates!\"));\n\t\t\t\t\t\t\tdealer.send(new Package(\"END\",0));\n\t\t\t\t\t\t\tendGame();\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Since the size of player list changed, check again whether all remain players have chosen to pass. \n\t\t\t\t\t\tif(passCounter >= players.size()-1) {\t\n\t\t\t\t\t\t\tdealerTurn();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (SocketException e) {\n\t\t\t\tquit();\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(\"Unrecognized package received.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public TurnoVOClient() {\r\n }", "public LocalClient() {\n\t\tsuper(\"SERVER\", Arrays.asList(new String[] {\"*\"}), null, null);\n\t\tinputThread = new Thread(this);\n\t\tinputThread.start();\n\t}", "public void doInitializationsMulti(JFrame f){\n\t\t\n\t\t//TODO: Hier wird nix gemalt, solange Server und Client aktiv sind -> Zwei parallel Threads? Wie implementieren?\n\t\tf.dispose();\n\t\tchat();\n\n\t\tSystem.out.println(\"Netzwerk-Fenster verstecken\");\n\t\tSystem.out.println(\"doInitializationsMulti ausführen\");\n\t\t\n\t\tup = false;\n\t\tdown = false;\n\t\tleft = false;\n\t\tright = false; //sonst läuft Spieler nach Neustart einfach los\n\t\tattack = false;\n\t\tattack2 = false;\n\t\t\n\t\tlevel = 1;\n\t\troom = 1;\n\t\tlast = System.nanoTime();\n\t\tgameover = 0;\n\t\t\n\t\tactors = new CopyOnWriteArrayList<Sprite>();\n\t\tattacks = new CopyOnWriteArrayList<Object>();\n\t\t\n\t\tlib = SpriteLib.getInstance();\n\t\tsoundlib = new SoundLib();\n\t\tsoundlib.loadSound(\"Hintergrund\", \"sound/Greensleeves.wav\");\n\t\tsoundlib.loadSound(\"Angriff\", \"sound/Angriff.wav\");\n\t\tsoundlib.loadSound(\"Zauber\", \"sound/Zauber.wav\");\n\t\tif(sound_running == true){\n\t\tsoundlib.loopSound(\"Hintergrund\");\n\t\t}\n\t\t\n\t\tif(serverMode){\n\t\t\tplayer = new Player(lib.getSprite(\"resources/pics/player.gif\", 12, 1), 50, 50, 100, this); //player immer eigener Spieler, player 2 der andere\n\t\t\tplayer2 = new Player(lib.getSprite(\"resources/pics/player2.gif\", 12, 1), 650, 50, 100, this);\n\t\t\tplayer2.setRemote(true);\n\t\t\tactors.add(player);\n\t\t\tactors.add(player2);\n\t\t}else{\n\t\t\tplayer = new Player(lib.getSprite(\"resources/pics/player2.gif\", 12, 1), 650, 50, 100, this);\n\t\t\tplayer2 = new Player(lib.getSprite(\"resources/pics/player.gif\", 12, 1), 50, 50, 100, this);\n\t\t\tplayer2.setRemote(true);\n\t\t\tactors.add(player2);\n\t\t\tactors.add(player);\n\t\t}\n\t\tschwerteis = new Item(lib.getSprite(\"resources/pics/IceSword.gif\", 1, 1), 100, 500, 5, 100, this);\n\t\tschwertfeuer = new Item(lib.getSprite(\"resources/pics/FireSword.gif\", 1, 1), 600, 500, 10, 100, this);\n\t\t\n//\t\tItem xp1 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 50, 530, 11, 100, this);\n//\t\tItem xp2 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 100, 530, 11, 100, this);\n//\t\tItem xp3 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 150, 530, 11, 100, this);\n//\t\tItem xp4 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 200, 530, 11, 100, this);\n//\t\tItem xp5 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 250, 530, 11, 100, this);\n//\t\tItem xp6 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 300, 530, 11, 100, this);\n//\t\tItem xp7 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 350, 530, 11, 100, this);\n//\t\tItem xp8 = new Item(lib.getSprite(\"resources/pics/Doughnut.gif\", 1, 1), 400, 530, 11, 100, this);\n\t\t\n\t\tactors.add(schwerteis);\n\t\tactors.add(schwertfeuer);\n//\t\tactors.add(xp1);\n//\t\tactors.add(xp2);\n//\t\tactors.add(xp3);\n//\t\tactors.add(xp4);\n//\t\tactors.add(xp5);\n//\t\tactors.add(xp6);\n//\t\tactors.add(xp7);\n//\t\tactors.add(xp8);\n\t\t\n\t\tmap = new MapDisplay(\"resources/level/MultiTileMap_1_1.txt\", \"resources/pics/tiles_2.gif\", \"resources/pics/shadow.png\", 5, 1, this);\n\t\t\n\t\tframe.add(this);\n\t\tinitSkills();\n\t\tsetStarted(true);\n\t}", "public Controller(Client client, ServerGUI serverGUI) throws IOException {\r\n\t\tthis.client = client;\r\n\t\tthis.serverGUI = serverGUI;\r\n\t\tbeginningRoadCount = 0;\r\n\t\tbeginningSettlementCount = 0;\r\n\t\tbuilt = false;\r\n\t\tallowedToRoll = false;\r\n\t\tsong = new MP3();\r\n\t\taddAllowedCheats();\r\n\t\tthread = new ClientThread(client, client.getSocket(), this);\r\n\t\tthread.start();\r\n\t\tgameEnd = false;\r\n\t\texceptionLogger = ExceptionLogger.getInstance();\r\n\t}", "public ClientThread(Socket cs){\r\n this.cs = cs;\r\n \r\n //set the action listeners for the white card buttons\r\n cardOne.addActionListener(this);\r\n cardTwo.addActionListener(this);\r\n cardThree.addActionListener(this);\r\n cardFour.addActionListener(this);\r\n cardFive.addActionListener(this);\r\n cardSix.addActionListener(this);\r\n cardSeven.addActionListener(this);\r\n cardEight.addActionListener(this); \r\n \r\n }", "public void actionPerformed(ActionEvent ae) {\n try{\r\n //Socket\r\n cs = new Socket(IP, PORT);\r\n \r\n //Output Stream\r\n out = cs.getOutputStream();\r\n oos = new ObjectOutputStream(out);\r\n \r\n //Input Stream\r\n in = cs.getInputStream();\r\n ois = new ObjectInputStream(in);\r\n \r\n //asks the user for a user name and sends to server\r\n if(clientName == null){\r\n clientName = JOptionPane.showInputDialog(jbSend,\"Please enter a username\");\r\n oos.writeObject(clientName); \r\n oos.flush(); \r\n }\r\n \r\n \r\n //BlackCard bc = new BlackCard(\"black card\");\r\n //oos.writeObject(bc);\r\n\r\n jbConnect.setEnabled(false);\r\n \r\n //Thread\r\n ClientThread ct = new ClientThread(cs);\r\n ct.start();\r\n \r\n //handles chat strings from client to server\r\n jbSend.addActionListener(\r\n new ActionListener(){\r\n public void actionPerformed(ActionEvent ae) {\r\n try{\r\n //Writes message from server and appends\r\n if(jtaClient.getText().length() > 0){\r\n String clientMsg = jtaClient.getText();\r\n oos.writeObject(clientMsg);\r\n oos.flush();\r\n jtaClient.setText(\"\");\r\n } \r\n }\r\n catch (IOException oie) {\r\n System.out.println(\"IO Exception\");\r\n } \r\n }\t\r\n }); \r\n } \r\n catch(ConnectException ce ) { \r\n System.out.println(\"Server is Not Online\"); \r\n }\r\n catch(UnknownHostException uhe) {\r\n System.out.println(\"no host\");\r\n uhe.printStackTrace();\r\n }\r\n catch(IOException ioe)\r\n {\r\n System.out.println(\"IO error\");\r\n ioe.printStackTrace();\r\n }\r\n catch( ArrayIndexOutOfBoundsException aioobe ) {\r\n System.out.println(\"Array Index Out of Bounds\");\r\n }\r\n }", "public GameClient(WritableByteChannel w) {\r\n super(new Client(Config.WRITE_BUFFER_SIZE, Config.OBJECT_BUFFER_SIZE), w, null);\r\n }", "public Player(int playerNumber, Map map, CommandRelay commandRelay, MapObserver observer, UnitObserver unitObserver, StructureObserver structureObserver, StatusObserver statusObserver, PlayerObservator playerObservator, int startingX, int startingY){\n\n this.playerNumber = playerNumber;\n customID=new CustomID(IdType.PLAYER, String.valueOf(playerNumber));\n\n// entities = new EntityOwnership(customID, commandRelay, startingX, startingY); //TODO should entity ownership know Player?\n\n entities = new EntityOwnership(customID, commandRelay,startingX, startingY); //TODO should entity ownership know Player?\n entities.setMapObserver(observer);\n entities.setUnitObserver(unitObserver);\n\n keymap = new HashMap<KeyCode, String>();\n\n // Defualt keys\n keymap.put(KeyCode.NUMPAD2, \"SOUTH\");\n keymap.put(KeyCode.NUMPAD8, \"NORTH\");\n keymap.put(KeyCode.NUMPAD7, \"NW\");\n keymap.put(KeyCode.NUMPAD1, \"SW\");\n keymap.put(KeyCode.NUMPAD9, \"NE\");\n keymap.put(KeyCode.NUMPAD3, \"SE\");\n\n\n\n resources = new ResourceOwnership(customID);\n resources.addResource(new Resource(ResourceType.ENERGY, 100));\n resources.addResource(new Resource(ResourceType.ORE, 100));\n resources.addResource(new Resource(ResourceType.FOOD, 100));\n this.playerMap = map; // TODO for the moment global map is shared, later each player will have own map\n this.registerMapObserver(observer);\n this.registerUnitObserver(unitObserver);\n this.registerStructureObserver(structureObserver);\n this.registerStatusObserver(statusObserver);\n this.registerPlayerObserver(playerObservator);\n }", "public void connexionServeur() {\r\n\r\n\t\tString serverIp = JOptionPane\r\n\t\t\t\t.showInputDialog(\"Entrez le nom du serveur.\");\r\n\t\ttry {\r\n\t\t\tsocket = new Socket(serverIp, 4456);\r\n\t\t\tlogger.info(\"Connexion au socket serveur.\");\r\n\r\n\t\t\tThread t = new Thread(new EnvoiPresence(socket));\r\n\t\t\tt.start();\r\n\r\n\t\t\tThread t2 = new Thread(new ReceptionListUser(socket, mainView));\r\n\t\t\tt2.start();\r\n\r\n\t\t} catch (ConnectException e) {\r\n\t\t\tJOptionPane.showMessageDialog(new Frame(),\r\n\t\t\t\t\t\"Le serveur Draw Me An Idea n'est pas lancé\", \"Erreur\", 1);\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (UnknownHostException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void serverListener() {\n while(true){\n try{\n Object obj = ois.readObject();\n\n /*\n * If the object is of the CoronosAuth Class\n * Verify if the person can log in\n * if Yes: Display interface\n * if No: Prompt reason\n */\n if(obj instanceof CoronosAuth){\n System.out.println(\"[IO] - [Server] - Received CoronosAuth Object\");\n CoronosAuth returned = (CoronosAuth) obj;\n\n allow = returned.getAllow();\n reason = returned.getReason();\n username = returned.getUsername();\n\n if(allow) {\n System.out.println(\"[AUTH] - Successful Login - Authentication Successful!\");\n loginFrame.setVisible(false);\n String username = jtfUserNameField.getText();\n jfFrame.setTitle(String.format(\"Coronos Client - %s\", username));\n jfFrame.setVisible(true);\n Message message = new Message(String.format(\"%s has joined\\n\", username));\n oos.writeObject((Object) message);\n //set clientGUI to visible\n\n } else {\n System.out.println(\"[AUTH] - Failed Login - Authentication Failed!\");\n JOptionPane.showMessageDialog(loginButton, reason, \"Login Error\", JOptionPane.WARNING_MESSAGE);\n }\n }\n\n /*\n * if the object is of the Message Class\n * Append message to chat area\n */\n if(obj instanceof Message){\n System.out.println(\"[IO] - [Server] - Received Message Object\");\n Message message = (Message) obj;\n jtaChatArea.append(String.format(\"%s\", message.toString()));\n }\n\n /*\n * if the object is of the Employee class, save the employee object\n */\n else if(obj instanceof Employee){\n System.out.println(\"[IO] - [Server] - Received Employee Object\");\n this.employee = (Employee) obj;\n\n }\n }\n catch(IOException ioe){\n ioe.printStackTrace();\n }\n catch(ClassNotFoundException cnfe){\n cnfe.printStackTrace();\n }\n catch(NullPointerException npe){\n npe.printStackTrace();\n }\n }\n }", "public void setup_servers()\n {\n // get ServerInfo\n ServerInfo t = new ServerInfo();\n // all 3 servers\n for(int i=0;i<3;i++)\n {\n // get the server IP and port info\n String t_ip = t.hmap.get(i).ip;\n int t_port = Integer.valueOf(t.hmap.get(i).port);\n Thread x = new Thread()\n {\n public void run()\n {\n try\n {\n Socket s = new Socket(t_ip,t_port);\n // SockHandle instance with svr_hdl true and rx_hdl false as this is the socket initiator\n SockHandle t = new SockHandle(s,my_ip,my_port,my_c_id,c_list,s_list,false,true,cnode);\n }\n catch (UnknownHostException e) \n {\n \tSystem.out.println(\"Unknown host\");\n \tSystem.exit(1);\n } \n catch (IOException e) \n {\n \tSystem.out.println(\"No I/O\");\n e.printStackTrace(); \n \tSystem.exit(1);\n }\n }\n };\n \n x.setDaemon(true); \t// terminate when main ends\n x.setName(\"Client_\"+my_c_id+\"_SockHandle_to_Server\"+i);\n x.start(); \t\t\t// start the thread\n }\n }", "public ClientHandle(Socket cs) {\r\n \t\r\n this.threadSocket = cs;\r\n\r\n }", "public Server()\n {\n clientSessions = new ArrayList();\n }", "public SocketServerConnection(Socket socket, ServerConnectionListener clientController){\n\n this.socket = socket;\n this.clientController = clientController;\n pong = true;\n\n try {\n\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n buffer = new NetworkBuffer();\n out = new PrintWriter(socket.getOutputStream());\n\n } catch (IOException e){\n\n e.printStackTrace();\n System.out.println(\"[CLIENT] Error occurred while opening input and output streams.\");\n\n }\n\n }", "public ControlCenter(){\n serverConnect = new Sockets();\n serverConnect.startClient(\"127.0.0.1\", 5000);\n port = 5000;\n }", "public interface ClientConstants {\n char DOT_X = 'x'; // This is players dot\n char DOT_Y = 'o'; // This is AI dot\n char DOT_EMPTY = '.'; // Empty dot\n int WINDOW_SIZE_X = 516;\n int WINDOW_SIZE_Y = 565;\n int CELL_SIZE = 50;\n String BTN_NEW_GAME = \"New game\";\n String BTN_EXIT = \"Exit\";\n String[] mapSizeItems = {\"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"}; // Array for comboBoxMapSize\n String[] winRowItems = {\"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"}; // Array for comboBoxWinRow\n String SERVER_ADDRESS = \"localhost\";\n int PORT = 123;\n}", "public PlayerSocket(String name, PrintWriter output, BufferedReader input) throws IOException {\n\t\tsuper(name);\n\t\tthis.input= input;\n\t\tthis.output= output;\n\t\tvalidResponse = false;\n\t\tponged = false;\n\t\tThread t = new Thread(this::listen);\n\t\tt.start();\n\t}", "public ServerHelper(Server server, Socket clientsoc) { //server obj is used to to call getlist method and use it\n this.server = server;\n this.clientsoc = clientsoc;\n }", "public InterfaceSalon(String liste, Client client) {\n initComponents();\n this.c=client;\n this.lobbyListJSON=new JSONArray();\n parser = new JSONParser();\n \n setLobbyList(liste);\n }", "@Inject(at = @At(\"TAIL\"), method = \"onPlayerConnect\")\n\tprivate void onPlayerConnect(ClientConnection connection, ServerPlayerEntity player, CallbackInfo info) {\n\t\tShipItComponents.MAIL.get(player.getServerWorld().getLevelProperties()).getMailInfo(player).tryNameUpdate(player);\n\t}", "Client(String server, int port, String username, ClientGUI cg) {\n\t\tthis.server = server;\n\t\tthis.port = port;\n\t\tthis.username = username;\n\t\tthis.cg = cg; // Saved if in GUI mode or not\n\t}", "public void run() {\n try {\n //Create the input object stream and output object stream for this client\n toClient = new ObjectOutputStream(client.getOutputStream());\n fromClient = new ObjectInputStream(client.getInputStream());\n login = false;\n\n while (!login) {/*Wait for a client to login*/\n try {\n receviedProtocol = (Protocol) fromClient.readObject();\n if (receviedProtocol.getMethod().equals(\"HELP\"))\n sendHelpMenu();\n else if (receviedProtocol.getMethod().equals(\"LOGIN\")) {\n authorize(receviedProtocol);\n login = true;\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n logout = false;\n while (!logout) {/*Keep conncetion between client and server until the client logout*/\n try{\n receviedProtocol = (Protocol)fromClient.readObject(); //Wait for client input\n startIndex = 0;//This will be used to track the starting point of next n groups to be send\n if(receviedProtocol.getMethod().equals(\"AG\"))\n allGroupHandler(receviedProtocol);\n else if(receviedProtocol.getMethod().equals(\"LOGOUT\")){\n logout();\n logout = true;\n }\n }catch (Exception e){\n e.printStackTrace();\n }\n\n }\n\n } catch (IOException e) {\n System.out.println(e);\n\n } finally {\n try {\n client.close();\n } catch (IOException e) {\n System.out.println(e);\n }\n }\n }", "public TelaCliente() {\n initComponents();\n conexao=ModuloConexao.conector();\n }", "public void configureSocketEvents() {\n socket.on(\"startGame\", new Emitter.Listener() {\n @Override\n public void call(Object... args) {\n JSONObject data = (JSONObject) args[0];\n\n try {\n String start = (String) data.getString(\"room\");\n if (start.equals(roomHost)) {\n startGame = true;\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }).on(\"playerNames\", new Emitter.Listener() {\n @Override\n public void call(Object... args) {\n JSONArray data = (JSONArray) args[0];\n try {\n\n for (int i = 0; i < data.length(); i++) {\n playerNames[i] = (String) data.getString(i);\n }\n for (int i = data.length(); i < maxPlayers; i++) {\n playerNames[i] = \"Empty\";\n }\n updateNames();\n } catch (JSONException e) {\n Gdx.app.log(\"multiplayer\", \"unable to update names\");\n }\n }\n }).on(\"maxPlayers\", new Emitter.Listener() {\n @Override\n public void call(Object... args) {\n JSONObject data = (JSONObject) args[0];\n try {\n maxPlayers = (int) data.getInt(\"maxPlayers\");\n } catch (JSONException e) {\n Gdx.app.log(\"multiplayer\", \"unable to get max players\");\n }\n }\n }).on(\"lobbyUpdate\", new Emitter.Listener() {\n @Override\n public void call(Object... args) {\n JSONObject data = (JSONObject) args[0];\n try {\n String room = (String) data.getString(\"id\");\n if (room.equals(roomHost)) {\n updateLobby();\n }\n } catch (JSONException e) {\n Gdx.app.log(\"multiplayer\", \"unable to get max players\");\n }\n }\n }).on(\"roomCanceled\", new Emitter.Listener() {\n @Override\n public void call(Object... args) {\n JSONObject data = (JSONObject) args[0];\n try {\n String room = (String) data.getString(\"roomid\");\n if (room.equals(roomHost)) {\n mainmenu = true;\n }\n } catch (JSONException e) {\n Gdx.app.log(\"multiplayer\", \"unable to get max players\");\n }\n }\n });\n }", "public Server(){\n\t\t//-- Crear datos default\n\t\tSport s = new Sport(\"Soccer\",\"soccer.png\");\n\t\tSport b = new Sport(\"Basketball\",\"basketball.png\");\n\t\tTeam t1 = s.addTeam(\"Tigres\");\n\t\tTeam t2 = s.addTeam(\"Rayados\");\n\t\ts.addGame(t1,t2);\n\t\t\n\t\tdeportes.add(s);\n\t\tdeportes.add(b);\n\t}", "public void run() {\n try {\n // Create data input and output streams\n fromPlayer1 = new DataInputStream(player1.getInputStream());\n toPlayer1 = new DataOutputStream(player1.getOutputStream());\n fromPlayer2 = new DataInputStream(player2.getInputStream());\n toPlayer2 = new DataOutputStream(player2.getOutputStream());\n\n\n /**Write anything to notify player 1 to startServer\n This is just to let player 1 know to startServer*/\n toPlayer1.writeInt(1);\n\n /** Continuously serve the players and determine and report\n the game status to the players*/\n while (true) {\n\n\n // Receive a move from player 1\n int row = fromPlayer1.readInt();\n int column = fromPlayer1.readInt();\n char token = 'r';\n\n if ((row == DISCONNECT_TOKEN)) {\n sendDisconnectRequest(toPlayer2);\n sendDisconnectRequest(toPlayer2);\n\n } else if (column == DISCONNECT_TOKEN) {\n sendDisconnectRequest(toPlayer2);\n sendDisconnectRequest(toPlayer2);\n\n } else\n cell[row][column] = 'r';\n // Check if Player 1 wins\n if (checkWin('r')) {\n toPlayer1.writeInt(PLAYER1_WON);\n toPlayer2.writeInt(PLAYER1_WON);\n //make sure the 2 players are logged off\n closeSession();\n sendMove(toPlayer2, row, column);\n\n break; // Break the loop\n } else if (isFull()) { // Check if all cells are filled\n toPlayer1.writeInt(DRAW);\n toPlayer2.writeInt(DRAW);\n sendMove(toPlayer2, row, column);\n break;\n } else {\n // Notify player 2 to take the turn\n toPlayer2.writeInt(CONTINUE);\n\n // Send player 1's selected row and column to player 2\n sendMove(toPlayer2, row, column);\n }\n\n // Receive a move from Player 2\n row = fromPlayer2.readInt();\n column = fromPlayer2.readInt();\n\n if ((row == DISCONNECT_TOKEN)) {\n sendDisconnectRequest(toPlayer1);\n sendDisconnectRequest(toPlayer1);\n closeSession();\n\n } else if (column == DISCONNECT_TOKEN) {\n sendDisconnectRequest(toPlayer1);\n sendDisconnectRequest(toPlayer1);\n closeSession();\n\n\n } else\n // Check if Player 2 wins\n cell[row][column] = 'b';\n if (checkWin('b')) {\n toPlayer1.writeInt(PLAYER2_WON);\n toPlayer2.writeInt(PLAYER2_WON);\n closeSession();\n sendMove(toPlayer1, row, column);\n break;\n } else {\n // Notify player 1 to take the turn\n toPlayer1.writeInt(CONTINUE);\n\n // Send player 2's selected row and column to player 1\n sendMove(toPlayer1, row, column);\n }\n }\n } catch (IOException ex) {\n System.err.println(ex);\n //make sure array list is empty at end of session\n closeSession();\n\n }\n }", "public HostRouter(int port, int maxPlayers) {\n try {\n this.serverSocket = new ServerSocket(port);\n } catch (IOException e) {\n log.error(\"Error establishing host socket\", e);\n System.exit(-1);\n }\n this.clients = new HashMap<Integer, Client>();\n this.maxPlayers = maxPlayers;\n setLocalPlayerId(0);\n \n registeredMoves = new HashMap<Player, PlayerCommand>();\n pool = Executors.newFixedThreadPool(SevenWonders.MAX_PLAYERS+2);\n \n start();\n }", "public RWClient(Socket usr, String name, boolean t, ObjectOutputStream oos, Client cl){\n this.usr = usr;\n this.username = name;\n this.write = t;\n this.client = cl;\n this.oos = oos;\n }", "public Player(int aMapPort,String aCompName, String aMapName)\r\n\t{\r\n\t\tmapPort = aMapPort;\r\n\t\tcompName = aCompName;\r\n\t\tmapName = aMapName;\r\n\t\t\r\n\t\tJFrame frameBoard = new JFrame();\r\n\t\tframeBoard.setTitle(\"MapFrame \"+mapName);\r\n\t\tframeBoard.setSize(800, 480);\r\n\t\tframeBoard.setLocation(450, 100);\r\n\t\tframeBoard.setResizable(false);\r\n\t\t\r\n\t\tSystem.out.println(\"We got so far\");\t\r\n\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tgetInfo();\r\n\t\t\t board = new Hub_Board(sizeX, sizeY, frameBoard.getContentPane(),value,mapName);\r\n\t\t\t setPlayerPosition();\r\n\t\t\tframeBoard.setVisible(true);\r\n\t\t\t\r\n\t\t\tfieldArray = board.getArray();\r\n\t\t\t\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\tSystem.out.println(\"Exception occured\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Exception occured\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\nSystem.out.println(\"We are victorious with matthiew\");\r\n\t\t \r\n\t}", "public interface Player {\n /**\n * has to be implemented\n * wird von update() in Game aufgerufen.\n * @return eine der Actions aus Rules.getActionsTileMove()\n */\n GameState requestActionTile();\n /**\n * has to be implemented\n * wird von update() in Game aufgerufen.\n * @return eine der Actions aus Rules.getActionsGamePieceMove()\n */\n GameState requestActionGamePiece();\n\n /**\n * has to be implemented\n * wird von update() aufgerufen.\n * @param gameState aktueller GameState\n */\n void updateGameState(GameState gameState);\n\n GameState getGameState();\n\n /**\n * has to be implemented\n * @return the color of the Player\n */\n Color getColor();\n\n void setRules(Rules rules);\n Rules getRules();\n\n void setName(String name);\n String getName();\n\n void setThread(ThreadUpdate thread);\n void setSynchronizer(Object synchronizer);\n\n /**\n * wird von update aufgerufen, sobald ein anderer Spieler eine Karte gewinnt.\n * @param color Farbe des Spielers, der eine Karte gewonnen hat\n * @param symbol auf dieser Karte\n */\n void notifyWonCards(Color color, Symbol symbol);\n\n /**\n * legt die Karte ganz oben auf dem Stapel, die der Spieler als nächstes gewinnen muss fest.\n * Wird von Game_Impl aufgerufen um dem Player seine Karte mitzuteilen\n * @param symbol neue zu erreichende Karte/Symbol\n */\n void setActiveCard(Symbol symbol);\n\n /**\n * has to be implemented\n * @return the activeCard, that was set by Game_Impl\n */\n Symbol getActiveCard();\n\n\n /**\n * creates new instance of chosen player\n *\n * Correct place to add new and more KI players!\n *\n * @param className name of the class to create an instance of\n * @param color chosen color for a player\n * @return new instance of playerclass\n */\n static Player createNewPlayer(String className, Color color) throws IllegalArgumentException {\n switch (className) {\n case \"PlayerKI\":\n return new PlayerKI(color);\n case \"PlayerKI2\":\n return new PlayerKI2(color);\n case \"PlayerKI3\":\n return new PlayerKI3(color);\n case \"PlayerKI4\":\n return new PlayerKI4(color);\n case \"PlayerHuman\":\n return new PlayerPhysical(color);\n default:\n throw new IllegalArgumentException(\"createNewPlayer in Player.java doesn't know how to handle this!\");\n }\n }\n}", "public KKServerGui(){\n\t\t\n\t\tsuper(\"Knock Knock Server\");\n\t\t\t\t\n\t\tloadData();\n\t\torganizeUI();\n\t\taddListeners();\n\t\t\t\n\t\tsetDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);\n\t}", "private void initiateClient(){\n btnNewGame.addActionListener(clientAction);\n btnNewGame.setActionCommand(\"NEWGAME\");\n btnQuit.addActionListener(clientAction);\n btnQuit.setActionCommand(\"QUIT\");\n btnResign.addActionListener(clientAction);\n btnResign.setActionCommand(\"RESIGN\");\n btnSendMsg.addActionListener(clientAction);\n btnSendMsg.setActionCommand(\"CHAT\");\n\n setButtons(false);\n btnNewGame.setEnabled(false);\n boardComponent.initiate();\n }", "public Ctacliente() {\n\t}", "ServerThread(Server srv, Socket s, IProtocolHandler h) throws IOException {\n server = srv;\n fromClient = new BufferedReader(new InputStreamReader(s.getInputStream()));\n toClient = new PrintWriter(s.getOutputStream(), true);\n client = s;\n handler = h;\n id = UUID.randomUUID().toString();\n }", "private void setupGUI() {\r\n\t\tnetPaintClient = new NetPaintClient(out, clientName);\t\r\n\t\tnetPaintClient.addWindowListener(new WindowAdapter(){\r\n\t\tpublic void windowClosing(WindowEvent arg0) {\r\n\t\t\ttry {\r\n\t\t\t\tout.writeObject(new DisconnectCommand(clientName));\r\n\t\t\t\tout.close();\r\n\t\t\t\tin.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\t}", "@Override\n\tpublic boolean init()\n\t{\n\t\tentityMap = new EntityIDMap();\n\t\t\n\t\tServerBootstrap bootstrap = new ServerBootstrap();\n\t\tbootstrap.group(bossGroup, workerGroup)\n\t\t\t\t.channel(NioServerSocketChannel.class) // Channel type\n\t\t\t\t.childHandler(new ChannelInitializer<SocketChannel>() // Setup ChannelInitializer\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void initChannel(SocketChannel ch)\n\t\t\t\t\t{\n\t\t\t\t\t\t// On client connect:\n\t\t\t\t\t\t// Send back client-id\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Client side:\n\t\t\t\t\t\t// Send back position of player\n\t\t\t\t\t\t// client id | pos x | pos y | pos z\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Server side:\n\t\t\t\t\t\t// Broadcast all player positions\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldPrepender(2));\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldBasedFrameDecoder(0xFFFF, 0, 2));\n\t\t\t\t\t\tch.pipeline().addLast(new PacketCodec());\n\t\t\t\t\t\tch.pipeline().addLast(new ServerChannelHandler(instance));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.option(ChannelOption.SO_BACKLOG, 128)\n\t\t\t\t.childOption(ChannelOption.SO_KEEPALIVE, true);\n\t\t\n\t\t// Bind & start accepting connections\n\t\ttry\n\t\t{\n\t\t\tChannelFuture f = bootstrap.bind(this.hostPort).sync();\n\t\t\tserverChannel = f.channel();\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\tSystem.err.println(\"Unable to bind to the requested port\");\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public Servidor(Socket s) {\r\n\t\tconexao = s;\r\n\t}", "public ClientThread(Server server, Socket socket,\n RegistrationLoginHandler registrationLoginHandler,\n BootHandler bootHandler, ContactHandler contactHandler) {\n this.server = server;\n this.socket = socket;\n\n //handlers\n this.registrationLoginHandler = registrationLoginHandler;\n this.bootHandler = bootHandler;\n this.contactHandler = contactHandler;\n\n id = UUID.randomUUID().toString();\n\n System.out.println(\"Client connected with id: \" + id);\n\n try {\n output = new ObjectOutputStream(socket.getOutputStream());\n input = new ObjectInputStream(socket.getInputStream());\n } catch (IOException ex) {\n server.displayError(\"Exception creating new Input/output Streams: \" + ex.getMessage());\n ex.printStackTrace();\n }\n }", "public Connect4TextConsole(){\r\n this.board = new Connect4(); \r\n this.comp = new Connect4ComputerPlayer(this.board);\r\n }", "public void receiveInfoFromServerC() throws IOException\n\t{\n\t\tstatus = fromServer.readInt();\n\n\t\tif (status == PLAYER1WINS)\n\t\t{\t\n\t\t\tsetMove(currentToken);\n\t\t\tPlatform.runLater(() -> lblStatus.setText(\"You've won!\")); \n\t\t\tcontinueToPlay = false;\n\t\t}\n\n\t\telse if (status == PLAYER2WINS)\n\t\t{\n\t\t\tsetMove(otherToken);\n\t\t\tPlatform.runLater(() -> lblStatus.setText(\"Game over - Player O has won!\"));\n\t\t\tcontinueToPlay = false;\n\t\t}\n\n\t\telse if (status == DRAW)\n\t\t{\n\t\t\tPlatform.runLater(() -> lblStatus.setText(\"Game over - It's a tie!\"));\n\t\t\tsetMove(otherToken);\n\t\t\tcontinueToPlay = false;\n\t\t}\n\t\telse if (status == WAIT)\n\t\t{\n\t\t\tsetMove(currentToken);\n\t\t\tPlatform.runLater(() -> lblStatus.setText(\"Other player's turn.\"));\n\t\t\tmyTurn = false; \n\t\t}\n\t\telse if (status == CONTINUE)\n\t\t{\n\t\t\tsetMove(otherToken);\n\t\t\tPlatform.runLater(() -> lblStatus.setText(\"Your turn.\"));\n\t\t\tmyTurn = true;\n\t\t}\n\t}", "public HiloDeCliente_1(DefaultListModel charla, Socket socket) throws IOException\n {\n \n \n this.socket = socket;\n ArrayList lista = ManejadorDeListas.ListaDeRojos;\n //lista.add(\"PERE\");\n \n \n try\n {\n salienteServidor=new ObjectOutputStream(socket.getOutputStream());\n salienteServidor.writeObject(lista);\n dataInput = new DataInputStream(socket.getInputStream());\n dataOutput = new DataOutputStream(socket.getOutputStream());\n \n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public interface SocketControl {\n\n /**\n * 获取服务的IP和端口\n * @return 格式:ip:port,如127.0.0.1:8080\n */\n String getIpPort();\n\n /**\n * 获取服务的ServiceId\n * @return 服务的ServiceId\n */\n String getServiceId();\n\n /**\n * 获取服务的InstanceId\n * @return 服务的InstanceId\n */\n String getInstanceId();\n\n\n /**\n * 获取模块名称,也可以直接调用getIpPort()\n * @return 模块名称\n */\n String getModelName();\n\n\n /**\n * 模块下连接的标示\n * @param channel 管道对象\n * @return uk\n */\n String getUniqueKey(Channel channel);\n\n\n /**\n * 模块下连接的标示\n * @param ctx 管道对象\n * @return uk\n */\n String getUniqueKey(ChannelHandlerContext ctx);\n\n\n /**\n * 绑定key\n * @param ctx 当前连接对象\n * @param key key\n */\n void bindKey(ChannelHandlerContext ctx,String key);\n\n /**\n * 绑定key\n * @param ctx 当前连接对象\n * @param key key\n */\n void bindKey(Channel ctx,String key);\n\n /**\n * 获取key\n * @param ctx 当前链接对象\n * @return key\n */\n String getKey(Channel ctx);\n\n /**\n * 获取key\n * @param ctx 当前链接对象\n * @return key\n */\n String getKey(ChannelHandlerContext ctx);\n\n\n /**\n * 重置心跳时间\n * @param ctx 当前连接对象\n * @param heartTime 心跳时间(秒)\n */\n void resetHeartTime(Channel ctx,int heartTime);\n\n\n\n}", "public ServerNMS() {\n\t\tclients = new LinkedList<PrintWriter>();\n\t}", "OthelloPlayer(Socket socket, String playerColor, OthelloGame othelloGame)\r\n {\r\n this.socket = socket;\r\n this.playerColor = playerColor;\r\n this.game = othelloGame;\r\n\r\n try\r\n {\r\n socketWriter = new PrintWriter(socket.getOutputStream(), true);\r\n socketReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n socketWriter.println(\"WELCOME \" + playerColor);\r\n socketWriter.println(\"MESSAGE Waiting for opponent to connect\");\r\n }\r\n catch (IOException e)\r\n {\r\n System.out.println(\"Player died: \" + e);\r\n }\r\n }", "@Override\n public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) {\n Channel channel = ctx.getChannel();\n //session.setAttachment(new Player(session));\n Client client = new Client(channel);\n channel.setAttachment(client);\n engine.addClient(client);\n }", "public void run() {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"SERVER: all players connected!\");\n\t\t\t\t\n\t\t\t\t//build the info message for clients\n\t\t\t\tString gameConfig = \"INFO \" + Integer.toString(pitsPerPlayer) + \" \" + Integer.toString(seedsPerPit)\n\t\t\t\t + \" \" + Integer.toString(timerValMils);\n\t\t\t\t\n\t\t\t\t//append first/second character\n\t\t\t\tif (playerNum == 1) {\n\t\t\t\t\tgameConfig += \" F\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgameConfig += \" S\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//append random/uniform distro character\n\t\t\t\tif (randomDistro) {\n\t\t\t\t\tgameConfig += \" R\";\n\t\t\t\t\tcurrentGame = new kalah(pitsPerPlayer, seedsPerPit, randomDistro);\n\t\t\t\t\t\n\t\t\t\t\tArrayList<Integer> randomSeeds = currentGame.getP1pits();\n\t\t\t\t\tfor (int i = 0; i < randomSeeds.size(); i++) {\n\t\t\t\t\t\tgameConfig += \" \" + Integer.toString(randomSeeds.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgameConfig += \" S\";\n\t\t\t\t\tcurrentGame = new kalah(pitsPerPlayer, seedsPerPit, randomDistro);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//send to server \n\t\t\t\twriter.println(gameConfig);\n\t\t\t\t\n\t\t\t\t//process client commands (game loop for each client)\n\t\t\t\twhile (true) {\n\t\t\t\t\t\n\t\t\t\t\tString clientMessage = reader.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//ignore empty commands\n\t\t\t\t\tif (!clientMessage.equals(null) && !clientMessage.equals(\"\")) {\n\t\t\t\t\t\tif (clientMessage.startsWith(\"MOVE\")) {\n\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Client \" + playerNum + \" sent move: \" + clientMessage.substring(5));\n\n\t\t\t\t\t\t\tint clientMove = Integer.parseInt(clientMessage.substring(5));\n\n\t\t\t\t\t\t\tif (currentGame.move(clientMove)) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: acknowledged client \" + playerNum + \"'s \" + \"move: \" + clientMessage.substring(5));\n\t\t\t\t\t\t\t\twriter.println(\"OK\");\n\n\t\t\t\t\t\t\t\t//send move to other client to keep their game in sync\n\t\t\t\t\t\t\t\topponent.writer.println(\"MOVE \" + clientMessage.substring(5));\n\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Sent move \" + clientMessage.substring(5) + \" to client \" + opponent.playerNum);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//check for winner \n\t\t\t\t\t\t\t\tcurrentGame.checkGameOver();\n\t\t\t\t\t\t\t\tif (currentGame.gameOver) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: GAME OVER\");\n\t\t\t\t\t\t\t\t\tif (currentGame.winner == 0) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Tie!\");\n\t\t\t\t\t\t\t\t\t\twriter.println(\"TIE\");\n\t\t\t\t\t\t\t\t\t\topponent.writer.println(\"TIE\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (playerNum == currentGame.winner) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Player \" + playerNum + \" wins!\");\n\t\t\t\t\t\t\t\t\t\twriter.println(\"WINNER\");\n\t\t\t\t\t\t\t\t\t\topponent.writer.println(\"LOSER\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Player \" + playerNum + \" wins!\");\n\t\t\t\t\t\t\t\t\t\twriter.println(\"LOSER\");\n\t\t\t\t\t\t\t\t\t\topponent.writer.println(\"WINNER\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: rejected client's move: \" + clientMessage.substring(5));\n\t\t\t\t\t\t\t\twriter.println(\"ILLEGAL\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e) {\n\t\t\t\tSystem.out.println(\"Player error: \" + e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tsocket.close();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public Server() {\n initComponents();\n listModel = new DefaultListModel<>();\n listModel2 = new DefaultListModel<>();\n \n }" ]
[ "0.64371324", "0.6146286", "0.6104465", "0.6047765", "0.6046978", "0.5988714", "0.59854287", "0.587098", "0.58447266", "0.5757688", "0.57495046", "0.5745117", "0.56975543", "0.5679192", "0.5674966", "0.56746066", "0.56641024", "0.56430674", "0.558678", "0.557469", "0.55421096", "0.5540506", "0.55157834", "0.5506586", "0.5505704", "0.5502765", "0.5502079", "0.5482036", "0.5466359", "0.5461543", "0.54502743", "0.5446101", "0.5445783", "0.5444497", "0.54093623", "0.5405308", "0.53883845", "0.5383913", "0.53811234", "0.53548515", "0.5350498", "0.53477126", "0.5345411", "0.53445524", "0.5340097", "0.5333616", "0.5319618", "0.5319098", "0.53143936", "0.5310784", "0.53097445", "0.52951944", "0.5292997", "0.52904516", "0.52826434", "0.52756584", "0.52737385", "0.5264031", "0.52633137", "0.5258413", "0.5258001", "0.5257349", "0.52444875", "0.523855", "0.52369833", "0.5233557", "0.52302825", "0.52263486", "0.52244306", "0.52238154", "0.5223702", "0.52191544", "0.5219147", "0.5217265", "0.5215722", "0.520981", "0.5208369", "0.5201823", "0.5197091", "0.5195311", "0.5188179", "0.5186289", "0.51784325", "0.5177944", "0.51776594", "0.517297", "0.5170467", "0.51673704", "0.51666147", "0.51649684", "0.51638746", "0.5160674", "0.5158718", "0.5156852", "0.51541185", "0.5153414", "0.51480603", "0.5142706", "0.51418537", "0.5138422" ]
0.57767206
9
Die runMethode des Thread nimmt eingehende Nachrichten des Client entgegen und uebergibt diese an den Server durch Aufruf der Methode resolveMessage() Faengt eine ClassNotFoundException ab, falls die Klasse nicht gefunden werden kann und gibt einen Fehler aus. Faengt eine IOException ab und ruft im jeweiligen Server, dem er zugeteilt ist die handleIOException Methode auf.
@Override public void run() { run = true; ComObject object; while (run) { try { object = (ComObject) comIn.readObject(); object.process(this, server); } catch (ClassNotFoundException e) { run = false; System.err.println("Classpath was not found!"); server.disconnectPlayer(this); e.printStackTrace(); } catch (IOException e) { run = false; System.err.println("Couldn't find Input/Output!"); server.disconnectPlayer(this); e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void run() {\n while (connected) {\n Message message = getMessage();\n if (!connected)\n break;\n Executors.newCachedThreadPool().execute(() -> {\n try {\n message.handle(messageHandler);\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tRecieveSocketOfClient(SocketForClient);\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "final public void run() {\n connectionEstablished();\n\n // The message from the server\n int msg;\n\n // Loop waiting for data\n\n try {\n // messageTimer.schedule(new TimerTask() {\n // @Override\n // public void run() {\n // try {\n // sendFromMessageQueue();\n // } catch (IOException e) {}\n // }\n // }, 0, 100);\n while (!readyToStop) {\n // Get data from Server and send it to the handler\n // The thread waits indefinitely at the following\n // statement until something is received from the server\n\n try { // added in version 2.31\n\n // String cur = input.readLine();\n // handleBig5String(cur + \"\\n\");\n readByte();\n\n } catch (RuntimeException ex) { // thrown by handleMessageFromServer\n\n connectionException(ex);\n }\n }\n } catch (Exception exception) {\n if (!readyToStop) {\n try {\n closeAll();\n } catch (Exception ex) {\n }\n\n clientReader = null;\n connectionException(exception);\n }\n } finally {\n\n clientReader = null;\n connectionClosed(); // moved here in version 2.31\n }\n }", "public void run() {\n\t\ttry {\n\t\t\tout = new PrintWriter(client.getOutputStream(), true);\n\t\t\tin = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\ts.getMessage(this, inputLine);\n\t\t\t\tSystem.out.println(inputLine);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to host\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "private void run() throws IOException {\n\n Socket socket = new Socket(\"localhost\", 8678);\n in = new BufferedReader(new InputStreamReader(\n socket.getInputStream()));\n\n // Process all messages from server, according to the protocol.\n\n while (true) {\n String line = in.readLine();\n if (line.startsWith(\"SUBMIT\")) {\n new MessageThread(socket).start();\n }\n else if (line.startsWith(\"NAMEACCEPTED\")) {\n System.out.println(\"Success\");;\n } else if (line.startsWith(\"MESSAGE\")) {\n System.out.println(line);\n }\n }\n }", "@Override\n public void run() {\n FILEPREFIX = \".//files\"+serverID + \"//\";\n ClientMessage = (Message) socketRead();\n ServerMessage = getReturnMessage(ClientMessage);\n //System.out.println(\"client\"+ClientMessage.getFrom()+\"message : \"+ClientMessage.getContent());\n File file = new File(FILEPREFIX + ClientMessage.getFileName());\n switch (ClientMessage.getType()){\n case \"enquiry\"://return the list of file\n ServerMessage.setContent(ListAllFile());\n break;\n case \"read\"://read the last line\n System.out.println(ClientMessage.getFrom() + \": Reading...\");\n ServerMessage.setContent(\"Reading: \"+ReadLastLine(file));\n System.out.println(\"Reading \"+ClientMessage.getContent());\n break;\n case \"write\"://write to the end of file\n System.out.println(ClientMessage.getFrom() + \": writing...\");\n try{\n WriteLastLine(file,ClientMessage.getContent());\n }catch (IOException e) {\n System.out.println(\"write error\");\n }\n\n ServerMessage.setContent(\"writing: \"+ReadLastLine(file));\n System.out.println(\"Writing \"+ClientMessage.getContent());\n break;\n default://unknown command\n System.out.println(ClientMessage.getType());\n ServerMessage.setContent(\"Error\");\n System.out.println(ClientMessage.getFrom() + \": Wrong type\");\n break;\n }\n socketWrite(ServerMessage);\n\n try {//close the socket connection\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void run() {\n if (isV6())\n while (!interrupted()) {\n try {\n handleMessage(serverSocket.accept());\n } catch (SocketTimeoutException ignore) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n try {\n serverSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void handleMessage(Message message, DatagramSocket socket) throws HandlingException, IOException, ClassNotFoundException;", "@Override\n\tpublic void run()\n\t{\n\t\tif(socket != null && !socket.isClosed() && socket.isConnected())\n\t\t{\n\t\t\tSendMessage(ApplicationManager.Instance().GetName(), MessageType.clientData);\n\t\t\tApplicationManager.textChat.writeGreen(\"Connected to \" + connectionInfo.ServerAdress);\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\twhile (IsConnected) \n\t\t {\n\t\t Message message = (Message) in.readObject();\n\t\t\t\t\t\n\t\t if(!IsConnected)\n\t\t \tbreak;\n\t\t \t\n\t\t if(message == null)\n\t\t {\n\t\t \tIsConnected = false;\n\t\t \tbreak;\n\t\t }\n\t\t \n\t\t HandleMessage(message); \n\t\t }\n\t\t\t \n\t\t\t} \n\t\t\tcatch (SocketException | EOFException e) {\n\t\t\t\tif(IsConnected)\n\t\t\t\tApplicationManager.textChat.writeGreen(\"Server go down!\");\n\t\t\t}\n\t\t\tcatch (IOException | ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplicationManager.Instance().Disconnect();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApplicationManager.textChat.writeGreen(\"Cannot connect!\");\n\t\t\tApplicationManager.Instance().Disconnect();\n\n\t\t}\n\t}", "public void start() {\n try {\n Socket socket = new Socket(conf.getServerIp(), conf.getServerPort());\n\n java.io.InputStream is = socket.getInputStream();\n BufferedReader reader = new BufferedReader(new java.io.InputStreamReader(is));\n\n readerThread = new MessageReader(reader);\n new Thread(readerThread).start();\n\n java.io.OutputStream os = socket.getOutputStream();\n PrintWriter writer = new PrintWriter(os);\n writerThread = new MessageWriter(writer);\n new Thread(writerThread).start();\n\n while (serverMessages.empty()) {\n //Do nothing\n }\n\n ServerMessage serverMessage = serverMessages.pop();\n if (!serverMessage.getMessageType().equals(ServerMessage.MessageType.HELO)) {\n System.out.println(\"Expecting a HELO message but received: \" + serverMessage.toString());\n } else {\n System.out.println(\"Please fill in your username: \");\n Scanner scanner = new Scanner(System.in);\n String username = scanner.nextLine();\n\n\n ClientMessage heloMessage = new ClientMessage(ClientMessage.MessageType.HELO, username);\n clientMessages.push(heloMessage);\n\n while (serverMessages.empty()) {\n }\n\n\n isConnected = validateServerMessage(heloMessage, serverMessages.pop());\n if (!isConnected) {\n System.out.println(\"Error logging into server\");\n } else {\n System.out.println(\"Successfully connected to server.\");\n System.out.println(\"(Type '/quit' to close connection and stop application.)\");\n System.out.println(\"Type a broadcast message: \");\n nonblockReader = new NonblockingBufferedReader(new BufferedReader(new java.io.InputStreamReader(System.in)));\n\n\n while (isConnected) {\n String line = nonblockReader.readLine();\n if (line != null) {\n ClientMessage clientMessage;\n if (line.equals(\"/quit\")) {\n clientMessage = new ClientMessage(ClientMessage.MessageType.QUIT, username + \" left the server\");\n isConnected = false;\n\n Thread.sleep(500L);\n } else if (line.startsWith(\"/msg\") && line.split(\" \").length > 1) {\n //Split the message first\n String[] splittedline = line.split(\" \");\n String senderUsername = splittedline[1].toLowerCase();\n\n if (!senderUsername.equalsIgnoreCase(username)) {\n line = line.replace(\"/msg \" + splittedline[1] + \" \", \"\");\n\n //Check if we have an encryptionsession with the user or not\n if (encryptionSessionHashMap.containsKey(senderUsername)) {\n //We have an encryptionsession, so we can just send the message\n String encryptedLine = encryptionSessionHashMap.get(senderUsername).encryptMessage(line);\n clientMessage = new ClientMessage(ClientMessage.MessageType.ENCR, senderUsername + \" \" + encryptedLine);\n System.out.println(\"(You -> \" + senderUsername + \"): \" + line);\n } else {\n //We don't have an encryptionsession yet, so we create one\n EncryptionSession encryptionSession = new EncryptionSession();\n encryptionSessionHashMap.put(senderUsername, encryptionSession);\n clientMessage = new ClientMessage(ClientMessage.MessageType.KEYS, senderUsername + \" \" + encryptionSession.getPublicKey());\n savedMessage.put(senderUsername, line);\n }\n } else {\n System.out.println(\"You cannot send a message to yourself\");\n clientMessage = null;\n }\n } else if (line.startsWith(\"/file\") && line.split(\" \").length == 3) {\n //Split the message first\n String[] splitLine = line.split(\" \");\n String senderUsername = splitLine[1].toLowerCase();\n\n if (!senderUsername.equalsIgnoreCase(username)) {\n String fileBase64String = new FileTransfer(splitLine[2], senderUsername).sendFile();\n clientMessage = new ClientMessage(ClientMessage.MessageType.FILE, fileBase64String);\n System.out.println(\"You have send \" + splitLine[2] + \" to \" + senderUsername);\n } else {\n System.out.println(\"You cannot send a file to yourself\");\n clientMessage = null;\n }\n\n } else {\n clientMessage = new ClientMessage(ClientMessage.MessageType.BCST, line);\n System.out.println(line);\n }\n\n if (clientMessage != null) {\n clientMessages.push(clientMessage);\n }\n }\n if (!serverMessages.empty()) {\n ServerMessage received = serverMessages.pop();\n\n\n if (received.getMessageType().equals(ServerMessage.MessageType.BCST)) {\n System.out.println(received.getPayload());\n }\n\n //Check if we received an encrypted message\n else if (received.getMessageType().equals(ServerMessage.MessageType.ENCR)) {\n //Split the message first\n String[] splitMessage = received.getPayload().split(\" \");\n String sender = splitMessage[0].toLowerCase();\n String encryptedMessage = splitMessage[1];\n\n //If we have a session with this user, we can decrypt the message\n if (encryptionSessionHashMap.containsKey(sender)) {\n System.out.println(\"(\" + sender + \" -> You): \" + encryptionSessionHashMap.get(sender).decryptMessage(encryptedMessage));\n }\n }\n\n //If this is the first time, we have to share keys\n else if (received.getMessageType().equals(ServerMessage.MessageType.KEYS)) {\n //Split the message first\n String[] splitMessage = received.getPayload().split(\" \");\n String sender = splitMessage[0].toLowerCase();\n String encryptedKey = splitMessage[1];\n\n //Check if we send the first message or not\n if (encryptionSessionHashMap.containsKey(sender)) {\n encryptionSessionHashMap.get(sender).decryptKey(encryptedKey);\n\n //After saving the aes key, we have to resend our first message\n String msg = savedMessage.get(sender);\n if (msg != null) {\n String encryptedLine = encryptionSessionHashMap.get(sender).encryptMessage(msg);\n ClientMessage responseMessage = new ClientMessage(ClientMessage.MessageType.ENCR, sender + \" \" + encryptedLine);\n clientMessages.push(responseMessage);\n System.out.println(\"(You -> \" + sender + \"): \" + msg);\n savedMessage.remove(sender);\n }\n }\n\n //We send our aes key when we didn't send the message first\n else {\n EncryptionSession encryptionSession = new EncryptionSession();\n encryptionSessionHashMap.put(sender, encryptionSession);\n String aesKey = encryptionSession.encryptKey(encryptedKey);\n\n ClientMessage responseMessage = new ClientMessage(ClientMessage.MessageType.KEYS, sender + \" \" + aesKey);\n clientMessages.push(responseMessage);\n }\n }\n\n //Check if the message is a file\n else if (received.getMessageType().equals(ServerMessage.MessageType.FILE)) {\n String[] splitMessage = received.getPayload().split(\" \");\n String sender = splitMessage[0].toLowerCase();\n String base64String = splitMessage[2];\n\n new FileTransfer(base64String, splitMessage[0], true).readFile();\n System.out.println(\"You have received \" + splitMessage[1] + \" from \" + sender);\n }\n }\n }\n }\n\n disconnect();\n System.out.println(\"Client disconnected!\");\n }\n } catch (IOException e) {\n System.out.println(\"Ouch! Could not connect to server!\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void run()\n {\n TTL_CIL_Message msg;\n Command cmd;\n\n while( shutdown == false )\n {\n msg = null;\n cmd = null;\n try\n {\n\tmsg = (TTL_CIL_Message)cil.receiveMessage();\n\n\t// add Mesasge to a Hashtable(?) of mesages being dealt\n\t// with for reply with correct headers\n }\n catch( java.io.IOException ioe )\n {\n\tlogger.log( 1, logName, ioe );\n }\n\n if( msg == null )\n {\n\tlogger.log( 1, logName, \"null CIL_Message received\" );\n\t// reply with error\n }\n else if( msg.getMessageClass() ==\n\t TTL_CIL_MessageClass.E_CIL_ERR_CLASS )\n {\n\tlogger.log( 1, logName,\n\t\t \"ERROR message class received\" );\n\t// reply with error\n }\n //else if ( ( cmd = translator.translate( msg ) ) == null ) \n else if( cmd == null )\n {\n\tlogger.log( 1, logName,\n\t\t \"no translation available for message\" );\n\t// translate failed - send correct TTL_CIL_Message\n }\n\n new ExecutionThread( telescope, this, cmd ).start();\n }\n }", "@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\t//让改线程可以接受到客户端的信息;\n\t\t\ttry {\n//\t\t\t\tThread.sleep(2000);\n\t\t\tObjectInputStream ois=new ObjectInputStream(s.getInputStream());\n\t\t\tMessage message=(Message) ois.readObject();\n\t\t\tSystem.out.println(message.getSender()+\"给\"+message.getGetter()+\"说\"+message.getCon());\n\t\t\t//这里进行转发;\n\t\t\t/*\n\t\t\t * 转发时出现错误;???????????已解决;\n\t\t\t */\n\t\t\t//取得接收人的通讯线程;\n\t\t\tServerConnectClient scClient=ManageQQClientTh.getClientThread(message.getGetter());\n\t\t\tObjectOutputStream oos=new ObjectOutputStream(scClient.s.getOutputStream());\n\t\t\t\toos.writeObject(message);\n\t\t\n\t\t\t\t} catch (IOException | ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}", "@Override\n public void run()\n {\n System.out.println(\"[\" + getCurrentDateTimeStamp() + \"]\" + \" Received connection from: \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.INFO.toString(), \"Received connection from: \" + clientSocket);\n try (PrintWriter pw = new PrintWriter(clientSocket.getOutputStream());\n BufferedReader br = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()))) {\n String line = \"\";\n\n while ((line != null) && (!line.trim().toUpperCase().equals(\"CLOSE\")) && (!stop)) {\n if (!stop && !clientSocket.isClosed()) {\n synchronized (this) {\n line = br.readLine();\n }\n }\n\n if ((line != null) && (!line.trim().isEmpty()) && (!stop)) {\n if(\"getRegisterTopics\".equalsIgnoreCase(line))\n {\n sendRegisterTopics(pw);\n }\n else\n {\n line = processMessage(clientSocket, pw, line);\n }\n }\n }\n } catch (SocketException e1)\n {\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), \"the connection was interrupted by the client - \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), getStackTraceAsString(e1));\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] the connection was interrupted by the client - \" + clientSocket);\n } catch (IOException e)\n {\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), \"Error while try to read from client \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), getStackTraceAsString(e));\n System.out.println(\"Error while try to read from client \" + clientSocket);\n } finally {\n //remove from topic table\n synchronized (Server.class) {\n if (clientTopicsTable.containsKey(clientSocket)) {\n clientTopicsTable.remove(clientSocket);\n }\n //remove from threads table\n if (Server.handleClients.contains(this)) {\n Server.handleClients.remove(this);\n }\n }\n try {\n clientSocket.close();\n } catch (IOException e) {\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), \"Error while try to close socket clientSocket: \" + clientSocket);\n writeToLog(Server.LOG_LEVEL.FATAL.toString(), getStackTraceAsString(e));\n System.out.println(\"Error while try to close socket clientSocket: \" + clientSocket);\n }\n }\n }", "public void run() {\n try {\n String receivedMessage = \"\";\n \t\twhile (!receivedMessage.startsWith(this.PSEUDO+\" left.\")) {\n \n byte[] buf = new byte[256];\n DatagramPacket packet = new DatagramPacket(buf, buf.length);\n \n clientSocket.receive(packet);\n receivedMessage = new String(packet.getData(), packet.getOffset(), packet.getLength());\n\n conversation.append(receivedMessage + \"\\n\");\n\n \t\t}\n \t\tSystem.exit(0);\n\n \t} catch (Exception e) {\n \tSystem.err.println(\"Error in ReceptionClientThread:\" + e); \n }\n }", "public void run(){\n\t\t\tObjectReader readerClient = new ObjectReader(in, clientInetAddress);\r\n\t\t\treaderClient.start();\r\n\t\t\t\r\n\t\t\t// Constantly checks msgToSend for messages and sends them\r\n\t\t\twhile(true){\r\n\t\t\t\ttry{\r\n\t\t\t\t\t// Send message\r\n\t\t\t\t\tif(msgToSend.length() != 0){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tout.writeObject(new DataObject(DataObject.STRING, msgToSend.toString()));\r\n\t\t\t\t\t\tout.flush();\r\n\t\t\t\t\t\tmsgToSend.setLength(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tcatch(IOException ioe){\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (!client.isClosed()) {\n\t\t\t\t\tSystem.out.println(\"is socket connected\" + client.isConnected());\n\t\t\t\t\tInputStreamReader reader;\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\treader = new InputStreamReader(client.getInputStream());\n\t\t\t\t\t\tBufferedReader buf = new BufferedReader(reader);\n\t\t\t\t\t\tString msg = buf.readLine();\n\t\t\t\t\t\tif (msg != null) {\n\t\t\t\t\t\t\tSystem.out.println(\"server:\" + msg.toString());\n\t\t\t\t\t\t\tString ContextMsg = \"来自被连接的回复:\" + client.getInetAddress() + \"\\n\" + msg.toString();\n\t\t\t\t\t\t\ttextList.add(ContextMsg);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}", "public void run() \n { \n String message; // String for incoming messages\n \n // listen for messages until stopped\n while ( keepListening ) \n { \n try \n { \n message = input.readLine(); // read message from client\n } // end try\n catch ( SocketTimeoutException socketTimeoutException ) \n {\n continue; // continue to next iteration to keep listening\n } // end catch\n catch ( IOException ioException ) \n {\n ioException.printStackTrace(); \n break;\n } // end catch\n\n // ensure non-null message\n if ( message != null ) \n {\n // tokenize message to retrieve user name and message body\n StringTokenizer tokenizer = new StringTokenizer( \n message, MESSAGE_SEPARATOR );\n\n // ignore messages that do not contain a user\n // name and message body\n if ( tokenizer.countTokens() == 2 ) \n {\n // send message to MessageListener\n messageListener.messageReceived( \n tokenizer.nextToken(), // user name\n tokenizer.nextToken() ); // message body\n } // end if\n else\n {\n // if disconnect message received, stop listening\n if ( message.equalsIgnoreCase(\n MESSAGE_SEPARATOR + DISCONNECT_STRING ) ) \n stopListening();\n } // end else\n } // end if\n } // end while \n \n try\n { \n input.close(); // close BufferedReader (also closes Socket)\n } // end try\n catch ( IOException ioException ) \n {\n ioException.printStackTrace(); \n } // end catch \n }", "@Override\r\n\tpublic void run() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t//Get a list of pairs. The pair will be a chunkname with a chunkserver \r\n\t\t/*for(Pair<String, String> p: EventFactory.hostToFiles.getChunkLocations(message.getContent())){\r\n\t\t\tSystem.out.println(\"The location is: \" + p.getKey() + \" and the chunkname is: \" + p.getValue());\r\n\t\t\t\r\n\t\t\t//actual code will contact chunk servers and tell them to read and forward the file to the client\r\n\t\t\tMessage forwardToClient = new Message(\"ForwardChunkToClient\");\r\n\t\t\t//chunkname, servername, port\r\n\t\t\tforwardToClient.setContent(p.getKey());\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tTCPSender sender = new TCPSender(new Socket(p.getValue().split(\" \")[0], Integer.parseInt(p.getValue().split(\" \")[1])));\r\n\t\t\t\tsender.sendData(forwardToClient);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnknownHostException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}*/\r\n\t\t//Send the list to the client so it can request the chunks from chunkServers\r\n\t\t//Any other way seems like it would be beyond a pain. \r\n\t\tLinkedList<String> fileAndHosts = new LinkedList<String>();\r\n\t\tfor(PairStrings p: EventFactory.hostToFiles.getChunkLocations(message.getContent())) {\r\n\t\t\tString fileAndHost = p.getValue() + \" \" + p.getKey();\r\n\t\t\tfileAndHosts.add(fileAndHost);\r\n\t\t}\r\n\t\t\r\n\t\tMessage getFromChunkServers = new Message(\"RequestChunksFromServers\");\r\n\t\t\r\n\t\t//If the list is empy, the no file was found, report invalid.\r\n\t\tif(fileAndHosts.size() == 0) {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"invalid\" + \" \" + message.getContent());\r\n\t\t} else {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"valid\" + \" \" + message.getContent());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTCPSender sender = new TCPSender(new Socket(message.getSenderHostName(), message.getSenderPort()));\r\n\t\t\tsender.sendData(getFromChunkServers);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void run() { \n \n String received; \n while (true) { \n try { \n\n // receive the messages from clients\n received = dis.readUTF();\n ChatServer.writeOnThreads(received);\n\n } catch (IOException e) {\n try { \n this.dis.close(); \n this.dos.close(); \n\n } catch(IOException e1) { \n e1.printStackTrace(); \n } \n } \n } \n }", "@Override\n\tpublic void run() {\n\t\tInetSocketAddress remoteAddr = (InetSocketAddress) socket.getRemoteSocketAddress();\n\t\tChatServer.log(\"[server] connected by client[\" + remoteAddr.getAddress().getHostAddress() + \":\" + remoteAddr.getPort());\n\t\t\n\t\ttry {\n\t\t\t//2. 스트림 얻기\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), \"utf-8\"));\n\t\t PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream() ,\"utf-8\"),true);\n\t\t \n\t\t while(true) {\n\t\t \tString request = reader.readLine();\n\t\t \tSystem.out.println(request);\n\t\t \tif(request == null) {\n\t\t \t\tChatServer.log(\"클라이언트로 부터 연결 끊김\");\n\t\t \t\tbreak;\n\t\t \t}\n\t\t \tString[] tokens = request.split(\":\");\n\t\t \t// Join:둘리 일때 - 0은 Join 1은 둘리\n\t\t \tif(\"join\".equals(tokens[0])) {\n\t\t \t\tnickname = tokens[1]; \n\t\t \t\tdoJoin(nickname + \"님이 입장하였습니다.\", writer);\n\t\t \t}else if(\"message\".equals(tokens[0])) {\n\t\t \t\t\n\t\t \t\tdoMessage(nickname + \":\" + tokens[1] );\n\t\t \t}else if(\"quit\".equals(tokens[0])) {\n\t\t \t\tdoQuit(nickname + \"님이 퇴장하였습니다.\", writer);\n\t\t \t}else {\n\t\t \t\tChatServer.log(\"에러: 알수 없는 요청(\" + tokens[0] + \")\");\n\t\t \t}\n\t\t }\n\t\t\n\t\t} catch (SocketException e) {\n\t\t\tChatServer.log(nickname);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void handleMessage(Message message, Socket socket) throws IOException, HandlingException;", "public void run() {\n // open socket\n Socket s = null;\n int retries = 3;\n int retry_interval_ms = 100;\n for (int i = 0; i < retries; i++) {\n\n // create or find a socket server\n try {\n InetAddress localhost = InetAddress.getByName(null);\n if (id < otherId) {\n ServerSocket serverSocket = new ServerSocket(port, 0, localhost);\n s = serverSocket.accept();\n } else {\n s = new Socket(localhost, port);\n }\n System.out.println(logPrefix + \"socket connected\");\n break;\n\n // retry a few times if necessary\n } catch (IOException e) {\n System.out.println(logPrefix + \"Socket connection failure.\");\n System.out.println(logPrefix + e.getMessage());\n if (i < retries - 1) {\n System.out.println(logPrefix + \"Trying again...\");\n try {\n Thread.sleep(retry_interval_ms);\n } catch (InterruptedException e1) {\n }\n } else {\n System.out.println(logPrefix + \"Giving up.\");\n }\n }\n }\n\n // if socket exists, finish initialization then listen for messages\n if (s != null) {\n try (\n // get I/O streams\n PrintWriter xxx = outContainer[0] =\n new PrintWriter(s.getOutputStream(), true);\n BufferedReader in = new BufferedReader(new InputStreamReader(\n s.getInputStream()));\n ) {\n // enqueue received messages\n String inputLine;\n while ((inputLine = in.readLine()) != null) {\n messages.add(Integer.parseInt(inputLine));\n }\n } catch (IOException e) {\n System.out.println(logPrefix + \"Exception in socket thread.\");\n System.out.println(logPrefix + e.getMessage());\n }\n }\n }", "@Override\n public void run() {\n if (this.clientInterfaceTCP.getConnected())\n this.clientInterfaceTCP.sendString(this.messageToSend);\n }", "public void fromMicroServer() throws Exception {\n \tbyte[] buf = new byte[1024];\n\t\tDatagramPacket dp = new DatagramPacket(buf, 1024);\n\t\ttry{\n\t\t\ttoMicroServer.receive(dp);\n\t\t\trecieve = true;\n\t\t}\n\t\tcatch (IOException e){\n\t\t\tSystem.out.println(\"Connection timed out, retrying...\");\n\t\t\trecieve = false;\n\t\t\treturn;\n\t\t}\n str = new String(dp.getData(), 0, dp.getLength());\n\t\tSystem.out.printf(\"Child about to send message: %s \\n\", str);\n\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tServerSocket servClient = new ServerSocket(9090);\n\t\t\tSocket client;\n\t\t\tString id, msg;\n\t\t\tPackageToSend packageReceived;\n\t\t\twhile(true) {\n\t\t\t\tclient = servClient.accept();\n\t\t\t\tObjectInputStream inStream = \n\t\t\t\t\t\tnew ObjectInputStream(\n\t\t\t\t\t\t\t\tclient.getInputStream());\n\t\t\t\tpackageReceived = (PackageToSend) inStream.readObject();\n\t\t\t\tid = packageReceived.getId();\n\t\t\t\tmsg = packageReceived.getMsg();\n\t\t\t\tthis.textArea.append(id + \": \" + msg + \"\\n\");\n\t\t\t\tinStream.close();\n\t\t\t\tclient.close();\n\t\t\t}\n\t\t} catch (IOException | ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "private void receiveAndDispatchMessage() {\n String response = null;\n try {\n while((response = bufferedReader.readLine()) != null) {\n System.out.println(\"received message from server: \" + response);\n String messageKind = \"\";\n if(response.contains(\":\")) {\n messageKind = response.substring(0, response.indexOf(\":\"));\n } else {\n messageKind = response;\n }\n Bundle bundle = new Bundle();\n bundle.putString(\"response\", response);\n switch (messageKind) {\n case ClientMessageKind.SIGNUPDENIED:\n case ClientMessageKind.SIGNUPOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNUPACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNUPACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.SIGNINDENIED:\n case ClientMessageKind.SIGNINOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNINACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNINACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMDRIVER:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMPASSENGER:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERDEST:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.STARTRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n } else if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.ENDRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERENDSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERENDSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEPASSENGERPROFILEDENIED:\n case ClientMessageKind.UPDATEPASSENGERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEDRIVERPROFILEDENIED:\n case ClientMessageKind.UPDATEDRIVERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n default:\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@Override\r\n\tpublic void run() {\n\t\ttry {\r\n\t\t\t//creamos un server socket que se conecte al puerto 9999\r\n\t\t\tServerSocket servidor = new ServerSocket(9999);\r\n\t\t\t//instanciamos variables y un array list\r\n\t\t\tString nick, ip, mensaje;\r\n\t\t\t\r\n\t\t\tArrayList<String> listaIp = new ArrayList<String>();\r\n\t\t//y la clase paquete envio\r\n\t\t\tPaqueteEnvio paquete_recibido;\r\n\t\t\t\r\n\t\t\t//creamos un bucle infinito para que siempre este a la escucha\r\n\t\t\twhile(true) {\r\n\t\t\t\t//aceptamos la conexion\r\n\t\t\tSocket misocket = servidor.accept();\r\n\t\t\t//creamos una object inputstream para desmigar el paquete que nos viene del cliente\r\n\t\t\tObjectInputStream paquete_datos = new ObjectInputStream(misocket.getInputStream());\r\n\t\t\t//lo leemos\r\n\t\t\tpaquete_recibido = (PaqueteEnvio) paquete_datos.readObject();\r\n\t\t\t//lo desmigamos en variables con los metodos get\r\n\t\t\tnick = paquete_recibido.getNick();\r\n\t\t\t\r\n\t\t\tip = paquete_recibido.getIp();\r\n\t\t\t\r\n\t\t\tmensaje = paquete_recibido.getMensaje();\r\n\t\t\t\r\n\t\t\t//DataInputStream flujo_entrada = new DataInputStream(misocket.getInputStream());\r\n\t\t\t\r\n\t\t\t//String mensaje_texto = flujo_entrada.readUTF();\r\n\t\t\t\r\n\t\t\t//areatexto.append(\"\\n\"+mensaje_texto);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// diferenciamos los mensaje si es dimerente de \" online\" el mensaje\r\n\t\t\t if(!mensaje.equals(\" online\")) {\r\n\t\t\t\t //y si el id es diferente de \"Grupo\"\r\n\t\t\t\t if(!ip.equals(\"Grupo\")) {\r\n\t\t\t\t\t// mostramos el texto\r\n\t\t\t\t\t areatexto.append(\"\\n\"+ nick +\": \"+mensaje+\" para \"+ip);\r\n\t\t\t\t//creamos el socket con la ip recivida para enviar el mensaje\r\n\t\t\t\t\t Socket enviaDestinatario = new Socket(ip, 9090);\r\n\t\t\t\t//creamos el object stream \r\n\t\t\t\t\t ObjectOutputStream paqueteReenvio = new ObjectOutputStream(enviaDestinatario.getOutputStream());\r\n\t\t\t\t//escribimos en el\r\n\t\t\t\t\t paqueteReenvio.writeObject(paquete_recibido);\r\n\t\t\t\t//cerramos todo\r\n\t\t\t\t\t paqueteReenvio.close();\r\n\t\t\t\t\r\n\t\t\t\t\t enviaDestinatario.close();\r\n\t\t\t\t\r\n\t\t\t\t\t misocket.close();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t else {//en caso de ser \"Grupo\" hacemos exactamente lo mismo que antes menos por una cosa, primero mostramos texto\r\n\t\t\t\t\t areatexto.append(\"\\n Grupo-->\"+ nick +\": \"+mensaje+\" para grupo\");\r\n\t\t\t\t\t //creamos un bucle foreach en el que enviamos a cada ip del array el mensaje\r\n\t\t\t\t\t for(String z:listaIp) {\r\n\t\t\t\t\t\t //el socket lo creamos con z \r\n\t\t\t\t\t\t \tSocket enviaDestinatario = new Socket(z, 9090);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tnick = \"Grupo--->\"+nick;\r\n\t\t\t\t\t\t \t//le decimos que concatene el nick con el texto grupo para que el cliente sepa de donde viene el mensaje y que njo es algro privado\r\n\t\t\t\t\t\t \tpaquete_recibido.setNick(nick);\r\n\t\t\t\t\t\t\t//objetos de salida\r\n\t\t\t\t\t\t\tObjectOutputStream paqueteReenvio = new ObjectOutputStream(enviaDestinatario.getOutputStream());\r\n\t\t\t\t\t\t\t//escribimos\r\n\t\t\t\t\t\t\tpaqueteReenvio.writeObject(paquete_recibido);\r\n\t\t\t\t\t\t\t//cerramos todo\r\n\t\t\t\t\t\t\tpaqueteReenvio.close();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tenviaDestinatario.close();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tmisocket.close();\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t }\r\n\t\t\t\t\t \r\n\t\t\t\t \t\r\n\t\t\t\t \t\r\n\t\t\t\t }\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {// si el texto recibido seria \" online\" seria una peticion de conexion\r\n\t\t\t\t\r\n\t\t\t\t//-----------------DETECTA ONLINE--------------------\r\n\t\t\t\t//cojemos la ip de el mensajero\r\n\t\t\t\tInetAddress localizacion =misocket.getInetAddress();\r\n\t\t\t\t//la almacenamos\r\n\t\t\t\tString IpRemota = localizacion.getHostAddress();\r\n\t\t\t\t\r\n\t\t\t\t//System.out.println(\"Online \"+IpRemota);\r\n\t\t\t\t//la a�adimos al array list\r\n\t\t\t\tlistaIp.add(IpRemota);\r\n\t\t\t\t//escribimos en el objeto con el metodo setIps\r\n\t\t\t\tpaquete_recibido.setIps(listaIp);\r\n\t\t\t\t//creamos el bucle foreach\r\n\t\t\t\tfor(String z:listaIp) {\r\n\t\t\t\t\t//mostramos los usuarios conectados en el array\r\n\t\t\t\t\tareatexto.append(\"\\n Usuario conectado: \"+z);\r\n\t\t\t\t\t//creamos el socket para cada destinatario y enviamos la informacion\r\n\t\t\t\t\tSocket enviaDestinatario = new Socket(z, 9090);\r\n\t\t\t\t\t\r\n\t\t\t\t\tObjectOutputStream paqueteReenvio = new ObjectOutputStream(enviaDestinatario.getOutputStream());\r\n\t\t\t\t\t\r\n\t\t\t\t\tpaqueteReenvio.writeObject(paquete_recibido);\r\n\t\t\t\t\t\r\n\t\t\t\t\tpaqueteReenvio.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\tenviaDestinatario.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\tmisocket.close();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//---------------------------------------------------\r\n\t\t\t\t\r\n\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tServerSocket servidor = new ServerSocket(8888);\n\t\t\t\n\t\t\tString nick,ip,mensaje;\n\t\t\t\n\t\t\tPaquete paquete_recibido;\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\n\t\t\tSocket miSocket = servidor.accept();\n\t\t\t\n\t\t\tObjectInputStream paquete_datos = new ObjectInputStream(miSocket.getInputStream());\n\t\t\t\n\t\t\tpaquete_recibido =(Paquete) paquete_datos.readObject();\n\t\t\t\n\t\t\tnick = paquete_recibido.getNick();\n\t\t\t\n\t\t\tip = paquete_recibido.getIp();\n\t\t\t\n\t\t\tmensaje = paquete_recibido.getMensaje();\n\t\t\t\n\t\t\t\n\t\t\t/*DataInputStream flujo_entrada = new DataInputStream(miSocket.getInputStream());\n\t\t\t\n\t\t\tString mensaje = flujo_entrada.readUTF();\n\t\t\t\n\t\t\tareatexto.append(\"\\n\" + mensaje);\n\t\t\t*/\n\t\t\t\n\t\t\tareatexto.append(\"\\n\" +nick +\": \"+mensaje +\" para: \"+ ip);\n\t\t\t\n\t\t\t\n\t\t\tmiSocket.close();\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n public void run() {\n\n startPingTimer();\n String read = \"\";\n\n try {\n while ((read = in.readLine()) != null){\n\n //System.out.println(\"[CLIENT] Received: \" + read);\n messageHandler(read);\n\n }\n closeConnection();\n\n }catch (IOException e){\n\n System.out.println(\"[CLIENT] \" + e.getMessage());\n System.out.println(\"[CLIENT] Connection closed.\");\n\n }\n\n }", "public void run() {\n\t\tInputStream istream = null;\n\t\ttry {\n\t\t\tistream = (this.socket).getInputStream();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t DataInputStream dstream = new DataInputStream(istream);\n\t \n\t username = null;\n\t try {\n\t \tusername = dstream.readLine();\n\t \tSystem.out.println(username + \" on server side! (username)\");\n\t \tthis.masterServer.addUserName(username);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t // pause thread to read in from client.\n\t\tString friendUsername = null;\n\t try {\n\t \tfriendUsername = dstream.readLine();\n\t \tSystem.out.println(friendUsername + \" on server side!!!!! (friendUsername)\");\n\t \tfindFriendsThread(friendUsername);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t try {\n\t\t\tdstream.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t try {\n\t\t\tistream.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t //this.masterServer.addUserName(username);\n\t \n\t}", "@Override\r\n\tpublic void run() {\n\t\tsuper.run();\r\n\t\tString str;\r\n\t\ttry {\r\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\tsocket.getInputStream()));\r\n\r\n\t\t\twhile ((str = reader.readLine()) != null) {\r\n\t\t\t\tString[] msg = str.split(\",\");\r\n\t\t\t\tSystem.out.println(\"The message contents:\" + str);\r\n\t\t\t\twordDisp.setText(msg[0]);\r\n\t\t\t\tSystem.out.println(\"Message[0]\" + msg[0]);\r\n\t\t\t\tmessage.setText(msg[1].toUpperCase());\r\n\t\t\t\tSystem.out.println(\"Message[1]\" + msg[1]);\r\n\t\t\t\tattempts.setText(\"REMAINING: \" + msg[2]);\r\n\t\t\t\tSystem.out.println(\"Message[2]\" + msg[2]);\r\n\t\t\t\tscore.setText(\"SCORE: \" + msg[3]);\r\n\t\t\t\tSystem.out.println(\"Message[3]\" + msg[3]);\r\n\t\t\t}\r\n\t\t\tsocket.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void run() {\n try {\n while (!socket.isClosed()) {\n Message message = socket.receiveMessage();\n if (message != null) {\n logger.info(\"Received: \" + message);\n socket.sendMessage(message);\n logger.info(\"Sent: \" + message);\n } else {\n // Close socket if no messages were received.\n // NOTE: This is a simplifying assumption that no messages means the client has been shutdown\n // and the application lifecyle has come to an end. Otherwise a shutdown message should be\n // detected and handled accordingly.\n socket.close();\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n executorService.shutdown();\n }", "public void run() {\n // Initial connect request comes in\n Request request = getRequest();\n\n if (request == null) {\n closeConnection();\n return;\n }\n\n if (request.getConnectRequest() == null) {\n closeConnection();\n System.err.println(\"Received invalid initial request from Remote Client.\");\n return;\n }\n\n ObjectFactory objectFactory = new ObjectFactory();\n Response responseWrapper = objectFactory.createResponse();\n responseWrapper.setId(request.getId());\n responseWrapper.setSuccess(true);\n responseWrapper.setConnectResponse(objectFactory.createConnectResponse());\n responseWrapper.getConnectResponse().setId(id);\n\n // Return connect response with our (statistically) unique ID.\n if (!sendMessage(responseWrapper)) {\n closeConnection();\n System.err.println(\"Unable to respond to connect Request from remote Client.\");\n return;\n }\n\n // register our thread with the server\n Server.register(id, this);\n\n // have handler manage the protocol until it decides it is done.\n while ((request = getRequest()) != null) {\n\n Response response = handler.process(this, request);\n\n if (response == null) {\n continue;\n }\n\n if (!sendMessage(response)) {\n break;\n }\n }\n\n // client is done so thread can be de-registered\n if (handler instanceof IShutdownHandler) {\n ((IShutdownHandler) handler).logout(Server.getState(id));\n }\n Server.unregister(id);\n\n // close communication to client.\n closeConnection();\n }", "@Override\n public void run() {\n P.print(\"Receive thread starts up.\");\n try {\n ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());\n while (P.choke_thread_running) { //read input forever.\n try{\n Object o = ois.readObject(); //blocking.\n if (o instanceof Handshake) { // this is a Handshake.\n Handshake hs = (Handshake)o;\n P.print(\"Received handshake from \"+hs.pid);\n }\n else if(o instanceof Message){ //this is a Message.\n Message M = (Message) o;\n if(M.type==0){\n P.print(\"Received choke from \"+t.getName());\n }\n else if(M.type==1){\n P.print(\"Received unchoke from \"+t.getName());\n }\n else if(M.type==2){\n P.print(\"Received interested from \"+t.getName());\n }\n else if(M.type ==3){\n P.print(\"Received not_interested from \"+t.getName()); \n }\n else if(M.type==4){\n P.print(\"Received have from \"+t.getName());\n }\n else if(M.type==5){\n P.print(\"Received bitfield from \"+t.getName());\n }\n else if(M.type==6){\n P.print(\"Received request from \"+t.getName());\n }\n else if(M.type==7){\n P.print(\"Received piece from \"+t.getName());\n }\n else{\n P.print(\"Error: undefined message type: \"+M.type);\n }\n }\n else {\n System.out.println(\"Class not found.\");\n }\n }\n catch(ClassNotFoundException ex){\n ex.printStackTrace();\n }\n }\n ois.close();\n socket.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tInputStream inputStream = mSocket.getInputStream();\n\t\t\tint leng;\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\tByteArrayBuffer[] data = {new ByteArrayBuffer(1024 * 32)};\n\t\t\twhile((leng = inputStream.read(buffer)) != -1 && mConected)\n\t\t\t{\n\t\t\t\tif(mConected)\n\t\t\t\t{\n\t\t\t\t\tdata[0].append(buffer, data[0].length(), leng);\n\t\t\t\t\tprocessMessage(data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(TAG, \"Cannot set InputStream\\nNetwork error\");\n\t\t\tevent.connectionLost();\n\t\t} catch (ProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tevent.connectionLost();\n\t\t}\n\t}", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile (socket != null && !socket.isClosed()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbInputStream.read(rbyte);\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\tmsg.obj = rbyte;\r\n\t\t\t\t\t\treHandler.sendMessage(msg);\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}", "private void Thread() {\n\n Thread thread = new Thread ( new Runnable() {\n \n @Override\n public void run() {\n \n String mensagem = \"\";\n\n try {\n \n InputStreamReader isr = new InputStreamReader(socket.getInputStream());\n BufferedReader br = new BufferedReader(isr);\n\n while ((mensagem = br.readLine()) != null) {\n\n enviarMensagem(mensagem);\n }\n } catch ( Exception e ) {\n e.printStackTrace();\n }\n }\n });\n //para iniciar a thread\n thread.start();\n }", "public synchronized void run() {\n\t\t\tGameMessage message;\n\t\t\ttry {\n\t\t\t\twhile((message = (GameMessage) ois.readObject()) != null) {\n\t\t\t\t\tparseMessage(message);\n\t\t\t\t}\n\t\t\t} catch(Exception e) {\n\t\t\t\ttable.printMsg(\"Unable to receive message from server. Connection will be terminated.\");\n\t\t\t\ttable.printMsg(\"Try to Connect again.\");\n\t\t\t\ttry {\n\t\t\t\t\tsock.close();\n\t\t\t\t} catch(Exception ee) {\n\t\t\t\t\t// doing nothing\n\t\t\t\t}\t\n\t\t\t\tsock = null;\n\t\t\t\tSystem.out.println(\"Unable to receive message from server.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\ttable.repaint();\n\t\t}", "public void handleMessage(Message message, DatagramSocket socket, DatagramPacket packet) throws HandlingException, IOException, ClassNotFoundException;", "private void getMessage() throws Exception {\n\t\tGetTimestamp(\"Getting Message: \");\n\t\tString msg = \"\";\n\t\tString decmsg = \"\";\n\t\tbyte[] result;\n\t\ttry {\n\t\t\tmsg = br.readLine();\n\t\t\tJSONObject RESPONSE = new JSONObject();\n\t\t\tRESPONSE.put(\"payload\", msg);\n\t\t\tSystem.out.println(RESPONSE);\n\t\t\tdecmsg = decrypt(serversharedkey, msg);\n\t\t\tSystem.out.println(\"Decrypted Message from client is \" + decmsg);\n\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t\tif (decmsg.equalsIgnoreCase(\"bye\")) {\n\t\t\tSystem.out.println(\"Client has signed out!\");\n\t\t\tcloseConnection();\n\n\t\t} else {\n\t\t\tsendMessage();\n\t\t}\n\n\t}", "private void run() throws IOException\r\n {\r\n\r\n // Make connection and initialize streams\r\n String serverAddress = getServerAddress();\r\n Socket socket = new Socket(serverAddress, 9001);\r\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n out = new PrintWriter(socket.getOutputStream(), true);\r\n\r\n // Process all messages from server, according to the protocol.\r\n while (true) {\r\n String line = in.readLine();\r\n if (line.startsWith(\"SUBMITNAME\")) {\r\n out.println(getName());\r\n } else if (line.startsWith(\"NAMEACCEPTED\")) {\r\n textField.setEditable(true);\r\n } else if (line.startsWith(\"MESSAGE\")) {\r\n messageArea.append(line.substring(8) + \"\\n\");\r\n }\r\n }\r\n }", "public void run() {\r\n\r\n mRun = false;\r\n\r\n try {\r\n //here you must put your computer's IP address.\r\n InetAddress serverAddr = InetAddress.getByName(SERVER_IP);\r\n\r\n //create a socket to make the connection with the server\r\n socket = new Socket(serverAddr, SERVER_PORT);\r\n\r\n\r\n Log.i(TAG, \"run: connected\");\r\n\r\n mBufferOut = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);\r\n\r\n //receives the message which the server sends back\r\n mBufferIn = new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n mRun = true; // socket attached so connected\r\n\r\n String line = mBufferIn.readLine();\r\n\r\n while (line != null) {\r\n mServerMessage = line;\r\n\r\n if (mMessageListener != null) {\r\n Log.i(TAG, \"server response: \" + mServerMessage);\r\n //call the method onResponseReceived from MyActivity class\r\n mMessageListener.onResponseReceived(mServerMessage);\r\n }\r\n\r\n line = mBufferIn.readLine();\r\n }\r\n\r\n } catch (ConnectException e) {\r\n Log.d(TAG, e.getMessage());\r\n\r\n Log.d(TAG, \"trying to reconnect\");\r\n if (retry < 10) {\r\n retry++;\r\n\r\n // try to reconnect after 3 seconds\r\n try {\r\n Thread.sleep(3000);\r\n } catch (InterruptedException ie) {\r\n Log.d(TAG, \"interruptedexception\");\r\n }\r\n\r\n run();\r\n } else {\r\n mRun = false;\r\n retry = 1;\r\n\r\n // reconnect after 30 seconds\r\n try {\r\n Log.d(TAG, \"sleep for 30\");\r\n Thread.sleep(30000);\r\n } catch (InterruptedException ie) {\r\n Log.d(TAG, \"interruptedexception\");\r\n }\r\n\r\n run();\r\n }\r\n\r\n\r\n\r\n }\r\n catch (SocketException e) {\r\n Log.e(TAG, \"socket ex: \" + e.getMessage());\r\n // we want to reconnect\r\n if (e.getMessage().contains(\"ECONNRESET\") || e.getMessage().contains(\"ETIMEDOUT\")) {\r\n run();\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.e(TAG, \"S: Error\", e);\r\n }\r\n finally {\r\n //the socket must be closed. It is not possible to reconnect to this socket\r\n // after it is closed, which means a new socket instance has to be created.\r\n try {\r\n if (socket != null) {\r\n socket.close();\r\n retry = 1;\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.e(TAG, \"error closing socket: \" + e.getMessage());\r\n }\r\n }\r\n\r\n mRun = true;\r\n }", "public void run() {\n\t\t\twhile (true) {// 保持连接直到异常发生或套接字返回\n\t\t\t\ttry {\n\t\t\t\t\tif (serverSocket != null) {\n\t\t\t\t\t\tmTempSocket = serverSocket.accept(); // 如果一个连接同意\n\t\t\t\t\t}\n\t\t\t\t\t// If a connection was accepted\n\t\t\t\t\tif (mTempSocket != null) {\n\t\t\t\t\t\t// Do work to manage the connection (in a separate\n\t\t\t\t\t\t// thread)\n\t\t\t\t\t\tmanageConnectedSocket(); // 管理一个已经连接的RFCOMM通道在单独的线程。\n\t\t\t\t\t\tserverSocket.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void run() {\n try {\n // 대화명 입력 받기\n printWriter.println(\"대화명을 입력하세요\");\n userId = bufferedReader.readLine();\n\n // 서버에서 각 클라이언트에 대화명 출력\n chatGUIServer.broadCast(\"[\" + userId + \"]\" + \"님이 입장했습니다.\");\n\n // 무한 대기하며 입력한 메세지를 각 클라이언트에 계속 전달\n while ((strSend = bufferedReader.readLine()) != null) {\n chatGUIServer.broadCast(\"[\" + userId + \"]: \" + strSend);\n }\n } catch (Exception e) {\n // 접속자 퇴장시 v에서 해당 클라이언트 스레드 제거\n chatGUIServer.removeThread(this); // this: ServerThread 객체, 접속 클라이언트\n // 서버에서 각 클라이언트에 출력\n chatGUIServer.broadCast(\"[\" + userId + \"]\" + \"님이 퇴장했습니다.\");\n\n // 콘솔에 퇴장 클라이언트 IP 주소 출력\n System.out.println(socket.getInetAddress() + \"의 연결이 종료됨!\");\n }\n }", "public void run() {\n try {\n\n // Decorate the streams so we can send characters\n // and not just bytes.  Ensure output is flushed\n // after every newline.\n BufferedReader in = new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n PrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n\n // Send a welcome message to the client.\n out.println(\"Hello, you are client #\" + clientNumber + \".\");\n out.println(\"Enter a line with only a period to quit\\n\");\n\n // Get messages from the client, line by line; return them\n // capitalized\n while (true) {\n String input = in.readLine();\n if (input == null || input.equals(\".\")) {\n break;\n }\n out.println(input.toUpperCase());\n }\n } catch (IOException e) {\n log(\"Error handling client# \" + clientNumber + \": \" + e);\n } finally {\n try {\n socket.close();\n } catch (IOException e) {\n log(\"Couldn't close a socket, what's going on?\");\n }\n log(\"Connection with client# \" + clientNumber + \" closed\");\n }\n }", "@Override\n public void run() {\n try {\n while(!this.socket.isClosed()) {\n System.out.println(\"Unicast Server Ok\");\n Socket distant = this.socket.accept();\n System.out.println(\"Connexion établie\");\n Discussion discussion =new Discussion(distant);\n discussion.addObserver(this);\n chatRooms.put(distant.getInetAddress(), discussion);\n new Thread(discussion).start();\n }\n } catch (IOException e) {\n System.out.println(\"Erreur socket unicast\");\n }\n }", "@Override\r\n\t public void run() {\n\t\tsuper.run();\r\n\t\ttry {\r\n\t\t // String newParams=URLEncoder.encode(params, \"utf-8\");\r\n\t\t String newurl = url + \"?\" + params;\r\n\r\n\t\t URL uri = new URL(newurl);\r\n\t\t try {\r\n\t\t\tHttpURLConnection conn = (HttpURLConnection) uri\r\n\t\t\t\t.openConnection();\r\n\t\t\tconn.connect();\r\n\t\t\t// 获取返回结果\r\n\t\t\tif (conn.getResponseCode() == 200) {\r\n\t\t\t InputStream is = conn.getInputStream();\r\n\t\t\t String result = convertInputStreamToString(is);\r\n\t\t\t // 通过handle发送消息\r\n\t\t\t Message msg = new Message();\r\n\t\t\t msg.what = 2;\r\n\t\t\t msg.obj = result;\r\n\t\t\t handle.sendMessage(msg);\r\n\t\t\t}\r\n\t\t } catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t }\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t }", "public void run()\n\t{\n\t\tSystem.out.println(\"Connection established: \" + clientSocket);\n\t\tThread messageThread; // start a new Thread on TCPReceiver to receive messages through clientSocket.\n\t\ttry \n\t\t{\n\t\t\tmessageThread = new Thread(new TCPNodeReceiver(clientSocket, messagingNode), \"tcpReceiverThread\"); // pass a copy of the MessagingNode to TCPNodeReceiver.\n\t\t\tmessageThread.start(); // start receiving messages.\t\t\t\t\t\n\t\t} \n\t\tcatch (IOException e) {\n\t\t\tSystem.err.println(\"messagingNodeThread got error: \" + e.getMessage());\n\t\t} \n\t}", "public void run() {\r\n String request = \"\";\r\n\r\n try {\r\n /**\r\n * The ClientConnectionHandler constantly waits for requests from the client. Requests are the initial message\r\n * that the client sends. This initial message determines how the server receives the messages that come after\r\n * it (if there are any).\r\n */\r\n while (isOpen) {\r\n request = readMessage();\r\n processRequest(request);\r\n }\r\n clientSocket.close();\r\n System.out.println(\"Client #\" + clientNumber + \" has closed\");\r\n } catch (Exception e) {}\r\n }", "public void runServer() throws Exception{\n \twhile (true) \n {\n \trecieve = false;\n try\n {\n System.out.printf(\"Child process received message: %s\\n\", message);\n System.out.println(\"Child about to send message: OK. Command?\\n\");\n line = in.readUTF();\n \n // parses the commands as a long then initializes it to an array list\n long numbers = Long.parseLong(line);\n ArrayList<Long> array = new ArrayList<Long>();\n do {\n \tarray.add(0, numbers % 10);\n \tnumbers /= 10;\n } \n while(numbers > 0 );\n str = message;\n \n // loops through the commands and applies the appropriate transformation based on order\n for (Long num : array) {\n \trecieve = false;\n \twhile(!recieve && num < 7 && num >0) {\n \t\tsendMicroServer(str, num);\n \t\tfromMicroServer();\n }\t\n }\n // writes the message back to the client after successfully transforming it\n sendBack = new DataOutputStream(socket.getOutputStream()); \n \t\tsendBack.writeUTF(str);\n \t\tstr = message;\n } \n catch(IOException i) \n { \t\n System.out.println(\"Client has exited the program.\");\n System.exit(1);\n \n } \n } \n }", "public void run()\n {\n \n try {\n String Msg = \"\";\n ArrayList<String> tokens=new ArrayList<String>();\n while ((Msg = this.reader.readLine())!=null)\n {\n if(!tokens.isEmpty())\n {\n //not empty,clear.\n tokens.clear();\n\n }\n //check the msg\n System.out.println(\"Inside while, Received msg in client handler:\"+Msg);\n //all the meta datas are separated using :\n tokens.addAll(Constants.tokens(Msg, \":\"));\n //if it's a login request\n if(tokens.contains(Constants.LOGIN_ID))\n {\n this.userID=tokens.get(1);//the 2nd string of this format LOGIN_ID:username:password\n this.password=tokens.get(2);\n this.client_delegate.validate(this);\n }\n //if it's a log out request.\n if(tokens.contains(Constants.LOGOUT_ID))\n {\n this.client_delegate.logout(this);\n }\n //public room message\n if(tokens.contains(Constants.PUBLIC_ROOM))\n {\n \n if(tokens.get(1).contains(\"file\"))\n {\n //there is smiley,but the parts were separated due to the presence of an internal : after word 'file'\n this.client_delegate.sendMessage(tokens.get(1)+\":\"+tokens.get(2));\n }\n else\n {\n //the message is without smiley...\n this.client_delegate.sendMessage(tokens.get(1));\n }\n \n }\n //private message\n if(tokens.contains(Constants.MESSAGE_ID))\n {\n //private message\n if(tokens.get(2).contains(\"file\"))\n {\n //there is smiley,but the parts were separated due to the presence of an internal : after word 'file'\n this.client_delegate.sendMessageFromThisTo(tokens.get(1), tokens.get(2)+\":\"+tokens.get(3), tokens.get(4));\n }\n else\n {\n //the message is without smiley...\n this.client_delegate.sendMessageFromThisTo(tokens.get(1), tokens.get(2), tokens.get(3));\n }\n }\n if(tokens.contains(Constants.FILE))\n {\n this.client_delegate.sendFileTo(tokens.get(1), Integer.parseInt(tokens.get(2)), tokens.get(3));\n }\n \n \n\n }\n } catch (Exception ex) {\n System.out.printf(\"Error parsing message from client:%s.\",this.userID);\n }\n }", "@Override\n public void run() {\n try{\n System.out.println(\"A new client is trying to connect\");\n inputFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n outputFromServer = new PrintWriter(socket.getOutputStream(),true);\n retrievingClientInformation(); // Identifies clients\n sendPreviousMessagesToClient(); // Sends last 15 messages to new comers\n while (clientConnected) // It will execute until client sends a signal to disconnect\n {\n readMessagesFromClients(); // Reads a client inputs then sends them to other clients\n }\n }catch (IOException ioException)\n {\n \tSystem.out.println(username + \" has left the chat.\"); // Announce client's disconnection on server\n }finally {\n try\n {\n socket.close();\n }catch (IOException ioException)\n {\n \tSystem.out.println(username + \" has left the chat.\"); // Announce client's disconnection on server\n }\n }\n }", "abstract public Object handleMessage(Object message) throws Exception;", "@Override\r\n\tpublic void run() {\n\t\tString msg;\r\n\t\ttry\r\n\t\t{\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t\tBufferedReader inFromClient =\r\n\t\t\t\t new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n\t\t\t\t DataOutputStream outToClient = new DataOutputStream(socket.getOutputStream());\r\n\t\t\t\t \r\n\t\t\t\t String clientSentence;\r\n\t\t\t\t while((clientSentence = inFromClient.readLine())!=null)\r\n\t\t\t\t {\t\r\n\t\t\t\t\t System.out.println(\"Received: \" + clientSentence);\r\n\t\t\t\t\t System.out.println(\"port: \" + socket.getPort());\r\n\r\n\t\t\t\t\t String newsentence = clientSentence + '\\n';\r\n\t\t\t\t\t outToClient.writeBytes(\"Server: \"+newsentence);\r\n\t\t\t\t\t \r\n\t\t\t\r\n\t\t\t\t }\r\n//\t\t\t\t \r\n//\t\t\t\t\treader.close();\r\n//\t\t\t\t\tinFromClient.close();\r\n//\t\t\t\t\toutToClient.close();\r\n//\t\t\t\t\tsocket.close();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(SocketException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Client has Disconnected\");\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void run(){\n\t\ttry{\n\t\t\tin = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\twhile(true){\n\t\t\t\ttry{\t\t\t\t\t\n\t\t\t\t\tmethReception(in);\n\t\t\t\t\texeBdd();\n\t\t\t\t\tmethEnvoie();\n\t\t\t\t}catch(IllegalArgumentException | ExecutionException | InterruptedException a){\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(a.getMessage());\t\t\t\t\n\t\t \tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"Fin des comunucations avec :\" + socket.getPort());\n\t\t\tAuthentification.CLIENTS.remove(this);\n\t\t\tsocket.close();\t\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"problème BufferedReader du ChatServeur\");\n\t\t\t//e.printStackTrace();\n\t\t}\n\t}", "@Override\n public void run() {\n try {\n socket = new Socket(\"192.168.0.165\", 2000);\n out = new PrintWriter(socket.getOutputStream());\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n ReadThread readThread = new ReadThread();\n readThread.start();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n boolean done = false;\n\n while (!done) {\n if (message != null) {\n try {\n out.print(message);\n out.flush();\n message = null;\n } catch (Exception e) {\n e.printStackTrace();\n try {\n socket.close();\n in.close();\n out.close();\n done = true;\n } catch (IOException d) {\n e.printStackTrace();\n }\n }\n }\n }\n disconnect();\n }", "@Override\r\n public void run() {\r\n\r\n try {\r\n is = threadSocket.getInputStream();\r\n isr = new InputStreamReader(is);\r\n br = new BufferedReader(isr);\r\n\r\n String line = new String();\r\n GLogger.debug(Modules.NETWORK, \"Waiting for client {\" + threadSocket.toString() + \"}\");\r\n \r\n while ((!isDone) && (line = br.readLine()) != null) {\r\n \tprocessInput(line);\r\n }\r\n } catch (Exception e) {\r\n\r\n GLogger.error(Modules.NETWORK, \"IO Exception during client communication\");\r\n } finally {\r\n\r\n try {\r\n\t\t\t\t\tbr.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n \r\n ClientStore.removeClient(threadSocket);\r\n try {\r\n\t\t\t\t\tthreadSocket.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n }\r\n\r\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry{\n\t\t\t\t\n\t \tSocket s=new Socket(\"192.168.3.176\",9000);\n\t \tBufferedReader reader=new BufferedReader(new InputStreamReader(s.getInputStream()));\n\t \tString info=reader.readLine();\t \n\t \ttext.setText(\"服务器收到的消息:\"+info); \t\n\t reader.close();\n\t s.close();\n\t }catch(Exception e){\n\t \te.printStackTrace();\n//\t \tSystem.out.print(c);\n\t //\ttext.setText(\"出错了\"); \n\t }\n\t\t}", "@Override\n public void run() {\n while (!bShutDown || !messageCache.isEmpty()) {\n try {\n while (!messageCache.isEmpty()) {\n HttpMessage httpMessage = messageCache.poll();\n if (httpMessage != null) {\n SendResult result = sendMessageWithHostInfo(\n httpMessage.getBodies(), httpMessage.getGroupId(),\n httpMessage.getStreamId(), httpMessage.getDt(),\n httpMessage.getTimeout(), httpMessage.getTimeUnit());\n httpMessage.getCallback().onMessageAck(result);\n }\n }\n TimeUnit.MILLISECONDS.sleep(proxyClientConfig.getAsyncWorkerInterval());\n } catch (Exception exception) {\n logger.error(\"exception caught\", exception);\n }\n }\n }", "@Override\n public void run() {\n try {\n boolean busy = true;\n while (busy) {\n AbstractBasicMessage msg = readMsg();\n if (msg != null) {\n busy = msg.operate(this.persistor, this.pushServer);\n }\n }\n } catch (IOException e) {\n // Treat an IOException as a termination of the message\n // exchange, and let this message-processing thread die.\n\n // CODE VON DOZENTEN...\n } catch (OperationNotSupportedException ex) {\n System.out.println(\"Error while reading incoming message\");\n ex.printStackTrace();\n }\n }", "@Override\n\tpublic void run() {\n\t\n\t\tboolean finMsg = false;\n\n \n \n\t\ttry {\n\t\t\t\n\t\t DataInputStream is = new DataInputStream(socket.getInputStream());\n DataOutputStream os = new DataOutputStream(socket.getOutputStream()); \n\t\t\t\n\t\t\twhile (!finMsg) {\n\t\t\t\t\n\t\t\tString[] client_Msg = is.readUTF().split(\" \");\n\t\t\t\t\n\t\t\tswitch (client_Msg[1]) {\n\t\t\t\n\t\t\t\tcase \"REG\":\n\t\t\t\t\thandleRegister(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"RDY\":\n\t\t\t\t\thandleReady(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"MOV\":\n\t\t\t\t\thandleMove(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tcase \"FIN\":\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tfinMsg=true;\n\t\t\t\t\tbreak;\n\t\t\t \n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t \n\t\t\t}\n\t\t\t\t\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"Waiting for input\");\n\t\t// Handle reading data until we exit\n\t\tByteBuffer buf = ByteBuffer.allocate(2048);\n\t\twhile (!stopper && socketChannel.isOpen()) {\n\t\t\tSystem.out.println(\"Reading the socket\");\n\t\t\ttry {\n\t\t\t\t// No input from the user in 60 seconds results in kicking them\n\t\t\t\t// out\n\t\t\t\tint bytesRead = socketChannel.read(buf).get(60, TimeUnit.SECONDS);\n\t\t\t\t// ByteBuffer dst = ByteBuffer.allocate(bytesRead);\n\t\t\t\t// engine.unwrap(buf, dst);\n\t\t\t\tSystem.out.println(\"Got data of size: \" + bytesRead);\n\t\t\t\t// convert to proto\n\t\t\t\tcommonUIElements.MessageProtos.Message msg = commonUIElements.MessageProtos.Message\n\t\t\t\t\t\t.parseFrom(Arrays.copyOf(buf.array(), bytesRead));\n\t\t\t\tSystem.out.println(\"RXed: \" + msg.toString());\n\t\t\t\tif (!msg.getName().equals(name)) {\n\t\t\t\t\tname = msg.getName();\n\t\t\t\t}\n\t\t\t\t// add data to the message queue\n\t\t\t\tif (SignatureSystem.verifySignature(msg.getSignature(), msg.getMessage(), msg.getName(), trustStore)) {\n\t\t\t\t\tmessages.put(\n\t\t\t\t\t\t\tnew Message(msg.getSender(), msg.getMessage(), msg.getSignature(), msg.getClearance()));\n\t\t\t\t} else {\n\t\t\t\t\tMessage error = new Message(msg.getSender(), \"Error: signture is invalid\", msg.getSignature(),\n\t\t\t\t\t\t\tmsg.getClearance());\n\t\t\t\t\terror.error = true;\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t}\n\t\t\t\t// clear the buffer for the next message\n\t\t\t\tbuf.clear();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"Failed to add message to the queue: \" + e.getMessage());\n\t\t\t\tMessage error = new Message(this.name, \"Disconnected\", \"\", 1);\n\t\t\t\terror.error = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (TimeoutException e) {\n\t\t\t\tSystem.err.println(\"Timeout hit, waiting again\");\n\t\t\t\tMessage error = new Message(this.name, \"Client: \" + this.name + \" has timed out\", \"\", 1);\n\t\t\t\terror.kill = true;\n\t\t\t\ttry {\n\t\t\t\t\tmessages.put(error);\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\tSystem.err.println(\"Thread has an error, can't inform server of this transgression\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tSystem.err.println(\"Execution error, breaking out of loop\");\n\t\t\t\tbreak;\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\tSystem.err.println(\"Invalid protobuf received: \" + e.getMessage());\n\t\t\t\t// } catch(SSLException e) {\n\t\t\t\t// System.err.println(\"SSL Failed: \" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tsocketChannel.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Failed to close socket while exiting\");\n\t\t}\n\t\tSystem.out.println(\"Exiting thread...\");\n\t}", "public void run() {\n // Check if the specified connector is null\n //\n if(this.connector == null) {\n System.out.println(\"[ERROR] connector is null aborting\");\n return;\n }\n\n //\n // Keep reading messages\n //\n while (true) {\n AeMessage inMsg = connector.read();\n if(inMsg == null) {\n System.out.println(\"[ERROR] Received an invalid message\");\n connector.reconnect();\n try {\n Thread.sleep(10000);\n }\n catch(Exception e) {\n }\n }\n else {\n //\n // Reject messages over two minutes old\n //\n if(inMsg.checkMessageOlderThan(120) == 1) {\n System.out.println(\"[INFO] Message has expired: \" + inMsg.toString());\n }\n else if(inMsg.getMessageType().equals(\"22\")) {\n System.out.println(\"[INFO] Received message:\" + inMsg.toString());\n if(messageStore.reportMessage(inMsg)) {\n System.out.println(\"[INFO] Successfully added message to the store\");\n }\n else {\n System.out.println(\"[ERROR] Failed to add message to the store\");\n }\n }\n }\n }\n }", "public void run(){\n //wait for clients to connect to the server and start a new thread,\n //then continue waiting.\n while(true) {\n //create the packet to accept a message\n byte[] buf = new byte[bufSize];\n DatagramPacket packet = new DatagramPacket(buf, buf.length);\n try {\n //receive a message from the client\n datagramSocket.receive(packet);\n } catch (IOException e) {\n System.err.println(\"Error receiving datagram packet\");\n } catch (Exception e){\n serverGUI.displayText(\"Error: There is an issue with your connection. Please restart the program.\");\n }\n //Start a new thread for this client\n ServerThread servant = new ServerThread(mainServer, packet, serverGUI);\n servant.start();\n }\n }", "@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }", "public Thread messageHandler(boolean isGUI, ClientView clientView) {\n Gson gson = new Gson();\n this.isGUI = isGUI;\n return new Thread(() -> {\n MessageEnvelope envelope = null;\n try {\n do {\n String inputMessage = (String)serverInput.readObject();\n envelope = gson.fromJson(inputMessage, MessageEnvelope.class);\n if (envelope.getType() != MessageType.PING) {\n synchronized (messageQ) {\n messageQ.add(inputMessage);\n messageQ.notifyAll();\n }\n if (!isGUI && envelope.getType().equals(MessageType.ENDGAME)) {\n EndGameMessage endGameMessage = gson.fromJson(envelope.getMessage(), EndGameMessage.class);\n if (!endGameMessage.isWinner() && !endGameMessage.getPlayer().isEmpty()) {\n clientView.endRead(true);\n }\n }\n }\n } while (!socket.isClosed() && !view.isQuitting());\n } catch (IOException | ClassNotFoundException e) {\n // If this branch is executed when the user is not really quitting, there was a server disconnection.\n // If the user is quitting, this thread is terminated (catches the exception because of the socket closing),\n // due to viewRun socket.close() call (should do nothing)\n if (!view.isQuitting()) {\n // Line needed to avoid another do..while iteration in viewRun()\n view.setQuitting(true);\n EndGameMessage message = new EndGameMessage(\"\", null);\n MessageEnvelope finalEnvelope = new MessageEnvelope(MessageType.ENDGAME, gson.toJson(message, EndGameMessage.class));\n try {\n serverInput.close();\n clientOutput.close();\n socket.close();\n synchronized (messageQ) {\n messageQ.add(gson.toJson(finalEnvelope, MessageEnvelope.class));\n messageQ.notifyAll();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n if (!isGUI) {\n clientView.endRead(false);\n }\n }\n }\n });\n }", "@Override\n\t\tpublic void run()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\twhile (keepListening)\n\t\t\t\t{\n\t\t\t\t\tString rcvStr = is.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//We must make sure that this packet has been sent here correctly.\n\t\t\t\t\tif (rcvStr != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//TO-DO parse message here and notify controller\n\t\t\t\t\t\t//just transmit it to controller.\n\t\t\t\t\t\tSystem.out.println(\"receive reply : \" + rcvStr);\n\t\t\t\t\t\tmyController.parseResponse(rcvStr);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//The receive String is null means that this connection is broken.\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"at ControlChannel listenRunnable : receive null response\");\n\t\t\t\t\t\tkeepListening = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "private void receiveServerMessage() throws IOException {\n mRemoteServerMessage = lengthValueRead(in, ServerMessage.class);\n if (mRemoteServerMessage == null) {\n setExchangeStatus(Status.ERROR);\n setErrorMessage(\"Remote server message was not received.\");\n throw new IOException(\"Remote server message was not received.\");\n }\n }", "public void run() {\n\t\tString line = null;\n\t\tMessage message;\n\t\tBufferQueueElement<Message> messageList = new BufferQueueElement<Message>();\n\t\tlong t1 = System.nanoTime();\n\t long t2 = 0;\n\t\ttry {\n\t\t\twhile ((line = messageIO.readMessage()) != null) {\n\t\t\t\tt2 = System.nanoTime();\n\t\t\t\t/* Ok, we can close the stream. But process the last message list. */\n\t\t\t\tif (CLOSE_STREAM.equals(line)) {\n\t\t\t\t\tmessageList.setStreamClosed(true);\n\t\t\t\t\tqueue.put(messageList);\n\t\t\t\t\tbreak;\n\t\t\t\t} else if((t2 - t1) < ONE_SECOND) {\n\t\t\t\t\tmessage = new Message(line);\n\t\t\t\t\tmessageList.setMessageElement(message);\n\t\t\t\t} else {\n\t\t\t\t\tqueue.put(messageList);\n\t\t\t\t\tmessageList = new BufferQueueElement<Message>();\n\t\t\t\t\tt1 = System.nanoTime();\n\t\t\t\t\tmessage = new Message(line);\n\t\t\t\t\tmessageList.setMessageElement(message);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "@Override\n public void run() {\n try {\n boolean autoFlush = true;\n fromClient = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n toClient = new PrintWriter(clientSocket.getOutputStream(), autoFlush);\n } catch (IOException ioe) {\n throw new UncheckedIOException(ioe);\n }\n for (String entry : communicationWhenStarting) {\n sendMsg(entry);\n }\n while (connected) {\n try {\n Message msg = new Message(fromClient.readLine());\n updateClientAction(msg);\n } catch (IOException ioe) {\n disconnectClient();\n throw new MessageException(ioe);\n }\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\tString msg=\"\";\n\t\t\twhile((msg=br.readLine())!=null){\n\t\t\t\tSystem.out.println((server?\"Client\":\"Server\")+\": \"+msg);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run() {\n\t\ttry {\n\t\t\ttryToConnect();\n\t\t\tif(!fromServer.equals(null) && fromServer.equals(\"VALIDATED\")){\n\t\t\t\tmsg(\"Connected Successfully and was Validated\");\n\t\t\t\tClient.updateConnectedClients(id);\n\t\t\t\tmsg(\"connectedClients array index = \" +id+ \" \" +Client.connectedClients[id]);\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmsg(\"Waiting for another session to connect\");\n\t\t\t\twhile(!fromServer.equals(\"VALIDATED\")) tryToConnect();\n\t\t\t}\n\t\t\t\n\t\t\t//validated threads should continue\n\t\t\tfromServer = in.readLine();\n\t\t\twhile(!fromServer.equals(null)){\n\t\t\t\tif(fromServer.equals(\"sorry\"))return; //it's the end of the day, go home\n\t\t\t\tif(fromServer.equals(\"MOVIEPLAYING\")){\n\t\t\t\t\tmsg(\"Am watching movie now.\");\n\t\t\t\t}\n\t\t\t\tif(fromServer.equals(\"done\"))return;\n\t\t\t\tfromServer = in.readLine();\n\t\t\t}\n\t\t\t\t\n\t\n\t\t}catch (UnknownHostException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n // Methode run die bei Aufruf des Threads gestartet wird\n public void run() {\n //Endlosschleife zum abhören was der Server sedent. Neuen InputStream erzeugen und in Anzeigefenster ausgeben\n while(schleife == 1){\n \n try {\n // Methode online gibt die Nutzernamen der online-verfügabaren Usern zurück vom Server. Die eigene Methode schriebt diese in die UserListe. \n online(remote.online());\n in = new DataInputStream(s.getInputStream());\n\n String lesen = in.readUTF();\n \n\n // Trennt den Einkommenden String am \":\" um Username von der Nachricht zu trennen\n String [] nachrichten = lesen.split(\":\");\n \n //Überprüfen ob ein Header namens VERBINDUNG geschickt wird um entsprechend zu reagieren\n if(nachrichten[0].equals(\"VERBINDUNG\")){\n //Aufruf einer MessageBox, dass Verbindung aufgenommen werden möchte.\n int eingabe = JOptionPane.showConfirmDialog(null,\n \"Wollen sie eine Verbindung mit \" + nachrichten[1] +\" aufbauen?\",\n \"Verbindungsanfrage\",\n JOptionPane.YES_NO_CANCEL_OPTION);\n //Überprüfen der Eingabe in die Messagebox\n //Wenn 'Ja' gedrückt wurde\n if(eingabe == 0){\n //UserListe sperren\n UserListe.setEnabled(false);\n //Verbinden mit User- Button auf trennen stellen\n UserVerbinden.setText(\"Trennen von User\");\n //Offline Anzeigen um weitere Anfragen zu unterbinden\n remote.zeigeOff(UserName.getText());\n //Rückantwort,dass Verbindung aufgebaut werden soll!\n remote.verbindenUser(\"VERBINDEN\", UserName.getText(), nachrichten[1]);\n //Übergabe des Namens des Chat-Partners in die globale Variable \n ZielUser= nachrichten[1];\n \n }else{\n remote.verbindenUser(\"TRENNEN\", UserName.getText() ,nachrichten[1] );\n \n } \n //Wenn die Nachricht den Header 'TRENNEN' enthält, entweder bei beendigung oder bei ablehnen der Verbindung\n }else if(nachrichten[0].equals(\"TRENNEN\")){\n //Nachricht ausgeben, dass getrennt wird bzw. abgelehnt wurde\n Anzeigefeld.append(\"Verbindung von \"+ nachrichten[1]+ \" wurde getrennt/abgelehnt! \\n\");\n //UserListe entsperren\n UserListe.setEnabled(true);\n //Verbinden mit User- Button auf Verbinden stellen\n UserVerbinden.setText(\"Verbinden mit User\");\n //wieder als online Anzeigen \n remote.verbinden(UserName.getText());\n \n //wird aufgerufen wenn VERBINDEN als Header mitgegeben wird\n }else if(nachrichten[0].equals(\"VERBINDEN\")){\n //Ausgabe dass Schlüsselaustausch stattfinden kann\n Anzeigefeld.append(\"Schlüssel wird an \"+nachrichten[1]+ \" gesendet \\n\");\n\n //Den eigenen AES Schlüssel mit öffentlichem Schlüssel des Gegenübers verschlüsseln\n EncryptAES(nachrichten[1]);\n \n //Aufruf der Methode zum Schlüsselaustausch. Überträgt byte[] des Schlüssels\n AESanServer(nachrichten[1]); \n \n //wird aufgerufen wenn der Header KEY mitgegeben wird.\n }else if(nachrichten[0].equals(\"KEY\")){\n \n // Aufruf der Methode Decrypt AES mit der Methode vom Server holeAES\n DecryptAES(remote.schluesselTausch(UserName.getText(), nachrichten[1]));\n \n //Senden-Button freigeben\n Senden.setEnabled(true);\n \n // Anzeigen, das Schlüssel erhalten wurde und Kommunikation starten kann\n Anzeigefeld.append(\"Key von \"+ nachrichten[1] +\" erhalten. Kommunikation kann starten! \\n\");\n \n \n\n \n }\n \n \n // Gibt die Nachricht die verschlüsselt vom Server kommt, entschlüsselt aus!\n Anzeigefeld.append(nachrichten[0] + \": \"+ aes.entschlüsseln(aes.SchlüsselAusDatei(), nachrichten[1])+ \"\\n\");\n\n } catch (IOException ex) {\n Logger.getLogger(ClientGui.class.getName()).log(Level.SEVERE, null, ex);\n } catch (Exception ex) {\n Logger.getLogger(ClientGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n}", "public void receiveMessage() throws IOException {\n String inputLine;\n while (true) {\n inputLine = inputStream.readLine();\n if (inputLine != null && !inputLine.equals(\"\")){\n if (!inputLine.equals(\"Host: closing\")) {\n network.appendMessage(inputLine);\n } else {\n network.appendMessage(\"Server has been closed! Restart the \"\n + \"server!\");\n waitForServer();\n }\n }\n }\n }", "@Override\n public void run() {\n String message = \"Someone: \";\n while(true) {\n try {\n message = in.readLine();\n if (message == null) {\n server.sendToAll(\"Someone has disconnected.\");\n break;\n }\n server.sendToAll(message);\n } catch (IOException e) {\n break;\n } catch (Exception e) {\n System.out.println(e);\n }\n }\n }", "public void run() {\n\t\t\twhile (running || !messages_to_send.isEmpty()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsend();\r\n\t\t\t\t\tread();\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Error! Sending or Reading failed. Reason: \" + e);\r\n\t\t\t\t\tcancel();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "private void receberMensagem() throws Exception {\n\t\ttry {\n\t\t\tbyte[] buffer = new byte[1000];\n\t\t\tMessage mensagem;\n\t\t\tDatagramPacket messageIn = new DatagramPacket(buffer, buffer.length);\n\n\t\t\tthis.socket.receive(messageIn);\n\n\t\t\tmensagem = Message.fromBytes(buffer);\n\n\t\t\tSystem.out.println(mensagem.toString());\n\n\t\t\tif (!mensagem.getRemetente().equals(this.identificador)) {\n\t\t\t\tbyte[] chavePublicaRemetenteBytes = this.listaChavesPublicas.get(mensagem.getRemetente());\n\n\t\t\t\tif (mensagem.getTipoMensagem().equals(EnumMessageType.ENTRADA)\n\t\t\t\t\t\t|| mensagem.getTipoMensagem().equals(EnumMessageType.RESPOSTA_ENTRADA)) {\n\t\t\t\t\tchavePublicaRemetenteBytes = mensagem.getChavePublica();\n\t\t\t\t}\n\n\t\t\t\tmensagem.validar(chavePublicaRemetenteBytes);\n\n\t\t\t\tthis.tratarMensagem(mensagem);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new Exception(\"Erro ao receber mensagem\");\n\t\t}\n\t}", "@Override\n public void run() {\n Message message = new Message();\n message.what=1;\n handler.sendMessage(message);\n }", "protected void handleMessage(Message msg) {}", "public void start() throws SocketException {\n serverSocket = new DatagramSocket(port);\n serverThread = new Thread(new Runnable() {\n public void run() {\n\n\n\n try{\n while(true) {\n byte[] receiveBuffer = new byte[BUFFER_SIZE];\n\n DatagramPacket receivePacket = new DatagramPacket(receiveBuffer,BUFFER_SIZE);\n serverSocket.receive(receivePacket);\n\n if(drop()) continue;\n\n String receiveString = new String(receivePacket.getData());\n receiveString = trim(receiveString);\n\n\n UUID uuid = Message.getUUIDFromMessageString(receiveString);\n int timestamp = Message.getTimestampFromMessageString(receiveString);\n int type = Message.getTypeFromMessageString(receiveString);\n int port = Message.getPortFromMessageString(receiveString);\n MachineInfo.MachineState state = Message.getStateFromMessageString(receiveString);\n\n\n \n\n SocketAddress sa = receivePacket.getSocketAddress();\n String[] address = sa.toString().split(\":\");\n if(address[0].startsWith(\"/\")) {\n address[0] = address[0].substring(1);\n }\n\n MachineInfo machineInfo = new MachineInfo(address[0], port);\n machineInfo.setUUID(uuid).setTimestamp(timestamp).setState(state);\n\n EventMessage em = null;\n \n if(type == 0 ) { // join message\n if(DistributedMachine.isContactServer()) {\n machineInfo.setStateConnected();\n em = new EventMessage(EventMessage.EventType.Join);\n em.setMachineInfo(machineInfo);\n }\n logger.info(\"Received a join message\");\n } else if(type == 1) { //leave message\n em = new EventMessage(EventMessage.EventType.Leave);\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a leave message\");\n } else if(type == 2) { //sync message\n em = new EventMessage(EventMessage.EventType.Sync);\n em.setMemberList(Message.getMemberListfromMessageString(receiveString));\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a sync message\");\n } else if(type == 3) { //ping message\n em = new EventMessage(EventMessage.EventType.Ping);\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a ping\");\n } else if(type == 4) { //receive pingack\n em = new EventMessage(EventMessage.EventType.Ping_ACK);\n em.setMachineInfo(machineInfo);\n logger.info(\"Received a pingack\");\n }\n \n else if (type == -1){\n logger.error(\"Receive an unknown type message\");\n }\n\n if(em != null) {\n eventMessageQueue.add(em);\n }\n\n\n logger.info(\"Receive \" + receiveString);\n// System.out.println();\n// System.out.println(receiveString);\n// System.out.print(\">\");\n }\n } catch(Exception ex) {\n logger.info(ex.toString());\n }\n }\n });\n\n serverThread.start();\n }", "public void run() {\n\t\tMisc.log(\"Server waiting for client...\");\r\n\r\n\t\ttry {\r\n\t\t\tserver = socket.accept();\r\n\t\t\tMisc.log(server.getRemoteSocketAddress() + \" has connected.\");\r\n\t\t\t\r\n\t\t\t//get the input and output streams which are used to send and receive messages from the client\r\n\t\t\tin = new DataInputStream(server.getInputStream());\r\n\t\t\tout = new DataOutputStream(server.getOutputStream());\r\n\t\t\t\r\n\t\t\t//send host's username to the connected client by creating a hello packet with the username\r\n\t\t\tsendData(new HelloPacket(serverHost.getUsername()).getData());\r\n\t\t\t\r\n\t\t} catch(IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//server is listening until the serverRunning flag is set to false\r\n\t\twhile(serverRunning) {\t\t\t\r\n\t\t\t//construct packet object to save received data into\r\n\t\t\tbyte[] data = new byte[1024];\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\t//wait to receive a packet\r\n\t\t\t\tin.read(data);\r\n\t\t\t\t//handle packet\r\n\t\t\t\tpacketHandler.handlePacket(data);\r\n\t\t\t} catch(Exception e) {\r\n\t\t\t\tMisc.log(\"Exception in server.\");\r\n\t\t\t\tserverRunning = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//we are done and it has been requested that the server turns off\r\n\t\tcloseServer();\r\n\t\t\r\n\t\t//end of thread\r\n\t}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tthis.sendMessage(Response.WELCOME_MESSAGE);\n\t\t\t// Get new command from client\n\t\t\twhile (true) {\n\t\t\t\tthis.executeCommand();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// If a exception is catch we just close the client connection\n\t\t\ttry {\n\t\t\t\tthis.close();\n\t\t\t} catch (IOException e1) {\n\t\t\t\t/// just throw the exception of the close\n\t\t\t\tthrow new RuntimeException(e1);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treMsg = withClient.getInputStream();\r\n\t\t\t\t\t\tbyte[] reBuffer = new byte[500];\r\n\t\t\t\t\t\treMsg.read(reBuffer);\r\n\t\t\t\t\t\tString msg = new String(reBuffer);\r\n\t\t\t\t\t\tmsg = msg.trim();\r\n\t\t\t\t\t\tif (msg.indexOf(\"/bye\") == 0) {\r\n\t\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tAnalysis.ckMsg(mySin, msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}", "public static void main(String[] args) throws IOException, UnknownHostException{\n\n\t\t Scanner scan = new Scanner(System.in);\n\n\t\t System.out.println(\"Bitte hostname und port eingeben:\");\n\t\t String hostname= scan.nextLine();\n\t\t int port = scan.nextInt();\n\n\t\t Socket client = new Socket(hostname,port);\n\t\t //rfhpc987\n\t\t InputStream in = client.getInputStream();\n\t\t BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n\n\t\t OutputStream out = client.getOutputStream();\n\t\t PrintWriter writer = new PrintWriter(out);\n\n\t\t //BufferedReader msgReader = new BufferedReader(new InputStreamReader(System.in));\n\t\t System.out.println(\"Bitte geben Sie einen Text ein: \");\n\t\t Scanner msgReader = new Scanner(System.in);\n \n \n\t\t // Nachricht an server senden\n\t\t String result= msgReader.nextLine();\n\t\t writer.println(result);\n\t\t writer.flush();\n\n\t\t // die von Server gesendete Nachricht\n\t\t String msgServer = reader.readLine();\n\t\t // Nachricht von Client\n\t\t System.out.println(\"Message von Server:\"+msgServer);\n\n\n\n\n\t}", "@Override\n public void run() {\n // The error-handling here tries to be as simple as possible: if anything\n // goes wrong that causes an exception, we call the .failure() method on the\n // callback. All the subroutines here (init/send/receive client/server message routines)\n // store intermediate results in instance variables rather than passing them\n // as arguments, and they all throw IOException if something goes wrong with\n // sending/receiving (some subparts can throw other exceptions too, which are\n // handled in the same way here, treated as fatal).\n //\n // When these subroutines called in the following try block fail, they set\n // the error message and error state of the exchange to reasonable values\n // before throwing their exceptions.\n try {\n // TODO(lerner): This (initializing PSIs) is costly, so we may want to\n // do this offline if it's making exchanges slow.\n initializePSIObjects();\n\n // Send client message.\n sendClientMessage();\n // Receive client message.\n receiveClientMessage();\n // Send server message in response to remote client message.\n sendServerMessage();\n // Receive server message.\n receiveServerMessage();\n\n computeSharedFriends();\n \n setExchangeStatus(Status.SUCCESS);\n callback.success(this);\n } catch (Exception e) { // Treat ALL exceptions as fatal.\n // This status setting should be redundant (whoever threw the exception\n // should have set the status to ERROR before throwing the exception) but\n // this maintains the invariant that whenever callback.failure is called\n // the error code is ERROR.\n Log.e(TAG, \"Exception while run()ing CryptographicExchange: \" + e);\n setExchangeStatus(Status.ERROR);\n\n callback.failure(this, getErrorMessage());\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void run() {\r\n\t\t//prendo gli streams per comunicare con il server\r\n\t\tDataOutputStream writer = ClientMain.WRITER;\r\n\t\tDataInputStream reader = ClientMain.READER;\r\n\t\t\r\n\t\t//creo la richiesta di look up\r\n\t\tJSONObject request = new JSONObject();\r\n\t\trequest.put(\"OP\", \"LOOKUP\");\r\n\t\trequest.put(\"ID\", nickname);\r\n\t\t\t\t\r\n\t\t//variabili per gestire la riposta del server\r\n\t\tString response = null;\r\n\t\tJSONObject responseJSON = null;\r\n\t\t\t\t\t\t\t\t\r\n\t\ttry {\r\n\t\t\t//mando la richiesta\r\n\t\t\twriter.writeUTF(request.toJSONString());\r\n\t\t\twriter.flush();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t//ricevo la risposta\r\n\t\t\tresponse = reader.readUTF();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//trasformo in formato JSON la risposta ricevuta dal server\r\n\t\t\tresponseJSON = \t(JSONObject) new JSONParser().parse(response);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t//se c'è qualche problema di comunicazione con il server\r\n\t\t\t//o se non è possibile parsare il messaggio ricevuto\r\n\t\t\te.printStackTrace();\r\n\t\t\t//termino il client\r\n\t\t\tClientMain.cleanUp();\r\n\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t//controllo l'esito della risposta\r\n\t\tOperations esito = Operations.valueOf((String) responseJSON.get(\"OP\"));\r\n\t\tif (esito==Operations.OP_OK) {\r\n\t\t\t//prendo il responso della ricerca\r\n\t\t\tString msg = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msg);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//prendo il messaggio di errore trasmesso dal server\r\n\t\t\tString msgErr = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msgErr);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t}", "@Override\r\n public void run() {\r\n try {\r\n nui.notifyJoinConnecting();\r\n networkPlayer.start();\r\n } catch (NetworkException nex) {\r\n game.abortGame();\r\n if (networkPlayer.getClass() == NetworkClient.class) {\r\n nui.notifyJoinWaiting();\r\n } else if (networkPlayer.getClass() == NetworkHost.class) {\r\n nui.notifyHostWaiting();\r\n } else {\r\n new CriticalException(\"Network player identified itself as neither\"\r\n + \" a client or a server.\");\r\n }\r\n }\r\n }", "public void run() {\n while (true) { \n \t\ttry {\n \t\t\tString line=br.readLine();\n\t\t\t\t\t\t\th.obtainMessage(RECIEVE_MESSAGE, line).sendToTarget();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n \n }\n }", "@Override\n\tpublic void onReceive(Object message) throws Exception {\n\t\tif(message instanceof String){\n\t\t\tSystem.out.println(\"Worker receive: \"+message);\n\n\t\t\tString cmd = (String)message;\n\t\t\t\n\t\t\tString result = Executor.exec(cmd);\n\t\t\tSystem.out.println(\"exec result:\"+result);\n\t\t\t\n\t\t\tActorRef tellActor = getContext().actorOf(Props.create(WorkerTell.class));\n\t\t\ttellActor.tell(cmd, getSelf());\n\t\t\t\n\t\t//\tActorRef sender = getSender();\n\t\t//\tsender.tell(\"result:\"+result, ActorRef.noSender());\n\t\t\t\n\t\t}\n\t}", "public void run() {\n\t\t\tPrintWriter out = null;\n\t\t\ttry {\n\n\t\t\t\t/*\n\t\t\t\t * byte[] buf = new byte[2048]; DatagramPacket packet = new\n\t\t\t\t * DatagramPacket(buf, buf.length);\n\t\t\t\t * System.out.print(\"Server: Receiving\\n\");\n\t\t\t\t * incomingUDP.receive(packet);\n\t\t\t\t * \n\t\t\t\t * System.out.print(\"Receiving successful packet with :\" +\n\t\t\t\t * packet.getLength() + \"kb\");\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tout = new PrintWriter(new OutputStreamWriter(\n\t\t\t\t\t\tincoming.getOutputStream()));\n\n\t\t\t\t// inform the server of this new client\n\t\t\t\tServerNMS.this.addClient(out);\n\n\t\t\t\tout.print(\"Welcome to AndyChat! \");\n\t\t\t\tout.println(\"Enter BYE to exit.\");\n\t\t\t\tout.flush();\n\n\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t\t\t\t\tincoming.getInputStream()));\n\t\t\t\tfor (;;) {\n\t\t\t\t\tString msg = in.readLine();\n\t\t\t\t\tif (msg == null) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (msg.trim().equals(\"BYE\"))\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tSystem.out.println(\"Received: \" + msg\n\t\t\t\t\t\t\t\t+ \"With size is: \" + msg.getBytes().length\n\t\t\t\t\t\t\t\t+ \"bytes\");\n\t\t\t\t\t\t// broadcast the receive message\n\t\t\t\t\t\tServerNMS.this.broadcast(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tincoming.close();\n\n\t\t\t\tServerNMS.this.removeClient(out);\n\t\t\t} catch (Exception e) {\n\t\t\t\tif (out != null) {\n\t\t\t\t\tServerNMS.this.removeClient(out);\n\t\t\t\t}\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) {\n try {\n // The incoming message should have been transformed to a CorfuMsg earlier in the pipeline.\n CorfuMsg m = ((CorfuMsg) msg);\n // We get the handler for this message from the map\n AbstractServer handler = handlerMap.get(m.getMsgType());\n if (handler == null) {\n // The message was unregistered, we are dropping it.\n log.warn(\"Received unregistered message {}, dropping\", m);\n } else {\n if (validateEpoch(m, ctx)) {\n // Route the message to the handler.\n log.trace(\"Message routed to {}: {}\", handler.getClass().getSimpleName(), msg);\n handlerWorkers.submit(() -> handler.handleMessage(m, ctx, this));\n }\n }\n } catch (Exception e) {\n log.error(\"Exception during read!\", e);\n }\n }", "@Override\n public void run(){\n System.out.println(clientID+\" run\");\n open();\n if(isHost){ //HostClient listening\n try{\n controller.sendHostAddress(ip, port);\n socket = hostSocket.accept();\n System.out.println(clientID+\": run: accept\");\n close(); //closes hostSocket\n connected = true;\n open(); //gets streams\n controller.sendConnect(); \n }catch(IOException e){\n System.out.println(clientID+\": run: accept: failed: IOException: \"+e);\n }\n }\n while(connected){ //interprets requests from other client\n try{\n String request = streamIn.readUTF();\n System.out.println(clientID+\": receive: \"+request);\n String response[] = request.split(\"<&>\");\n controller.interpretRequest(response);\n }catch(IOException ioe){\n System.out.println(clientID+\": receive: failed: IOException:\"+ioe);\n connected = false; \n }\n }\n }", "@Override\n\tpublic void run() {\n try {\n while (true) {\n Socket socket = listener.accept();\n try {\n \t\n\t\t\t\t\tDataInputStream in = new DataInputStream(\n\t\t\t\t\t\t\tsocket.getInputStream());\n\t\t\t\t\tBufferedReader d = new BufferedReader(\n\t\t\t\t\t\t\tnew InputStreamReader(in));\n\n\t\t\t\t\tString msg = d.readLine();\n\t\t\t\t\t\n third.notifyAllClients(msg);\n \n d.close();\n in.close();\n } finally {\n socket.close();\n }\n }\n } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n finally {\n try {\n\t\t\t\tlistener.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n\t}", "public void run() {\n try {\n\n // Decorate the streams so we can send characters\n // and not just bytes.  Ensure output is flushed\n // after every newline.\n BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n PrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n\n // Send a welcome message to the client.\n out.println(\"Hello, you are client #\" + clientNumber + \".\");\n out.println(\"Enter \\\"ADD,X,Y\\\",\\\"SUB,X,Y\\\",\\\"MUL,X,Y\\\",\\\"DIV,X,Y\\\", KILL, or \\\".\\\".\");\n out.println(\"KILL will terminate the server and all connections, \\\".\\\" will close this client only\");\n\n // Get messages from the client, line by line; return them\n // capitalized\n while (true) {\n String input = in.readLine();\n if (input == null || input.equals(\".\")){\n break;\n }\n this.queue.add(input, out);\n if(input.equalsIgnoreCase(\"KILL\"))\n {\n \tbreak;\n }\n }\n } catch (IOException e) {\n log(\"Error handling client# \" + clientNumber + \": \" + e);\n } finally {\n try {\n socket.close();\n } catch (IOException e) {\n log(\"Couldn't close a socket, what's going on?\");\n }\n log(\"Connection with client# \" + clientNumber + \" closed\");\n }\n }", "public void handleMessageFromClient(Object msg) {\n\n }", "public void run() {\n if (!connectFuture.isDone()) {\n connectFuture.cancel(true);\n return;\n }\n try {\n // send a message to the server\n ByteBuffer message = ByteBuffer.wrap(\"ping\".getBytes());\n // wait for the response\n System.out.println(\"Sending message to the server...\");\n int numberBytes = client.write(message).get();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }", "public void run()\r\n\t\t{\n\t\t\ttheVMKClient.sendMessageToServer(m);\r\n\t\t}", "public void handleMessageInternal(final Message<?> message) throws MessageRejectedException,\n\t\t\tMessageHandlingException, MessageDeliveryException {\n\t\tif (this.serverConnectionFactory != null) {\n\t\t\t// We don't own the connection, we are asynchronously replying\n\t\t\tObject connectionId = message.getHeaders().get(IpHeaders.CONNECTION_ID);\n\t\t\tTcpConnection connection = connections.get(connectionId);\n\t\t\tif (connection != null) {\n\t\t\t\ttry {\n\t\t\t\t\tconnection.send(message);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(\"Error sending message\", e);\n\t\t\t\t\tconnection.close();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.error(\"Unable to find incoming socket for \" + message);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// we own the connection\n\t\ttry {\n\t\t\tdoWrite(message);\n\t\t} catch (MessageMappingException e) {\n\t\t\t// retry - socket may have closed\n\t\t\tif (e.getCause() instanceof IOException) {\n\t\t\t\tlogger.debug(\"Fail on first write attempt\", e);\n\t\t\t\tdoWrite(message);\n\t\t\t} else {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}", "public void process() throws Exception {\n\t\ttry {\n\t\t\tgui();\n\n\t\t\t// Open Server Soket\n\t\t\tserver = new ServerSocket(port);\n\n\t\t\ttextClient.append(\"Clients Connected to server:\\n\");\n\t\t\ttextAreaMain.append(\"Server Successfully Started - port# : \" + port\n\t\t\t\t\t+ \"\\n\");\n\t\t\tint count = 1;\n\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tclient = server.accept();\n\t\t\t\t\tHandleClient c = new HandleClient(client);\n\t\t\t\t\tif (value == 0) {\n\t\t\t\t\t\tsynchronized (clients) {\n\t\t\t\t\t\t\tclients.add(c);\n\t\t\t\t\t\t\ttextAreaMain.append(c.name + \" has loged on - \"\n\t\t\t\t\t\t\t\t\t+ c.getTimeAndDate() + \"\\n\");\n\t\t\t\t\t\t\ttextClient.append(count + \" : \" + c.name + \"\\n\");\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception ee) {\n\t\t\t\t\tserver.close();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (BindException ee) {\n\t\t\ttextAreaMain.append(\"Server Error - port #\" + port + \"\\n\");\n\t\t\ttextAreaMain.append(\"Process Will Not continue!\\n\");\n\t\t} catch (SocketException e) {\n\n\t\t\tSystem.out.println(\"soket in server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void sendMessage(String message) throws SocketIOException;" ]
[ "0.6337154", "0.62217593", "0.6186847", "0.61470693", "0.60733724", "0.60520643", "0.60219556", "0.59885997", "0.5978263", "0.59702677", "0.59405833", "0.5939722", "0.585813", "0.5846653", "0.58274174", "0.5811155", "0.580006", "0.57928556", "0.5776814", "0.5760311", "0.57526827", "0.5751796", "0.5742545", "0.5725081", "0.5724624", "0.5711228", "0.5702162", "0.56865764", "0.5682634", "0.56718045", "0.566032", "0.5660009", "0.56556815", "0.56547445", "0.5643701", "0.5622992", "0.5606962", "0.56011117", "0.5581533", "0.5577056", "0.55702204", "0.5553267", "0.55427784", "0.55393064", "0.55373716", "0.55329067", "0.5532241", "0.55307776", "0.55252343", "0.55212504", "0.55061984", "0.5505508", "0.5495647", "0.5495637", "0.5488399", "0.5487516", "0.5474966", "0.5473304", "0.54689795", "0.5468819", "0.54557043", "0.545", "0.5449716", "0.544944", "0.5447336", "0.54460794", "0.5432945", "0.5427499", "0.5420007", "0.54100156", "0.54092956", "0.54076177", "0.54010797", "0.53968614", "0.5389674", "0.53891355", "0.5384955", "0.53785384", "0.53782475", "0.5373332", "0.5366313", "0.53612596", "0.5358402", "0.5355141", "0.5341279", "0.5336397", "0.53342676", "0.5332031", "0.5331882", "0.5322839", "0.53220695", "0.5315776", "0.5314334", "0.5307148", "0.5303455", "0.52979153", "0.5292515", "0.52906144", "0.52870816", "0.52841383", "0.52822554" ]
0.0
-1
Diese Methode schickt ein ComObjekt an den Client. Sie faengt eine IOException ab und ruft im jeweiligen Server, dem er zugeteilt ist die handleIOException Methode auf.
public void send(ComObject com) { try { comOut.writeObject(com); comOut.flush(); } catch (IOException e) { run = false; server.disconnectPlayer(this); e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void connect()\n {\n System.out.println(\"CLIENT partito in esecuzione\");\n try\n {\n //Initialize socket variables and json formatter\n socket = new Socket(serverIP, serverPort);\n outputStream = new DataOutputStream(socket.getOutputStream());\n inputStream = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n gson = new Gson();\n \n receiverThread = new ClientReceiver(this);\n } \n catch (UnknownHostException e)\n {\n System.out.println(e.getMessage());\n System.out.println(\"Host sconosciuto\");\n System.exit(1);\n }\n catch (ConnectException e)\n {\n System.out.println(e.getMessage());\n System.out.println(\"Non c'è posto per te, mi spiace\");\n System.exit(1);\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "@Override\n\tpublic void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {\n\t\ttry {\n\t\t\tthrow e.getCause();\n\t\t} catch (ClientException ce) {\n\t\t\tif (ctx.getChannel().isOpen())\n\t\t\t\tctx.getChannel().write(ChannelBuffers.wrappedBuffer(CLIENT_ERROR.array(), ce.getMessage().getBytes(), CRLF.array()));\n\t\t} catch (ClosedChannelException e2) {\n\t\t\tlogger.info(\"ClosedChannelException\" + e.getChannel().getRemoteAddress());\n\t\t\tif (ctx.getChannel().isOpen()) {\n\t\t\t\tctx.getChannel().write(ERROR);\n\t\t\t}\n\t\t} catch (IOException e2) {\n\t\t\tStackTraceElement[] stackTraceElements = e2.getStackTrace();\n\t\t\tfor (int i = 0; i < stackTraceElements.length; i++) {\n\t\t\t\tif (stackTraceElements[i].getClassName().equals(\"sun.nio.ch.SocketDispatcher\")) {\n\t\t\t\t\tlogger.info(\"IOException:\" + e.getChannel().getRemoteAddress());\n\t\t\t\t\tif (ctx.getChannel().isOpen()) {\n\t\t\t\t\t\tctx.getChannel().write(ERROR);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlogger.error(\"error\", e2);\n\n\t\t} catch (Throwable tr) {\n\t\t\tlogger.error(\"error\", tr);\n\t\t\tif (ctx.getChannel().isOpen()) {\n\t\t\t\tctx.getChannel().write(ERROR);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\t\tpublic void handleError(ClientHttpResponse response) throws IOException {\n\t\t\t\t\n\t\t\t}", "public void readFromClient() throws IOException {\n\t\tserverBuffer.writeFrom(clientChannel);\n\t\tif (serverBuffer.isReadyToRead()) {\n\t\t\tregister();\n\t\t}\n\t}", "private static void esperarCliente() {\n try {\n socket = serverSocket.accept();\n System.out.println(\"Cliente conectado...\");\n } catch (IOException ex) {\n Logger.getLogger(ServidorUnicauca.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public Echange_Client() throws UnknownHostException, IOException {\n start_Connexion(); \n }", "private void connectToServer() {\n\n try {\n this.socket = new Socket(InetAddress.getByName(serverIP), this.port);\n\n oos = new ObjectOutputStream(socket.getOutputStream());\n oos.flush();\n ois = new ObjectInputStream(socket.getInputStream());\n\n Message connectMessage = new Message(Message.CLIENT_CONNECT);\n connectMessage.setMessage(userName);\n sendToServer(connectMessage);\n\n Message message;\n while (true){// wait for welcome message\n message = (Message) ois.readObject();\n if(message != null && message.getType() == Message.WELCOME){\n handleMessage(message);\n break;\n }\n }\n\n } catch (UnknownHostException e) {\n e.printStackTrace();\n System.exit(0);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void writeToClient() throws IOException {\n\t\tclientBuffer.writeTo(clientChannel);\n\t\tif (clientBuffer.isReadyToWrite()) {\n\t\t\tregister();\n\t\t}\n\t}", "ClientThread(Socket socket) {\n // a unique id\n id = ++uniqueId;\n //the socket used to connect\n this.socket = socket;\n //creating both data streams\n displayEvent(\"Thread trying to create Object Input/Output Streams\");\n try {\n // create output first\n sOutput = new ObjectOutputStream(socket.getOutputStream());\n //create input\n sInput = new ObjectInputStream(socket.getInputStream());\n // read the client's username\n username = (String) sInput.readObject();\n //display event saying client has just connected\n displayEvent(username + \" just connected.\");\n } catch (IOException e) {\n displayEvent(\"Exception creating new Input/output Streams: \" + e);\n return;\n }\n //have to catch ClassNotFoundException,but server reads a String,\n //so it should work\n catch (ClassNotFoundException e) {\n // handle exception\n }\n //string representation created of a new date object \n date = new Date().toString() + \"\\n\";\n }", "protected void serverError() throws IOException {\n cleanup();\n throw new IOException(\"Recieved error message from server:\\n\" + new String(_text_buffer));\n }", "ClientProcess(Socket socket)\r\n {\r\n\r\n id = IDCounter++;\r\n this.socket = socket;\r\n\r\n System.out.println(\"Thread trying to create Object Input/Output Streams\");\r\n try\r\n {\r\n //set up i/o\r\n out = new ObjectOutputStream(socket.getOutputStream());\r\n in = new ObjectInputStream(socket.getInputStream());\r\n\r\n username = (String) in.readObject();\r\n displayMessage(\"***username + \" + \"JUST CONNECTED***\");\r\n userNames.add(username);\r\n }\r\n catch (IOException e) {\r\n displayMessage(\"Exception creating new Input/output Streams: \" + e);\r\n return;\r\n }\r\n\r\n\r\n catch (ClassNotFoundException e) {\r\n }\r\n\r\n System.out.println(\"complete\");\r\n }", "public abstract void handleClient(Client conn);", "private void sendClientMessage() throws IOException {\n ArrayList<ByteString> blindedFriends = Crypto.byteArraysToStrings(mClientPSI.encodeBlindedItems());\n ClientMessage cm = new ClientMessage.Builder()\n .messages(getMessages())\n .blindedFriends(blindedFriends)\n .build();\n boolean success = lengthValueWrite(out, cm);\n if (!success) {\n setExchangeStatus(Status.ERROR);\n setErrorMessage(\"Length/value write of client message failed.\");\n throw new IOException(\"Length/value write of client message failed, but exception is hidden (see Exchange.java)\");\n }\n }", "public void process() throws Exception {\n\t\ttry {\n\t\t\tgui();\n\n\t\t\t// Open Server Soket\n\t\t\tserver = new ServerSocket(port);\n\n\t\t\ttextClient.append(\"Clients Connected to server:\\n\");\n\t\t\ttextAreaMain.append(\"Server Successfully Started - port# : \" + port\n\t\t\t\t\t+ \"\\n\");\n\t\t\tint count = 1;\n\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tclient = server.accept();\n\t\t\t\t\tHandleClient c = new HandleClient(client);\n\t\t\t\t\tif (value == 0) {\n\t\t\t\t\t\tsynchronized (clients) {\n\t\t\t\t\t\t\tclients.add(c);\n\t\t\t\t\t\t\ttextAreaMain.append(c.name + \" has loged on - \"\n\t\t\t\t\t\t\t\t\t+ c.getTimeAndDate() + \"\\n\");\n\t\t\t\t\t\t\ttextClient.append(count + \" : \" + c.name + \"\\n\");\n\t\t\t\t\t\t\tcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception ee) {\n\t\t\t\t\tserver.close();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (BindException ee) {\n\t\t\ttextAreaMain.append(\"Server Error - port #\" + port + \"\\n\");\n\t\t\ttextAreaMain.append(\"Process Will Not continue!\\n\");\n\t\t} catch (SocketException e) {\n\n\t\t\tSystem.out.println(\"soket in server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public MiAhorcadoCliente() throws RemoteException{}", "public HandleAClient(Socket socket) {\n this.socket = socket;\n }", "@Override\n\tprotected void processConnection() {\n\t\t\n\t\twhile(true) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tint receiverID = (Integer) input.readObject();\n\t\t\t\tString message = (String) input.readObject();\n\t\t\t\t\n\t\t\t\tClientHandler recieverHandler = Server.clientConnections.get(receiverID);\n\t\t\t\tif(recieverHandler == null) {\n\t\t\t\t\tsendData(ERROR_CODE);\n\t\t\t\t\tsendData(\"Not available\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trecieverHandler.sendData(clientID);\n\t\t\t\t\trecieverHandler.sendData(message);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(ClassNotFoundException classNotFoundException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Unknown object type recieved.\");\n\t\t\t}\n\t\t\tcatch(IOException ioException) {\n\t\t\t\tserver.serverGUI.showMessage(\"Client terminated connection.\\n\");\n\t\t\t\tcloseConnection();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void send(Object object) throws IOException {\n\t\ttry {\n\t\t\tsuper.send(object);\n\t\t} catch(IOException e) {\n\t\t\tgestioneDisconnessione(e);\n\t\t}\n\t}", "public Client() throws IOException\n {\n socket = new Socket(\"127.0.0.1\", 1234);\n\n socket2 = new Socket(\"127.0.0.1\", 1235);\n \n out = new ObjectOutputStream(socket.getOutputStream());\n in = new ObjectInputStream(socket.getInputStream());\n \n in2 = new ObjectInputStream(socket2.getInputStream());\n }", "public void handleError(ClientHttpResponse response) throws IOException {\n }", "private void peticionDeCliente() throws IOException, InterruptedException {\n\t\tString mensaje = null;\n\t\tboolean salir = false;\n\t\twhile(!salir) {\n\t\t\tmensaje = in.readLine();\n\t\t\tif(mensaje!=null && !mensaje.split(\";\")[0].equals(\"Comprobacion\")) {\n\t\t\t\tthis.tcpServidor.colaPeticion.put(mensaje); //ALMACENA SOLICITUD EN COLA_PETICIONES\n\t\t\t\tSystem.out.println(\"Peticion del cliente \"+this.idCliente+\": \"+ mensaje);\n\t\t\t}\n\t\t}\n\t}", "public void serverListener() {\n while(true){\n try{\n Object obj = ois.readObject();\n\n /*\n * If the object is of the CoronosAuth Class\n * Verify if the person can log in\n * if Yes: Display interface\n * if No: Prompt reason\n */\n if(obj instanceof CoronosAuth){\n System.out.println(\"[IO] - [Server] - Received CoronosAuth Object\");\n CoronosAuth returned = (CoronosAuth) obj;\n\n allow = returned.getAllow();\n reason = returned.getReason();\n username = returned.getUsername();\n\n if(allow) {\n System.out.println(\"[AUTH] - Successful Login - Authentication Successful!\");\n loginFrame.setVisible(false);\n String username = jtfUserNameField.getText();\n jfFrame.setTitle(String.format(\"Coronos Client - %s\", username));\n jfFrame.setVisible(true);\n Message message = new Message(String.format(\"%s has joined\\n\", username));\n oos.writeObject((Object) message);\n //set clientGUI to visible\n\n } else {\n System.out.println(\"[AUTH] - Failed Login - Authentication Failed!\");\n JOptionPane.showMessageDialog(loginButton, reason, \"Login Error\", JOptionPane.WARNING_MESSAGE);\n }\n }\n\n /*\n * if the object is of the Message Class\n * Append message to chat area\n */\n if(obj instanceof Message){\n System.out.println(\"[IO] - [Server] - Received Message Object\");\n Message message = (Message) obj;\n jtaChatArea.append(String.format(\"%s\", message.toString()));\n }\n\n /*\n * if the object is of the Employee class, save the employee object\n */\n else if(obj instanceof Employee){\n System.out.println(\"[IO] - [Server] - Received Employee Object\");\n this.employee = (Employee) obj;\n\n }\n }\n catch(IOException ioe){\n ioe.printStackTrace();\n }\n catch(ClassNotFoundException cnfe){\n cnfe.printStackTrace();\n }\n catch(NullPointerException npe){\n npe.printStackTrace();\n }\n }\n }", "private void send(Object o) {\r\n try {\r\n System.out.println(\"02. -> Sending (\" + o +\") to the client.\");\r\n this.os.writeObject(o);\r\n this.os.flush();\r\n } \r\n catch (Exception e) {\r\n System.out.println(\"XX.\" + e.getStackTrace());\r\n }\r\n }", "public CoronosClient(String ip){\n //GUI creator\n loginBuilder();\n uiBuilder();\n\n //create Socket + Streams\n try {\n s = new Socket(ip, 16789);\n oos = new ObjectOutputStream(s.getOutputStream());\n ois = new ObjectInputStream(s.getInputStream());\n serverListener();\n } catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (BindException be) {\n be.printStackTrace();\n } catch(ConnectException ce){\n JOptionPane.showMessageDialog(loginButton, \"Failed to connect to server, please contact your System Administrator\", \"Connection Error\", JOptionPane.ERROR_MESSAGE);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "void toConnect() throws Exception {\n\t\tnameField.setVisible(false);\n\t\tf.setTitle(nameField.getText());\n\t\tsocketToServer = new Socket(\"127.0.0.1\", 5050);\n\t\tmyOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());\n\t\tmyInputStream = new ObjectInputStream(socketToServer.getInputStream()); \n\t\tconnected();\n\t\tstart();\n\t}", "public static void closeSocketClient(){\r\n\r\n try{\r\n clientObjectInputStream.close();\r\n clientObjectOutputStream.close();\r\n socket.close();\r\n\r\n System.out.println(\"Client: Socket and all streams were closed successfully!\");\r\n\r\n }catch (java.io.IOException ioe){\r\n ioe.printStackTrace();\r\n //TODO - send error message to server, we won't handle it here\r\n }\r\n }", "public HiloDeCliente_1(DefaultListModel charla, Socket socket) throws IOException\n {\n \n \n this.socket = socket;\n ArrayList lista = ManejadorDeListas.ListaDeRojos;\n //lista.add(\"PERE\");\n \n \n try\n {\n salienteServidor=new ObjectOutputStream(socket.getOutputStream());\n salienteServidor.writeObject(lista);\n dataInput = new DataInputStream(socket.getInputStream());\n dataOutput = new DataOutputStream(socket.getOutputStream());\n \n } catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public void socketError(Exception arg0) {\n\t\t\r\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void onIOException(IOException e, Object state) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "@Override\n\tpublic void readClient(Client clt) {\n\t\t\n\t}", "public void sendMessageToClient(String msg) throws IOException {\r\n\t\tif (this.clientSocket == null || this.out == null)\r\n\t\t\tthrow new SocketException(\"socket does not exist\");\r\n\t\t\r\n\t\tthis.out.writeObject(msg);\r\n\t}", "@Override\n\tpublic void run()\n\t{\n\t\tif(socket != null && !socket.isClosed() && socket.isConnected())\n\t\t{\n\t\t\tSendMessage(ApplicationManager.Instance().GetName(), MessageType.clientData);\n\t\t\tApplicationManager.textChat.writeGreen(\"Connected to \" + connectionInfo.ServerAdress);\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\twhile (IsConnected) \n\t\t {\n\t\t Message message = (Message) in.readObject();\n\t\t\t\t\t\n\t\t if(!IsConnected)\n\t\t \tbreak;\n\t\t \t\n\t\t if(message == null)\n\t\t {\n\t\t \tIsConnected = false;\n\t\t \tbreak;\n\t\t }\n\t\t \n\t\t HandleMessage(message); \n\t\t }\n\t\t\t \n\t\t\t} \n\t\t\tcatch (SocketException | EOFException e) {\n\t\t\t\tif(IsConnected)\n\t\t\t\tApplicationManager.textChat.writeGreen(\"Server go down!\");\n\t\t\t}\n\t\t\tcatch (IOException | ClassNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally\n\t\t\t{\n\t\t\t\tApplicationManager.Instance().Disconnect();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApplicationManager.textChat.writeGreen(\"Cannot connect!\");\n\t\t\tApplicationManager.Instance().Disconnect();\n\n\t\t}\n\t}", "public static void initSocketClient(){\r\n\r\n try{\r\n //connectToProfilingServer();\r\n //setupClientStreams();\r\n handleData();\r\n }catch (EOFException eofe){\r\n eofe.printStackTrace();\r\n //TODO - send error message to server, we won't handle it here\r\n }catch (java.io.IOException ioe){\r\n ioe.printStackTrace();\r\n //TODO - send error message to server, we won't handle it here\r\n }catch (ClassNotFoundException ccne){\r\n ccne.printStackTrace();\r\n //TODO - send error message to server, we won't handle it here\r\n }finally {\r\n //closeSocketClient();\r\n }\r\n }", "public void readFromServer() throws IOException {\n\t\tclientBuffer.writeFrom(serverChannel);\n\t\tif (clientBuffer.isReadyToRead()) {\n\t\t\tregister();\n\t\t}\n\t}", "@Override\n @SuppressWarnings(\"NullableProblems\")\n public void handleError(ClientHttpResponse clientHttpResponse) throws IOException {\n handleError(null, null, clientHttpResponse);\n }", "@Override\n public void close() throws IOException {\n if (clientSocket != null) {\n clientSocket.close();\n }\n }", "private static void abrirPuerto() {\n try {\n serverSocket = new ServerSocket(PUERTO);\n System.out.println(\"Servidor escuchando por el puerto: \" + PUERTO);\n } catch (IOException ex) {\n Logger.getLogger(ServidorUnicauca.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void actionPerformed(ActionEvent ae) {\n try{\r\n //Socket\r\n cs = new Socket(IP, PORT);\r\n \r\n //Output Stream\r\n out = cs.getOutputStream();\r\n oos = new ObjectOutputStream(out);\r\n \r\n //Input Stream\r\n in = cs.getInputStream();\r\n ois = new ObjectInputStream(in);\r\n \r\n //asks the user for a user name and sends to server\r\n if(clientName == null){\r\n clientName = JOptionPane.showInputDialog(jbSend,\"Please enter a username\");\r\n oos.writeObject(clientName); \r\n oos.flush(); \r\n }\r\n \r\n \r\n //BlackCard bc = new BlackCard(\"black card\");\r\n //oos.writeObject(bc);\r\n\r\n jbConnect.setEnabled(false);\r\n \r\n //Thread\r\n ClientThread ct = new ClientThread(cs);\r\n ct.start();\r\n \r\n //handles chat strings from client to server\r\n jbSend.addActionListener(\r\n new ActionListener(){\r\n public void actionPerformed(ActionEvent ae) {\r\n try{\r\n //Writes message from server and appends\r\n if(jtaClient.getText().length() > 0){\r\n String clientMsg = jtaClient.getText();\r\n oos.writeObject(clientMsg);\r\n oos.flush();\r\n jtaClient.setText(\"\");\r\n } \r\n }\r\n catch (IOException oie) {\r\n System.out.println(\"IO Exception\");\r\n } \r\n }\t\r\n }); \r\n } \r\n catch(ConnectException ce ) { \r\n System.out.println(\"Server is Not Online\"); \r\n }\r\n catch(UnknownHostException uhe) {\r\n System.out.println(\"no host\");\r\n uhe.printStackTrace();\r\n }\r\n catch(IOException ioe)\r\n {\r\n System.out.println(\"IO error\");\r\n ioe.printStackTrace();\r\n }\r\n catch( ArrayIndexOutOfBoundsException aioobe ) {\r\n System.out.println(\"Array Index Out of Bounds\");\r\n }\r\n }", "public synchronized void close(){\n if(connected){\n try{\n socket.close();\n streamIn.close();\n streamOut.close();\n System.out.println(clientID+\": close: socket\"); \n }catch(IOException ioe){\n System.out.println(clientID+\": close: IOException:\"+ioe);\n }\n }else if(isHost){\n try{\n hostSocket.close();\n System.out.println(clientID+\": close: hostSocket\"); \n }catch(IOException ioe){\n System.out.println(clientID+\": close: IOException:\"+ioe);\n }\n }\n }", "private void sendMessageToClient(String message) {\n try {\n outputStream.writeObject(message);\n outputStream.flush();\n } catch (IOException e) {\n System.out.println(\"Erreur lors de l'envoi du message au client\");\n }\n }", "ClientHandler(Socket socket) {\n this.client = socket;\n }", "@Override\n public void run() {\n FILEPREFIX = \".//files\"+serverID + \"//\";\n ClientMessage = (Message) socketRead();\n ServerMessage = getReturnMessage(ClientMessage);\n //System.out.println(\"client\"+ClientMessage.getFrom()+\"message : \"+ClientMessage.getContent());\n File file = new File(FILEPREFIX + ClientMessage.getFileName());\n switch (ClientMessage.getType()){\n case \"enquiry\"://return the list of file\n ServerMessage.setContent(ListAllFile());\n break;\n case \"read\"://read the last line\n System.out.println(ClientMessage.getFrom() + \": Reading...\");\n ServerMessage.setContent(\"Reading: \"+ReadLastLine(file));\n System.out.println(\"Reading \"+ClientMessage.getContent());\n break;\n case \"write\"://write to the end of file\n System.out.println(ClientMessage.getFrom() + \": writing...\");\n try{\n WriteLastLine(file,ClientMessage.getContent());\n }catch (IOException e) {\n System.out.println(\"write error\");\n }\n\n ServerMessage.setContent(\"writing: \"+ReadLastLine(file));\n System.out.println(\"Writing \"+ClientMessage.getContent());\n break;\n default://unknown command\n System.out.println(ClientMessage.getType());\n ServerMessage.setContent(\"Error\");\n System.out.println(ClientMessage.getFrom() + \": Wrong type\");\n break;\n }\n socketWrite(ServerMessage);\n\n try {//close the socket connection\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Object readObject() {\n Object fromServer = null;\n\n try {\n fromServer = inputStream.readObject();\n } catch(InvalidClassException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - could not deserialize the read object!\");\n e.printStackTrace();\n System.exit(1);\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - error reading an object from the socket's input stream!\");\n e.printStackTrace();\n System.exit(1);\n } catch(ClassNotFoundException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - the read object's data type is unknown!\");\n e.printStackTrace();\n System.exit(1);\n }\n\n return fromServer;\n }", "@Override\r\n\t\tpublic void onIOException(IOException e, Object state) {\n\t\t\t\r\n\t\t}", "public ServidorSocket() throws IOException {\n\t\tservidor = new ServerSocket(PUERTO);\n\t\tcliente = new Socket();\n\t}", "public abstract void handleConnected() throws Exception;", "public void disconnect() throws IOException {\n numberOfCommands++;\n LOG.log(Level.INFO, \"client has request to be disconnect.\");\n if(isConnected()) {\n sendToServer(RouletteV2Protocol.CMD_BYE);\n ByeCommandResponse byeCmdResp = JsonObjectMapper.parseJson(in.readLine(), ByeCommandResponse.class);\n\n LOG.log(Level.INFO, \"Status: \" + byeCmdResp.getStatus());\n LOG.log(Level.INFO, \"Number of commands on the server \" + String.valueOf(byeCmdResp.getNumberOfCommands()));\n\n connected = false;\n\n cleanup();\n } else {\n LOG.log(Level.INFO, \"The client is already disconencted\");\n }\n }", "@Override\n\tpublic void run() {\n\t\t// Get object streams.\n\t\ttry{\n\t\t\toutput = new ObjectOutputStream(socket.getOutputStream());\n\t\t\toutput.flush();\n\t\t\tinput = new ObjectInputStream(socket.getInputStream());\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"ERROR: could not create streams \" + e.getMessage());\n\t\t\ttry {\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\tcatch (IOException e1) {\n\t\t\t\tSystem.out.println(\"ERROR: Could not close connection - \" + e.getMessage());\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Receive commands until EOFException thrown\n\t\ttry{\n\t\t\t// The delay after a command is processed in milliseconds. Increase this value to test the client's command queuing.\n\t\t\tlong serverDelayPerCommand = 100;\n\t\t\t\n\t\t\t// Create the command verifier.\n\t\t\tPattern validCommandPattern = Pattern.compile(\"-(end|echo|time|date|help|cls)(-.+)?\");\n\t\t\t\n\t\t\t// Create the time and date formatters.\n\t\t\tDateFormat timeFormat = new SimpleDateFormat(\"hh:mm:ss a\");\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"d MMMM yyyy\");\n\t\t\t\n\t\t\t// Main loop\n\t\t\twhile(true){\n\t\t\t\tString command = (String)input.readObject();\n\t\t\t\tString response = \"ERROR: Unrecognized command.\";\n\t\t\t\t\n\t\t\t\t// Make sure that the string is in a valid format.\n\t\t\t\tif(validCommandPattern.matcher(command).matches()){\n\t\t\t\t\tif(command.startsWith(\"-echo-\")){\n\t\t\t\t\t\tresponse = \"ECHO:\" + command.substring(6);\n\t\t\t\t\t}\n\t\t\t\t\telse if(command.startsWith(\"-echo\")){\n\t\t\t\t\t\tresponse = \"ECHO:\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(command.startsWith(\"-time\")){\n\t\t\t\t\t\tresponse = \"TIME: \" + timeFormat.format(new Date());\n\t\t\t\t\t}\n\t\t\t\t\telse if(command.startsWith(\"-date\")){\n\t\t\t\t\t\tresponse = \"DATE: \" + dateFormat.format(new Date());\n\t\t\t\t\t}\n\t\t\t\t\telse if(command.startsWith(\"-help\")){\n\t\t\t\t\t\tresponse = \"Available Services:\\nend\\necho\\ntime\\ndate\\nhelp\\ncls\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(command.startsWith(\"-cls\")){\n\t\t\t\t\t\tresponse = Server.SR_CLS;\n\t\t\t\t\t}\n\t\t\t\t\t// If the response is an end command, break from the loop.\n\t\t\t\t\telse if(command.startsWith(\"-end\")){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Write the response\n\t\t\t\toutput.writeObject(response);\n\t\t\t\t\n\t\t\t\t// Sleep.\n\t\t\t\ttry{\n\t\t\t\t\tThread.sleep(serverDelayPerCommand);\n\t\t\t\t}\n\t\t\t\tcatch(InterruptedException e){\n\t\t\t\t\t// Do nothing.\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\toutput.writeObject(Server.SR_END);\n\t\t}\n\t\tcatch(EOFException e){\n\t\t\t// Connection closed on client side.\n\t\t}\n\t\tcatch(ClassNotFoundException e){\n\t\t\tSystem.out.println(\"ERROR: Unknown object type recieved.\");\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"ERROR: \" + e.getMessage());\n\t\t}\n\t\t\n\t\t// Close the connection\n\t\tSystem.out.println(\"Server Socket: Closing client connection...\");\n\t\ttry {\n\t\t\toutput.close();\n\t\t\tinput.close();\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"ERROR: Could not close connection. \" + e.getMessage());\n\t\t}\n\t}", "private void send(Object o) {\n\t\ttry {\n\t\t\tSystem.out.println(\"02. -> Sending (\" + o +\") to the client.\");\n\t\t\tthis.os.writeObject(o);\n\t\t\tthis.os.flush();\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"XX.\" + e.getStackTrace());\n\t\t}\n\t}", "private static void handleClient(Socket cSocket){\n PrintStream toClient;\n BufferedReader fromClient;\n String data;\n try{\n // Get Input and Output\n fromClient = new BufferedReader(\n new InputStreamReader(\n cSocket.getInputStream()));\n toClient = new PrintStream(\n cSocket.getOutputStream());\n while(true){\n // read from Client\n data = fromClient.readLine();\n if(data == null) break;\n data = data.toUpperCase();\n // write to Client\n toClient.println(data);\n }\n fromClient.close();\n toClient.close();\n cSocket.close();\n }catch(IOException ioe){\n String msg = \"Connection lost\";\n System.out.println(msg);\n }\n }", "private void gestioneDisconnessione(Exception e) {\n\t\tLOG.info(\"Client disconnesso\");\n\t\tthis.completeWithError(e);\n\t\tthis.running=false;\n\t}", "@Override\n\tprotected void requesting(ExtendedDataOutputStream out) throws Exception\n\t{\n\t\tout.writeObject(this.clientServerPort);\n\t}", "public ClientHandle(Socket cs) {\r\n \t\r\n this.threadSocket = cs;\r\n\r\n }", "@Override\n\t\tpublic void onIOException(IOException e, Object state) {\n \n \t}", "private void connectToServer() {\n\t\ttry {\n\n\t\t\tSystem.out.println(\"Attempting connection to server at port: 5555\");\n\t\t\tsocket = new Socket(\"localhost\", 5554);\n\t\t\tSystem.out.println(\"Connected to server at port: 5555\");\n\n\t\t\tobjectOutputStream = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tobjectInputStream = new ObjectInputStream(socket.getInputStream());\n\t\t\t\n\t\t\t// sending client object to server\n\t\t\tobjectOutputStream.writeInt(Main.getUser().getUserId());\n\t\t\tobjectOutputStream.flush();\n\t\t} catch (UnknownHostException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t}", "private void closeConnection() throws IOException {\n\t\tclientSocket.close();\n\t}", "public String sendMessage(){\n System.out.print(handle);\n try{ \n message = inFromUser.readLine();\n if(message.equals(\"SIGINT\")){\n outToServer.writeBytes(\"SIGINT\");\n System.out.println(\"\\nTCP connection closed and program terminated.\");\n response = inFromServer.readLine();\n if(!response.isEmpty()){\n System.out.println(response + \" message received from server means OK to close connection\");\n clientSocket.close();\n }\n return \"INTERRUPT\";\n } \n else if(message.equals(\"\\\\quit\")){\n outToServer.writeBytes(\"SIGQUIT\");\n System.out.println(\"\\nTCP connection closed.\");\n response = inFromServer.readLine();\n if(!response.isEmpty()) {\n System.out.println(response + \" message received from server means OK to close connection on this side\");\n clientSocket.close();\n }\n return \"QUIT\";\n }\n else{\n handleMsg = handle + message;\n int lengthInt = handleMsg.length();\n outToServer.writeBytes(handleMsg); \n return \"OK\";\n }\n }catch(IOException e){\n System.err.println(\"Caught IOException in sendMessage(): \" + e.getMessage());\n } \n return null;\n }", "void handleClient(Server srv, Socket s) {\n\n InputStream is = null;\n PrintStream ps = null;\n\n try {\n\n logger.debug(\"Setting request timeout to: \" + srv.getTimeout() + \"ms\");\n s.setSoTimeout(srv.getTimeout());\n s.setTcpNoDelay(true);\n \n // Get reader/writer on stream\n logger.debug(\"Creating IO streams\");\n is = s.getInputStream();\n ps = new PrintStream(s.getOutputStream());\n\n HTTPRequest req = new HTTPRequest(srv.getApplicationName(), is, logger);\n HTTPResponse resp;\n\t if ( req.isGet() ){\n\t\t logger.debug( \"Response is GET\" );\n\t\t resp = new HTTPResponse(srv.getApplicationName(), ps, logger);\n\t } else {\n\t\t logger.debug( \"Response is HEAD\" );\n\t\t resp = new HTTPHeadResponse(srv.getApplicationName(), ps, logger);\n\t }\n new HTTPHandler(srv, req, resp, logger);\n\n } catch (Exception e) {\n // I would say throw a 500 here, but that's not really\n // possible since if we got here, something is wrong\n // with the socket/streams\n logger.error(e);\n \n } finally {\n logger.debug(\"Closing socket and streams.\");\n try {\n is.close();\n } catch (Exception e) {}\n try {\n ps.close();\n } catch (Exception e) {}\n try {\n s.close();\n } catch (Exception e) {}\n is = null;\n ps = null;\n }\n }", "public void sentRecieve() throws UnknownHostException, IOException, ClassNotFoundException, InterruptedException {\n InetAddress host = InetAddress.getLocalHost();\r\n Socket socket = null;\r\n ObjectOutputStream output = null;\r\n ObjectInputStream input = null;\r\n \r\n LinkedList client = new LinkedList();\r\n client.add(\"Elifas\");\r\n client.add(\"Andrew\");\r\n client.add(\"Claudia\");\r\n client.add(\"Ester\");\r\n client.add(\"Emilie\");\r\n \r\n for (int i = 0; i < client.size(); i++) {\r\n int size = client.size();\r\n //establishing socket connection to a server\r\n socket = new Socket(host.getHostName(), 2535);\r\n //write to the socket using ObjectOutputStream\r\n output = new ObjectOutputStream(socket.getOutputStream());\r\n System.out.println(client.get(i)+\" sending request to the server\");\r\n if (size > 5) {\r\n output.writeObject(\"exit\");\r\n }\r\n else{\r\n output.writeObject(\" \"+ client.get(i));\r\n }\r\n //reading the server response\r\n input = new ObjectInputStream(socket.getInputStream());\r\n String message = (String) input.readObject();\r\n System.out.println(\"Response: \"+message);\r\n \r\n //close resources\r\n input.close();\r\n output.close();\r\n Thread.sleep(2000);\r\n }\r\n }", "private void handleClient() {\n\t\t//Socket link = null;\n\t\tRequestRecord reqRec = new RequestRecord();\n\t\tResponder respondR = new Responder();\n\t\t\n\t\ttry {\n\t\t\t// STEP 1 : accepting client request in client socket\n\t\t\t//link = servSock.accept(); //-----> already done in *ThreadExecutor*\n\t\t\t\n\t\t\t// STEP 2 : creating i/o stream for socket\n\t\t\tScanner input = new Scanner(link.getInputStream());\n\t\t\tdo{\n\t\t\t\t//PrintWriter output = new PrintWriter(link.getOutputStream(),true);\n\t\t\t\t//DataOutputStream ds = new DataOutputStream(link.getOutputStream());\n\t\t\t\tint numMsg = 0;\n\t\t\t\tString msg = input.nextLine();\n\t\t\t\t\n\t\t\t\t//to write all requests to a File\n\t\t\t\tFileOutputStream reqFile = new FileOutputStream(\"reqFile.txt\");\n\t\t\t\tDataOutputStream dat = new DataOutputStream(reqFile);\n\t\t\t\t\n\t\t\t\t// STEP 4 : listening iteratively till close string send\n\t\t\t\twhile(msg.length()>0){\n\t\t\t\t\tnumMsg++;\n\t\t\t\t\tdat.writeChars(msg + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"\\nNew Message Received\");\n\t\t\t\t\tif(reqRec.setRecord(msg)==false)\n\t\t\t\t\t\tSystem.out.println(\"\\n-----\\nMsg#\"+numMsg+\": \"+msg+\":Error with Request Header Parsing\\n-----\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Msg#\" + numMsg + \": \" + msg);\n\t\t\t\t\tmsg = input.nextLine();\n\t\t\t\t};\n\t\t\t\tdat.writeChars(\"\\n-*-*-*-*-*-*-*-*-*-*-*-*-*-\\n\\n\");\n\t\t\t\tdat.close();\n\t\t\t\treqFile.close();\n\t\t\t\tSystem.out.println(\"---newEST : \" + reqRec.getResource());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n==========Send HTTP Response for Get Request of\\n\"+reqRec.getResource()+\"\\n***********\\n\");\n\t\t\t\tif(respondR.sendHTTPResponseGET(reqRec.getResource(), link)==true)//RES, ds)==true)\n\t\t\t\t\tSystem.out.println(\"-----------Resource Read\");\n\t\t\t\tSystem.out.println(\"Total Messages Transferred: \" + numMsg);\n\t\t\t\t//link.close();\n\t\t\t\tif(reqRec.getConnection().equalsIgnoreCase(\"Keep-Alive\")==true && respondR.isResourceExisting(reqRec.getResource())==true)\n\t\t\t\t\tlink.setKeepAlive(true);\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}while(true);\n\t\t\tSystem.out.print(\"Request Link Over as Connection: \" + reqRec.getConnection());\n\t\t} catch (IOException e) {\n\t\t\tif(link.isClosed())\n\t\t\t\tSystem.out.print(\"\\n\\nCritical(report it to developer):: link closed at exception\\n\\n\");\n\t\t\tSystem.out.println(\"Error in listening.\\n {Error may be here or with RespondR}\\nTraceString: \");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// STEP 5 : closing the connection\n\t\t\tSystem.out.println(\"\\nClosing Connection\\n\");\n\t\t\ttry {\t\t\t\t\n\t\t\t\tlink.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Unable to disconnect.\\nTraceString: \");\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}/*ends :: try...catch...finally*/\n\t\t\n\t}", "public HandleAClient(Socket s) {\n\t\t\tmySocket = s;\n\t\t}", "public void socketException(PacketChannel pc, Exception ex);", "public void handleMessageFromClient(Object msg) {\n\n }", "private void handleServerMessage() throws IOException {\n System.out.println(\"Handeling message for \" + id + \" with type: \" + sm.getType().toString());\n switch (sm.getType()) {\n case REGISTER:\n registrationLoginHandler.register(sm, output);\n break;\n case LOGIN:\n this.user = registrationLoginHandler.login(sm, output);\n break;\n case BOOT:\n bootHandler.boot(user, output);\n break;\n case ADD_CONTACT:\n contactHandler.addContact(sm, user, output);\n handleAddContact();\n break;\n case REMOVE_CONTACT:\n break;\n case UPDATE_NICKNAME:\n break;\n case UPDATE_STATUS:\n break;\n case UPDATE_PROFILE_PIC:\n break;\n case CLIENT_DISCONNECT:\n keepGoing = false;\n close();\n server.remove(id);\n break;\n }\n }", "void chiudiConnessione() throws RemoteException,IOException;", "private void sendObjectToServer (Object obj) throws IOException,\n ClassNotFoundException {\n\n ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());\n out.writeObject(obj);\n out.flush();\n }", "public void desconectaCliente() throws IOException {\n //Desconecta o Cliente\n SOCKET.close();\n }", "private void startKlient() {\n\t\tSystem.out.println(\"Trying to connect\");\r\n\t\ttry (Socket serverkontakt = new Socket(\"127.0.0.1\", 8000);\r\n\t\t// Step 2 - obtaining input/output streams\r\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(\r\n\t\t\t\t\t\tserverkontakt.getOutputStream())) {\r\n\t\t\toutput.flush();\r\n\t\t\tSystem.out.println(\"Connected\");\r\n\t\t\tsendObject(output);\r\n\t\t} catch (EOFException eofException) {\r\n\t\t\tSystem.out.println(\"Server closing connection\\n\");\r\n\t\t} catch (IOException ioException) {\r\n\t\t\tSystem.out.println(\"Problem with server connection\\n\");\r\n\t\t}\r\n\t}", "private void acceptConnection() throws Exception {\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \"TcpConnectionListener.acceptConnection()\");\n\n Socket sock = proxyService.getServerSocket().accept();\n String inaddr = sock.getInetAddress().getHostAddress();\n\n connectionCount++;\n\n if (logger.isLoggable(BasicLevel.INFO))\n logger.log(BasicLevel.INFO, \" -> accept connection from \" + inaddr);\n\n try {\n sock.setTcpNoDelay(true);\n\n // Fix bug when the client doesn't use the right protocol (e.g. Telnet)\n // and blocks this listener.\n sock.setSoTimeout(timeout);\n\n InputStream is = sock.getInputStream();\n NetOutputStream nos = new NetOutputStream(sock);\n\n byte[] magic = StreamUtil.readByteArrayFrom(is, 8);\n for (int i = 0; i < 5; i++) {\n if (magic.length == i || magic[i] != MetaData.joramMagic[i] && magic[i] > 0) {\n String errorMsg = \"Bad magic number. Client is not compatible with JORAM.\";\n protocolErrorCount++;\n throw new IllegalAccessException(errorMsg);\n }\n }\n if (magic[7] != MetaData.joramMagic[7]) {\n if (magic[7] > 0 && MetaData.joramMagic[7] > 0) {\n String errorMsg = \"Bad protocol version number \" + magic[7] + \" != \" + MetaData.joramMagic[7];\n protocolErrorCount++;\n throw new IllegalAccessException(errorMsg);\n }\n \n logger.log(BasicLevel.WARN,\n \"Wildcard protocol version number: from stream = \" + magic[7] + \", from MetaData = \" + MetaData.joramMagic[7]);\n }\n\n //read the ack mode(noAckedQueue)\n boolean noAckedQueue = StreamUtil.readBooleanFrom(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read noAckedQueue = \" + noAckedQueue);\n if (noAckedQueue)\n TcpProxyService.createExecutors();\n \n long dt = Math.abs(StreamUtil.readLongFrom(is) - System.currentTimeMillis());\n if (dt > clockSynchroThreshold)\n logger.log(BasicLevel.WARN, \" -> bad clock synchronization between client and server: \" + dt);\n StreamUtil.writeTo(dt, nos);\n\n Identity identity = Identity.read(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read identity = \" + identity);\n\n int key = StreamUtil.readIntFrom(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read key = \" + key);\n\n int heartBeat = 0;\n if (key == -1) {\n heartBeat = StreamUtil.readIntFrom(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read heartBeat = \" + heartBeat);\n }\n \n if (logger.isLoggable(BasicLevel.INFO))\n logger.log(BasicLevel.INFO, \" -> open connection \" + identity + \"/\" + key + \" - \" + heartBeat);\n \n GetProxyIdNot gpin = new GetProxyIdNot(identity, inaddr);\n AgentId proxyId;\n try {\n gpin.invoke(AdminTopic.getDefault());\n proxyId = gpin.getProxyId();\n } catch (Exception exc) {\n if (logger.isLoggable(BasicLevel.WARN))\n logger.log(BasicLevel.WARN, \" -> login failed\", exc);\n failedLoginCount++;\n StreamUtil.writeTo(1, nos);\n StreamUtil.writeTo(exc.getMessage(), nos);\n nos.send();\n return;\n }\n\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> open connection, proxyId=\" + proxyId);\n \n IOControl ioctrl;\n ReliableConnectionContext ctx;\n if (key == -1) {\n OpenConnectionNot ocn = new OpenConnectionNot(Type.RELIABLE, heartBeat, noAckedQueue);\n ocn.invoke(proxyId);\n StreamUtil.writeTo(0, nos);\n ctx = (ReliableConnectionContext) ocn.getConnectionContext();\n key = ctx.getKey();\n StreamUtil.writeTo(key, nos);\n nos.send();\n ioctrl = new IOControl(sock);\n } else {\n GetConnectionNot gcn = new GetConnectionNot(key);\n try {\n gcn.invoke(proxyId);\n } catch (Exception exc) {\n if (logger.isLoggable(BasicLevel.WARN))\n logger.log(BasicLevel.WARN, \"TcpConnectionListener: reconnection failed\", exc);\n StreamUtil.writeTo(1, nos);\n StreamUtil.writeTo(exc.getMessage(), nos);\n nos.send();\n return;\n }\n ctx = (ReliableConnectionContext) gcn.getConnectionContext();\n StreamUtil.writeTo(0, nos);\n nos.send();\n ioctrl = new IOControl(sock, ctx.getInputCounter());\n\n // Close the remaining connection if it exists\n TcpConnection tcpConnection = proxyService.getConnection(proxyId, key);\n if (tcpConnection != null) {\n tcpConnection.close();\n }\n }\n\n // Reset the timeout in order to enable the server to indefinitely\n // wait for requests.\n sock.setSoTimeout(0);\n\n TcpConnection tcpConnection = new TcpConnection(ioctrl, ctx, proxyId, proxyService, identity);\n tcpConnection.start();\n } catch (IllegalAccessException exc) {\n if (logger.isLoggable(BasicLevel.ERROR))\n logger.log(BasicLevel.ERROR, \"TcpConnectionListener: close connection\", exc);\n sock.close();\n throw exc;\n } catch (IOException exc) {\n if (logger.isLoggable(BasicLevel.WARN))\n logger.log(BasicLevel.WARN, \"TcpConnectionListener: close socket\", exc);\n sock.close();\n throw exc;\n }\n }", "public void connect() throws IOException {\n //Loggen \"connecting\"\n addEntry(\"connecting\");\n\n //Den Input und Output Stream zum Kommunizieren über das Socket\n //initzialisieren\n out = new PrintWriter(primeServer.getOutputStream(), true);\n in = new BufferedReader(new InputStreamReader(primeServer.getInputStream()));\n\n //Kommunikation mit dem Server initzialisieren\n out.println(MessageType.HALLO);\n //Die vom Server an diesen Client vergebene ID auslesen\n id = Integer.parseInt(in.readLine());\n\n //Loggen \"connected,id\"\n addEntry(\"connected,\" + id);\n }", "public void getConnection() throws Exception {\n\t\ttry {\n\t\t\tSystem.out.println(\"Waiting for new client!\");\n\n\n\n\t\t\tclient = serverSocket.accept();\n\t\t\tis = client.getInputStream();\n\t\t\tisr = new InputStreamReader(is);\n\t\t\tbr = new BufferedReader(isr);\n\t\t\tos = client.getOutputStream();\n\t\t\tosw = new OutputStreamWriter(os);\n\t\t\tpw = new PrintWriter(osw, true);\n\t\t\tsleep(500);\n\t\t\t//clientkey = getClientKey();\n\t\t\tSystem.out.println(\"Client has connected!\");\n\t\t\t\n\t\t\tGetTimestamp(\"Client Publickey is being stored: \" ) ;\n\t\t\t\n\t\t\tpublicKey = getClientPublicKey();\n\t\t\t\n\t\t\tGetTimestamp(\"Client Publickey is stored: \" ) ;\n\t\t\t\n\t\t\tString tosend = encrypt1(getSharedKey(), getClientPublicKey());\n\t\t\t\n\t\t\tGetTimestamp(\"Client sharedkey is being encrypted: \") ;\n\t\t\t\n\t\t\tGetTimestamp(\"Waiting for Authorization Request from Client: \");\n\t\t\t\n\t\t\t//getclientpublickey();\n\t\t\tgetAUTH_REQUEST();\n\t\t\t//getMessage();\n\n\t\t} catch (IOException | InterruptedException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t}", "public interface ClientInterface extends Remote {\n\tpublic static final int NUMBEROFSERVER=7;\n\t\n\t/*public static final String[] SERVERS = { \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\",\n\t\t\"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\",\n\t\t\"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\" };*/\n\tpublic static final String[] SERVERS = { \"glados.cs.rit.edu\", \"kansas.cs.rit.edu\", \"doors.cs.rit.edu\", \"gorgon.cs.rit.edu\",\n\t\t\"newyork.cs.rit.edu\", \"yes.cs.rit.edu\", \"kinks.cs.rit.edu\", \"medusa.cs.rit.edu\", \"joplin.cs.rit.edu\",\n\t\t\"delaware.cs.rit.edu\", \"buddy.cs.rit.edu\", \"arizona.cs.rit.edu\" };\n\t//public static final String ClientIP=\"129.21.88.98\";\n\t/**\n\t * This remote method will be called by server for copying file at Client using remote object.\n\t * @param data Byte array containing File data\n\t * @param name Name of the File\n\t * @param Server Name of the server\n\t * @throws RemoteException\n\t */\n\tpublic void getFile(byte[] data, String name,String server) throws RemoteException;\n\t/**\n\t * Servers will update request trail by invoking this remote method\n\t * @param request Name of the Server which is serving the file request.\n\t * @throws RemoteException\n\t */\n\tpublic void updateRequestTrail(String request) throws RemoteException;\n\t/**\n\t * Severs invoke this method for passing message to client Ex File does not exist \n\t * @param error Message contains\n\t * @throws RemoteException \n\t */\n\tpublic void Error(String error) throws RemoteException; \n\t\t\n\t\n}", "public void addClient() throws IOException {\n BufferedReader in;\n Socket clientSocket; //pour chaque nouveau client\n System.out.println(\"New Client connected.\");\n clientSocket = serverSocket.accept();\n out = new PrintWriter(clientSocket.getOutputStream());\n in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n tabClientsout.addElement(out);\n Runnable r = new recevoir(out, in);\n // genere le Thread pour le nouveau client\n new Thread(r).start();\n }", "public void handleClientRequest() {\n System.out.println(\"... new ConnectionHandler constructed ...\");\n try {\n while (true) {\n // Get input data from client over socket\n String line = br.readLine();\n String[] lineArray = line.split(\" \");\n String requestType = lineArray[0];\n String resourceName = lineArray[1];\n // Log this request\n log.append(\"\\nRequest at \").append(fldt).append(\":\\n\").append(line);\n log.newLine();\n File f = new File(path + resourceName);\n String contentLength = String.valueOf(f.length());\n\n // Interpret request and respond accordingly\n if (!f.isFile()) {\n byte[] response = getHeader(404, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n404 Not Found\");\n log.newLine();\n break;\n } else if (requestType.contains(\"GET\")) {\n byte[] header = getHeader(200, contentLength, resourceName);\n byte[] content = getContent(f);\n byte[] response = new byte[header.length + content.length];\n System.arraycopy(header, 0, response, 0, header.length);\n System.arraycopy(content, 0, response, header.length, content.length);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"HEAD\")) {\n byte[] response = getHeader(200, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n200 OK\");\n log.newLine();\n break;\n } else if (requestType.equals(\"DELETE\")) {\n f.delete();\n break;\n } else {\n byte[] response = getHeader(501, contentLength, resourceName);\n\n os.write(response);\n // Log this response\n log.append(\"Response code:\\n501 Not Implemented\");\n log.newLine();\n break;\n }\n }\n cleanUp();\n } catch (IOException | IndexOutOfBoundsException e) {\n System.err.println(\"ConnectionHandler:handleClientRequest (error): \" + e.getMessage());\n cleanUp();\n }\n }", "private void operateLine() throws IOException{\n String message=\"你好 服务端\";\n OutputStream write = socket.getOutputStream();\n write.write(message.getBytes(\"UTF-8\"));\n write.flush();\n LOG.info(\"to-server:\" + message);\n BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n StringBuilder sb = new StringBuilder();\n String temp;\n int index;\n while ((temp=br.readLine()) != null) {\n if ((index = temp.indexOf(\"EOF\")) != -1) {//遇到eof时就结束接收\n sb.append(temp.substring(0, index));\n break;\n }\n sb.append(temp);\n }\n LOG.info(\"get-server:\" + sb);\n write.close();\n br.close();\n socket.close();\n\n\n }", "protected void onBadClient(Throwable e) {\n log.warn(\"Caught exception (maybe client is bad)\", e);\n }", "public void run() {\n try {\n //clientSocket only writes to MainServer\n //establish the inputStream\n DataInputStream inputFromClient = new DataInputStream(\n clientSocket.getInputStream());\n\n //Instance of Reunion\n ObjectInputStream objectFromClient=new ObjectInputStream(\n clientSocket.getInputStream());\n\n //Questionable\n ObjectOutputStream objectOutputToClient = new ObjectOutputStream(\n clientSocket.getOutputStream());\n\n //get from the client the port that was established for the client server\n String receivedInfo = inputFromClient.readUTF();\n\n //parse the receivedInfo into port number and clientName\n clientName = receivedInfo.split(\":\")[1];\n int portToConnect = Integer.valueOf(receivedInfo.split(\":\")[0]);\n\n System.out.println(\"port: \" +portToConnect + \" Name: \" + clientName);\n\n //create a connection socket to the clientServer\n Socket toCServerSocket = new Socket(\"localhost\",portToConnect);\n\n //create an output stream to the clientServer Socket\n DataOutputStream outputToClient = new DataOutputStream(\n toCServerSocket.getOutputStream());\n\n //store client and socket info into Administrador dictionary\n ArrayList<Socket> holder = new ArrayList<>();\n holder.add(clientSocket);\n holder.add(toCServerSocket);\n //[0] socket that listens to client\n //[1] socket that writes to clientServer\n mServer.Administrador.put(clientName,holder);\n\n //TODO: we need to determine a proper way to handle listening events\n while (true) {\n //String type = inputFromClient.readUTF();\n //outputToClient.writeUTF(type);\n\n Reunion reunionReceived=(Reunion) objectFromClient.readObject();\n\n System.out.println(reunionReceived.toString());\n\n\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "@Override\r\n\tpublic void handleRequest(){\r\n\r\n\t\ttry {\r\n\t\t\t_inFromClient = new ObjectInputStream(_socket.getInputStream());\r\n\t\t\t_outToClient = new ObjectOutputStream(_socket.getOutputStream());\r\n\t\t _humanQuery = (String) _inFromClient.readObject();\r\n\t\t _outToClient.writeObject(manageCommunication());\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}", "public Client(ClientEvents event) throws UnknownHostException, IOException {\n\t\t// TODO Auto-generated constructor stub\n\t\t//super(\"83.52.33.147\", 3553);\n\t\tmIp = \"85.53.66.42\";\n\t\tmPort = 3553;\n\t\tthis.event = event;\n\t\tmInstance = this;\n\t\t\n\t\t//startConection();\n\t}", "private void start_Connexion()throws UnknownHostException, IOException{\n \tsocket = new Socket(IP,num_Socket);\n \tout = new ObjectOutputStream(socket.getOutputStream());\n \tin = new ObjectInputStream(socket.getInputStream());\n \t\n }", "public void writeObject(Object toServer) {\n try {\n outputStream.writeObject(toServer);\n }\n catch(InvalidClassException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - the object being written could not be serialized!\");\n e.printStackTrace();\n System.exit(1);\n } catch(NotSerializableException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - the object being written belongs to a non-serializable data type!\");\n e.printStackTrace();\n System.exit(1);\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - error writing an object into the socket's output stream!\");\n e.printStackTrace();\n System.exit(1);\n }\n }", "@Override\n\tpublic void connect() throws IOException {\n\n\t}", "@Override\n public void socket() {\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tRecieveSocketOfClient(SocketForClient);\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "protected void handleClientInput(Object objectFromClient) {\n Object objectToClient = null;\n\n // DOES NOTHING\n\n if (objectToClient != null)\n this.clientConnection.send(objectToClient);\n }", "public void init() {\n\t\ttry {\n\t\t\tthis.is = new ObjectInputStream(clientSocket.getInputStream());\n\t\t\tthis.os = new ObjectOutputStream(clientSocket.getOutputStream());\n\t\t\twhile (this.readCommand()) {}\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void cclient() throws Exception {\n\n\t\tws.xml c = this.ls.cclient();\n\t\tfor (String[] row : c.t) {\n\t\t\tString pat1 = row[0];\n\t\t\tcomboBox.addItem(pat1);\n\t\t}\n\t}", "void doClientSide() throws Exception {\n\n\t\tSSLSocketFactory sslsf = (SSLSocketFactory) SSLSocketFactory\n\t\t\t\t.getDefault();\n\t\tSSLSocket sslSocket = (SSLSocket) sslsf.createSocket(theServerName,\n\t\t\t\t12345);\n\t\t\n\t\tOutputStream sslOS = sslSocket.getOutputStream();\n\t\tsslOS.write(\"Hello SSL Server\".getBytes()); // Write to the Server\n\t\tsslOS.flush();\n\t\tsslSocket.close();\n\t}", "public void connect() throws IOException {\n socket = new java.net.Socket(IP_SERVER, PORT);\n Logger.getLogger(\"SocketClient\").log(Level.INFO, \"Socket establecido\");\n }", "@Override\r\n\tpublic void handleServerException(Exception e, String commandReceived) {\r\n\t\tLoggingUtils.logError(logger, e, \"Error from the TCPServerHandler\");\r\n\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void run() {\r\n\t\t//prendo gli streams per comunicare con il server\r\n\t\tDataOutputStream writer = ClientMain.WRITER;\r\n\t\tDataInputStream reader = ClientMain.READER;\r\n\t\t\r\n\t\t//creo la richiesta di look up\r\n\t\tJSONObject request = new JSONObject();\r\n\t\trequest.put(\"OP\", \"LOOKUP\");\r\n\t\trequest.put(\"ID\", nickname);\r\n\t\t\t\t\r\n\t\t//variabili per gestire la riposta del server\r\n\t\tString response = null;\r\n\t\tJSONObject responseJSON = null;\r\n\t\t\t\t\t\t\t\t\r\n\t\ttry {\r\n\t\t\t//mando la richiesta\r\n\t\t\twriter.writeUTF(request.toJSONString());\r\n\t\t\twriter.flush();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t//ricevo la risposta\r\n\t\t\tresponse = reader.readUTF();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//trasformo in formato JSON la risposta ricevuta dal server\r\n\t\t\tresponseJSON = \t(JSONObject) new JSONParser().parse(response);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t//se c'è qualche problema di comunicazione con il server\r\n\t\t\t//o se non è possibile parsare il messaggio ricevuto\r\n\t\t\te.printStackTrace();\r\n\t\t\t//termino il client\r\n\t\t\tClientMain.cleanUp();\r\n\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t//controllo l'esito della risposta\r\n\t\tOperations esito = Operations.valueOf((String) responseJSON.get(\"OP\"));\r\n\t\tif (esito==Operations.OP_OK) {\r\n\t\t\t//prendo il responso della ricerca\r\n\t\t\tString msg = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msg);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//prendo il messaggio di errore trasmesso dal server\r\n\t\t\tString msgErr = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msgErr);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t}", "public void run() {\r\n try {\r\n this.is = new ObjectInputStream(clientSocket.getInputStream());\r\n this.os = new ObjectOutputStream(clientSocket.getOutputStream());\r\n while (this.readCommand()) {}\r\n } \r\n catch (IOException e) \r\n {\r\n \tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\r\n e.printStackTrace();\r\n }\r\n }", "public Cliente(String cpf, Object object, String nome, Object object0, int codCliente) {\r\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }", "@Override\r\n\tpublic void send() throws Exception {\n\t\t\r\n\t}", "public void closeConnection() {\n try {\n if ( clientSocket != null ) {\n clientSocket.close();\n }\n } catch ( IOException e ) {\n logger.error( \"Error closing sokcet to client \" + getId(), e );\n }\n }", "@Override\n\tpublic void connect() throws IOException {\n\t}", "private void handleSingleClient(Socket connectionSocket) throws IOException {\n\t\tBufferedReader inFromClient = new BufferedReader(new InputStreamReader(\n\t\t\t\tconnectionSocket.getInputStream()));\n\t\tDataOutputStream outToClient = new DataOutputStream(\n\t\t\t\tconnectionSocket.getOutputStream());\n\n\t\twhile (!connectionSocket.isClosed()) {\n\t\t\tString clientSentence = inFromClient.readLine();\n\t\t\tif (clientSentence != null) {\n\t\t\t\tSystem.out.println(\"Received: \" + clientSentence);\n\t\t\t\tif (clientSentence.equals(\".\"))\n\t\t\t\t\tbreak;\n\t\t\t\tString capitalizedSentence = clientSentence.toUpperCase() + '\\n';\n\t\t\t\toutToClient.writeBytes(capitalizedSentence);\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t\tconnectionSocket.close(); // exceptions will be thrown upward\n\t}", "private void getMessage() throws Exception {\n\t\tGetTimestamp(\"Getting Message: \");\n\t\tString msg = \"\";\n\t\tString decmsg = \"\";\n\t\tbyte[] result;\n\t\ttry {\n\t\t\tmsg = br.readLine();\n\t\t\tJSONObject RESPONSE = new JSONObject();\n\t\t\tRESPONSE.put(\"payload\", msg);\n\t\t\tSystem.out.println(RESPONSE);\n\t\t\tdecmsg = decrypt(serversharedkey, msg);\n\t\t\tSystem.out.println(\"Decrypted Message from client is \" + decmsg);\n\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t\tif (decmsg.equalsIgnoreCase(\"bye\")) {\n\t\t\tSystem.out.println(\"Client has signed out!\");\n\t\t\tcloseConnection();\n\n\t\t} else {\n\t\t\tsendMessage();\n\t\t}\n\n\t}", "private void error() {\n this.error = true;\n this.clients[0].error();\n this.clients[1].error();\n }", "private Socket createClient()\n\t{\n\t\tSocket client = null;\n\t\ttry {\n\t\t\tclient = this.server.accept();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tinsertLogEntry(e.getMessage(), e.getStackTrace().toString());\n\t\t}\n\t\t\n\t\treturn client;\n\t}", "public void fromMicroServer() throws Exception {\n \tbyte[] buf = new byte[1024];\n\t\tDatagramPacket dp = new DatagramPacket(buf, 1024);\n\t\ttry{\n\t\t\ttoMicroServer.receive(dp);\n\t\t\trecieve = true;\n\t\t}\n\t\tcatch (IOException e){\n\t\t\tSystem.out.println(\"Connection timed out, retrying...\");\n\t\t\trecieve = false;\n\t\t\treturn;\n\t\t}\n str = new String(dp.getData(), 0, dp.getLength());\n\t\tSystem.out.printf(\"Child about to send message: %s \\n\", str);\n\n }" ]
[ "0.61314416", "0.5861954", "0.58618397", "0.5785428", "0.5743838", "0.57290953", "0.5708915", "0.5680675", "0.5614933", "0.5596348", "0.5590534", "0.555405", "0.5551597", "0.5545735", "0.55401915", "0.5505481", "0.5496788", "0.54890686", "0.54870653", "0.5465336", "0.54425114", "0.54307795", "0.53992116", "0.5373527", "0.53721106", "0.5352658", "0.5347315", "0.5344395", "0.53314036", "0.532892", "0.5325064", "0.531483", "0.53061557", "0.5301607", "0.529523", "0.528838", "0.52850574", "0.5281477", "0.5271975", "0.5268704", "0.5260366", "0.52496946", "0.5247752", "0.5246709", "0.52435076", "0.52412754", "0.5238381", "0.52361184", "0.5225586", "0.5218763", "0.5218419", "0.5212065", "0.5211906", "0.5210646", "0.518974", "0.5189734", "0.5185808", "0.5182649", "0.5181572", "0.51801485", "0.51779807", "0.5168013", "0.5159398", "0.51581186", "0.5155347", "0.5152188", "0.51457715", "0.51399344", "0.5135112", "0.5132914", "0.5127629", "0.5127194", "0.51253444", "0.51241094", "0.51217246", "0.5113765", "0.51096225", "0.51073223", "0.5105567", "0.51048416", "0.5104613", "0.5101876", "0.5100681", "0.5095359", "0.5093718", "0.5091132", "0.50895834", "0.5087489", "0.5083126", "0.50818485", "0.5081261", "0.50793105", "0.50769013", "0.5071161", "0.50698006", "0.5065059", "0.50615406", "0.5060418", "0.50583345", "0.5056476", "0.5054743" ]
0.0
-1
Diese Methode wechselt beim Player den Server an den er comObjects weiterleiten soll. Dabei wird er aus dem playerSet des alten Servers entfernt und in das playerSet des neuen Players eingefuegt. Vom neuen Server ein ComUpdatePlayerlist Objekt mit broadcast an alle Clients, die vom Server verwaltet werden, verschickt.
public void changeServer(Server newServer) { server = newServer; server.broadcast(new ComUpdatePlayerlist(this.getPlayerName(), false)); server.addPlayer(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updatePlayerList() \n\t{\n\t\tplayerStatus.clear();\n\n\t\tfor(Player thisPlayer: players) // Add the status of each player to the default list model.\n\t\t{\n\t\t\tplayerStatus.addElement(thisPlayer.toString());\n\t\t}\n\n\t}", "public void updateLobby(Set<String> players) {\r\n lobbyFrame.updateList(players);\r\n }", "public void updateConnectedPlayers(ArrayList<Player> connectedPlayers) throws RemoteException{\n match.setPlayers(connectedPlayers);\n for (int i=0;i<match.getPlayers().size();i++){\n System.out.println(\"[LOBBY]: Player \"+ match.getPlayers().get(i).getNickname()+ \" is in lobby\");\n }\n System.out.println(\"[LOBBY]: Refreshing Lobby..\");\n Platform.runLater(() -> firstPage.refreshPlayersInLobby());// Update on JavaFX Application Thread\n }", "protected void updatePlayer(Player player, PacketBuilder packet) {\n\n /*\n * The update block packet holds update blocks and is send after the\n * master packet.\n */\n PacketBuilder updateBlock = new PacketBuilder();\n\n /*\n * Updates this player.\n */\n manageMovement(true, player, packet);\n masks(player, updateBlock, false);\n\n /*\n * Write the current size of the player list.\n */\n packet.putBits(8, player.getLocalPlayers().size());\n\n /*\n * Iterate through the local player list.\n */\n for (Iterator<Player> it$ = player.getLocalPlayers().iterator(); it$.hasNext(); ) {\n /*\n * Get the next player.\n */\n Player otherPlayer = it$.next();\n\n /*\n * If the player should still be in our list.\n */\n if (WorldModule.getLogic().getPlayers().contains(otherPlayer)\n && !otherPlayer.basicSettings().isTeleporting()\n && otherPlayer.getLocation().withinRange(\n player.getLocation())) {\n /*\n * Update the movement.\n */\n manageMovement(false, otherPlayer, packet);\n\n /*\n * Check if an update is required, and if so, send the update.\n */\n if (otherPlayer.getMasks().requiresUpdate()) {\n masks(otherPlayer, updateBlock, false);\n }\n } else {\n /*\n * Otherwise, remove the player from the list.\n */\n it$.remove();\n\n /*\n * Tell the client to remove the player from the list.\n */\n packet.putBits(1, 1);\n packet.putBits(2, 3);\n }\n }\n\n /*\n * Loop through every player.\n */\n for (Player otherPlayer : WorldModule.getLogic().getLocalPlayers(player.getLocation())) {\n /*\n * Check if there is room left in the local list.\n */\n if (player.getLocalPlayers().size() >= 255) {\n /*\n * There is no more room left in the local list. We cannot\n * add more players, so we just ignore the extra ones. They\n * will be added as other players get removed.\n */\n break;\n }\n\n /*\n * If they should not be added ignore them.\n */\n if (otherPlayer == null || otherPlayer == player\n || player.getLocalPlayers().contains(otherPlayer) || otherPlayer.isReleased()) {\n continue;\n }\n\n /*\n * Add the player to the local list if it is within distance.\n */\n player.getLocalPlayers().add(otherPlayer);\n\n /*\n * Add the player in the packet.\n */\n addPlayer(packet, player, otherPlayer);\n\n /*\n * Update the player, forcing the appearance flag.\n */\n masks(otherPlayer, updateBlock, true);\n }\n\n /*\n * Check if the update block is not empty.\n */\n if (updateBlock.getPosition() != 0) {\n /*\n * Write a magic id indicating an update block follows.\n */\n packet.putBits(11, 2047);\n packet.recalculateBitPosition();\n\n /*\n * Add the update block at the end of this packet.\n */\n packet.put(updateBlock.toPacket().getBytes());\n } else {\n /*\n * Terminate the packet normally.\n */\n packet.recalculateBitPosition();\n }\n /*\n * Write the packet.\n */\n player.write(packet.toPacket());\n }", "void refreshPlayerList(Map<String, IPlayerConfig> playerList) throws RpcException;", "public void setPlayers(ArrayList<Player> players) {\n this.players = players;\n }", "public void sendUpdate() {\n int i = 1;\n\n Deque<ProxiedPlayer> removePlayers = new LinkedList<>();\n\n for (ProxiedPlayer player : playersQueue) {\n Server playerServer = player.getServer();\n\n // Player is not connected OR Player Server is not the Queue Server\n if (!player.isConnected() || !playerServer.getInfo().getName().equals(Config.queue)) {\n removePlayers.add(player);\n continue;\n }\n\n player.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', Config.messagePosition.replaceAll(\"%position%\", Integer.toString(i))) + \"§r\"));\n\n i++;\n }\n\n for (ProxiedPlayer player : removePlayers) {\n try {\n // Remove Player from the queue\n mutex.acquire();\n playersQueue.remove(player);\n\n Main.log(\"sendUpdate\", \"§3§b\" + player.toString() + \"§3 was removed from §b\" + Config.queue + \"§3 (wrong server or disconnected). Queue count is \" + playersQueue.size() + \".\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }", "public void updatePlayerInstances()\r\n {\r\n long var1 = this.theWorldServer.getTotalWorldTime();\r\n int var3;\r\n PlayerManager.PlayerInstance var4;\r\n\r\n if (var1 - this.previousTotalWorldTime > 8000L)\r\n {\r\n this.previousTotalWorldTime = var1;\r\n\r\n for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3)\r\n {\r\n var4 = (PlayerManager.PlayerInstance)this.playerInstanceList.get(var3);\r\n var4.onUpdate();\r\n var4.processChunk();\r\n }\r\n }\r\n else\r\n {\r\n for (var3 = 0; var3 < this.playerInstancesToUpdate.size(); ++var3)\r\n {\r\n var4 = (PlayerManager.PlayerInstance)this.playerInstancesToUpdate.get(var3);\r\n var4.onUpdate();\r\n }\r\n }\r\n\r\n this.playerInstancesToUpdate.clear();\r\n\r\n if (this.players.isEmpty())\r\n {\r\n WorldProvider var5 = this.theWorldServer.provider;\r\n\r\n if (!var5.canRespawnHere())\r\n {\r\n this.theWorldServer.theChunkProviderServer.unloadAllChunks();\r\n }\r\n }\r\n }", "private void broadcast(ArrayList<Integer> update){\n for (Player p : players.values()){\n p.sendModel(update);\n }\n }", "public void setPlayers(ArrayList<Player> players) {\n\t\tthis.players = players;\n\t}", "void updateOnlinePlayers(String skipone) { \r\n DynmapPlayer[] players = server.getOnlinePlayers();\r\n DynmapPlayer[] pl = new DynmapPlayer[players.length];\r\n System.arraycopy(players, 0, pl, 0, pl.length);\r\n if(skipone != null) {\r\n for(int i = 0; i < pl.length; i++)\r\n if(pl[i].getName().equals(skipone))\r\n pl[i] = null;\r\n }\r\n online = pl;\r\n }", "public void getPlayerList() {\n if (connected == true) {\n try {\n write(\"get playerlist\");\n } catch (IOException e) {\n System.out.println(\"No connecting with server:ServerCommunication:getPlayerList()\");\n }\n }\n }", "public List<ServerPlayerEntity> getPlayerList() {\n return this.players;\n }", "public static void set_players(){\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\tbat1=PlayBrain1.myteam[0];\n\t\t\tbat2=PlayBrain1.myteam[1];\n\t\t\tStriker=bat1;\n\t\t\tNonStriker=bat2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tbat1=PlayBrain1.oppteam[0];\n\t\t\t\tbat2=PlayBrain1.oppteam[1];\n\t\t\t\tStriker=bat1;\n\t\t\t\tNonStriker=bat2;\n\n\t\t\t\t}\n\t}", "public void setPlayers(Player[] players) {\n this.players = players;\n }", "public void updateTrackers(Set<LanternPlayer> players) {\n // TODO: Sync the updates in a different thread?\n if (this.pulseCounter++ % UPDATE_RATE != 0) {\n return;\n }\n\n AbstractEntityProtocol<?> removed;\n while ((removed = this.queuedForRemoval.poll()) != null) {\n removed.destroy(new EntityProtocolInitContextImpl(removed));\n }\n\n final List<AbstractEntityProtocol.TrackerUpdateContextData> updateContextDataList = new ArrayList<>();\n\n final Set<AbstractEntityProtocol<?>> protocols = new HashSet<>(this.entityProtocols.values());\n for (AbstractEntityProtocol<?> protocol : protocols) {\n final AbstractEntityProtocol.TrackerUpdateContextData contextData = protocol.buildUpdateContextData(players);\n if (contextData != null) {\n //noinspection unchecked\n protocol.updateTrackers(contextData);\n updateContextDataList.add(contextData);\n }\n }\n\n for (AbstractEntityProtocol.TrackerUpdateContextData contextData : updateContextDataList) {\n contextData.entityProtocol.postUpdateTrackers(contextData);\n }\n }", "public void setPlayer(Player _player) { // beallit egy ezredest az adott mapElementre, ha az rajta van\n player = _player;\n }", "@Override\r\n public void handleMessage (Message inputMessage) {\n OnUpdatePlayerSubscription.OnUpdatePlayer updatePlayer = response.data().onUpdatePlayer();\r\n\r\n Log.i(TAG, \"updated user is \" + updatePlayer.toString() + \" session id is \" + sessionId);\r\n //checking if the updated player is in this session\r\n if(updatePlayer.session().id().equals(sessionId)){\r\n boolean contains = false;\r\n\r\n //checking if the updated player is in the current player list\r\n for(Player player : players){\r\n\r\n // if we have a match update players lat/long\r\n if(updatePlayer.id().equals(player.getId())){\r\n List<LatLng> bananasList = new LinkedList<>();\r\n bananasList.add(new LatLng(response.data().onUpdatePlayer().lat(),\r\n response.data().onUpdatePlayer().lon()));\r\n player.setLocations(bananasList); // sets location for the player\r\n player.setIt(updatePlayer.isIt());\r\n contains = true;\r\n }\r\n }\r\n\r\n //if the player is in the session, but not in the player list, then make a new player and add them to the players list and add a marker\r\n if(contains == false){\r\n Marker marker = mMap.addMarker(new MarkerOptions()\r\n .position(new LatLng(updatePlayer.lat(), updatePlayer.lon()))\r\n .title(updatePlayer.username()));\r\n Circle circle = mMap.addCircle(new CircleOptions()\r\n .center(new LatLng(updatePlayer.lat(), updatePlayer.lon()))\r\n .radius(tagDistance)\r\n .fillColor(Color.TRANSPARENT)\r\n .strokeWidth(3));\r\n\r\n marker.setIcon(playerpin);\r\n circle.setStrokeColor(notItColor);\r\n\r\n Player newPlayer = new Player();\r\n newPlayer.setId(updatePlayer.id());\r\n newPlayer.setIt(false);\r\n newPlayer.setMarker(marker);\r\n newPlayer.setCircle(circle);\r\n newPlayer.setUsername(updatePlayer.username());\r\n List<LatLng> potatoes = new LinkedList<>();\r\n potatoes.add(new LatLng(updatePlayer.lat(), updatePlayer.lon()));\r\n newPlayer.setLocations(potatoes);\r\n\r\n //adding player to the list of players in the game\r\n players.add(newPlayer);\r\n }\r\n }\r\n// for(Player player : players) {\r\n// if(response.data().onUpdatePlayer().id().equals(player.getId())) {\r\n// // if true (we have a match) update players lat/long\r\n// List<LatLng> bananasList = new LinkedList<>();\r\n// bananasList.add(new LatLng(response.data().onUpdatePlayer().lat(),\r\n// response.data().onUpdatePlayer().lon()));\r\n// player.setLocations(bananasList); // sets location for the player\r\n// //Might have been causing the starting point to move\r\n//// player.getCircle().setCenter(player.getLastLocation());\r\n//// player.getMarker().setPosition(player.getLastLocation());\r\n// }\r\n// }\r\n }", "void updatePlayer(Player player);", "public void updatePlayers(ArrayList<PlayerDeck> decks)\n\t{\n\t\tplayers = decks;\n\t\trepaint();\n\t}", "public void handleSendPlayers(long id, List<Player> players){\r\n\t\t//convert arraylist to array\r\n\t\tPlayer[] playerArray = players.toArray(new Player[players.size()]);\r\n\t\t\r\n\t\tsuper.handleSendPlayers(id, playerArray);\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\tListIterator<Player> it = players.listIterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tit.next().update();\r\n\t\t}\r\n\t\t// Logica del juego, etc\r\n\t\tcontrolMenu();\r\n\t}", "public void updated(ServerList list);", "public Player updatePlayer(Player player);", "private void updatePlayersStatus() {\n PlayerModel[] playersInLobby = this.lobbyModel.getPlayersInLobby();\n int i = 0;\n for (; i < playersInLobby.length; i++) {\n final PlayerModel playerInLobby = playersInLobby[i];\n final TextField playerStatus = this.playersStatus[i];\n playerStatus.setColor(playerInLobby.isReady() ? Color.GREEN : Color.RED);\n playerStatus.setText(playerInLobby.getUsername());\n playerInLobby.clearPropertyChangeListeners();\n this.addPropertyChangeListener(playerInLobby, new PropertyChangeListener() {\n @Override\n public void propertyChange(PropertyChangeEvent evt) {\n String propertyName = evt.getPropertyName();\n if (propertyName.equals(\"username\")) {\n playerStatus.setText((String) evt.getNewValue());\n } else if (propertyName.equals(\"ready\")) {\n playerStatus.setColor((boolean) evt.getNewValue() ? Color.GREEN : Color.RED);\n }\n }\n });\n if (i >= 1 && this.host) {\n TextButton kickButton = kickButtons[i - 1];\n kickButton.clearListeners();\n kickButton.addListener(new ClickListener() {\n @Override\n public void clicked(InputEvent e, float x, float y) {\n Connection connection = ConnectionManager.getInstance().getConnection();\n if (connection instanceof ServerConnection) {\n UUID playerUUID = playerInLobby.getPlayerUUID();\n ServerSenderReceiver client = ((ServerConnection) connection).getClientByUUID(playerUUID);\n if (client != null) {\n connection.sendPacket(new KickPlayerPacket(playerUUID));\n ((ServerConnection) connection).removeClient(client);\n connection.getPlayer().getLobby().removePlayer(client.getPlayer());\n }\n }\n }\n });\n kickButton.setDisabled(false);\n }\n }\n for (int j = i; j < this.playersStatus.length; j++) {\n final TextField playerStatus = this.playersStatus[j];\n playerStatus.setColor(Color.RED);\n playerStatus.setText(\"\");\n if (j >= 1 && this.host) {\n TextButton kickButton = kickButtons[j - 1];\n kickButton.clearListeners();\n kickButton.setDisabled(true);\n }\n }\n }", "public void setPlayers(ArrayList<Integer> players) {\n this.players= new ArrayList<>(players);\n }", "public static void updatePlayerCaches() {\n\t\tfor (Player player : getOnlinePlayers()) {\n\t\t\tPlayerCache cache = getCache(player);\n\n\t\t\tcache.reloadCache();\n\t\t}\n\t}", "public void setD_PlayerList(ArrayList<Player> p_PlayerList) {\n d_PlayerList = p_PlayerList;\n }", "public boolean sendPlayerUpdate(String gameID, Map<Player, Team> players) {\n//\t\tSystem.out.println(\"Player.sendPlayerUpdate()\");\n\t\tMap<String, Integer> playerAndTeam = new HashMap<String, Integer>();\n\t\tMap<String, String> playerjidAndPlayername = new HashMap<String, String>();\n\t\tMap<String, Boolean> playerjidAndPlayerstate = new HashMap<String, Boolean>();\n\t\tMap<String, GeoPosition> playerAndPosition = new HashMap<String, GeoPosition>();\n\t\t\n\t\tfor(Player player : players.keySet()){\n\t\t\tString playerJid = player.getJid();\n\t\t\tif(players.get(player) != null){\n\t\t\t\tTeam team = players.get(player);\n\t\t\t\tplayerAndTeam.put(playerJid,team.getNumber());\n\t\t\t}else{\n\t\t\t\tplayerAndTeam.put(playerJid, -1);\n\t\t\t}\n\t\t\tplayerjidAndPlayername.put(playerJid, player.getName());\n\t\t\tplayerjidAndPlayerstate.put(playerJid, player.getState());\n\t\t\tplayerAndPosition.put(playerJid, player.getActualPosition());\n\t\t}\n\t\t\n\t\tPlayerUpdateBean bean = new PlayerUpdateBean(gameID, playerAndTeam, playerjidAndPlayername, playerjidAndPlayerstate, playerAndPosition);\n\t\tbean.setFrom(fromJID);\n\t\tbean.setTo(jid);\n\t\tbean.setType(XMPPBean.TYPE_SET);\n\t\t\n\t\tconnection.sendPacket(new BeanIQAdapter(bean));\n\n\t\tunacknowledgedBeans.add(bean);\n\t\tnew BeanResenderTask(bean, this);\n\t\treturn true;\n\t}", "public ServerPlayers() {\n sockets = new ArrayList<Socket>();\n }", "public PlayerSet getPlayer(){\n return definedOn;\n }", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "@Override\n public void update(Observable o, Object remoteView) {\n RemoteView remote = (RemoteView) remoteView;\n this.mapView = remote.getMapView();\n this.playerHand = remote.getPlayerHands().get(this.playerId);\n this.playerBoardViews = remote.getPlayerBoardViews();\n this.playerPosition = remote.getMapView().getPlayerPosition(remote.getPlayerBoardViews().get(this.playerId).getColor());\n }", "public void update(Player player) {\n\t\t\n\t}", "@Override\n\tpublic void handleServer(EntityPlayerMP player) {\n\n\t}", "private void updatePlayersOptions(){\n\t\tfor(Player player : players.keySet()){\n\t\t\tif(player != null) {\n\t\t\t\tBlackjackHand hand = players.get(player).get(0);\n\t\t\t\tList<GameOptionsEnumeration> options = getGameOptions(player);\n\t\t\t\tupdateHandOptions(player, hand, options);\n\t\t\t}\n\t\t}\n\t}", "void updateState() {\n String[] players = client.getPlayers();\n System.out.println(Arrays.toString(players));\n\n if(oldPlayerNum != players.length){\n oldPlayerNum = players.length;\n updateComboBox();\n }\n\n playersListModel.clear();\n\n for (int i = 0; i < players.length; i++) {\n playersListModel.add(i, players[i]);\n }\n\n // SECOND check if player holding the ball / update GUI accordingly\n String[] playerBall = client.whoIsBall();\n boolean serverSideBall = Integer.parseInt(playerBall[1]) == client.getId();\n\n if (client.hasBall != serverSideBall) { // If the server says something different\n client.hasBall = serverSideBall;\n ballState(serverSideBall, playerBall[0]);\n }\n // THIRD if you are holding the ball update gui so that ball is throwable\n\n }", "private void refreshPlayerList() {\n List<MarketItem> items = new ArrayList<>();\n EntityRef player = localPlayer.getCharacterEntity();\n for (int i = 0; i < inventoryManager.getNumSlots(player); i++) {\n EntityRef entity = inventoryManager.getItemInSlot(player, i);\n\n if (entity.getParentPrefab() != null) {\n MarketItem item;\n\n if (entity.hasComponent(BlockItemComponent.class)) {\n String itemName = entity.getComponent(BlockItemComponent.class).blockFamily.getURI().toString();\n item = marketItemRegistry.get(itemName, 1);\n } else {\n item = marketItemRegistry.get(entity.getParentPrefab().getName(), 1);\n }\n\n items.add(item);\n }\n }\n\n tradingScreen.setPlayerItems(items);\n }", "public void setPlayers(int theCompPlayer) throws Exception {\r\n\t\tswitch(theCompPlayer) {\r\n\t\t\tcase 1:\r\n\t\t\t\tcompPlayer = 1;\r\n\t\t\t\totherPlayer = 2;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tcompPlayer = 2;\r\n\t\t\t\totherPlayer = 1;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception(\"That player number is invalid\");\r\n\t\t}\r\n\t}", "protected void syncNewContainer(EntityPlayerMP player) {\n\t}", "@Override\n\tpublic void updatePlayer(Joueur joueur) {\n\t\t\n\t}", "public void update(Player localPlayer)\n\t{\n\t\t\n\t\tfor (int i = 0; i < entities.size(); i++)\n\t\t{\n\t\t\tif (entities.get(i) != null)\n\t\t\t\tentities.get(i).update();\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < players.size(); i++)\n\t\t{\n\t\t\tif (players.get(i) != null)\n\t\t\t\tplayers.get(i).update();\n\t\t}\n\t\t\n\t\tif (localPlayer != null)\n\t\t{\n\t\t\tthis.screenPos = new DVector((WIDTH/2) - localPlayer.worldPos.getX(),\n\t\t\t\t\t(HEIGHT/2) - localPlayer.worldPos.getY());\n\t\t}\n\t\t\n\t\tcheckCollisions();\n\t\n\t\tCollections.sort(players, new Comparator<PlayerMP>() {\n\t\t @Override\n\t\t public int compare(PlayerMP p1, PlayerMP p2) {\n\t\t if (p1.score < p2.score)\n\t\t return 1;\n\t\t if (p1.score > p2.score)\n\t\t return -1;\n\t\t return 0;\n\t\t }\n\t\t});\n\t\t\n\t}", "@SuppressWarnings(\"deprecation\")\n private void update(Player player) {\n Team team = teams.getTeam(player);\n\n if (team == null) {\n for (Player online : game.getPlayers()) {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n return;\n }\n\n for (Player online : game.getPlayers()) {\n if (team.hasPlayer(online)) {\n player.hidePlayer(online);\n online.hidePlayer(player);\n } else {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n }\n }", "public void playerSetFlag(List<String> playersList) {\n for (String playerId : playersList) {\n Player player = playerRepository.findBy_id(playerId);\n player.setFirst(false);\n player.setLast(false);\n playerRepository.save(player);\n }\n\n //setez First\n String idFirst = playersList.get(0);\n Player first = playerRepository.findBy_id(idFirst);\n first.setFirst(true);\n playerRepository.save(first);\n\n //setez Last\n String idLast = playersList.get(playersList.size() - 1);\n Player last = playerRepository.findBy_id(idLast);\n last.setLast(true);\n playerRepository.save(last);\n }", "@Override\n public void run(){\n ServerConnection[] clients = new ServerConnection[]{client2, client3, client1};\n\n for( ServerConnection c : clients ) {\n if ( c != null ){\n if ( client3 == null ){\n c.send(\"Game has started with code:\" + gameID + \".\\n\" + \"Current players are \" +\n client1.getName() + \", \" + client2.getName());\n }\n else {\n c.send(\"Game has started with code:\" + gameID + \".\\n\" + \"Current players are \" +\n client1.getName() + \", \" + client2.getName() + \", \" + client3.getName());\n }\n c.setGameID(gameID);\n }\n }\n\n String[] gods = readChallengerMessage();\n\n for (int i=0; i<2 && currClient != client1; i++){\n currClient.send(Arrays.toString(gods) );\n clientMessage = readClientMessage();\n if (i == 0) {\n gameMessage.setGod2(clientMessage.getGod());\n gameMessage.setName2(clientMessage.getName());\n } else if (i == 1) {\n gameMessage.setGod3(clientMessage.getGod());\n gameMessage.setName3(clientMessage.getName());\n }\n List<String> list = new ArrayList<String>(Arrays.asList(gods));\n list.remove( clientMessage.getGod().name());\n gods = list.toArray(new String[0]);\n currClient.send(\"Choice confirmed\");\n updateCurrClient();\n }\n\n currClient.send(gods[0]);\n gameMessage.setGod1(God.valueOf(gods[0]));\n gameMessage.setName1(client1.getName());\n updateCurrClient();\n resetUpdate();\n gameMessage.notify(gameMessage);\n sendLiteGame();\n\n for( ServerConnection c : clients ) {\n resetUpdate();\n if ( c != null ) {\n while ( !updateModel) {\n sendToCurrClient(\"Placing workers\");\n clientMessage = readClientMessage();\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.setSpace2(clientMessage.getSpace2());\n gameMessage.notify(gameMessage);\n if (!updateModel) {\n sendLiteGame();\n }\n }\n updateCurrClient();\n liteGame.setPlayer(currClient.getName());\n sendLiteGame();\n }\n }\n\n\n while ( !endOfTheGame ) {\n sendToCurrClient(\"Next action\");\n clientMessage = readClientMessage();\n\n if ( \"Choose Worker\".equals(clientMessage.getAction()) ) {\n chooseWorker();\n }\n else if ( \"Charon Switch\".equals(clientMessage.getAction()) ) {\n charonSwitch();\n }\n else if ( \"Prometheus Build\".equals(clientMessage.getAction()) ) {\n build();\n }\n else if ( \"Move\".equals(clientMessage.getAction()) ) {\n move();\n }\n else if ( \"Build\".equals(clientMessage.getAction()) ) {\n build();\n }\n\n if ( \"End\".equals(clientMessage.getAction()) ) {\n gameMessage.resetGameMessage();\n updateCurrClient();\n liteGame.setCurrWorker(5,5);\n liteGame.setPlayer(currClient.getName());\n sendLiteGame();\n }\n else {\n sendLiteGame();\n if ( !endOfTheGame && !playerRemoved ) {\n if (!updateModel) {\n currClient.send(\"Invalid action\");\n } else currClient.send(\"Action performed\");\n }\n else playerRemoved = false;\n }\n }\n\n sendToCurrClient(\"You won the match.\");\n server.endMatch(gameID, null);\n }", "private void loadPlayers() {\r\n this.passive_players.clear();\r\n this.clearRoster();\r\n //Map which holds the active and passive players' list\r\n Map<Boolean, List<PlayerFX>> m = ServiceHandler.getInstance().getDbService().getPlayersOfTeam(this.team.getID())\r\n .stream().map(PlayerFX::new)\r\n .collect(Collectors.partitioningBy(x -> x.isActive()));\r\n this.passive_players.addAll(m.get(false));\r\n m.get(true).stream().forEach(E -> {\r\n //System.out.println(\"positioning \"+E.toString());\r\n PlayerRosterPosition pos = this.getPlayerPosition(E.getCapnum());\r\n if (pos != null) {\r\n pos.setPlayer(E);\r\n }\r\n });\r\n }", "protected ClientList getCurrentPlayers() {\r\n\t\treturn this.players;\r\n\t}", "public void flushQueue() {\n // Ignore if queue is empty\n if (playersQueue.isEmpty())\n return;\n\n // Get status of target server\n ServerInfoGetter mainServerInfo = ServerInfoGetter.awaitServerInfo(Config.target);\n\n // Allow player to join the main server - 1s (ping timeout) + ~500ms (connection time) < 2s (interval)\n if (mainServerInfo.isOnline && mainServerInfo.playerCount < Config.maxPlayers && Math.min(Config.maxPlayers - mainServerInfo.playerCount, playersQueue.size()) > 0) {\n try {\n mutex.acquire();\n\n ProxiedPlayer player = null;\n\n // try to find the first player that got not kicked recently\n for (ProxiedPlayer testPlayer : playersQueue) {\n if (kickedPlayers.containsKey(testPlayer)) continue;\n\n player = testPlayer;\n break;\n }\n\n // if no player was found return\n if (player == null) return;\n\n playersQueue.remove(player);\n\n if (player.isConnected()) {\n ProxiedPlayer finalPlayer = player;\n ServerInfo targetServer = ProxyServer.getInstance().getServerInfo(Config.target);\n\n if (isNotConnected(player, targetServer)) {\n Callback<Boolean> cb = (result, error) -> {\n if (result) {\n Main.log(\"flushQueue\", \"§3§b\" + finalPlayer.toString() + \"§3 connected to §b\" + Config.target + \"§3. Queue count is \" + playersQueue.size() + \". Main count is \" + (mainServerInfo.playerCount + 1) + \" of \" + Config.maxPlayers + \".\");\n } else {\n Main.log(\"flushQueue\", \"§c§b\" + finalPlayer.toString() + \"s§c connection to §b\" + Config.target + \"§c failed: \" + error.getMessage());\n finalPlayer.sendMessage(TextComponent.fromLegacyText(\"§cConnection to \" + Config.serverName + \" failed!§r\"));\n playersQueue.add(finalPlayer);\n }\n };\n\n player.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', Config.messageConnecting) + \"§r\"));\n player.connect(targetServer, cb);\n } else {\n player.disconnect(TextComponent.fromLegacyText(\"§cYou are already connected to \" + Config.serverName + \"!\"));\n Main.log(\"flushQueue\", \"§c§b\" + player.toString() + \"§c was disconnected because there was already a connection for this account to the server.\");\n }\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "public void setPlayers(Hashtable<Integer, Player> players) {\r\n\t\tthis.players = players;\r\n\t}", "public void setPlayer(ViewerManager2 player) {\n this.player = player;\n // the player is needed to be existent befor starting up the remote Server\n //startRemoteServer();\n\n }", "void notifyPlayerChanged(PlayerNumber newPlayer);", "@Override\n\tpublic void update(){\n\t\tif(right && !left)\n\t\t{\n\t\t\tif(player1.getX() < cm.getGameStateManager().getWidth() - player1.getBounds().getWidth())\n\t\t\t\tplayer1.setX(player1.getX()+8);\n\t\t}\n\t\tif(!right && left)\n\t\t{\n\t\t\tif(player1.getX() > 0)\n\t\t\t\tplayer1.setX(player1.getX()-8);\n\t\t}\n\t\t\n\t\tcheckBarrelBounds();\n\t\ttry{\n\t\t\tcheckPlayerCollision();\t\t\n\t\t\trefreshData();\n\t\t}catch(IOException e){\n\t\t\tSystem.err.println(\"no connection with server\");\n\t\t}\n\t\tplayer1.update();\n\t\tplayer2.update();\n\t\tplayerIndication.update();\n\t}", "public void setPlayers(Player a_players[], int a_numPlayers)\n {\n m_numPlayers = a_numPlayers;\n \n for(int i = 0; i < m_numPlayers; i++)\n {\n m_currentPlayers.add(a_players[i]);\n m_players.add(a_players[i]);\n }\n }", "public static void clientListUpdater() {\r\n\t\tclientList.clear();\r\n\t\tclientList.addAll(serverConnector.getAllClients());\r\n\t}", "private void savePlayers() {\r\n this.passive_players.stream()\r\n .filter(E -> E.isChanged())\r\n .forEach(e -> {\r\n e.save();\r\n });\r\n }", "public void startserver()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tSocket clientsocket = serversocket.accept();\r\n\t\t\t\tif(clientsocket.isConnected())\r\n\t\t\t\t{\r\n\t\t\t\t\tDataOutputStream wdata = new DataOutputStream(clientsocket.getOutputStream());\r\n\t\t\t\t\tDataInputStream rdata = new DataInputStream(clientsocket.getInputStream());\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t// read message from client and add new player\r\n\t\t\t\t\tJsonObject newplayrejson = gson.fromJson(rdata.readUTF(), JsonObject.class);\r\n\t\t\t\t\tint mode = newplayrejson.get(\"mode\").getAsInt();\r\n\t\t\t\t\tclientaddresslist.get(mode).add(clientsocket.getInetAddress());\r\n\t\t\t\t\tString profession = newplayrejson.get(\"profession\").getAsString();\r\n\t\t\t\t\tString teamname;\r\n\t\t\t\t\tif(mode == 0)\r\n\t\t\t\t\t\tteamname = \"deathMatch\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(teamcount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tteamname = \"teamBlue\";\r\n\t\t\t\t\t\t\tif(king[0] == -1)\r\n\t\t\t\t\t\t\t\tking[0] = idcount[mode];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tteamname = \"teamRed\";\r\n\t\t\t\t\t\t\tif(king[1] == -1)\r\n\t\t\t\t\t\t\t\tking[1] = idcount[mode];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tteamcount = !teamcount;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcdc.collideObjectManager[mode].addCharacter(collideObjecctClass.valueOf(profession), idcount[mode], randposition(), newplayrejson.get(\"name\").getAsString(), TeamName.valueOf(teamname));\r\n\t\t\t\t\tclientidlist.get(mode).add(idcount[mode]);\r\n\t\t\t\t\t++idcount[mode];\r\n\t\t\t\t\t++playercount[mode];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// sending collideobject list to client\r\n\t\t\t\t\twdata.writeInt(idcount[mode] - 1);\r\n\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tfor(CollideObject object : cdc.collideObjectManager[mode].collideObjectList)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twdata.writeUTF(object.getClass().getName());\r\n\t\t\t\t\t\twdata.writeUTF(gson.toJson(object));\r\n\t\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\twdata.writeUTF(\"done\");\r\n\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// send king id if mode is kingkill\r\n\t\t\t\t\tif(mode == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twdata.writeInt(king[0]);\r\n\t\t\t\t\t\twdata.writeInt(king[1]);\r\n\t\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tThread thread = new Thread(new clientmanager(clientsocket , this , mode));\r\n\t\t\t\t\tthread.start();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public CopyOnWriteArrayList<Player> getPlayerList() \t\t\t\t\t\t\t{ return this.playerList; }", "public static interface Client\n\t{\n\n\t\t/**\n\t\t * Server notify the client to refresh the player list.\n\t\t * @param playerList New player list.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid refreshPlayerList(Map<String, IPlayerConfig> playerList) throws RpcException;\n\n\t\t/**\n\t\t * Server notify the client to refresh the game config. Client is expected to display it in GameCreation panel.\n\t\t * @param gameCfg New game config.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid refreshGameConfig(GameConfig gameCfg) throws RpcException;\n\t\t\n\t\t/**\n\t\t * Server broadcast game creation message from another player.\n\t\t * @param fromPlayer Sender player. \n\t\t * @param msg Message.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receiveGameCreationMessage(String fromPlayer, String msg) throws RpcException;\n\n\t\t/**\n\t\t * Server broadcast running game message from another player.\n\t\t * @param fromPlayer Sender player. \n\t\t * @param msg Message.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receiveRunningGameMessage(String fromPlayer, String msg) throws RpcException;\n\t\t\n\t\t/**\n\t\t * Server broadcast paused game message from another player.\n\t\t * @param fromPlayer Sender player. \n\t\t * @param msg Message.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receivePausedGameMessage(String fromPlayer, String msg) throws RpcException;\n\t\t\n\t\t/**\n\t\t * Server broadcast new turn events.\n\t\t * Client should process these events on local gameboard.\n\t\t * If there is an error processins events on local gameboard, then it means local gameboard and server gameboard view for this player are out of sync.\n\t\t * In that case, client should call {@link ServerRunningGame#getEntireGameLog()} methods to recreate a fresh local gameboard.\n\t\t * @param newTurnEvents Events generated on turn resolution.\n\t\t * @throws RpcException On connection error.\n\t\t */\n\t\tvoid receiveNewTurnGameBoard(List<IGameEvent> newTurnEvents) throws RpcException;\n\t}", "public void setPlayer(Player player) {\n this.player = player;\n }", "void playerPositionChanged(Player player);", "public Set<Player> getPlayers() {\n return players;\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "@Override\n public List<Player> getPlayers() {\n return players;\n }", "public void saveAllPlayers() {\n for (Player player : bukkitService.getOnlinePlayers()) {\n savePlayer(player);\n }\n }", "public void setData(List<Player> players, Player owningPlayer) {\n this.players = players;\n thisPlayer = owningPlayer;\n }", "@Override\n public ArrayList<Player> getPlayers() {return steadyPlayers;}", "public void handle(EntityPlayerMP player, GUIUpdatePacket message) {\n Container container = player.openContainer;\n if(container != null){\n if(container instanceof SyncableContainer){\n SyncableContainer synCont = (SyncableContainer) container;\n SyncableTileEntity tileSyncable = synCont.getSyncableTileEntity();\n tileSyncable.doSync(message.toSync);\n // We have adjusted the clientside values for at least one client. We need to send these updated\n // values to all players so that they can all see it\n TileEntity tile = (TileEntity) tileSyncable;\n for(EntityPlayerMP pl : player.getServerWorld().getPlayers(EntityPlayerMP.class, new Predicate<EntityPlayerMP>() {\n @Override\n public boolean apply(@Nullable EntityPlayerMP input) {\n if(Math.sqrt(input.getPosition().distanceSq(tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ())) < 5D){\n if(input.openContainer != null){\n if(input.openContainer instanceof SyncableContainer){\n return true;\n }\n }\n }\n return false;\n }\n })){\n TonePacketHandler.sendTo(new PlayerGuiSyncMessage(message.toSync), pl);\n }\n }\n }\n }", "@Override\r\n\t\tpublic void run()\r\n\t\t{\r\n\r\n\t\t\t\r\n\t\t\twhile(clientsocket.isConnected())\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t// get type for update. 1 for object update, 2 for new attack object\r\n\t\t\t\t\tint type = rdata.readInt();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(type == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString playerupdatestr = rdata.readUTF();\r\n\t\t\t\t\t\tJsonObject jsonObject = server.gson.fromJson(playerupdatestr, JsonObject.class);\r\n\t\t\t\t\t\tint index = findlistindex(jsonObject.get(\"ID\").getAsInt());\r\n\t\t\t\t\t\tArrayList<CollideObject> templist = server.cdc.collideObjectManager[mode].collideObjectList;\r\n\t\t\t\t\t\tCollideObject obj = server.gson.fromJson(jsonObject, templist.get(index).getClass());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttemplist.set(index,obj);\r\n\t\t\t\t\t\tif(obj.getFlag())\r\n\t\t\t\t\t\t\tserver.cdc.calculatecollide(mode);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tserver.broacast_update(mode , obj);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString classname = rdata.readUTF();\r\n\t\t\t\t\t\tint id = rdata.readInt();\r\n\t\t\t\t\t\tint index = findlistindex(id);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tserver.cdc.collideObjectManager[mode].addAttackObject(collideObjecctClass.valueOf(classname), server.idcount[mode], server.randposition(),(Character) server.cdc.collideObjectManager[mode].collideObjectList.get(index));\r\n\t\t\t\t\t\t++server.idcount[mode];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t//e.printStackTrace();\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}", "public Set<String> getPlayers()\n\t{\n\t\tSet<String> player = playerPieces.keySet();\n\t\treturn player;\n\t}", "public synchronized void updateOpponentCollection (ServerThread oppo) {\n\t\tsendMessage (\"Signal:UpdateOpponentCollection\", oppo);\n\t\tfor(int j=0; j < Collection.size(); j++) {\n\t\t\t// Signal clients that the next few cards will be the opponent's collection\n\t\t\tsendMessage (\"Signal:SendOpponentCollection\", oppo);\n\t\t\t// Make sure the messages are not sent to clients at the same time as the cards\n\t\t\ttry {\n\t\t\t\tThread.sleep (10);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tsendCard (Collection.get (j), oppo);\n\t\t}\n\t\tsendMessage (\"Signal:SendOpponentCollectionEnded\", oppo);\n\t}", "abstract void updatePlayer();", "@Test\n public void testsetPlayerList() {\n ArrayList<Player> players = new ArrayList<>();\n // Make 2 players.\n Player lars = new Player(\"127.0.0.1\", \"Lars\");\n Player remco = new Player(\"127.0.1.1\", \"Remco\");\n // Add the 2 players to the list.\n players.add(lars);\n players.add(remco);\n // Now set the player list to the session.\n session.setPlayerList(players);\n // Check if the list has a size of 2.\n assertEquals(2, session.getPlayers().size());\n }", "public void updatePlayer(Player player) {\n\t\t// update the flag GO TO JAIL in Player class\n\t}", "@Override\r\n public void update() {\n for (int i = 0; i < super.npcShips.size(); i++){\r\n super.npcShips.get(i).owner.update();\r\n for (int ii = 0; ii < Server.serverClientsList.size(); ii++) {\r\n AbstractShip ship = Server.serverClientsList.get(ii).pilot.ship;\r\n if ((Math.abs(ship.x - super.npcShips.get(i).x) < sightLength) && (Math.abs(ship.y - super.npcShips.get(i).y) < sightLength)){\r\n if (super.npcShips.get(i) instanceof Asteroid) {\r\n int asteroidNr = (super.npcShips.get(i).moving) ? 1 : 0;\r\n Server.send((\"/a/,\" + super.npcShips.get(i).name + \",\" + String.format(Locale.US, \"%1$.3f\", super.npcShips.get(i).x) + \",\" + String.format(Locale.US, \"%1$.3f\", super.npcShips.get(i).y) + \",\" + String.format(Locale.US, \"%1$.3f\", super.npcShips.get(i).rotationRadians) + \",\" + asteroidNr + \",\").getBytes(), Server.serverClientsList.get(ii).address, Server.serverClientsList.get(ii).port);\r\n } else {\r\n int moving = (super.npcShips.get(i).moving) ? 1 : 0;\r\n int turbo = (super.npcShips.get(i).turbo) ? 1 : 0;\r\n Server.send((\"/s/,\" + super.npcShips.get(i).name + \",\" + String.format(Locale.US, \"%1$.3f\", super.npcShips.get(i).x)\r\n + \",\" + String.format(Locale.US, \"%1$.3f\", super.npcShips.get(i).y)\r\n + \",\" + String.format(Locale.US, \"%1$.3f\", super.npcShips.get(i).rotationRadians)\r\n + \",\" + moving + \",\" + super.npcShips.get(i).engineLevel + \",\" + super.npcShips.get(i).gunLevel\r\n + \",\" + super.npcShips.get(i).gunCount + \",\" + super.npcShips.get(i).constitution + \",\" + turbo\r\n + \",\" + String.format(Locale.US, \"%1$.3f\", super.npcShips.get(i).curHP) + \",\" + (int)super.npcShips.get(i).owner.getPointerForGunsX() + \",\" + (int)super.npcShips.get(i).owner.getPointerForGunsY() + \",\").getBytes(), Server.serverClientsList.get(ii).address, Server.serverClientsList.get(ii).port);\r\n }\r\n }\r\n }\r\n if (super.npcShips.get(i).curHP <= 0) {\r\n if (npcShips.get(i).owner instanceof ClientPlayer) {\r\n tiles[super.npcShips.get(i).currentTile].ships.remove(super.npcShips.get(i));\r\n ClientPlayer owner = (ClientPlayer)super.npcShips.get(i).owner;\r\n BasicShip ship = new BasicShip(this, super.npcShips.get(i).owner);\r\n owner.ship = ship;\r\n ship.name = super.npcShips.get(i).name;\r\n if (Server.serverClients.get(ship.name) == null) {\r\n super.npcShips.remove(super.npcShips.get(i));\r\n super.npcShipsByName.remove(ship.name);\r\n i--;\r\n continue;\r\n }\r\n Server.serverClients.get(ship.name).pilot = owner;\r\n super.npcShips.remove(super.npcShips.get(i));\r\n super.npcShips.add(ship);\r\n super.npcShipsByName.remove(ship.name);\r\n super.npcShipsByName.put(ship.name, ship);\r\n i--;\r\n continue;\r\n }\r\n tiles[super.npcShips.get(i).currentTile].ships.remove(super.npcShips.get(i));\r\n npcShips.remove(super.npcShips.get(i));\r\n i--;\r\n }\r\n }\r\n\r\n //update every projectile, if removed then remove\r\n for (int i = 0; i < super.projectiles.size(); i++){\r\n super.projectiles.get(i).update();\r\n //Server.sendToAll(\"/p/,\" + super.projectiles.get(i).x + \",\" + super.projectiles.get(i).y + \",\" + super.projectiles.get(i));\r\n if (super.projectiles.get(i).removed) {\r\n super.projectiles.remove(i);\r\n i--;\r\n }\r\n }\r\n\r\n }", "@Override\r\n\tpublic void set(final Player t) {\n\r\n\t}", "public void setPlayer(Player player) {\n\t\tthis.player = player;\r\n\t}", "@Override\n public void setPlayers(PlayerId ownId, Map<PlayerId, String> playerNames) {\n underlyingPlayer.setPlayers(ownId, playerNames);\n }", "public GameHandler(Socket cs) {\r\n try {\r\n ous = new ObjectOutputStream(cs.getOutputStream());\r\n ois = new ObjectInputStream(cs.getInputStream());\r\n try {\r\n Request request = (Request) ois.readObject();\r\n if (request.getType() == Setting.REG || request.getType() == Setting.LOGIN || request.getType() == Setting.FBLOG) {\r\n user = (User) request.getObject();\r\n if (request.getType() == Setting.LOGIN) {\r\n user = UserController.login(user);\r\n\r\n } else if (request.getType() == Setting.REG) {\r\n user = UserController.register(user);\r\n\r\n } else if (request.getType() == Setting.FBLOG) {\r\n user = UserController.fbLogin(user);\r\n System.out.println(\"\" + user.getImg());\r\n Image image = new Image(user.getImg());\r\n saveToFile(image, \"\" + image.toString(), user);\r\n }\r\n\r\n if (user.getId() != 0 && !checkAlreadyLogin(user)) {\r\n\r\n clientsVector.add(this);\r\n // if register or login is ok send list off available players to client \r\n this.ous.flush();\r\n this.ous.reset();\r\n user.setStatus(Setting.AVAILABLE);\r\n //////////// Update server list ////////////////\r\n if (request.getType() == Setting.REG) {\r\n Platform.runLater(() -> {\r\n try {\r\n ServerTicTacServer.items.add(user);\r\n } catch (Exception e) {\r\n System.out.println(\"servertictacserver items \");\r\n e.printStackTrace();\r\n }\r\n });\r\n }\r\n if (request.getType() == Setting.LOGIN) {\r\n ServerTicTacServer.updateServerList(user);\r\n }\r\n ServerTicTacServer.usersList.refresh();\r\n ////////////////////////////////////////////////\r\n request.setType(Setting.REG_OK);\r\n\r\n List availablePlayerList = new ArrayList<User>();\r\n for (GameHandler gameHandler : clientsVector) {\r\n if (gameHandler.user != null && gameHandler.user.getId() != user.getId()) {\r\n availablePlayerList.add(gameHandler.user);\r\n }\r\n }\r\n Object[] objects = {availablePlayerList, user};\r\n request.setObject(objects);\r\n System.out.println(\"ssssssssssssss :\" + user.getName());\r\n this.ous.writeObject(request);\r\n this.ous.flush();\r\n this.ous.reset();\r\n request.setType(Setting.ADD_PLAYER_TO_AVAILABLE_LIST);\r\n request.setObject(user);\r\n brodCast(request);\r\n start();\r\n } else {\r\n\r\n // error in registration or login >> send to client error message\r\n if (request.getType() == Setting.REG) {\r\n\r\n request.setType(Setting.REG_NO);\r\n request.setObject(\"email already exist\");\r\n } else if (checkAlreadyLogin(user)) {\r\n request.setType(Setting.LOGIN_NO);\r\n request.setObject(\"That account is already login\");\r\n } else if (request.getType() == Setting.LOGIN) {\r\n request.setType(Setting.LOGIN_NO);\r\n request.setObject(\"incorrect username or passsword\");\r\n\r\n }\r\n\r\n this.ous.writeObject(request);\r\n this.ous.flush();\r\n this.ous.reset();\r\n ous.close();\r\n ois.close();\r\n cs.close();\r\n }\r\n }\r\n } catch (ClassNotFoundException ex) {\r\n System.out.println(\"construct gamehandler exception\");\r\n //Logger.getLogger(GameHandler.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public void updateServerData() throws IOException {\n Iterator it = gameServers.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry<InetSocketAddress, GameServer> pair = (Map.Entry) it.next();\n pair.getValue().requestInfo();\n pair.getValue().requestPlayers();\n pair.getValue().requestRules();\n }\n }", "@EventHandler\n public void onServerConnected(ServerConnectedEvent event) {\n if (event.getServer().getInfo().getName().equals(Config.queue)) {\n if (!playersQueue.contains(event.getPlayer())) {\n // Add Player to queue\n try {\n mutex.acquire();\n playersQueue.add(event.getPlayer());\n Main.log(\"onServerConnected\", \"§3§b\" + event.getPlayer().toString() + \"§3 was added to §b\" + Config.queue + \"§3. Queue count is \" + playersQueue.size() + \".\");\n } catch (InterruptedException e1) {\n e1.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }\n }", "public void sendOpponents(ArrayList<Player> plist, Player sentTo) {\n try {\n // Send the number of players being sent\n sendNumOpponents(plist.size()-1);\n for (Player p : plist) {\n if (p != sentTo) { // Do not send player self data as opponent\n dOut.writeObject(p);\n dOut.flush();\n }\n }\n } catch (IOException e) {\n System.out.println(\"Could not send player objects\");\n e.printStackTrace();\n }\n }", "public void nextPlayer() {\n\t\tif (currentPlayer.equals(vServerThread.get(0))){\n\t\t\tcurrentPlayer=vServerThread.get(1);\n\t\t} else if (currentPlayer.equals(vServerThread.get(1))){\n\t\t\tcurrentPlayer=vServerThread.get(0);\n\t\t}\n\t}", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t}", "private void updateTurnsObjectQueue() {\n while(!playersTurns.isEmpty())\n playersTurns.poll();\n loadPlayersIntoQueueOfTurns();\n }", "public void setPlayer(String player) {\r\n this.player = player;\r\n }", "Set<String> getPlayers();", "public void updatePlayerPanel()\n {\n playerInfoPanel.updateLabel();\n }", "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "@Override\n public void update(Node players, AssetManager assetManager) {\n }", "private Collection<Player> getPlayers() {\n\t\treturn players;\n\t}", "private void removePlayerFromTheGame(){\n ServerConnection toRemove = currClient;\n\n currClient.send(\"You have been removed from the match!\");\n updateCurrClient();\n server.removePlayerFromMatch(gameID, toRemove);\n\n if ( toRemove == client1 ){\n this.client1 = null;\n }\n else if ( toRemove == client2 ){\n this.client2 = null;\n }\n else {\n client3 = null;\n }\n gameMessage.notify(gameMessage);\n\n if ( (client1 == null && client2 == null) || (client2 == null && client3 == null) || (client1 == null && client3 == null) ){\n gameMessage.notify(gameMessage);\n }\n if ( liteGame.isWinner() ) endOfTheGame = true;\n playerRemoved = true;\n }", "public void setOwner(Player player) {\n owner = player;\n }", "private void sendUpdates() {\n\n List<PeerUpdateMessage.Part> parts = new ArrayList<PeerUpdateMessage.Part>();\n for (ActivePlayer peer : player.getSavedNeighbors()) {\n PeerUpdateMessage.Part part = new PeerUpdateMessage.Part(\n peer.character.id, peer.character.getExtrapolatedMotionState());\n parts.add(part);\n }\n\n if (!parts.isEmpty()) {\n PeerUpdateMessage msg = new PeerUpdateMessage(parts);\n new ToClientMessageSink(player.session).sendWithoutConfirmation(msg);\n }\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\r\n\tvoid updateNames () {\n\t\tConnection[] connections = server.getConnections();\r\n\t\t\r\n\t\tArrayList<String> names = new ArrayList<>(connections.length);\r\n\t\tfor (int i = connections.length - 1; i >= 0; i--) {\r\n\t\t\tChatConnection connection = (ChatConnection)connections[i];\r\n\t\t\tnames.add(connection.name);\r\n\t\t}\r\n\t\t// Send the names to everyone.\r\n\t\tUpdateNames updateNames = new UpdateNames();\r\n\t\tupdateNames.names = (String[])names.toArray(new String[names.size()]);\r\n\t\tserver.sendToAll(updateNames, true);\r\n\t}", "public ListResponse<PlayerResponse> getPlayers() {\n\t\tcheckProvided();\n\t\treturn players;\n\t}", "private void updatePlayersWorth(){\n for (Player e : playerList) {\n e.setPlayerWorth(getTotalShareValue(e) + e.getFunds());\n }\n }", "public void RemovePlayerFromList(ClientThread client){\n this.client_List.remove(client);\n if (this.GetPlayerCount() <= 0){\n \tserv.DeleteLobby(this.name);\n }\n }", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "public List<Player> getPlayerList(){\n return this.players;\n }" ]
[ "0.67656595", "0.6636419", "0.64124054", "0.63354975", "0.6298928", "0.6230388", "0.61956096", "0.6192089", "0.6164524", "0.6133058", "0.60278225", "0.6002364", "0.59676164", "0.59602076", "0.5953079", "0.5920689", "0.58765584", "0.5875665", "0.5856368", "0.5813421", "0.58026105", "0.57917666", "0.57880455", "0.576886", "0.5748507", "0.5719116", "0.57189476", "0.57153636", "0.5712589", "0.570788", "0.57067025", "0.57043695", "0.5680143", "0.5679066", "0.5672798", "0.56680775", "0.56647015", "0.56419384", "0.5633022", "0.5606787", "0.56043804", "0.5599211", "0.55849487", "0.5571207", "0.5567008", "0.55669653", "0.5562742", "0.5555423", "0.5553309", "0.5528249", "0.55267274", "0.55157435", "0.55114776", "0.5507651", "0.55074525", "0.5504172", "0.55031294", "0.55008465", "0.54965526", "0.5489431", "0.54840374", "0.54724205", "0.54694206", "0.5468959", "0.54651237", "0.5457468", "0.5455316", "0.5450514", "0.5430319", "0.54257643", "0.54121774", "0.54116696", "0.54092294", "0.5399269", "0.53929234", "0.53888416", "0.5384598", "0.5380737", "0.5379172", "0.53639704", "0.5363078", "0.5338884", "0.5336387", "0.5329786", "0.5321694", "0.53202385", "0.5319148", "0.5314392", "0.5311808", "0.5309401", "0.53041625", "0.5303477", "0.53008497", "0.5294704", "0.5291173", "0.5290634", "0.52882314", "0.5287163", "0.52852553", "0.5283362" ]
0.550929
53
GetterMethode fuer den Benutzernamen.
public String getPlayerName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getNombre()\r\n/* 60: */ {\r\n/* 61: 67 */ return this.nombre;\r\n/* 62: */ }", "public String getNombre()\r\n/* 113: */ {\r\n/* 114:204 */ return this.nombre;\r\n/* 115: */ }", "public String getNombre()\r\n/* 17: */ {\r\n/* 18:41 */ return this.nombre;\r\n/* 19: */ }", "public abstract String getBeschreibung();", "public String getter() {\n\t\treturn name;\n\t}", "public String getNom();", "String getName(){return this.name;}", "String getNombre();", "String getNombre();", "String getNombre();", "@Override\n String get();", "String getNome();", "public String get_name(){\n return _name;\n }", "protected String getName(){\r\n return this.name;\r\n }", "public String getName() { return (String)get(\"Name\"); }", "public String getName(){return this.aName;}", "public String getName (){\n \n return boyName;\n }", "public String getName()\r\n/* 24: */ {\r\n/* 25:20 */ return this.name;\r\n/* 26: */ }", "@Override\r\n\tpublic String getIzena() {\n\t\treturn super.getIzena();\r\n\t}", "public String getName () { return this.name; }", "public String getName(){return this.name;}", "public abstract java.lang.String getNombre();", "public String getName(){return name;}", "public String getName(){return name;}", "public String getName(){return name;}", "public String getName(){return name;}", "public String getName() \n{\n\treturn name;\n}", "public String getName(){ return name; }", "public String getName(){\n return name;\n}", "public String getName(){\n return name;\r\n }", "public String getName ()\n {\n return name;\n }", "public String getName(){\n return name; \n }", "public String getNome(){\r\n return nome;\r\n }", "public String getNombre(){\r\n return nombre;\r\n }", "public String getNombre () {\n return nombre;\n }", "public String getName(){\n return name;\n }", "public String getName(){\n return name;\n }", "public String getName(){\n\n //returns the value of the name field\n return this.name;\n }", "public String getName()\n {\n return name;\n}", "public String getName() { return _name; }", "public String getNome();", "public abstract String get();", "public String getNombre(){\n return nombre;\n }", "public java.lang.String getName()\r\n{\r\n\treturn name;\r\n}", "public String getNombre(){\n\treturn this.nombre;\n }", "public String getNombre()\r\n {\r\n return nombre;\r\n }", "public String getName(){\r\n return this.name;\r\n }", "public String getnombre(){\n return nombre;\n }", "public String getNombre(){\n return nombre;\n }", "public String getNombre()\n {\n return nombre;\n }", "public String getNombre()\n {\n return nombre;\n }", "@Override\n public String getNom() {\n return nom;\n }", "public String getName(){\n return name ;\n }", "public String get();", "public String getNombre(){\n return nombre;\n }", "public String getNombre(){\n return nombre;\n }", "public String getGetter() {\n return \"get\" + getCapName();\n }", "String getName(){\r\n\t\treturn name;\r\n\t}", "public java.lang.String getWoolieName(){return this.woolieName;}", "String get();", "String get();", "public String getName() { return name.get(); }", "public String getName()\n/* */ {\n/* 62 */ return this.name;\n/* */ }", "public String getName() {\n/* */ return this.field_176894_i;\n/* */ }", "public String getName() {\n/* 57 */ return this.name;\n/* */ }", "public String getNombre() {return nombre;}", "public abstract String getNombre();", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "public String getName(){\r\n return name;\r\n }", "String getName(){\n\t\treturn name;\n\t}", "public abstract java.lang.String getAcma_cierre();", "public String getName(){\n return name;\n }", "public String getName(){\n return name;\n }", "public String getName() {\n/* 209 */ return this.name;\n/* */ }", "public String getName (){\r\n return name;\r\n }", "public String getNome () { return this.nome; }", "public String getName()\n {\n // put your code here\n return name;\n }", "java.lang.String getHotelName();", "public String getNome(){\r\n return this.nome;\r\n }", "@Override\n public String getName(){\n return Name; \n }", "@Override\n\tpublic String getNombre() {\n\t\treturn nombre;\n\t}", "public String getNombreGeneral()\r\n {\r\n return nombreGeneral; \r\n }", "public String getBookNameEn() {\n return bookNameEn;\n }", "public String getName(){\n \t\treturn this.name;\n \t}", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName(){\n return this.name;\n }", "public String getName()\n {\n return _name;\n }", "public String getName()\n {\n return _name;\n }" ]
[ "0.7354709", "0.7208897", "0.7202429", "0.7107064", "0.7052994", "0.70468193", "0.6992574", "0.6991139", "0.6991139", "0.6991139", "0.6907734", "0.6886857", "0.6836517", "0.6832783", "0.6831375", "0.67904913", "0.6784219", "0.67830473", "0.6780245", "0.6772084", "0.67618436", "0.67582977", "0.6757461", "0.6757461", "0.6757461", "0.6757461", "0.67439324", "0.6733783", "0.67243207", "0.67224985", "0.6708377", "0.6679874", "0.66671956", "0.6667093", "0.66625035", "0.6652673", "0.6652673", "0.66483516", "0.6645837", "0.6639357", "0.6635856", "0.6628395", "0.66253144", "0.66191334", "0.66174924", "0.66045785", "0.6603977", "0.659575", "0.65946424", "0.65930974", "0.65930974", "0.6592461", "0.65900606", "0.65892684", "0.65824336", "0.65824336", "0.65809894", "0.6580588", "0.6565153", "0.6564109", "0.6564109", "0.65638715", "0.6562985", "0.65589654", "0.6555954", "0.6553898", "0.6553568", "0.65502816", "0.65502816", "0.65502816", "0.65502816", "0.65502816", "0.6541651", "0.65392697", "0.6537687", "0.6537687", "0.6534706", "0.6531088", "0.6523379", "0.6522607", "0.65219426", "0.65161824", "0.6514164", "0.65134114", "0.6511022", "0.64969826", "0.64943707", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.6492336", "0.64890534", "0.64890534" ]
0.0
-1
SetterMethode fuer den Benutzernamen.
public void setPlayerName(String newName) { name = newName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setNombre(String nombre)\r\n/* 65: */ {\r\n/* 66: 76 */ this.nombre = nombre;\r\n/* 67: */ }", "public String setter() {\n\t\treturn prefix(\"set\");\n\t}", "public void setValor(String valor)\n/* 22: */ {\n/* 23:34 */ this.valor = valor;\n/* 24: */ }", "public void set(String name, Object value) {\n }", "public void setNombre(String nombre)\r\n/* 118: */ {\r\n/* 119:214 */ this.nombre = nombre;\r\n/* 120: */ }", "void setName(String strName);", "private void setName(java.lang.String name) {\n System.out.println(\"setting name \"+name);\n this.name = name;\n }", "public void setName (String newName)\n {\n this.name = newName; \n }", "String setValue();", "public void setName(String newname){\n name = newname; \n }", "public void setEmployee(String employee)\r\n/* 43: */ {\r\n/* 44:47 */ this.employee = employee;\r\n/* 45: */ }", "public void setName(String name){this.name=name;}", "public void setName(String name)\r\n/* 29: */ {\r\n/* 30:23 */ this.name = name;\r\n/* 31: */ }", "public void setName(String name) {\n fName= name;\n }", "@Override\n\tpublic void setValue(String arg0, String arg1) {\n\t\t\n\t}", "public abstract void setNombre(java.lang.String newNombre);", "void setName(String name_);", "@Override\n\t\tpublic void set(E arg0) {\n\t\t\t\n\t\t}", "public void setName (String name){\n \n boyName = name;\n }", "void setNome(String nome);", "@Override\n\tpublic void set() {\n\t\tSystem.out.println(\"A==========set\");\n\t}", "public static String setterName(String name) {\n return genMethodName(name, \"set\", null);\n }", "public void setName(String name){this.name = name;}", "public void setEmpresa(Empresa empresa)\r\n/* 89: */ {\r\n/* 90:141 */ this.empresa = empresa;\r\n/* 91: */ }", "public void setName(String name)\n/* */ {\n/* 53 */ this.name = name;\n/* */ }", "public String getSetter() {\n return \"set\" + getCapName();\n }", "public void setName(String newValue);", "public void setName(String newValue);", "public void setAutorizacion(String autorizacion)\r\n/* 139: */ {\r\n/* 140:236 */ this.autorizacion = autorizacion;\r\n/* 141: */ }", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(String s);", "public void setName(String n){ name=n; }", "public void setName(java.lang.String value);", "public void setName(java.lang.String value);", "public void set(String s);", "public void setName (String Name);", "public void setName (String Name);", "public void setName (String Name);", "public MethodBuilder set(String name) {\n\t\treturn name(\"set \" + name);\n\t}", "public void set() {\r\n\t\tage = 19;\r\n\t\tname = \"ΎΛ·»\";\r\n\t\theight = 161;\r\n\t\tsetWeight(50);\r\n\t\tSystem.out.println(getWeight());\r\n\t}", "public abstract void setAcma_cierre(java.lang.String newAcma_cierre);", "@Override\n public void setName(String name) {\n\n }", "public void setNumero(int numero)\r\n/* 195: */ {\r\n/* 196:206 */ this.numero = numero;\r\n/* 197: */ }", "public void setName(String name){\n this.name = name;\n }", "public void setNombre(String nombre){\n this.nombre =nombre;\n }", "@Override\r\n\t\tpublic void set(E arg0) {\n\r\n\t\t}", "public void setNombre(String nombre) {this.nombre = nombre;}", "public void setEmpleado(Empleado empleado)\r\n/* 188: */ {\r\n/* 189:347 */ this.empleado = empleado;\r\n/* 190: */ }", "public void setName(String name)\n/* */ {\n/* 84 */ this._name = name;\n/* */ }", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "@Override\n\tpublic void setProperty(String name, Object value)\n\t{\n\t\tsuper.setProperty(name, value);\n\n\t\tprocessProperty(name, value);\n\t}", "@Override\n\tpublic void setProperty(String name, Object value)\n\t{\n\t\tsuper.setProperty(name, value);\n\n\t\tprocessProperty(name, value);\n\t}", "public abstract void set(M newValue);", "public void setdat()\n {\n }", "public void setProperty(String name,Object value)\n {\n ClassAnalyzer.setProperty(m_Source,name,value);\n }", "public void setName(String name)\n {\n _name = name;\n }", "protected abstract void setMyName(String name);", "@Override\n\tpublic void setProperty(String propertyName, Object value) {\n\t\t\n\t}", "public final void setName(String name) {_name = name;}", "@Override\n public void setName(String name) {\n \n }", "public void setName(String new_name){\n this.name=new_name;\n }", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String Name){\r\n name = Name;\r\n }", "private void setPropertyInternal(String name, String value) {\n PropertyHelper ph = PropertyHelper.getPropertyHelper(this);\n ph.setProperty(null, name, value, false);\n }", "public void setU(String f){\n u = f;\n}", "@Override\r\n public void setName(String name) {\n }", "public abstract void setCod_tecnico(java.lang.String newCod_tecnico);", "@Override\n\tpublic void setName(String name) {\n\t\t\n\t}", "public void setProperty(String name,Object value);", "@Override\n\tprotected void setValue(String name, TipiValue tv) {\n\t}", "void setValue(String value);", "void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setNombre(String nombre) {\r\n\tthis.nombre = nombre;\r\n}", "protected abstract void setName(String string);", "protected void setName(String name) {\r\n this.name = name;\r\n }", "@Override\n\t\tpublic void setProperty(String key, Object value) {\n\n\t\t}", "public void setName(String name)\r\n/* */ {\r\n/* 137 */ this.name = name;\r\n/* */ }", "private void setName(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n name_ = value;\n }", "public void setName(String string) {\n\t\t\n\t}", "public abstract void setAcma_valor(java.lang.String newAcma_valor);" ]
[ "0.70223457", "0.6969608", "0.67709076", "0.6716227", "0.67131364", "0.6667688", "0.66546863", "0.66235906", "0.6620024", "0.65521103", "0.65520793", "0.6542344", "0.65312916", "0.6528156", "0.65187573", "0.6506215", "0.6479557", "0.6474794", "0.6464843", "0.6458132", "0.64495164", "0.6432049", "0.64198583", "0.6415027", "0.63994277", "0.6375507", "0.6375083", "0.6375083", "0.6347818", "0.63469905", "0.63469905", "0.63469905", "0.63469905", "0.63469905", "0.63469905", "0.6344265", "0.6342188", "0.6342166", "0.6342166", "0.63372064", "0.6331051", "0.6331051", "0.6331051", "0.6323623", "0.6319462", "0.63079053", "0.63003576", "0.6297198", "0.6286882", "0.62816286", "0.6281512", "0.6276861", "0.6270076", "0.62696326", "0.62691796", "0.62691796", "0.62691796", "0.6254694", "0.6254694", "0.6249096", "0.6243713", "0.6239227", "0.62254953", "0.622501", "0.62216604", "0.62142897", "0.62124825", "0.6201603", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.62012964", "0.61911964", "0.6186482", "0.6177272", "0.6173709", "0.6171745", "0.6171328", "0.6158551", "0.614315", "0.61415774", "0.61415774", "0.6137708", "0.6137708", "0.6137708", "0.6137708", "0.61349976", "0.6133742", "0.6131983", "0.6126405", "0.6124593", "0.6122129", "0.6114866", "0.61106807" ]
0.0
-1
IMPROVE use or discard
public static void main( String[] args ) { ResourceBundle rbm = ResourceBundle.getBundle( rbmFile ); CommandLine userInput = prepCli( prepCliParser(), args, rbm ); BerCli doesStuff = prepDoer( userInput ); doesStuff.setSessionConfig( prepConfig( userInput, rbm ) ); doesStuff.satisfySession(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void discardUnget() {\n\t\t\n\t}", "public void discard();", "void discard();", "void discard();", "public void swrap() throws NoUnusedObjectExeption;", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public void discard() {\n }", "void use();", "public interface Overdrive {\n void useOverdrive();\n}", "public void reuse() {}", "@Override\r\n\tpublic void discard(Resources toDiscard) {\n\t\t\r\n\t}", "private ForwardingObjective preProcessVersatile(ForwardingObjective fwd) {\n if (fwd.treatment().clearedDeferred()) {\n // First we create a new treatment without the unsupported action\n TrafficTreatment.Builder noClearTreatment = DefaultTrafficTreatment.builder();\n fwd.treatment().allInstructions().forEach(noClearTreatment::add);\n // Then we create a new forwarding objective without the unsupported action\n ForwardingObjective.Builder noClearFwd = DefaultForwardingObjective.builder(fwd);\n noClearFwd.withTreatment(noClearTreatment.build());\n // According to the operation we substitute fwd with the correct objective\n switch (fwd.op()) {\n case ADD:\n fwd = noClearFwd.add(fwd.context().orElse(null));\n break;\n case REMOVE:\n fwd = noClearFwd.remove(fwd.context().orElse(null));\n break;\n default:\n log.warn(\"Unknown operation {}\", fwd.op());\n }\n }\n return fwd;\n }", "boolean ignoreExternal();", "public void markReused() {\n\t\tupdate(Phase.vm_creation, State.SKIPPED);\n\t\tupdate(Phase.installation, State.SKIPPED);\n\t\tupdate(Phase.configuration, State.SKIPPED);\n\t\tsetState(State.SKIPPED);\n\t}", "protected void discard() {\r\n discarded = true;\r\n onDiscard();\r\n }", "@Override\n\tpublic void imprimir() {\n\t\t\n\t}", "@Override\n public boolean use(CanTakeItem o){\n return false; \n }", "public void avvia() {\n /** invoca il metodo sovrascritto della superclasse */\n super.avvia();\n }", "public void use()\n\t{\n\t}", "private void offer() {\n\t\t\t\n\t\t}", "private void cancelHeavyLifting()\n {\n }", "void unDo();", "void unavailable();", "void unavailable();", "public abstract boolean uncover();", "Snapshot apply();", "void bypass();", "static void ignore() {\n }", "@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }", "@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }", "@Override\n\tpublic void imprime() {\n\t\t\n\t}", "public void reassignIfNeeded() {\n\t}", "public void forceReasonerReSynchronization();", "void cancelOriginal();", "private Object writeReplace()\n {\n return Channel.current().export( Acceptor.class, this );\n }", "@Override\r\n\tpublic ImproveResult preImprove(FGFusionContext arg0, String arg1, OpsComplexus arg2, RecordComplexus arg3) {\n\t\treturn null;\r\n\t}", "public void setImportantForAccessibility(boolean important) {\n/* 1316 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "void uncap();", "boolean shouldRescore() {\n return false;\n }", "public void setUsed(){\n\t\talreadyUsed = true;\n\t}", "@External\n\tpublic void untether() {\n\t\tif (!Context.getOrigin().equals(Context.getOwner()))\n\t\t\tContext.revert(\"Only the owner can call the untether method.\");\n\t}", "public void unget() {}", "public void enableSmartImprovement() { this.exec = this.exec.withProperty(\"sm.improve\", true); }", "protected void doManaged() {\n // default is no-op\n }", "void decUsage() {\n incUsage(-1);\n }", "@RequiresLock(\"SeaLock\")\r\n protected void invalidate_internal() {\n }", "boolean isReplaceable();", "@Override\n\tpublic void exucute() {\n\t\t\n\t}", "AttackResult smartAttack();", "public void forceDiscard(TurnTracker turn_tracker_pointer, int player_index) throws Exception;", "public void setExempt(boolean exempt);", "public void unExecute()\n\t{\n\t}", "public void setUnused(boolean unused) {\n this.binderySlotNumber = -9234;\n }", "public void disparar(){}", "void unsetCombine();", "public void damageDevice() {\n\t\t\r\n\t}", "void apply() throws Exception;", "boolean isIgnorable() { return false; }", "public void use(Player player) {\n\n\t}", "@Override\n public void bankrupt() {\n this.mortgaged = false;\n }", "@Override\n\tpublic void setIsUsed(boolean arg0) {\n\n\t}", "@Override\n \tpublic boolean imprisonPlayer(String playerName) {\n \t\treturn false;\n \t}", "void callForBackup() {\n List<Resource> redundantList = resourceRepository.findAllByIsRedundantIsTrue();\n System.out.println(\"Invoking redundant instance from list: \" + redundantList);\n if (redundantList != null && redundantList.size() > 0) {\n Resource redundantResource = redundantList.get(0);\n redundantResource.setRedundant(false);\n resourceRepository.save(redundantResource);\n }\n }", "private void useInventoryByAI() {\n\t\tChampion AI = currentTask.getCurrentChamp();\n\t\tArrayList<Collectible> inventory = ((Wizard)AI).getInventory();\n\t\tif(inventory.size()>0){\n\t\t\tint randomPotion = (int)(Math.random()*inventory.size());\n\t\t\tcurrentTask.usePotion((Potion)inventory.get(randomPotion));\n\t\t}\n\n\t\t\n\t}", "protected void apply() {\n dispose();\n }", "public void isDeceased(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public void use(Player player){\r\n\t\t\tif(this.getEffect()==\"HEAL\"){\r\n\t\t\t\tplayer.heal(this.getValue());\r\n\t\t\t}\r\n\t\t\tif(this.getEffect() == \"BOOK\"){ \r\n\t\t\t\tplayer.increaseSkill(this.getValue(), 1); \r\n\t\t\t}\r\n\t\t\tif(this.getEffect() == \"RESSURECTION\"){\r\n\t\t\t\ttry {TrackLog.writeLog(\"I think I should keep this one, migth save my life some days\");} \r\n\t\t\t\tcatch (IOException e) {e.printStackTrace();}\r\n\t\t\t}\r\n\t\t}", "public void revert()\n {\n throw new UnsupportedOperationException(\"this is a security delegate object\"); \n }", "public boolean softAccept(Thing candidate){\n if(thing == null){\n thing = candidate;\n return true;\n }else{\n return false;\n }\n }", "@Override\n public boolean isSoft() {\n return true;\n }", "void disable();", "void disable();", "boolean doFilter() { return false; }", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "public void makeSilence() {\n\t\tmakeSilence(0, getSampleCount());\n\t}", "void disable(final Op op);", "public void setUnused(VersionVO param){\n \n if (param != null){\n //update the setting tracker\n localUnusedTracker = true;\n } else {\n localUnusedTracker = true;\n \n }\n \n this.localUnused=param;\n \n\n }", "static void setNotCopying(){isCopying=false;}", "private Boolean infect( Player player ){\n try {\n player.setHealth( false );\n return true;\n } catch (Exception e) {\n System.out.println(\"Something went wrong.\");\n return false;\n }\n }", "public abstract void use(Player player) throws GameException;", "private Unescaper() {\n\n\t}", "public IProduct tryHandoutProduct() {\n // No sync, because called between barriers anyway\n Product product = self.getOutputBuffer().tryRemoveProduct();\n env.updateMachine(self);\n return product;\n }", "public void usePotion() {\n Potion potion = this.getInventory().getFirstPotion();\n if (potion != null){\n this.setLife(this.getLife() + potion.getGainLife());\n this.getInventory().removeItems(potion);\n }\n }", "@Override\n\tpublic int vanish() {\n\t\treturn 1;\n\t}", "static void setNotAutoCopy(){isAutoCopying=false;}", "void unsetObjectives();", "void cancelOverrideRequest() {\n cancelCurrentRequestLocked();\n }", "public static Action use() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.isFacing(Useable.class)) {\n ((Useable) a.getFacing()).use(a);\n }\n }\n\n @Override\n public int getCost() {\n return 0;\n }\n\n @Override\n public boolean isExclusive() {\n return true;\n }\n\n @Override\n public Object getData() {\n return null;\n }\n\n @Override\n public String toString() {\n return \"Use()\";\n }\n };\n }", "public void doOfflineComputation() {\n\t\toptimalPolicy = policyIteration();\n\n\t}", "@Override\n protected Object freshBatch(Object reuse)\n {\n throw new NotImplementedException();\n }", "private void blockUntilEstimatedCompletion() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e3 in method: android.speech.tts.BlockingAudioTrack.blockUntilEstimatedCompletion():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.speech.tts.BlockingAudioTrack.blockUntilEstimatedCompletion():void\");\n }", "public void changeIsInvincible()\r\n\t{\r\n\t\tisInvincible = !isInvincible;\r\n\t}", "private USI_ADRC(boolean ignored) {\n \t\tsuper(opId);\n \t}", "@Override\n\tpublic void swim() {\n\t\t\n\t}", "private Object writeReplace() throws ObjectStreamException {\n return INSTANCE;\n }", "default void infect(Spreadable spreadable, int count) {\n changeState(spreadable, State.SUSCEPTIBLE, State.INFECTED, count);\n }", "private void unmarkForSecOp() {\n\t\tthis.secOpFlag = false;\n\t\tthis.secopDoc = null;\n\t}", "public void off() throws Exception;", "public void avvia() {\n /* variabili e costanti locali di lavoro */\n\n try { // prova ad eseguire il codice\n getModuloRisultati().avvia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n super.avvia();\n\n }", "public abstract void swim() {}", "protected abstract boolean useReasoner();" ]
[ "0.6053401", "0.60416085", "0.60374016", "0.60374016", "0.6018056", "0.59657747", "0.58581436", "0.58195174", "0.57515556", "0.5739418", "0.56786376", "0.5643639", "0.55971456", "0.5591827", "0.5588587", "0.5555201", "0.54267603", "0.54170084", "0.539842", "0.5375843", "0.5301805", "0.52933943", "0.5261777", "0.5261777", "0.52570605", "0.5236324", "0.52082956", "0.51713717", "0.514829", "0.514829", "0.5110779", "0.5080527", "0.5062779", "0.5057807", "0.5042322", "0.5014227", "0.50026864", "0.49996883", "0.49904585", "0.49838662", "0.49807948", "0.4968678", "0.49653488", "0.49637648", "0.49607998", "0.4917846", "0.4894974", "0.48949358", "0.48941106", "0.48846775", "0.4878283", "0.48727414", "0.48696256", "0.48669952", "0.48653805", "0.48641023", "0.48622882", "0.48613092", "0.48437774", "0.48427036", "0.48370025", "0.4835893", "0.48291093", "0.48290488", "0.48273113", "0.48251727", "0.48216233", "0.48105758", "0.48062396", "0.4796752", "0.47907564", "0.47907564", "0.47901565", "0.47839504", "0.4775829", "0.47680095", "0.47642314", "0.4763292", "0.47610062", "0.47580844", "0.4755041", "0.47549412", "0.47496682", "0.47474197", "0.47458556", "0.47427312", "0.47352856", "0.47264823", "0.4723382", "0.47224835", "0.47224626", "0.47171253", "0.4709899", "0.4708544", "0.47077847", "0.47069252", "0.47065133", "0.47047365", "0.4698568", "0.46983695", "0.46945763" ]
0.0
-1
fills options with our cli flags and text
public static Options prepCliParser() { Options knowsCliDtd = new Options(); final boolean needsEmbelishment = true; knowsCliDtd.addOption( configFlagS, configFlagLong, needsEmbelishment, "path to config (ex C:\\Program Files\\apache\\tomcat.txt)" ); knowsCliDtd.addOption( verboseFlagS, verboseFlagLong, ! needsEmbelishment, "show debug information" ); knowsCliDtd.addOption( helpFlagS, helpFlagLong, ! needsEmbelishment, "show arg flags" ); return knowsCliDtd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initOptions() {\n\t\t// TODO: ???\n\t\t// additional input docs via --dir --includes --excludes --recursive\n\t\t// --loglevel=debug\n\t\t// --optionally validate output as well?\n\t\t\n\t\tthis.sb = new StringBuffer();\n\t\tArrayList options = new ArrayList();\n\t\toptions.add( new LongOpt(\"help\", LongOpt.NO_ARGUMENT, null, 'h') );\n\t\toptions.add( new LongOpt(\"version\", LongOpt.NO_ARGUMENT, null, 'v') );\t\t\n\t\toptions.add( new LongOpt(\"query\", LongOpt.REQUIRED_ARGUMENT, sb, 'q') );\n\t\toptions.add( new LongOpt(\"base\", LongOpt.REQUIRED_ARGUMENT, sb, 'b') );\n\t\toptions.add( new LongOpt(\"var\", LongOpt.REQUIRED_ARGUMENT, sb, 'P') );\n\t\toptions.add( new LongOpt(\"out\", LongOpt.REQUIRED_ARGUMENT, sb, 'o') );\n\t\toptions.add( new LongOpt(\"algo\", LongOpt.REQUIRED_ARGUMENT, sb, 'S') );\n\t\toptions.add( new LongOpt(\"encoding\", LongOpt.REQUIRED_ARGUMENT, sb, 'E') );\n\t\toptions.add( new LongOpt(\"indent\", LongOpt.REQUIRED_ARGUMENT, sb, 'I') );\t\n\t\toptions.add( new LongOpt(\"strip\", LongOpt.NO_ARGUMENT, null, 's') );\t\t\n\t\toptions.add( new LongOpt(\"update\", LongOpt.REQUIRED_ARGUMENT, sb, 'u') );\t\n\t\toptions.add( new LongOpt(\"xinclude\", LongOpt.NO_ARGUMENT, null, 'x') );\t\t\n\t\toptions.add( new LongOpt(\"explain\", LongOpt.NO_ARGUMENT, null, 'e') );\n\t\toptions.add( new LongOpt(\"noexternal\", LongOpt.NO_ARGUMENT, null, 'n') );\t\t\n\t\toptions.add( new LongOpt(\"runs\", LongOpt.REQUIRED_ARGUMENT, sb, 'r') );\n\t\toptions.add( new LongOpt(\"iterations\", LongOpt.REQUIRED_ARGUMENT, sb, 'i') );\n\t\toptions.add( new LongOpt(\"docpoolcapacity\", LongOpt.REQUIRED_ARGUMENT, sb, 'C') );\n\t\toptions.add( new LongOpt(\"docpoolcompression\", LongOpt.REQUIRED_ARGUMENT, sb, 'D') );\n\t\toptions.add( new LongOpt(\"nobuilderpool\", LongOpt.NO_ARGUMENT, null, 'p') );\n\t\toptions.add( new LongOpt(\"debug\", LongOpt.NO_ARGUMENT, null, 'd') );\t\t\n\t\toptions.add( new LongOpt(\"validate\", LongOpt.REQUIRED_ARGUMENT, sb, 'V') ); \n\t\toptions.add( new LongOpt(\"namespace\", LongOpt.REQUIRED_ARGUMENT, sb, 'W') ); \n\t\toptions.add( new LongOpt(\"schema\", LongOpt.REQUIRED_ARGUMENT, sb, 'w') );\n\t\toptions.add( new LongOpt(\"filterpath\", LongOpt.REQUIRED_ARGUMENT, sb, 'f') );\n\t\toptions.add( new LongOpt(\"filterquery\", LongOpt.REQUIRED_ARGUMENT, sb, 'F') );\n\t\toptions.add( new LongOpt(\"xomxpath\", LongOpt.NO_ARGUMENT, null, 'N') );\t\t\n\t\t\n////\t\toptions.add( new LongOpt(\"loglevel\", LongOpt.REQUIRED_ARGUMENT, sb, 'l') ); setLogLevels(Level.INFO);\n\t\t\t\n\t\tthis.longOpts = new LongOpt[options.size()];\n\t\toptions.toArray(this.longOpts);\t\t\n\t}", "public static void initDefaultOptions()\r\n\t{\n\r\n\t\taddOption(HELP, true, \"show Arguments\");\r\n\t}", "public int setOptionFlag(String[] args, int i)\n/* */ {\n/* 393 */ boolean didSomething = true;\n/* 394 */ while ((i < args.length) && (didSomething)) {\n/* 395 */ didSomething = false;\n/* 396 */ if (this.annotationPatterns.keySet().contains(args[i])) {\n/* 397 */ Pair<TregexPattern, Function<TregexMatcher, String>> p = (Pair)this.annotationPatterns.get(args[i]);\n/* 398 */ this.activeAnnotations.put(p.first(), p.second());\n/* 399 */ didSomething = true;\n/* 400 */ this.optionsString = (this.optionsString + \"Option \" + args[i] + \" added annotation pattern \" + p.first() + \" with annotation \" + p.second() + \"\\n\");\n/* 401 */ } else if (args[i].equals(\"-retainNPTmp\")) {\n/* 402 */ this.optionsString += \"Retaining NP-TMP marking.\\n\";\n/* 403 */ this.retainNPTmp = true;\n/* 404 */ didSomething = true;\n/* 405 */ } else if (args[i].equals(\"-discardX\")) {\n/* 406 */ this.optionsString += \"Discarding X trees.\\n\";\n/* 407 */ this.discardX = true;\n/* 408 */ didSomething = true;\n/* 409 */ } else if (args[i].equals(\"-changeNoLabels\")) {\n/* 410 */ this.optionsString += \"Change no labels.\\n\";\n/* 411 */ this.changeNoLabels = true;\n/* 412 */ didSomething = true;\n/* 413 */ } else if (args[i].equals(\"-markPRDverbs\")) {\n/* 414 */ this.optionsString += \"Mark PRD.\\n\";\n/* 415 */ this.retainPRD = true;\n/* 416 */ didSomething = true;\n/* 417 */ } else if (args[i].equals(\"-collinizerRetainsPunctuation\")) {\n/* 418 */ this.optionsString += \"Collinizer retains punctuation.\\n\";\n/* 419 */ this.collinizerRetainsPunctuation = true;\n/* 420 */ didSomething = true;\n/* 421 */ } else if (args[i].equals(\"-collinizerPruneRegex\")) {\n/* 422 */ this.optionsString = (this.optionsString + \"Collinizer prune regex: \" + args[(i + 1)] + \"\\n\");\n/* 423 */ this.collinizerPruneRegex = Pattern.compile(args[(i + 1)]);\n/* 424 */ i++;\n/* 425 */ didSomething = true;\n/* 426 */ } else if (args[i].equals(\"-hf\")) {\n/* */ try {\n/* 428 */ this.headFinderClass = Class.forName(args[(i + 1)]).asSubclass(HeadFinder.class);\n/* 429 */ this.optionsString = (this.optionsString + \"HeadFinder class: \" + args[(i + 1)] + \"\\n\");\n/* */ }\n/* */ catch (ClassNotFoundException e) {\n/* 432 */ System.err.println(\"Error -- can't find HeadFinder class\" + args[(i + 1)]);\n/* */ }\n/* 434 */ i++;\n/* 435 */ didSomething = true;\n/* 436 */ } else if (args[i].equals(\"-arabicFactored\"))\n/* */ {\n/* 438 */ String[] opts = { \"-discardX\", \"-markNounNPargTakers\", \"-genitiveMark\", \"-splitPUNC\", \"-markContainsVerb\", \"-splitCC\", \"-markContainsSBAR\" };\n/* */ \n/* 440 */ setOptionFlag(opts, 0);\n/* 441 */ didSomething = true;\n/* 442 */ } else if (args[i].equals(\"-arabicTokenizerModel\")) {\n/* 443 */ String modelFile = args[(i + 1)];\n/* */ try {\n/* 445 */ WordSegmenter aSeg = (WordSegmenter)Class.forName(\"edu.stanford.nlp.wordseg.ArabicSegmenter\").newInstance();\n/* 446 */ aSeg.loadSegmenter(modelFile);\n/* 447 */ TokenizerFactory aTF = WordSegmentingTokenizer.factory(aSeg);\n/* 448 */ ((ArabicTreebankLanguagePack)treebankLanguagePack()).setTokenizerFactory(aTF);\n/* */ } catch (RuntimeIOException ex) {\n/* 450 */ System.err.println(\"Couldn't load ArabicSegmenter \" + modelFile);\n/* 451 */ ex.printStackTrace();\n/* */ } catch (Exception e) {\n/* 453 */ System.err.println(\"Couldn't instantiate segmenter: edu.stanford.nlp.wordseg.ArabicSegmenter\");\n/* 454 */ e.printStackTrace();\n/* */ }\n/* 456 */ i++;\n/* 457 */ didSomething = true;\n/* */ }\n/* 459 */ if (didSomething) {\n/* 460 */ i++;\n/* */ }\n/* */ }\n/* 463 */ return i;\n/* */ }", "@Override\n @SuppressWarnings(\"static-access\")\n public void setJCLIOptions() {\n Option Help = new Option(\"h\", \"help\", false, \"Show Help.\");\n this.jcOptions.addOption(Help);\n this.jcOptions.addOption(OptionBuilder.withLongOpt(\"file\").withDescription(\"File to Convert\").isRequired(false).hasArg().create(\"f\"));\n //this.jcOptions.addOption(OptionBuilder.withLongOpt(\"outputfile\").withDescription(\"Output File\").isRequired(false).hasArg().create(\"of\"));\n OptionGroup jcGroup = new OptionGroup();\n jcGroup.addOption(OptionBuilder.withLongOpt(\"texttobinary\").withDescription(\"Convert text to Binary\").create(\"ttb\"));\n jcGroup.addOption(OptionBuilder.withLongOpt(\"binarytotext\").withDescription(\"Convert binary to text\").create(\"btt\"));\n this.jcOptions.addOptionGroup(jcGroup);\n }", "private void prepareOptions() {\n CommandFactory\n .getInstance()\n .getCommands()\n .forEach((s, command) -> options.addOption(s, true, command.getDefinition()));\n }", "private void setOptions() {\n cliOptions = new Options();\n cliOptions.addOption(Option.builder(\"p\")\n .required(false)\n .hasArg()\n .desc(\"Paramaters file\")\n .type(String.class)\n .build());\n cliOptions.addOption(Option.builder(\"P\")\n .required(false)\n .hasArg()\n .desc(\"Overwrite of one or more parameters provided by file.\")\n .type(String.class)\n .hasArgs()\n .build());\n cliOptions.addOption(Option.builder(\"H\")\n .required(false)\n .desc(\"Create a parameter file model on the classpath.\")\n .type(String.class)\n .build());\n }", "public static void showCommandLineOptions() {\n showCommandLineOptions(new TextUICommandLine());\n }", "@Override\n protected void options()\n {\n super.options();\n addOption(Opt.APPLICATION_ID);\n addOption(Opt.SERVER_ID);\n addOption(Opt.CATEGORY);\n addOption(Opt.NAME, \"The name of the label\");\n }", "private static void printRunOptions(){\n\t\tSystem.out.println(\"Run options:\");\n\t\tSystem.out.println(\" -simple <configFile> <pathToApplication> <synthesis(true/false)>\");\n\t\tSystem.out.println(\" -simpleSpeedup <configFile> <pathToApplication>\");\n\t\tSystem.out.println(\" -sweep <configFile> <pathToApplication> <sweepConfig> <parallelism(integer)> <synthesis(true/false)>\");\n\t\tSystem.out.println(\" -sweepRemote <configFile> <pathToApplication> <sweepConfig> <parallelism(integer)> <synthesis(true/false)> <hostAddress> <hostPort>\");\n\t\tSystem.out.println(\" -synthesize <configFile> <pathToApplication> <methodName> <scheduleCDFG(true/false)>\");\n\t\tSystem.out.println(\" -test <configFile> <pathToApplication>\");\n\t\tSystem.out.println(\" -speedup <configFile> <pathToApplication>\");\n\t\tSystem.out.println(\" -testCGRAVerilog <configFile> <pathToApplication>\");\n\t}", "private HashMap initCommonOpts() {\n HashMap _opts = new HashMap();\n \n _opts.put(\"help\", \n new Option(\"h\", \"help\", false, \"Get help.\")\n );\n _opts.put(\"version\",\n new Option(\"v\", \"version\", false, \"Print version number and exit.\")\n );\n _opts.put(\"system\",\n OptionBuilder\n .withLongOpt( \"system\" )\n .withDescription(\"Use the given filename or system identifier to find the DTD. \" +\n \"This could be a relative \" +\n \"pathname, if the DTD exists in a file on your system, or an HTTP URL. \" +\n \"The '-s' switch is optional. \" +\n \"Note that if a catalog is in use, what looks like a filename might \" +\n \"resolve to something else entirely.\")\n .hasArg()\n .withArgName(\"system-id\")\n .create('s')\n );\n _opts.put(\"doc\",\n OptionBuilder\n .withLongOpt( \"doc\" )\n .withDescription(\"Specify an XML document used to find the DTD. This could be just a \\\"stub\\\" \" +\n \"file, that contains nothing other than the doctype declaration and a root element. \" +\n \"This file doesn't need to be valid according to the DTD.\")\n .hasArg()\n .withArgName(\"xml-file\")\n .create('d')\n );\n _opts.put(\"public\",\n OptionBuilder\n .withLongOpt( \"public\" )\n .withDescription(\"Use the given public identifier to find the DTD. This would be used in \" +\n \"conjunction with an OASIS catalog file.\")\n .hasArg()\n .withArgName(\"public-id\")\n .create('p')\n );\n _opts.put(\"catalog\",\n OptionBuilder\n .withLongOpt( \"catalog\" )\n .withDescription(\"Specify a file to use as the OASIS catalog, to resolve system and \" +\n \"public identifiers.\")\n .hasArg()\n .withArgName(\"catalog-file\")\n .create('c')\n );\n _opts.put(\"title\",\n OptionBuilder\n .withLongOpt( \"title\" )\n .withDescription(\"Specify the title of this DTD.\")\n .hasArg()\n .withArgName(\"dtd-title\")\n .create('t')\n );\n _opts.put(\"roots\",\n OptionBuilder\n .withLongOpt(\"roots\")\n .withDescription(\"Specify the set of possible root elements for documents conforming \" +\n \"to this DTD.\")\n .hasArg()\n .withArgName(\"roots\")\n .create('r')\n );\n _opts.put(\"docproc\",\n OptionBuilder\n .withLongOpt(\"docproc\")\n .withDescription(\"Command to use to process structured comments. This command should \" +\n \"take its input on stdin, and produce valid XHTML on stdout.\")\n .hasArg()\n .withArgName(\"cmd\")\n .create()\n );\n _opts.put(\"markdown\",\n OptionBuilder\n .withLongOpt(\"markdown\")\n .withDescription(\"Causes structured comments to be processed as Markdown. \" +\n \"Requires pandoc to be installed on the system, and accessible to this process. \" +\n \"Same as \\\"--docproc pandoc\\\". If you want to supply your own Markdown \" +\n \"processor, or any other processor, use the --docproc option.\")\n .create('m')\n );\n _opts.put(\"param\",\n OptionBuilder\n .withLongOpt(\"param\")\n .hasArgs(2)\n .withValueSeparator()\n .withDescription(\"Parameter name & value to pass to the XSLT. You can use multiple \" +\n \"instances of this option.\")\n .withArgName( \"param=value\" )\n .create('P')\n );\n\n /* \n The 'q' here is a hack to get around some weird behavior that I can't figure out.\n If the 'q' is omitted, this option just doesn't work.\n */\n _opts.put(\"debug\",\n OptionBuilder\n .withLongOpt(\"debug\")\n .withDescription(\"Turns on debugging.\")\n .create('q')\n );\n\n return _opts;\n }", "protected P parse(String options, String[] args){\n HashMap cmdFlags = new HashMap();\n String flag;\n String nextFlag=null;\n StringBuffer errors=new StringBuffer();\n /**\n First go through options to see what should be in args\n */\n for(int which=0;which<options.length();which++){\n flag = \"-\"+options.substring(which,which+1);\n if(which+1<options.length()){\n nextFlag=options.substring(which+1,which+2);\n if (nextFlag.equals(\"-\")){\n cmdFlags.put(flag,nextFlag);\n } else\n if (nextFlag.equals(\"+\")){\n cmdFlags.put(flag,nextFlag);\n /*\n mark that it is required\n if found this will be overwritten by -\n */\n this.put(flag,nextFlag);\n } else\n //JDH changed to \"_\" from \";\" because too many cmdlines mess up ;\n if (nextFlag.equals(\"_\")){\n cmdFlags.put(flag,nextFlag);\n } else\n //JDH changed to \".\" from \":\" because too many cmdlines mess up ;\n if (nextFlag.equals(\".\")){\n cmdFlags.put(flag,\" \"); //JDH changed this from \":\"\n /*\n mark that it is required\n if found this will be overwritten by value\n JDH should use \" \" so it cannot be the same as a value\n */\n this.put(flag,\" \"); // mark that it is required\n } else {\n System.out.println(\"Bad symbol \"+nextFlag+\"in option string\");\n }\n which++;\n } else {\n System.out.println(\"Missing symbol in option string at \"+which);\n }\n }\n\n int arg=0;\n for(;arg<args.length;arg++){\n if (!args[arg].startsWith(\"-\")){\n break;\n }\n flag = args[arg];\n /*\n This should tell it to quit looking for flags or options\n */\n if (flag.equals(\"--\")){\n arg++;\n break;\n }\n if (!(cmdFlags.containsKey(flag))){\n errors.append(\"\\nbad flag \"+flag);\n continue;\n }\n if (((String)cmdFlags.get(flag)).equals(\"-\")){\n this.put(flag,\"-\");\n continue;\n }\n if (((String)cmdFlags.get(flag)).equals(\"+\")){\n this.put(flag,\"-\");// turns off the + because it was found\n continue;\n }\n if (!(arg+1<args.length)){\n errors.append(\"\\nMissing value for \"+flag);\n continue;\n }\n arg++;\n this.put(flag,args[arg]);\n }\n String[] params=null;\n params = new String[args.length - arg];\n\n int n=0;\n // reverse these so they come back in the right order!\n for(;arg<args.length;arg++){\n params[n++] = args[arg];\n }\n Iterator k = null;\n Map.Entry e = null;\n if (this.containsValue(\"+\")){\n // can iterate through to see which ones\n k = this.entrySet().iterator();\n while (k.hasNext()){\n if (\"+\".equals((String)(e=(Map.Entry)k.next()).getValue())){\n errors.append(\"\\nThe required flag \"+(String)e.getKey()+\" was not supplied.\");\n };\n }\n } \n /*\n Should change this to \" \" in accordance with remark above\n */\n //JDH changed to \" \" from \":\" in both spots below\n if (this.containsValue(\" \")){\n // can iterate through to see which ones\n k = this.entrySet().iterator();\n while (k.hasNext()){\n if (\" \".equals((String)(e=(Map.Entry)k.next()).getValue())){\n errors.append(\"\\nThe required option \"+(String)e.getKey()+\" was not supplied.\");\n }\n }\n }\n this.put(\" \",params);\n this.put(\"*\",errors.toString());\n return this;\n }", "public static StringBuffer describeOptions( final CLOptionDescriptor[] options )\n {\n final String lSep = System.getProperty( \"line.separator\" );\n final StringBuffer sb = new StringBuffer();\n\n for ( final CLOptionDescriptor option : options )\n {\n final char ch = (char) option.getId();\n final String name = option.getName();\n String description = option.getDescription();\n int flags = option.getFlags();\n boolean argumentRequired =\n ( flags & CLOptionDescriptor.ARGUMENT_REQUIRED ) == CLOptionDescriptor.ARGUMENT_REQUIRED;\n final boolean twoArgumentsRequired =\n ( flags & CLOptionDescriptor.ARGUMENTS_REQUIRED_2 ) == CLOptionDescriptor.ARGUMENTS_REQUIRED_2;\n boolean needComma = false;\n if ( twoArgumentsRequired )\n {\n argumentRequired = true;\n }\n\n sb.append( '\\t' );\n\n if ( Character.isLetter( ch ) )\n {\n sb.append( \"-\" );\n sb.append( ch );\n needComma = true;\n }\n\n if ( null != name )\n {\n if ( needComma )\n {\n sb.append( \", \" );\n }\n\n sb.append( \"--\" );\n sb.append( name );\n }\n\n if ( argumentRequired )\n {\n sb.append( \" <argument>\" );\n }\n if ( twoArgumentsRequired )\n {\n sb.append( \"=<value>\" );\n }\n sb.append( lSep );\n\n if ( null != description )\n {\n while ( description.length() > MAX_DESCRIPTION_COLUMN_LENGTH )\n {\n final String descriptionPart =\n description.substring( 0, MAX_DESCRIPTION_COLUMN_LENGTH );\n description =\n description.substring( MAX_DESCRIPTION_COLUMN_LENGTH );\n sb.append( \"\\t\\t\" );\n sb.append( descriptionPart );\n sb.append( lSep );\n }\n\n sb.append( \"\\t\\t\" );\n sb.append( description );\n sb.append( lSep );\n }\n }\n return sb;\n }", "protected void DefineFlag()\n {\n String flagStr = \"-ci -d -h -hs -i:STR -n -o:STR -p -s:STR -t:INT -ti -v -x:STR\";\n \n // init the system option\n systemOption_ = new Option(flagStr);\n // Add the full name for flags\n systemOption_.SetFlagFullName(\"-ci\", \"Print_Config_Info\");\n systemOption_.SetFlagFullName(\"-d\", \"Print_Operation_Details\");\n systemOption_.SetFlagFullName(\"-h\", \"Help\");\n systemOption_.SetFlagFullName(\"-hs\", \"Hierarchy_Struture\");\n systemOption_.SetFlagFullName(\"-i\", \"Input_File\");\n systemOption_.SetFlagFullName(\"-n\", \"No_Output\");\n systemOption_.SetFlagFullName(\"-o\", \"Output_File\");\n systemOption_.SetFlagFullName(\"-p\", \"Show_Prompt\");\n systemOption_.SetFlagFullName(\"-s\", \"Field_Separator\");\n systemOption_.SetFlagFullName(\"-t\", \"Term_Field\");\n systemOption_.SetFlagFullName(\"-ti\", \"Display_Filtered_Input\");\n systemOption_.SetFlagFullName(\"-v\", \"Version\");\n systemOption_.SetFlagFullName(\"-x\", \"Load_Configuration_file\");\n }", "void\t\tsetCommandOptions(String command, Strings options);", "private void setHelp() {\n\t\tHelpOpt.add(\"-h\");\n\t\tHelpOpt.add(\"/h\");\n\t\tHelpOpt.add(\"help\");\n\t}", "public void printOptions() {\n String indent = \" \";\n System.out.println();\n System.out.println(\"+--------------------------- COMMANDS AND OPTIONS LIST ---------------------------+\");\n\n System.out.println();\n System.out.println(\"******* COMMANDS (scraper.[COMMAND]) *******\");\n System.out.println(\"The following interact with the RegistrationScraper class\");\n System.out.println();\n \n\n System.out.println();\n System.out.println(\"iterateAll() --> Scrape every SDSU department's class and store the data [Recommended before: printDepartmentCourses()]\");\n System.out.println(indent + \"@usage iterateAll()\");\n\n System.out.println();\n System.out.println(\"iterateOne() --> Scrape ONE department's class and store the data [Recommended before: printDepartmentCourses()]\");\n System.out.println(indent + \"@usage iterateOne(\\\"CS\\\")\");\n System.out.println(indent + \"@param department\");\n\n System.out.println();\n System.out.println(\"printDepartmentCourses() --> Display a formatted list of every stored class so far\");\n System.out.println(indent + \"@usage printDepartmentCourses()\");\n\n System.out.println();\n System.out.println(\"printArrListSizes() --> Display the sizes of all the data (to make sure they're all the same length)\");\n System.out.println(indent + \"@usage printArrListSizes()\");\n \n\n System.out.println();\n System.out.println(\"******* OPTIONS (custom.[COMMAND] *******\");\n System.out.println(\"The following interact with the HTML GET method\");\n System.out.println();\n \n\n System.out.println();\n System.out.println(\"setTerm() --> Set the semester term you want to search\");\n System.out.println(indent + \"@usage setTerm(\\\"Summer\\\", \\\"2017\\\")\");\n System.out.println(indent + \"@param season\");\n System.out.println(indent + indent + \"options: Fall, Spring, Winter, Summer\");\n System.out.println(indent + \"@param year\");\n System.out.println(indent + indent + \"options: 2015, 2016, 2017, etc.\");\n\n System.out.println();\n System.out.println(\"setDepartment() --> Set a single department you wish to search (use with iterateOne())\");\n System.out.println(indent + \"@usage setDepartment(\\\"CS\\\")\");\n System.out.println(indent + \"@param department\");\n System.out.println(indent + indent + \"options: AMIND, BIOL, CS, etc.\");\n\n System.out.println();\n System.out.println(\"setInstructor() --> Set the course number you want to return (ex. all \\\"xx-108\\\" classes)\");\n System.out.println(indent + \"@usage setInstructor(\\\"Kraft\\\")\");\n System.out.println(indent + \"@param last name\");\n\n System.out.println();\n System.out.println(\"setCourseNumber() --> Set the course number you want to return (ex. all \\\"xx-108\\\" classes)\");\n System.out.println(indent + \"@usage setCourseNumber(\\\"108\\\")\");\n System.out.println(indent + \"@param number\");\n\n System.out.println();\n System.out.println(\"setCourseNumber() --> Set the course number AND suffic you want to return (ex. all \\\"xx-451A\\\" classes)\");\n System.out.println(indent + \"@usage setTerm(\\\"451\\\", \\\"A\\\")\");\n System.out.println(indent + \"@param number\");\n System.out.println(indent + \"@param suffix\");\n System.out.println(indent + indent + \"options: A, B, C, etc.\");\n\n System.out.println();\n System.out.println(\"setScheduleNumber() --> Set the specific class you want to return\");\n System.out.println(indent + \"@usage setScheduleNumber(\\\"20019\\\")\");\n System.out.println(indent + \"@param number\");\n\n System.out.println();\n System.out.println(\"setUnits() --> Set the specific number of units\");\n System.out.println(indent + \"@usage setUnits(\\\"3\\\")\");\n System.out.println(indent + \"@param units\");\n\n System.out.println();\n System.out.println(\"setLocation() --> Set the facility location of the class\");\n System.out.println(indent + \"@usage setUnits(\\\"GMCS\\\")\");\n System.out.println(indent + \"@param facility\");\n\n System.out.println();\n System.out.println(\"setLocation() --> Set the facility AND room location of the class\");\n System.out.println(indent + \"@usage setUnits(\\\"GMCS\\\", \\\"311\\\")\");\n System.out.println(indent + \"@param facility\");\n System.out.println(indent + \"@param room number\");\n\n System.out.println();\n System.out.println(\"setServiceLearning() --> Toggle the 'Service Learning' option [only show Service Learning classes]\");\n System.out.println(indent + \"@usage setServiceLearning(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setSpecialTopics() --> Toggle the 'Special Topics' option [only show Special Topics classes]\");\n System.out.println(indent + \"@usage setSpecialTopics(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setHonors() --> Toggle the 'Honors' option [only show Honors classes]\");\n System.out.println(indent + \"@usage setHonors(true)\");\n System.out.println(indent + \"@param true/false\");\n \n System.out.println();\n System.out.println(\"setDistanceOnline() --> Toggle the 'Distance Online' option [only show Online classes]\");\n System.out.println(indent + \"@usage setDistanceOnline(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setDistanceHybrid() --> Toggle the 'Distance Hybrid' option [only show Hybrid classes]\");\n System.out.println(indent + \"@usage setDistanceHybrid(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setEvening() --> Toggle the 'Evening' option [only show Evening classes]\");\n System.out.println(indent + \"@usage setEvening(true)\");\n System.out.println(indent + \"@param true/false\");\n\n System.out.println();\n System.out.println(\"setMeetingType() --> Set your preferred meeting type\");\n System.out.println(indent + \"@usage setMeetingType(\\\"Lecture\\\")\");\n System.out.println(indent + \"@param type\");\n System.out.println(indent + indent + \"@options Activity, Discussion, Labratory, Lecture, \"+\n \"Nontraditional, ROTC, Seminar, Supervised\");\n \n System.out.println();\n System.out.println(\"setGenEd() --> Set the General Education requirements you want to show\");\n System.out.println(indent + \"@usage setGenEd(\\\"IIA2\\\")\");\n System.out.println(indent + \"@param true/false\");\n System.out.println(indent + indent + \"@options see general catalog\");\n\n System.out.println();\n System.out.println(\"setSession() --> Set the Summer Session you want to show\");\n System.out.println(indent + \"@usage setGenEd(\\\"S1\\\")\");\n System.out.println(indent + \"@param session\");\n System.out.println(indent + indent + \"@options S1, S2, T1\");\n\n System.out.println();\n System.out.println(\"+---------------------------------------------------------------------------------+\");\n System.out.println();\n\n }", "private SimpleCLI(Options options) {\n this.options = options;\n }", "public void options(CliOption... options) {\n\t\toptions(Arrays.asList(Preconditions.checkNotNull(options)));\n\t}", "public CopsOptionParser() {\n\t\tsuper();\n\t\taddOption(HELP);\n\t\taddOption(SCENARIO);\n\t\taddOption(VALIDATE_ONLY);\n\t\taddOption(CONF);\n\n\t}", "private static String optionsListing() {\n\t\tString result = \"\\nUsage: java -jar comtor.jar -dir dirname\\n\\n\";\n\t\tresult += \"Options:\\n\";\n\t\t\n\t\tresult += \"-dir dirname\\t\\tSpecified the pathname of the directory in which COMTOR will \"; \n\t\tresult += \"search for Java source code\\n\\t\\t\\tfiles (packaged and non-packaged).\\n\\n\";\n\t\t\n\t\tresult += \"-help | --help\\t\\tThis help message\\n\";\n\t\tresult += \"\\n\\n\";\n\t\treturn result;\n\t}", "public GoRun flags(String... args) {\n if (args.length % 2 != 0) {\n throw new InvalidParameterException(\"given args are not even\");\n }\n\n for (int i = 0; i < args.length; i += 2) {\n shortOption(args[i], args[i + 1]);\n }\n return this;\n }", "public InfoOptions() {\n\t\tHelpOpt = new ArrayList<String>();\n\t\tDisplayOpt = new ArrayList<String>();\n\t\tNoteOpt = new ArrayList<String>();\n\t\tDelOpt = new ArrayList<String>();\n\t\tChangeNameOpt = new ArrayList<String>();\n\t\tsetDisplay();\n\t\tsetHelp();\n\t\tsetNote();\n\t\tsetDel();\n\t\tsetChangeName();\n\t}", "public static Options getCmdLineOptions(){\n\t\tOptions options = new Options();\n\t\t//\t\toptions.addOption(OptionBuilder.withArgName(\"outputPath\").hasArg().withDescription(\"output sequence lengths to a file [if not specified, lengths are printed to stdout]\").create(Thunder.OPT_PATH_OUTPUT));\n\t\t//\t\toptions.addOption(OptionBuilder.withArgName(\"maxExpectedLength\").hasArg().withDescription(\"print sequences exceeding this maximum expected size (for debugging + QC)\").create(\"m\"));\n\t\treturn options;\n\t}", "public static Options prepareOptions() {\n Options options = new Options();\n\n options.addOption(\"f\", \"forceDeleteIndex\", false,\n \"Force delete index if index already exists.\");\n options.addOption(\"h\", \"help\", false, \"Show this help information and exit.\");\n options.addOption(\"r\", \"realTime\", false, \"Keep for backwards compabitlity. No Effect.\");\n options.addOption(\"t\", \"terminology\", true, \"The terminology (ex: ncit_20.02d) to load.\");\n options.addOption(\"d\", \"directory\", true, \"Load concepts from the given directory\");\n options.addOption(\"xc\", \"skipConcepts\", false,\n \"Skip loading concepts, just clean stale terminologies, metadata, and update latest flags\");\n options.addOption(\"xm\", \"skipMetadata\", false,\n \"Skip loading metadata, just clean stale terminologies concepts, and update latest flags\");\n options.addOption(\"xl\", \"skipLoad\", false,\n \"Skip loading data, just clean stale terminologies and update latest flags\");\n options.addOption(\"xr\", \"report\", false, \"Compute and return a report instead of loading data\");\n\n return options;\n }", "public static void help() {\n\tSystem.out.println(\"-- Avaible options --\");\n\tSystem.out.println(\"-- [arg]: Required argument\");\n\tSystem.out.println(\"-- {arg}: Optional argument\");\n\tSystem.out.println(\"* -s {file} Save the game into a file\");\n\tSystem.out.println(\"* -r {file} Play or Replay a game from a file\");\n\tSystem.out.println(\"* -a [file] Play a binary file or a game file\");\n\tSystem.out.println(\"* -n [file] Create a random game file\");\n\tSystem.out.println(\"* -t [size] Specify the size of the board\");\n\tSystem.out.println(\"* -k Solve the game with the IA solver\");\n\tSystem.out.println(\"* -m Solve the game with the MinMax/AlphaBeta algorithm\");\n\tSystem.out.println(\"----------------------------------------------\");\n\tSystem.out.println(\". Press Enter to Start or Restart\");\n\tSystem.out.println(\". Press Z to Undo the last move\");\n\tSystem.out.println(\"\");\n }", "static void selectOptions(String[] args)\n {\n if (args.length > 0)\n {\n for (String arg : args)\n {\n switch(arg)\n {\n default:\n System.out.println(\"Usage: java PGInstance [-options]\\n\"\n + \"where options include\\n\"\n + \" <an invalid option> to print this help message\\n\"\n + \" -m -more -v -verbose to turn on verbose console messages\\n\"\n + \" -c -cheat to turn on cheats\\n\"\n + \" <no options> to run program as is\"\n );\n System.exit(0);\n break;\n\n // this silences all calls to Verbose.println()\n case \"-m\": case \"-more\": case \"-v\": case \"-verbose\":\n if (!Verbose.on)\n {\n System.out.println(\"[Verbose messages enabled.]\");\n Verbose.on = true;\n }\n break;\n\n // a Pokemon object will always output an invincible Pokemon with this option\n case \"-c\": case \"-cheat\":\n if (!Pokemon.usingCheats)\n {\n System.out.println(\"[Cheats on. (69/420/\\\"ONE PUNCH MON\\\")]\");\n Pokemon.usingCheats = true;\n }\n break;\n }\n }\n }\n }", "public void fillCLIArgs(List<String> args) {\n\t\tif (transactionalCheckBox.isSelected()) {\n\t\t\targs.add(\"-transactional\");\n\t\t}\n\t\tObject isolationLevel = isolationLevelComboBox.getSelectedItem();\n\t\tif (isolationLevel != null && !String.valueOf(Connection.TRANSACTION_NONE).equals(isolationLevel)) {\n\t\t\targs.add(\"-isolation-level\");\n\t\t\targs.add(isolationLevel.toString());\n\t\t}\n\t\tInteger nt = numThreads();\n\t\tif (nt != null) {\n\t\t\targs.add(\"-threads\");\n\t\t\targs.add(\"\" + nt);\n\t\t}\n\t}", "public void printOptions(String[] options) {\n\tfor (int counter = 0; counter < options.length; counter++) {\n\t System.out.print(options[counter] + \" || \");\n\t}\n\tSystem.out.print(\"\\n\");\n }", "public static void showOptions() {\n System.out.println(new StringJoiner(\"\\n\")\n .add(\"*************************\")\n .add(\"1- The participants' directory.\")\n .add(\"2- The RDVs' agenda.\")\n .add(\"3- Quit the app.\")\n .add(\"*************************\")\n );\n }", "public void printOptions() {\n\t\t\n\t}", "public BwaOptions(String[] args) {\n\n\t\t//Parse arguments\n\t\tfor (String argument : args) {\n\t\t\tLOG.info(\"[\"+this.getClass().getName()+\"] :: Received argument: \" + argument);\n\t\t}\n\n\t\t//Algorithm options\n\t\tthis.options = this.initOptions();\n\n\t\t//To print the help\n\t\tHelpFormatter formatter = new HelpFormatter();\n\t\t//formatter.setWidth(500);\n\t\t//formatter.printHelp( correctUse,header, options,footer , true);\n\n\t\t//Parse the given arguments\n\t\tCommandLineParser parser = new BasicParser();\n\t\tCommandLine cmd;\n\n\t\ttry {\n\t\t\tcmd = parser.parse(this.options, args);\n\n\t\t\t//We look for the algorithm\n\t\t\tif (cmd.hasOption('m') || cmd.hasOption(\"mem\")){\n\t\t\t\t//Case of the mem algorithm\n\t\t\t\tmemAlgorithm = true;\n\t\t\t\talnAlgorithm = false;\n\t\t\t\tbwaswAlgorithm = false;\n\t\t\t}\n\t\t\telse if(cmd.hasOption('a') || cmd.hasOption(\"aln\")){\n\t\t\t\t// Case of aln algorithm\n\t\t\t\talnAlgorithm = true;\n\t\t\t\tmemAlgorithm = false;\n\t\t\t\tbwaswAlgorithm = false;\n\t\t\t}\n\t\t\telse if(cmd.hasOption('b') || cmd.hasOption(\"bwasw\")){\n\t\t\t\t// Case of bwasw algorithm\n\t\t\t\tbwaswAlgorithm = true;\n\t\t\t\tmemAlgorithm = false;\n\t\t\t\talnAlgorithm = false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Default case. Mem algorithm\n\t\t\t\tLOG.warn(\"[\"+this.getClass().getName()+\"] :: The algorithm \"\n\t\t\t\t\t\t+ cmd.getOptionValue(\"algorithm\")\n\t\t\t\t\t\t+ \" could not be found\\nSetting to default mem algorithm\\n\");\n\n\t\t\t\tmemAlgorithm = true;\n\t\t\t\talnAlgorithm = false;\n\t\t\t\tbwaswAlgorithm = false;\n\t\t\t}\n\n\t\t\t//We look for the index\n\t\t\tif (cmd.hasOption(\"index\") || cmd.hasOption('i')) {\n\t\t\t\tindexPath = cmd.getOptionValue(\"index\");\n\t\t\t}\n\t\t/* There is no need of this, as the index option is mandatory\n\t\telse {\n\t\t\tLOG.error(\"[\"+this.getClass().getName()+\"] :: No index has been found. Aborting.\");\n\t\t\tformatter.printHelp(correctUse, header, options, footer, true);\n\t\t\tSystem.exit(1);\n\t\t}*/\n\n\t\t\t//Partition number\n\t\t\tif (cmd.hasOption(\"partitions\") || cmd.hasOption('n')) {\n\t\t\t\tpartitionNumber = Integer.parseInt(cmd.getOptionValue(\"partitions\"));\n\t\t\t}\n\n\t\t\t// BWA arguments\n\t\t\tif (cmd.hasOption(\"bwa\") || cmd.hasOption('w')) {\n\t\t\t\tbwaArgs = cmd.getOptionValue(\"bwa\");\n\t\t\t}\n\n\t\t\t// Paired or single reads\n\t\t\tif (cmd.hasOption(\"paired\") || cmd.hasOption('p')) {\n\t\t\t\tpairedReads = true;\n\t\t\t\tsingleReads = false;\n\t\t\t}\n\t\t\telse if (cmd.hasOption(\"single\") || cmd.hasOption('s')) {\n\t\t\t\tpairedReads = false;\n\t\t\t\tsingleReads = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tLOG.warn(\"[\"+this.getClass().getName()+\"] :: Reads argument could not be found\\nSetting it to default paired reads\\n\");\n\t\t\t\tpairedReads = true;\n\t\t\t\tsingleReads = false;\n\t\t\t}\n\n\t\t\t// Sorting\n\t\t\tif (cmd.hasOption('f') || cmd.hasOption(\"hdfs\")) {\n\t\t\t\tthis.sortFastqReadsHdfs = true;\n\t\t\t\tthis.sortFastqReads = false;\n\t\t\t}\n\t\t\telse if (cmd.hasOption('k') || cmd.hasOption(\"spark\")) {\n\t\t\t\tthis.sortFastqReadsHdfs = false;\n\t\t\t\tthis.sortFastqReads = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.sortFastqReadsHdfs = false;\n\t\t\t\tthis.sortFastqReads = false;\n\t\t\t}\n\n\t\t\t// Use reducer\n\t\t\tif (cmd.hasOption('r') || cmd.hasOption(\"reducer\")) {\n\t\t\t\tthis.useReducer = true;\n\t\t\t}\n\n\t\t\t// Help\n\t\t\tif (cmd.hasOption('h') || cmd.hasOption(\"help\")) {\n\t\t\t\t//formatter.printHelp(correctUse, header, options, footer, true);\n\t\t\t\tthis.printHelp();\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\n\t\t\t//Input and output paths\n\t\t\tString otherArguments[] = cmd.getArgs(); //With this we get the rest of the arguments\n\n\t\t\tif ((otherArguments.length != 2) && (otherArguments.length != 3)) {\n\t\t\t\tLOG.error(\"[\"+this.getClass().getName()+\"] No input and output has been found. Aborting.\");\n\n\t\t\t\tfor (String tmpString : otherArguments) {\n\t\t\t\t\tLOG.error(\"[\"+this.getClass().getName()+\"] Other args:: \" + tmpString);\n\t\t\t\t}\n\n\t\t\t\t//formatter.printHelp(correctUse, header, options, footer, true);\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t\telse if (otherArguments.length == 2) {\n\t\t\t\tinputPath = otherArguments[0];\n\t\t\t\toutputPath = otherArguments[1];\n\t\t\t}\n\t\t\telse if (otherArguments.length == 3) {\n\t\t\t\tinputPath = otherArguments[0];\n\t\t\t\tinputPath2 = otherArguments[1];\n\t\t\t\toutputPath = otherArguments[2];\n\t\t\t}\n\n\t\t} catch (UnrecognizedOptionException e) {\n\t\t\te.printStackTrace();\n\t\t\t//formatter.printHelp(correctUse, header, options, footer, true);\n\t\t\tthis.printHelp();\n\t\t\tSystem.exit(1);\n\t\t} catch (MissingOptionException e) {\n\t\t\t//formatter.printHelp(correctUse, header, options, footer, true);\n\t\t\tthis.printHelp();\n\t\t\tSystem.exit(1);\n\t\t} catch (ParseException e) {\n\t\t\t//formatter.printHelp( correctUse,header, options,footer , true);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public void initOptions(String[] args) {\n\t\tCL_Initializer.CL_init(args);\n\t\tCL_Initializer.checkParsing(args);\n\t\tCL_Initializer.initImagingScheme();\n\t\tCL_Initializer.initDataSynthesizer();\n\t}", "public void printArgsInterpretation() {\n StringBuilder usage = new StringBuilder();\n usage.append(\"You launched the CuratorClient with the following options:\");\n usage.append(\"\\n\");\n usage.append(\"\\tCurator host: \");\n usage.append(host);\n usage.append(\"\\n\");\n usage.append(\"\\tCurator port: \");\n usage.append(port);\n usage.append(\"\\n\");\n usage.append(\"\\tInput directory: \");\n usage.append(inputDir.toString());\n usage.append(\"\\n\");\n usage.append(\"\\tOutput directory: \");\n usage.append(outputDir.toString());\n usage.append(\"\\n\");\n usage.append(\"\\tRun in testing mode? \");\n usage.append(testing ? \"Yes.\" : \"No.\");\n usage.append(\"\\n\");\n\n System.out.println( usage.toString() );\n }", "public static Options addOptions() {\n Options options = new Options();\n options.addOption(\"f\", true, \"The input file \");\n options.addOption(\"d\", true, \"The output directory\");\n options.addOption(\"u\", true, \"Only uber retrieval value is (1,0) default 0\");\n options.addOption(\"l\",true,\"Only Lyft Retrieval value is (1,0) default 0\");\n return options;\n }", "public static Options createOptions() {\n Options options = new Options();\n options.addOption(Option.builder(\"i\").required(true).longOpt(\"inputFile\").hasArg(true)\n .argName(\"PATH\").desc(\"this command specifies the path to the file \"\n + \"containing queries to be inputted into the tool. It is therefore mandatory\")\n .build());\n options.addOption(Option.builder(\"o\").longOpt(\"outputFile\").hasArg(true).argName(\"PATH\")\n .desc(\"this command specifies the path to the file that the tool can write \"\n + \"its results to. If not specified, the tool will simply print results\"\n + \"on the console. It is therefore optional\").build());\n options.addOption(Option.builder(\"l\").longOpt(\"limit\").hasArg(true).argName(\"INTEGER\")\n .desc(\"this command specifies the path to an integer that the tools takes \"\n + \"as a limit for the number of errors to be explored, thereby controlling\"\n + \"the runtime. It is therefore optional\").build());\n return options;\n }", "public List<String> getOptions() {\n List<String> options = new ArrayList<String>();\n if (!showWarnings) {\n options.add(\"-nowarn\");\n }\n addStringOption(options, \"-source\", source);\n addStringOption(options, \"-target\", target);\n addStringOption(options, \"--release\", release);\n addStringOption(options, \"-encoding\", encoding);\n return options;\n }", "private void initOption() {\r\n\t\tthis.option = new JMenu(\"Options\");\r\n\t\tthis.add(option);\r\n\t\tthis.initNewGame();\r\n\t\tthis.initNewServer();\r\n\t\tthis.initNewConnect();\r\n\t\tthis.initExitConnect();\r\n\t\tthis.initExitGame();\r\n\t}", "private static JSAP prepCmdLineParser()\n throws Exception {\n final JSAP jsap = new JSAP();\n\n final FlaggedOption site_xml = new FlaggedOption(\"hbase_site\")\n .setStringParser(JSAP.STRING_PARSER)\n .setDefault(\"/etc/hbase/conf/hbase-site.xml\")\n .setRequired(true)\n .setShortFlag('c')\n .setLongFlag(JSAP.NO_LONGFLAG);\n site_xml.setHelp(\"Path to hbase-site.xml\");\n jsap.registerParameter(site_xml);\n\n final FlaggedOption jmxremote_password = new FlaggedOption(\"jmxremote_password\")\n .setStringParser(JSAP.STRING_PARSER)\n .setDefault(\"/etc/hbase/conf/jmxremote.password\")\n .setRequired(true)\n .setShortFlag('j')\n .setLongFlag(JSAP.NO_LONGFLAG);\n jmxremote_password.setHelp(\"Path to jmxremote.password.\");\n jsap.registerParameter(jmxremote_password);\n\n final FlaggedOption throttleFactor = new FlaggedOption(\"throttleFactor\")\n .setStringParser(JSAP.INTEGER_PARSER)\n .setDefault(\"1\")\n .setRequired(false)\n .setShortFlag('t')\n .setLongFlag(JSAP.NO_LONGFLAG);\n throttleFactor.setHelp(\"Throttle factor to limit the compaction queue. The default (1) limits it to num threads / 1\");\n jsap.registerParameter(throttleFactor);\n\n final FlaggedOption num_cycles = new FlaggedOption(\"numCycles\")\n .setStringParser(JSAP.INTEGER_PARSER)\n .setDefault(\"1\")\n .setRequired(false)\n .setShortFlag('n')\n .setLongFlag(JSAP.NO_LONGFLAG);\n num_cycles.setHelp(\"Number of iterations to run. The default is 1. Set to 0 to run forever.\");\n jsap.registerParameter(num_cycles);\n\n final FlaggedOption pauseInterval = new FlaggedOption(\"pauseInterval\")\n .setStringParser(JSAP.INTEGER_PARSER)\n .setDefault(\"30000\")\n .setRequired(false)\n .setShortFlag('p')\n .setLongFlag(JSAP.NO_LONGFLAG);\n pauseInterval.setHelp(\"Time (in milliseconds) to pause between compactions.\");\n jsap.registerParameter(pauseInterval);\n\n final FlaggedOption waitInterval = new FlaggedOption(\"waitInterval\")\n .setStringParser(JSAP.INTEGER_PARSER)\n .setDefault(\"60000\")\n .setRequired(false)\n .setShortFlag('w')\n .setLongFlag(JSAP.NO_LONGFLAG);\n waitInterval.setHelp(\"Time (in milliseconds) to wait between \" +\n \"time (are we there yet?) checks.\");\n jsap.registerParameter(waitInterval);\n\n DateStringParser date_parser = DateStringParser.getParser();\n date_parser.setProperty(\"format\", \"HH:mm\");\n\n final FlaggedOption startTime = new FlaggedOption(\"startTime\")\n .setStringParser(date_parser)\n .setDefault(\"01:00\")\n .setRequired(true)\n .setShortFlag('s')\n .setLongFlag(JSAP.NO_LONGFLAG);\n startTime.setHelp(\"Time to start compactions.\");\n jsap.registerParameter(startTime);\n\n final FlaggedOption endTime = new FlaggedOption(\"endTime\")\n .setStringParser(date_parser)\n .setDefault(\"07:00\")\n .setRequired(true)\n .setShortFlag('e')\n .setLongFlag(JSAP.NO_LONGFLAG);\n endTime.setHelp(\"Time to stop compactions.\");\n jsap.registerParameter(endTime);\n\n final FlaggedOption dryRun = new FlaggedOption(\"dryRun\")\n .setStringParser(JSAP.BOOLEAN_PARSER)\n .setDefault(\"false\")\n .setRequired(false)\n .setShortFlag('d')\n .setLongFlag(JSAP.NO_LONGFLAG);\n dryRun.setHelp(\"Don't actually do any compactions or splits.\");\n jsap.registerParameter(dryRun);\n\n final FlaggedOption maxSplitSize = new FlaggedOption(\"maxSplitSize_in_MB\")\n .setStringParser(JSAP.LONG_PARSER)\n .setDefault(\"4096\")\n .setRequired(false)\n .setShortFlag('m')\n .setLongFlag(JSAP.NO_LONGFLAG);\n maxSplitSize.setHelp(\"Maximum size for store files (in MB) at which a region is split.\");\n jsap.registerParameter(maxSplitSize);\n\n final FlaggedOption splitsEnabled = new FlaggedOption(\"splitsEnabled\")\n .setStringParser(JSAP.BOOLEAN_PARSER)\n .setDefault(\"false\")\n .setRequired(false)\n .setShortFlag('h')\n .setLongFlag(JSAP.NO_LONGFLAG);\n splitsEnabled.setHelp(\"Do splits (default split size will be 256MB unless specified).\");\n jsap.registerParameter(splitsEnabled);\n\n final FlaggedOption table_names = new FlaggedOption(\"tableNames\")\n .setStringParser(JSAP.STRING_PARSER)\n .setRequired(false)\n .setShortFlag(JSAP.NO_SHORTFLAG)\n .setLongFlag(\"tableNames\")\n .setList(true)\n .setListSeparator(',');\n table_names.setHelp(\"Specific table names to check against (default is all)\");\n jsap.registerParameter(table_names);\n\n final FlaggedOption files_keep = new FlaggedOption(\"filesKeep\")\n .setStringParser(JSAP.INTEGER_PARSER)\n .setRequired(false)\n .setShortFlag('f')\n .setLongFlag(\"filesKeep\")\n .setDefault(\"5\");\n files_keep.setHelp(\"Number of storefiles to look for before compacting (default is 5)\");\n jsap.registerParameter(files_keep);\n\n\n return jsap;\n }", "protected abstract void initializeOptions(Options options);", "private static Options createOptions() {\n \n \t\tOptions options = new Options();\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the input file / directory\");\n \t\tOptionBuilder.isRequired(true);\n \t\toptions.addOption(OptionBuilder.create(\"input\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"int\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"minimum size of file in MB to split (Default: \" + MIN_FILE_SIZE + \" MB)\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"minsize\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the ignore list file\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"ignore\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the output directory\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"output\"));\n \t\t\n \t\tOptionBuilder.withArgName(\"path\");\n \t\tOptionBuilder.hasArg(true);\n \t\tOptionBuilder.withDescription(\"path to the osmosis script template\");\n \t\tOptionBuilder.isRequired(false);\n \t\toptions.addOption(OptionBuilder.create(\"template\"));\n \t\t\n \t\treturn options;\n \t\t\n \t}", "public Options initOptions() {\n\n\t\tOptions privateOptions = new Options();\n\n\t\t//Algorithm options\n\t\t//Option algorithm = new Option(\"a\", \"algorithm\", true, \"Specify the algorithm to use during the alignment\");\n\t\t//algorithm.setArgName(\"mem | aln | bwasw\");\n\n\t\t//options.addOption(algorithm);\n\n\t\tOptionGroup algorithm = new OptionGroup();\n\n\t\tOption mem = new Option(\"m\",\"mem\", false,\"The MEM algorithm will be used\");\n\t\talgorithm.addOption(mem);\n\n\t\tOption aln = new Option(\"a\",\"aln\", false,\"The ALN algorithm will be used\");\n\t\talgorithm.addOption(aln);\n\n\t\tOption bwasw = new Option(\"b\", \"bwasw\", false, \"The bwasw algorithm will be used\");\n\t\talgorithm.addOption(bwasw);\n\n\t\tprivateOptions.addOptionGroup(algorithm);\n\n\t\t//Paired or single reads\n\t\t//Option reads = new Option(\"r\", \"reads\", true, \"Type of reads to use during alignment\");\n\t\t//reads.setArgName(\"paired | single\");\n\n\t\t//options.addOption(reads);\n\t\tOptionGroup reads = new OptionGroup();\n\n\t\tOption paired = new Option(\"p\", \"paired\", false, \"Paired reads will be used as input FASTQ reads\");\n\t\treads.addOption(paired);\n\n\t\tOption single = new Option(\"s\", \"single\", false, \"Single reads will be used as input FASTQ reads\");\n\t\treads.addOption(single);\n\n\t\tprivateOptions.addOptionGroup(reads);\n\n\t\t// Options to BWA\n\t\tOptionGroup bwaOptionsGroup = new OptionGroup();\n\t\tOption bwaArgs = new Option(\"w\", \"bwa\", true, \"Arguments passed directly to BWA\");\n\t\tbwaArgs.setArgName(\"\\\"BWA arguments\\\"\");\n\n\t\tbwaOptionsGroup.addOption(bwaArgs);\n\n\t\tprivateOptions.addOptionGroup(bwaOptionsGroup);\n\n\t\t//Index\n\t\tOptionGroup indexGroup = new OptionGroup();\n\t\tOption index = new Option(\"i\", \"index\", true, \"Prefix for the index created by bwa to use - setIndexPath(string)\");\n\t\tindex.setArgName(\"Index prefix\");\n\t\tindex.setRequired(true);\n\n\t\tindexGroup.addOption(index);\n\n\t\tprivateOptions.addOptionGroup(indexGroup);\n\n\t\t//Partition number\n\t\tOptionGroup sparkGroup = new OptionGroup();\n\t\tOption partitions = new Option(\"n\", \"partitions\", true,\n\t\t\t\t\"Number of partitions to divide input - setPartitionNumber(int)\");\n\t\tpartitions.setArgName(\"Number of partitions\");\n\n\t\tsparkGroup.addOption(partitions);\n\n\t\tprivateOptions.addOptionGroup(sparkGroup);\n\n\n\t\tOptionGroup reducerGroup = new OptionGroup();\n\t\tOption reducer = new Option(\"r\", \"reducer\", false, \"The program is going to merge all the final results in a reducer phase\");\n\n\t\treducerGroup.addOption(reducer);\n\n\t\tprivateOptions.addOptionGroup(reducerGroup);\n\n\t\t/* OptionGroup sorting = new OptionGroup();\n\n\t\tOption hdfs = new Option(\"f\", \"hdfs\", false, \"The HDFS is used to perform the input FASTQ reads sort\");\n\t\tsorting.addOption(hdfs);\n\n\t\tOption spark = new Option(\"k\", \"spark\", false, \"the Spark engine is used to perform the input FASTQ reads sort\");\n\t\tsorting.addOption(spark);\n\n\t\tprivateOptions.addOptionGroup(sorting);\n\t\t*/\n\t\t// Help\n\t\tOptionGroup helpGroup = new OptionGroup();\n\t\tOption help = new Option(\"h\", \"help\", false, \"Shows this help\");\n\n\t\thelpGroup.addOption(help);\n\n\t\tprivateOptions.addOptionGroup(helpGroup);\n\n\t\treturn privateOptions;\n\t}", "@Override\n public String[] getOptions() {\n\n Vector<String> result = new Vector<String>();\n\n Collections.addAll(result, super.getOptions());\n\n result.add(\"-a\");\n result.add(\"\" + getNumAttributes());\n\n if (getClassFlag()) {\n result.add(\"-c\");\n }\n\n return result.toArray(new String[result.size()]);\n }", "public void editOptions()\n {\n System.out.println(\"\\n\\t\\t:::::::::::::::::::::::::::::::::::\");\n System.out.println(\"\\t\\t| Select Options Below : |\");\n System.out.println(\"\\t\\t:::::::::::::::::::::::::::::::::::\");\n System.out.println(\"\\t\\t| [1] Modify Actors |\");\n System.out.println(\"\\t\\t| [2] Modify Rating |\");\n System.out.println(\"\\t\\t| [3] Modify Actors & Rating |\");\n System.out.println(\"\\t\\t| [4] Back To Menu |\");\n System.out.println(\"\\t\\t===================================\");\n System.out.print(\"\\t\\t Input the option number : \");\n }", "public static void showCommandLineOptions(TextUICommandLine commandLine) {\n commandLine.printUsage(System.out);\n }", "public static void main( String[] args )\n {\n CommandLineParser parser = new DefaultParser();\n\n // create the Options\n OptionGroup optgrp = new OptionGroup();\n optgrp.addOption(Option.builder(\"l\")\n .longOpt(\"list\")\n .hasArg().argName(\"keyword\").optionalArg(true)\n .type(String.class)\n .desc(\"List documents scraped for keyword\")\n .build());\n optgrp.addOption( Option.builder(\"r\")\n .longOpt(\"read\")\n .hasArg().argName(\"doc_id\")\n .type(String.class)\n .desc(\"Display a specific scraped document.\")\n .build());\n optgrp.addOption( Option.builder(\"a\")\n .longOpt(\"add\")\n .type(String.class)\n .desc(\"Add keywords to scrape\")\n .build());\n optgrp.addOption( Option.builder(\"s\")\n .longOpt(\"scraper\")\n .type(String.class)\n .desc(\"Start the scraper watcher\")\n .build());\n\n\n\n Options options = new Options();\n options.addOptionGroup(optgrp);\n\n options.addOption( Option.builder(\"n\")\n .longOpt(\"search-name\").hasArg()\n .type(String.class)\n .desc(\"Name of the search task for a set of keywords\")\n .build());\n\n options.addOption( Option.builder(\"k\")\n .longOpt(\"keywords\")\n .type(String.class).hasArgs()\n .desc(\"keywords to scrape. \")\n .build());\n\n options.addOption( Option.builder(\"t\")\n .longOpt(\"scraper-threads\")\n .type(Integer.class).valueSeparator().hasArg()\n .desc(\"Number of scraper threads to use.\")\n .build());\n\n //String[] args2 = new String[]{ \"--add --search-name=\\\"some thing\\\" --keywords=kw1, kw2\" };\n // String[] args2 = new String[]{ \"--add\", \"--search-name\", \"some thing new\", \"--keywords\", \"kw3\", \"kw4\"};\n // String[] args2 = new String[]{ \"--scraper\"};\n// String[] args2 = new String[]{ \"--list\"};\n\n int exitCode = 0;\n CommandLine line;\n try {\n // parse the command line arguments\n line = parser.parse( options, args );\n }\n catch( ParseException exp ) {\n System.out.println( \"Unexpected exception:\" + exp.getMessage() );\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"searchscraper \\n\" +\n \" [--add --search-name=<SearchTask> --keywords=<keyword1> <keyword2> ...]\\n\" +\n \" [--list [<keyword>] ]\\n\" +\n \" [--read <doc_id>]\\n\", options , true);\n System.exit(2);\n return;\n }\n\n if( line.hasOption( \"add\" ) ) {\n // Add Search Task mode\n if(!line.hasOption( \"search-name\" ) || !line.hasOption(\"keywords\")) {\n System.out.println(\"must have search name and keywords when adding\");\n System.exit(2);\n }\n String name = line.getOptionValue( \"search-name\" );\n String[] keywords = line.getOptionValues(\"keywords\");\n System.out.println(\"Got keywords: \" + Arrays.toString(keywords) );\n\n exitCode = add(name, Arrays.asList(keywords));\n\n } else if( line.hasOption( \"list\" ) ) {\n // List Keyword mode\n DataStore ds = new DataStore();\n String keyword = line.getOptionValue( \"list\" );\n System.out.println(\"Listing with keyword = `\" + keyword + \"`\");\n if(keyword == null) {\n List<String > keywords = ds.listKeywords();\n for(String kw : keywords) {\n System.out.println(kw);\n }\n exitCode=0;\n } else {\n List<SearchResult > results = ds.listDocsForKeyword(keyword);\n for(SearchResult kw : results) {\n System.out.println(kw);\n }\n }\n ds.close();\n\n } else if( line.hasOption( \"read\" ) ) {\n // Show a specific document\n String docId = line.getOptionValue( \"read\" );\n if(docId == null) {\n System.err.println(\"read option missing doc_id parameter\");\n exitCode = 2;\n } else {\n\n DataStore ds = new DataStore();\n String result = ds.read(docId);\n\n if (result == null) {\n System.err.println(\"NOT FOUND\");\n exitCode = 1;\n } else {\n System.out.println(result);\n }\n ds.close();\n }\n }\n else if( line.hasOption( \"scraper\" ) ) {\n int numThreads = 1;\n if(line.hasOption( \"scraper-threads\")) {\n String threadString = line.getOptionValue(\"scraper-threads\");\n try {\n numThreads = Integer.parseInt(threadString);\n } catch (NumberFormatException e) {\n System.out.println(\n \"unable to parse number of threads from `\" +\n threadString + \"`\");\n }\n\n }\n // Start scraper mode\n Daemon daemon = new Daemon(numThreads);\n daemon.start();\n } else {\n // generate the help statement\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"searchscraper \\n\" +\n \" [--add --search-name <SearchTask> --keywords <keyword1> <keyword2> ...]\\n\" +\n \" [--list [<keyword>] ]\\n\" +\n \" [--read <doc_id>]\\n\", options , true);\n exitCode = 2;\n }\n\n\n System.exit(exitCode);\n }", "private void printHelp(Options options) {\n HelpFormatter formatter = new HelpFormatter();\n formatter.setWidth(79);\n formatter.setOptionComparator(Comparator.comparingInt(this::getOptionOrder));\n formatter.printHelp(\"protostuff-compiler [options] proto_files\", options);\n }", "@OverridingMethodsMustInvokeSuper\n protected Tool parseArguments(String[] args) throws Exception {\n for (String arg : options(args)) {\n if (arg.equals(\"--debug\")) {\n checkArgument(verbosity == Level.DEFAULT, \"Specify one of: --quiet --verbose --debug\");\n setVerbosity(Level.DEBUG);\n } else if (arg.equals(\"--verbose\")) {\n checkArgument(verbosity == Level.DEFAULT, \"Specify one of: --quiet --verbose --debug\");\n setVerbosity(Level.VERBOSE);\n } else if (arg.equals(\"--quiet\")) {\n checkArgument(verbosity == Level.DEFAULT, \"Specify one of: --quiet --verbose --debug\");\n setVerbosity(Level.QUIET);\n } else if (arg.equals(\"--pretty\")) {\n setPretty(true);\n } else {\n return unknownOption(arg);\n }\n }\n return this;\n }", "public static void options(){\n System.out.println(\"Choose from the following options \");\n System.out.println(\"0 Print the options again\");\n System.out.println(\"1 Create Student Records\");\n System.out.println(\"2 Create Teacher Records\");\n System.out.println(\"3 Edit the Records\");\n System.out.println(\"4 Get the Record Count\");\n System.out.println(\"5 Exit\");\n }", "public void setOptions(){\n System.out.println(\"¿Que operacion desea realizar?\");\n System.out.println(\"\");\n System.out.println(\"1- Consultar sus datos\");\n System.out.println(\"2- Ingresar\");\n System.out.println(\"3- Retirar\");\n System.out.println(\"4- Transferencia\");\n System.out.println(\"5- Consultar saldo\");\n System.out.println(\"6- Cerrar\");\n System.out.println(\"\");\n}", "private void printUsage() {\n \n // new formatter\n HelpFormatter formatter = new HelpFormatter();\n \n // add the text and print\n formatter.printHelp(\"arara [file [--log] [--verbose] [--timeout N] [--language L] | --help | --version]\", commandLineOptions);\n }", "private static Options getOptions() {\n Option inputOption = Option.builder(\"i\")\n .longOpt(\"input\")\n .hasArg()\n .argName(\"input file\")\n .required()\n .desc(\"The JSON input filename\")\n .build();\n Option outputOption = Option.builder(\"o\")\n .longOpt(\"output\")\n .hasArg()\n .argName(\"output file\")\n .required()\n .desc(\"The Drupal output filename\")\n .build();\n Option configOption = Option.builder(\"c\")\n .longOpt(\"config\")\n .hasArg()\n .argName(\"properties file\")\n .required()\n .desc(\"The properties file for containing Google credentials\")\n .build();\n Option helpOption = Option.builder(\"h\")\n .longOpt(\"help\")\n .desc(\"Print this message\")\n .build();\n\n Options options = new Options();\n options.addOption(inputOption);\n options.addOption(outputOption);\n options.addOption(configOption);\n options.addOption(helpOption);\n\n return options;\n }", "public FindBugsCommandLine() {\n super();\n project = new Project();\n startOptionGroup(\"General FindBugs options:\");\n addOption(\"-project\", \"project\", \"analyze given project\");\n addOption(\"-home\", \"home directory\", \"specify FindBugs home directory\");\n addOption(\"-pluginList\", \"jar1[\" + File.pathSeparator + \"jar2...]\", \"specify list of plugin Jar files to load\");\n addSwitchWithOptionalExtraPart(\"-effort\", \"min|less|default|more|max\", \"set analysis effort level\");\n addSwitch(\"-adjustExperimental\", \"lower priority of experimental Bug Patterns\");\n addSwitch(\"-workHard\", \"ensure analysis effort is at least 'default'\");\n addSwitch(\"-conserveSpace\", \"same as -effort:min (for backward compatibility)\");\n }", "private static void viewOptions() {\n\t\tlog.info(\"Enter 0 to Exit.\");\n\t\tlog.info(\"Enter 1 to Login.\");\n\t}", "public String[] getOptions() {\n return argv;\n }", "static void printGeneralOptions(){\n System.out.println(GeneralInfo.PREFIX_COMMAND_DESCRIPTION + \"NameWeapon/Powerup: read the description of that weapon/powerup\");\n }", "private static void printHelp(){\r\n System.out.println(\"\\n\\n\\t\\t\\t ----HELP---\\n\\n\" +\r\n \"\\nYou can set the length of password like this \\n\" +\r\n \"\\t java -jar nipunpassgen.jar -l (where l is length of password) \\n\\n\" +\r\n \"\\nYou can also specifiy the which type of word your want to use like this-->\\n\" +\r\n \"\\t Type java -jar nipunpassgen.jar -l -tttt \\n \" +\r\n \"Here 1st t will set uselowercase true \\t 2nd t set useUppercase true\\n\" +\r\n \"\\t 3rd t set useDigit True \\t and 4th t set useSpecial Char true\\n\" +\r\n \"You can use 't' or 'T' for setting the true and 'f' or 'F' for setting the false\\n\" +\r\n \"You can pass -c flag at the end of command for directly copy the password in your\\n\" +\r\n \"clipboard without showing in console like this \\t java -jar nipunpassgen.jar -c \\t this will copy a\\n\" +\r\n \"random 8 digit password in your clipboard .\");\r\n }", "public abstract void setOptions(String[] options) throws Exception;", "public static CommandLine prepCli( Options knowsCliDtd,\n\t\t\tString[] args, ResourceBundle rbm )\n\t{\n\t\tCommandLineParser cliRegex = new DefaultParser();\n\t\tCommandLine userInput = null;\n\t\ttry\n\t\t{\n\t\t\tuserInput = cliRegex.parse( knowsCliDtd, args );\n\t\t\tif ( userInput.hasOption( helpFlagS )\n\t\t\t\t\t|| userInput.hasOption( helpFlagLong ) )\n\t\t\t{\n\t\t\t\tnew HelpFormatter().printHelp( \"Note Enojes\", knowsCliDtd );\n\t\t\t}\n\t\t}\n\t\tcatch ( ParseException pe )\n\t\t{\n\t\t\tMessageFormat problem = new MessageFormat( rbm.getString( rbKeyCliParse ) );\n\t\t\tSystem.err.println( problem.format( new Object[]{ cl +\"pc\", pe } ) );\n\t\t}\n\t\treturn userInput;\n\t}", "private void _init(String[] _args, String[] _optList, OptionHandler _optHandler, \n HashMap _customOpts,\n boolean _wantOutput, int _numDtds, String _cmdLineSyntax, \n String _usageHeader) \n {\n args = _args;\n optList = _optList;\n optHandler = _optHandler;\n customOpts = _customOpts;\n wantOutput = _wantOutput;\n numDtds = _numDtds;\n cmdLineSyntax = _cmdLineSyntax;\n usageHeader = _usageHeader;\n }", "private static void printHelp(Options options) {\n HelpFormatter formatter = new HelpFormatter();\n String header = \"Generates the JSON file to send to Drupal.\";\n formatter.printHelp(120, \"drupal-builder\", header, options, \"\", true);\n }", "private static void help(Options options) {\n\t\tHelpFormatter formater = new HelpFormatter();\n\n\t\tformater.printHelp(\"Main\", options);\n\t\tSystem.exit(0);\n\n\t}", "private void printOptionsMessage() {\n System.out.println(\"\\n\");\n System.out.print(\"Visible arrays: \");\n if (showArray == true) {\n System.out.println(\"On\");\n } else {\n System.out.println(\"Off\");\n }\n\n System.out.println(\"Selected Algorithms: \");\n if (selected[0] == true) {\n System.out.print(\" MergeSort\");\n }\n if (selected[1] == true) {\n System.out.print(\" QuickSort\");\n }\n if (selected[2] == true) {\n System.out.print(\" HeapSort\");\n }\n\n System.out.println();\n }", "protected static List<String> options(String[] args) {\n List<String> options = new ArrayList<>(args.length);\n for (String arg : args) {\n if (arg.equals(\"--\")) {\n break;\n } else if (arg.startsWith(\"-\")) {\n options.add(arg);\n }\n }\n return options;\n }", "private void printHelp() {\r\n\t\tSystem.out.println(\"Flag Param Details\");\r\n\t\tSystem.out.println(\" -f **x** Add a filter. 'x' is the board letter.\");\r\n\t\tSystem.out.println(\" Can have 0 or more stars before and after the board letter.\");\r\n\t\tSystem.out.println(\" -h Print this message.\");\r\n\t\tSystem.out.println(\" -q Quit interactive session.\");\r\n\t\tSystem.out.println(\" -n xx Display xx number of words.\");\r\n\t\tSystem.out.println(\" -n all Display all words.\");\r\n\t\tSystem.out.println(\" -r Repeat last search.\");\r\n\t\tSystem.out.println(\" -s len Words are sorted by length.\");\r\n\t\tSystem.out.println(\" -s alpha Words are sorted alphapetically.\");\r\n\t\t// System.out.println(\"\");\r\n\t}", "public void options(Collection<CliOption> options) {\n\t\tMultibinder<CliOption> optionsBinder = optionsBinder();\n\t\tPreconditions.checkNotNull(options).forEach(o -> optionsBinder.addBinding().toInstance(o));\n\t}", "public void createOptionsList() {\r\n int j;\r\n int i;\r\n String tempClassOptionsString = this.classOptionsString;\r\n while (tempClassOptionsString.length() > 0) {\r\n char cliChar = ' ';\r\n String optionValue = \"\";\r\n String str = \"\";\r\n tempClassOptionsString = tempClassOptionsString.trim();\r\n\r\n i = tempClassOptionsString.indexOf(\"-\");\r\n if (i >= 0) {\r\n cliChar = tempClassOptionsString.charAt(i + 1);\r\n tempClassOptionsString = tempClassOptionsString.substring(i + 2).trim();\r\n if (tempClassOptionsString.length() == 0) {\r\n optionValue = \"true\";\r\n Pair<String, String> optionPair = new Pair<String, String>(String.valueOf(cliChar), optionValue);\r\n this.outputClassOptions.add(optionPair);\r\n } else {\r\n if (tempClassOptionsString.charAt(0) == '-') {\r\n optionValue = \"true\";\r\n Pair<String, String> optionPair = new Pair<String, String>(String.valueOf(cliChar), optionValue);\r\n this.outputClassOptions.add(optionPair);\r\n } else if (tempClassOptionsString.charAt(0) == '(') {\r\n int openBracket = 0;\r\n int closeBracket = 0;\r\n StringBuffer temp = new StringBuffer(\"\");\r\n for (int k = 0; k < tempClassOptionsString.length(); k++) {\r\n char cTemp = tempClassOptionsString.charAt(k);\r\n temp.append(cTemp);\r\n switch (cTemp) {\r\n case '(': {\r\n openBracket += 1;\r\n break;\r\n }\r\n case ')': {\r\n closeBracket += 1;\r\n if (closeBracket == openBracket) {\r\n tempClassOptionsString = tempClassOptionsString.substring(k + 1).trim();\r\n optionValue = temp.toString().trim();\r\n optionValue = optionValue.substring(1, optionValue.length() - 1);\r\n Pair<String, String> optionPair = new Pair<String, String>(String.valueOf(cliChar), optionValue);\r\n this.outputClassObjectOptions.add(optionPair);\r\n optionsString subObject = new optionsString(optionValue);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n\r\n } else {\r\n j = tempClassOptionsString.indexOf(\" \");\r\n if (j > 0) {\r\n optionValue = tempClassOptionsString.substring(0, j);\r\n tempClassOptionsString = tempClassOptionsString.substring(j + 1).trim();\r\n Pair<String, String> optionPair = new Pair<String, String>(String.valueOf(cliChar), optionValue);\r\n this.outputClassOptions.add(optionPair);\r\n } else {\r\n optionValue = tempClassOptionsString;\r\n tempClassOptionsString = \"\";\r\n Pair<String, String> optionPair = new Pair<String, String>(String.valueOf(cliChar), optionValue);\r\n this.outputClassOptions.add(optionPair);\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n i = this.classFullName.lastIndexOf('.');\r\n if (i > 0) {\r\n this.classShortName = this.classFullName.substring(i + 1);\r\n } else\r\n this.classShortName = this.classFullName;\r\n }", "public BuilderOptions(String[][] options) {\r\n this.options = options;\r\n }", "public abstract String[] getOptions();", "public static void main(String[] ignored) {\n\t\tfinal String[] argv = new String[] {\n\n\t\t\t\t/* short options */\n\t\t\t\t\"-ab\",\n\t\t\t\t\"dd-argument\",\n\t\t\t\t\"-0\",\n\t\t\t\t\"-1\",\n\t\t\t\t\"-2\",\n\n\t\t\t\t/* long options */\n\t\t\t\t\"--add=123\",\n\t\t\t\t\"--append\",\n\t\t\t\t\"--delete-float=3.141952\",\n\t\t\t\t\"--delete-double=3.141952\",\n\t\t\t\t\"--verbose\",\n\t\t\t\t\"--create=789\",\n\t\t\t\t\"-c987\",\n\t\t\t\t\"--file=filename1\",\n\n\t\t\t\t/* non-option arguments */\n\t\t\t\t\"--\",\n\t\t\t\t\"hello\",\n\t\t\t\t\"there\",\n\t\t};\n\n\t\ttry {\n\n\t\t\t/* Two ways to build options, via create() method or using() */\n\t\t\tfinal Options options = new Options.Builder()\n\n\t\t\t\t\t/* Short options */\n\t\t\t\t\t.create(\"a\")\n\t\t\t\t\t.create(\"b\")\n\t\t\t\t\t.create(\"c\", int.class)\n\t\t\t\t\t.create(\"d\", String.class)\n\t\t\t\t\t.create(\"0\")\n\t\t\t\t\t.create(\"1\")\n\t\t\t\t\t.create(\"2\")\n\n\t\t\t\t\t.group('o', suboptions -> suboptions\n\t\t\t\t\t\t\t.create(\"ro\")\n\t\t\t\t\t\t\t.create(\"rw\")\n\t\t\t\t\t\t\t.create(\"name\", String.class))\n\n\t\t\t\t\t/* Long options */\n\t\t\t\t\t.using(Option.of(\"add\", int.class))\n\t\t\t\t\t.using(Option.of(\"append\"))\n\t\t\t\t\t.using(Option.of(\"delete-float\", float.class))\n\t\t\t\t\t.using(Option.of(\"delete-double\", double.class))\n\t\t\t\t\t.using(Option.of(\"verbose\"))\n\t\t\t\t\t.using(Option.of(\"create\", int.class))\n\t\t\t\t\t.using(Option.of(\"file\", String.class))\n\t\t\t\t\t.build();\n\n\t\t\t/* Handler be notified when option is matched */\n\t\t\tfinal Option<Integer> create = options.get(\"create\", int.class);\n\t\t\tcreate.onMatch(n -> System.out.printf(\"Creating new entry %d%n\", n));\n\n\t\t\t/* Setup and parse the command line arguments */\n\t\t\tfinal Args args = Args.of(argv, options);\n\n\t\t\t/* All matched options */\n\t\t\tSystem.out.println(\"-- Example 3:\");\n\t\t\tSystem.out.println(\"Matched options:\");\n\t\t\tfinal List<Option<?>> matched = options.getAllMatched();\n\t\t\tmatched.forEach(System.out::println);\n\n\t\t\t/* Anything that was unmatched by the parser is stored here */\n\t\t\tSystem.out.println(\"Unmatched args:\");\n\t\t\tfinal List<String> unmatched = args.getUnmatchedArgs();\n\t\t\tunmatched.forEach(System.out::println);\n\n\t\t\t/* 2 ways to work with user options: getOption or findMatched */\n\n\t\t\t/*\n\t\t\t * Find methods always return a java Optional. Unmatched option with no command\n\t\t\t * line match, the returned optional will be empty, otherwise the Optional will\n\t\t\t * have the option with the commanline arg/value.\n\t\t\t */\n\t\t\tfinal Optional<Option<Boolean>> a = options.findMatched(\"a\", boolean.class);\n\t\t\ta.ifPresent(opt -> System.out.println(\"Option A is found!\"));\n\n\t\t\t/* Get method will throw unchecked OptionNotFoundException if not found */\n\t\t\tfinal Option<Integer> add = options.get(\"add\", int.class);\n\t\t\tif (add.isMatched()) {\n\t\t\t\tSystem.out.printf(\"add this amount %d%n\", add.getValue());\n\t\t\t}\n\n\t\t} catch (UnrecognizedArgException | InvalidArgException e) {\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\n\t\t\tSystem.err.printf(\"Usage: %s [-a|-b|-0|-1|-2] [-c arg] [-d arg]%n\", \"Example3\");\n\t\t\tSystem.err.printf(\" \"\n\t\t\t\t\t+ \" [--add element]\"\n\t\t\t\t\t+ \" [--append]\"\n\t\t\t\t\t+ \" [--delete-float arg]\"\n\t\t\t\t\t+ \" [--delete-double arg]\"\n\t\t\t\t\t+ \" [--verbose]\"\n\t\t\t\t\t+ \" [--create arg]\"\n\t\t\t\t\t+ \" [--file arg]\"\n\t\t\t\t\t+ \"%n\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\t/*\n\t\t * Next step: Example 4 - working with beans\n\t\t * \n\t\t * A much easiest way to deal with many options is using the BeanOption API.\n\t\t * Example 4 demostrates its usage.\n\t\t */\n\t}", "private void printGoalOptions() {\n System.out.println(ANSI_PURPLE + \"CHOOSE YOUR GOALS: \" + ANSI_RESET);\n System.out.println(\"----------------------------------------------------------------------------------------------------------------\");\n System.out.println(\"1. I can be poor - I don't care about the money but I want to be as\" + ANSI_BLUE + \" happy and\" + ANSI_RESET + \" as\" + ANSI_BLUE + \" educated\" + ANSI_RESET + \" as possible.\");\n System.out.println(\"2. I want to be \" + ANSI_BLUE + \"rich and happy!\" + ANSI_RESET + \" I don't have to be educated at all.\");\n System.out.println(\"3. I want to be well \" + ANSI_BLUE + \"educated and \" + ANSI_RESET + \"I don't want be hungry ever again. Always \" + ANSI_BLUE + \"full!\" + ANSI_RESET + \" ;) \");\n System.out.println(\"4. I want to have the \" + ANSI_BLUE + \"best job\" + ANSI_RESET + \" possible and make\" + ANSI_BLUE + \" lots of money\" + ANSI_RESET + \" even if it will make me unhappy.\");\n System.out.println(\"----------------------------------------------------------------------------------------------------------------\");\n }", "public free_args setOptions(FreeTOptions options) {\n this.options = options;\n return this;\n }", "public String getOptionsAsString() {\n\t\tStringBuilder buf = new StringBuilder();\n\t\tfor (int i = 0; i <propertyKeys.size(); i++) {\n\t\t\tString key = propertyKeys.get(i);\n\t\t\tif (!runtimeKeys.get(i))\n buf.append(key + \" : \" + getOption(key)).append(\"\\r\\n\");\n\t\t}\n\t\tfor (int i = 0; i <propertyKeys.size(); i++) {\n\t\t\tString key = propertyKeys.get(i);\n\t\t\tif (runtimeKeys.get(i))\n buf.append(\"* \" + key + \" : \" + getOption(key)).append(\"\\r\\n\");\n\t\t}\n\t\treturn buf.toString();\n\t}", "private void displayOptions() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Main System Menu\");\n\t\tSystem.out.println(\"----------------\");\n\t\tSystem.out.println(\"A)dd polling place\");\n\t\tSystem.out.println(\"C)lose the polls\");\n\t\tSystem.out.println(\"R)esults\");\n\t\tSystem.out.println(\"P)er-polling-place results\");\n\t\tSystem.out.println(\"E)liminate lowest candidate\");\n\t\tSystem.out.println(\"?) display this menu of choices again\");\n\t\tSystem.out.println(\"Q)uit\");\n\t\tSystem.out.println();\n\t}", "public interactOption()\n\t{\n\t\tsuper();\n\t\toptionType = \"interact with the\";\n\t\toptionFocus = \"nothing\";\n\t\toptionText = optionType + \" \" + optionFocus;\n\t}", "private int handleOptions(String[] args) {\r\n\r\n int status = 0;\r\n\r\n if ((args == null) || (args.length == 0)) { return status; }\r\n\r\n for (int i = 0; i < args.length; i++) {\r\n if (status != 0) { return status; }\r\n\r\n if (args[i].equals(\"-h\")) {\r\n displayUsage();\r\n status = 1;\r\n } else if (args[i].equals(\"-d\") || args[i].equals(\"-discourse\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.discourseId = Long.parseLong(args[i]);\r\n if (discourseId < 0) {\r\n logger.error(\"Invalid discourse id specified: \" + args[i]);\r\n status = -1;\r\n }\r\n } catch (Exception exception) {\r\n logger.error(\"Error while trying to parse discourse id. \"\r\n + \"Please check the parameter for accuracy.\");\r\n throw new IllegalArgumentException(\"Invalid discourse id specified.\");\r\n }\r\n } else {\r\n logger.error(\"A discourse id must be specified with the -discourse argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-e\") || args[i].equals(\"-email\")) {\r\n setSendEmailFlag(true);\r\n if (++i < args.length) {\r\n setEmailAddress(args[i]);\r\n } else {\r\n logger.error(\"An email address must be specified with this argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-b\") || args[i].equals(\"-batchSize\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.batchSize = Integer.parseInt(args[i]);\r\n if (batchSize <= 0) {\r\n logger.error(\"The batch size must be greater than zero.\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } catch (NumberFormatException exception) {\r\n logger.error(\"Error while trying to parse batch size: \" + args[i]);\r\n throw new IllegalArgumentException(\"Invalid batch size specified.\");\r\n }\r\n } else {\r\n logger.error(\"A batch size must be specified with the -batchSize argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n } else if (args[i].equals(\"-p\") || args[i].equals(\"-project\")) {\r\n if (++i < args.length) {\r\n try {\r\n this.projectId = Integer.parseInt(args[i]);\r\n if (projectId < 0) {\r\n logger.error(\"Invalid project id specified: \" + args[i]);\r\n status = -1;\r\n }\r\n } catch (Exception exception) {\r\n logger.error(\"Error while trying to parse project id. \"\r\n + \"Please check the parameter for accuracy.\");\r\n throw new IllegalArgumentException(\"Invalid project id specified.\");\r\n }\r\n } else {\r\n logger.error(\"A project id must be specified with the -project argument\");\r\n displayUsage();\r\n status = -1;\r\n }\r\n }\r\n }\r\n\r\n return status;\r\n }", "public void addOption(char _argShort, String _description, boolean _argReq, boolean _valReq) {\r\n\t\tCliOptStruct opt = new CliOptStruct(_argShort, \" \", _description, _argReq, _valReq);\r\n\t\topts.add(opt);\r\n\t}", "public static void showUsage() {\n System.out.println(\"Usage:\");\n System.out.println(\"java -jar jira-changelog-builder.jar <JIRA_URL> <JIRA_username> <JIRA_password> <JIRA_project_key> <version> <template_list> [<flags>]\");\n System.out.println(\"<JIRA_URL>: The URL of the JIRA instance (e.g. https://somecompany.atlassian.net).\");\n System.out.println(\"<JIRA_username>: The username used to log into JIRA.\");\n System.out.println(\"<JIRA_password>: The password used to log into JIRA.\");\n System.out.println(\"<JIRA_project_key>: The key of the project in JIRA.\");\n System.out.println(\"<version>: Specifies up to which version the changelog should be generated.\");\n System.out.println(\"<template_root>: The path on disk to the directory that contains the template files.\");\n System.out.println(\"<template_list>: A CSV list of template file names. Each templated changelog is saved into a new file which can be processed at a later stage.\");\n System.out.println(\"<flags> (optional): One or more of the following flags:\");\n // TODO: If this JQL causes no issues to be returned, it causes a hard\n // error. Handle this more nicely.\n System.out.println(\"\\t--jql 'some arbitrary JQL': Append the given JQL to the issue filter. eg 'status = \\\"Ready for Build\\\"'\");\n System.out.println(\"\\t--object-cache-path /some/path: The path on disk to the cache, if you do not use this, no cache will be used. Using a cache is highly recommended.\");\n System.out.println(\"\\t--debug: Print debug/logging information to standard out. This will also force errors to go to the standard out and exit with code 0 rather than 1.\");\n System.out.println(\"\\t--changelog-description-field 'field_name': The name of the field in JIRA you wish to use as the changelog description field. If you do not use this, it will default to the summary field.\");\n System.out.println(\"\\t--eol-style (NATIVE|CRLF|LF): The type of line endings you wish the changelog files to use. Valid values are NATIVE (system line endings), CRLF (Windows line endings) or LF (UNIX line endings). If you do not use this, the changelogs will use the default system line endings.\");\n System.out.println(\"\\t--version-starts-with 'Version name prefix': Only display versions in the changelog that have a name starting with 'Version name prefix'. This cannot be used with --version-less-than-or-equal. This is useful for restricting what goes in the changelog if you are producing different version side-by-side.\");\n System.out.println(\"\\t--version-less-than-or-equal 'Version name': Only display versions in the changelog that have a name less than or equal to 'Version name'. This cannot be used with --version-starts-with. This uses a Java string comparison. This is useful for restricting what goes in the changelog if you are producing different version side-by-side.\");\n }", "public static void setHelpArgs(String text)\n\t{\n\t\tsetHelpArgs(last[0], last[1], text);\n\t}", "private static void appendOptions(StringBuilder argumentBuf,\n List<String> optList, Map<String, String> varMap) {\n final boolean isWindows = OsUtils.isWin();\n final String METHOD = \"appendOptions\"; // NOI18N\n // override the values that are found in the domain.xml file.\n // this is totally a copy/paste from StartTomcat...\n final Map<String,String> PROXY_PROPS = new HashMap<>();\n for(String s: new String[] {\n \"http.proxyHost\", // NOI18N\n \"http.proxyPort\", // NOI18N\n \"http.nonProxyHosts\", // NOI18N\n \"https.proxyHost\", // NOI18N\n \"https.proxyPort\", // NOI18N\n }) {\n PROXY_PROPS.put(JavaUtils.systemPropertyName(s), s);\n PROXY_PROPS.put(\"-D\\\"\" + s, s); // NOI18N\n PROXY_PROPS.put(\"-D\" + s, s); // NOI18N\n }\n\n // first process optList aquired from domain.xml \n for (String opt : optList) {\n String name, value;\n // do placeholder substitution\n opt = Utils.doSub(opt.trim(), varMap);\n int splitIndex = opt.indexOf('=');\n // && !opt.startsWith(\"-agentpath:\") is a temporary hack to\n // not touch already quoted -agentpath. Later we should handle it\n // in a better way.\n if (splitIndex != -1 && !opt.startsWith(\"-agentpath:\")) { // NOI18N\n // key=value type of option\n name = opt.substring(0, splitIndex);\n value = Utils.quote(opt.substring(splitIndex + 1));\n LOGGER.log(Level.FINER, METHOD,\n \"jvmOptVal\", new Object[] {name, value});\n\n } else {\n name = opt;\n value = null;\n LOGGER.log(Level.FINER, METHOD, \"jvmOpt\", name); // NOI18N\n }\n\n if(PROXY_PROPS.containsKey(name)) {\n String sysValue = System.getProperty(PROXY_PROPS.get(name));\n if (sysValue != null && sysValue.trim().length() > 0) {\n if (isWindows && \"http.nonProxyHosts\".equals(PROXY_PROPS.get(name))) { // NOI18N\n // enclose in double quotes to escape the pipes separating\n // the hosts on windows\n sysValue = \"\\\"\" + value + \"\\\"\"; // NOI18N\n }\n name = JavaUtils.systemPropertyName(PROXY_PROPS.get(name));\n value = sysValue;\n }\n }\n\n argumentBuf.append(' ');\n argumentBuf.append(name);\n if(value != null) {\n argumentBuf.append(\"=\"); // NOI18N\n argumentBuf.append(value);\n }\n }\n }", "public Options() {\n init();\n }", "private void displayMenuOptions()\n {\n // display user options menu\n System.out.println(\"\");\n System.out.println(\"----------------------------------------------------\");\n System.out.println(\"\");\n System.out.println(\"COMMAND OPTIONS:\");\n System.out.println(\"\");\n System.out.println(\" 'on' to force power controller to ON state\");\n System.out.println(\" 'off' to force power controller to OFF state\");\n System.out.println(\" 'status' to see current power controller state\");\n System.out.println(\" 'sunrise' to display sunrise time.\");\n System.out.println(\" 'sunset' to display sunset time.\");\n System.out.println(\" 'next' to display next scheduled event.\");\n System.out.println(\" 'time' to display current time.\");\n System.out.println(\" 'coord' to display longitude and latitude.\");\n System.out.println(\" 'help' to display this menu.\");\n System.out.println(\"\");\n System.out.println(\"PRESS 'CTRL-C' TO TERMINATE\");\n System.out.println(\"\");\n System.out.println(\"----------------------------------------------------\");\n System.out.println(\"\");\n }", "@Test\n\tpublic void testHelpOption()\n\t{\n\t\tPrintStream outBkp = System.out;\n\t\tByteArrayOutputStream outBuf = new ByteArrayOutputStream ();\n\t\tSystem.setOut ( new PrintStream ( outBuf ) );\n\n\t\tApp.main ( \"--help\" );\n\t\t\n\t\tSystem.setOut ( outBkp ); // restore the original output\n\n\t\tlog.debug ( \"CLI output:\\n{}\", outBuf.toString () );\n\t\tassertTrue ( \"Can't find CLI output!\", outBuf.toString ().contains ( \"*** Command Line Example ***\" ) );\n\t\tassertEquals ( \"Bad exit code!\", 1, App.getExitCode () );\n\t}", "public static void main(String[]args) {\n\t\n\t \n\tArgsHandler handler = new ArgsHandler(args);\n if (!handler.empty()) {\n handler.execute();\n }\n \n final int exit = 0;\n final int setValues = 1;\n final int getValues = 2;\n final int execute2 = 3;\n final int printResult = 4;\n String word = null;\n \n /**\n * Our dialog menu with checking of input argumet's of program \n */\n do {\n UI.mainMenu();\n UI.enterChoice();\n switch (UI.getChoice()) {\n case exit:\n if (ArgsHandler.isDebug()) {\n System.out.println(\"\\nYou chosen 0. Exiting...\");\n System.out.format(\"%n############################################################### DEBUG #############################################################\");\n }\n break;\n case setValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 1. Setting values...\");\n }\n word = UI.enterValues();\n break;\n case getValues:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 2. Getting values...\");\n }\n if (word != null ) {\n UI.printText(word);\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break; \n case execute2:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.println(\"\\nYou chosen 3. Executing task...\");\n }\n if (word != null) {\n \t final String []lines = NewHelper.DivString(word);\n \t System.out.println(\"\\nTask done...\");\n \t if (ArgsHandler.isDebug()) {\n \t System.out.format(\"%n############################################################### DEBUG #############################################################\");\n \t }\n } else {\n System.out.format(\"%nFirst you need to add values.\");\n }\n break;\n case printResult:\n if (ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n System.out.format(\"%nYou chosen 4. \"\n + \"Printing out result...%n\");\n }\n if (word != null) {\n \tfinal String[] lines2 = NewHelper.DivString(word);\n \tfor (final String line2 : lines2) {\n NewHelper.printSymbols(line2);\n NewHelper.printSymbolNumbers(line2);\n \t}\n \tif(ArgsHandler.isDebug()) {\n \tSystem.out.format(\"%n############################################################### DEBUG #############################################################\");\n } \n \telse {\n System.out.format(\"%nFirst you need to add values.\"); \n }\n break;\n }\n default:\n System.out.println(\"\\nEnter correct number.\");\n }\n } while (UI.getChoice() != 0);\n}", "@Override\r\n public String getUsage() {\r\n return String.format(\"%s <%s> %s%s <%s>\", super.getCommand(), super.getArgumentName(), FLAG_PREFIX, flagOption,\r\n flagName);\r\n }", "public String toCmdLine() {\n\t\tif( Utils.isEmpty(value) ) {\n\t\t\treturn prefix + name;\n\t\t}\n\t\t\n\t\t/*\n\t\t * check \n\t\t */\n\t\tStringBuilder result = new StringBuilder();\n\t\tfor( String v : getAll() ) {\n\t\t\tif( result.length()>0 ) result.append(\" \");\n\t\t\tresult\n\t\t\t\t.append(prefix) \n\t\t\t\t.append(name)\n\t\t\t\t.append(separator)\n\t\t\t\t.append(v);\n\t\t}\n\t\t\n\t\treturn result.toString();\n\t}", "protected Set<ValidOption> usageOptions() {\n Set<ValidOption> opts = new LinkedHashSet<ValidOption>();\n addOption(opts, \"printprompt\", '\\0', \"BOOLEAN\", false,\n Boolean.toString(programOpts.isInteractive()));\n opts.addAll(commandOpts);\n opts.remove(printPromptOption);\n return opts;\n }", "@Test public void completeUsage() {\n\t\tfinal String[] args = new String[]{\"-verbose\", \"-speed\", \"4\", \"-filter\", \"a\", \"-filter\", \"b\", \"x\", \"y\", \"z\"};\n\t\tfinal CliActuators actuators = parser.parse(args, OPTIONS);\n\t\t// -verbose\n\t\tAssert.assertNotNull(actuators.getActuatorById(\"verbose\"));\n\t\t// -speed\n\t\tAssert.assertEquals(\"4\", actuators.getActuatorById(\"speed\").getValue());\n\t\t// -filter\n\t\tfinal CliActuator filter = actuators.getActuatorById(\"filter\");\n\t\tfinal List<String> filters = filter.getValues();\n\t\tAssert.assertEquals(2, filters.size());\n\t\tAssert.assertEquals(\"a\", filters.get(0));\n\t\tAssert.assertEquals(\"b\", filters.get(1));\n\t\t// rests\n\t\tfinal List<String> rests = actuators.getRests();\n\t\tAssert.assertEquals(3, rests.size());\n\t\tAssert.assertEquals(\"x\", rests.get(0));\n\t\tAssert.assertEquals(\"y\", rests.get(1));\n\t\tAssert.assertEquals(\"z\", rests.get(2));\n\t}", "private void printHelp(Options options) {\n\t\tHelpFormatter formatter = new HelpFormatter();\r\n\t\tString header = \"CLI for Message Counter program\\n\\n\";\r\n\t\tString footer = \"End of the help\\n\";\r\n\t\tformatter.printHelp(\"ChatCounter\", header, options, footer, true);\r\n\t}", "@Override\n\tpublic String[] getOptions() {\n\t\tVector<String> result = new Vector<String>();\n\n\t\tresult.add(\"-populationSize\");\n\t\tresult.add(\"\" + populationSize);\n\n\t\tresult.add(\"-initialMaxDepth\");\n\t\tresult.add(\"\" + maxDepth);\n\n\t\tCollections.addAll(result, super.getOptions());\n\n\t\treturn result.toArray(new String[result.size()]);\n\t}", "public Args(String ... args) {\n CommandLineParser parser = new DefaultParser();\n Options options = new Options();\n options.addOption(\"d\", true, \"search directory\");\n Option maskOption = new Option(\"n\", true, \"list of filename masks\");\n maskOption.setArgs(Option.UNLIMITED_VALUES);\n options.addOption(maskOption);\n OptionGroup maskModeOptionGroup = new OptionGroup();\n maskModeOptionGroup.addOption(new Option(\"m\", false,\n \"maximum coincidence of file name and search key\"));\n maskModeOptionGroup.addOption(new Option(\"f\", false,\n \"full coincidence of file name and search key\"));\n maskModeOptionGroup.addOption(new Option(\"r\", false,\n \"search key - is a regular expression\"));\n options.addOptionGroup(maskModeOptionGroup);\n ArrayList<Option> maskModeOptions = new ArrayList<>(maskModeOptionGroup.getOptions());\n boolean maskModeOptionsIsGiven = false;\n options.addOption(\"o\", true, \"full output log-file path\");\n options.addOption(\"help\", false, \"Print help\");\n try {\n CommandLine line = parser.parse(options, args);\n if (line.hasOption(\"help\")) {\n new HelpFormatter().printHelp(\"Find\", options);\n System.exit(0);\n } else {\n if (line.hasOption(\"d\")) {\n this.directory = line.getOptionValue(\"d\");\n }\n if (line.hasOption(\"o\")) {\n this.output = line.getOptionValue(\"o\");\n }\n if (line.hasOption(\"n\")) {\n String[] masks = line.getOptionValues(\"n\");\n for (String mask : masks) {\n this.maskList.add(mask);\n }\n }\n for (Option option : maskModeOptions) {\n if (line.hasOption(option.getOpt())) {\n this.maskMode = option.getOpt();\n maskModeOptionsIsGiven = true;\n break;\n }\n }\n if (!line.hasOption(\"d\") || !line.hasOption(\"n\") || !line.hasOption(\"o\") || !maskModeOptionsIsGiven) {\n throw new ParseException(\"Missing option\");\n }\n }\n } catch (ParseException exp) {\n System.out.println(\"Unexpected exception during command line parsing occured: \" + exp.getMessage());\n new HelpFormatter().printHelp(\"Find\", options);\n System.exit(0);\n }\n }", "private static String printOptionalArgs() {\n String output = \"\";\n for (int i = 0; i < MAX_OPTIONAL_ARGS; i++)\n output += \" [-\" + VALID_OPTIONAL_ARGS[i] + \"]\";\n return output + \" \";\n }", "public void showHelp() {\n\tString shortFormat = \"%16s -- %-20s %n\";\n\tString longFormat = \"%16s -- %-40s %n\";\n System.out.printf(shortFormat, \"ls\", \"list matched tariffs\");\n System.out.printf(shortFormat, \"ls all\", \"list all tariffs\");\n System.out.printf(shortFormat, \"clear\", \"reset filters\");\n System.out.printf(shortFormat, \"exit\", \"exit the program\");\n System.out.printf(longFormat, \"field min max\",\n \"filter tariffs with field having\"\n + \"value between min and max\");\n System.out.println(\"\\nList of available fields:\\n\");\n filterCommands.stream().forEach(System.out::println);\n }", "private Options() {\n }", "private static void printUsage()\n {\n StringBuilder usage = new StringBuilder();\n usage.append(String.format(\"semantika %s [OPTIONS...]\\n\", Environment.QUERYANSWER_OP));\n usage.append(\" (to execute query answer)\\n\");\n usage.append(String.format(\" semantika %s [OPTIONS...]\\n\", Environment.MATERIALIZE_OP));\n usage.append(\" (to execute RDB2RDF export)\");\n String header = \"where OPTIONS include:\"; //$NON-NLS-1$\n String footer =\n \"\\nExample:\\n\" + //$NON-NLS-1$\n \" ./semantika queryanswer -c application.cfg.xml -l 100 -sparql 'SELECT ?x WHERE { ?x a :Person }'\\n\" + //$NON-NLS-1$\n \" ./semantika rdb2rdf -c application.cfg.xml -o output.n3 -f N3\"; //$NON-NLS-1$\n mFormatter.setOptionComparator(null);\n mFormatter.printHelp(400, usage.toString(), header, sOptions, footer);\n }", "protected CLOptionDescriptor[] createCLOptions()\n {\n //TODO: localise\n final CLOptionDescriptor options[] = new CLOptionDescriptor[ 13 ];\n\n options[0] =\n new CLOptionDescriptor( \"help\",\n CLOptionDescriptor.ARGUMENT_DISALLOWED,\n HELP_OPT,\n \"display this help message\",\n INFO_OPT_INCOMPAT );\n \n options[1] =\n new CLOptionDescriptor( \"file\",\n CLOptionDescriptor.ARGUMENT_REQUIRED,\n FILE_OPT,\n \"the build file.\" );\n\n options[2] =\n new CLOptionDescriptor( \"log-level\",\n CLOptionDescriptor.ARGUMENT_REQUIRED,\n LOG_LEVEL_OPT,\n \"the verbosity level at which to log messages. \" +\n \"(DEBUG|INFO|WARN|ERROR|FATAL_ERROR)\",\n LOG_OPT_INCOMPAT );\n\n options[3] =\n new CLOptionDescriptor( \"quiet\",\n CLOptionDescriptor.ARGUMENT_DISALLOWED,\n QUIET_OPT,\n \"equivelent to --log-level=FATAL_ERROR\",\n LOG_OPT_INCOMPAT );\n\n options[4] =\n new CLOptionDescriptor( \"verbose\",\n CLOptionDescriptor.ARGUMENT_DISALLOWED,\n VERBOSE_OPT,\n \"equivelent to --log-level=INFO\",\n LOG_OPT_INCOMPAT );\n\n options[5] =\n new CLOptionDescriptor( \"listener\",\n CLOptionDescriptor.ARGUMENT_REQUIRED,\n LISTENER_OPT,\n \"the listener for log events.\" );\n\n options[6] =\n new CLOptionDescriptor( \"version\",\n CLOptionDescriptor.ARGUMENT_DISALLOWED,\n VERSION_OPT,\n \"display version\",\n INFO_OPT_INCOMPAT );\n\n options[7] =\n new CLOptionDescriptor( \"bin-dir\",\n CLOptionDescriptor.ARGUMENT_REQUIRED,\n BIN_DIR_OPT,\n \"the listener for log events.\" );\n\n options[8] =\n new CLOptionDescriptor( \"lib-dir\",\n CLOptionDescriptor.ARGUMENT_REQUIRED,\n LIB_DIR_OPT,\n \"the lib directory to scan for jars/zip files.\" );\n\n options[9] =\n new CLOptionDescriptor( \"task-lib-dir\",\n CLOptionDescriptor.ARGUMENT_REQUIRED,\n TASKLIB_DIR_OPT,\n \"the task lib directory to scan for .tsk files.\" );\n options[10] =\n new CLOptionDescriptor( \"incremental\",\n CLOptionDescriptor.ARGUMENT_DISALLOWED,\n INCREMENTAL_OPT,\n \"Run in incremental mode\" );\n options[11] =\n new CLOptionDescriptor( \"ant-home\",\n CLOptionDescriptor.ARGUMENT_REQUIRED,\n HOME_DIR_OPT,\n \"Specify ant home directory\" );\n options[12] =\n new CLOptionDescriptor( \"define\",\n CLOptionDescriptor.ARGUMENTS_REQUIRED_2,\n DEFINE_OPT,\n \"Define a variable (ie -Dfoo=var)\" );\n return options;\n }", "public GetOpt(String [] sargs, String flags) throws BadOptException {\n\tint size = sargs.length;\n\n\ttry {\n\t StringReader sreader = new StringReader(flags);\n\t for (int i = 0; i < flags.length(); i++) {\n\t\tint opt = sreader.read();\n\t\t\n\t\tif (opt == ':')\n\t\t ((OptPair) optlist.elementAt(optlist.size() - 1)).bool = false;\n\t\telse\n\t\t optlist.add(new OptPair((char) opt, true));\n\t }\n\t \n\t sreader.close();\n\t} catch (IOException e) {\n\t System.err.println(\"Bizarre error situation!\");\n\t throw new BadOptException(\"I/O problem encountered manipulating strings with a StringReader!\");\n\t}\n\n\t//\tfor (int i = 0; i < optlist.size(); i++)\n\t//\t System.out.println(optlist.elementAt(i));\n\n\tfor (int i = 0; i < sargs.length; i++) {\n\t if (sargs[i].startsWith(\"-\")) {\n\t\ttry {\n\t\t StringReader sreader = new StringReader(sargs[i].substring(1));\n\n\t\t int opt = -1;\n\t\t while ((opt = sreader.read()) != -1) {\n\t\t\tboolean found = false;\n\t\t\tboolean bool = true;\n\t\t\tfor (int j = 0; j < optlist.size(); j++) {\n\t\t\t OptPair temp = (OptPair) optlist.elementAt(j);\n\t\t\t if (temp.option == (char) opt) {\n\t\t\t\tfound = true;\n\t\t\t\tbool = temp.bool;\n\t\t\t\tbreak;\n\t\t\t }\n\t\t\t}\n\n\t\t\tif (found) {\n\t\t\t opts.add(new Character((char) opt));\n\t\t\t if (!bool) {\n\t\t\t\targs.add(sargs[++i]);\n\t\t\t\tbreak;\n\t\t\t }\n\t\t\t} else {\n\t\t\t throw new BadOptException((char) opt + \": is an invalid switch option.\");\n\t\t\t}\n\t\t }\n\t\t} catch (IOException e) {\n\t\t System.err.println(\"Bizarre error situation!\");\n\t\t throw new BadOptException(\"I/O problem encountered manipulating strings with a StringReader!\");\n\t\t}\n\t } else {\n\t\tparams.add(sargs[i]);\n\t }\n\t}\n }", "public static void help() {\n\n\t\tSystem.out.println(\"--help--Input format should be as below\" + \n\t\t \"\\njava -jar passgen.jar -l\" + \n\t\t\t\t \"\\n\" +\n\t\t\t\t \"\\njava -jar passgen.jar -l\" + \"\\n(where l= length of password)\" + \n\t\t\t\t \"\\n\");\n\n\t}", "void initialize(int options) {\n\n\t}", "private static void help() {\n System.out.println(\"usage: pgen <project name> <args>\");\n System.out.println(\"Arguments:\");\n System.out.println(\"\\t-h | -help : help menu\");\n System.out.println(\"\\t-s | -size <example file amount> : the amount of example files to create. Defaults to 2\");\n System.out.println(\"\\t-t | -template <template> : the template to use. Defaults to java_default\");\n System.out.println(\"\\t\\tValid Templates:\");\n System.out.println(\"\\t\\t\\t* java_default\");\n System.out.println(\"\\t\\t\\t* cpp_default\");\n System.out.println(\"\\t-kattis : fetches the problems from Kattis and creates a makefile and test script for them\");\n System.out.println(\"\\t-local : fetches nothing and creates empty example files\");\n System.exit(0);\n }", "public void testOptions() {\n OptionsOperator optionsOper = OptionsOperator.invoke();\n optionsOper.selectEditor();\n optionsOper.selectFontAndColors();\n optionsOper.selectKeymap();\n optionsOper.selectGeneral();\n // \"Manual Proxy Setting\"\n String hTTPProxyLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Use_HTTP_Proxy\");\n new JRadioButtonOperator(optionsOper, hTTPProxyLabel).push();\n // \"HTTP Proxy:\"\n String proxyHostLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Proxy_Host\");\n JLabelOperator jloHost = new JLabelOperator(optionsOper, proxyHostLabel);\n new JTextFieldOperator((JTextField) jloHost.getLabelFor()).setText(\"www-proxy.uk.oracle.com\"); // NOI18N\n // \"Port:\"\n String proxyPortLabel = Bundle.getStringTrimmed(\n \"org.netbeans.core.ui.options.general.Bundle\", \"CTL_Proxy_Port\");\n JLabelOperator jloPort = new JLabelOperator(optionsOper, proxyPortLabel);\n new JTextFieldOperator((JTextField) jloPort.getLabelFor()).setText(\"80\"); // NOI18N\n optionsOper.ok();\n }" ]
[ "0.7036943", "0.6833003", "0.6600267", "0.65545976", "0.6430836", "0.63731295", "0.6313198", "0.62401944", "0.6192392", "0.61556387", "0.61287147", "0.6015014", "0.5992966", "0.5987039", "0.5985313", "0.5973032", "0.592113", "0.5911385", "0.5849541", "0.5812015", "0.5811994", "0.58100134", "0.5798126", "0.5768036", "0.5742788", "0.5741025", "0.5739999", "0.57396084", "0.5735018", "0.5687836", "0.5679809", "0.5635568", "0.5632359", "0.5616208", "0.5609622", "0.5582953", "0.55672383", "0.5566074", "0.55627763", "0.55603766", "0.55549675", "0.5540335", "0.551802", "0.55178136", "0.54960126", "0.5495358", "0.5490671", "0.5477596", "0.5476925", "0.5474989", "0.5469464", "0.54634684", "0.544236", "0.54400676", "0.5437534", "0.5429589", "0.5412344", "0.5407451", "0.54063153", "0.54058206", "0.5405809", "0.53640515", "0.5354347", "0.5339696", "0.5337025", "0.5333381", "0.5310824", "0.5310578", "0.53084755", "0.53025454", "0.53015417", "0.53", "0.5299913", "0.5296188", "0.52825224", "0.5272321", "0.5266737", "0.5260479", "0.52553594", "0.5247862", "0.5244591", "0.52410316", "0.52350605", "0.52346224", "0.5233265", "0.5223005", "0.5222876", "0.5221506", "0.52175957", "0.521285", "0.5209812", "0.5194859", "0.5186732", "0.5180148", "0.5176653", "0.51758754", "0.51709986", "0.5159665", "0.5152151", "0.51438224" ]
0.60469323
11
Parses the actual input and shows help, if requested
public static CommandLine prepCli( Options knowsCliDtd, String[] args, ResourceBundle rbm ) { CommandLineParser cliRegex = new DefaultParser(); CommandLine userInput = null; try { userInput = cliRegex.parse( knowsCliDtd, args ); if ( userInput.hasOption( helpFlagS ) || userInput.hasOption( helpFlagLong ) ) { new HelpFormatter().printHelp( "Note Enojes", knowsCliDtd ); } } catch ( ParseException pe ) { MessageFormat problem = new MessageFormat( rbm.getString( rbKeyCliParse ) ); System.err.println( problem.format( new Object[]{ cl +"pc", pe } ) ); } return userInput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private SlackerOutput handleHelp() {\n logger.debug(\"Handling help request\");\n List<WorkflowMetadata> metadata = registry.getWorkflowMetadata();\n Collections.sort(metadata, new Comparator<WorkflowMetadata>() {\n @Override\n public int compare(WorkflowMetadata m1, WorkflowMetadata m2) {\n String p1 = StringUtils.join(m1.getPath(), \"::\");\n String p2 = StringUtils.join(m2.getPath(), \"::\");\n return p1.compareTo(p2);\n }\n });\n StringBuilder sb = new StringBuilder(\"I can understand:\\n\");\n for (WorkflowMetadata wm : metadata) {\n sb.append(StringUtils.join(wm.getPath(), \" \"))\n .append(\" \")\n .append(trimToEmpty(wm.getArgsSpecification()))\n .append(\"\\n\").append(\" \")\n .append(trimToEmpty(wm.getName()))\n .append(\" - \").append(trimToEmpty(wm.getDescription()))\n .append(\"\\n\");\n }\n return new TextOutput(sb.toString());\n }", "public static void help() {\n\n\t\tSystem.out.println(\"--help--Input format should be as below\" + \n\t\t \"\\njava -jar passgen.jar -l\" + \n\t\t\t\t \"\\n\" +\n\t\t\t\t \"\\njava -jar passgen.jar -l\" + \"\\n(where l= length of password)\" + \n\t\t\t\t \"\\n\");\n\n\t}", "@Override\r\n public void getInput() { \r\n \r\n String command;\r\n Scanner inFile = new Scanner(System.in);\r\n \r\n do {\r\n \r\n this.display();\r\n \r\n command = inFile.nextLine();\r\n command = command.trim().toUpperCase();\r\n \r\n switch (command) {\r\n case \"B\":\r\n this.helpMenuControl.displayBoardHelp();\r\n break;\r\n case \"C\":\r\n this.helpMenuControl.displayComputerPlayerHelp();\r\n break;\r\n case \"G\":\r\n this.helpMenuControl.displayGameHelp();\r\n break; \r\n case \"Q\": \r\n break;\r\n default: \r\n new Connect4Error().displayError(\"Invalid command. Please enter a valid command.\");\r\n }\r\n } while (!command.equals(\"Q\")); \r\n }", "private static void help() {\n HelpFormatter formater = new HelpFormatter();\n formater.printHelp(\"SGD-SVM\", options);\n System.exit(0);\n }", "private static void DisplayHelp() {\r\n System.out.println();\r\n System.out.println(\"Usage: Consumes messages from a topic/queue\");\r\n System.out.println();\r\n System.out.println(\" SampleConsumerJava [ < response_file ]\");\r\n System.out.println();\r\n return;\r\n }", "private void help() {\n HelpFormatter formater = new HelpFormatter();\n\n formater.printHelp(\"Main\", options);\n System.exit(0);\n }", "private void helpService() {\n output.println(\"Help command\");\n output.println(\"-calc <number> \\t Calculates the value of pi based on <number> points; quit \\t Exit from program \");\n }", "private static void help() {\n\t\tHelpFormatter formater = new HelpFormatter();\n\t\tformater.printHelp(\"Main\", options);\n\t\tSystem.exit(0);\n\t}", "void printHelp();", "public HelpCommand(String input) {\n super(input);\n initialise();\n }", "public void showHelp();", "private void printHelp() \n {\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "private void help() {\n usage(0);\n }", "public static void help() {\n\tSystem.out.println(\"-- Avaible options --\");\n\tSystem.out.println(\"-- [arg]: Required argument\");\n\tSystem.out.println(\"-- {arg}: Optional argument\");\n\tSystem.out.println(\"* -s {file} Save the game into a file\");\n\tSystem.out.println(\"* -r {file} Play or Replay a game from a file\");\n\tSystem.out.println(\"* -a [file] Play a binary file or a game file\");\n\tSystem.out.println(\"* -n [file] Create a random game file\");\n\tSystem.out.println(\"* -t [size] Specify the size of the board\");\n\tSystem.out.println(\"* -k Solve the game with the IA solver\");\n\tSystem.out.println(\"* -m Solve the game with the MinMax/AlphaBeta algorithm\");\n\tSystem.out.println(\"----------------------------------------------\");\n\tSystem.out.println(\". Press Enter to Start or Restart\");\n\tSystem.out.println(\". Press Z to Undo the last move\");\n\tSystem.out.println(\"\");\n }", "void doHelp() throws AmbiguousException\n\t{\n // someone entered a help command so let's help them!\n\t\tString topic = \"help\"; //$NON-NLS-1$\n\n int cmd;\n String commandName;\n\n // they might have entered something like \"help br\"\n if (hasMoreTokens())\n\t\t{\n\t\t\t// map \"br\" to CMD_BREAK\n cmd = commandFor(nextToken());\n // and then back to \"break\"\n commandName = commandNumberToCommandName(g_commandArray, cmd);\n // so we'll look up the topic named \"break\" in fdbhelp*.txt\n topic = commandName;\n\n // they might have entered something like \"help inf fil\"\n if (cmd == CMD_INFO && hasMoreTokens())\n {\n // map \"fil\" to CMD_INFO_FILE\n cmd = infoCommandFor(nextToken());\n // and then back to \"file\"\n commandName = commandNumberToCommandName(g_infoCommandArray, cmd);\n // so we'll look up the topic named \"info file\" in fdbhelp*.txt\n topic += \" \" + commandName; //$NON-NLS-1$\n }\n\n // or like \"help sho n\"\n else if (cmd == CMD_SHOW && hasMoreTokens())\n {\n // map \"n\" to CMD_SHOW_NET\n cmd = showCommandFor(nextToken());\n // and then back to \"net\"\n commandName = commandNumberToCommandName(g_showCommandArray, cmd);\n // so we'll look up the topic named \"show net\" in fdbhelp*.txt\n topic += \" \" + commandName; //$NON-NLS-1$\n }\n\t\t}\n\n\t\tout( getHelpTopic(topic) );\n\t}", "private void handleInput()\n {\n String instructions = \"Options:\\n<q> to disconnect\\n<s> to set a value to the current time\\n<p> to print the map contents\\n<?> to display this message\";\n System.out.println(instructions);\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n while (true) {\n String line = br.readLine();\n if (line.equals(\"q\")) {\n System.out.println(\"Closing...\");\n break;\n } else if (line.equals(\"s\")) {\n System.out.println(\"setting value cli_app to current time\");\n collabMap.set(\"cli_app\", System.currentTimeMillis());\n } else if (line.equals(\"?\")) {\n System.out.println(instructions);\n } else if (line.equals(\"p\")) {\n System.out.println(\"Map contents:\");\n for (String key : collabMap.keys()) {\n System.out.println(key + \": \" + collabMap.get(key));\n }\n }\n }\n } catch (Exception ex) {\n }\n\n if (document != null)\n document.close();\n System.out.println(\"Closed\");\n }", "private void printHelp()//Method was given\n {\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "public void callHelp() {\n System.out.println(\"Enter emergency number: \");\n String emergencyNeed = input.nextLine();\n this.emergencyNeed = emergencyNeed;\n if (emergencyNeed.equals(police)) {\n System.out.println(\"Calling for police!\");\n }\n else if (emergencyNeed.equals(fire)) {\n System.out.println(\"Calling for fire department!\");\n }\n else if (emergencyNeed.equals(emt)) {\n System.out.println(\"Calling for emt!\");\n }\n else {\n System.out.println(\"Invalid emergency number.\");\n }\n }", "public abstract void printHelp(List<String> args);", "void help() {\n // FIXME\n try {\n FileReader help = new FileReader(\"loa/Help.txt\");\n Scanner helpPls = new Scanner(help);\n while (helpPls.hasNextLine()) {\n System.out.println(helpPls.nextLine());\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"Help file not found.\");\n }\n\n }", "public void startInfo() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Enter your name:\");\n\t\tString name = this.getInputString();\n\t\tSystem.out.println(\"Enter your mobile number:\");\n\t\tint number = this.getInputInteger();\n\t\tSystem.out.println(\"Enter your email:\");\n\t\tString email = this.getInputString();\n\t}", "private int help(Integer parameterIndex) throws ExceptionMalformedInput\n {\n System.out.println(\"usage: \");\n\n Field[] fieldList = this.getClass().getFields();\n\n for (Field field : fieldList)\n {\n if (!field.getName().startsWith(USER_OPTION_FIELD_NAME))\n continue;\n\n try\n {\n String attributeName = (String) field.get(this);\n String fieldName = USER_HELP_FIELD_NAME + field.getName().substring(USER_OPTION_FIELD_NAME.length()); //USER_HELP_FIELD_NAME+attributeName;\n String help = (String) this.getClass().getDeclaredField(fieldName).get(this);\n System.out.println(\"\\t\" + USER_OPTION + attributeName + \": \\t\" + help);\n }\n catch(Exception e)\n {\n throw new RuntimeException(\"Internal error.\" +\n \" We forgot to declare a help for the user option \" + field);\n }\n\n }\n System.exit(0);\n\n return parameterIndex + 1;\n }", "private static void help() {\n\t\t\n\t\tTask[] taskList = createTaskList();\n\t\t\n\t\tSystem.out.println(\"\\n---------------------------------[ HELP ]--------\"\n\t\t\t\t+ \"------------------------------\\n\");\n\t\t\n\t\t// Post1 Display help (Polymorphism)\n\t\tfor (Task task : taskList) {\n\t\t\ttask.displayHelp();\n\t\t}\n\t\t\n\t}", "private static void help() {\n\t\tSystem.out.println(\"\\n----------------------------------\");\n\t\tSystem.out.println(\"---Regatta Calculator Commands----\");\n\t\tSystem.out.println(\"----------------------------------\");\n\t\tSystem.out.println(\"addtype -- Adds a boat type and handicap to file. Format: name:lowHandicap:highHandicap\");\n\t\tSystem.out.println(\"format -- Provides a sample format for how input files should be arranged.\");\n\t\tSystem.out.println(\"help -- Lists every command that can be used to process regattas.\");\n\t\tSystem.out.println(\"podium -- Lists the results of the regatta, assuming one has been processed.\");\n\t\tSystem.out.println(\"regatta [inputfile] -- Accepts an input file as a parameter, this processes the regatta results outlined in the file.\");\n\t\tSystem.out.println(\"types -- lists every available boat type.\");\n\t\tSystem.out.println(\"write [outputfile] -- Takes the results of the regatta and writes them to the file passed as a parameter.\");\n\t\tSystem.out.println(\"----------------------------------\\n\");\n\t}", "private void printHelp() \n {\n Logger.Log(\"You have somehow ended up in this strange, magical land. But really you just want to go home.\");\n Logger.Log(\"\");\n Logger.Log(\"Your command words are:\");\n parser.showCommands();\n Logger.Log(\"You may view your inventory or your companions\");\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "public void parseInput(Map gameMap, Player player) {\n String[] splitInput = playerInput.split(\" \", 0); // Splits the input into an action and an object.\n String action; // Stores the action that the user input\n String predic; // Stores the predicate of the input\n String object; // Stores the object to do action on of the input\n String object2; // Stores extra words from the input\n String ANSI_RED = \"\\u001B[31m\"; // Red text color\n String ANSI_BLUE = \"\\u001B[34m\"; // Blue text color\n prevInputs.add(splitInput);\n\n // Parses single word inputs\n // Stores the action of the input\n if (splitInput.length == 1) {\n action = splitInput[0];\n switch (action.toLowerCase()) {\n case \"cheat\":\n System.out.println(player.getHint());\n break;\n case \"superbrief\":\n System.out.println(\"Dialogue length set to superbrief.\");\n player.changeDialogueState(\"superbrief\");\n break;\n case \"brief\":\n System.out.println(\"Dialogue length set to brief.\");\n player.changeDialogueState(\"brief\");\n break;\n case \"verbose\":\n System.out.println(\"Dialogue length set to verbose.\");\n player.changeDialogueState(\"verbose\");\n break;\n case \"autoplay\":\n case \"auto\":\n System.out.println(\"Turning on autoplay.\");\n player.changeDialogueState(\"autoplay\");\n break;\n case \"again\":\n case \"g\":\n prevInputs.remove(splitInput);\n playerInput = \"\";\n for (int i = 0; i < prevInputs.get(prevInputs.size() - 1).length; i++) {\n playerInput = playerInput.concat(prevInputs.get(prevInputs.size() - 1)[i]);\n playerInput = playerInput.concat(\" \");\n }\n parseInput(gameMap, player);\n return;\n case \"i\":\n case \"inventory\":\n case \"inv\":\n player.getInventory();\n break;\n case \"look\":\n case \"l\":\n player.checkArea();\n player.incrementTurn();\n break;\n case \"equipment\":\n player.getEquipment();\n break;\n case \"diagnose\":\n player.diagnose();\n player.incrementTurn();\n break;\n case \"hi\":\n case \"hello\":\n System.out.println(\"You said 'Hello'\");\n player.incrementTurn();\n break;\n case \"jump\":\n System.out.println(\"For whatever reason, you jumped in place.\");\n player.incrementTurn();\n break;\n case \"walk\":\n System.out.println(\"You walked around the area but you've already seen everything.\");\n player.incrementTurn();\n break;\n case \"save\":\n System.out.println(\"Saving Game...\");\n try {\n TimeUnit.SECONDS.sleep(1);\n }\n catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n player.save();\n break;\n case \"restore\":\n System.out.println(\"Loading Game...\");\n try {\n TimeUnit.SECONDS.sleep(1);\n }\n catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n player.load(gameMap);\n player.checkArea();\n break;\n case \"restart\":\n player.setHealth(0);\n break;\n case \"status\":\n player.getStatus();\n break;\n case \"score\":\n System.out.println(\"SCORE: \" + player.getScore());\n break;\n case \"quit\":\n case \"q\":\n System.out.print(\"Thank you for playing!\");\n System.exit(0);\n case \"wait\":\n case \"z\":\n case \"stay\":\n System.out.println(\"You stood in place.\");\n player.incrementTurn();\n break;\n case \"north\":\n case \"south\":\n case \"east\":\n case \"west\":\n case \"northeast\":\n case \"northwest\":\n case \"southeast\":\n case \"southwest\":\n case \"n\":\n case \"s\":\n case \"e\":\n case \"w\":\n case \"ne\":\n case \"nw\":\n case \"se\":\n case \"sw\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase()));\n player.incrementTurn();\n break;\n case \"version\":\n System.out.println(\"Version: \" + VERSION);\n return;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n\n // Parses two word inputs\n if (splitInput.length == 2) {\n action = splitInput[0]; // Stores the action that the user inputs\n object = splitInput[1]; // Stores the object that the user inputs\n switch (action.toLowerCase()) {\n case \"attack\":\n if (player.getLocation().isCharaInRoom(object.toUpperCase())) {\n player.attack(player.getLocation().getChara(object.toUpperCase()));\n }\n else {\n System.out.println(\"There is no \" + ANSI_RED + object.toLowerCase() + ANSI_RESET + \" here.\");\n }\n player.incrementTurn();\n break;\n case \"go\":\n if (player.getLocation().getConnectedRoom(object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(object.toLowerCase()));\n else\n System.out.println(\"There is nothing in that direction.\");\n player.incrementTurn();\n break;\n case \"enter\":\n case \"exit\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()));\n player.incrementTurn();\n break;\n case \"break\":\n if (player.getLocation().getConnectedRoom(object.toLowerCase()) != null) {\n if (player.getLocation().getConnectedRoom(object.toLowerCase()).getLocked()) {\n player.getLocation().getConnectedRoom(object.toLowerCase()).unlock();\n System.out.println(\"You broke down the door.\");\n } else\n System.out.println(\"There is nothing to break down.\");\n }\n else\n System.out.println(\"There is nothing to break down.\");\n player.incrementTurn();\n break;\n case \"equip\":\n player.equipFromInv(object.toUpperCase());\n player.incrementTurn();\n break;\n case \"unequip\":\n player.equipToInv(object.toUpperCase());\n player.incrementTurn();\n break;\n case \"examine\":\n if (player.inInventory(object.toUpperCase()))\n player.examineInv(player.getItem(object.toUpperCase()));\n else if (player.inEquip(object.toUpperCase()))\n player.examineInv(player.getEquip(object.toUpperCase()));\n else\n System.out.println(\"You do not have: \" + ANSI_BLUE + object.toUpperCase() + ANSI_RESET);\n break;\n case \"read\":\n if (player.inInventory(object.toUpperCase()))\n player.examineInv(player.getItem(object.toUpperCase()));\n else\n System.out.println(\"You do not have: \" + ANSI_BLUE + object.toUpperCase() + ANSI_RESET);\n break;\n case \"get\":\n case \"take\":\n if (player.getLocation().isObjInRoom(object.toUpperCase())) {\n ZorkObj zorkObj = player.getLocation().getObj(object.toUpperCase());\n if (player.checkWeight(zorkObj))\n player.addItemToInventory(zorkObj);\n else {\n System.out.println(ANSI_BLUE + zorkObj.getName() + ANSI_RESET + \" is too heavy to pick up.\");\n player.getLocation().addObject(zorkObj);\n }\n }\n else if (object.toLowerCase().equals(\"all\")) {\n int objectsInRoom = player.getLocation().getObjLength();\n\n if (objectsInRoom == 0)\n System.out.println(\"There are no items in this room.\");\n\n for (int i = 0; i < objectsInRoom; i++) {\n ZorkObj zorkObj = player.getLocation().getObj();\n if (player.checkWeight(zorkObj) && player.checkInvSize()){\n player.addItemToInventory(zorkObj);\n }\n else if (!player.checkInvSize()) {\n System.out.println(\"Your inventory is too full.\");\n player.getLocation().addObject(zorkObj);\n }\n else {\n System.out.println(ANSI_BLUE + zorkObj.getName() + ANSI_RESET + \" is too heavy to pick up.\");\n player.getLocation().addObject(zorkObj);\n }\n }\n }\n else\n System.out.println(\"There is no item named \" + ANSI_BLUE + object + ANSI_RESET + \" in this area.\");\n player.incrementTurn();\n break;\n case \"drop\":\n player.removeItemFromChara(object.toUpperCase());\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n\n else if (splitInput.length == 3) {\n action = splitInput[0]; // Stores the action that the user inputs\n predic = splitInput[1]; // Stores the predicate of the input\n object = splitInput[2]; // Stores the object that the user inputs\n switch (action.toLowerCase()) {\n case \"attack\":\n if (player.getLocation().isCharaInRoom((predic + \" \" + object).toUpperCase())) {\n player.attack(player.getLocation().getChara((predic + \" \" + object).toUpperCase()));\n }\n else {\n System.out.println(\"There is no \" + ANSI_RED + (predic + \" \" + object).toLowerCase() + ANSI_RESET + \" here.\");\n }\n player.incrementTurn();\n break;\n case \"go\":\n switch (predic.toLowerCase()) {\n case \"down\":\n case \"up\":\n case \"in\":\n case \"out\":\n if (player.getLocation().getConnectedRoom(predic.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(predic.toLowerCase(), object.toLowerCase()));\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command.\");\n break;\n }\n break;\n case \"look\":\n switch (predic.toLowerCase()) {\n case \"inside\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getInsideDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getInsideDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"under\":\n case \"below\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getUnderDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getUnderDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"behind\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getBehindDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getBehindDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"through\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getThroughDesc());\n else if(player.getLocation().isCharaInRoom((object).toUpperCase()))\n System.out.println(player.getLocation().getChara((object).toUpperCase()).getThroughDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"at\":\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getDescription());\n else if (player.getLocation().isCharaInRoom(object.toUpperCase()))\n player.examineChara(player.getLocation().getChara(object.toUpperCase()));\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command.\");\n return;\n }\n break;\n case \"talk\":\n case \"speak\":\n if (\"to\".equals(predic)) {\n if (player.getLocation().isObjInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel(object.toUpperCase()).getDialogue());\n else if (player.getLocation().isCharaInRoom(object.toUpperCase()))\n System.out.println(player.getLocation().getChara(object.toUpperCase()).getDialogue());\n else\n System.out.println(\"There is nothing to talk to.\");\n player.incrementTurn();\n } else {\n System.out.println(\"Invalid Command.\");\n }\n break;\n case \"in\":\n case \"enter\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()));\n else\n System.out.println(\"There is nothing to enter.\");\n player.incrementTurn();\n break;\n case \"out\":\n case \"exit\":\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()) != null)\n player.enterDoor(player.getLocation().getConnectedRoom(action.toLowerCase(), object.toLowerCase()));\n else\n System.out.println(\"There is nothing to exit.\");\n player.incrementTurn();\n break;\n case \"get\":\n case \"take\":\n if (predic.toLowerCase().equals(\"off\")) {\n player.equipToInv(object.toUpperCase());\n player.incrementTurn();\n break;\n }\n else if (player.getLocation().getObj((predic + object).toUpperCase()) != null) {\n player.addItemToInventory(player.getLocation().getObj((predic + object).toUpperCase()));\n System.out.println(\"You have picked up: \" + predic + \" \" + object);\n }\n else\n System.out.println(\"There is no item named \" + predic + \" \" + object + \" in this area.\");\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n\n else if (splitInput.length == 4) {\n action = splitInput[0]; // Stores the action that the user inputs\n predic = splitInput[1]; // Stores the predicate of the input\n object = splitInput[2]; // Stores the object that the user inputs\n object2 = splitInput[3]; // Stores extra words that the user inputs\n switch (action.toLowerCase()) {\n case \"attack\":\n if (player.getLocation().isCharaInRoom((predic + \" \" + object + \" \" + object2).toUpperCase())) {\n player.attack(player.getLocation().getChara((predic + \" \" + object + \" \" + object2).toUpperCase()));\n }\n else {\n System.out.println(\"There is no \" + ANSI_RED + (predic + \" \" + object + \" \" + object2).toLowerCase() + ANSI_RESET + \" here.\");\n }\n player.incrementTurn();\n break;\n case \"look\":\n switch (predic.toLowerCase()) {\n case \"inside\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getInsideDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getInsideDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"under\":\n case \"below\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getUnderDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getUnderDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"behind\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getBehindDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getBehindDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"through\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getThroughDesc());\n else if(player.getLocation().isCharaInRoom(((object + \" \" + object2)).toUpperCase()))\n System.out.println(player.getLocation().getChara(((object + \" \" + object2)).toUpperCase()).getThroughDesc());\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n case \"at\":\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getDescription());\n else if (player.getLocation().isCharaInRoom((object + \" \" + object2).toUpperCase()))\n player.examineChara(player.getLocation().getChara((object + \" \" + object2).toUpperCase()));\n else\n System.out.println(\"Object is not found in this area.\");\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command.\");\n break;\n }\n break;\n case \"talk\":\n case \"speak\":\n if (\"to\".equals(predic)) {\n if (player.getLocation().isObjInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getObjNoDel((object + \" \" + object2).toUpperCase()).getDialogue());\n else if (player.getLocation().isCharaInRoom((object + \" \" + object2).toUpperCase()))\n System.out.println(player.getLocation().getChara((object + \" \" + object2).toUpperCase()).getDialogue());\n else\n System.out.println(\"There is nothing to talk to.\");\n player.incrementTurn();\n } else {\n System.out.println(\"Invalid Command.\");\n }\n break;\n case \"use\":\n if (predic.toUpperCase().equals(\"KEY\")) {\n if (object.toUpperCase().equals(\"ON\")) {\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object2.toLowerCase()) != null) {\n if (player.getLocation().getConnectedRoom(action.toLowerCase(), object2.toLowerCase()).getLocked()) {\n player.getLocation().getConnectedRoom(action.toLowerCase(), object2.toLowerCase()).unlock();\n System.out.println(\"You unlocked the door.\");\n } else\n System.out.println(\"You do not have a key.\");\n } else {\n if (player.inInventory(\"KEY\"))\n System.out.println(\"There is nothing to use a key on.\");\n else\n System.out.println(\"You do not have a key.\");\n }\n }\n }\n player.incrementTurn();\n break;\n default:\n System.out.println(\"Invalid Command\");\n return;\n }\n }\n else if (splitInput.length > 4) {\n System.out.println(\"Invalid Command\");\n return;\n }\n\n // Makes the enemies that are in the 'aggressive' state in the same room as the player attack the player.\n ArrayList<Character> NPCsInRoom = player.getLocation().getCharacters();\n if (NPCsInRoom.size() > 0) {\n for (Character character : NPCsInRoom) {\n if (character.getHealth() > 0 && character.getState().getStateName().equals(\"agg\")) {\n try {\n TimeUnit.SECONDS.sleep(1);\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n System.out.println(ANSI_RED + character.getName() + ANSI_RESET + \" is attacking!\");\n try {\n TimeUnit.SECONDS.sleep(1);\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n character.attack(player);\n }\n }\n }\n }", "private void printHelp() {\n System.out.println(\"Your available command words are:\");\n parser.showCommands();\n }", "public boolean parse() {\n \n // create the version option\n Option optVersion = new Option(\"V\", \"version\", false, localization.getMessage(\"Help_Version\"));\n \n // create the help option\n Option optHelp = new Option(\"h\", \"help\", false, localization.getMessage(\"Help_Help\"));\n \n // create the log option\n Option optLog = new Option(\"l\", \"log\", false, localization.getMessage(\"Help_Log\"));\n \n // create the verbose option\n Option optVerbose = new Option(\"v\", \"verbose\", false, localization.getMessage(\"Help_Verbose\"));\n \n // create the timeout option\n Option optTimeout = new Option(\"t\", \"timeout\", true, localization.getMessage(\"Help_Timeout\"));\n \n // create the language option\n Option optLanguage = new Option(\"L\", \"language\", true, localization.getMessage(\"Help_Language\"));\n \n // add version\n commandLineOptions.addOption(optVersion);\n \n // add help\n commandLineOptions.addOption(optHelp);\n \n // add log\n commandLineOptions.addOption(optLog);\n \n // add verbose\n commandLineOptions.addOption(optVerbose);\n \n // add timeout\n commandLineOptions.addOption(optTimeout);\n \n // add language\n commandLineOptions.addOption(optLanguage);\n \n // create a new basic parser\n CommandLineParser parser = new BasicParser();\n \n // lets try to parse everthing\n try {\n \n // parse the arguments\n CommandLine line = parser.parse(commandLineOptions, theArgs);\n \n // if -L or --language found\n if (line.hasOption(\"language\")) {\n \n // create a new language controler\n LanguageController language = new LanguageController();\n \n // if the attempt to set the language according to the command\n // line has failed\n if (!language.setLanguage(line.getOptionValue(\"language\"))) {\n \n // print the list of available languages\n language.printLanguageHelp();\n \n // print the usage\n printUsage();\n \n // and simply return\n return false;\n }\n }\n \n // if -h or --help found\n if (line.hasOption(\"help\")) {\n \n // print version\n printVersion();\n \n // and usage\n printUsage();\n \n // return\n return false;\n \n } else {\n \n // if -v or --version found\n if (line.hasOption(\"version\")) {\n \n // print version\n printVersion();\n \n printSpecialThanks();\n \n // and return\n return false;\n \n } else {\n \n // get the list of files\n String[] files = line.getArgs();\n \n // we only expect one file\n if (files.length != 1) {\n \n // print version\n printVersion();\n \n // usage\n printUsage();\n \n // and return\n return false;\n \n } else {\n \n // if -t or --timeout found\n if (line.hasOption(\"timeout\")) {\n \n // try to convert the argument to a number\n try {\n \n // parse the long value\n executionTimeout = Long.parseLong(line.getOptionValue(\"timeout\"));\n \n // if it's not a valid number\n if (executionTimeout <= 0) {\n \n // print version\n printVersion();\n \n // usage\n printUsage();\n \n // and return\n return false;\n \n }\n } catch (NumberFormatException numberFormatException) {\n \n // we have a bad conversion\n \n // print version\n printVersion();\n \n // usage\n printUsage();\n \n // and return\n return false;\n }\n } else {\n \n // fallback to the default value, that is,\n // timeout is disabled\n executionTimeout = 0;\n }\n \n // active logging\n AraraLogging.enableLogging(line.hasOption(\"log\"));\n \n // set verbose flag\n showVerboseOutput = line.hasOption(\"verbose\");\n \n // everything is fine, set\n // the file\n theFile = files[0];\n \n // check if file exists\n if (!checkFile(theFile, configuration.getValidExtensions())) {\n \n // file not found, return false\n return false;\n \n }\n \n // and return\n return true;\n }\n }\n }\n \n } catch (ParseException parseException) {\n \n // something happened, in the last case print version\n printVersion();\n \n // and usage\n printUsage();\n \n // and simply return\n return false;\n \n }\n }", "private static void displayHelp(){\n System.out.println(\"1. (R)eport\");\n System.out.println(\"2. (M)inimum Spanning Tree\");\n System.out.println(\"3. (S)hortest Path from i j\");\n System.out.println(\"4. (D)own i j\");\n System.out.println(\"5. (U)p i j\");\n System.out.println(\"6. (C)hange Weight i j x\");\n System.out.println(\"7. (E)ulerian\");\n System.out.println(\"8. (Q)uit\");\n }", "private static void displayHelp()\r\n {\r\n System.out.println(\"Usage: \");\r\n System.out.println(\"======\");\r\n System.out.println(\"\");\r\n System.out.println(\" -i=<file> : The input file name\");\r\n System.out.println(\" -o=<file> : The output file name\");\r\n System.out.println(\" -e : Write the output as embedded glTF\");\r\n System.out.println(\" -b : Write the output as binary glTF\");\r\n System.out.println(\" -c=<type> : The indices component type. \"\r\n + \"The <type> may be GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT \"\r\n + \"or GL_UNSIGNED_INT. The default is GL_UNSIGNED_SHORT\");\r\n System.out.println(\" -m : Create one mesh per primitive, \"\r\n + \"each attached to its own node.\");\r\n System.out.println(\" -h : Print this message.\");\r\n System.out.println(\" -v=<number> : The target glTF version. \"\r\n + \"The <number> may be 1 or 2. The default is 2.\");\r\n System.out.println(\"\");\r\n System.out.println(\"Example: \");\r\n System.out.println(\"========\");\r\n System.out.println(\"\");\r\n System.out.println(\" ObjToGltf -b -i=C:/Input/Example.obj \" \r\n + \"-o=C:/Output/Example.glb\");\r\n }", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around in a dense woods.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }", "private void printHelp() {\r\n\t\tSystem.out.println(\"Flag Param Details\");\r\n\t\tSystem.out.println(\" -f **x** Add a filter. 'x' is the board letter.\");\r\n\t\tSystem.out.println(\" Can have 0 or more stars before and after the board letter.\");\r\n\t\tSystem.out.println(\" -h Print this message.\");\r\n\t\tSystem.out.println(\" -q Quit interactive session.\");\r\n\t\tSystem.out.println(\" -n xx Display xx number of words.\");\r\n\t\tSystem.out.println(\" -n all Display all words.\");\r\n\t\tSystem.out.println(\" -r Repeat last search.\");\r\n\t\tSystem.out.println(\" -s len Words are sorted by length.\");\r\n\t\tSystem.out.println(\" -s alpha Words are sorted alphapetically.\");\r\n\t\t// System.out.println(\"\");\r\n\t}", "private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the prision.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(parser.showCommands());\n }", "@Override\n \t\t\t\tpublic void doHelp() {\n \n \t\t\t\t}", "private static void doUsage() {\r\n\t\tSystem.out.println(\"Usage: SpellChecker [-i] <dictionary> <document>\\n\"\r\n\t\t\t\t+ \" -d <dictionary>\\n\" + \" -h\");\r\n\t}", "public void createHelpList() {\t\n\t\tcommandList.add(\"add event with deadline\");\n\t\tcommandList.add(\"add event with timeline\");\n\t\tcommandList.add(\"add event with timeline, single day\");\n\t\tcommandList.add(\"add event with no deadline\");\n\t\tcommandList.add(\"add event with rank\");\n\t\tcommandList.add(\"add recurring tasks with deadline\");\n\t\tcommandList.add(\"add recurring tasks with timeline\");\n\t\tcommandList.add(\"add timeline events with blocking ability\");\n\t\tcommandList.add(\"edit date only\");\n\t\tcommandList.add(\"edit title only\");\n\t\tcommandList.add(\"edit timeline only\");\n\t\tcommandList.add(\"edit rank only\");\n\t\tcommandList.add(\"deleting event\");\n\t\tcommandList.add(\"undo\");\n\t\tcommandList.add(\"redo\");\n\t\tcommandList.add(\"display default\");\n\t\tcommandList.add(\"display by date\");\n\t\tcommandList.add(\"display by importance\");\n\t\tcommandList.add(\"display alphabetically\");\n\t\tcommandList.add(\"search by title\");\n\t\tcommandList.add(\"search by date\");\n\t\tcommandList.add(\"search by importance\");\n\t\tcommandList.add(\"change directory\");\n\t\tcommandList.add(\"marking task as complete\");\n\t\tcommandList.add(\"clear file\");\n\t\tcommandList.add(\"help\");\n\t\tcommandList.add(\"exit\");\n\t\t\n\t\tinputCommand.add(\"add <description> by <deadline>\");\n\t\tinputCommand.add(\"add <description> from <start date time> to \"\n\t\t\t\t + \"<end date time> \");\n\t\tinputCommand.add(\"add <description> on <date> from <start time> \"\n\t\t\t\t + \"to <end time>\");\n\t\tinputCommand.add(\"add <description>\");\n\t\tinputCommand.add(\"add <description> by <deadline> rank <number>\");\n\t\tinputCommand.add(\"add <description> repeat <repeat period>\"\n\t\t\t\t + \" <monthly/yearly/daily> \" + \"on <date>\");\n\t\tinputCommand.add(\"add <description> repeat <repeat period>\" + \" <monthly/yearly/daily> \" + \"from <startDate> to <endDate>\");\n\t\tinputCommand.add(\"add <description> block <start date> to <end date>\");\n\t\tinputCommand.add(\"edit <task index> by date <new date>\");\n\t\tinputCommand.add(\"edit <task index> by title <updated title>\");\n\t\tinputCommand.add(\"edit <task index> by time from <new start date> \"\n\t\t\t\t + \"to <new end date>\");\n\t\tinputCommand.add(\"edit <task index> by impt <new rank>\");\n\t\tinputCommand.add(\"delete <task index>\");\n\t\tinputCommand.add(\"undo\");\n\t\tinputCommand.add(\"redo\");\n\t\tinputCommand.add(\"display\");\n\t\tinputCommand.add(\"display date\");\n\t\tinputCommand.add(\"display impt\");\n\t\tinputCommand.add(\"display alpha\");\n\t\tinputCommand.add(\"search <title>\");\n\t\tinputCommand.add(\"search date <date>\");\n\t\tinputCommand.add(\"search impt <rank>\");\n\t\tinputCommand.add(\"cd <new directory>\");\n\t\tinputCommand.add(\"complete <task index>\");\n\t\tinputCommand.add(\"clear\");\n\t\tinputCommand.add(\"help\");\n\t\tinputCommand.add(\"exit\");\n\t}", "private static void displayHelp(){\n System.out.println(\"-host hostaddress: \\n\" +\n \" connect the host and run the game \\n\" +\n \"-help: \\n\" +\n \" display the help information \\n\" +\n \"-images: \\n\" +\n \" display the images directory \\n\" +\n \"-sound: \\n\" +\n \" display the sounds file directory \\n\"\n\n );\n }", "void help();", "private static void printHelp(CmdLineParser parser) {\n\tSystem.out.print(\"Usage: Main \");\n\tparser.printSingleLineUsage(System.out);\n\tSystem.out.println(\"\\n\");\n\tparser.printUsage(System.out);\n\tSystem.out.println(\"\");\n\treturn;\n }", "public void help();", "public static void printHelp() {\n System.out.println(\"Usage:\");\n System.out.println(\"To create a user, post a message.\");\n System.out.println(\"<user name> [command] | <another user name>\");\n System.out.println(\"<user name> -> message - post a message\");\n System.out.println(\"<user name> - read timeline messages\");\n System.out.println(\"<user name> follows <another user name> - follow another user\");\n System.out.println(\"<user name> wall - display users wall\");\n System.out.println(\"-help - help\");\n System.out.println(\"exit - exit the program\");\n }", "private static void help() {\n System.out.println(\"usage: pgen <project name> <args>\");\n System.out.println(\"Arguments:\");\n System.out.println(\"\\t-h | -help : help menu\");\n System.out.println(\"\\t-s | -size <example file amount> : the amount of example files to create. Defaults to 2\");\n System.out.println(\"\\t-t | -template <template> : the template to use. Defaults to java_default\");\n System.out.println(\"\\t\\tValid Templates:\");\n System.out.println(\"\\t\\t\\t* java_default\");\n System.out.println(\"\\t\\t\\t* cpp_default\");\n System.out.println(\"\\t-kattis : fetches the problems from Kattis and creates a makefile and test script for them\");\n System.out.println(\"\\t-local : fetches nothing and creates empty example files\");\n System.exit(0);\n }", "private static void doHelp() {\r\n\t\tdoUsage();\r\n\t\tSystem.out.println(\"\\n\" + \"When passed a dictionary and a document, spell check the document. Optionally,\\n\"\r\n\t\t\t\t+ \"the switch -n toggles non-interactive mode; by default, the tool operates in\\n\"\r\n\t\t\t\t+ \"interactive mode. Interactive mode will write the corrected document to disk,\\n\"\r\n\t\t\t\t+ \"backing up the uncorrected document by concatenating a tilde onto its name.\\n\\n\"\r\n\t\t\t\t+ \"The optional -d switch with a dictionary parameter enters dictionary edit mode.\\n\"\r\n\t\t\t\t+ \"Dictionary edit mode allows the user to query and update a dictionary. Upon\\n\"\r\n\t\t\t\t+ \"completion, the updated dictionary is written to disk, while the original is\\n\"\r\n\t\t\t\t+ \"backed up by concatenating a tilde onto its name.\\n\\n\"\r\n\t\t\t\t+ \"The switch -h displays this help and exits.\");\r\n\t\tSystem.exit(0);\r\n\t}", "private static void help(){\n\t\tSystem.out.println(\"\\t\\tAge\\n\\tby Sayan Ghosh\\n\\n\"+\n\t\t\t\t\t\t\t\"Calculates Age of Person from Date of Birth (DD MM YYYY).\\n\"+\n\t\t\t\t\t\t\t\"Shows age in two forms:\\n\"+\n\t\t\t\t\t\t\t\t\"\\tAge in years, months, days\\n\"+\n\t\t\t\t\t\t\t\t\"\\tAge in years (as fraction)\\n\"+\n\t\t\t\t\t\t\t\"Syntax:\\n\"+\n\t\t\t\t\t\t\t\t\"\\tjava Age\\t\\t\\truns program and takes input\\n\"+\n\t\t\t\t\t\t\t\t\"\\tjava Age <dd mm yyyy>\\t\\tdirectly shows result taking dob as parameters\\n\"+\n\t\t\t\t\t\t\t\t\"\\tjava Age --help\\t\\t\\tshows this help\\n\");\n\t}", "public static void displayHelp() {\n\t\thelp = getInstance();\n\t\tUIMain.popUpHelp(commandList, inputCommand);\t\n\t\tLoggingLogic.logging(HELP_MESSAGE);\n\t}", "Help createHelp();", "private static void dealwithelp() {\r\n\t\tSystem.out.println(\"1 ) myip - to see your ip address.\");\r\n\t\tSystem.out.println(\"2 ) myport - to see your port number.\");\r\n\t\tSystem.out.println(\"3 ) connect <ip> <port> - connect to peer.\");\r\n\t\tSystem.out.println(\"4 ) list Command - list all the connected peer/peers.\");\r\n\t\tSystem.out.println(\"5 ) send <id> - to send message to peer.\");\r\n\t\tSystem.out.println(\"6 ) terminate <id> - terminate the connection\");\r\n\t\tSystem.out.println(\"7 ) exit - exit the program.\");\r\n\t}", "private void showHelp() {\n \tHelpFormatter formatter = new HelpFormatter();\n \tformatter.printHelp( \"java -cp moustache.jar Main\", options );\n }", "private static void printDescription(String inputFromUser) throws IllegalArgumentException{\n for(int index = 0; index < GeneralInfo.PREFIX_COMMAND_DESCRIPTION.length(); index++){\n if(inputFromUser.charAt(index) != GeneralInfo.PREFIX_COMMAND_DESCRIPTION.charAt(index)){\n throw new IllegalArgumentException(\"The input is not a correct description request. \" +\n \"This method should not have been called\");\n }\n }\n String nameCard = inputFromUser.substring(GeneralInfo.PREFIX_COMMAND_DESCRIPTION.length());\n printDescriptionCard(nameCard);\n }", "private void help() {\n String border = \"=====================================================================================\";\n String title = \"AILearning API:\\n\";\n String template = \"arguments: numOfControls, controls..., quantityOfEach, hasHighContrast, hasDisabled, \" +\n \"hasNoise, isUnsorted\\n\";\n String numOfCon= \"numOfControls - integer number of controls (1 - 6)\\n\";\n String contrls = \"controls... - each control is string and number of strings equals numOfControls\";\n String namesOfControls = \"Every string is define symbol:\\nB - Button, TF - TextField, RB - RadioButton\" +\n \"Sp - Spinner, Sl - Slider, CB - CheckBox\\n\";\n String quantityOfEach = \"quantityOfEach - integer number of each control (0 - 1 000 000)\\n\";\n String highContrast = \"hasHighContrast - string (true or false)\\n\";\n String disabled = \"hasDisabled - string (true of false)\\nif true - some controls will be disabled\\n\";\n String noise = \"hasNoise - string (true or false)\\n\";\n String unsorted = \"isUnsorted - string (true or false)\\nif true - controls will be in one folder\\n\";\n String example = \"Example: 3 B TF RB 100 true true true false\";\n String meaning = \"It means that app will generate 100 Buttons, 100 TextFields, 100 RadioButtons \" +\n \"with high contrast, noise,\\nsome controls will be disabled and locate in different folders\";\n\n System.out.println(String.format(\"%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\", border, title, template, numOfCon,\n contrls, namesOfControls, quantityOfEach, highContrast, disabled, noise, unsorted, example, meaning));\n }", "private void doHelp()\r\n {\r\n Help.showHelp(page, ref, null);\r\n }", "private String printHelp()//refactored\n { String result = \"\";\n result += \"\\n\";\n result += \"You are weak if you have to ask me\\n\";\n result += \"Try not to die, while i´am mocking you.\\n\";\n result += \"\\n\";\n result += \"\" + currentRoom.getDescription() + \"\\n\"; //new\n result += \"\\nExits: \" + currentRoom.getExitDescription() + \"\\n\";//new\n result += \"\\nCommand words:\\n\";\n result += ValidAction.getValidCommandWords();\n result += \"\\n\";\n \n return result;\n }", "private static void help() {\n System.out.println(USAGE); \n System.exit(0);\n }", "public void inputInformation() throws IOException {\n BufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n try {\n System.out.println(\"Please enter shape: \");\n shape = input.readLine();\n\n System.out.println(\"Please enter color\");\n color = input.readLine();\n\n System.out.println(\"Please enter name: \");\n name = input.readLine();\n\n System.out.println(\"Please enter weight: \");\n weight = Double.parseDouble(input.readLine());\n } catch (NumberFormatException e) {\n System.out.println(\"Error: \" + e.toString());\n }\n }", "public void consoleGetOptions(){\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tString input;\n\t\tint diff=0,first=0;\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.print(\"Who starts first (0-Player, 1-Computer): \");\n\t\t\t\tinput=in.readLine();\n\t\t\t\tfirst = Integer.parseInt(input);\n\t\t\t\tif (first<0 || first>1) throw new IllegalArgumentException();\n\t\t\t\tif (first==1) ttt.switchPlayer();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}while(true);\t\t\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.print(\"Enter AI level (0-Noob, 1-Normal, 2-God Mode): \");\n\t\t\t\tinput=in.readLine();\n\t\t\t\tdiff = Integer.parseInt(input);\n\t\t\t\tif (diff<0 || diff>2) throw new IllegalArgumentException();\n\t\t\t\tttt.setDifficulty(diff);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\t}\n\t\t}while(true);\t\t\n\t}", "protected void helpPage() {\n \n System.out.println(\"Commands:\");\n System.out.println(\"\\tQ [filename]\\t\\t\\tquit and save to filename\"); \n System.out.println(\"\\t ~ is used for a space character\" ); \n System.out.println(\"\\tb [STRING] [INDEX]\\t\\tinsert [STRING] \" +\n \"before [INDEX]\");\n System.out.println(\"\\tr [START] [STOP]\\t\\tremove all charecters\" +\n \" from index start to stop\");\n System.out.println(\"\\td [CHAR]\\t\\t\\tremove all [CHAR] elements \" +\n \"in the list\");\n System.out.println(\"\\tr [CHAR1] [CHAR2]\\t\\treplace all \" + \n \"[CHAR1]'s with [CHAR2]\");\n System.out.println(\"\\tz\\t\\t\\t\\trandomly run other commands several\" +\n \" times\");\n System.out.println(\"\\tp [INDEX] [CLIPBOARD]\\t\\tpaste from \" +\n \"clipboard number [CLIPBOARD] to message index [INDEX]\");\n System.out.println(\"\\tc [START] [STOP] [CLIPBOARD]\\t\" + \n \"copy message values from index [START] to [STOP] to \" + \n \"clipboard [CLIPBOARD]\");\n System.out.println(\"\\tx [STOP] [START] [CLIPBOARD]\\tcut from \" +\n \"message index [START] to [STOP] to clipboard [CLIPBOARD]\");\n System.out.println(\"\\th\\t\\t\\t\\tmeans to show this help page\");\n }", "public void showHelp() {\n\tString shortFormat = \"%16s -- %-20s %n\";\n\tString longFormat = \"%16s -- %-40s %n\";\n System.out.printf(shortFormat, \"ls\", \"list matched tariffs\");\n System.out.printf(shortFormat, \"ls all\", \"list all tariffs\");\n System.out.printf(shortFormat, \"clear\", \"reset filters\");\n System.out.printf(shortFormat, \"exit\", \"exit the program\");\n System.out.printf(longFormat, \"field min max\",\n \"filter tariffs with field having\"\n + \"value between min and max\");\n System.out.println(\"\\nList of available fields:\\n\");\n filterCommands.stream().forEach(System.out::println);\n }", "protected void handleHelp(ActionEvent event) {\n\t}", "private void setHelp() {\n\t\tHelpOpt.add(\"-h\");\n\t\tHelpOpt.add(\"/h\");\n\t\tHelpOpt.add(\"help\");\n\t}", "private void printHelp() {\n TablePrinter helpTableHead = new TablePrinter(\"Command Name : \", \"textconvert\");\n helpTableHead.addRow(\"SYNOPSIS : \", \"textconvert [OPTION]...\");\n helpTableHead.addRow(\"DESCRIPTION : \", \"Convert text/file to Binary, Hexadecimal, Base64.\");\n helpTableHead.print();\n TablePrinter helpTable = new TablePrinter(\"Short Opt\", \"Long Opt\", \"Argument\", \"Desc\", \"Short Option Example\", \"Long Option Example\");\n helpTable.addRow(\"-h\", \"--help\", \"not required\", \"Show this help.\", \"help -h\", \"help --help\");\n helpTable.addRow(\"-f\", \"--file\", \"required\", \"Path to file\", \"textconvert -f /PATH/TO/FILE\", \"textconvert --file /PATH/TO/FILE\");\n helpTable.addRow(\"-ttb\", \"--texttobinary\", \"not required\", \"Convert text to Binary\", \"textconvert -ttb -f /PATH/TO/FILE\", \"textconvert --texttobinary --file /PATH/To/File\");\n helpTable.addRow(\"-btt\", \"--binarytotext\", \"not required\", \"Convert Binary to text\", \"textconvert -btt -f /PATH/To/FileWithBinaryData\", \"textconvert --binarytotext --file /PATH/To/FileWithBinaryData\");\n helpTable.print();\n this.done = true;\n }", "public void printUsage() {\n System.out.println(\"\\nHelp Invoked on \");\n System.out.println(\"[-hfs] \");\n System.out.println(\"\");\n\n System.out.println(\"Usage: \");\n System.out.println(\"-d [true|false]\");\n System.out.println(\"-f URL-file-pathame\");\n System.out.println(\"-h: invoke help\");\n System.out.println(\"-i: URL-list-input-source [ DEFAULT | USER | FILE ]\");\n System.out.println(\"-s URL-list-separator\");\n }", "public void start() {\n\n\tSystem.out.println(\"Welcome on HW8\");\n\tSystem.out.println(\"Avaiable features:\");\n\tSystem.out.println(\"Press 1 for find the book titles by author\");\n\tSystem.out.println(\"Press 2 for find the number of book published in a certain year\");\n\tSystem.out.print(\"Which feature do you like to use?\");\n\n\tString input = sc.nextLine();\n\tif (input.equals(\"1\"))\n\t showBookTitlesByAuthor();\n\telse if (input.equals(\"2\"))\n\t showNumberOfBooksInYear();\n\telse {\n\t System.out.println(\"Input non recognized. Please digit 1 or 2\");\n\t}\n\n }", "public void helpMenu()\n {\n System.out.println(\"*********************************************Help Menue**************************************************************\");\n System.out.println(\"Each player starts the game with zero points.\");\n System.out.println(\"Each player is given the following set of five tiles. Each tile has a value and an associated score\");\n System.out.println(\"For each round, each player will play ONE tile, with the tile value adding to the game total for that round.\"); \n System.out.println(\"Provided the game total is less than or equal to 21, the player will get the score for using that tile.\");\n System.out.println(\"If the game total is greater than 21\");\n System.out.println(\"no score is allocated to the player who played the last tile causing the score to become greater than 21.\");\n System.out.println(\"Once the round ends, Each player will get their score based on the total of the tiles they have used during the round.\");\n System.out.println(\"Any player who has NOT used the tile with the value of 5, will get a penalty of -3 points.\");\n System.out.println(\"The player who, after all deductions, has the highest score, will be the winner of that round and will get 5 points.\"); \n System.out.println(\"At the end of all the rounds, the player who has won the most rounds is declared the winner of the game.\");\n System.out.println(\"**********************************************************************************************************************\");\n getUserStringInput(\"Please enter continue\");\n }", "public void help() {\n\t\tString format = \"%-20s%s%n\";\n\t\tString[] commands = new String[5];\n\t\tcommands[0] = \"help\";\n\t\tcommands[1] = \"learn\";\n\t\tcommands[2] = \"alphabet:create\";\n\t\tcommands[3] = \"alphabet:destroy\";\n\t\tcommands[4] = \"alphabet:compose\";\n\n\t\tString[] explanation = new String[5];\n\t\texplanation[0] = \"display this message\";\n\t\texplanation[1] = \"starts a learning process. Note: with a large alphabet, this\\ncan take a \"\n\t\t\t\t+ \"very long time!\";\n\t\texplanation[2] = \"creates an alphabet. Currently only working for Android, the\\n\"\n\t\t\t\t+ \"creation of an iOS alphabet has to be done more or less manually\";\n\t\texplanation[3] = \"deletes an existing alphabet\";\n\t\texplanation[4] = \"composes an alphabet from existing window dumps.\";\n\n\t\tfor (int i = 0; i < commands.length; i++) {\n\t\t\tSystem.out.printf(format, commands[i], explanation[i]);\n\t\t}\n\t}", "public void displayHelp() {\n io.println(\"To insert a new CNF use the following format: \\n1 2; -1 2; 3 1; -3 2\");\n io.println(\"Where each number represents a variable. If the number has a minus sign in front it means it is the negation of that variable.\");\n io.println(\"Each disjunction pair is separated by a semicolon so for example above looks in mathematical form:\");\n io.println(\"(x\" + UnicodeUtil.numbers[1] + \" \" + UnicodeUtil.disjunction + \" x\" + UnicodeUtil.numbers[2] + \") \" + UnicodeUtil.conjunction + \" (\" + UnicodeUtil.negation\n + \"x\" + UnicodeUtil.numbers[1] + \" \" + UnicodeUtil.disjunction + \" x\" + UnicodeUtil.numbers[2] + \") \" + UnicodeUtil.conjunction + \" (x\" + UnicodeUtil.numbers[3] + \" \"\n + UnicodeUtil.disjunction + \" x\" + UnicodeUtil.numbers[1] + \") \" + UnicodeUtil.conjunction + \" (\" + UnicodeUtil.negation + \"x\" + UnicodeUtil.numbers[3] + \" \" + UnicodeUtil.disjunction + \" x\" + UnicodeUtil.numbers[2] + \")\");\n io.println(\"Note that this is a 2SAT-solver so each disjunction can hold just two variables.\");\n }", "private static void showHelpAndExit(){\n\n System.out.println(\"*****************************************\");\n System.out.println(\"Format to run: java DataLoadTool <<no_of_docs>> <<doc_size>>\");\n System.out.println(\" <no_of_docs> -> Number of JSON documents needed to populate in one batch\");\n System.out.println(\" <doc_size>> -> Document size in Bytes (this value can be any number but more than 15)\");\n\n System.out.println(\"\\n Eg: If you wan to poulate 10 docs each of 20 Bytes\\n\" +\n \"\\t java DataLoadTool 10 20\");\n\n System.out.println(\"*****************************************\\n\");\n System.exit(0);\n }", "protected void doHelp (RenderRequest request,\n\t\t RenderResponse response)\n throws PortletException, java.io.IOException\n {\n throw new PortletException(\"doHelp method not implemented\");\n\n }", "Argument help(String help);", "public void input() throws ParseException {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Please enter id: \");\r\n\t\tString idSt = scn.nextLine();\r\n\t\tid = Integer.parseInt(idSt);\r\n\t\tSystem.out.println(\"Please enter title: \");\r\n\t\ttitle = scn.nextLine();\r\n\t\tSystem.out.println(\"Please enter authors name: \");\r\n\t\tauthor = scn.nextLine();\r\n\t\tSystem.out.println(\"Please enter date (dd.MM.yyyy): \");\r\n\t\tString scnDate = scn.nextLine();\r\n\t\tdateOfPublication = stringToDate(scnDate);\r\n\t}", "private void showHelp() {\n System.out.println(\"new: \");\n System.out.println(\"new chess and throw the chess bevor away\");\n System.out.println(\"move from to:\");\n System.out.println(\"take the pawn from position from to position to \");\n System.out.println(\"print:\");\n System.out.println(\"print the chess now \");\n System.out.println(\"help:\");\n System.out.println(\"show help\");\n System.out.println(\"quit:\");\n System.out.println(\"quit out\");\n }", "private static void usage()\n {\n System.out.println(\"Lex\");\n System.exit(-1);\n }", "public static void help() {\n System.out.println(line(\"*\", 80));\n System.out.println(\"SUPPORTED COMMANDS\");\n System.out.println(\"All commands below are case insensitive\");\n System.out.println();\n System.out.println(\"\\tSELECT * FROM table_name; Display all records in the table.\");\n System.out.println(\"\\tSELECT * FROM table_name WHERE rowid = <value>; Display records whose rowid is <id>.\");\n System.out.println(\"\\tDROP TABLE table_name; Remove table data and its schema.\");\n System.out.println(\"\\tVERSION; Show the program version.\");\n System.out.println(\"\\tHELP; Show this help information\");\n System.out.println(\"\\tEXIT; Exit the program\");\n System.out.println();\n System.out.println();\n System.out.println(line(\"*\", 80));\n }", "public String getHelp();", "@Override\n public void printHelp() {\n\n }", "public abstract String getHelpInfo();", "private static void printUsage()\n {\n StringBuilder usage = new StringBuilder();\n usage.append(String.format(\"semantika %s [OPTIONS...]\\n\", Environment.QUERYANSWER_OP));\n usage.append(\" (to execute query answer)\\n\");\n usage.append(String.format(\" semantika %s [OPTIONS...]\\n\", Environment.MATERIALIZE_OP));\n usage.append(\" (to execute RDB2RDF export)\");\n String header = \"where OPTIONS include:\"; //$NON-NLS-1$\n String footer =\n \"\\nExample:\\n\" + //$NON-NLS-1$\n \" ./semantika queryanswer -c application.cfg.xml -l 100 -sparql 'SELECT ?x WHERE { ?x a :Person }'\\n\" + //$NON-NLS-1$\n \" ./semantika rdb2rdf -c application.cfg.xml -o output.n3 -f N3\"; //$NON-NLS-1$\n mFormatter.setOptionComparator(null);\n mFormatter.printHelp(400, usage.toString(), header, sOptions, footer);\n }", "private static void printUsage() {\n\t\tSystem.out.println(\"Usage: java UniqueUniqueChromosomeReconstructor [-h] input_file\");\n\t\tSystem.out.println(\" -h: Print usage information\");\n\t\tSystem.out.println(\" input_file: File containing input sequence data\");\n\t}", "private static void help(){\r\n System.out.println(\"\\n\\t Something Went Wrong\\nType\\t java -jar nipunpassgen.jar -h\\t for mor info\");\r\n System.exit(0);\r\n }", "private ParserInput parserInput(String topicName) {\r\n \t\t// set dummy values for parser input\r\n \t\tParserInput parserInput = new ParserInput();\r\n \t\tparserInput.setContext(\"/wiki\");\r\n \t\tparserInput.setLocale(LocaleUtils.toLocale(\"en_US\"));\r\n \t\tparserInput.setWikiUser(null);\r\n \t\tparserInput.setTopicName(topicName);\r\n \t\tparserInput.setUserDisplay(\"0.0.0.0\");\r\n \t\tparserInput.setVirtualWiki(\"en\");\r\n \t\tparserInput.setAllowSectionEdit(true);\r\n \t\treturn parserInput;\r\n \t}", "private void printUsage() {\n \n // new formatter\n HelpFormatter formatter = new HelpFormatter();\n \n // add the text and print\n formatter.printHelp(\"arara [file [--log] [--verbose] [--timeout N] [--language L] | --help | --version]\", commandLineOptions);\n }", "private void showMenu() {\n\t Scanner sc = new Scanner(System.in);\n\t Arguments argument = Arguments.INVALID;\n\t System.out.println(\"Enter command of your choice in the correct format\");\n\t do\n\t {\n\t \tString command = sc.nextLine();\n\t \tString[] arguments = command.split(\" +\");\n\t \targument = validateAndReturnType(arguments);\n\t \tswitch(argument) {\n\t\t \tcase INCREASE:\n\t\t \t\tincrease(arguments);\n\t\t \t\tbreak;\n\t\t \tcase REDUCE:\n\t\t \t\treduce(arguments);\n\t\t \t\tbreak;\n\t\t\t\tcase COUNT:\n\t\t\t\t\tcount(arguments);\n\t\t\t\t\tbreak;\n\t\t\t\tcase INRANGE:\n\t\t\t\t\tinRange(arguments);\n\t\t\t\t\tbreak;\n\t\t\t\tcase NEXT:\n\t\t\t\t\tnext(arguments);\n\t\t\t\t\tbreak;\n\t\t\t\tcase PREVIOUS:\n\t\t\t\t\tprevious(arguments);\n\t\t\t\t\tbreak;\n\t\t\t\tcase QUIT:\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\tcase INVALID:\n\t\t\t\t\tSystem.out.println(\"Please enter a valid command\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.out.println(\"Invalid command. Enter a command in the correct format\");\n\t \t}\n\t } while(argument != Arguments.QUIT);\n\t}", "String getHelpString();", "public void handleHelp() {\n if (!helpWindow.isShowing()) {\n helpWindow.show();\n } else {\n helpWindow.focus();\n }\n }", "private Configuration help() {\n final HelpFormatter formatter = new HelpFormatter();\n\n formatter.printHelp(\"-f filepath OR -u http://fake.url\", options);\n return null;\n }", "static void printHelp(String processname)\r\n\t{\n\t\tHelpFormatter formatter = new HelpFormatter();\r\n\t\tformatter.printHelp(processname, options);\r\n\r\n\t\tSystem.exit(0);\r\n\t}", "private void displayUsage() {\r\n System.err.println(\"\\nUSAGE: java -classpath ... \" + \"DiscourseImportTool\");\r\n System.err.println(\"Option descriptions:\");\r\n System.err.println(\"\\t-h\\t usage info\");\r\n System.err.println(\"\\t-e, email\\t send email if major failure\");\r\n System.err.println(\"\\t-b\\t batchSize number of items to batch during import\");\r\n System.err.println(\"\\t-discourse\\t discourse id to run the generator on\");\r\n System.err.println(\"\\t-project\\t project id to add discourse to\");\r\n }", "public void help() {\n System.out.println(\"Type 'commands' to list all \" +\n \"available commands\");\n System.out.println(\"Type 'start' to play game\");\n System.out.println(\"Player to remove the last stone loses!\");\n System.out.println();\n }", "@Override\n\tpublic Command parse(String[] s) {\n\t\tif (s.length==1 && s[0].equalsIgnoreCase(\"HELP\"))\n\t\t\treturn new Help(); \n\t\telse return null;\n\t}", "@Override\n public void help() {\n\n }", "void printUsage(){\n\t\tSystem.out.println(\"Usage: RefactorCalculator [prettyPrint.tsv] [tokenfile.ccfxprep] [cloneM.tsv] [lineM.tsv]\");\n\t\tSystem.out.println(\"Type -h for help.\");\n\t\tSystem.exit(1); //error\n\t}", "private void helpCommand() {\n output.println(\"HELP COMMAND\");\n output.println(\"read tasks: 'r all/today/before/after', write new task: 'w dd/mm/yyyy taskName' (wrong format of date -> default today date)\");\n }", "private void help() {\n System.out.println(\"PLACE X,Y,F #Placing the robot in (X,Y) facing F. \\n\" +\n \"\\tX and Y are numbers between 0 AND 5, F is NORTH, EAST, WEST, SOUTH directions\\n\" +\n \"MOVE #Move one position towards the current direction\\n\" +\n \"LEFT #Turn left\\n\" +\n \"RIGHT #Turn right\\n\" +\n \"REPORT #Prints current position and the direction\\n\" +\n \"HELP #Help menu\");\n }", "@Override\n\tpublic String getHelp()\n\t{\n\t\treturn \"<html>Enter two before values and one after value<br>\"\n\t\t\t\t+ \"from the solution. Click the calculate button<br>\"\n\t\t\t\t+ \"to find the remaining after value.</html>\";\n\t}", "public void setHelp (String Help);", "String getHelpText();", "public CommResponse parseHumanInput(String str, Action suggestedHumanAction){\n \tstr = str.toLowerCase();\n \tCommType type = null;\n \tAction humanAction = null;\n \tAction robotAction = null;\n \tif(LearningAlgorithm.currCommunicator == Constants.ROBOT){\n\t \tif(str.contains(\"yes\") || str.contains(\"yeah\") || str.contains(\"accept\"))\n\t \t\ttype = CommType.ACCEPT;\n\t \telse if(str.contains(\"no\") || str.contains(\"instead\"))\n\t \t\ttype = CommType.REJECT;\n \t} else if(LearningAlgorithm.currCommunicator == Constants.HUMAN){\n\t \tif(str.contains(\"suggest\"))\n\t \t\ttype = CommType.SUGGEST;\n\t \telse if(str.contains(\"extinguish\"))\n\t \t\ttype = CommType.UPDATE;\n \t}\n\n \tif(type == CommType.ACCEPT){\n \t\thumanAction = suggestedHumanAction; \t\t\t\n \t}\n \telse if(type == CommType.REJECT || type == CommType.UPDATE){\n \t\thumanAction = MyWorld.getActionFromInput(str);\n \t} else if(type == CommType.SUGGEST){\n \t\tint index = str.indexOf(\"suggest\");\n \t\tString humanStr = str.substring(0, index);\n \t\tString robotStr = str.substring(index);\n \t\thumanAction = MyWorld.getActionFromInput(humanStr);\n \t\trobotAction = MyWorld.getActionFromInput(robotStr);\n \t}\n \tSystem.out.println(\"type \"+type+\" humanAction \"+humanAction);\n \tif(type == null || humanAction == null){\n \t\tSystem.out.println(\"What was the type of communication (A = Accept, R = Reject, S = Suggest, U = Update)?\");\n \t\ttype = getCommType(Constants.scan.next().toUpperCase().trim().charAt(0));\n \t\tif(type == CommType.ACCEPT){\n \t\t\thumanAction = suggestedHumanAction;\n \t\t} else{\n\t \t\tSystem.out.println(\"What was the human's action? (A = Alpha, B = Bravo, C = Charlie, D = Delta, E = Echo)\");\n\t \t\thumanAction = getAction(Constants.scan.next().toUpperCase().charAt(0)); \t\n \t\t}\n \t}\n \tif(type == CommType.SUGGEST && robotAction == null){\n \t\tSystem.out.println(\"What was the suggested robot action? (A = Alpha, B = Bravo, C = Charlie, D = Delta, E = Echo)\");\n \t\trobotAction = getAction(Constants.scan.next().toUpperCase().charAt(0));\n \t}\n \t\t\n \tCommResponse response = new CommResponse(type, humanAction, robotAction);\n \tSystem.out.println(response);\n \treturn response;\n }", "private void help() {\n for (GameMainCommandType commandType : GameMainCommandType.values()) {\n System.out.printf(\"%-12s%s\\n\", commandType.getCommand(), commandType.getInfo());\n }\n System.out.println();\n }", "private static void showHelp(){\r\n JOptionPane.showMessageDialog(null, \"1. Choose the faculty.\\n\"\r\n + \"2. Type in the year when the school year started in format YYYY.\\n\"\r\n + \"3. Choose the semester.\\n\"\r\n + \"4. Enter subject codes separated by semicolon. You can add them all at once or add other subjects later.\\n\"\r\n + \"5. Press the Add button to load schedule options.\\n\"\r\n + \"6. Click on the loaded options you want to choose. Their color will turn red.\\n\"\r\n + \"7. Save the options you chose to the text file through File -> Save.\\n\",\r\n \"How-to\", JOptionPane.PLAIN_MESSAGE);\r\n }", "private static void printUsage() {\r\n\t\t//TODO: print out clear usage instructions when there are problems with\r\n\t\t// any command line args\r\n\t\tSystem.out.println(\"This program expects three command-line arguments, in the following order:\"\r\n\t\t\t\t+ \"\\n -q for storing as a queue, -c for console output, and the input file name.\");\r\n\t}", "public static String parser(String input) throws IOException{\n\t\tif (input == null)\n\t\t\treturn \"Null input!\";\n\t\t\n\t\telse if (input.startsWith(\"HTTPClient \")){\n\t\t\tinput = input.replace(\"HTTPClient \", \"\"); // Cut HTTPClient of the string so we can handle the command more easily.\n\t\t\t\t\t\t\n\t\t\tif(\"exit\".equals(input))\n\t\t\t\treturn EXIT();\n\t\t\t\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tString[] splitted = input.split(\"\\\\s+\"); // Split around spaces\n\t\t\t\tString command = splitted[0];\n\t\t\t\tString uri = splitted[1];\n\t\t\t\tint port = Integer.parseInt(splitted[2]);\n\t\t\t\tSystem.out.println(uri);\n\t\t\t\tSystem.out.println(port);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (command.startsWith(\"HEAD\")){\n\t\t\t\t\treturn HEAD(uri, port);\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if (command.startsWith(\"GET\")){\n\t\t\t\t\treturn GET(uri, port);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (command.startsWith(\"PUT\")){\n\t\t\t\t\treturn PUT(uri, port);\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if (command.startsWith(\"POST\")){ \n\t\t\t\t\treturn POST(uri, port);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}" ]
[ "0.689711", "0.6723283", "0.6686088", "0.6436728", "0.6434296", "0.63760257", "0.6367849", "0.63637257", "0.6350117", "0.6334053", "0.6331912", "0.6317768", "0.627845", "0.6275868", "0.62705564", "0.62537205", "0.6246895", "0.62375647", "0.6222249", "0.6219268", "0.6210991", "0.6204068", "0.61989015", "0.6197134", "0.6188464", "0.6176571", "0.617418", "0.61603034", "0.61520165", "0.6148567", "0.61462265", "0.6140835", "0.6129408", "0.6122561", "0.6107807", "0.61042476", "0.60937905", "0.6085358", "0.6080139", "0.6079102", "0.6074883", "0.60570973", "0.60368973", "0.60333794", "0.601078", "0.60067266", "0.5988434", "0.5975805", "0.59705013", "0.5969124", "0.5960375", "0.5953225", "0.5943565", "0.59394574", "0.59191906", "0.5907037", "0.5884076", "0.5881392", "0.5877518", "0.5877472", "0.5877198", "0.5872364", "0.5863896", "0.5851659", "0.58451277", "0.5840551", "0.5837516", "0.5837413", "0.5834687", "0.5830754", "0.5817579", "0.5809176", "0.58046", "0.5802283", "0.5794841", "0.5787068", "0.57683873", "0.57569605", "0.5755036", "0.5750099", "0.5742534", "0.5740886", "0.573942", "0.57341087", "0.5727753", "0.5721163", "0.5716232", "0.57109654", "0.57046956", "0.57027066", "0.5698195", "0.56969255", "0.5675248", "0.5668543", "0.5664711", "0.5660691", "0.5652269", "0.56504285", "0.56496876", "0.5647996", "0.56416696" ]
0.0
-1
throws npe if sessionConfig is null
public void setSessionConfig( Properties sessionConfig ) { if ( sessionConfig == null ) { MessageFormat problem = new MessageFormat( rbm.getString( rbKeySetNullProp ) ); throw new NullPointerException( problem .format( new Object[]{ cl +"ssc" } ) ); } this.sessionConfig = sessionConfig; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Session getSession() throws Exception {\n\t\treturn null;\n\t}", "@Override\n public SessionCookieConfig getSessionCookieConfig() {\n return null;\n }", "protected boolean shouldValidateSession ()\n {\n return false;\n }", "@Override\r\n public PhoenixSession getSession()\r\n {\n return null;\r\n }", "@Override\n\tpublic SessionConfig getSessionConfig(String appkey) {\n\t\treturn sessionStore.getSessionConfig(appkey);\n\t}", "public void testGetSessionContext() throws Exception {\n assertNotNull(\"The session context has to be set.\", invoiceSessionBean.getSessionContext());\n }", "boolean hasSession();", "@Test\n void getSessionStateNoSessionId() {\n // Act & Assert\n StepVerifier.create(managementChannel.getSessionState(null, LINK_NAME))\n .verifyError(NullPointerException.class);\n\n StepVerifier.create(managementChannel.getSessionState(\"\", LINK_NAME))\n .verifyError(IllegalArgumentException.class);\n\n verifyNoInteractions(requestResponseChannel);\n }", "public void setSession(Session session) { this.session = session; }", "protected void onSessionStateChange(SessionState state, Exception exception) {\n }", "@Override\n\tprotected Session doReadSession(Serializable sessionId) {\n\t\treturn null;\n\t}", "boolean isSessionValid(Object session);", "public void setSession(Session session) {\n\tthis.session = session; \r\n}", "@Test\r\n void checkSession() {\n }", "public Session createEmptySession();", "@Override\n\t\tpublic HttpSession getSession() {\n\t\t\treturn null;\n\t\t}", "public abstract I_SessionInfo getSession(I_SessionName sessionName);", "@Test\n public void getNotExistingSession() throws Exception {\n addDevice();\n assertEquals(\"Session should be created\", snmpSession, snmpController.getSession(device.deviceId()));\n assertEquals(\"Map should contain session\", 1, snmpController.snmpDeviceMap.size());\n assertEquals(\"Session should be fetched from map\", snmpSession, snmpController.getSession(device.deviceId()));\n }", "@Override\r\n \t\t\tpublic SSession getSession(long sessionId) throws SSessionNotFoundException {\n \t\t\t\treturn null;\r\n \t\t\t}", "@Override\n\tpublic HttpSessionContext getSessionContext() {\n\t\treturn null;\n\t}", "private Session() {\n }", "private Session() {\n }", "@Before\n public void getTestSession() {\n if (sessionId == null) {\n sessionId = Util.getSessionID();\n }\n }", "Session getSession();", "Session getSession();", "public WebServiceConfig()\n {\n// session1 = new sessionmanager(getApplicationContext);\n\n }", "@Override\n\tpublic ServerSession getServerSession() throws JMSException {\n\t\treturn null;\n\t}", "boolean hasSessionTemplate();", "@Deprecated\n @InlineMe(replacement = \"null\")\n @Override\n public final HttpSessionContext getSessionContext() {\n return null;\n }", "private void setupSession() {\n // TODO Retreived the cached Evernote AuthenticationResult if it exists\n// if (hasCachedEvernoteCredentials) {\n// AuthenticationResult result = new AuthenticationResult(authToken, noteStoreUrl, webApiUrlPrefix, userId);\n// session = new EvernoteSession(info, result, getTempDir());\n// }\n ConnectionUtils.connectFirstTime();\n updateUiForLoginState();\n }", "public default void sessionCreated(HttpSessionEvent se) {\n }", "Session getCurrentSession();", "Session getCurrentSession();", "public abstract I_SessionInfo getSessionInfo(I_SessionName sessionName);", "public abstract void initialize(ISession session);", "Session getValidSession() {\n final Session session = sessionProvider.getActiveSession();\n // Only use session if it has auth token.\n if (session != null && session.getAuthToken() != null &&\n !session.getAuthToken().isExpired()) {\n return session;\n } else {\n return null;\n }\n }", "@Test\n void setSessionStateNoSessionId() {\n // Arrange\n final byte[] sessionState = new byte[]{10, 11, 8, 88, 15};\n\n // Act & Assert\n StepVerifier.create(managementChannel.setSessionState(null, sessionState, LINK_NAME))\n .verifyError(NullPointerException.class);\n\n StepVerifier.create(managementChannel.setSessionState(\"\", sessionState, LINK_NAME))\n .verifyError(IllegalArgumentException.class);\n\n verifyNoInteractions(requestResponseChannel);\n }", "SessionManagerImpl() {\n }", "@Override\n public void sessionCreated(HttpSessionEvent event) {\n }", "@Override\n\tprotected Serializable doCreate(Session session) {\n\t\treturn null;\n\t}", "public Session getSession();", "protected Session getSession() { return session; }", "InternalSession createEmptySession();", "@Override\r\npublic void setSession(Map<String, Object> arg0) {\n\t\r\n}", "public String testSession() {\n ActionContext context = ActionContext.getContext();\n Map session = context.getSession(); //session\n Struts2Utils.renderJson(session);\n return null;\n }", "@Bean\n @Override\n protected NullAuthenticatedSessionStrategy sessionAuthenticationStrategy() {\n return new NullAuthenticatedSessionStrategy();\n }", "@Test\n void getSessionStateNull() {\n // Arrange\n final String sessionId = \"A session-id\";\n\n final Map<String, Object> responseBody = new HashMap<>();\n responseBody.put(ManagementConstants.SESSION_STATE, null);\n responseMessage.setBody(new AmqpValue(responseBody));\n\n // Act & Assert\n StepVerifier.create(managementChannel.getSessionState(sessionId, LINK_NAME))\n .verifyComplete();\n\n verify(requestResponseChannel).sendWithAck(messageCaptor.capture(), isNull());\n\n final Message sentMessage = messageCaptor.getValue();\n assertTrue(sentMessage.getBody() instanceof AmqpValue);\n\n final AmqpValue amqpValue = (AmqpValue) sentMessage.getBody();\n\n @SuppressWarnings(\"unchecked\") final Map<String, Object> hashMap = (Map<String, Object>) amqpValue.getValue();\n assertEquals(sessionId, hashMap.get(ManagementConstants.SESSION_ID));\n\n // Assert application properties\n final Map<String, Object> applicationProperties = sentMessage.getApplicationProperties().getValue();\n assertEquals(OPERATION_GET_SESSION_STATE, applicationProperties.get(MANAGEMENT_OPERATION_KEY));\n }", "@Override\n\tpublic void sessionDestroyed(HttpSessionEvent arg0) {\n\t\tlog.info(\"------ sessionListen-----init------\");\n\t}", "public void setSession(Session value);", "@Override\r\npublic void sessionCreated(HttpSessionEvent arg0) {\n\t\r\n}", "@Test\r\n public void testGetSession() {\r\n System.out.println(\"getSession\");\r\n assertNotNull(sm);\r\n \r\n ISimulationSessionInfo result = sm.getSession(\"test1\");\r\n assertNotNull(result);\r\n assertEquals(result.getRequester(), \"junit\");\r\n }", "@Override\n public CreateSessionResponse createSession()\n throws EwalletException {\n return null;\n }", "@Override\r\npublic void sessionWillPassivate(HttpSessionEvent arg0) {\n\t\r\n}", "private void doConfiguration(HttpServletRequest request, HttpSession session) {\r\n\t\tConfigurationManager configurationManager = (ConfigurationManager) getBean(\"configurationManager\");\r\n\r\n\t\tsession.setAttribute(\"showMenu\", configurationManager.isActive(\"show.menu\", false));\r\n\r\n\t\t// course\r\n\t\tsession.setAttribute(\"singleprice\", configurationManager.isActive(\"access.course.singleprice\", false));\r\n\t\tsession.setAttribute(\"usePayment\", configurationManager.isActive(\"access.course.usePayment\", true));\r\n\t\tsession.setAttribute(\"showDuration\", configurationManager.isActive(\"access.course.showDuration\", true));\r\n\t\tsession.setAttribute(\"showDescription\", configurationManager.isActive(\"access.course.showDescription\", true));\r\n\t\tsession.setAttribute(\"showDescriptionToPublic\", configurationManager.isActive(\"access.course.showDescriptionToPublic\", true));\r\n\t\tsession.setAttribute(\"showRole\", configurationManager.isActive(\"access.course.showRole\", true));\r\n\t\tsession.setAttribute(\"showType\", configurationManager.isActive(\"access.course.showType\", true));\r\n\t\tsession.setAttribute(\"showRestricted\", configurationManager.isActive(\"access.course.showRestricted\", true));\r\n\t\tsession.setAttribute(\"useServiceArea\", configurationManager.isActive(\"access.course.useServiceArea\", true));\r\n\t\tsession.setAttribute(\"showCourseName\", configurationManager.isActive(\"access.course.showCourseName\", true));\r\n\t\tsession.setAttribute(\"useAttendants\", configurationManager.isActive(\"access.course.useAttendants\", false));\r\n\t\tsession.setAttribute(\"useRegisterBy\", configurationManager.isActive(\"access.course.useRegisterBy\", true));\r\n\t\tsession.setAttribute(\"useOrganization2\", configurationManager.isActive(\"access.course.useOrganization2\", false));\r\n\t\tsession.setAttribute(\"showAttendantDetails\", configurationManager.isActive(\"access.course.showAttendantDetails\", true));\r\n\t\tsession.setAttribute(\"showAdditionalInfo\", configurationManager.isActive(\"access.course.showAdditionalInfo\", true));\r\n\t\tsession.setAttribute(\"filterlocation\", configurationManager.isActive(\"access.course.filterlocation\", false));\r\n\t\t\r\n\t\t// registration\r\n\t\tsession.setAttribute(\"canDelete\", configurationManager.isActive(\"access.registration.delete\", false));\r\n\t\tsession.setAttribute(\"userdefaults\", configurationManager.isActive(\"access.registration.userdefaults\", false));\r\n\t\tsession.setAttribute(\"emailrepeat\", configurationManager.isActive(\"access.registration.emailrepeat\", false));\r\n\t\tsession.setAttribute(\"showEmployeeFields\", configurationManager.isActive(\"access.registration.showEmployeeFields\", true));\r\n\t\tsession.setAttribute(\"showServiceArea\", configurationManager.isActive(\"access.registration.showServiceArea\", false));\r\n\t\tsession.setAttribute(\"showJobTitle\", configurationManager.isActive(\"access.registration.showJobTitle\", true));\r\n\t\tsession.setAttribute(\"showWorkplace\", configurationManager.isActive(\"access.registration.showWorkplace\", true));\r\n\t\tsession.setAttribute(\"showComment\", configurationManager.isActive(\"access.registration.showComment\", true));\r\n\t\tsession.setAttribute(\"useBirthdateForRegistration\", configurationManager.isActive(\"access.registration.useBirthdate\", false));\r\n\t\tsession.setAttribute(\"useWaitlists\", configurationManager.isActive(\"access.registration.useWaitlists\", true));\r\n\t\tsession.setAttribute(\"useParticipants\", configurationManager.isActive(\"access.registration.useParticipants\", false));\r\n\t\t\r\n\t\t// organization\r\n\t\tsession.setAttribute(\"useOrganizationType\", configurationManager.isActive(\"access.organization.useType\", false));\r\n\t\t\r\n\t\t// location\r\n\t\tsession.setAttribute(\"usePostalCode\", configurationManager.isActive(\"access.location.usePostalCode\", true));\r\n\t\t\r\n\t\t// user\r\n\t\tsession.setAttribute(\"useBirthdateForUser\", configurationManager.isActive(\"access.user.useBirthdate\", false));\r\n\t\tsession.setAttribute(\"useWebsiteForUser\", configurationManager.isActive(\"access.user.useWebsite\", false));\r\n\t\tsession.setAttribute(\"useCountryForUser\", configurationManager.isActive(\"access.user.useCountry\", false));\r\n\t\t\r\n\t\t\r\n\t\t// profile\r\n\t\tsession.setAttribute(\"showAddress\", configurationManager.isActive(\"access.profile.showAddress\", true));\r\n\t\tsession.setAttribute(\"showInvoiceaddress\", configurationManager.isActive(\"access.profile.showInvoiceaddress\", true));\r\n\r\n\t\t// lists\r\n\t\tsession.setAttribute(\"itemCount\", configurationManager.getValue(\"list.itemCount\", \"50\"));\r\n\t}", "Object getNativeSession();", "@Test\n\tpublic void testIsSession() {\n\t\t\n\t\tclub.CreerSession();\n\t\tassertNotNull(\"Aucune session n'a été pas créée\", club.getSession());\n\t\t\n\t}", "public boolean CheckSession(String session) { return validSessions.containsKey(session); }", "@Override\n\t\t\tpublic void handleSessionEstablishmentError(Throwable error) throws Exception {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void sessionCreated(HttpSessionEvent arg0) {\n\t\t\n\t}", "@OnError\n\tpublic void onError(Session session, Throwable throwable) {\n\t}", "public Session getSession() { return session; }", "@Override\r\n\tpublic void setSession(Map<String, Object> session) \r\n\t{\n\t\tthis.session = session;\r\n\t}", "private ShoppingCart getExistingScFromSession(HttpServletRequest request) throws UnartigSessionExpiredException\n {\n HttpSession s = request.getSession();\n ShoppingCart shoppingCart = (ShoppingCart) s.getAttribute(Registry._NAME_SHOPPING_CART_SESSION);\n if (shoppingCart == null)\n {\n _logger.debug(\"no shopping cart found in session. throwing exception\");\n throw new UnartigSessionExpiredException(\"Session expired, no Shopping cart available\");\n }\n return shoppingCart;\n }", "@Override\n\t\t\tpublic void handleNewSession() throws Exception {\n\t\t\t\t\n\t\t\t}", "@Override\n public StandardBizResponse extendSession(\n StandardBizRequest standardBizRequest)\n throws EwalletException {\n return null;\n }", "public void setSession(Session session) {\r\n this.session = session;\r\n }", "public SessionDao(Configuration configuration) {\n super(Session.SESSION, com.scratch.database.mysql.jv.tables.pojos.Session.class, configuration);\n }", "private void checkAuthSessionToken() {\n val auth = config.getString(\"authSessionToken\");\n\n checkArgument(auth.length() > 10, \"auth string (sessionToken) length is less than or equal to 10!\");\n }", "private Session session(Properties props) {\n return Session.getInstance(props,\n new Authenticator() {\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(\"[email protected]\", \"happinessbarometer2014\");\n }\n }\n );\n }", "@Override\n\tpublic void setSession(Map<String, Object> session)\n\t{\n\t\tthis.session = session;\n\n\t}", "@Override\n\tpublic CacheHttpSession getSession(String sessionId) {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session=session;\n\t}", "void sessionExpired();", "public void setSessionEnabled(Boolean sessionEnabled) {\n this.sessionEnabled = sessionEnabled;\n }", "@Override\n\t\tpublic HttpSession getSession(boolean create) {\n\t\t\treturn null;\n\t\t}", "@Override\n public void sessionCreated(IoSession session) {\n }", "private Session getSession() throws RepositoryException {\n return getRepository().loginAdministrative(null);\n }", "boolean isSetSessionID();", "@Override\r\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session=session;\r\n\t}", "public void setSession(Map<String, Object> session) {\n\t\t\n\t}", "@Override\n\tpublic void sessionCreated(IoSession arg0) throws Exception {\n\n\t}", "public void setSessionName(String sessionName) {\n\t\tthis.sessionName = sessionName;\n\t\t\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\t\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\t\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\tthis.session = arg0;\n\t\t\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session = session;\n\t}", "com.weizhu.proto.WeizhuProtos.SessionOrBuilder getSessionOrBuilder();", "@Override\r\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\t\r\n\t}", "private void getHibernateSession() {\n try {\n session = em.unwrap(Session.class)\n .getSessionFactory().openSession();\n\n } catch(Exception ex) {\n logger.error(\"Failed to invoke the getter to obtain the hibernate session \" + ex.getMessage());\n ex.printStackTrace();\n }\n\n if(session == null) {\n logger.error(\"Failed to find hibernate session from \" + em.toString());\n }\n }", "public void setSession(Map<String, Object> session)\r\n\t{\n\t\tthis.session = session;\r\n\t}", "@Override\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\tthis.session = arg0;\n\t}", "public AuthStorageSession() { \n }", "@Override\n\tpublic MemberVO getSession() {\n\t\treturn null;\n\t}", "public Session() {\n\t\tLogger.log(\"Creating application session\");\n\t}", "@Override\r\n\tpublic void setSession(Map<String, Object> arg0) {\n\t\tthis.session = arg0;\r\n\t}", "private void checkSessionExpired(HttpServletRequest request) throws UnartigSessionExpiredException\n {\n HttpSession session = request.getSession(false);\n if (session == null || session.getAttribute(Registry._NAME_SHOPPING_CART_SESSION) == null)\n {\n _logger.warn(\"Session has expired during check-out process! throwing session-expired exception\");\n throw new UnartigSessionExpiredException(\"Session expired during check-out\");\n }\n }", "@Override\r\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session = session;\r\n\t}", "@Override\r\n\tpublic void setSession(Map<String, Object> session) {\n\t\tthis.session = session;\r\n\t}", "@Override\n\tpublic void call(Session session, SessionState state, Exception exception) {\n\t\tMylog.i(TAG, \"session call start\");\n\t\tonSessionStateChange(session, state, exception);\n\t}", "void sessionCreated(SessionEvent se);" ]
[ "0.64464235", "0.6394447", "0.62233776", "0.61322093", "0.59476626", "0.59439856", "0.594288", "0.5898713", "0.5889945", "0.5883866", "0.5855888", "0.5851432", "0.57929873", "0.57576704", "0.5750592", "0.5747114", "0.56985176", "0.5693727", "0.5684398", "0.56489617", "0.5590172", "0.5590172", "0.55829126", "0.55756164", "0.55756164", "0.5541235", "0.55293256", "0.55272484", "0.55192107", "0.55092776", "0.5506382", "0.5497548", "0.5497548", "0.5490768", "0.5473588", "0.5454035", "0.5451485", "0.5451198", "0.54459196", "0.5438452", "0.54349387", "0.54267865", "0.5393386", "0.53884804", "0.5385188", "0.53805995", "0.5377293", "0.53743315", "0.53737795", "0.53642964", "0.5362366", "0.53591084", "0.5347642", "0.5333667", "0.53232366", "0.5322888", "0.5309161", "0.52958107", "0.5272578", "0.5270103", "0.5262551", "0.52623975", "0.5257413", "0.52552414", "0.5233525", "0.52332336", "0.5227133", "0.5217715", "0.5212865", "0.5208735", "0.5208133", "0.5198747", "0.5193477", "0.51809436", "0.5168306", "0.51588917", "0.51569927", "0.5156344", "0.5148855", "0.51366544", "0.5135205", "0.5133822", "0.5129484", "0.5129484", "0.51255953", "0.5121282", "0.5117312", "0.51160944", "0.51150703", "0.5109043", "0.510477", "0.5101798", "0.51007736", "0.5096561", "0.50961584", "0.50945276", "0.50833386", "0.50833386", "0.508076", "0.5079793" ]
0.68358195
0
Created by zjh on 2016/5/11.
public interface EaseConversationListContract { //界面处理逻辑 interface View extends BaseView { void initView(); void getOrderData(HelpBean beans); void getServiceInfo(ServiceEmchatBean.DataBean serviceEmchatBean); } //业务处理逻辑 interface Presenter extends BasePresenter<View> { void getToken(String token); void getDataFromServer(); void getServiceInfo(); // boolean isLogin();//是否登录 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void gored() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "private void init() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo38117a() {\n }", "private void kk12() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public void mo4359a() {\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n public void init() {}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n protected void init() {\n }", "@Override\n protected void getExras() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\r\n\tpublic void init() {}", "private Rekenhulp()\n\t{\n\t}", "private void init() {\n\n\n\n }", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "@Override\n\tpublic void init() {\n\t}", "private void strin() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n public void initialize() { \n }", "public void mo6081a() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\n\tprotected void initdata() {\n\n\t}" ]
[ "0.61451495", "0.6043382", "0.5999219", "0.5968427", "0.5893182", "0.5893182", "0.5888416", "0.58737934", "0.582265", "0.5794", "0.577805", "0.5764145", "0.5745372", "0.57397443", "0.5737248", "0.57118964", "0.5710753", "0.57072616", "0.56913245", "0.56872255", "0.56812763", "0.56812763", "0.56702214", "0.56580365", "0.56580365", "0.56580365", "0.56580365", "0.56580365", "0.5643765", "0.56356305", "0.5631838", "0.5612785", "0.56106377", "0.55907947", "0.55870956", "0.5586245", "0.55846477", "0.55821794", "0.5568138", "0.55650944", "0.55650944", "0.55650944", "0.5563848", "0.5561824", "0.5561824", "0.5549561", "0.5540527", "0.5540527", "0.5540527", "0.5520491", "0.55197585", "0.5518716", "0.5518716", "0.5518716", "0.5518215", "0.54943293", "0.54942584", "0.54942584", "0.54872227", "0.5486465", "0.5479564", "0.5477814", "0.5473939", "0.54702526", "0.54702526", "0.54702526", "0.54702526", "0.54702526", "0.54702526", "0.54676116", "0.5462807", "0.5460656", "0.5459669", "0.5453773", "0.5452379", "0.5452379", "0.5452379", "0.5452379", "0.5452379", "0.5452379", "0.5452379", "0.54420805", "0.5441634", "0.5437655", "0.54357326", "0.5433601", "0.5430808", "0.542855", "0.5427271", "0.54153526", "0.5409984", "0.5401272", "0.5401272", "0.53965205", "0.5396323", "0.53916186", "0.5386595", "0.5369367", "0.53673196", "0.5361988", "0.5360515" ]
0.0
-1
\"tags\":[ \n\n ], \"submissionAccess\":[ \n\n ],\n
public static void main(String[] args) { ObjectMapper mapper = new ObjectMapper(); //mapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE); //mapper.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); //mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); String jsonInString = "{'name' : 'mkyong'}"; // JSON from String to Object try { Form obj = mapper.readValue(sample, Form.class); String jsonInStringx = mapper.writeValueAsString(obj); System.out.println(jsonInStringx); } catch (JsonParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JsonMappingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@JsonSetter(\"tags\")\n public void setTags (String value) { \n this.tags = value;\n }", "private String[] extractTags(HttpServletRequest request)\n throws ServletException, IOException {\n String tagline = request.getParameter(\"tags\").toLowerCase();\n String[] tags = {};\n if (!tagline.isEmpty())\n tags = tagline.split(\" \");\n return tags;\n }", "private static ArrayList<JSONObject> getJsonTagSet(Task task) {\n ArrayList<JSONObject> myArray = new ArrayList<>();\n Set<Tag> myTags = task.getTags();\n for (Tag t : myTags) {\n JSONObject myOb = tagToJson(t);\n myArray.add(myOb);\n }\n return myArray;\n }", "public String toString() {\n return \"submission\";\n }", "void setTags(@MaxSize(4096) String serializedTags);", "@JsonSetter(\"tags\")\n public void setTags (Object value) { \n this.tags = value;\n }", "public String[] submissionResponse(String input)\n\t{\n\t\tinput = tselDecrypt(key,input);\n\n\t\tsubmissionResponse=input.split(\"@~|\");\n\n\t\treturn submissionResponse;\n\t}", "@JsonGetter(\"tags\")\n public String getTags ( ) { \n return this.tags;\n }", "@Override\n public String toString() {\n return tags.toString();\n }", "List<Tag> saveTags(String tags);", "public static void main(String[] args) {\n String jsonText = \"{'name': 'Yuki', 'feedback': 'OK'}\";\r\n jsonText = jsonText.replaceAll(\"(')\", \"\\\"\");\r\n\r\n System.out.println(jsonText);\r\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n// trying to make the big deal post insertable but didn't worked out because of the parsing in java\n public String addVote(String body) {\n return \"test\";\n }", "@Override\n protected String[] doInBackground(String... params) {\n String jsonTags = RequestManger.requestGet(params[0]);\n String jsonRest = RequestManger.requestGet(params[1]);\n return new String[]{(jsonTags),(jsonRest)};\n }", "public String getTags() {\n return this.tags;\n }", "public Tag inlineTags()[] {return inlineTags; }", "public static void main(String[] args) throws JsonProcessingException {\n\t\tString txt= \"5C:A8:6A:ED:65:2D,B4:82:C5:00:22:DB,B4:82:C5:51:C2:30,\\\"UREC\\\",2097154,4,14,-59,6,2,Deauth by Inactivity or Many Retries,1517391829738\";\n\t\tString[] spliturl = txt.split(\",\");\n\t\tSystem.out.println(spliturl[0]);\n\t\tSystem.out.println(spliturl[4]);\n\t\tSystem.out.println(spliturl[5]);\n\t}", "public Set<String> getTags(){return tags;}", "@Override\n\t\t\tprotected String doInBackground(String... arg0) {\n\t\t\t\t\n\t\t\t\tList<NameValuePair> params=new ArrayList<NameValuePair>();\n\t\t\t\tparams.add(new BasicNameValuePair(\"tag\",tag));\n\t\t\t\t\n\t\t\t\tString json;\n\t\t\t\t\t\n\t\t\t\t\tjson=jsonParser.makeHttpRequest(url, \"POST\", params);\n\t\t\t\t\t\n\t\t\t\treturn json;\n\t\t\t\t\n\t\t\t}", "@JsonGetter(\"tags\")\n public Object getTags ( ) { \n return this.tags;\n }", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "Map<String, String> tags();", "public String getTags() {\n return tags;\n }", "public String getTags() {\n return tags;\n }", "private void assembleTags(Question question, String userTags) {\n\t\tif (userTags != null && !userTags.isEmpty()) {\n\t\t\tString[] tagNames = userTags.split(Constants.COMMA_DELIMITER);\n\t\t\tif (tagNames.length > 0) {\n\t\t\t\tList<Tag> tags = new ArrayList<Tag>();\n\t\t\t\tfor (String tagName : tagNames) {\n\t\t\t\t\tTag tag = new Tag();\n\t\t\t\t\ttag.setName(tagName);\n\t\t\t\t\ttags.add(tag);\n\t\t\t\t}\n\t\t\t\tquestion.setTags(tags);\n\t\t\t}\n\t\t}\n\t}", "public static String convertPoSToJson(String hitResultString){\n if (hitResultString == null || hitResultString.isEmpty()) return hitResultString;\n\n try {\n ObjectMapper mapper = AppConfig.getInstance().getObjectMapper();\n ArrayNode annotationArrayNode = mapper.createArrayNode();\n\n String[] words = hitResultString.trim().split(\" \");\n\n StringBuilder sb = new StringBuilder();\n //keep track of the string length we are in.\n int strLenProceesed = 0;\n for (String word : words) {\n String wordToAdd = word;\n String labelToAdd = null;\n\n String[] wordLabel = word.split(DConstants.LABEL_SEPARATOR);\n if (wordLabel.length == 2) {\n wordToAdd = wordLabel[0];\n labelToAdd = wordLabel[1];\n }\n\n int wordLen = wordToAdd.length();\n if (labelToAdd != null) {\n JsonNode node = mapper.createObjectNode();\n ((ObjectNode) node).putArray(\"label\").add(labelToAdd);\n ArrayNode pointsArrayNode = ((ObjectNode) node).putArray(\"points\");\n\n JsonNode pointNode = mapper.createObjectNode();\n ((ObjectNode) pointNode).put(\"start\", strLenProceesed);\n ((ObjectNode) pointNode).put(\"end\", strLenProceesed + wordLen -1); //End index is inclusive.\n ((ObjectNode) pointNode).put(\"text\", wordToAdd);\n pointsArrayNode.add(pointNode);\n\n annotationArrayNode.add(node);\n\n }\n\n sb.append(wordToAdd).append(\" \");\n strLenProceesed += wordLen + 1; //extra 1 for the space.\n }\n\n return mapper.writeValueAsString(annotationArrayNode);\n }\n catch (Exception e) {\n LOG.error(\"convertPoSToJson for item \" + hitResultString + \" Error = \" + e.toString());\n e.printStackTrace();\n return null;\n }\n }", "@Override\n protected String bodyAsJsonString() {\n return gson.toJson(draft);\n }", "@Override\n public String getDescription() {\n return \"Tagged data upload\";\n }", "public static void main(String[] str) {\n String str1 = \"[{\\\"随机欢迎语\\\":[\\\"aaa\\\",\\\"bbbbb\\\",\\\"ccccc\\\"],\\\"no\\\":\\\"1\\\"},{\\\"商品标题\\\":\\\"商品标题\\\",\\\"no\\\":\\\"2\\\"},{\\\"商品卖点\\\":\\\"商品卖点\\\",\\\"no\\\":\\\"3\\\"},{\\\"商品描述\\\":\\\"商品描述\\\",\\\"no\\\":\\\"2\\\"},{\\\"包装清单\\\":\\\"包装清单\\\",\\\"no\\\":\\\"2\\\"},{\\\"随机结束语\\\":[\\\"1111\\\",\\\"2222\\\",\\\"33333\\\"],\\\"no\\\":\\\"2\\\"}]\";\n //System.out.println(JSONObject.);\n JSONArray objects = JSONObject.parseArray(str1);\n List<JSONObject> jsonObjects = JSONObject.parseArray(str1, JSONObject.class);\n for (JSONObject object : jsonObjects) {\n for (Map.Entry<String, Object> en : object.entrySet()) {\n System.out.println(en.getValue());\n }\n }\n\n }", "Map<String, List<String>> getFormDataMultivalue();", "@Override\n protected void onPostExecute(ClarifaiResponse<List<ClarifaiOutput<Concept>>> response) {\n if (!response.isSuccessful()) {\n Toast.makeText(getApplicationContext(), \"API contact error\", Toast.LENGTH_SHORT).show();\n return;\n }\n final List<ClarifaiOutput<Concept>> predictions = response.get();\n if (predictions.isEmpty()) {\n Toast.makeText(getApplicationContext(), \"No results from API\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n final List<Concept> predictedTags = predictions.get(0).data();\n for(int i = 0; i < predictedTags.size(); i++) {\n tags.add(predictedTags.get(i).name());\n }\n printTags();\n }", "public static void main(String[] argv) {\n Owner owner1 = new Owner(1, 111111, \"registered\", 14,\n \"https://www.gravatar.com/avatar/36cdb80d69e1f92ca429bdf69ccb05c6?s=128&d=identicon&r=PG&f=1\",\n \"Blake Lassiter\",\n \"http://stackoverflow.com/users/4805044/blake-lassiter\");\n\n Owner owner2 = new Owner(2, 222222, \"registered\", 14,\n \"https://www.gravatar.com/avatar/36cdb80d69e1f92ca429bdf69ccb05c6?s=128&d=identicon&r=PG&f=1\",\n \"Blake Lassiter\",\n \"http://stackoverflow.com/users/4805044/blake-lassiter\");\n\n Owner owner3 = new Owner(3, 333333, \"registered\", 14,\n \"https://www.gravatar.com/avatar/36cdb80d69e1f92ca429bdf69ccb05c6?s=128&d=identicon&r=PG&f=1\",\n \"Blake Lassiter\",\n \"http://stackoverflow.com/users/4805044/blake-lassiter\");\n\n String json = \"{\\n\" +\n \" \\\"items\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"tags\\\": [\\n\" +\n \" \\\"android\\\",\\n\" +\n \" \\\"android-manifest\\\"\\n\" +\n \" ],\\n\" +\n \" \\\"owner\\\": {\\n\" +\n \" \\\"reputation\\\": 23,\\n\" +\n \" \\\"user_id\\\": 4805044,\\n\" +\n \" \\\"user_type\\\": \\\"registered\\\",\\n\" +\n \" \\\"accept_rate\\\": 14,\\n\" +\n \" \\\"profile_image\\\": \\\"https://www.gravatar.com/avatar/36cdb80d69e1f92ca429bdf69ccb05c6?s=128&d=identicon&r=PG&f=1\\\",\\n\" +\n \" \\\"display_name\\\": \\\"Blake Lassiter\\\",\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/users/4805044/blake-lassiter\\\"\\n\" +\n \" },\\n\" +\n \" \\\"is_answered\\\": false,\\n\" +\n \" \\\"view_count\\\": 13,\\n\" +\n \" \\\"answer_count\\\": 0,\\n\" +\n \" \\\"score\\\": 0,\\n\" +\n \" \\\"last_activity_date\\\": 1462763611,\\n\" +\n \" \\\"creation_date\\\": 1462762986,\\n\" +\n \" \\\"last_edit_date\\\": 1462763611,\\n\" +\n \" \\\"question_id\\\": 37107214,\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/questions/37107214/set-title-to-hidden-on-android-app\\\",\\n\" +\n \" \\\"title\\\": \\\"Set Title To Hidden on Android App\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"tags\\\": [\\n\" +\n \" \\\"android\\\",\\n\" +\n \" \\\"c++\\\",\\n\" +\n \" \\\"windows\\\",\\n\" +\n \" \\\"bluetooth\\\"\\n\" +\n \" ],\\n\" +\n \" \\\"owner\\\": {\\n\" +\n \" \\\"reputation\\\": 937,\\n\" +\n \" \\\"user_id\\\": 1183804,\\n\" +\n \" \\\"user_type\\\": \\\"registered\\\",\\n\" +\n \" \\\"accept_rate\\\": 83,\\n\" +\n \" \\\"profile_image\\\": \\\"https://i.stack.imgur.com/Z5Lyl.jpg?s=128&g=1\\\",\\n\" +\n \" \\\"display_name\\\": \\\"Chris\\\",\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/users/1183804/chris\\\"\\n\" +\n \" },\\n\" +\n \" \\\"is_answered\\\": true,\\n\" +\n \" \\\"view_count\\\": 17,\\n\" +\n \" \\\"answer_count\\\": 1,\\n\" +\n \" \\\"score\\\": 3,\\n\" +\n \" \\\"last_activity_date\\\": 1462763542,\\n\" +\n \" \\\"creation_date\\\": 1462701554,\\n\" +\n \" \\\"last_edit_date\\\": 1462743555,\\n\" +\n \" \\\"question_id\\\": 37098557,\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/questions/37098557/c-winsock-bluetooth-connection-at-command-error-received\\\",\\n\" +\n \" \\\"title\\\": \\\"C++ WinSock Bluetooth Connection - AT Command - Error Received\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"tags\\\": [\\n\" +\n \" \\\"java\\\",\\n\" +\n \" \\\"android\\\",\\n\" +\n \" \\\"user-interface\\\",\\n\" +\n \" \\\"fragment\\\",\\n\" +\n \" \\\"android-orientation\\\"\\n\" +\n \" ],\\n\" +\n \" \\\"owner\\\": {\\n\" +\n \" \\\"reputation\\\": 4,\\n\" +\n \" \\\"user_id\\\": 4835349,\\n\" +\n \" \\\"user_type\\\": \\\"registered\\\",\\n\" +\n \" \\\"profile_image\\\": \\\"https://lh4.googleusercontent.com/-ZFmtDec26j4/AAAAAAAAAAI/AAAAAAAAAC4/RGi5zw-SFao/photo.jpg?sz=128\\\",\\n\" +\n \" \\\"display_name\\\": \\\"jl1992\\\",\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/users/4835349/jl1992\\\"\\n\" +\n \" },\\n\" +\n \" \\\"is_answered\\\": false,\\n\" +\n \" \\\"view_count\\\": 41,\\n\" +\n \" \\\"answer_count\\\": 2,\\n\" +\n \" \\\"score\\\": -1,\\n\" +\n \" \\\"last_activity_date\\\": 1462761445,\\n\" +\n \" \\\"creation_date\\\": 1462750768,\\n\" +\n \" \\\"question_id\\\": 37105990,\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/questions/37105990/android-how-do-i-prevent-class-variables-being-cleared-on-orientation-change\\\",\\n\" +\n \" \\\"title\\\": \\\"Android: how do I prevent class variables being cleared on orientation change\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"has_more\\\": true,\\n\" +\n \" \\\"quota_max\\\": 300,\\n\" +\n \" \\\"quota_remaining\\\": 298\\n\" +\n \"}\";\n Gson gson = new GsonBuilder().create();\n\n String jsonArray = \"[\\n\" +\n \" {\\n\" +\n \" \\\"tags\\\": [\\n\" +\n \" \\\"android\\\",\\n\" +\n \" \\\"android-manifest\\\"\\n\" +\n \" ],\\n\" +\n \" \\\"owner\\\": {\\n\" +\n \" \\\"reputation\\\": 23,\\n\" +\n \" \\\"user_id\\\": 4805044,\\n\" +\n \" \\\"user_type\\\": \\\"registered\\\",\\n\" +\n \" \\\"accept_rate\\\": 14,\\n\" +\n \" \\\"profile_image\\\": \\\"https://www.gravatar.com/avatar/36cdb80d69e1f92ca429bdf69ccb05c6?s=128&d=identicon&r=PG&f=1\\\",\\n\" +\n \" \\\"display_name\\\": \\\"Blake Lassiter\\\",\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/users/4805044/blake-lassiter\\\"\\n\" +\n \" },\\n\" +\n \" \\\"is_answered\\\": false,\\n\" +\n \" \\\"view_count\\\": 13,\\n\" +\n \" \\\"answer_count\\\": 0,\\n\" +\n \" \\\"score\\\": 0,\\n\" +\n \" \\\"last_activity_date\\\": 1462763611,\\n\" +\n \" \\\"creation_date\\\": 1462762986,\\n\" +\n \" \\\"last_edit_date\\\": 1462763611,\\n\" +\n \" \\\"question_id\\\": 37107214,\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/questions/37107214/set-title-to-hidden-on-android-app\\\",\\n\" +\n \" \\\"title\\\": \\\"Set Title To Hidden on Android App\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"tags\\\": [\\n\" +\n \" \\\"android\\\",\\n\" +\n \" \\\"c++\\\",\\n\" +\n \" \\\"windows\\\",\\n\" +\n \" \\\"bluetooth\\\"\\n\" +\n \" ],\\n\" +\n \" \\\"owner\\\": {\\n\" +\n \" \\\"reputation\\\": 937,\\n\" +\n \" \\\"user_id\\\": 1183804,\\n\" +\n \" \\\"user_type\\\": \\\"registered\\\",\\n\" +\n \" \\\"accept_rate\\\": 83,\\n\" +\n \" \\\"profile_image\\\": \\\"https://i.stack.imgur.com/Z5Lyl.jpg?s=128&g=1\\\",\\n\" +\n \" \\\"display_name\\\": \\\"Chris\\\",\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/users/1183804/chris\\\"\\n\" +\n \" },\\n\" +\n \" \\\"is_answered\\\": true,\\n\" +\n \" \\\"view_count\\\": 17,\\n\" +\n \" \\\"answer_count\\\": 1,\\n\" +\n \" \\\"score\\\": 3,\\n\" +\n \" \\\"last_activity_date\\\": 1462763542,\\n\" +\n \" \\\"creation_date\\\": 1462701554,\\n\" +\n \" \\\"last_edit_date\\\": 1462743555,\\n\" +\n \" \\\"question_id\\\": 37098557,\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/questions/37098557/c-winsock-bluetooth-connection-at-command-error-received\\\",\\n\" +\n \" \\\"title\\\": \\\"C++ WinSock Bluetooth Connection - AT Command - Error Received\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"tags\\\": [\\n\" +\n \" \\\"java\\\",\\n\" +\n \" \\\"android\\\",\\n\" +\n \" \\\"user-interface\\\",\\n\" +\n \" \\\"fragment\\\",\\n\" +\n \" \\\"android-orientation\\\"\\n\" +\n \" ],\\n\" +\n \" \\\"owner\\\": {\\n\" +\n \" \\\"reputation\\\": 4,\\n\" +\n \" \\\"user_id\\\": 4835349,\\n\" +\n \" \\\"user_type\\\": \\\"registered\\\",\\n\" +\n \" \\\"profile_image\\\": \\\"https://lh4.googleusercontent.com/-ZFmtDec26j4/AAAAAAAAAAI/AAAAAAAAAC4/RGi5zw-SFao/photo.jpg?sz=128\\\",\\n\" +\n \" \\\"display_name\\\": \\\"jl1992\\\",\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/users/4835349/jl1992\\\"\\n\" +\n \" },\\n\" +\n \" \\\"is_answered\\\": false,\\n\" +\n \" \\\"view_count\\\": 41,\\n\" +\n \" \\\"answer_count\\\": 2,\\n\" +\n \" \\\"score\\\": -1,\\n\" +\n \" \\\"last_activity_date\\\": 1462761445,\\n\" +\n \" \\\"creation_date\\\": 1462750768,\\n\" +\n \" \\\"question_id\\\": 37105990,\\n\" +\n \" \\\"link\\\": \\\"http://stackoverflow.com/questions/37105990/android-how-do-i-prevent-class-variables-being-cleared-on-orientation-change\\\",\\n\" +\n \" \\\"title\\\": \\\"Android: how do I prevent class variables being cleared on orientation change\\\"\\n\" +\n \" }\\n\" +\n \" ]\";\n Type collectionType = new TypeToken<List<Item>>(){}.getType();\n List<Item> items = gson.fromJson(jsonArray, collectionType);\n System.out.println(items.size());\n for (int i = 0; i < items.size();i++) {\n System.out.println(items.get(i).questionId);\n }\n\n Item[] items2 = gson.fromJson(jsonArray, Item[].class);\n ArrayList<Item> items3 = new ArrayList<Item>(Arrays.asList(items2));\n for (int i = 0; i < items3.size();i++) {\n System.out.println(items3.get(i).questionId);\n }\n\n Result r = gson.fromJson(json, Result.class);\n for (int i = 0; i < r.items.size();i++) {\n System.out.println(r.items.get(i).questionId);\n }\n }", "public void setTags(String tags) {\n this.tags = tags;\n }", "public String[] getTags(IEntry entry);", "List<String> getTags() {\r\n return tags;\r\n }", "@Path(\"/tags\")\n\t@GET\n\t@Produces(\"application/json\")\n\tpublic Response getTagsList() {\n\t\tList<String> tags = PhotoDB.getTags();\n\t\t\n\t\tGson gson = new Gson();\n\t\tString jsonText = gson.toJson(tags);\n\t\t\n\t\treturn Response.status(Status.OK).entity(jsonText).build();\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"Add tags attached to this object\")\n\n public List<String> getTags() {\n return tags;\n }", "public void addEntryToGUI(String tags, String entry) {\r\n String[] split = tags.split(\",\");\r\n for (int i = 0; i < split.length; i++) {\r\n if (!m_tags.contains(split[i].trim())) {\r\n m_tags.add(split[i].trim());\r\n }\r\n m_tagsMaster.add(split[i].trim());\r\n }\r\n Collections.sort(m_tags);\r\n this.tags.setListData(m_tags);\r\n }", "@ApiModelProperty(value = \"A comma-separated values list of tags to add to the package.\")\n public String getTags() {\n return tags;\n }", "@Override\n\tpublic String getSubmissionText() {\n\t\treturn model.getSubmissionText();\n\t}", "private void createLearnJSON(){\n json = new JSONObject();\n\n try {\n json.put(\"userID\", global.getUserID());\n StringBuilder p1 = new StringBuilder();\n for (String s: global.getWords()){\n p1.append(p1.toString().equals(\"\") ? s : (\" \" + s));\n }\n json.put(\"p1\", p1.toString());\n json.put(\"p2\", url);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@POST\n public synchronized void doSubmit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {\n getACL().checkPermission(getPermission());\n\n MultipartFormDataParser parser = new MultipartFormDataParser(req);\n\n Map<SvnInfo,String> newTags = new HashMap<>();\n\n int i=-1;\n for (SvnInfo e : tags.keySet()) {\n i++;\n if(tags.size()>1 && parser.get(\"tag\"+i)==null)\n continue; // when tags.size()==1, UI won't show the checkbox.\n newTags.put(e,parser.get(\"name\" + i));\n }\n\n String credentialsId = parser.get(\"_.credentialsId\");\n StandardCredentials upc = null;\n if (credentialsId != null) {\n Item context = req.findAncestorObject(Item.class);\n final List<Authentication> authentications = new ArrayList<>(2);\n authentications.add(Jenkins.getAuthentication());\n if (context.hasPermission(Item.CONFIGURE)) { // TODO should this check EXTENDED_READ?\n authentications.add(ACL.SYSTEM);\n }\n for (Authentication a : authentications) {\n upc = CredentialsMatchers.firstOrNull(CredentialsProvider.lookupCredentials(StandardCredentials.class,\n context,\n a,\n Collections.emptyList()),\n CredentialsMatchers.allOf(CredentialsMatchers.withId(credentialsId), CredentialsMatchers.anyOf(\n CredentialsMatchers.instanceOf(StandardUsernamePasswordCredentials.class),\n CredentialsMatchers.instanceOf(StandardCertificateCredentials.class),\n CredentialsMatchers.instanceOf(SSHUserPrivateKey.class)\n )\n )\n );\n if (upc != null) {\n break;\n }\n }\n }\n new TagWorkerThread(newTags,upc,parser.get(\"comment\")).start();\n\n rsp.sendRedirect(\".\");\n }", "protected String getJSON() {\n/*Generated! Do not modify!*/ return gson.toJson(replyDTO);\n/*Generated! Do not modify!*/ }", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn \"{\\\"a\\\":\"+a+\", \\\"B\\\":\\\"\"+B+\"\\\"}\";\n\t}", "public String getTags() {\n\t\treturn tags;\n\t}", "public String getTags() {\n\t\treturn tags;\n\t}", "public static void main(String[] args) throws IOException {\n List<LinkCommentDTO> linkCommentDTOs = new ArrayList<>();\n ObjectMapper mapper = new ObjectMapper();\n try {\n linkCommentDTOs = mapper.readValue(new File(\"D:\\\\linkAsahy.json\"), new TypeReference<List<LinkCommentDTO>>(){});\n } catch (IOException e) {\n e.printStackTrace();\n }\n// String sessionId = getSessionId(\"[email protected]\",\"pKnTAb\");\n linkCommentDTOs.forEach(linkCommentDTO -> {\n boolean linkNotDie = linkCommentDTO.rapidgator_net.stream().allMatch(s -> isNotDie(s));\n if(linkNotDie) {\n linkCommentDTO.rapidgator_net.stream().forEach(s -> {\n// String[] data = s.split(\"\\\\[|\\\\]\");\n// data = Stream.of(data).distinct().toArray(String[]::new);\n// Pattern p = Pattern.compile(\"\\\\w+-\\\\d+\");\n// for (String link : data) {\n// if(link.startsWith(\"http://ra\") || link.startsWith(\"http://rg\")) {\n// if(!p.matcher(link).find()) {\n// link = link + \"/\" + linkCommentDTO.code_video;\n// }\n System.out.println(s);\n\n// }\n// }\n });\n }\n });\n }", "private interface Tags {\n String SESSION_ID = \"id\";\n String SESSION_ROOM = \"room\";\n String SESSION_TRACK = \"type\";\n String SESSION_TITLE = \"name\";\n String SESSION_ABSTRACT = \"abstract\";\n String SESSION_SPEAKERS = \"speaker\";\n String SESSION_IS_BREAK = \"isBreak\";\n String SESSION_URL = \"link\";\n String SESSION_MODERATOR_URL = \"question\";\n String SESSION_YOUTUBE_URL = \"video\";\n String SESSION_PDF_URL = \"pdf\";\n }", "public static void main(String[] args) {\n\t\t\n\t\tMap<String,Object>m=new HashMap<String,Object>();\n\t\tm.put(\"name\", \"thirupathi\");\n\t\tm.put(\"designation\",\"Automation Tester\");\n\t\tSystem.out.println(m);\n\t\t\n\t\t//JSONObject j=new JSONObject(m);\n\t\tJSONObject j=new JSONObject(m);\n\t\t//j.put(\"name\", \"thirupathi\");\n\t\t//j.put(\"job\", \"testing\");\n\t\tSystem.out.println(j);\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "public Object getTags() {\n return this.tags;\n }", "public void setInlineTags(Tag[] _inlineTags)\n\t{ inlineTags = _inlineTags; }", "@Override\n\tpublic String onData() {\n\t\tMap<String, Object> mapObj = new HashMap<String, Object>();\n\t\tfor (BasicNameValuePair pair : pairs) {\n\t\t\tmapObj.put(pair.getName(), pair.getValue());\n\t\t}\n\t\tGson gson = new Gson();\n\t\tString json = gson.toJson(mapObj);\n\t\treturn json;\n\t}", "List<GistComment> deserializeCommentsFromJson(String json);", "@Test\n public void inlineJsonBlob() throws Exception {\n String jsonText = \"[1, 3, 5, 7]\";\n JsonNode originalNode = DefaultObjectMapper.INSTANCE.readTree(jsonText);\n\n // serialize, which basically just copies the JSON text as is\n String retVal = new SynapseHelper().serializeToSynapseType(MOCK_TEMP_DIR, TEST_PROJECT_ID, TEST_RECORD_ID,\n TEST_FIELD_NAME, UploadFieldTypes.INLINE_JSON_BLOB, originalNode);\n\n // parse back into JSON and compare\n JsonNode reparsedNode = DefaultObjectMapper.INSTANCE.readTree(retVal);\n assertTrue(reparsedNode.isArray());\n assertEquals(reparsedNode.size(), 4);\n assertEquals(reparsedNode.get(0).intValue(), 1);\n assertEquals(reparsedNode.get(1).intValue(), 3);\n assertEquals(reparsedNode.get(2).intValue(), 5);\n assertEquals(reparsedNode.get(3).intValue(), 7);\n }", "public static void main(String[] args) {\n Map<String,String> params = new HashMap<String, String>();\n String[] aa = new String[3];\n aa[0]=\"1\";\n aa[1]=\"2\";\n aa[2]=\"3\";\n String.valueOf(aa);\n System.out.println(String.valueOf(aa));\n params.put(\"userIds\",\"22,33,44\");\n String[] resultArray = null;\n// String contacts = HttpClientsUtil.httpGet(\"http://127.0.0.1:8888/authority/user/contacts/list\",\"\",params);\n// JSONObject myJson = JSONObject.parseObject(contacts);\n /*if(\"success\".equals(myJson.get(\"code\"))){\n JSONArray userArrays =(JSONArray)myJson.get(\"content\");\n int size = userArrays.size();\n resultArray = new String[size];\n for(int i=0;i<size;i++){\n resultArray[i] = ((JSONObject)userArrays.get(i)).get(\"email\")+\"\";\n }\n }*/\n System.out.println(resultArray);\n }", "void shouldParseTheJsonPostData() {\n }", "@Test\n public void testCreateJsonFromIssueEntity() throws Exception {\n List<IssueEntity> issueEntities = new ArrayList<IssueEntity>();\n \n String json1 = \"\"\n + \"{\\n\"\n + \" \\\"issues_in_text\\\": {\\n\"\n + \" \\\"context\\\": \\\"vimger test context\\\",\\n\"\n + \" \\\"k12n\\\": \\\"000\\\",\\n\"\n + \" \\\"subject\\\": \\\"000\\\",\\n\"\n + \" \\\"dod\\\": 60,\\n\"\n + \" \\\"type\\\": \\\"000\\\",\\n\"\n + \" \\\"qas\\\": [\\n\"\n + \" {\\n\"\n + \" \\\"question\\\": \\\"which one is right?\\\",\\n\"\n + \" \\\"options\\\": [\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"A. 1+1=1\\\",\\n\"\n + \" \\\"answer\\\": \\\"1\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"B. 1+1=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"0\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"C. 2+2=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"1\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"D. 2+2=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"0\\\"\\n\"\n + \" }\\n\"\n + \" ]\\n\"\n + \" }\\n\"\n + \" ]\\n\"\n + \" }\\n\"\n + \"}\";\n IssueEntity issue1 = converter.createIssueEntityFromJson(json1);\n issueEntities.add(issue1);\n \n String json2 = \"\"\n + \"{\\n\"\n + \" \\\"issues_in_text\\\": {\\n\"\n + \" \\\"context\\\": \\\"vimger test context\\\",\\n\"\n + \" \\\"k12n\\\": \\\"010\\\",\\n\"\n + \" \\\"subject\\\": \\\"010\\\",\\n\"\n + \" \\\"dod\\\": 70,\\n\"\n + \" \\\"type\\\": \\\"010\\\",\\n\"\n + \" \\\"qas\\\": [\\n\"\n + \" {\\n\"\n + \" \\\"question\\\": \\\"which one is wrong?\\\",\\n\"\n + \" \\\"options\\\": [\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"A. 1+1=1\\\",\\n\"\n + \" \\\"answer\\\": \\\"0\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"B. 1+1=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"1\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"C. 2+2=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"0\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"D. 2+2=4\\\",\\n\"\n + \" \\\"answer\\\": \\\"1\\\"\\n\"\n + \" }\\n\"\n + \" ]\\n\"\n + \" }\\n\"\n + \" ]\\n\"\n + \" }\\n\"\n + \"}\";\n IssueEntity issue2 = converter.createIssueEntityFromJson(json2);\n issueEntities.add(issue2);\n \n String actual = converter.createJsonFromIssueEntity(issueEntities);\n \n assertEquals(issue1, actual);\n }", "@Override\r\n protected void parseAttributes()\r\n {\n\r\n }", "void extractDataFromJson(String commentData);", "private String processandFormReponse(Set<String> lcsSet) throws JSONException{\n\t\tList<String> finalList = new ArrayList<>(lcsSet);\n\t\tCollections.sort(finalList);\n\t\tJSONObject finaljson = new JSONObject();\n\t\tJSONArray jsonArray = new JSONArray();\n\t\tfor(String str : finalList) {\n\t\t\tJSONObject row = new JSONObject();\n\t\t\trow.put(VALUE, str);\n\t\t\tjsonArray.put(row);\n\t\t}\n\t\tfinaljson.put(LCS, jsonArray);\n\t\tString values = finaljson.toString();\n\t\treturn values;\n\t\t\n\t}", "java.lang.String getTagValue();", "public void setTags(String tags) {\n\t\tthis.tags = tags;\n\t}", "public void gsonData() {\n Gson gson = new Gson();\n gson.toJson(list);\n System.out.println(\"gson string is :----->\" + list);\n }", "public static void main(String[] args) throws Exception\n {\n \n JSONArray array=new JSONArray();\n JSONObject object=new JSONObject();\n object.put(\"key1\", \"value1\");\n array.add(object);\n System.out.println(((JSONObject) (array.get(0))).get(\"key1\"));\n \n }", "public TagInfo[] getTags() {\n/* 164 */ return this.tags;\n/* */ }", "public void testTagList() throws Exception\n {\n ObjectMapper m = new ObjectMapper();\n TagList list = new TagList();\n list.add(Tag.A);\n list.add(Tag.B);\n String json = m.writeValueAsString(list);\n\n TagList result = m.readValue(json, TagList.class);\n assertEquals(2, result.size());\n assertSame(Tag.A, result.get(0));\n assertSame(Tag.B, result.get(1));\n }", "@SuppressWarnings(\"unchecked\")\n @JsonProperty(\"tags\")\n @Override\n public List<? extends Tag> getTerms() {\n return (List)super.getTerms();\n }", "private void shareDataOnLinkedin() {\n\n OAuthConsumer consumer = new CommonsHttpOAuthConsumer(Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET);\n consumer.setTokenWithSecret(accessToken.getToken(), accessToken.getTokenSecret());\n DefaultHttpClient httpclient = new DefaultHttpClient();\n HttpPost post = new HttpPost(\"https://api.linkedin.com/v1/people/~/shares\");\n\n try {\n consumer.sign(post);\n } catch (OAuthMessageSignerException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (OAuthExpectationFailedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (OAuthCommunicationException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n // here need the consumer for sign in for post the share\n post.setHeader(\"content-type\", \"text/XML\");\n/*\n <share ><comment > This is a test</comment ><visibility ><code > anyone </code ></\n visibility ></share >*/\n\n /* String myEntity = \"{\" +\n \"\\\"comment\\\":\\\"Check out developer.linkedin.com! \" +\n \"http://linkd.in/1FC2PyG\\\",\" +\n \"\\\"visibility\\\":{\" + \"\\\"code\\\":\\\"anyone\\\"}\" +\n \"}\";*/\n\n String myEntity = \"<share>\"\n + \"<comment>Check out work of Logiguyz Tech!</comment>\"\n + \"<content>\"\n + \"<title>Logiguyz Tech</title>\"\n + \"<description>Great mobile apps development organization</description>\"\n + \"<submitted-url>www.logiguyz.com</submitted-url>\"\n //+ \"<submitted-image-url>http://m3.licdn.com/media/p/3/000/124/1a6/089a29a.png</submitted-image-url>\"\n + \"</content>\"\n + \"<visibility> \"\n + \" <code>anyone</code>\"\n + \"</visibility>\"\n + \"</share>\";\n\n Log.e(\"myEntity\", \"*\" + myEntity);\n try {\n String res = \"\";\n\n post.setEntity(new StringEntity(myEntity));\n org.apache.http.HttpResponse response = httpclient.execute(post);\n if (response != null) {\n HttpEntity resEntity = response.getEntity();\n res = EntityUtils.toString(resEntity);\n // .....Read the response\n }\n\n Log.e(\"response\", res);\n Toast.makeText(Login.this, \"Shared sucessfully\" + res, Toast.LENGTH_SHORT).show();\n } catch (UnsupportedEncodingException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n }", "private static String formatEntry(Object entry){\n return QUOTE + entry.toString() + QUOTE + DELIM;\n }", "@Override\n\tprotected String toJSON()\n\t{\n\t\treturn getJSON(null);\n\t}", "private JsonObject getNewRequestBody(String[] arguments, int tickets, String uuid) throws NumberFormatException {\n JsonObject obj = new JsonObject();\n obj.addProperty(\"userid\", Integer.parseInt(arguments[2]));\n obj.addProperty(\"eventid\", Integer.parseInt(arguments[0]));\n obj.addProperty(\"tickets\", tickets);\n obj.addProperty(\"uuid\", uuid);\n\n return obj;\n }", "public Tags() {\n set (\"\");\n }", "public Tags (String tags) {\n set (tags);\n }", "@Test\n public void testGetVerifiedAssociatedTags() {\n String insertedTagList = \" #awesome, #dry, #newTag \";\n List<Tag> verifiedTags = tagServ.getVerifiedAssociatedTags(insertedTagList);\n List<Tag> allTags = tagServ.getAllTags();\n Assert.assertEquals(5, allTags.size());\n Assert.assertEquals(3, verifiedTags.size());\n }", "public void deletePushQuestionsIDList() {\n\t\tArrayList<String> blank = new ArrayList<String>();\n\t\ttry {\n\t\t\tFileOutputStream fileOutputStream = context.openFileOutput(\n\t\t\t\t\tPUSH_POSTS, Context.MODE_PRIVATE);\n\t\t\tOutputStreamWriter outputStreamWriter = new OutputStreamWriter(\n\t\t\t\t\tfileOutputStream);\n\t\t\tGsonBuilder builder = new GsonBuilder();\n\t\t\tGson gson = builder.create();\n\t\t\tgson.toJson(blank, outputStreamWriter); // Serialize to Json\n\t\t\toutputStreamWriter.flush();\n\t\t\toutputStreamWriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void addTag(String tag){tags.add(tag);}", "@Override\n public String toJson() {\n return \"{'content':'\" + this.content + \"'}\";\n }", "protected void addDeviceTags(JSONArray args, final CallbackContext callbackContext) {\n\t\tLog.d(TAG, \"ADDTAGS\");\n\t\tArrayList<String> tagList = new ArrayList<String>();\n\t\ttry {\n\t\t\tJSONArray tags = args.getJSONArray(0);\n\t\t\tif (tags != null) {\n\t\t\t\tfor (int i = 0; i < tags.length(); i++) {\n\t\t\t\t\ttagList.add(tags.getString(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\tNotificare.shared().addDeviceTags(tagList, new NotificareCallback<Boolean>() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(Boolean result) {\n\t\t\t\t\tif (callbackContext == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcallbackContext.success();\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onError(NotificareError error) {\n\t\t\t\t\tif (callbackContext == null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcallbackContext.error(error.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (JSONException e) {\n\t\t\tcallbackContext.error(\"JSON parse error\");\n\t\t}\n\t}", "@Test\n public void embedded() throws IOException {\n String obj = \"{\\\"authors\\\":[\\\"Ted\\\", \\\"Mark\\\"],\\\"date\\\": {\\\"year\\\":2013,\\\"month\\\":9}}\";\n JsonLexer l = new JsonLexer(new StringReader(obj));\n JsonParser p = new JsonParser(l);\n Map<String, Object> m = p.parseObject();\n assertEquals(2, m.size());\n\n @SuppressWarnings(\"unchecked\")\n List<String> authors = (List<String>)m.get(\"authors\");\n assertEquals(2, authors.size());\n assertEquals(\"Ted\", authors.get(0));\n assertEquals(\"Mark\", authors.get(1));\n\n @SuppressWarnings(\"unchecked\")\n Map<String, Object> date = (Map<String, Object>)m.get(\"date\");\n assertEquals(2, date.size());\n assertEquals(2013L, date.get(\"year\"));\n assertEquals(9L, date.get(\"month\"));\n }", "@Override\n\tpublic String toJSON() {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}", "protected String[] arrayParser(String item){\n return item.replaceAll(\"\\\\{|\\\\}|\\\\[|\\\\]|(\\\\d+\\\":)|\\\"|\\\\\\\\\", \"\").split(\",\");\n }", "private static void createSubmission(String[] attributes, int docuID, int orgID) {\n\t\tint actID = ActivityDetailsService.getActivityDetailsByDocuID(docuID).getId();\n\t\tint submissionID = SubmissionDetailsService.getSubmissionIDByDateSubmittedAndActID(toDateTime(attributes[0]), actID);\n\t\t//System.out.println(\"docuID: \" + docuID);\n\t\tif(submissionID == 0){\n\t\t\t//create submission details\n\t\t\tSubmissionDetails subDet = new SubmissionDetails();\n\t\t\tsubDet.setActID(actID);\n\t\t\tsubDet.setSubmittedBy(attributes[16]);\n\t\t\tsubDet.setContactNo(attributes[17]);\n\t\t\tsubDet.setEmailAddress(attributes[18]);\n\t\t\tsubDet.setDateSubmitted(toDateTime(attributes[0]));\n\t\t\tsubDet.setSubmissionType(attributes[4]);\n\t\t\t\n\t\t\tif(subDet.getSubmissionType().equalsIgnoreCase(\"Special Approval Slip\"))\n\t\t\t\tsubDet.setSasType(attributes[19]);\n\t\t\telse subDet.setSasType(\"-\");\n\t\t\tSubmissionDetailsService.addSubmissionDetails(subDet);\n\t\t\tif(attributes.length >= 21) {\n\t\t\t\tsubmissionID = SubmissionDetailsService.getSubmissionIDByDateSubmittedAndActID(toDateTime(attributes[0]), actID);\n\t\t\t\tcreateCheckingDetails(attributes, submissionID);\n\t\t\t}\n\t\t} else {\n\t\t\tif(attributes.length >= 21) {\n\t\t\t\tsubmissionID = SubmissionDetailsService.getSubmissionIDByDateSubmittedAndActID(toDateTime(attributes[0]), actID);\n\t\t\t\tcreateCheckingDetails(attributes, submissionID);\n\t\t\t}\n\t\t}\n\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate static JSONObject convertCommitList(CommitInfo commitInfo) {\n JSONObject commitInfoJSON = new JSONObject();\n\n commitInfoJSON.put(\"authorLogin\", commitInfo.getAuthorLogin());\n commitInfoJSON.put(\"authoredDate\", commitInfo.getAuthoredDate().toString());\n commitInfoJSON.put(\"committedDate\", commitInfo.getCommittedDate().toString());\n commitInfoJSON.put(\"additions\", commitInfo.getAdditions());\n commitInfoJSON.put(\"deletions\", commitInfo.getDeletions());\n commitInfoJSON.put(\"committedDateInSeconds\", commitInfo.getCommittedDateInSeconds());\n\n DirectoryDistribution dirDistribution = commitInfo.getDirectoryDistribution();\n \n commitInfoJSON.put(\"modelLines\", dirDistribution.getModelLines());\n commitInfoJSON.put(\"controllerLines\", dirDistribution.getControllerLines());\n commitInfoJSON.put(\"viewLines\", dirDistribution.getViewLines());\n commitInfoJSON.put(\"libLines\", dirDistribution.getLibraryLines());\n commitInfoJSON.put(\"otherLines\", dirDistribution.getOtherLines());\n\n return commitInfoJSON;\n }", "public void postTest(LabTest labTest) {\n URL url = null;\n try {\n url = new URL(apiAddress+\"postTest\");\n\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String json = gson.toJson(labTest);\n String encodedString = Base64.getEncoder().encodeToString(json.getBytes());\n\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setDoOutput(true);\n con.setInstanceFollowRedirects( false );\n con.setRequestMethod( \"GET\" );\n con.setRequestProperty( \"Content-Type\", \"application/json\");\n con.setRequestProperty( \"charset\", \"utf-8\");\n con.setRequestProperty( \"Content-Length\", Integer.toString( encodedString.getBytes().length ));\n con.setRequestProperty(\"Data\", encodedString);\n con.setUseCaches( false );\n BufferedReader in = null;\n try {\n in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n } catch (IOException e) {\n e.printStackTrace();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "List<String> getTags() {\n return tags;\n }", "public String getTagLine() {\n return tagLine;\n }", "private void addEntry( List<TicketEntry> entries, JSONObject entry){\n //parsing the entry fields and building it\n String barcode = (String) entry.get(\"barcode\");\n String desc = (String) entry.get(\"description\");\n int amount = Integer.parseInt((String) entry.get(\"amount\"));\n double PPU = Double.parseDouble((String) entry.get(\"PPU\"));\n double discountRate = Double.parseDouble((String) entry.get(\"discountRate\"));\n entries.add(new TicketEntryImpl(barcode,desc,amount,PPU,discountRate));\n }", "public EntryToJson(){\n AccountEntry entry;\n Account acc;\n String fileName;\n ArrayList<AccountEntry> entryList;\n ArrayList<String> accList = Bank.getInstance().getAllAccounts();\n for (int i = 0; i<accList.size();i++) {\n acc = Bank.getInstance().findAccount(accList.get(i));\n entryList = acc.getEntryObjects();\n fileName = acc.getNum()+\".json\";\n\n\n Gson gson = new GsonBuilder().create();\n System.out.println(gson.toJson(entryList));\n\n\n }\n\n }", "public List getTags();", "@Test\n public void testWithoutNewWarnings() {\n String request = \"{\\\"canRunOnFailed\\\":false,\\\"defaultEncoding\\\":\\\"\\\",\\\"failedTotalAll\\\":\\\"\\\",\\\"failedTotalHigh\\\":\\\"\\\",\\\"failedTotalLow\\\":\\\"\\\",\\\"failedTotalNormal\\\":\\\"\\\",\\\"healthy\\\":\\\"0\\\",\\\"pattern\\\":\\\"\\\",\\\"shouldDetectModules\\\":false,\\\"thresholdLimit\\\":\\\"low\\\",\\\"unHealthy\\\":\\\"50\\\",\\\"unstableTotalAll\\\":\\\"\\\",\\\"unstableTotalHigh\\\":\\\"\\\",\\\"unstableTotalLow\\\":\\\"\\\",\\\"unstableTotalNormal\\\":\\\"\\\"}\";\n\n JSONObject input = JSONObject.fromObject(request);\n JSONObject output = PluginDescriptor.convertHierarchicalFormData(input);\n\n assertEquals(\"Wrong JSON \", input, output);\n }", "@Test\n public void testCreateIssueEntityFromJson() throws Exception {\n String json = \"\"\n + \"{\\n\"\n + \" \\\"issues_in_text\\\": {\\n\"\n + \" \\\"context\\\": \\\"vimger test context\\\",\\n\"\n + \" \\\"k12n\\\": \\\"000\\\",\\n\"\n + \" \\\"subject\\\": \\\"000\\\",\\n\"\n + \" \\\"dod\\\": 60,\\n\"\n + \" \\\"type\\\": \\\"000\\\",\\n\"\n + \" \\\"qas\\\": [\\n\"\n + \" {\\n\"\n + \" \\\"question\\\": \\\"which one is right?\\\",\\n\"\n + \" \\\"options\\\": [\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"A. 1+1=1\\\",\\n\"\n + \" \\\"answer\\\": \\\"1\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"B. 1+1=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"0\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"C. 2+2=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"1\\\"\\n\"\n + \" },\\n\"\n + \" {\\n\"\n + \" \\\"option\\\": \\\"D. 2+2=2\\\",\\n\"\n + \" \\\"answer\\\": \\\"0\\\"\\n\"\n + \" }\\n\"\n + \" ]\\n\"\n + \" }\\n\"\n + \" ]\\n\"\n + \" }\\n\"\n + \"}\";\n \n IssueEntity issue = converter.createIssueEntityFromJson(json);\n \n assertEquals(\"vimger test context\", issue.getContext());\n assertEquals(\"000\", issue.getK12n());\n assertEquals(\"000\", issue.getSubject());\n assertEquals(60, issue.getDod(), 0.1);\n assertEquals(\"000\", issue.getType());\n }", "private String toJSONValues(Set<?> resources) {\n if (resources == null) {\n return null;\n }\n StringBuffer values = new StringBuffer();\n Iterator<?> itr = resources.iterator();\n Object resource;\n values.append('[');\n while (itr.hasNext()) {\n resource = itr.next();\n if (resource instanceof IResource) {\n String label = ((IResource) resource).getLabel();\n values.append(\"\\\"\" + StringEscapeUtils.escapeJavaScript(label.trim())\n + \"\\\"\");\n } else {\n values.append(\"\\\"\"\n + StringEscapeUtils.escapeJavaScript(resource.toString().trim())\n + \"\\\"\");\n }\n if (itr.hasNext()) {\n values.append(\", \");\n }\n }\n values.append(']');\n return values.toString();\n }", "public void setTags(List<Tag> tags) {\n this.tags = tags;\n }", "public CreateQueueRequest addTagsEntry(String key, String value) {\n if (null == this.tags) {\n this.tags = new java.util.HashMap<String, String>();\n }\n if (this.tags.containsKey(key))\n throw new IllegalArgumentException(\"Duplicated keys (\" + key.toString() + \") are provided.\");\n this.tags.put(key, value);\n return this;\n }", "@Override\n public String toString() {\n return jsonString;\n }", "@JsonGetter(\"tag\")\r\n public String getTag() {\r\n return tag;\r\n }" ]
[ "0.5235528", "0.5154323", "0.51506466", "0.513559", "0.5020254", "0.49968308", "0.48696232", "0.48405945", "0.47761923", "0.47671214", "0.47295952", "0.4716956", "0.4713841", "0.47006032", "0.46819216", "0.46703368", "0.46645895", "0.46524984", "0.46487698", "0.46345967", "0.46345967", "0.46345967", "0.46345967", "0.46345967", "0.46345967", "0.46345967", "0.46345967", "0.4634518", "0.4634518", "0.45869622", "0.45840588", "0.4559464", "0.4554456", "0.4544628", "0.45284203", "0.45266134", "0.45197418", "0.45099184", "0.45082694", "0.45056188", "0.44936025", "0.44808888", "0.44744778", "0.4471752", "0.44692537", "0.44630882", "0.44558746", "0.44498655", "0.44407132", "0.44372737", "0.44372737", "0.44331264", "0.44242346", "0.4415297", "0.44146696", "0.44142723", "0.44100767", "0.44086853", "0.44041976", "0.43902233", "0.43811417", "0.43751547", "0.43622062", "0.43612096", "0.43593422", "0.4352155", "0.4350273", "0.43490353", "0.43483368", "0.4348002", "0.43429327", "0.4342673", "0.434033", "0.43348366", "0.4333439", "0.43259412", "0.4324722", "0.43145013", "0.4309662", "0.4309212", "0.4304484", "0.4301048", "0.42986467", "0.42905426", "0.42853928", "0.4285363", "0.42848215", "0.4269995", "0.42692173", "0.42657837", "0.4265511", "0.4264324", "0.42622426", "0.4256256", "0.42463747", "0.42438087", "0.42421496", "0.4241999", "0.42414096", "0.42397296", "0.4238583" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
parse size and unit including possibility for decimal or until hits semicolon (if unit not specified)
static void parsePossiblyDecimalSizeValue(Lexer<CSSToken, CharInput> lexer, CSSUnit defaultUnit, BiConsumer<Integer, CSSUnit> toCall) throws IOException, ParserException { CSSParserHelperSize.parsePossiblyDecimalSizeValue( lexer, defaultUnit, INTEGER_OR_UNIT_OR_DOT_OR_SEMICOLON_OR_WS_OR_COMMENT_TOKENS, UNIT_OR_DOT_OR_SEMICOLON_OR_WS_OR_COMMENT_TOKENS, UNIT_OR_SEMICOLON_TOKENS, toCall); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public void validateSize(String t, boolean bZero, boolean bMinus) throws Exception {\n t = t.Trim();\n if (t.Length == 0)\n return ;\n \n // not specified is ok?\n // Ensure we have valid units\n if (t.IndexOf(\"in\") < 0 && t.IndexOf(\"cm\") < 0 && t.IndexOf(\"mm\") < 0 && t.IndexOf(\"pt\") < 0 && t.IndexOf(\"pc\") < 0)\n {\n throw new Exception(\"Size unit is not valid. Must be in, cm, mm, pt, or pc.\");\n }\n \n int space = t.LastIndexOf(' ');\n String n = \"\";\n // number string\n String u = new String();\n try\n {\n // unit string\n // Convert.ToDecimal can be very picky\n if (space != -1)\n {\n // any spaces\n n = t.Substring(0, space).Trim();\n // number string\n u = t.Substring(space).Trim();\n }\n else // unit string\n if (t.Length >= 3)\n {\n n = t.Substring(0, t.Length - 2).Trim();\n u = t.Substring(t.Length - 2).Trim();\n }\n \n }\n catch (Exception ex)\n {\n throw new Exception(ex.Message);\n }\n\n if (n.Length == 0 || !Regex.IsMatch(n, \"\\\\A[ ]*[-]?[0-9]*[.]?[0-9]*[ ]*\\\\Z\"))\n {\n throw new Exception(\"Number format is invalid. ###.## is the proper form.\");\n }\n \n float v = DesignXmlDraw.getSize(t);\n if (!bZero)\n {\n if (v < .1)\n throw new Exception(\"Size can't be zero.\");\n \n }\n else if (v < 0 && !bMinus)\n throw new Exception(\"Size can't be less than zero.\");\n \n return ;\n }", "private void parseUnitLength(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length != 2) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLength argument\");\n\t\t}\n\t\tthis.setUnitLength(Double.parseDouble(tokens[1]));\n\t}", "private Values getApproximateSizeValObj(String data){\n\t\tdata = data.replaceAll(\"[^0-9.x ]\", \"\");\r\n\t\tString[] values = data.split(\"x\");\r\n\t\tValue valObj1 = getValueObj(values[1].trim(), \"Length\", \"in\");\r\n\t\t Value valObj2 = getValueObj(values[2].trim(), \"Width\", \"in\");\r\n\t\t Values valuesObj = new Values();\r\n\t\t List<Value> listOfValue = new ArrayList<>();\r\n\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t valuesObj.setValue(listOfValue);\r\n\t\t return valuesObj;\r\n\t}", "private void parseUnitLengthDegreeScaler(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length == 2) {\n\t\t\tthis.setUnitLengthDegreeScaler(Double.parseDouble(tokens[1]));\n\t\t}\n\t\telse if(tokens.length == 3) {\n\t\t\tdouble firstNumber = Double.parseDouble(tokens[1].replace(\"/\", \"\"));\n\t\t\tdouble secondNumber = Double.parseDouble(tokens[2].replace(\"/\", \"\"));\n\t\t\tdouble degreeScaler = firstNumber / secondNumber;\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse if(tokens.length == 4 && tokens[2].equals(\"/\")) {\n\t\t\tdouble degreeScaler = Double.parseDouble(tokens[1]) / Double.parseDouble(tokens[3]);\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLengthDegreeScaler\");\n\t\t}\n\t}", "public static long parse(String s, ByteUnit defaultUnit) throws NumberFormatException {\n\n // Value must be a floating point number followed by a unit.\n Pattern p = Pattern.compile(\"^\\\\s*(\\\\d+)\\\\s*(\\\\w+)?\\\\s*$\");\n Matcher m = p.matcher(s);\n\n if (!m.matches()) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n }\n\n // Group 1 is the float.\n long l;\n\n try {\n l = Long.valueOf(m.group(1));\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n }\n\n // Group 2 is the unit.\n String unitString = m.group(2);\n ByteUnit unit;\n\n if (unitString == null) {\n if (defaultUnit == null) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n } else {\n unit = defaultUnit;\n }\n } else {\n try {\n unit = ByteUnit.valueOf(unitString.trim());\n } catch (IllegalArgumentException e) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n }\n }\n\n return l * unit.value;\n }", "public static double parseHumanReadable(String datum, String separator, String unit)\n {\n int end = datum.length();\n if (unit != null)\n {\n if (!datum.endsWith(unit))\n throw new NumberFormatException(datum + \" does not end in unit \" + unit);\n end -= unit.length();\n }\n\n Matcher m = BASE_NUMBER_PATTERN.matcher(datum);\n m.region(0, end);\n if (!m.lookingAt())\n throw new NumberFormatException();\n double v = Double.parseDouble(m.group(0));\n\n int pos = m.end();\n if (m.group(2) == null) // possible binary exponent, parse\n {\n m = BINARY_EXPONENT.matcher(datum);\n m.region(pos, end);\n if (m.lookingAt())\n {\n int power = Integer.parseInt(m.group(1));\n v = Math.scalb(v, power);\n pos = m.end();\n }\n }\n\n if (separator != null)\n {\n if (!datum.startsWith(separator, pos))\n throw new NumberFormatException(\"Missing separator \" + separator + \" in \" + datum);\n pos += separator.length();\n }\n else\n {\n while (pos < end && Character.isWhitespace(datum.charAt(pos)))\n ++pos;\n }\n\n if (pos < end)\n {\n char prefixChar = datum.charAt(pos);\n int prefixIndex = UNIT_PREFIXES.indexOf(prefixChar);\n if (prefixIndex >= 0)\n {\n prefixIndex -= UNIT_PREFIXES_BASE;\n ++pos;\n if (pos < end && datum.charAt(pos) == 'i')\n {\n ++pos;\n v = Math.scalb(v, prefixIndex * 10);\n }\n else\n {\n v *= Math.exp(Math.log(1000.0) * prefixIndex);\n }\n }\n }\n\n if (pos != end && unit != null)\n throw new NumberFormatException(\"Unexpected characters between pos \" + pos + \" and \" + end + \" in \" + datum);\n\n return v;\n }", "public int parse (String text, int offset) {\n\t\tParsing t = new Parsing(text, offset);\n\t\tif (true) {\n\t\t\tthis.parsing(t);\n\t\t}\n\t\telse {\t\t\t\t//*** OLD CODE\n\t\t\tdouble val;\n\t\t\tint pos1, pos2, pos3;\n\t\t\tboolean has_value, has_unit;\n\t\t\tif (!initialized) init();\t// Be sure everyting in place\n\n\t\t\t/* Ignore the leading blanks */\n\t\t\tt.gobbleSpaces();\n\t\t\tpos1 = t.pos;\t\t\t// Just before the possible value\n\n\t\t\t/* Interpret the Value, if any */\n\t\t\tval = t.parseFactor();\t\t// Default value is 1\n\t\t\tpos2 = t.pos;\t\t\t// After interpretation of Value\n\t\t\thas_value = pos2 > pos1; \t// Something was found.\n\n\t\t\t/* Skip blanks between value and Unit */\n\t\t\tt.gobbleSpaces();\n\n\t\t\t/* It may happen that interpreting the Value first generates an error,\n\t for instance 1/4. That means that the number (1) is part of the\n\t unit, and is not the value in front of the unit.\n\t\t\t */\n\t\t\tif (t.lookup(op_symb) >= 0) {\n\t\t\t\thas_value = false;\n\t\t\t\tt.pos = pos1;\n\t\t\t\tpos2 = pos1;\n\t\t\t}\n\n\t\t\t/* Interpret the Unit */\n\t\t\thas_unit = true;\n\t\t\tpos3 = t.pos;\t\t\t// Starting offset of unit\n\t\t\ttry { unitec(t, null) ; }\n\t\t\tcatch (Exception e) {\n\t\t\t\thas_unit = false;\n\t\t\t\tt.pos = pos2;\n\t\t\t\tif (!has_value) t.pos = offset;\n\t\t\t}\n\t\t\tif (has_unit) symbol = text.substring(pos3, t.pos);\n\t\t\tvalue = has_value ? val : 0./0. ;\n\t\t}\n\t\treturn(t.pos);\n\t}", "public abstract double fromBasicUnit(double valueJTextInsert);", "private Values getThicknessSizeValObj(String val,String unit){\n\t\tval = val.replaceAll(\"[^0-9.x ]\", \"\");\r\n\t\tString[] values = val.split(\"x\");\r\n\t\tValue valObj1 = null;\r\n\t\tValue valObj2 = null;\r\n\t\tValue valObj3 = null;\r\n\t\tList<Value> listOfValue = new ArrayList<>();\r\n\t\tif(values.length == ApplicationConstants.CONST_INT_VALUE_ONE){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t} else if(values.length == ApplicationConstants.CONST_INT_VALUE_TWO){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t valObj2 = getValueObj(values[1].trim(), \"Thickness\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t} else if(values.length == ApplicationConstants.CONST_INT_VALUE_THREE){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t valObj2 = getValueObj(values[1].trim(), \"Width\", unit);\r\n\t\t\t valObj3 = getValueObj(values[2].trim(), \"Thickness\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t listOfValue.add(valObj3);\r\n\t\t}\r\n\t\t Values valuesObj = new Values(); \r\n\t\t valuesObj.setValue(listOfValue);\r\n\t\t return valuesObj;\r\n\t}", "private Values getFlagSizeValObj(String data){\n\t\tdata = data.replaceAll(\"[^0-9.x ]\", \"\");\r\n\t\tString[] values = data.split(\"x\");\r\n\t\tValue valObj1 = getValueObj(values[0].trim(), \"Length\", \"in\");\r\n\t\t Value valObj2 = getValueObj(values[1].trim(), \"Width\", \"in\");\r\n\t\t Values valuesObj = new Values();\r\n\t\t List<Value> listOfValue = new ArrayList<>();\r\n\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t valuesObj.setValue(listOfValue);\r\n\t\t return valuesObj;\r\n\t}", "private ChronoUnit parseUnit(String unitStr) {\n unitStr = unitStr.toUpperCase();\n // If the unitStr ends with a 'S' then do nothing otherwise add a 'S' to the end\n unitStr = unitStr.charAt(unitStr.length() - 1) == 'S' ? unitStr : unitStr + \"S\";\n // Return the corresponding ChronoUnit\n switch (unitStr) {\n case \"DAYS\":\n return ChronoUnit.DAYS;\n case \"WEEKS\":\n return ChronoUnit.WEEKS;\n case \"HOURS\":\n return ChronoUnit.HOURS;\n case \"SECONDS\":\n return ChronoUnit.SECONDS;\n case \"MINUTES\":\n return ChronoUnit.MINUTES;\n }\n return ChronoUnit.DAYS;\n }", "public static NormalTridasUnit parseUnitString(String str) throws Exception\n\t{\n\t\tstr = str.trim();\n\t\tif ((str==null) || (str.equals(\"\"))) return null;\n\t\n\t\tstr =str.toLowerCase();\n\t\t\n\t\tInteger val;\n\t\tBoolean mmDetected = false;\n\t\t\n\t\t//Remove leading fraction\n\t\tif(str.startsWith(\"1/\")){ str = str.substring(2);}\n\t\t\n\t\t// Remove 'ths'\n\t\tif(str.contains(\"ths\")){ str = str.replace(\"ths\", \"\");}\n\t\t\n\t\t// Remove 'th'\n\t\tif(str.contains(\"th\")){ str = str.replace(\"th\", \"\");}\n\t\t\n\t\t// Remove 'mm'\n\t\tif(str.contains(\"mm\"))\n\t\t{ \n\t\t\tstr = str.replace(\"mm\", \"\");\n\t\t\tmmDetected = true;\n\t\t}\n\t\tif(str.contains(\"millimet\"))\n\t\t{ \n\t\t\tstr = str.replace(\"millimetres\", \"\");\n\t\t\tstr = str.replace(\"millimeters\", \"\");\n\t\t\tstr = str.replace(\"millimetre\", \"\");\n\t\t\tstr = str.replace(\"millimeter\", \"\");\n\t\t\tmmDetected = true;\n\t\t}\n\t\t\n\t\tif(str.length()==0 && mmDetected)\n\t\t{\n\t\t\treturn NormalTridasUnit.MILLIMETRES;\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tval = Integer.parseInt(str.trim());\n\t\t} catch (NumberFormatException e)\n\t\t{\n\t\t\tthrow new Exception(\"Unable to parse units from units string\");\n\t\t}\n\t\t\n\t\tswitch(val)\n\t\t{\t\n\t\t\tcase 10: return NormalTridasUnit.TENTH_MM; \n\t\t\tcase 20: return NormalTridasUnit.TWENTIETH_MM;\n\t\t\tcase 50: return NormalTridasUnit.FIFTIETH_MM;\n\t\t\tcase 100: return NormalTridasUnit.HUNDREDTH_MM; \n\t\t\tcase 1000: return NormalTridasUnit.MICROMETRES; \n\t\t}\n\t\t\n\t\tthrow new Exception(\"Unable to parse units from units string\");\n\t}", "public boolean parsing (Parsing t) {\n\t\tint posini = t.pos;\n\t\tboolean has_value, has_symbol;\n\t\tint pos, j;\n\t\tdouble val;\n\t\tif (!initialized) init();\t\t// Be sure everyting in place\n\n\t\tt.gobbleSpaces();\t\t\t// Ignore the leading blanks\n\t\tpos = t.pos;\n\n\t\tif (DEBUG>0) System.out.print(\"....parsing(\" + t + \"):\");\n\n\t\t/* Interpret the Value, if any */\n\t\tval = t.parseFactor();\t\t\t// Default value is 1\n\t\tif (DEBUG>0) System.out.print(\" val=\" + val);\n\t\thas_value = t.pos > pos; \t\t// NaN when nothing interpreted\n\n\t\t/* Skip blanks between value and Unit */\n\t\tt.gobbleSpaces();\n\n\t\t/* It may happen that interpreting the Value first generates an error,\n\t for instance 1/4. That means that the number (1) is part of the\n\t unit, and is not the value in front of the unit.\n\t\t */\n\t\tif (t.lookup(op_symb) >= 0) {\n\t\t\thas_value = false;\n\t\t\tt.pos = pos;\n\t\t\tif (DEBUG>0) System.out.print(\"(FALSE!)\");\n\t\t}\n\n\t\t/* Interpret the Unit */\n\t\tpos = t.pos;\t\t\t\t// To keep the Unit symbol\n\t\toffset = 0.;\n\t\tsymbol = null;\n\t\tif (DEBUG>0) System.out.println(\"\\n Interpret '\" + t + \"'\");\n\t\ttry { \n\t\t\thas_symbol = unitec(t, null); \n\t\t\tsymbol = String.copyValueOf(t.a, pos, t.pos-pos);\n\t\t\tObject o = hUnit.get(symbol);\n\t\t\tif (o instanceof String) symbol = (String)o;\n\t\t\tif (has_value & (mksa&_pic) != 0) {\t// A misinterpretation ? Rescan\n\t\t\t\tint pos_end = t.pos;\n\t\t\t\tt.set(posini); t.gobbleSpaces();\n\t\t\t\ttry { t.parseComplex(symbol); t.set(pos_end); }\n\t\t\t\tcatch(Exception e) { \n\t\t\t\t\tt.set(posini); \n\t\t\t\t\treturn(false); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e) { \n\t\t\tif (DEBUG>0) {\n\t\t\t\tSystem.out.println(\"++++unitec catched: \" + e);\n\t\t\t\tMessenger.printStackTrace(e);\n\t\t\t\ttry { Thread.sleep(2000); } catch(Exception i) {;}\n\t\t\t}\n\t\t\thas_symbol = false; \n\t\t\tt.pos = pos;\n\t\t}\n\t\tif (DEBUG>0) System.out.println(\"\\n interpret '\" + t \n\t\t\t\t+ \"', has_value=\" + has_value);\n\n\t\t// Default value in log scale is 0 !\n\t\t// if (no_value && ((mksa&_log) != 0)) value = 0;\n\t\t/* Skip the trailing blanks */\n\n\t\t/* The value may follow the unit -- only for dates and \"special\"\n\t\t * quoted unit\n\t\t */\n\t\tif ((!has_value) && (t.pos < t.length)) {\n\t\t\tpos = t.pos;\n\t\t\t// The symbol may be a \"picture\" e.g. \"YYYY/MMM/DD\"\n\t\t\tif ((!has_symbol) && (t.currentChar() == '\"')) {\n\t\t\t\tif ((j = t.matchingQuote()) > 0) {\n\t\t\t\t\tUdef u; int ip1, ip2;\n\t\t\t\t\tString msg;\n\t\t\t\t\tif (DEBUG>0) System.out.println(\n\t\t\t\t\t\t\t\"....parsing: t.matchingQuote()=\" + j);\n\t\t\t\t\tj -= pos; j++;\t\t// Length including quotes\n\t\t\t\t\tsymbol = t.toString(j);\n\t\t\t\t\tt.advance(j);\n\t\t\t\t\tt.gobbleSpaces();\n\t\t\t\t\tpos = t.pos;\n\t\t\t\t\ttry { val = t.parseComplex(symbol); }\n\t\t\t\t\tcatch(ParseException e) {\t// Mismatch: could be mixed up\n\t\t\t\t\t\tmsg = e.getMessage();\n\t\t\t\t\t\tif (msg.indexOf(\"parseComplex((\")>=0) \t// ERROR in pic\n\t\t\t\t\t\t\tSystem.err.println(e);\n\t\t\t\t\t\tt.set(posini);\n\t\t\t\t\t\treturn(false);\n\t\t\t\t\t}\n\t\t\t\t\tif (t.status() != 0) {\t// Something wrong in 'picture'\n\t\t\t\t\t\tmsg = t.error_message;\n\t\t\t\t\t\tif ((ip1 = msg.indexOf(\" interpreted as (\")) >0) {\n\t\t\t\t\t\t\tip1 = msg.indexOf('(', ip1);\n\t\t\t\t\t\t\tip2 = msg.indexOf(')', ip1);\n\t\t\t\t\t\t\tString correct_symbol = msg.substring(ip1+1, ip2);\n\t\t\t\t\t\t\tif (DEBUG>0) System.out.println(\n\t\t\t\t\t\t\t\t\t\"....parsing: adding Hash \"+symbol\n\t\t\t\t\t\t\t\t\t+\" => \"+correct_symbol);\n\t\t\t\t\t\t\t/* Add the new 'picture' as an alias \n\t\t\t\t\t\t\t * to the correctly spelled one.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\thUnit.put(symbol, correct_symbol);\n\t\t\t\t\t\t\tsymbol = correct_symbol;\n\t\t\t\t\t\t\tt.pos = pos;\n\t\t\t\t\t\t\ttry { val = t.parseComplex(symbol); }\n\t\t\t\t\t\t\tcatch (ParseException pe) {\n\t\t\t\t\t\t\t\tSystem.err.println(pe);\n\t\t\t\t\t\t\t\tMessenger.printStackTrace(pe);\n\t\t\t\t\t\t\t\tt.set(posini);\n\t\t\t\t\t\t\t\treturn(false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.err.println(msg);\n\t\t\t\t\t\t\tt.set(posini);\n\t\t\t\t\t\t\treturn(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thas_value = true;\n\t\t\t\t\tif (t.isDate()) u = uLookup(\"MJD\");\n\t\t\t\t\telse if (t.isDays()) u = uLookup(\"d\");\n\t\t\t\t\telse if (t.isTime()) u = uLookup(\"\\\"h:m:s\\\"\");\n\t\t\t\t\telse u = uLookup(\"\\\"d:m:s\\\"\");\n\t\t\t\t\t// The quoted symbol is added, to speed up its retrieval\n\t\t\t\t\t// in the next search.\n\t\t\t\t\ttry {\n\t\t\t\t\t\taddSymbol(symbol, u.symb, Parsing.explainComplex(symbol));\n\t\t\t\t\t\tu = uLookup(symbol);\n\t\t\t\t\t\tu.mksa |= _pic;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (ParseException pe) {\n\t\t\t\t\t\tSystem.err.println(pe); \n\t\t\t\t\t\tMessenger.printStackTrace(pe);\n\t\t\t\t\t}\n\t\t\t\t\tmksa = u.mksa;\n\t\t\t\t\tfactor = u.fact;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (has_symbol && (t.pos<t.length)) {\n\t\t\t\tif (DEBUG>0) System.out.println(\"....parsing: symbol=\" + symbol \n\t\t\t\t\t\t+ \", interpret: \" + t);\n\t\t\t\tif (mksa == _MJD) {\t\t// Get Date + Time\n\t\t\t\t\tif (DEBUG>0) System.out.print(\" parsing via Astrotime(\");\n\t\t\t\t\tAstrotime datime = new Astrotime();\n\t\t\t\t\tif (Character.isLetter(symbol.charAt(0)))\n\t\t\t\t\t\tt.set(posini);\t\t// JD or MJD followed by number\n\t\t\t\t\tif (DEBUG>0) System.out.print(t + \") symbol=\" + symbol);\n\t\t\t\t\thas_value = datime.parsing(t);\n\t\t\t\t\tif (has_value) val = datime.getMJD();\n\t\t\t\t\tif (DEBUG>0) {\n\t\t\t\t\t\tSystem.out.println(\" has_value=\" + has_value \n\t\t\t\t\t\t\t\t+ \", MJD=\" + val);\n\t\t\t\t\t\tdatime.dump(\"datime \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ((mksa&_pic) != 0) {\t// Interpret complex\n\t\t\t\t\ttry { val = t.parseComplex(symbol); has_value = true; }\n\t\t\t\t\tcatch (Exception e) { t.set(posini); return(false); }\n\t\t\t\t}\n\t\t\t\t//* No other case! else val = t.parseFactor();\n\t\t\t}\n\t\t}\n\n\t\t// Final: Store the results.\n\t\tvalue = has_value ? val : 0./0.;\n\t\tif (has_symbol|has_value) {\n\t\t\treturn(true);\n\t\t}\n\t\tt.pos = posini;\n\t\treturn(false);\t\t\t\t// Nothing found...\n\t}", "public int parseUnit (String text, int offset) {\n\t\tint o = parse(text, offset);\n\t\tthis.setUnit();\n\t\treturn(o);\n\t}", "public void setUnit (String text) throws ParseException {\n\t\tthis.set(text);\n\t\tthis.setUnit();\n\t}", "private static float parse_number() {\n skip_spaces();\n\n if (i == l) {\n throw new Error(String.format(\"Unexpected end (s=%s)\", s));\n }\n\n int start = i;\n\n char c = s.charAt(i);\n\n // Consume sign.\n if (c == '-' || c == '+') {\n i += 1;\n c = s.charAt(i);\n }\n\n // Consume integer.\n if (c >= '0' && c <= '9') {\n skip_digits();\n if (i < l) {\n c = s.charAt(i);\n }\n } else if (c != '.') {\n throw new Error(\n String.format(\"Invalid number formating character '%c' (i=%d, s=%s)\", c, i, s));\n }\n\n // Consume fraction.\n if (c == '.') {\n i += 1;\n skip_digits();\n if (i < l) {\n c = s.charAt(i);\n }\n }\n\n if ((c == 'e' || c == 'E') && i + 1 < l) {\n char c2 = s.charAt(i + 1);\n // Check for `em`/`ex`.\n if (c2 != 'm' && c2 != 'x') {\n i += 1;\n c = s.charAt(i);\n\n if (c == '+' || c == '-') {\n i += 1;\n skip_digits();\n } else if (c >= '0' && c <= '9') {\n skip_digits();\n } else {\n throw new Error(\n String.format(\"Invalid number formating character '%c' (i=%d, s=%s)\", c, i, s));\n }\n }\n }\n\n String num = s.substring(start, i);\n float n = Float.parseFloat(num);\n\n // inf, nan, etc. are an error.\n if (Float.isInfinite(n) || Float.isNaN(n)) {\n throw new Error(\n String.format(\"Invalid number '%s' (start=%d, i=%d, s=%s)\", num, start, i, s));\n }\n\n return n;\n }", "public UnitP(String valueAndUnit, ExceptionHandlingTypes exceptionHandling, PrefixUsageTypes prefixUsage)\n {\n ErrorTypes parsingError = \n (\n valueAndUnit == null ? ErrorTypes.NumericParsingError : ErrorTypes.None\n );\n\n UnitInfo unitInfo = ExceptionInstantiation.NewUnitInfo(0.0, exceptionHandling, prefixUsage);\n \n String unitString = \"\";\n\n if (parsingError == ErrorTypes.None)\n {\n UnitInfo tempInfo = MethodsUnitP.ParseValueAndUnit(valueAndUnit);\n \n if (tempInfo.Error.Type == ErrorTypes.None)\n {\n unitString = tempInfo.TempString;\n unitInfo.Value = tempInfo.Value;\n unitInfo.BaseTenExponent = tempInfo.BaseTenExponent;\n }\n else parsingError = tempInfo.Error.Type;\n }\n\n if (parsingError != ErrorTypes.None && !valueAndUnit.contains(\" \"))\n {\n //valueAndUnit is assumed to only contain unit information.\n parsingError = ErrorTypes.None;\n unitInfo.Value = 1.0;\n unitString = valueAndUnit;\n }\n\n UnitPConstructor unitP2 = MethodsUnitP.GetUnitP2(unitInfo, unitString);\n\n OriginalUnitString = unitP2.OriginalUnitString;\n Value = unitP2.Value;\n BaseTenExponent = unitP2.UnitInfo.BaseTenExponent;\n Unit = unitP2.UnitInfo.Unit;\n UnitType = unitP2.UnitType;\n UnitSystem = unitP2.UnitSystem;\n UnitPrefix = new Prefix(unitP2.UnitInfo.Prefix.getFactor(), prefixUsage);\n UnitParts = unitP2.UnitInfo.Parts;\n UnitString = unitP2.UnitString;\n ValueAndUnitString = unitP2.ValueAndUnitString;\n //If applicable, this instantiation would trigger an exception right away.\n Error = ExceptionInstantiation.NewErrorInfo\n (\n (parsingError != ErrorTypes.None ? parsingError : unitP2.ErrorType),\n unitP2.ExceptionHandling\n );\n }", "public void setAmountAndUnits(String a) {\n \t\tint i = a.indexOf(\" \");\n \t\tString d = a.substring(0, i);\n \t\tString u = a.substring(i);\n \t\t// preBoilVol.setAmount(Double.parseDouble(d.trim()));\n \t\tpreBoilVol.setUnits(u.trim());\n \t\t// postBoilVol.setAmount(Double.parseDouble(d.trim()));\n \t\tpostBoilVol.setUnits(u.trim());\n \t\tsetPostBoil(Double.parseDouble(d.trim()));\n \n \t}", "public void setUnit (String value) {\n\tthis.unit = value;\n }", "private double parseOptionPrice(String line) {\n\n Double optionPrice = -1d;\n\n try {\n if (\"\".equals(line.trim()))\n throw new AutoException(EnumAutomobileErrors.MISSING_OPTION_PRICE);\n else\n try {\n optionPrice = Double.valueOf(line.substring(line.indexOf(\":\") + 1).trim());\n } catch (NumberFormatException ex) {\n throw new AutoException(EnumAutomobileErrors.WRONG_OPTION_PRICE);\n }\n } catch (AutoException ex) {\n Object object = ex.fix();\n if (object != null)\n optionPrice = (double) object;\n }\n\n return optionPrice;\n\n }", "@Test\n public void canParseSeparator(){\n int[] i = null;\n try {\n i = SUT.getColumnWidthsFromString(\"1,2,3\");\n } catch (ImportException e) {\n Assert.fail(e.getMessage());\n }\n\n Assert.assertNotNull(i);\n Assert.assertEquals(i[0], 1);\n Assert.assertEquals(i[1], 2);\n Assert.assertEquals(i[2], 3);\n }", "private int _parseSize(\n String value\n )\n {\n if (value == null)\n return -1;\n\n try\n {\n return Integer.parseInt(value);\n }\n catch (NumberFormatException e)\n {\n ;\n }\n\n _LOG.warning(_SIZE_ERROR);\n\n return -1;\n }", "public void setValue (String text) throws ParseException {\n\t\tParsing t = new Parsing(text);\n\t\tint posini;\n\t\t/* Ignore the leading blanks */\n\t\tt.gobbleSpaces();\n\t\tposini = t.pos;\n\t\t/* Take care of units requiring data in Sexagesimal */\n\t\tif ((symbol.charAt(0) == '\"') && (symbol.indexOf(':')>0)) \t// \"\n\t\t\tvalue = t.parseSexa();\n\t\telse value = t.parseFactor();\n\t\tif (t.pos == posini) {\t\t// Nothing (NaN checked in Parsing)\n\t\t\tvalue = 0./0. ;\n\t\t\t// while ((t.pos < t.length) && (t.a[t.pos] == '-')) t.pos++;\n\t\t}\n\t\t/* Skip the trailing blanks */\n\t\tt.gobbleSpaces();\n\t\tif (t.pos < t.length) throw new ParseException\n\t\t(\"****Unit: setValue '\" + text + \"'+\" + t.pos, t.pos);\n\t}", "private Values getOverAllSizeValObj(String val,String unit){\n\t\tString[] values = val.split(\"x\");\r\n\t\tValue valObj1 = null;\r\n\t\tValue valObj2 = null;\r\n\t\tValue valObj3 = null;\r\n\t\tList<Value> listOfValue = new ArrayList<>();\r\n\t\tif(values.length == ApplicationConstants.CONST_INT_VALUE_ONE){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t} else if(values.length == ApplicationConstants.CONST_INT_VALUE_TWO){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t valObj2 = getValueObj(values[1].trim(), \"Width\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t} else if(values.length == ApplicationConstants.CONST_INT_VALUE_THREE){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t valObj2 = getValueObj(values[1].trim(), \"Width\", unit);\r\n\t\t\t valObj3 = getValueObj(values[2].trim(), \"Height\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t listOfValue.add(valObj3);\r\n\t\t}\r\n\t\t Values valuesObj = new Values(); \r\n\t\t valuesObj.setValue(listOfValue);\r\n\t\t return valuesObj;\r\n\t}", "public static Dimension parseDimension(String s, Component parent) {\r\n\r\n \tif (s == null || s.isEmpty()) return null;\r\n\r\n \tStringTokenizer st = new StringTokenizer(s, \"x\");\r\n\r\n int w, h;\r\n\r\n \tif (st.hasMoreElements()) {\r\n try {\r\n \t\tw = Integer.parseInt(st.nextToken());\r\n\t \tif (st.hasMoreElements()) {\r\n\t \t\th = Integer.parseInt(st.nextToken());\r\n\t \treturn new Dimension(w, h);\r\n\t \t}\r\n } catch (NumberFormatException nfe) {\r\n }\r\n \t}\r\n\r\n JOptionPane.showMessageDialog(parent,\r\n \t\t\t\"Could not parse the specified dimensions.\\nPlease use WxH format, e.g. 11x9.\",\r\n \t\t\t\"Invalid Dimensions\", JOptionPane.ERROR_MESSAGE);\r\n return null;\r\n }", "private static PageSize parsePageLengthValue(String[] pageSizeChunks, float em, float rem) {\n Float width, height;\n width = tryParsePageLengthValue(pageSizeChunks[0], em, rem);\n if (width == null) {\n return null;\n }\n if (pageSizeChunks.length > 1) {\n height = tryParsePageLengthValue(pageSizeChunks[1], em, rem);\n if (height == null) {\n return null;\n }\n } else {\n height = width;\n }\n return new PageSize((float) width, (float) height);\n }", "public void setUnit(String unit);", "public void setUnit(Length units) {\n unit = units;\n }", "String getUnitsString();", "@Test\r\n\tpublic void typeParserTest() {\n\t\tvalidateTypeParse(\r\n\t\t\t\t\"(function that takes a number and outputs a number)\");\r\n\t\t// validateTypeParse(\r\n\t\t// \"(function that takes a number and a (function that takes a number)\r\n\t\t// and outputs a number)\");\r\n\t\t// validateTypeParse(\r\n\t\t// \"(function that takes a number, a string, and an element_of_type_3\r\n\t\t// and outputs a number)\");\r\n\t\t// validateTypeParse(\"(function that takes a number)\");\r\n\t\t// assertEquals(\"procedure\", cdLoopType(\"function\"));\r\n\t\t// validateTypeParse(\"(function that outputs a number)\");\r\n\t\t// validateTypeParse(\"procedure\");\r\n\t}", "public final void setUnits() {\r\n\r\n for (final FileMincVarElem element : varArray) {\r\n\r\n if (element.units != null) {\r\n\r\n if (element.name.equals(\"xspace\")) {\r\n\r\n if (element.units.equals(\"mm\")) {\r\n setUnitsOfMeasure(Unit.MILLIMETERS.getLegacyNum(), 0);\r\n } else if (element.units.equals(\"in\")) {\r\n setUnitsOfMeasure(Unit.INCHES.getLegacyNum(), 0);\r\n }\r\n }\r\n\r\n if (element.name.equals(\"yspace\")) {\r\n\r\n if (element.units.equals(\"mm\")) {\r\n setUnitsOfMeasure(Unit.MILLIMETERS.getLegacyNum(), 1);\r\n } else if (element.units.equals(\"in\")) {\r\n setUnitsOfMeasure(Unit.INCHES.getLegacyNum(), 1);\r\n }\r\n }\r\n\r\n if (element.name.equals(\"zspace\")) {\r\n\r\n if (element.units.equals(\"mm\")) {\r\n setUnitsOfMeasure(Unit.MILLIMETERS.getLegacyNum(), 2);\r\n } else if (element.units.equals(\"in\")) {\r\n setUnitsOfMeasure(Unit.INCHES.getLegacyNum(), 2);\r\n }\r\n }\r\n }\r\n }\r\n }", "private void handleNumber() {\n while (isDigit(peek())) {\n advance();\n }\n\n // Look for decimals; Will be allowing extension calls like 140.abs() so make sure it's a numerical decimal\n if (peek() == '.' && isDigit(peekFurther(1))) {\n\n // Consume the decimal\n advance();\n\n // Consume the digits following the decimal\n while (isDigit(peek())) {\n advance();\n }\n }\n\n addToken(NUMBER, Double.parseDouble(source.substring(start, current)));\n }", "private String getResultUnit() {\n switch (mCalculationType) {\n case CONSUMPTION_L_100_KM:\n return \"l/100 km\";\n case CONSUMPTION_KM_L:\n return \"km/l\";\n case CONSUMPTION_MPG:\n return \"mpg\";\n default:\n return \"\";\n }\n }", "@Test(timeout = 4000)\n public void test114() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.parseColumnTypeAndSize(\"(, 4$, 4$, 4$, 4$, 4$, 4$, , )\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "public static long parseDecimalMemorySizeToBinary(String size) {\n String[] mem = RegEx.SPACES.split(size);\n if (mem.length < 2) {\n // If no spaces, use regexp\n Matcher matcher = BYTES_PATTERN.matcher(size.trim());\n if (matcher.find() && matcher.groupCount() == 2) {\n mem = new String[2];\n mem[0] = matcher.group(1);\n mem[1] = matcher.group(2);\n }\n }\n long capacity = Builder.parseLongOrDefault(mem[0], 0L);\n if (mem.length == 2 && mem[1].length() > 1) {\n switch (mem[1].charAt(0)) {\n case 'T':\n capacity <<= 40;\n break;\n case 'G':\n capacity <<= 30;\n break;\n case 'M':\n capacity <<= 20;\n break;\n case 'K':\n case 'k':\n capacity <<= 10;\n break;\n default:\n break;\n }\n }\n return capacity;\n }", "private Double parseNumber(String num) {\r\n\t\tDouble tempnum = (double) 0;\r\n\t\tint opos; //operator position\r\n\t\tif ((num == null) || (num.length() < 1) ) {\r\n\t\t\treturn tempnum;\r\n\t\t}\r\n\r\n\t\t//replace constants with their value\r\n\t\twhile (num.indexOf(\"P\") >= 0) { //PI constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'P', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.PI)+numparts[1];\r\n\t\t}\r\n\t\twhile (num.indexOf(\"X\") >= 0) { //e constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'X', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.E)+numparts[1];\r\n\t\t}\r\n\r\n\t\tif (num.indexOf(\"^\") >= 0) { //allows to specify powers (e.g.: 2^10)\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '^', 2);\r\n\t\t\ttempnum = Math.pow(parseNumber(numparts[0]), parseNumber(numparts[1]));\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"-\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '-', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) - parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"+\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '+', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) + parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"/\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '/', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) / parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"*\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '*', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) * parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttempnum = Double.valueOf(num);\r\n\t\t}\r\n\r\n\t\treturn tempnum;\r\n\t}", "private double parseHTMLForTemp(String line){\n String output = \"\";\n int end = 0;\n char charInt;\n for (int i=0; i<line.length(); i++){\n charInt=line.charAt(i);\n if(charInt>=45 && charInt<=57){\n output = output + charInt;\n end+=1;\n }\n else{\n if (end > 1){\n break;\n }\n }\n }\n\n return Double.parseDouble(output.substring(1));\n }", "String getUnits();", "String getUnits();", "String getUnits();", "public float[][] valunitSeparate(String[] data, String ps) {\n int eq=0,i;\n int u=0,sum=0;\n String units[],values[];\n String unknown;\n int un[];\n float[][] val = new float[3][2];\n un = new int[3]; //stores integer values corresponding to each var\n units = new String[3];\n values = new String[3];\n\n for(i=0;i<3;i++) {\n units[i] = \"\";\n values[i] = \"\";\n }\n\n for(i=0;i<3;i++) {\n for(int j=0;j<data[i].length();j++) {\n String c = \"\";\n c=c+data[i].charAt(j);\n if(Pattern.matches(\"[0-9]*\\\\.?[0-9]*\",c)) {\n values[i] = values[i]+c;\n } else {\n units[i] = units[i]+c;\n }\n }\n }\n\n unknown = ai.unknownFnd(ps); //contains the unknown var\n\n for (i=0;i<3;i++) {\n if (Objects.equals(units[i], \"m/ssq\"))\n un[i] = 3;\n else if (Objects.equals(units[i], \"s\"))\n un[i] = 4;\n else if(Objects.equals(units[i], \"m\"))\n un[i] = 5;\n else if (Objects.equals(units[i], \"m/s\")) {\n if (Objects.equals(unknown, \"u\"))\n un[i] = 1;\n else if (Objects.equals(unknown, \"v\"))\n un[i] = 2;\n else\n un[i] = 2;\n }\n }\n\n for (i=0;i<3;i++) {\n val[i][0] = Float.parseFloat(values[i]);\n val[i][1] = un[i];\n }\n\n return (val);\n }", "public String getUnit() {\n String unit = (String) comboUnits.getSelectedItem();\n if (\"inch\".equals(unit)) {\n return \"in\";\n } else if (\"cm\".equals(unit)) {\n return \"cm\";\n } else if (\"mm\".equals(unit)) {\n return \"mm\";\n } else if (\"pixel\".equals(unit)) {\n return \"px\";\n }\n return \"\";\n }", "DefiningUnitType getDefiningUnit();", "String getUnit();", "@Test\n public void testParseFloat() {\n FloatSpec floatSpec = new FloatSpec();\n floatSpec.setDefaultValue(0f);\n dataTypeParser.setDataTypeSpec(floatSpec);\n dataTypeParser.parse();\n FloatSpec parsedFloatSpec = (FloatSpec) dataTypeParser.getDataTypeSpec();\n\n assertNull(parsedFloatSpec.getMinValue());\n assertNull(parsedFloatSpec.getMaxValue());\n }", "public void calcAction(View v) \n\t{\n\t\ttry\n\t\t{\n\t\t\tString initial = size.getText().toString(); /* the following gets user input, in order to do calculations */\n\t\t\tString end = \"Nothing\"; /* This is the default text in case the unexpected happens */\n\t\t\tunit = selection.getSelectedItem().toString(); /* this gets the unit of measure that the user specifies */\n\t\tdouble convert = Double.parseDouble(initial); /* this converts the size input to numerical data, in order for calculations to be done */\n\t\t\tcapacity.setStorage(convert); /* send input to external class */\n\t\t\tDecimalFormat twop = new DecimalFormat(\"#.##\"); /* created new object, in order to format output to display two decimal places at most */\n\n\t\t\t/* the following conditional statement reads the unit of measure specify by the user, puts the data into the proper formula, and returns the results */\n\n\t\t\tif (unit.equals(\"KB\")) // runs if user specifies KB\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getKB());\n\t\t\t}\n\n\t\t\telse if (unit.equals(\"MB\")) /* runs if user specifies MB */\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getMB());\n\t\t\t}\n\n\t\t\telse if (unit.equals(\"GB\")) /* runs if user specifies GB */\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getGB());\n\t\t\t}\n\n\t\t\telse if (unit.equals(\"TB\")) /* runs if user specifies TB */\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getTB());\n\t\t\t}\n\n\t\t\telse if (unit.equals(\"PB\")) /* runs if user specifies PB */\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getPB());\n\t\t\t}\n\n\t\t\telse if (unit.equals(\"EB\")) /* runs if user specifies EB */\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getEB());\n\t\t\t}\n\n\t\t\telse if (unit.equals(\"ZB\")) /* runs if user specifies ZB */\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getZB());\n\t\t\t}\n\n\t\t\telse if (unit.equals(\"YB\")) /* runs if user specifies YB */\n\t\t\t{\n\t\t\t\tend = twop.format(capacity.getYB());\n\t\t\t}\n\n\t\t\telse; // send default text, if unexpected happens.\n\n\t\t\tresult.setText(end); // display results\n\t\t}\n\n\t\tcatch (NumberFormatException e)\n\t\t{\n\t\t\tAlertDialog.Builder m = new AlertDialog.Builder(this);\n\t\t\tm.setTitle(R.string.error); // set dialog title\n\t\t\tm.setMessage(R.string.error_message).setCancelable(true).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener()\n\t\t\t{\n\t\t\t\tpublic void onClick(DialogInterface dialog, int id)\n\t\t\t\t{\n\t\t\t\t\tdialog.cancel();\n\t\t\t\t}\n\t\t\t});\n\t\t\tm.create();\n\t\t\tm.show();\n\t\t}\t\n\t}", "@Test\n public void shouldParseFLOAT() {\n printTest(\"shouldParseFLOAT()\");\n String typeString = getDataTypeString(DataTypes.DTYPE_FLOAT);\n String content = typeString;\n\n DdlTokenStream tokens = getTokens(content);\n\n DataType dType = parser.parse(tokens);\n\n Assert.assertNotNull(\"DataType was NOT found for Type = \" + typeString, dType);\n Assert.assertEquals(\"Wrong DataType found\", typeString, dType.getName());\n\n content = typeString + \" (5)\";\n tokens = getTokens(content);\n dType = parser.parse(tokens);\n Assert.assertNotNull(\"DataType was NOT found for Type = \" + typeString, dType);\n Assert.assertEquals(\"Wrong DataType found\", typeString, dType.getName());\n Assert.assertEquals(\"DataType length is not correct\", 5, dType.getPrecision()); // PRECISION\n\n // ADDED SCALE\n content = typeString + \" (5, 2)\";\n tokens = getTokens(content);\n dType = null;\n try {\n dType = parser.parse(tokens);\n } catch (ParsingException e) {\n // Expect exception\n }\n Assert.assertNull(\"DataType should NOT have been found for Type = \" + content, dType);\n\n }", "static void parseSizeValueAfterInt(Lexer<CSSToken, CharInput> lexer, CSSUnit defaultUnit, int value, BiConsumer<Integer, CSSUnit> toCall) throws IOException, ParserException {\n\t\tCSSParserHelperSize.parseSizeValueAfterInt(lexer, defaultUnit, value, UNIT_OR_DOT_OR_SEMICOLON_OR_WS_OR_COMMENT_TOKENS, UNIT_OR_SEMICOLON_TOKENS, toCall);\n\t}", "static public String makeValidSize(String t, boolean bZero, boolean bNegative) throws Exception {\n // Ensure we have valid units\n if (t.IndexOf(\"in\") < 0 && t.IndexOf(\"cm\") < 0 && t.IndexOf(\"mm\") < 0 && t.IndexOf(\"pt\") < 0 && t.IndexOf(\"pc\") < 0)\n {\n t += \"in\";\n }\n \n float v = DesignXmlDraw.getSize(t);\n if (!bZero)\n {\n if (v < .1)\n t = \".1pt\";\n \n }\n \n if (!bNegative)\n {\n if (v < 0)\n t = \"0in\";\n \n }\n \n return t;\n }", "public Unit(String symbol) throws ParseException {\n\t\tthis.set(symbol) ;\n\t}", "public void testFormat() throws Exception {\n final BigDecimal bigDec = new BigDecimal(\"123.45678909E+10\");\r\n assertTrue(bigDec.toString().endsWith(\"E+12\"));\r\n assertEquals(\"1234567890900cm\", LengthUnit.CM.format(bigDec));\r\n // assert that we don't use BigDecimal internally (otherwise we would have the exact\r\n // approximation of 2.357f, e.g. 2.3570001125335693)\r\n assertEquals(\"2.357cm\", LengthUnit.CM.format(2.357f));\r\n }", "public AdSize[] mo6929a(String str) {\n AdSize adSize;\n String[] split = str.split(\",\");\n AdSize[] adSizeArr = new AdSize[split.length];\n for (int i = 0; i < split.length; i++) {\n String trim = split[i].trim();\n if (trim.matches(\"^(\\\\d+|FULL_WIDTH)\\\\s*[xX]\\\\s*(\\\\d+|AUTO_HEIGHT)$\")) {\n String[] split2 = trim.split(\"[xX]\");\n split2[0] = split2[0].trim();\n split2[1] = split2[1].trim();\n try {\n adSize = new AdSize(\"FULL_WIDTH\".equals(split2[0]) ? -1 : Integer.parseInt(split2[0]), \"AUTO_HEIGHT\".equals(split2[1]) ? -2 : Integer.parseInt(split2[1]));\n } catch (NumberFormatException e) {\n return null;\n }\n } else {\n adSize = \"BANNER\".equals(trim) ? AdSize.BANNER : \"SMART_BANNER\".equals(trim) ? AdSize.SMART_BANNER : \"IAB_MRECT\".equals(trim) ? AdSize.IAB_MRECT : \"IAB_BANNER\".equals(trim) ? AdSize.IAB_BANNER : \"IAB_LEADERBOARD\".equals(trim) ? AdSize.IAB_LEADERBOARD : \"IAB_WIDE_SKYSCRAPER\".equals(trim) ? AdSize.IAB_WIDE_SKYSCRAPER : null;\n }\n if (adSize == null) {\n return null;\n }\n adSizeArr[i] = adSize;\n }\n return adSizeArr;\n }", "private void parseAxiom(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length != 2) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLength argument\");\n\t\t}\n\t\tthis.setAxiom(tokens[1]);\n\t}", "protected final void parseT() {\n current = read();\n skipSpaces();\n\n for (;;) {\n switch (current) {\n default:\n return;\n case '+': case '-': case '.':\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n }\n\n float x = parseNumber();\n skipCommaSpaces();\n float y = parseNumber();\n\n smoothQCenterX = currentX * 2 - smoothQCenterX;\n smoothQCenterY = currentY * 2 - smoothQCenterY;\n currentX = x;\n currentY = y;\n p.quadTo(smoothQCenterX, smoothQCenterY,\n currentX, currentY);\n smoothCCenterX = currentX;\n smoothCCenterY = currentY;\n skipCommaSpaces();\n } \n }", "public boolean testParser() {\n boolean succeeded = true;\n\n // Test addition expression\n Double resultAddition = this.mockCalculator.x(\"12 + 5\");\n Double expectedAddition = new Double(17);\n \n if (!resultAddition.equals(expectedAddition)) {\n succeeded = false;\n System.out.println(\"[FAIL] Basic parsing fails to add.\");\n } else {\n System.out.println(\"[ OK ] Parser adds correctly.\");\n }\n\n // Test multiplication expression\n Double resultMulti = this.mockCalculator.x(\"12 x 5\");\n Double expectedMulti = new Double(60);\n \n if (!resultMulti.equals(expectedMulti)) {\n succeeded = false;\n System.out.println(\"[FAIL] Basic parsing multiply to add.\");\n } else {\n System.out.println(\"[ OK ] Parser multiplies correctly.\");\n }\n \n // Test invalid expression\n Double resultInvalid = this.mockCalculator.x(\"12 [ 5\");\n \n if (null != resultInvalid) {\n succeeded = false;\n System.out.println(\"[FAIL] Parser does not return null for operators which are not supported.\");\n } else {\n System.out.println(\"[ OK ] Parser returns null for operators which are not supported.\");\n }\n\n return succeeded;\n }", "static void parseDecimalAfterDot(Lexer<CSSToken, CharInput> lexer, CSSUnit defaultUnit, int beforeDecimal, BiConsumer<Integer, CSSUnit> toCall) throws IOException, ParserException {\n\t\tfinal CSSToken token = CSSParserHelperSize.parseDecimalAfterDot(lexer, defaultUnit,beforeDecimal, UNIT_OR_SEMICOLON_TOKENS, toCall);\n\t}", "private static double parseOutNum(String s)\n {\n final int N = s.length();\n // If the last character of s is a digit, the whole of s is assumed to\n // be a numeral. Otherwise, s up to, but not including, its last \n // character, is assumed to be a numeral.\n if (Character.isDigit(s.charAt(N-1)))\n { return Double.parseDouble(s); }\n else\n { return Double.parseDouble(s.substring(0,N-1)); }\n }", "private static float parseCoOrdinate(String value) {\n\t\tfloat result = 0f;\n\n\t\t// Quick and dirty way to determine if the value appears to have a units suffix.\n\t\tif (value.charAt(value.length() - 1) >= 'a') {\n\t\t\tif (value.endsWith(\"px\")) {\n\t\t\t\tvalue = value.substring(0, value.length() - 2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// TODO: Add support in future for other units here.\n\t\t\t\t// TODO: Call our error reporting function.\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tresult = Float.parseFloat(value);\n\t\t}\n\t\tcatch (final NumberFormatException nfe) {\n\n\t\t}\n\t\treturn result;\n\t}", "public void setUnit(String unit)\n {\n this.unit = unit;\n }", "private static Float tryParsePageLengthValue(String valueChunk, float em, float rem) {\n UnitValue unitValue = CssUtils.parseLengthValueToPt(valueChunk, em, rem);\n if (unitValue == null || unitValue.isPercentValue()) {\n return null;\n }\n return unitValue.getValue();\n }", "public void getWeightAndHeight(String weightText, String heightText){\n //parse double from user input in JTextField\n height = Double.parseDouble(heightText);\n weight = Double.parseDouble(weightText);\n }", "public void testGetNumericValue2() {\n ValueString vs = new ValueString(\"2.8\");\n\n assertEquals(\"2.8\", vs.getString());\n assertEquals(2.8D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n assertEquals(2.8D, vs.getBigNumber().doubleValue(), 0.1D);\n }", "public static double MyParseFloat(String s) throws Exception {\n\t\tStateFloat state;\n\n\t\tstate = StateFloat.SA;\n\n\t\tint i = 0;\n\t\tBoolean neg = false;\n\t\tBoolean nege = false;\n\t\tdouble divider = 10;\n\t\tdouble value = 0;\n\t\tint exponent = 0;\n\n\twhile (i < s.length() && (state != StateFloat.SC || state != StateFloat.SF || state != StateFloat.SH)) {\n\t\t\tchar ch = s.charAt(i);\n\t\t\tswitch (state) {\n\t\t\t\tcase SA:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SC;\n\t\t\t\t\t\tvalue = Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '+' || ch == '-') {\n\t\t\t\t\t\tstate = StateFloat.SB;\n\t\t\t\t\t\tif (ch == '-') neg = true;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SB:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SC;\n\t\t\t\t\t\tif (neg) value = 10*value - Character.getNumericValue(ch);\n\t\t\t\t\t\telse value = 10*value + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SC:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tif (neg) value = 10*value - Character.getNumericValue(ch);\n\t\t\t\t\t\telse value = 10*value + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == 'e' || ch == 'E') {\n\t\t\t\t\t\tstate = StateFloat.SE;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SD:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SF;\n\t\t\t\t\t\tif (neg) value -= Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\telse value += Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\tdivider *= 10;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SE:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SH;\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '+' || ch == '-') {\n\t\t\t\t\t\tstate = StateFloat.SG;\n\t\t\t\t\t\tif (ch == '-') nege = true;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SF:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\t//Divider comes here\n\t\t\t\t\t\tif (neg) value -= Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\telse value += Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\tdivider *= 10;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == 'e' || ch == 'E') {\n\t\t\t\t\t\tstate = StateFloat.SE;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SG:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SH;\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SH:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state != StateFloat.SC && state != StateFloat.SF && state != StateFloat.SH) throw new Exception(\"Bad Format\");\n\t\tvalue = value * Math.pow(10, exponent);\n\t\treturn value;\n\t}", "public void setUnit(String unit) {\n this.unit = unit;\n }", "@Test\n public final void whenSemicolonDelimiterIsSpecifiedThenItIsUsedToSeparateNumbers() {\n assertEquals(3+6+15, StringCalculator.add(\"//;\\n3;6;15\"));\n }", "@Test\r\n public void testInvalidPlusAssignmentExpressionWithSIUnits1() throws IOException {\n checkError(\"varD_S+=4km\", \"0xA0176\");\r\n }", "protected final void parseQ() {\n current = read();\n skipSpaces();\n\n for (;;) {\n switch (current) {\n default:\n return;\n case '+': case '-': case '.':\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n }\n\n float x1 = parseNumber();\n skipCommaSpaces();\n float y1 = parseNumber();\n skipCommaSpaces();\n float x = parseNumber();\n skipCommaSpaces();\n float y = parseNumber();\n\n smoothQCenterX = x1;\n smoothQCenterY = y1;\n currentX = x;\n currentY = y;\n p.quadTo(smoothQCenterX, smoothQCenterY, currentX, currentY);\n smoothCCenterX = currentX;\n smoothCCenterY = currentY;\n skipCommaSpaces();\n }\n }", "public static String units(String unit) {\n\t\tswitch (unit) {\n\t\t\tcase \"feet\":\n\t\t\t\treturn \"ft\";\n\t\t\tcase \"miles\":\n\t\t\t\treturn \"mi\";\n\t\t\tcase \"meters\":\n\t\t\t\treturn \"m\";\n\t\t\tcase \"kilometers\":\n\t\t\t\treturn \"km\";\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}", "public abstract double toBasicUnit(double unit);", "public String getUnit();", "@Override\n public void parse(String sentence) {\n String[] tmp = sentence.split(DELIM);\n if (tmp.length >= 16) {\n if (\"1\".equals(tmp[2])) {\n // return invalid location or invalid sentence\n return;\n }\n for (int i = 3; i < 15; i++) {\n // tag sats used for fix\n int sat = parseStringToInt(tmp[i]);\n if (sat > 0)\n mSvMasks[USED_FOR_FIX_MASK] |= (1 << (sat - 1));\n }\n if (tmp.length > 15)\n PDOP = parseStringToFloat(tmp[15]);\n if (tmp.length > 16)\n HDOP = parseStringToFloat(tmp[16]);\n if (tmp.length > 17)\n VDOP = parseStringToFloat(tmp[17]);\n }\n }", "@Test\n public void testParseString() {\n StringSpec stringSpec = new StringSpec();\n stringSpec.setDefaultValue(\"hello world!\");\n dataTypeParser.setDataTypeSpec(stringSpec);\n dataTypeParser.parse();\n StringSpec parsedStringSpec = (StringSpec) dataTypeParser.getDataTypeSpec();\n\n assertNull(parsedStringSpec.getMaxLength());\n assertNull(parsedStringSpec.getMinLength());\n assertNull(parsedStringSpec.getRegexPattern());\n\n // Checking that max and min values are null\n stringSpec = new StringSpec();\n stringSpec.setRegexPattern(\"[a-z]{2}\");\n dataTypeParser.setDataTypeSpec(stringSpec);\n dataTypeParser.parse();\n parsedStringSpec = (StringSpec) dataTypeParser.getDataTypeSpec();\n\n assertNull(parsedStringSpec.getMaxLength());\n assertNull(parsedStringSpec.getMinLength());\n }", "protected static Item parseStringToItem(String str) {\n String[] strList = str.split(\",\");\n if (strList.length != 3) {\n System.err.println(\"File line data is not in the correct format.\");\n return null;\n }\n\n //find the index of the place where the cost numbers start\n Matcher matcher = Pattern.compile(\"\\\\d\").matcher(strList[2]);\n matcher.find();\n int numberIndex = strList[2].indexOf(matcher.group());\n Item item = new Item(Integer.parseInt(strList[0]),\n Double.valueOf(strList[1]),\n strList[2].substring(0, numberIndex).trim(),\n Double.valueOf(strList[2].substring(numberIndex)));\n return item;\n }", "public static Vect3 parse(String str) {\n\t\tString[] fields = str.split(Constants.wsPatternParens);\n\t\tif (fields[0].equals(\"\")) {\n\t\t\tfields = Arrays.copyOfRange(fields,1,fields.length);\n\t\t}\n\t\ttry {\n\t\t\tif (fields.length == 3) {\n\t\t\t\treturn new Vect3(Double.parseDouble(fields[0]),Double.parseDouble(fields[1]),Double.parseDouble(fields[2]));\n\t\t\t} else if (fields.length == 6) {\n\t\t\t\treturn new Vect3(Units.from(Units.clean(fields[1]),Double.parseDouble(fields[0])),\n\t\t\t\t\t\tUnits.from(Units.clean(fields[3]),Double.parseDouble(fields[2])),\n\t\t\t\t\t\tUnits.from(Units.clean(fields[5]),Double.parseDouble(fields[4])));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// ignore exception\n\t\t}\n\t\treturn INVALID;\n\t}", "public int parsePrice(String goods) {\n return Integer.parseInt(goods.split(\"\\\\s+\")[2]);\n }", "private String extractQuantityFromString(Decoded decoded, String string) {\n Character digit = string.charAt(0);\n if(!Character.isDigit(digit)){\n return string;\n }\n\n Integer i = Integer.parseInt(String.valueOf(digit));\n int length;\n\n switch(i){\n case 8:\n length = 2;\n break;\n case 9:\n length = 5;\n break;\n default:\n // no quantity\n return string;\n }\n\n string = string.substring(1);\n // check if valid number, update decoded.quantity if so, otherwise update error\n try {\n int quantity = Integer.parseInt(string.substring(0, length));\n string = string.substring(length);\n decoded.quantity = quantity;\n } catch (NumberFormatException ex){\n decoded.error = Error.INVALID_QUANTITY;\n string = string.substring(length);\n }\n\n return string;\n }", "protected final void parseq() {\n current = read();\n skipSpaces();\n\n for (;;) {\n switch (current) {\n default:\n return;\n case '+': case '-': case '.':\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n }\n\n float x1 = parseNumber();\n skipCommaSpaces();\n float y1 = parseNumber();\n skipCommaSpaces();\n float x = parseNumber();\n skipCommaSpaces();\n float y = parseNumber();\n\n smoothQCenterX = currentX + x1;\n smoothQCenterY = currentY + y1;\n currentX += x; \n currentY += y;\n p.quadTo(smoothQCenterX, smoothQCenterY, currentX, currentY);\n smoothCCenterX = currentX;\n smoothCCenterY = currentY;\n\n skipCommaSpaces();\n }\n }", "private final int unit1 (Parsing text, StringBuffer edited) \n\tthrows ParseException {\n\t\tint posini = text.pos;\t\t// Initial position in text\n\t\tUdef theUnit = uDef[0];\t\t// Default Unit = Unitless\n\t\tint mult_index = -1;\t\t// Index in mul_fact by e.g. &mu;\n\t\tint power = 1;\n\t\tchar op = Character.MIN_VALUE;\t// Operator power\n\t\tint error = 0;\t\t\t// Error counter\n\t\tboolean close_bracket = false;\t// () not edited when buffer empty\n\t\tint edited_pos = -1;\n\t\tint i, s;\n\n\t\t/* Initialize the Unit to unitless */\n\t\tmksa = underScore; factor = 1.;\n\t\tif (text.pos >= text.length) return(0);\t// Unitless\n\n\t\tif (DEBUG>0) System.out.println(\"....unit1(\" + text + \")\");\n\t\tswitch(text.a[text.pos]) {\n\t\tcase '(':\t\t/* Match parenthesized expression */\n\t\t\ttheUnit = null;\t// Parenthese do NOT define any unit.\n\t\t\ttext.pos++;\t\t// Accept the '('\n\t\t\tclose_bracket = (edited != null) ; /*&& (edited.length() > 0)*/\n\t\t\tif (close_bracket) {\n\t\t\t\tedited_pos = edited.length();\t// where to insert 'square'\n\t\t\t\tedited.append('(') ;\n\t\t\t}\n\t\t\tthis.unitec(text, edited) ;\n\t\t\tif ((text.pos < text.length) && (text.a[text.pos] == ')'))\n\t\t\t\ttext.pos++;\n\t\t\telse throw new ParseException\n\t\t\t(\"****Unit: Missing ) in '\" + text + \"'\", text.pos);\n\t\t\tif (close_bracket) {\n\t\t\t\t// Remove the Ending blanks, before closing the bracket\n\t\t\t\ti = edited.length(); \n\t\t\t\twhile ((--i >= 0) && (edited.charAt(i) == ' ')) ;\n\t\t\t\tedited.setLength(++i);\n\t\t\t\tedited.append(')') ;\n\t\t\t\tclose_bracket = false;\n\t\t\t}\n\t\t\tbreak ;\n\t\tcase '\"':\t\t/* Quoted units must match exactly */\n\t\t\ti = text.matchingQuote();\n\t\t\tif (i<text.length) i++;\t// Matching quote\n\t\t\ttheUnit = uLookup(text, i-text.pos);\n\t\t\tif (theUnit == null) throw new ParseException\n\t\t\t(\"****Unit: quoted unit does not match\", text.pos);\n\t\t\tbreak ;\n\t\tcase '-':\t\t// Unitless ?\n\t\t\ts = text.pos++;\n\t\t\tif (text.pos >= text.length) break;\n\t\t\tif (Character.isDigit(text.a[text.pos])) { \t// Number ?\n\t\t\t\ttext.pos = s;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\twhile ((text.pos<text.length) && (text.a[text.pos]=='-')) \n\t\t\t\ttext.pos++;\t// Accept unitless as \"--\" or \"---\"\n\t\t\tbreak;\n\t\tcase '%':\n\t\t\ttheUnit = uLookup(text, 1);\n\t\t\tbreak;\n\t\tcase '\\\\':\t\t// Special constants\n\t\t\tfor (i=text.pos+1; (i<text.length) && Character.isLetter(text.a[i]); \n\t\t\ti++) ;\n\t\t\ttheUnit = uLookup(text, i-text.pos) ;\n\t\t\tif (theUnit == null) error++ ;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfor (i=text.pos; (i<text.length) && Character.isLetter(text.a[i]); \n\t\t\ti++) ;\n\t\t// A unit may be terminated by 0 (a0 = classical electron radius)\n\t\tif ((i<text.length) && (text.a[i] == '0')) i++;\n\t\ttheUnit = uLookup(text, i-text.pos) ;\n\t\tif (theUnit != null) break;\n\t\t/* Simple unit not found. Look for multiple prefix */\n\t\ts = text.pos ;\t// Save \n\t\tif ((text.length-text.pos)>1) \n\t\t\tmult_index = text.lookup(mul_symb) ;\n\t\tif (mult_index < 0) break;\n\t\ttheUnit = uLookup(text, i-text.pos) ;\n\t\tif (theUnit == null) text.pos = s; \n\t\t}\n\t\t/* Look now for a Power: */\n\t\tif ((error == 0) && (text.pos < text.length)) \n\t\t\top = text.a[text.pos];\n\t\t/* Power is however not acceptable for complex and date numbers */\n\t\tif (theUnit != null) {\n\t\t\tif ((theUnit.mksa&(_abs|_pic)) != 0)\n\t\t\t\top = Character.MIN_VALUE;\n\t\t}\n\t\tif ((op == '+') || (op == '-') || (op == '^') || \n\t\t\t\t(Character.isDigit(op) && (op != '0'))) {\n\t\t\tif (DEBUG>0) System.out.print(\" look for power with op=\" + op);\n\t\t\tif (op == '^') text.pos += 1;\n\t\t\tif (text.pos < text.length) {\n\t\t\t\top = text.a[text.pos];\n\t\t\t\tif (op == '+') text.pos++ ;\n\t\t\t\tif (op != '-') op = '+';\n\t\t\t\tpower = text.parseInt() ;\n\t\t\t\t// A zero-power is illegal !!\n\t\t\t\tif (power == 0) error++;\n\t\t\t\t// 'square' or 'cubic' is spelled out BEFORE the unit name\n\t\t\t\telse if ((power > 0) && (power < 10) && (edited != null)) {\n\t\t\t\t\ttext.pos--;\t\t// Now text is the digit of power\n\t\t\t\t\ti = text.lookup(op_symb) ;\n\t\t\t\t\tif (i >= 0) { \t// Square or cubic\n\t\t\t\t\t\tif (edited_pos >= 0)\n\t\t\t\t\t\t\tedited.insert(edited_pos, op_text[i]);\n\t\t\t\t\t\telse edited.append(op_text[i]) ; \n\t\t\t\t\t\top = ' '; \t// Power is now edited\n\t\t\t\t\t}\n\t\t\t\t\telse text.pos++;\n\t\t\t\t}\n\t\t\t\tif (DEBUG>0) System.out.print(\", power=\" + power);\n\t\t\t}\n\t\t\telse error++;\n\t\t\tif (DEBUG>0) System.out.println(\", error=\" + error);\n\t\t}\n\n\t\tif (error>0) throw new ParseException\n\t\t(\"****Unit: '\" + text + \"'+\" + text.pos, text.pos) ;\n\n\t\tif (mult_index >= 0) {\t\t// Multiplicities like 'k', '&mu;', ...\n\t\t\tfactor *= AstroMath.dexp(mul_fact[mult_index]);\n\t\t\tif (edited != null) edited.append(mul_text[mult_index]) ;\n\t\t}\n\n\t\tif (theUnit != null) {\n\t\t\tfactor *= theUnit.fact ;\n\t\t\tmksa = theUnit.mksa;\n\t\t\toffset = theUnit.orig;\n\t\t\tif (edited != null)\n\t\t\t\tedited.append(theUnit.expl) ;\n\t\t}\n\n\t\tif (power != 1) {\n\t\t\tthis.power (power) ;\n\t\t\tif ((op != ' ') && (edited != null)) {\n\t\t\t\tedited.append(\"power\") ;\n\t\t\t\tif (power>=0) edited.append(op);\t// - sign included...\n\t\t\t\tedited.append(power);\t\t\t// by this edition!\n\t\t\t}\n\t\t}\n\t\ts = text.pos - posini;\n\t\tif (DEBUG>0) System.out.println(\" =>unit1: return=\" + s \n\t\t\t\t+ \", f=\"+factor + \", val=\"+value);\n\t\treturn(s);\n\t}", "public void setUnitOfMeasure(String unitOfMeasure) {\r\n this.unitOfMeasure = unitOfMeasure;\r\n }", "@Test\n void testParseTestcaseFrom50Specification(){\n String testcase = \"\\r\\n\" +\n \"/ISk5\\\\2MT382-1000\\r\\n\" +\n \"\\r\\n\" +\n \"1-3:0.2.8(50)\\r\\n\" +\n \"0-0:1.0.0(101209113020W)\\r\\n\" +\n \"0-0:96.1.1(4B384547303034303436333935353037)\\r\\n\" +\n \"1-0:1.8.1(123456.789*kWh)\\r\\n\" +\n \"1-0:1.8.2(123456.789*kWh)\\r\\n\" +\n \"1-0:2.8.1(123456.789*kWh)\\r\\n\" +\n \"1-0:2.8.2(123456.789*kWh)\\r\\n\" +\n \"0-0:96.14.0(0002)\\r\\n\" +\n \"1-0:1.7.0(01.193*kW)\\r\\n\" +\n \"1-0:2.7.0(00.000*kW)\\r\\n\" +\n \"0-0:96.7.21(00004)\\r\\n\" +\n \"0-0:96.7.9(00002)\\r\\n\" +\n \"1-0:99.97.0(2)(0-0:96.7.19)(101208152415W)(0000000240*s)(101208151004W)(0000000301*s)\\r\\n\" +\n \"1-0:32.32.0(00002)\\r\\n\" +\n \"1-0:52.32.0(00001)\\r\\n\" +\n \"1-0:72.32.0(00000)\\r\\n\" +\n \"1-0:32.36.0(00000)\\r\\n\" +\n \"1-0:52.36.0(00003)\\r\\n\" +\n \"1-0:72.36.0(00000)\\r\\n\" +\n \"0-0:96.13.0(303132333435363738393A3B3C3D3E3F303132333435363738393A3B3C3D3E3F30313233343536373839\" +\n \"3A3B3C3D3E3F303132333435363738393A3B3C3D3E3F303132333435363738393A3B3C3D3E3F)\\r\\n\" +\n \"1-0:32.7.0(220.1*V)\\r\\n\" +\n \"1-0:52.7.0(220.2*V)\\r\\n\" +\n \"1-0:72.7.0(220.3*V)\\r\\n\" +\n \"1-0:31.7.0(001*A)\\r\\n\" +\n \"1-0:51.7.0(002*A)\\r\\n\" +\n \"1-0:71.7.0(003*A)\\r\\n\" +\n \"1-0:21.7.0(01.111*kW)\\r\\n\" +\n \"1-0:41.7.0(02.222*kW)\\r\\n\" +\n \"1-0:61.7.0(03.333*kW)\\r\\n\" +\n \"1-0:22.7.0(04.444*kW)\\r\\n\" +\n \"1-0:42.7.0(05.555*kW)\\r\\n\" +\n \"1-0:62.7.0(06.666*kW)\\r\\n\" +\n \"0-1:24.1.0(003)\\r\\n\" +\n \"0-1:96.1.0(3232323241424344313233343536373839)\\r\\n\" +\n \"0-1:24.2.1(101209112500W)(12785.123*m3)\\r\\n\" +\n \"!EF2F\\r\\n\" +\n \"\\r\\n\";\n DSMRTelegram dsmrTelegram = ParseDsmrTelegram.parse(testcase);\n\n // CHECKSTYLE.OFF: ParenPad\n assertEquals(\"/ISk5\\\\2MT382-1000\", dsmrTelegram.getRawIdent());\n assertEquals(\"ISK\", dsmrTelegram.getEquipmentBrandTag());\n assertEquals(\"MT382-1000\", dsmrTelegram.getIdent());\n\n assertEquals(\"5.0\", dsmrTelegram.getP1Version());\n assertEquals(ZonedDateTime.parse(\"2010-12-09T11:30:20+01:00\"), dsmrTelegram.getTimestamp());\n\n assertEquals(\"K8EG004046395507\", dsmrTelegram.getEquipmentId());\n assertEquals(\"0123456789:;<=>?0123456789:;<=>?0123456789:;<=>?0123456789:;<=>?0123456789:;<=>?\", dsmrTelegram.getMessage());\n\n assertEquals( 2, dsmrTelegram.getElectricityTariffIndicator());\n assertEquals( 123456.789, dsmrTelegram.getElectricityReceivedLowTariff(), 0.001);\n assertEquals( 123456.789, dsmrTelegram.getElectricityReceivedNormalTariff(), 0.001);\n assertEquals( 123456.789, dsmrTelegram.getElectricityReturnedLowTariff(), 0.001);\n assertEquals( 123456.789, dsmrTelegram.getElectricityReturnedNormalTariff(), 0.001);\n assertEquals( 1.193, dsmrTelegram.getElectricityPowerReceived(), 0.001);\n assertEquals( 0.0, dsmrTelegram.getElectricityPowerReturned(), 0.001);\n assertEquals( 4, dsmrTelegram.getPowerFailures());\n assertEquals( 2, dsmrTelegram.getLongPowerFailures());\n\n assertEquals(2, dsmrTelegram.getPowerFailureEventLogSize());\n\n List<PowerFailureEvent> powerFailureEventLog = dsmrTelegram.getPowerFailureEventLog();\n assertEquals(2, powerFailureEventLog.size());\n assertPowerFailureEvent(powerFailureEventLog.get(0), \"2010-12-08T15:20:15+01:00\", \"2010-12-08T15:24:15+01:00\", \"PT4M\");\n assertPowerFailureEvent(powerFailureEventLog.get(1), \"2010-12-08T15:05:03+01:00\", \"2010-12-08T15:10:04+01:00\", \"PT5M1S\");\n\n assertEquals( 2, dsmrTelegram.getVoltageSagsPhaseL1());\n assertEquals( 1, dsmrTelegram.getVoltageSagsPhaseL2());\n assertEquals( 0, dsmrTelegram.getVoltageSagsPhaseL3());\n assertEquals( 0, dsmrTelegram.getVoltageSwellsPhaseL1());\n assertEquals( 3, dsmrTelegram.getVoltageSwellsPhaseL2());\n assertEquals( 0, dsmrTelegram.getVoltageSwellsPhaseL3());\n assertEquals( 220.1, dsmrTelegram.getVoltageL1(), 0.001);\n assertEquals( 220.2, dsmrTelegram.getVoltageL2(), 0.001);\n assertEquals( 220.3, dsmrTelegram.getVoltageL3(), 0.001);\n assertEquals( 1, dsmrTelegram.getCurrentL1(), 0.001);\n assertEquals( 2, dsmrTelegram.getCurrentL2(), 0.001);\n assertEquals( 3, dsmrTelegram.getCurrentL3(), 0.001);\n assertEquals( 1.111, dsmrTelegram.getPowerReceivedL1(), 0.001);\n assertEquals( 2.222, dsmrTelegram.getPowerReceivedL2(), 0.001);\n assertEquals( 3.333, dsmrTelegram.getPowerReceivedL3(), 0.001);\n assertEquals( 4.444, dsmrTelegram.getPowerReturnedL1(), 0.001);\n assertEquals( 5.555, dsmrTelegram.getPowerReturnedL2(), 0.001);\n assertEquals( 6.666, dsmrTelegram.getPowerReturnedL3(), 0.001);\n assertEquals( 1, dsmrTelegram.getMBusEvents().size());\n\n assertEquals( 3, dsmrTelegram.getMBusEvents().get(1).getDeviceType());\n assertEquals(\"2222ABCD123456789\", dsmrTelegram.getMBusEvents().get(1).getEquipmentId());\n assertEquals(ZonedDateTime.parse(\"2010-12-09T11:25+01:00\"), dsmrTelegram.getMBusEvents().get(1).getTimestamp());\n assertEquals( 12785.123, dsmrTelegram.getMBusEvents().get(1).getValue(), 0.001);\n assertEquals( \"m3\", dsmrTelegram.getMBusEvents().get(1).getUnit());\n\n assertEquals(\"2222ABCD123456789\", dsmrTelegram.getGasEquipmentId());\n assertEquals(ZonedDateTime.parse(\"2010-12-09T11:25+01:00\"), dsmrTelegram.getGasTimestamp());\n assertEquals(12785.123, dsmrTelegram.getGasM3(), 0.001);\n\n assertEquals(\"EF2F\", dsmrTelegram.getCrc());\n\n // The CRC of this testcase is invalid.\n // Or better: I have not been able to copy it from the documentation and\n // recreate the \"original\" record for which the provided CRC was calculated.\n // assertTrue(dsmrTelegram.isValidCRC());\n }", "boolean isLengthUnitsRequired(QName eltName, QName styleName);", "public boolean ParseExcellon(String fileName, DrillList drillList, DrillToolMap drillToolMap)\n {\n ILogWriter log= new ConsoleLogWriter();\n f=new FileOpration();\n f.Open(fileName);\n String s;\n s=SkipComments();\n if (s.compareTo(\"M48\")!=0)\n {\n log.Writeln(\"begin of header not found\");\n return false;\n }\n log.Writeln(s+\"\\t//header found at \"+f.getIndex());\n s=f.Readln();\n while (s.lastIndexOf(\";FILE_FORMAT=\")==-1)\n {\n s=f.Readln();\n if (s==null) return false;\n }\n log.Writeln(s+\"\\t//found decimal point position declaration at \"+ f.getIndex());\n try {\n digBeforePoint = Integer.parseInt(s.substring(s.lastIndexOf('=')+1,s.lastIndexOf(':')));\n log.Writeln(\"\\tamount of digts before point is setted to \"+digBeforePoint);\n int digAfterPointStartPosition=s.lastIndexOf(':')+1;\n digAfterPoint= Integer.parseInt(s.substring(digAfterPointStartPosition,s.indexOf(' ',digAfterPointStartPosition)));\n log.Writeln(\"\\tamount of digts after point is setted to \"+digAfterPoint);\n }\n catch (NumberFormatException | IndexOutOfBoundsException exc)\n {\n log.Writeln(\"invalid decimal point position declaration\");\n f.Close();\n return false;\n }\n /*catch (IndexOutOfBoundsException exc)\n {\n log.Writeln(\"invalid decimal point position declaration\");\n f.Close();\n return false;\n }*/\n s=SkipComments();\n switch (s.toUpperCase())\n {\n case \"METRIC\":\n metric=true;\n break;\n case \"INCH\":\n metric=false;\n break;\n default:\n log.Writeln(\"the type of measurement system not found\");\n return false;\n }\n log.Writeln(s+\"\\t//the type of measurement system found at \"+f.getIndex());\n log.Writeln(\"\\t the type of measurement system is setted to \"+ (metric?\"METRIC\":\"INCH\"));\n do\n {\n s=SkipComments();\n log.Writeln(s);\n if (s.charAt(0)=='%') break;\n try\n {\n String toolName = s.substring(0, s.indexOf('C'));\n double toolDiam=Double.parseDouble(s.substring(s.indexOf('C')+1));\n drillToolMap.AddTool(toolName,toolDiam);\n log.Writeln(\"\\t\"+toolName+\" with diameter \"+toolDiam+\" found at \"+f.getIndex());\n\n }\n catch (NumberFormatException | IndexOutOfBoundsException exc)\n {\n log.Writeln(\"invalid tool declaration at \"+f.getIndex());\n f.Close();\n return false;\n }\n\n } while (s.charAt(0)!='%');\n log.Writeln(\"end of header found at \"+f.getIndex());\n s = SkipComments();\n do {\n if (s==null)\n {\n log.Writeln(\"parsing completed without footer at \"+f.getIndex());\n f.Close();\n return false;\n }\n if (s.compareTo(\"T00\")==0)\n {\n log.Writeln(\"\\tFooter found at \"+f.getIndex());\n s = SkipComments();\n log.Writeln(s);\n if (s.compareTo(\"M30\")==0)\n {\n log.Writeln(\"\\tEnd of file found at \"+f.getIndex());\n f.Close();\n log.Writeln(\"\\tPARSING COMPLETED\");\n return true;\n }\n log.Writeln(\"parsing completed without footer at \"+f.getIndex());\n f.Close();\n return false;\n }\n log.Writeln(s);\n if (drillToolMap.GetToolDiam(s) == -1) {\n log.Writeln(\"invalid tool name found at \" + f.getIndex());\n f.Close();\n return false;\n }\n DrillFrame df=new DrillFrame();\n df.setDrillDiam(drillToolMap.GetToolDiam(s));\n log.Writeln(\"\\ttool \"+s+\" frame with tool diameter \"+ df.getDrillDiam()+\" found at \"+f.getIndex());\n double x=0,y=0;\n do\n {\n s=SkipComments();\n log.Writeln(s);\n try\n {\n String tempX=\"\",tempY=\"\";\n if (s.indexOf('X')!=-1)\n {\n if (s.indexOf('Y')!=-1)\n {\n tempX = s.substring(s.indexOf('X') + 1, s.indexOf('Y'));\n tempY = s.substring(s.indexOf('Y') + 1);\n }\n else\n {\n tempX = s.substring(s.indexOf('X') + 1);\n }\n }\n else\n {\n if (s.indexOf('Y')!=-1)\n {\n tempY = s.substring(s.indexOf('Y') + 1);\n }\n else\n {\n drillList.Add(df);\n break;\n }\n\n }\n if (tempX!=\"\")\n x=Double.parseDouble(tempX)/Math.pow(10,digAfterPoint);\n if (tempY!=\"\")\n y=Double.parseDouble(tempY)/Math.pow(10,digAfterPoint);\n df.addPoint(x,y);\n log.Writeln(\"\\tpoint (\"+Double.toString(x)+\",\"+Double.toString(y)+\") found at \"+f.getIndex());\n }\n catch (NumberFormatException | IndexOutOfBoundsException exc)\n {\n log.Writeln(\"invalid coordinate at \"+f.getIndex());\n f.Close();\n return false;\n }\n\n }while(true);\n }while (true);\n\n\n //f.Close();\n //return true;\n }", "public void setSize(String size) throws IllegalPizza{\n\t\tif(size == null)\n\t\t\tthrow new IllegalPizza(\"Illegal, pizza size is not null!\");\n\t\tString size1 = size.toLowerCase();\n\t\tif (Objects.equals(size1, \"small\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"medium\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"large\"))\n\t\t\tSize = size1;\n\t\telse \n\t\t\tthrow new IllegalPizza(\"Illegal pizza size\");\n\t}", "@Test\r\n public void testInvalidRegularAssignmentExpressionWithSIUnits1() throws IOException {\n checkError(\"varD_KMe2perHmSe4 = 3 mm/ks^3h^2\", \"0xA0182\");\r\n }", "public void parse(){\r\n\t\t//StringTokenizer st = new StringTokenizer(nmeaSentence,\",\");\r\n\t\tst = new StringTokenizer(nmeaSentence,\",\");\r\n\t\tString sv = \"\";\r\n\r\n\t\ttry{\r\n\t\t\tnmeaHeader = st.nextToken();//Global Positioning System Fix Data\r\n\t\t\tmode = st.nextToken();\r\n\t\t\tmodeValue = Integer.parseInt(st.nextToken());\r\n\r\n\t\t\tfor(int i=0;i<=11;i++){\r\n\t\t\t\tsv = st.nextToken();\r\n\t\t\t\tif(sv.length() > 0){\r\n\t\t\t\t\tSV[i] = Integer.parseInt(sv);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSV[i] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tPDOP = Float.parseFloat(st.nextToken());\r\n\t\t\tHDOP = Float.parseFloat(st.nextToken());\r\n\t\t\tVDOP = Float.parseFloat(st.nextToken());\r\n\r\n\t\t}catch(NoSuchElementException e){\r\n\t\t\t//Empty\r\n\t\t}catch(NumberFormatException e2){\r\n\t\t\t//Empty\r\n\t\t}\r\n\r\n\t}", "public void testGetNumericValue1() {\n ValueString vs = new ValueString(\"1000\");\n\n assertEquals(\"1000\", vs.getString());\n assertEquals(1000.0D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(1000, vs.getInteger());\n assertEquals(BigDecimal.valueOf(1000), vs.getBigNumber());\n }", "@Test(timeout = 4000)\n public void test113() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.parseColumnTypeAndSize(\"()\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "public void read(Scanner sc){\n\n\t\tString fract = sc.next(); // \"3/4\"\n\t\tStringTokenizer parser = new StringTokenizer(fract, \"/\");\n\t\tif(parser.countTokens() != 2)\n\t \tthrow new IllegalArgumentException(\"Bad format for fraction!\");\n\t\tString first = parser.nextToken();\n\t\tint num = Integer.parseInt(first);\n\t\tString second = parser.nextToken();\n\t\tint denom = Integer.parseInt(second);\n\t\tsetFraction(num, denom);\n }", "protected final void parseS() {\n current = read();\n skipSpaces();\n\n for (;;) {\n switch (current) {\n default:\n return;\n case '+': case '-': case '.':\n case '0': case '1': case '2': case '3': case '4':\n case '5': case '6': case '7': case '8': case '9':\n }\n \n float x2 = parseNumber();\n skipCommaSpaces();\n float y2 = parseNumber();\n skipCommaSpaces();\n float x = parseNumber();\n skipCommaSpaces();\n float y = parseNumber();\n\n float smoothX = currentX * 2 - smoothCCenterX;\n float smoothY = currentY * 2 - smoothCCenterY;\n currentX = x;\n currentY = y;\n p.curveTo(smoothX, smoothY,\n x2, y2,\n currentX, currentY);\n smoothCCenterX = x2;\n smoothCCenterY = y2;\n smoothQCenterX = currentX;\n smoothQCenterY = currentY;\n\n skipCommaSpaces();\n }\n }", "@Test\r\n\tpublic void testDec0() throws LexicalException, SyntaxException {\r\n\t\tString input = \"b{int c;}\";\r\n\t\tParser parser = makeParser(input);\r\n\t\tparser.parse();\r\n\t}", "@Override\n\tpublic void endElement(String uri, String localName, String qName)\n\t\t\tthrows SAXException {\n\t\tif (localName.equals(\"dimen\")) {\n\t\t\tString value = builder.toString();\n\t\t\tif (configDimen != null && value.trim().length() > 0) {\n\t\t\t\tif (value.contains(\"px\")) {\n\t\t\t\t\tvalue = value.substring(0, value.indexOf(\"px\"));\n\t\t\t\t\tconfigDimen.type = \"px\";\n\t\t\t\t\tconfigDimen.value = TypedValue.applyDimension(\n\t\t\t\t\t\t\tTypedValue.COMPLEX_UNIT_PX,\n\t\t\t\t\t\t\tFloat.parseFloat(value),\n\t\t\t\t\t\t\tappContext.mContainerContext.getResources()\n\t\t\t\t\t\t\t\t\t.getDisplayMetrics());\n\t\t\t\t} else if (value.contains(\"dp\")) {\n\t\t\t\t\tvalue = value.substring(0, value.indexOf(\"dp\"));\n\t\t\t\t\tconfigDimen.type = \"dp\";\n\t\t\t\t\tconfigDimen.value = TypedValue.applyDimension(\n\t\t\t\t\t\t\tTypedValue.COMPLEX_UNIT_DIP, Float\n\t\t\t\t\t\t\t\t\t.parseFloat(value),\n\t\t\t\t\t\t\tappContext.mContainerContext.getResources()\n\t\t\t\t\t\t\t\t\t.getDisplayMetrics());\n\t\t\t\t} else if (value.contains(\"dip\")) {\n\t\t\t\t\tconfigDimen.type = \"dip\";\n\t\t\t\t\tvalue = value.substring(0, value.indexOf(\"dip\"));\n\t\t\t\t\tconfigDimen.value = TypedValue.applyDimension(\n\t\t\t\t\t\t\tTypedValue.COMPLEX_UNIT_DIP, Float\n\t\t\t\t\t\t\t\t\t.parseFloat(value),\n\t\t\t\t\t\t\tappContext.mContainerContext.getResources()\n\t\t\t\t\t\t\t\t\t.getDisplayMetrics());\n\t\t\t\t} else if (value.contains(\"sp\")) {\n\t\t\t\t\tconfigDimen.type = \"sp\";\n\t\t\t\t\tvalue = value.substring(0, value.indexOf(\"sp\"));\n\t\t\t\t\tconfigDimen.value = TypedValue.applyDimension(\n\t\t\t\t\t\t\tTypedValue.COMPLEX_UNIT_SP,\n\t\t\t\t\t\t\tFloat.parseFloat(value),\n\t\t\t\t\t\t\tappContext.mContainerContext.getResources()\n\t\t\t\t\t\t\t\t\t.getDisplayMetrics());\n\t\t\t\t}\n\t\t\t\tmDimen.put(configDimen.name, configDimen);\n\t\t\t}\n\t\t} else if (localName.equals(\"boolean\")) {\n\t\t\tString value = builder.toString();\n\t\t\tif (configBoolean != null) {\n\t\t\t\tif (value == null || value.length() == 0) {\n\t\t\t\t\tconfigBoolean.value = false;\n\t\t\t\t} else {\n\t\t\t\t\tconfigBoolean.value = Boolean.parseBoolean(value);\n\t\t\t\t}\n\t\t\t\tmBoolean.put(configBoolean.name, configBoolean);\n\t\t\t}\n\t\t} else if (localName.equals(\"item\")) {\n\t\t\tif (parentTag.equals(\"string-array\")) {\n\t\t\t\tstringList.add(builder.toString());\n\t\t\t}\n\t\t} else if (localName.equals(\"string-array\")) {\n\t\t\tif (stringList.size() > 0) {\n\t\t\t\tArrayList<String> value = new ArrayList<String>();\n\t\t\t\tvalue.addAll(stringList);\n\t\t\t\tmStringArray.put(parentName, value);\n\t\t\t\tparentTag = \"\";\n\t\t\t\tparentName = \"\";\n\t\t\t\tstringList.clear();\n\t\t\t}\n\t\t} else if (localName.equals(\"string\")) {\n\t\t\tif (configString != null) {\n\t\t\t\tconfigString.value = builder.toString();\n\t\t\t\tmString.put(configString.name, configString);\n\t\t\t}\n\t\t}\n\t}", "public int parseMapSize() {\n\t\t// TODO Auto-generated method stub\n\t\tint size = -1;\n\t\tboolean isValid = false;\n\t\twhile(!isValid) {\n\t\t\tSystem.out.println(\"Please enter size of board (4-20)\");\n\t\t\t size = parseInt();\n\t\t\t if(size >= 4 && size < 21) {\n\t\t\t\t isValid = true;\n\t\t\t } else {\n\t\t\t\t System.out.println(ConsoleColors.RED + \"Size of board should be between 4 and 20.\" + ConsoleColors.RESET);\n\t\t\t }\n\t\t}\n\t\treturn size;\n\t}", "private void parse_text()\n {\n float temporary_min = min; // used to hold the values entered, before\n float temporary_max = max; // validating them\n\n String str = getText();\n Float Float_NaN = new Float(Float.NaN);\n // get the first number\n float val = findNumber( START, str, SEPARATOR );\n Float Float_val = new Float(val);\n if ( !Float_val.equals(Float_NaN) )\n temporary_min = val;\n // get the second number\n val = findNumber( SEPARATOR, str, END );\n Float_val = new Float(val);\n if ( !Float_val.equals(Float_NaN) )\n temporary_max = val;\n\n if ( temporary_min < temporary_max ) // make sure the values\n { // define a non-degenerate\n min = temporary_min; // interval, before we \n max = temporary_max; // accept them\n }\n\n show_text();\n }", "@Test\n\tpublic void testValidInput() {\n\t\t\n\t\tString normalInput = \"1357.459\";\n\t\tString germanInput = \"1357,459\";\n\t\tBigDecimal expectedOutput = new BigDecimal(normalInput);\n\t\t\n\t\t// normal input\n\t\tfor( final CellProcessor p : Arrays.asList(processor, processor2, processorChain, processorChain2) ) {\n\t\t\tassertExecution(p, normalInput, expectedOutput);\n\t\t}\n\t\t\n\t\t// german input (\",\" instead of \".\" as decimal symbol)\n\t\tfor( final CellProcessor p : Arrays.asList(processor3, processorChain3) ) {\n\t\t\tassertExecution(p, germanInput, expectedOutput);\n\t\t}\n\t}", "protected final void parseM() {\n current = read();\n skipSpaces();\n\n float x = parseNumber();\n skipCommaSpaces();\n float y = parseNumber();\n \n currentX = x;\n smoothQCenterX = x;\n smoothCCenterX = x;\n\n currentY = y;\n smoothQCenterY = y;\n smoothCCenterY = y;\n p.moveTo(x, y);\n lastMoveToX = x;\n lastMoveToY = y;\n\n skipCommaSpaces();\n }", "public void setUnits(byte units) { this.units = units; }", "public void setUnit () {\n\t\tdouble f = factor;\n\t\t/* Transform the value as a part of Unit */\n\t\tif (Double.isNaN(value)) return;\n\t\tif ((mksa&_log) != 0) {\n\t\t\tif ((mksa&_mag) != 0) value *= -2.5;\n\t\t\tfactor *= AstroMath.dexp(value);\n\t\t\tvalue = 0;\n\t\t}\n\t\telse {\n\t\t\tfactor *= value;\n\t\t\tvalue = 1.;\n\t\t}\n\t\t// Transform also the symbol\n\t\tif (f != factor) {\n\t\t\tif (symbol == null) symbol = edf(factor);\n\t\t\telse symbol = edf(factor) + toExpr(symbol);\n\t\t}\n\t}", "private void _testLeadingPeriodFloat(String valueStr, double value, int bytesPerRead)\n throws Exception\n {\n\n JsonFactory f = new JsonFactory();\n String JSON = valueStr;\n AsyncReaderWrapper p = createParser(f, JSON, bytesPerRead);\n try {\n p.nextToken();\n p.currentText();\n fail(\"Should have thrown an exception for doc <\"+JSON+\">\");\n } catch (JsonParseException e) {\n verifyException(e, \"Unexpected character ('.'\");\n verifyException(e, \"expected a valid value\");\n } finally {\n p.close();\n }\n\n // and then verify it's ok when enabled\n f = JsonFactory.builder()\n .enable(JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS)\n .build();\n p = createParser(f, JSON, bytesPerRead);\n assertToken(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());\n assertEquals(value, p.getDoubleValue());\n assertEquals(valueStr.trim(), p.currentText());\n p.close();\n }", "@Test\n public void voicesAndvarMeterHeaderTest(){\n Header h;\n SimpleReader sr = new SimpleReader();\n String fileForLexer = sr.FileToString(\"sample_abc/invention.abc\");\n abcLexer lex = new abcLexer(fileForLexer);\n abcParser parser = new abcParser(lex);\n h=parser.parseHeader();\n assertEquals(h.getMeter(),\"4/4\");// this will test for M:C\n ArrayList<String> voice = new ArrayList<String>();\n voice.add(\"V:1\");\n voice.add(\"V:2\");\n assertEquals(h.getVoice(),voice);\n }", "public String getUnitsString() {\n String result = null;\n if (forVar != null) {\n Attribute att = forVar.findAttributeIgnoreCase(CDM.UNITS);\n if ((att != null) && att.isString())\n result = att.getStringValue();\n }\n return (result == null) ? units : result.trim();\n }" ]
[ "0.62785983", "0.6245282", "0.58711314", "0.5744852", "0.5662748", "0.56476784", "0.5569294", "0.555374", "0.55467874", "0.5477197", "0.54207927", "0.53697336", "0.53681946", "0.5359869", "0.5307305", "0.5304807", "0.51798916", "0.5161917", "0.51498145", "0.5134725", "0.50931257", "0.5090426", "0.50747645", "0.5072329", "0.50662494", "0.5061236", "0.5059538", "0.5058873", "0.50555414", "0.5048487", "0.50277877", "0.5010236", "0.50081545", "0.50077224", "0.5005075", "0.497634", "0.49649167", "0.49618036", "0.49618036", "0.49618036", "0.49492806", "0.49411786", "0.49268544", "0.48933935", "0.48893154", "0.4886849", "0.48818925", "0.4870242", "0.48702416", "0.48632032", "0.4862002", "0.48607305", "0.48525596", "0.484839", "0.483026", "0.4818724", "0.48080507", "0.4807864", "0.48050162", "0.4802995", "0.48014596", "0.47806323", "0.47769397", "0.47716656", "0.47693735", "0.47641945", "0.47611582", "0.47518727", "0.47513458", "0.4742342", "0.47362283", "0.47327337", "0.47291338", "0.47283143", "0.47282624", "0.4718592", "0.4714512", "0.47118396", "0.47105485", "0.47042406", "0.4701374", "0.4693356", "0.4688704", "0.4685886", "0.46827018", "0.4678299", "0.46779576", "0.46773967", "0.46741834", "0.46691054", "0.46623054", "0.46619752", "0.46518084", "0.46516755", "0.4648891", "0.46449587", "0.46445787", "0.4642609", "0.46383142", "0.46374625" ]
0.5859836
3
we have found first int, eg 25 in "25.3em" or 25px, parse any decimal part and unit
static void parseSizeValueAfterInt(Lexer<CSSToken, CharInput> lexer, CSSUnit defaultUnit, int value, BiConsumer<Integer, CSSUnit> toCall) throws IOException, ParserException { CSSParserHelperSize.parseSizeValueAfterInt(lexer, defaultUnit, value, UNIT_OR_DOT_OR_SEMICOLON_OR_WS_OR_COMMENT_TOKENS, UNIT_OR_SEMICOLON_TOKENS, toCall); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static NormalTridasUnit parseUnitString(String str) throws Exception\n\t{\n\t\tstr = str.trim();\n\t\tif ((str==null) || (str.equals(\"\"))) return null;\n\t\n\t\tstr =str.toLowerCase();\n\t\t\n\t\tInteger val;\n\t\tBoolean mmDetected = false;\n\t\t\n\t\t//Remove leading fraction\n\t\tif(str.startsWith(\"1/\")){ str = str.substring(2);}\n\t\t\n\t\t// Remove 'ths'\n\t\tif(str.contains(\"ths\")){ str = str.replace(\"ths\", \"\");}\n\t\t\n\t\t// Remove 'th'\n\t\tif(str.contains(\"th\")){ str = str.replace(\"th\", \"\");}\n\t\t\n\t\t// Remove 'mm'\n\t\tif(str.contains(\"mm\"))\n\t\t{ \n\t\t\tstr = str.replace(\"mm\", \"\");\n\t\t\tmmDetected = true;\n\t\t}\n\t\tif(str.contains(\"millimet\"))\n\t\t{ \n\t\t\tstr = str.replace(\"millimetres\", \"\");\n\t\t\tstr = str.replace(\"millimeters\", \"\");\n\t\t\tstr = str.replace(\"millimetre\", \"\");\n\t\t\tstr = str.replace(\"millimeter\", \"\");\n\t\t\tmmDetected = true;\n\t\t}\n\t\t\n\t\tif(str.length()==0 && mmDetected)\n\t\t{\n\t\t\treturn NormalTridasUnit.MILLIMETRES;\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tval = Integer.parseInt(str.trim());\n\t\t} catch (NumberFormatException e)\n\t\t{\n\t\t\tthrow new Exception(\"Unable to parse units from units string\");\n\t\t}\n\t\t\n\t\tswitch(val)\n\t\t{\t\n\t\t\tcase 10: return NormalTridasUnit.TENTH_MM; \n\t\t\tcase 20: return NormalTridasUnit.TWENTIETH_MM;\n\t\t\tcase 50: return NormalTridasUnit.FIFTIETH_MM;\n\t\t\tcase 100: return NormalTridasUnit.HUNDREDTH_MM; \n\t\t\tcase 1000: return NormalTridasUnit.MICROMETRES; \n\t\t}\n\t\t\n\t\tthrow new Exception(\"Unable to parse units from units string\");\n\t}", "private static float parseCoOrdinate(String value) {\n\t\tfloat result = 0f;\n\n\t\t// Quick and dirty way to determine if the value appears to have a units suffix.\n\t\tif (value.charAt(value.length() - 1) >= 'a') {\n\t\t\tif (value.endsWith(\"px\")) {\n\t\t\t\tvalue = value.substring(0, value.length() - 2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// TODO: Add support in future for other units here.\n\t\t\t\t// TODO: Call our error reporting function.\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tresult = Float.parseFloat(value);\n\t\t}\n\t\tcatch (final NumberFormatException nfe) {\n\n\t\t}\n\t\treturn result;\n\t}", "private double parseHTMLForTemp(String line){\n String output = \"\";\n int end = 0;\n char charInt;\n for (int i=0; i<line.length(); i++){\n charInt=line.charAt(i);\n if(charInt>=45 && charInt<=57){\n output = output + charInt;\n end+=1;\n }\n else{\n if (end > 1){\n break;\n }\n }\n }\n\n return Double.parseDouble(output.substring(1));\n }", "private static Float tryParsePageLengthValue(String valueChunk, float em, float rem) {\n UnitValue unitValue = CssUtils.parseLengthValueToPt(valueChunk, em, rem);\n if (unitValue == null || unitValue.isPercentValue()) {\n return null;\n }\n return unitValue.getValue();\n }", "private static float parse_number() {\n skip_spaces();\n\n if (i == l) {\n throw new Error(String.format(\"Unexpected end (s=%s)\", s));\n }\n\n int start = i;\n\n char c = s.charAt(i);\n\n // Consume sign.\n if (c == '-' || c == '+') {\n i += 1;\n c = s.charAt(i);\n }\n\n // Consume integer.\n if (c >= '0' && c <= '9') {\n skip_digits();\n if (i < l) {\n c = s.charAt(i);\n }\n } else if (c != '.') {\n throw new Error(\n String.format(\"Invalid number formating character '%c' (i=%d, s=%s)\", c, i, s));\n }\n\n // Consume fraction.\n if (c == '.') {\n i += 1;\n skip_digits();\n if (i < l) {\n c = s.charAt(i);\n }\n }\n\n if ((c == 'e' || c == 'E') && i + 1 < l) {\n char c2 = s.charAt(i + 1);\n // Check for `em`/`ex`.\n if (c2 != 'm' && c2 != 'x') {\n i += 1;\n c = s.charAt(i);\n\n if (c == '+' || c == '-') {\n i += 1;\n skip_digits();\n } else if (c >= '0' && c <= '9') {\n skip_digits();\n } else {\n throw new Error(\n String.format(\"Invalid number formating character '%c' (i=%d, s=%s)\", c, i, s));\n }\n }\n }\n\n String num = s.substring(start, i);\n float n = Float.parseFloat(num);\n\n // inf, nan, etc. are an error.\n if (Float.isInfinite(n) || Float.isNaN(n)) {\n throw new Error(\n String.format(\"Invalid number '%s' (start=%d, i=%d, s=%s)\", num, start, i, s));\n }\n\n return n;\n }", "private Token scanNumber(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(firstChar.getCharacter());\n\t\tappendSubsequentDigits(buffer);\n\t\tif(input.peek().getCharacter() == DECIMAL_POINT) {\n\t\t\tLocatedChar c = input.next();\n\t\t\tif(input.peek().getCharacter() == DECIMAL_POINT) {\n\t\t\t\tinput.pushback(c);\n\t\t\t\treturn IntToken.make(firstChar, buffer.toString());\n\t\t\t}\n\t\t\tbuffer.append(c.getCharacter());\n\t\t\tif(input.peek().isDigit()) {\n\t\t\t\tappendSubsequentDigits(buffer);\n\t\t\t\tif(input.peek().getCharacter() == CAPITAL_E) {\n\t\t\t\t\tLocatedChar expChar = input.next();\n\t\t\t\t\tbuffer.append(expChar.getCharacter());\n\t\t\t\t\tif(input.peek().getCharacter() == '+' || input.peek().getCharacter() == '-') {\n\t\t\t\t\t\tbuffer.append(input.next().getCharacter());\n\t\t\t\t\t}\n\t\t\t\t\tif(input.peek().isDigit()) {\n\t\t\t\t\t\tappendSubsequentDigits(buffer);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlexicalError(expChar, \"malformed floating exponent literal\");\n\t\t\t\t\t\treturn findNextToken();\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\treturn FloatToken.make(firstChar, buffer.toString());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlexicalError(firstChar, \"malformed floating literal\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn IntToken.make(firstChar, buffer.toString());\n\t\t}\n\t}", "private String subStringToInteger(String quantity) {\n String substring = null;\n\n if (quantity.contains(\".\")) {\n int indexEnd = quantity.indexOf(\".\");\n substring = quantity.substring(0, indexEnd);\n }\n\n return substring == null ? quantity : substring;\n }", "private String convertFeetToInches(String description) {\n String regex = \"(\\\\d+) to (\\\\d+) feet|up to (\\\\d+) (feet|foot)\";\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(description);\n if (matcher.find()) {\n if (matcher.group(1) != null) {\n int lower = Integer.parseInt(matcher.group(1)) * 12;\n int upper = Integer.parseInt(matcher.group(2)) * 12;\n return description.replace(matcher.group(0), lower + \" to \" + upper + \" inches\");\n }\n int upper = Integer.parseInt(matcher.group(3)) * 12;\n return description.replace(matcher.group(0), \"up to \" + upper + \" inches\");\n }\n return description;\n }", "public static double parseHumanReadable(String datum, String separator, String unit)\n {\n int end = datum.length();\n if (unit != null)\n {\n if (!datum.endsWith(unit))\n throw new NumberFormatException(datum + \" does not end in unit \" + unit);\n end -= unit.length();\n }\n\n Matcher m = BASE_NUMBER_PATTERN.matcher(datum);\n m.region(0, end);\n if (!m.lookingAt())\n throw new NumberFormatException();\n double v = Double.parseDouble(m.group(0));\n\n int pos = m.end();\n if (m.group(2) == null) // possible binary exponent, parse\n {\n m = BINARY_EXPONENT.matcher(datum);\n m.region(pos, end);\n if (m.lookingAt())\n {\n int power = Integer.parseInt(m.group(1));\n v = Math.scalb(v, power);\n pos = m.end();\n }\n }\n\n if (separator != null)\n {\n if (!datum.startsWith(separator, pos))\n throw new NumberFormatException(\"Missing separator \" + separator + \" in \" + datum);\n pos += separator.length();\n }\n else\n {\n while (pos < end && Character.isWhitespace(datum.charAt(pos)))\n ++pos;\n }\n\n if (pos < end)\n {\n char prefixChar = datum.charAt(pos);\n int prefixIndex = UNIT_PREFIXES.indexOf(prefixChar);\n if (prefixIndex >= 0)\n {\n prefixIndex -= UNIT_PREFIXES_BASE;\n ++pos;\n if (pos < end && datum.charAt(pos) == 'i')\n {\n ++pos;\n v = Math.scalb(v, prefixIndex * 10);\n }\n else\n {\n v *= Math.exp(Math.log(1000.0) * prefixIndex);\n }\n }\n }\n\n if (pos != end && unit != null)\n throw new NumberFormatException(\"Unexpected characters between pos \" + pos + \" and \" + end + \" in \" + datum);\n\n return v;\n }", "public int parse (String text, int offset) {\n\t\tParsing t = new Parsing(text, offset);\n\t\tif (true) {\n\t\t\tthis.parsing(t);\n\t\t}\n\t\telse {\t\t\t\t//*** OLD CODE\n\t\t\tdouble val;\n\t\t\tint pos1, pos2, pos3;\n\t\t\tboolean has_value, has_unit;\n\t\t\tif (!initialized) init();\t// Be sure everyting in place\n\n\t\t\t/* Ignore the leading blanks */\n\t\t\tt.gobbleSpaces();\n\t\t\tpos1 = t.pos;\t\t\t// Just before the possible value\n\n\t\t\t/* Interpret the Value, if any */\n\t\t\tval = t.parseFactor();\t\t// Default value is 1\n\t\t\tpos2 = t.pos;\t\t\t// After interpretation of Value\n\t\t\thas_value = pos2 > pos1; \t// Something was found.\n\n\t\t\t/* Skip blanks between value and Unit */\n\t\t\tt.gobbleSpaces();\n\n\t\t\t/* It may happen that interpreting the Value first generates an error,\n\t for instance 1/4. That means that the number (1) is part of the\n\t unit, and is not the value in front of the unit.\n\t\t\t */\n\t\t\tif (t.lookup(op_symb) >= 0) {\n\t\t\t\thas_value = false;\n\t\t\t\tt.pos = pos1;\n\t\t\t\tpos2 = pos1;\n\t\t\t}\n\n\t\t\t/* Interpret the Unit */\n\t\t\thas_unit = true;\n\t\t\tpos3 = t.pos;\t\t\t// Starting offset of unit\n\t\t\ttry { unitec(t, null) ; }\n\t\t\tcatch (Exception e) {\n\t\t\t\thas_unit = false;\n\t\t\t\tt.pos = pos2;\n\t\t\t\tif (!has_value) t.pos = offset;\n\t\t\t}\n\t\t\tif (has_unit) symbol = text.substring(pos3, t.pos);\n\t\t\tvalue = has_value ? val : 0./0. ;\n\t\t}\n\t\treturn(t.pos);\n\t}", "private void handleNumber() {\n while (isDigit(peek())) {\n advance();\n }\n\n // Look for decimals; Will be allowing extension calls like 140.abs() so make sure it's a numerical decimal\n if (peek() == '.' && isDigit(peekFurther(1))) {\n\n // Consume the decimal\n advance();\n\n // Consume the digits following the decimal\n while (isDigit(peek())) {\n advance();\n }\n }\n\n addToken(NUMBER, Double.parseDouble(source.substring(start, current)));\n }", "protected static float toInches(int type, float value) {\n \t\tswitch (type) {\n \t\tcase CSSPrimitiveValue.CSS_CM:\n \t\t\treturn (value / 2.54f);\n \t\tcase CSSPrimitiveValue.CSS_MM:\n \t\t\treturn (value / 25.4f);\n \t\tcase CSSPrimitiveValue.CSS_IN:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_PT:\n \t\t\treturn (value / 72);\n \t\tcase CSSPrimitiveValue.CSS_PC:\n \t\t\treturn (value / 6);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "protected static float toMillimeters(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_CM:\n \t\t\treturn (value * 10);\n \t\tcase CSSPrimitiveValue.CSS_MM:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_IN:\n \t\t\treturn (value * 25.4f);\n \t\tcase CSSPrimitiveValue.CSS_PT:\n \t\t\treturn (value * 25.4f / 72);\n \t\tcase CSSPrimitiveValue.CSS_PC:\n \t\t\treturn (value * 25.4f / 6);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "public abstract double fromBasicUnit(double valueJTextInsert);", "private String getUnits(Unit units, int value) {\n if (units == Unit.FEET) {\n if (value == 1) return \" foot\";\n return \" feet\";\n }\n if (value == 1) return \" inch\";\n return \" inches\";\n }", "private int parseExponentString(String str) {\n\t\treturn Integer.parseInt(str.substring(1));\n\t}", "private float findNumber( int start_char, String str, char end_char )\n {\n int i;\n float val = Float.NaN;\n\n i = str.indexOf( start_char ); // find the start_char and discard the\n if ( i < 0 ) // preliminary part of the string\n {\n Toolkit.getDefaultToolkit().beep();\n return Float.NaN;\n }\n str = str.substring(i+1);\n \n i = str.indexOf( end_char ); // find the end_char and discard the\n if ( i < 0 ) // remaining part of the string\n {\n Toolkit.getDefaultToolkit().beep();\n return Float.NaN;\n }\n str = str.substring(0,i);\n\n try // extract the float value between\n { // start_char and end_char, if possible\n val = Float.valueOf(str).floatValue();\n }\n catch (Exception e ) \n { \n Toolkit.getDefaultToolkit().beep();\n System.out.println(\"Exception in TextRangeUI.findNumber\");\n System.out.println(\"Exception is: \" + e );\n }\n\n return val; \n }", "public int parseAmount(String goods) {\n return Integer.parseInt(goods.split(\"\\\\s+\")[3]);\n }", "private ChronoUnit parseUnit(String unitStr) {\n unitStr = unitStr.toUpperCase();\n // If the unitStr ends with a 'S' then do nothing otherwise add a 'S' to the end\n unitStr = unitStr.charAt(unitStr.length() - 1) == 'S' ? unitStr : unitStr + \"S\";\n // Return the corresponding ChronoUnit\n switch (unitStr) {\n case \"DAYS\":\n return ChronoUnit.DAYS;\n case \"WEEKS\":\n return ChronoUnit.WEEKS;\n case \"HOURS\":\n return ChronoUnit.HOURS;\n case \"SECONDS\":\n return ChronoUnit.SECONDS;\n case \"MINUTES\":\n return ChronoUnit.MINUTES;\n }\n return ChronoUnit.DAYS;\n }", "public int parseUnit (String text, int offset) {\n\t\tint o = parse(text, offset);\n\t\tthis.setUnit();\n\t\treturn(o);\n\t}", "public static double atof(String s)\n {\n int i = 0;\n int sign = 1;\n double r = 0; // integer part\n // double f = 0; // fractional part\n double p = 1; // exponent of fractional part\n int state = 0; // 0 = int part, 1 = frac part\n\n while ((i < s.length()) && Character.isWhitespace(s.charAt(i)))\n {\n i++;\n }\n\n if ((i < s.length()) && (s.charAt(i) == '-'))\n {\n sign = -1;\n i++;\n }\n else if ((i < s.length()) && (s.charAt(i) == '+'))\n {\n i++;\n }\n\n while (i < s.length())\n {\n char ch = s.charAt(i);\n\n if (('0' <= ch) && (ch <= '9'))\n {\n if (state == 0)\n {\n r = ((r * 10) + ch) - '0';\n }\n else if (state == 1)\n {\n p = p / 10;\n r = r + (p * (ch - '0'));\n }\n }\n else if (ch == '.')\n {\n if (state == 0)\n {\n state = 1;\n }\n else\n {\n return sign * r;\n }\n }\n else if ((ch == 'e') || (ch == 'E'))\n {\n long e = (int) parseLong(s.substring(i + 1), 10);\n\n return sign * r * Math.pow(10, e);\n }\n else\n {\n return sign * r;\n }\n\n i++;\n }\n\n return sign * r;\n }", "private int extractInt() {\n\t\tint startIndex = index;\n\t\tfor (; index < exprLen; index++) {\n\t\t\tchar c = expr.charAt(index);\n\t\t\tif (!Character.isDigit(c)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tint endIndex = index;\n\t\tint value;\n\t\ttry {\n\t\t\tvalue = Integer.parseInt(expr.substring(startIndex, endIndex));\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(e.getMessage());\n\t\t}\n\n\t\treturn value;\n\t}", "private void parseUnitLengthDegreeScaler(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length == 2) {\n\t\t\tthis.setUnitLengthDegreeScaler(Double.parseDouble(tokens[1]));\n\t\t}\n\t\telse if(tokens.length == 3) {\n\t\t\tdouble firstNumber = Double.parseDouble(tokens[1].replace(\"/\", \"\"));\n\t\t\tdouble secondNumber = Double.parseDouble(tokens[2].replace(\"/\", \"\"));\n\t\t\tdouble degreeScaler = firstNumber / secondNumber;\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse if(tokens.length == 4 && tokens[2].equals(\"/\")) {\n\t\t\tdouble degreeScaler = Double.parseDouble(tokens[1]) / Double.parseDouble(tokens[3]);\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLengthDegreeScaler\");\n\t\t}\n\t}", "public static String extractPercentOrNumberStr(String str){\n return extract(str, percentOrNumberExtractPattern);\n }", "public int parsePrice(String goods) {\n return Integer.parseInt(goods.split(\"\\\\s+\")[2]);\n }", "private int getNumberFromString(String text){\n\t\t\n\t\tint result = 0;\n\t\t\n\t\tfor(int i=text.length() - 1, j=0; i >= 0 ; i--, j++){\n\t\t\t\n\t\t\tresult += (Character.getNumericValue(text.charAt(i))) * Math.pow(10, j);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private Number parseNumber(String part) {\n try {\n return this.numberFormat.parse(part);\n } catch (ParseException e) {\n throw new NumberFormatException(String.format(\"Could not parse: %s to number\", part));\n }\n }", "private static double parseOutNum(String s)\n {\n final int N = s.length();\n // If the last character of s is a digit, the whole of s is assumed to\n // be a numeral. Otherwise, s up to, but not including, its last \n // character, is assumed to be a numeral.\n if (Character.isDigit(s.charAt(N-1)))\n { return Double.parseDouble(s); }\n else\n { return Double.parseDouble(s.substring(0,N-1)); }\n }", "public String getUnit() {\n String unit = (String) comboUnits.getSelectedItem();\n if (\"inch\".equals(unit)) {\n return \"in\";\n } else if (\"cm\".equals(unit)) {\n return \"cm\";\n } else if (\"mm\".equals(unit)) {\n return \"mm\";\n } else if (\"pixel\".equals(unit)) {\n return \"px\";\n }\n return \"\";\n }", "private static int extractInt(String str) {\n\n String num = \"\";\n for (int i = 0; i < str.length(); i++) {\n if (java.lang.Character.isDigit(str.charAt(i))) num += str.charAt(i);\n }\n return (num.equals(\"\")) ? 0 : java.lang.Integer.parseInt(num);\n\n }", "public float convertUnitToEm(float ptSize, int units) {\n return (units * ptSize) / upem;\n }", "protected static float toPoints(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_CM:\n \t\t\treturn (value * 72 / 2.54f);\n \t\tcase CSSPrimitiveValue.CSS_MM:\n \t\t\treturn (value * 72 / 25.4f);\n \t\tcase CSSPrimitiveValue.CSS_IN:\n \t\t\treturn (value * 72);\n \t\tcase CSSPrimitiveValue.CSS_PT:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_PC:\n \t\t\treturn (value * 12);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "private double processFactor() throws ParsingException {\n if (tryCaptureChar('-')) {\n return -processFactor();\n }\n\n double result;\n int startPos = this.pos;\n\n if (tryCaptureChar('(')) {\n result = processExpression();\n tryCaptureChar(')');\n } else if (Character.isDigit(ch) || ch == '.') {\n\n while (Character.isDigit(ch) || ch == '.') {\n getNextChar();\n }\n\n // Number of points in a string\n // Without a hack :(\n int countPoints = 0;\n for (int i = startPos; i < this.pos; ++i) {\n countPoints += expression.charAt(i) == '.' ? 1 : 0;\n }\n\n if (countPoints > 1) {\n throw new ParsingException(\"Number with many points found\");\n }\n\n result = Double.parseDouble(expression.substring(startPos, this.pos));\n } else {\n throw new ParsingException(\"Unexpected appearance of: \" + ch);\n }\n\n return result;\n }", "@Test\n public void fixedTests() {\n assertEquals(69978 , Day02.parseInt(\"sixty nine thousand nine hundred seventy eight\"));\n }", "public int myAtoi(String str) {\n\t\tboolean isStarted = false;\n\t\tint startPos = str.length();\n\t\tint endPos = str.length();\n\t\tif (str == null || str.length() == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tchar[] s = str.toCharArray();\n\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\tif (s[i] == ' ') {\n\t\t\t\tif (!isStarted) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tendPos = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isValidNumber(s[i])) {\n\t\t\t\tif (!isStarted) {\n\t\t\t\t\tisStarted = true;\n\t\t\t\t\tstartPos = i;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (isValidChar(i, s[i], str)) {\n\t\t\t\tisStarted = true;\n\t\t\t\tstartPos = i;\n\t\t\t} else {\n\t\t\t\tif (!isStarted) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\tendPos = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tString valueStr = str.substring(startPos, endPos);\n\t\tvalueStr = (valueStr.equals(\"+\") || valueStr.equals(\"-\") || valueStr.isEmpty()) ? \"0\" : valueStr;\n\t\treturn filterOverflow(Double.valueOf(valueStr));\n\t}", "public static long parse(String s, ByteUnit defaultUnit) throws NumberFormatException {\n\n // Value must be a floating point number followed by a unit.\n Pattern p = Pattern.compile(\"^\\\\s*(\\\\d+)\\\\s*(\\\\w+)?\\\\s*$\");\n Matcher m = p.matcher(s);\n\n if (!m.matches()) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n }\n\n // Group 1 is the float.\n long l;\n\n try {\n l = Long.valueOf(m.group(1));\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n }\n\n // Group 2 is the unit.\n String unitString = m.group(2);\n ByteUnit unit;\n\n if (unitString == null) {\n if (defaultUnit == null) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n } else {\n unit = defaultUnit;\n }\n } else {\n try {\n unit = ByteUnit.valueOf(unitString.trim());\n } catch (IllegalArgumentException e) {\n throw new NumberFormatException(\"Invalid size value \\\"\" + s + \"\\\"\");\n }\n }\n\n return l * unit.value;\n }", "private double tranferStringToNum(String num){\r\n double number = 0;\r\n try{\r\n\tnumber = Double.parseDouble(num);\r\n }catch(Exception ex){\r\n\tnumber = 0;\r\n }\r\n return number;\r\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public abstract float mo70722e(String str);", "private int extractNumberFromText(String value) {\n\t\tif(!value.isEmpty()) {\n\t\t\tString[] token = value.split(\";\");\n\t\t\tString number = token[0].trim();\n\t\t\treturn Integer.valueOf(number);\n\t\t}\n\t\treturn 0;\n\t}", "public static String getCssText(short unit, float value) {\n \t\tif (unit < 0 || unit >= UNITS.length) {\n \t\t\tthrow new DOMException(DOMException.SYNTAX_ERR, \"\");\n \t\t}\n \t\tString s = String.valueOf(value);\n \t\tif (s.endsWith(\".0\")) {\n \t\t\ts = s.substring(0, s.length() - 2);\n \t\t}\n \t\treturn s + UNITS[unit - CSSPrimitiveValue.CSS_NUMBER];\n \t}", "private String getResultUnit() {\n switch (mCalculationType) {\n case CONSUMPTION_L_100_KM:\n return \"l/100 km\";\n case CONSUMPTION_KM_L:\n return \"km/l\";\n case CONSUMPTION_MPG:\n return \"mpg\";\n default:\n return \"\";\n }\n }", "private Double parseNumber(String num) {\r\n\t\tDouble tempnum = (double) 0;\r\n\t\tint opos; //operator position\r\n\t\tif ((num == null) || (num.length() < 1) ) {\r\n\t\t\treturn tempnum;\r\n\t\t}\r\n\r\n\t\t//replace constants with their value\r\n\t\twhile (num.indexOf(\"P\") >= 0) { //PI constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'P', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.PI)+numparts[1];\r\n\t\t}\r\n\t\twhile (num.indexOf(\"X\") >= 0) { //e constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'X', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.E)+numparts[1];\r\n\t\t}\r\n\r\n\t\tif (num.indexOf(\"^\") >= 0) { //allows to specify powers (e.g.: 2^10)\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '^', 2);\r\n\t\t\ttempnum = Math.pow(parseNumber(numparts[0]), parseNumber(numparts[1]));\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"-\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '-', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) - parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"+\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '+', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) + parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"/\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '/', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) / parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"*\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '*', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) * parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttempnum = Double.valueOf(num);\r\n\t\t}\r\n\r\n\t\treturn tempnum;\r\n\t}", "private double parseAmount(String amount){\n return Double.parseDouble(amount.replace(\",\", \".\"));\n }", "private void parse_text()\n {\n float temporary_min = min; // used to hold the values entered, before\n float temporary_max = max; // validating them\n\n String str = getText();\n Float Float_NaN = new Float(Float.NaN);\n // get the first number\n float val = findNumber( START, str, SEPARATOR );\n Float Float_val = new Float(val);\n if ( !Float_val.equals(Float_NaN) )\n temporary_min = val;\n // get the second number\n val = findNumber( SEPARATOR, str, END );\n Float_val = new Float(val);\n if ( !Float_val.equals(Float_NaN) )\n temporary_max = val;\n\n if ( temporary_min < temporary_max ) // make sure the values\n { // define a non-degenerate\n min = temporary_min; // interval, before we \n max = temporary_max; // accept them\n }\n\n show_text();\n }", "private String getAmountUnit(int unit) {\n switch (unit) {\n case UNIT_LITERS:\n return getResourceString(R.string.val_l);\n case UNIT_GALLONS:\n return getResourceString(R.string.val_g);\n }\n\n return \"\";\n }", "public static double MyParseFloat(String s) throws Exception {\n\t\tStateFloat state;\n\n\t\tstate = StateFloat.SA;\n\n\t\tint i = 0;\n\t\tBoolean neg = false;\n\t\tBoolean nege = false;\n\t\tdouble divider = 10;\n\t\tdouble value = 0;\n\t\tint exponent = 0;\n\n\twhile (i < s.length() && (state != StateFloat.SC || state != StateFloat.SF || state != StateFloat.SH)) {\n\t\t\tchar ch = s.charAt(i);\n\t\t\tswitch (state) {\n\t\t\t\tcase SA:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SC;\n\t\t\t\t\t\tvalue = Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '+' || ch == '-') {\n\t\t\t\t\t\tstate = StateFloat.SB;\n\t\t\t\t\t\tif (ch == '-') neg = true;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SB:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SC;\n\t\t\t\t\t\tif (neg) value = 10*value - Character.getNumericValue(ch);\n\t\t\t\t\t\telse value = 10*value + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SC:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tif (neg) value = 10*value - Character.getNumericValue(ch);\n\t\t\t\t\t\telse value = 10*value + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == 'e' || ch == 'E') {\n\t\t\t\t\t\tstate = StateFloat.SE;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SD:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SF;\n\t\t\t\t\t\tif (neg) value -= Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\telse value += Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\tdivider *= 10;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SE:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SH;\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '+' || ch == '-') {\n\t\t\t\t\t\tstate = StateFloat.SG;\n\t\t\t\t\t\tif (ch == '-') nege = true;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SF:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\t//Divider comes here\n\t\t\t\t\t\tif (neg) value -= Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\telse value += Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\tdivider *= 10;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == 'e' || ch == 'E') {\n\t\t\t\t\t\tstate = StateFloat.SE;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SG:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SH;\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SH:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state != StateFloat.SC && state != StateFloat.SF && state != StateFloat.SH) throw new Exception(\"Bad Format\");\n\t\tvalue = value * Math.pow(10, exponent);\n\t\treturn value;\n\t}", "public static int retrieve_num_element(String str, String query_element) {\n\t\tint total = 0;\n\t\tint str_index = str.indexOf(query_element);\n\t\t\t\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tif (str.substring(i, i + 1).equals(query_element)) {\n\t\t\t\tint value = 0;\n\t\t\t\tString num_str = \"\";\n\t\t\t\tfor (int j = i + 1; j < str.length(); j++) {\n\t\t\t\t\t\n\t\t\t\t\tif (str.substring(j, j + 1).matches(\"[0-9]\")) {\n\t\t\t\t\t\tnum_str += str.substring(j, j + 1);\n\t\t\t\t\t\tvalue = new Integer(num_str);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (value == 0) {\n\t\t\t\t\t\t\tvalue = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i == str.length() - 1) {\n\t\t\t\t\tvalue = 1;\n\t\t\t\t}\n\t\t\t\ttotal += value;\n\t\t\t}\n\t\t}\n\n\t\treturn total;\n\t}", "public static String units(String unit) {\n\t\tswitch (unit) {\n\t\t\tcase \"feet\":\n\t\t\t\treturn \"ft\";\n\t\t\tcase \"miles\":\n\t\t\t\treturn \"mi\";\n\t\t\tcase \"meters\":\n\t\t\t\treturn \"m\";\n\t\t\tcase \"kilometers\":\n\t\t\t\treturn \"km\";\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}", "protected static Item parseStringToItem(String str) {\n String[] strList = str.split(\",\");\n if (strList.length != 3) {\n System.err.println(\"File line data is not in the correct format.\");\n return null;\n }\n\n //find the index of the place where the cost numbers start\n Matcher matcher = Pattern.compile(\"\\\\d\").matcher(strList[2]);\n matcher.find();\n int numberIndex = strList[2].indexOf(matcher.group());\n Item item = new Item(Integer.parseInt(strList[0]),\n Double.valueOf(strList[1]),\n strList[2].substring(0, numberIndex).trim(),\n Double.valueOf(strList[2].substring(numberIndex)));\n return item;\n }", "static int getNumberFromString(String s) {\n if (s == null) {\n throw new NumberFormatException(\"null\");\n }\n int result = 0;\n int startIndex = 0;\n int length = s.length();\n boolean negative = false;\n char firstChar = s.charAt(0);\n if (firstChar == '-') {\n negative = true;\n startIndex = 1;\n }\n\n for (int i = startIndex; i < length; i++) {\n char num = s.charAt(i);\n result = result * 10 + num - '0';\n }\n\n return negative ? -result : result;\n }", "private Values getThicknessSizeValObj(String val,String unit){\n\t\tval = val.replaceAll(\"[^0-9.x ]\", \"\");\r\n\t\tString[] values = val.split(\"x\");\r\n\t\tValue valObj1 = null;\r\n\t\tValue valObj2 = null;\r\n\t\tValue valObj3 = null;\r\n\t\tList<Value> listOfValue = new ArrayList<>();\r\n\t\tif(values.length == ApplicationConstants.CONST_INT_VALUE_ONE){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t} else if(values.length == ApplicationConstants.CONST_INT_VALUE_TWO){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t valObj2 = getValueObj(values[1].trim(), \"Thickness\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t} else if(values.length == ApplicationConstants.CONST_INT_VALUE_THREE){\r\n\t\t\t valObj1 = getValueObj(values[0].trim(), \"Length\", unit);\r\n\t\t\t valObj2 = getValueObj(values[1].trim(), \"Width\", unit);\r\n\t\t\t valObj3 = getValueObj(values[2].trim(), \"Thickness\", unit);\r\n\t\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t listOfValue.add(valObj3);\r\n\t\t}\r\n\t\t Values valuesObj = new Values(); \r\n\t\t valuesObj.setValue(listOfValue);\r\n\t\t return valuesObj;\r\n\t}", "private static PageSize parsePageLengthValue(String[] pageSizeChunks, float em, float rem) {\n Float width, height;\n width = tryParsePageLengthValue(pageSizeChunks[0], em, rem);\n if (width == null) {\n return null;\n }\n if (pageSizeChunks.length > 1) {\n height = tryParsePageLengthValue(pageSizeChunks[1], em, rem);\n if (height == null) {\n return null;\n }\n } else {\n height = width;\n }\n return new PageSize((float) width, (float) height);\n }", "private int parseHTMLForSpeed(String line){\n String output = \"\";\n int end = 0;\n char charInt;\n for (int i=0; i<line.length(); i++){\n charInt=line.charAt(i);\n if(charInt>=45 && charInt<=57){\n output = output + charInt;\n end+=1;\n }\n else{\n if (end > 1){\n break;\n }\n }\n }\n\n return Integer.parseInt(output.substring(1));\n }", "private void parsePlateau(String s) {\r\n String[] parsedString = s.split(\" \");\r\n plateau[0] = Integer.parseInt(parsedString[0]);\r\n plateau[1] = Integer.parseInt(parsedString[1]);\r\n }", "public static float readNumFromConsole(Scanner scan1) {\n \t String str = null;\r\n \t Pattern p = Pattern.compile(\"^\\\\d+(?:\\\\.\\\\d+)?$\");\r\n \t Matcher m = null;\r\n \t int counter = 0;\r\n \t \tdo {\r\n \t \t\tif (counter != 0) {\r\n \t \t\t\tSystem.out.println(\"Invalid numeric input\");\r\n \t \t\t}\r\n \t \t\tstr = scan1.nextLine();\r\n \t \t\tm = p.matcher(str);\r\n \t \t\tcounter++;\r\n\t \t} while(!m.matches());\r\n \t //scan1.close();\r\n \t return Float.parseFloat(str);\r\n\t }", "private int parseFactor(Queue<String> exp) {\n int value;\n if(exp.peek().equals(\"(\")) {\n exp.dequeue().getData().toString();\n value = parseExpression(exp);\n exp.dequeue().getData().toString();\n } else {\n String number = exp.dequeue().getData().toString();\n value = Integer.parseInt(number);\n }\n return value;\n }", "private int getPercentageValue(String elem){\n String query = \"declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' $this//a:\" + elem;\n\n XmlObject[] obj;\n\n // first ask the context color and if not found, ask the actual color bean\n if(_phClr != null){\n obj = _phClr.selectPath(query);\n if(obj.length == 1){\n Node attr = obj[0].getDomNode().getAttributes().getNamedItem(\"val\");\n if(attr != null) {\n return Integer.parseInt(attr.getNodeValue()) / 1000;\n }\n }\n }\n\n obj = _xmlObject.selectPath(query);\n if(obj.length == 1){\n Node attr = obj[0].getDomNode().getAttributes().getNamedItem(\"val\");\n if(attr != null) {\n return Integer.parseInt(attr.getNodeValue()) / 1000;\n }\n }\n\n\n return -1;\n }", "public static int parseFractionForWholeNumber(String fraction) {\n int length = fraction.length();\n int underscore = fraction.indexOf(\"_\");\n int slash = fraction.indexOf(\"/\");\n String whole = \"0\"; // default\n if (underscore != -1) { // underscore will equal -1 if the String is not found, \n // so this tests that an underscore exists in the String\n whole = fraction.substring(0, underscore);\n } else {\n if (slash != -1) { // no underscore and a slash ==> fraction\n whole = \"0\";\n } else { // no underscore and no slash ==> whole number\n whole = fraction.substring(0, length);\n }\n }\n int wholeNumber = Integer.parseInt(whole);\n return wholeNumber;\n }", "private void processNumericModifier() {\n\n Token token = tokens.get(currentTokenPointer);\n\n if (currentVersionComponent == 3) {\n\n raiseParseProblem(\"cannot specify a numerical +/- value for the qualifier, found '\" + string(token) + \"' at position \" + token.start,\n\n token.start);\n\n }\n\n String tokenString = string(token);\n\n try {\n\n Integer value = null;\n\n if (token.kind == TokenKind.PLUSNUMBER) {\n\n value = Integer.parseInt(tokenString.substring(1));\n\n } else {\n\n value = Integer.parseInt(tokenString);\n\n }\n\n pushIt(new SumTransformer(value));\n\n } catch (NumberFormatException nfe) {\n\n raiseParseProblem(\"cannot parse numerical value '\" + tokenString + \"' at position \" + token.start, token.start);\n\n }\n\n }", "protected IExpressionValue getNum() throws TableFunctionMalformedException {\r\n\t\tvalue = \"\";\r\n\r\n\t\tif (!((isNumeric(look)) || ((look == '.') && (value.indexOf('.') == -1))))\r\n\t\t\texpected(\"Number\");\r\n\r\n\t\twhile ((isNumeric(look))\r\n\t\t\t\t|| ((look == '.') && (value.indexOf('.') == -1))) {\r\n\t\t\tvalue += look;\r\n\t\t\tnextChar();\r\n\t\t}\r\n\r\n\t\ttoken = '#';\r\n\t\tskipWhite();\r\n\r\n\t\t// Debug.println(\"GetNum returned \" + Float.parseFloat(value));\r\n\t\treturn new SimpleProbabilityValue(Float.parseFloat(value));\r\n\t}", "static void parsePossiblyDecimalSizeValue(Lexer<CSSToken, CharInput> lexer, CSSUnit defaultUnit, BiConsumer<Integer, CSSUnit> toCall) throws IOException, ParserException {\n\t\t\n\t\tCSSParserHelperSize.parsePossiblyDecimalSizeValue(\n\t\t\t\tlexer,\n\t\t\t\tdefaultUnit,\n\t\t\t\tINTEGER_OR_UNIT_OR_DOT_OR_SEMICOLON_OR_WS_OR_COMMENT_TOKENS,\n\t\t\t\tUNIT_OR_DOT_OR_SEMICOLON_OR_WS_OR_COMMENT_TOKENS,\n\t\t\t\tUNIT_OR_SEMICOLON_TOKENS,\n\t\t\t\ttoCall);\n\t}", "private Token number() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\twhile(isDigit(this.currentChar) && this.pos != Integer.MIN_VALUE) {\n\t\t\tsb.append(this.currentChar);\n\t\t\tnext_char();\n\t\t}\n\t\t//处理小数\n\t\tif(this.currentChar == '.') {\n\t\t\tsb.append(this.currentChar);\n\t\t\tnext_char();\n\t\t\t\n\t\t\twhile(isDigit(this.currentChar) && this.pos != Integer.MIN_VALUE) {\n\t\t\t\tsb.append(this.currentChar);\n\t\t\t\tnext_char();\n\t\t\t}\n\t\t\treturn new Token(Type.REAL_CONST, sb.toString());\n\t\t}else {\n\t\t\treturn new Token(Type.INTEGER_CONST, sb.toString());\n\t\t}\n\t}", "private double extractWeight(String item) {\n Pattern p = Pattern.compile(\",(.*?),\");\n Matcher m = p.matcher(item);\n if(m.find()) {\n return Double.parseDouble(m.group(1));\n }\n throw new IllegalArgumentException(\"Weight is wrongly formatted in: \" + item);\n }", "private static Expression getNumericLiteral(String token, ExceptionMetadata metadataFromContext) {\n if (!token.contains(\".\") && !token.contains(\"e\") && !token.contains(\"E\")) {\n return new IntegerLiteralExpression(Integer.parseInt(token), metadataFromContext);\n }\n if (!token.contains(\"e\") && !token.contains(\"E\")) {\n return new DecimalLiteralExpression(new BigDecimal(token), metadataFromContext);\n }\n return new DoubleLiteralExpression(Double.parseDouble(token), metadataFromContext);\n\n }", "public static int parseFractionForNumerator(String fraction) {\n int length = fraction.length();\n int underscore = fraction.indexOf(\"_\");\n int slash = fraction.indexOf(\"/\");\n String numerator = \"0\"; // default\n if (underscore != -1) { // underscore will equal -1 if the String is not found, \n // so this tests that an underscore exists in the String\n if (slash != -1) { // underscore and a slash ==> mixed number\n numerator = fraction.substring(underscore + 1, slash);\n }\n } else {\n if (slash != -1) { // no underscore and a slash ==> fraction\n numerator = fraction.substring(0, slash);\n } else { // no underscore and no slash ==> whole number\n numerator = \"0\";\n }\n }\n int numeratorNumber = Integer.parseInt(numerator);\n String whole = \"0\"; // default\n if (underscore != -1) { // underscore will equal -1 if the String is not found, \n // so this tests that an underscore exists in the String\n whole = fraction.substring(0, underscore);\n } else {\n if (slash != -1) { // no underscore and a slash ==> fraction\n whole = \"0\";\n } else { // no underscore and no slash ==> whole number\n whole = fraction.substring(0, length);\n }\n }\n int wholeNumber = Integer.parseInt(whole);\n if (wholeNumber < 0) {\n numeratorNumber = -numeratorNumber;\n }\n return numeratorNumber;\n }", "String getUnitsString();", "static int getValue(String str, int i, int m) {\n\t\tif (i + m > str.length()) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t// Find value at index i and length m.\n\t\tint value = 0;\n\t\tfor (int j = 0; j < m; j++) {\n\t\t\tint c = str.charAt(i + j) - '0';\n\t\t\tif (c < 0 || c > 9) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tvalue = value * 10 + c;\n\t\t}\n\t\treturn value;\n\t}", "static public void validateSize(String t, boolean bZero, boolean bMinus) throws Exception {\n t = t.Trim();\n if (t.Length == 0)\n return ;\n \n // not specified is ok?\n // Ensure we have valid units\n if (t.IndexOf(\"in\") < 0 && t.IndexOf(\"cm\") < 0 && t.IndexOf(\"mm\") < 0 && t.IndexOf(\"pt\") < 0 && t.IndexOf(\"pc\") < 0)\n {\n throw new Exception(\"Size unit is not valid. Must be in, cm, mm, pt, or pc.\");\n }\n \n int space = t.LastIndexOf(' ');\n String n = \"\";\n // number string\n String u = new String();\n try\n {\n // unit string\n // Convert.ToDecimal can be very picky\n if (space != -1)\n {\n // any spaces\n n = t.Substring(0, space).Trim();\n // number string\n u = t.Substring(space).Trim();\n }\n else // unit string\n if (t.Length >= 3)\n {\n n = t.Substring(0, t.Length - 2).Trim();\n u = t.Substring(t.Length - 2).Trim();\n }\n \n }\n catch (Exception ex)\n {\n throw new Exception(ex.Message);\n }\n\n if (n.Length == 0 || !Regex.IsMatch(n, \"\\\\A[ ]*[-]?[0-9]*[.]?[0-9]*[ ]*\\\\Z\"))\n {\n throw new Exception(\"Number format is invalid. ###.## is the proper form.\");\n }\n \n float v = DesignXmlDraw.getSize(t);\n if (!bZero)\n {\n if (v < .1)\n throw new Exception(\"Size can't be zero.\");\n \n }\n else if (v < 0 && !bMinus)\n throw new Exception(\"Size can't be less than zero.\");\n \n return ;\n }", "public static int findWhole(String fraction) {\t//method to find the whole #\r\n \tif(fraction.contains(\"_\")) {\t//check if the fraction has an _\r\n \t\tint whole= Integer.parseInt(fraction.substring(0, fraction.indexOf(\"_\"))); //if so use substring to get num from index 0 to the _ ; set as a variable\r\n \t\treturn whole;\t//return the number; use parseint to convert answer to an int\r\n \t} else {\r\n \t\tif(fraction.contains(\"/\")) { //else if it contains a /\r\n \t\t\treturn 0;\t//just return a 0\r\n \t\t} \r\n \t\treturn Integer.parseInt(fraction); //if it doesnt match any of conditionals then its probably just a whole num so just return it; convert to int\r\n \t}\t\t\r\n }", "public double extractMin(String str) {\n\t\n // assert checkCommand is true\n return Double.parseDouble(str.replaceAll(filterCmdPattern, \"$2\"));\n }", "private String extractQuantityFromString(Decoded decoded, String string) {\n Character digit = string.charAt(0);\n if(!Character.isDigit(digit)){\n return string;\n }\n\n Integer i = Integer.parseInt(String.valueOf(digit));\n int length;\n\n switch(i){\n case 8:\n length = 2;\n break;\n case 9:\n length = 5;\n break;\n default:\n // no quantity\n return string;\n }\n\n string = string.substring(1);\n // check if valid number, update decoded.quantity if so, otherwise update error\n try {\n int quantity = Integer.parseInt(string.substring(0, length));\n string = string.substring(length);\n decoded.quantity = quantity;\n } catch (NumberFormatException ex){\n decoded.error = Error.INVALID_QUANTITY;\n string = string.substring(length);\n }\n\n return string;\n }", "public static String parseExpressionForFirstFraction(String expression) {\n int space = expression.indexOf(\" \");\n String frac1 = expression.substring(0, space);\n return frac1;\n }", "public static Float parseInput(String romanNr) throws InvalidCharacterException, InvalidNumber, InvalidNrOfCharacters {\r\n if (romanNr.length() == 1) {\r\n //if the length is 1, you just have to return the value\r\n if (!disableSyntax) {\r\n checkIfIsValid(romanNr);\r\n }\r\n return symbols.get(romanNr);\r\n }\r\n \r\n if (!disableSyntax) {\r\n checkIfIsValid(romanNr);\r\n checkRomanNumber(romanNr);\r\n checkSubstractions(romanNr);\r\n }\r\n \r\n \r\n //the roman number will pe processed from right to left so\r\n //I have to save the previous letter in case of a subtract operation\r\n String prevLetter = romanNr.charAt(romanNr.length() - 1) + \"\";\r\n Float decimalNr = symbols.get(prevLetter + \"\");\r\n String curLetter;\r\n int j = romanNr.length() - 2;\r\n while (j >= 0) {\r\n curLetter = romanNr.charAt(j) + \"\";\r\n if (symbols.get(curLetter) < symbols.get(prevLetter)) {\r\n //when smaller values precede larger values, \r\n //the smaller values are subtracted from the larger values\r\n decimalNr -= symbols.get(curLetter);\r\n } else {\r\n //otherwise, they are added to the total\r\n decimalNr += symbols.get(curLetter);\r\n }\r\n prevLetter = romanNr.charAt(j--) + \"\";\r\n }\r\n return decimalNr;\r\n }", "private void parseSecsBAT(String str)\n {\n // The value.\n long theValue;\n\n // Try to parse the string as a double.\n try {\n // theValue = (long)(Double.parseDouble(str) * 1000000.0);\n theValue = (long) ((new Double(str)).doubleValue() * 1000000.0);\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Check for a negative number.\n if (theValue <= 0) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Set the value in the object.\n itsValue = theValue;\n }", "public static int parseCSS2FontWeight(String text) {\n int weight = 400;\n try {\n weight = Integer.parseInt(text);\n weight = (weight / 100) * 100;\n weight = Math.max(weight, 100);\n weight = Math.min(weight, 900);\n } catch (NumberFormatException nfe) {\n //weight is no number, so convert symbolic name to number\n if (text.equals(\"normal\")) {\n weight = 400;\n } else if (text.equals(\"bold\")) {\n weight = 700;\n } else {\n throw new IllegalArgumentException(\n \"Illegal value for font weight: '\"\n + text\n + \"'. Use one of: 100, 200, 300, \"\n + \"400, 500, 600, 700, 800, 900, \"\n + \"normal (=400), bold (=700)\");\n }\n }\n return weight;\n }", "public short getUnitsPerEm() throws PDFNetException {\n/* 843 */ return GetUnitsPerEm(this.a);\n/* */ }", "public abstract double toBasicUnit(double unit);", "private double parseTemperatureFromSpan(String document, int indexOfStart, int indexOfEnd) {\n StringBuilder temperatureBuilder = new StringBuilder();\n for (int i = indexOfStart; i < indexOfEnd; i++) {\n temperatureBuilder.append(document.charAt(i));\n }\n return Double.parseDouble(temperatureBuilder.toString());\n }", "private Values getApproximateSizeValObj(String data){\n\t\tdata = data.replaceAll(\"[^0-9.x ]\", \"\");\r\n\t\tString[] values = data.split(\"x\");\r\n\t\tValue valObj1 = getValueObj(values[1].trim(), \"Length\", \"in\");\r\n\t\t Value valObj2 = getValueObj(values[2].trim(), \"Width\", \"in\");\r\n\t\t Values valuesObj = new Values();\r\n\t\t List<Value> listOfValue = new ArrayList<>();\r\n\t\t listOfValue.add(valObj1);\r\n\t\t listOfValue.add(valObj2);\r\n\t\t valuesObj.setValue(listOfValue);\r\n\t\t return valuesObj;\r\n\t}", "private void parseUnitLength(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length != 2) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLength argument\");\n\t\t}\n\t\tthis.setUnitLength(Double.parseDouble(tokens[1]));\n\t}", "public static Double getNumber(String number){\n if(StringUtils.isEmpty(number) || !containDigit(number)){\n return null;\n }\n if(containVariable(number)){\n return extractFirstVariableValue(number);\n }\n String firstNumberStr = null, numberStr = null, unitStr = null;\n if(contains(number, numberUnitPattern)){\n firstNumberStr = removeFormatForNumberStr(extract(number, numberUnitPattern));\n Matcher matcher = numberUnitPattern.matcher(firstNumberStr);\n while(matcher.find()){\n numberStr = matcher.group(2); // number\n if(matcher.group(8) != null){\n unitStr = matcher.group(8); // unit\n }\n }\n }\n\n if(StringUtils.isNotEmpty(firstNumberStr)){\n Double result = Double.valueOf(numberStr);\n if(StringUtils.isNotEmpty(unitStr)){\n switch (unitStr){\n case \"bps\" : result *= 0.0001; break;\n case \"%\" : result *= 0.01; break;\n case \"k\" : result *= 1e3; break;\n case \"m\" :\n case \"mm\" : result *= 1e6; break;\n case \"bn\" : result *= 1e9; break;\n }\n }\n return result;\n }\n return null;\n }", "static int numberFrom(String s) throws NumberFormatException {\n return Integer.parseInt(s.replaceAll(\"[,+\\\\s+]\", EMPTY));\n }", "protected static float toPicas(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_CM:\n \t\t\treturn (value * 6 / 2.54f);\n \t\tcase CSSPrimitiveValue.CSS_MM:\n \t\t\treturn (value * 6 / 25.4f);\n \t\tcase CSSPrimitiveValue.CSS_IN:\n \t\t\treturn (value * 6);\n \t\tcase CSSPrimitiveValue.CSS_PT:\n \t\t\treturn (value / 12);\n \t\tcase CSSPrimitiveValue.CSS_PC:\n \t\t\treturn value;\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "private static int getVal(String s) {\n int val = Integer.parseInt(s.split(\" \")[0]);\r\n return val;\r\n }", "private int getInt(String next) {\n\t\ttry {\n\t\t\tint a = Integer.parseInt(next);\n\t\t\tif (a > 10) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn a;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn 0;\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test114() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.parseColumnTypeAndSize(\"(, 4$, 4$, 4$, 4$, 4$, 4$, , )\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "public static Integer parseWidthHeightValue(String value) {\r\n Integer rst = null;\r\n \r\n if ((value == null) || (value.trim().length() == 0)) {\r\n throw new NumberFormatException(\"Passed value is empty \"); //$NON-NLS-1$\r\n }\r\n \r\n if (value.endsWith(Constants.PIXEL)) {\r\n rst = Integer.parseInt(value.substring(0, value.length() - 2));\r\n } else {\r\n rst = Integer.parseInt(value);\r\n }\r\n \r\n return rst;\r\n }", "private static int numOfDecimalDigit(String text) {\n\t\treturn text.substring(text.indexOf(\".\") + 1, text.length()).length();\r\n\t}", "public static int findNumerator(String fraction) {\n \tif(fraction.contains(\"_\")) {\t//check if the frac has an _\r\n \t\tint numerator= Integer.parseInt(fraction.substring(fraction.indexOf(\"_\") +1, fraction.indexOf(\"/\")));\t//if so use substring from _ to the /; convert to int ant make variable for numerator\r\n \t\treturn numerator;\t//return the numerator\r\n \t} else {\r\n \t\tif(fraction.contains(\"/\")) {\t//check if the frac just had a /\r\n \t\t\tint numeratorSlash= Integer.parseInt(fraction.substring(0, fraction.indexOf(\"/\")));\t//use substring to get numbers from index 0 to / ; make variable and convert to int\r\n \t\t\treturn numeratorSlash;\t//return the number\r\n \t\t} \r\n \t}\r\n \treturn 0;\t//else if it doesnt apply to any of the conditionals above it's most likely a whole number so just return 0\r\n }", "public String getUnitOfMeasure() {\r\n\t\t\r\n\t\treturn McsElement.getElementByXpath(driver, \"//input[@name='unitOfMeasure']/following-sibling::input[@type='text']\").getAttribute(\"value\");\r\n\t}", "public double extractDouble(String s) {\n String pattern = \"(\\\\d+)\";\n //Create a Pattern object\n Pattern r = Pattern.compile(pattern);\n //Look for a match\n Matcher m = r.matcher(s);\n if (m.find( )) {\n Log.i(\"REGEX\", \"Found value: \" + m.group(0));\n return Double.parseDouble(m.group(0));\n } else {\n Log.i(\"REGEX\", \"No match found.\");\n return 0;\n }\n\n}", "public static int VersionToNumber(String str) {\n boolean error = false ;\n int i = 0;\n int result = 0;\n int digitsAfterDecimal = 0;\n boolean afterDecimal = false;\n while ((!error) && i < str.length()) {\n char c = str.charAt(i);\n if (('0' <= c) && (c <= '9')) {\n result = 10 * result + (c - '0');\n if (afterDecimal) {\n digitsAfterDecimal++;\n if (digitsAfterDecimal > 3) {\n error = true;\n }\n }\n } else if (c == '.') {\n afterDecimal = true;\n } else {\n error = true;\n }\n i++;\n }\n if (error) {\n return -1;\n }\n for (int j = 0; j < 3 - digitsAfterDecimal; j++) {\n result = 10 * result;\n }\n return result;\n }", "public static int parse(String formatted) {\n\t\tString s = formatted.toLowerCase();\n\t\tint output = 0;\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\tchar c = s.charAt(i);\n\t\t\tif (c >= '0' && c <= '9') {\n\t\t\t\tsb.append(c);\n\t\t\t} else if (c == ' ' || c == '\\t' || c == ',') {\n\t\t\t\tcontinue;\n\t\t\t} else if (convLookup.containsKey(c)) {\n\t\t\t\tint conversion = convLookup.get(c);\n\t\t\t\tint val = Integer.parseInt(sb.toString());\n\t\t\t\toutput += val * conversion;\n\t\t\t\tsb.delete(0, sb.length());\n\t\t\t}\n\t\t}\n\t\tif (sb.length() != 0) {\n\t\t\toutput += new Integer(sb.toString());\n\t\t}\n\t\treturn output;\n\t}", "private static Double stod(String string) {\n\t\tDouble result = 2.0; // should handle this error: \"cannnot convert string to Double\"\n\t\tif (string == null || string.equals(\"\") || string.equals(\"null\") || string.equals(\"I\")) {\n\t\t\tresult = 0.0;\n\t\t} else if (string.equals(\"E\")) {\n\t\t\tresult = 1.0;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tresult = Double.parseDouble(string);\n\t\t\t} catch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "private static long parseNumber(CharSequence text, String parsed, int multiplier, String errorText) {\n if (parsed == null) {\n return 0;\n }\n try {\n long val = Long.parseLong(parsed);\n return Math.multiplyExact(val, multiplier);\n } catch (NumberFormatException | ArithmeticException ex) {\n throw (DateTimeParseException) new DateTimeParseException(\"Text cannot be parsed to a Duration: \" + errorText, text, 0).initCause(ex);\n }\n }", "public static void main(String[] args) {\n\n\n String a=\"95.244522094727\";\n int score = (int)Double.parseDouble(a);\n System.out.println(score);\n }", "String getUnits();", "String getUnits();", "String getUnits();", "String getUnit();" ]
[ "0.6319216", "0.59104925", "0.5910348", "0.59020436", "0.589108", "0.5755881", "0.5751544", "0.5746805", "0.5688918", "0.563648", "0.5626268", "0.5600014", "0.559562", "0.5574162", "0.5555512", "0.555381", "0.5536251", "0.552448", "0.55207413", "0.5510268", "0.54913133", "0.548307", "0.5473604", "0.5473522", "0.54698", "0.5466936", "0.545835", "0.54461634", "0.5389476", "0.53662306", "0.5353682", "0.5353307", "0.53525174", "0.5343329", "0.53405577", "0.5339114", "0.5315568", "0.53009015", "0.5284708", "0.5274434", "0.52688205", "0.52633035", "0.52456707", "0.5242441", "0.52366287", "0.5230054", "0.5217983", "0.52157927", "0.5211417", "0.5207577", "0.52039874", "0.5201354", "0.51967776", "0.5189513", "0.5186463", "0.5151595", "0.51476264", "0.5144085", "0.51381505", "0.5138039", "0.5136801", "0.5123745", "0.5122102", "0.5118979", "0.51110864", "0.5110542", "0.51099503", "0.5108056", "0.5107574", "0.51002836", "0.5094487", "0.50862855", "0.50851864", "0.50769216", "0.50755906", "0.5072916", "0.5071833", "0.5067977", "0.5066433", "0.5066009", "0.5065867", "0.5057186", "0.5054647", "0.505137", "0.5039181", "0.5031848", "0.5026224", "0.5024428", "0.50207925", "0.50095683", "0.50034654", "0.49895942", "0.4983769", "0.49824816", "0.49810493", "0.49734643", "0.49704182", "0.49702007", "0.49702007", "0.49702007", "0.496786" ]
0.0
-1
we have found decimal '.', parse int after '.' and unit
static void parseDecimalAfterDot(Lexer<CSSToken, CharInput> lexer, CSSUnit defaultUnit, int beforeDecimal, BiConsumer<Integer, CSSUnit> toCall) throws IOException, ParserException { final CSSToken token = CSSParserHelperSize.parseDecimalAfterDot(lexer, defaultUnit,beforeDecimal, UNIT_OR_SEMICOLON_TOKENS, toCall); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int numOfDecimalDigit(String text) {\n\t\treturn text.substring(text.indexOf(\".\") + 1, text.length()).length();\r\n\t}", "private String subStringToInteger(String quantity) {\n String substring = null;\n\n if (quantity.contains(\".\")) {\n int indexEnd = quantity.indexOf(\".\");\n substring = quantity.substring(0, indexEnd);\n }\n\n return substring == null ? quantity : substring;\n }", "public static int VersionToNumber(String str) {\n boolean error = false ;\n int i = 0;\n int result = 0;\n int digitsAfterDecimal = 0;\n boolean afterDecimal = false;\n while ((!error) && i < str.length()) {\n char c = str.charAt(i);\n if (('0' <= c) && (c <= '9')) {\n result = 10 * result + (c - '0');\n if (afterDecimal) {\n digitsAfterDecimal++;\n if (digitsAfterDecimal > 3) {\n error = true;\n }\n }\n } else if (c == '.') {\n afterDecimal = true;\n } else {\n error = true;\n }\n i++;\n }\n if (error) {\n return -1;\n }\n for (int j = 0; j < 3 - digitsAfterDecimal; j++) {\n result = 10 * result;\n }\n return result;\n }", "public String check_after_decimal_point(double decimal) {\n String result = null;\n String[] after_point = String.valueOf(decimal).split(\"[:.]\");\n if (after_point[after_point.length - 1].equals(\"0\")) {\n result = after_point[0];\n } else {\n result = String.valueOf(decimal).replace(\".\", \",\");\n }\n return result;\n }", "private void parseDecimalBAT(String str) throws NumberFormatException\n {\n // The value.\n long theValue;\n\n // Try to parse the string as a decimal long.\n try {\n theValue = Long.parseLong(str);\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Check for a negative number and reject if so.\n if (theValue <= 0) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Set the value in the object.\n itsValue = theValue;\n }", "public void llenarnumerodecimales(java.awt.event.KeyEvent evt, int tamanioEntero, int tamanioDecimal, String txt){\n char c = evt.getKeyChar();\r\n int bDecimal = 0, bEntero = 0;\r\n// if ((c >= '0') || (c <= '9') && bEntero)\r\n// bEntero++;\r\n if (((c < '0') || (c > '9')) && (c != KeyEvent.VK_BACK_SPACE) && (c != '.')) {\r\n evt.consume();\r\n JOptionPane.showMessageDialog(null, \"Debe ingresar sólo números!!!\", \"Mensaje del sistema\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n if (c == '.' && txt.contains(\".\")) {\r\n evt.consume();\r\n JOptionPane.showMessageDialog(null, \"No puede ingresar más puntos!!!\", \"Mensaje del sistema\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "private void handleNumber() {\n while (isDigit(peek())) {\n advance();\n }\n\n // Look for decimals; Will be allowing extension calls like 140.abs() so make sure it's a numerical decimal\n if (peek() == '.' && isDigit(peekFurther(1))) {\n\n // Consume the decimal\n advance();\n\n // Consume the digits following the decimal\n while (isDigit(peek())) {\n advance();\n }\n }\n\n addToken(NUMBER, Double.parseDouble(source.substring(start, current)));\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public static int formatDecimalPart(String method,Double numString) throws Exception{\n\t\tdouble num = Double.valueOf(numString);\n\t\tint intPart = 0; \n\t\tif(method.equals(\"切り捨て\")){\n\t\t\t intPart = (int) Math.floor(num);\n\t\t}else if(method.equals(\"切り上げ\")){\n\t\t\t intPart = (int) Math.ceil(num);\n\t\t}else if(method.equals(\"四捨五入\")){\n\t\t\t intPart = (int) Math.round(num);\n\t\t}else{\n\t\t\t throw new Exception(\"the method value set wrong\");\n\t\t}\n\t\treturn intPart;\n\t}", "public static int decimalNumber(String n)\n\t{\n\t\tint retv = 0;\n\n\t\tString[] arr = n.split(\"\");\n\n\t\tfor(int i=arr.length-1; i>=0; i--)\n\t\t{\n\t\t\tretv += (Integer.parseInt(arr[i]))*Math.pow(2, i);\n\t\t}\n\n\t\treturn retv;\n\t}", "public static void main(String args[])\n {\n Scanner sc=new Scanner(System.in);\n String s=sc.next();\n double n=0;\n int dcount=0;\n int pointer=0;\n for(int i=0;i<s.length();i++)\n {\n if(s.charAt(i)!='.')\n {\n n=n*10+(s.charAt(i)-'0');\n if(pointer==1)\n dcount++;\n }\n else\n pointer=1;\n }\n n=n/Math.pow(10,dcount);\n System.out.printf(\"%.6f\",n);\n }", "public boolean countDecimals(String assetValue){\n\n int count = 0;\n for(int i = 0; i < assetValue.length(); i++){\n\n if(assetValue.charAt(i) == '.'){\n count++;\n if(count > 1)\n return false;\n\n }\n\n }\n return true;\n }", "private String filterDecimalString(String string) {\n return string\n .replaceAll(\"[^0-9.]\", \"\")\n .replaceFirst(\"\\\\.\", \"@\")\n .replaceAll(\"\\\\.\", \"\")\n .replaceFirst(\"@\", \".\");\n }", "private static double parseOutNum(String s)\n {\n final int N = s.length();\n // If the last character of s is a digit, the whole of s is assumed to\n // be a numeral. Otherwise, s up to, but not including, its last \n // character, is assumed to be a numeral.\n if (Character.isDigit(s.charAt(N-1)))\n { return Double.parseDouble(s); }\n else\n { return Double.parseDouble(s.substring(0,N-1)); }\n }", "private void validateInteger(String line) throws VectorException{\r\n\t\tif(line.contains(\".\"))\r\n\t\t\tthrow new VectorException(\"Value must be an integer\\nand cannot contain rational number\");\r\n\t}", "private Number parseNumber(String part) {\n try {\n return this.numberFormat.parse(part);\n } catch (ParseException e) {\n throw new NumberFormatException(String.format(\"Could not parse: %s to number\", part));\n }\n }", "private static String formatPRECIO(String var1)\r\n\t{\r\n\t\tString temp = var1.replace(\".\", \"\");\r\n\t\t\r\n\t\treturn( String.format(\"%09d\", Integer.parseInt(temp)) );\r\n\t}", "public static NormalTridasUnit parseUnitString(String str) throws Exception\n\t{\n\t\tstr = str.trim();\n\t\tif ((str==null) || (str.equals(\"\"))) return null;\n\t\n\t\tstr =str.toLowerCase();\n\t\t\n\t\tInteger val;\n\t\tBoolean mmDetected = false;\n\t\t\n\t\t//Remove leading fraction\n\t\tif(str.startsWith(\"1/\")){ str = str.substring(2);}\n\t\t\n\t\t// Remove 'ths'\n\t\tif(str.contains(\"ths\")){ str = str.replace(\"ths\", \"\");}\n\t\t\n\t\t// Remove 'th'\n\t\tif(str.contains(\"th\")){ str = str.replace(\"th\", \"\");}\n\t\t\n\t\t// Remove 'mm'\n\t\tif(str.contains(\"mm\"))\n\t\t{ \n\t\t\tstr = str.replace(\"mm\", \"\");\n\t\t\tmmDetected = true;\n\t\t}\n\t\tif(str.contains(\"millimet\"))\n\t\t{ \n\t\t\tstr = str.replace(\"millimetres\", \"\");\n\t\t\tstr = str.replace(\"millimeters\", \"\");\n\t\t\tstr = str.replace(\"millimetre\", \"\");\n\t\t\tstr = str.replace(\"millimeter\", \"\");\n\t\t\tmmDetected = true;\n\t\t}\n\t\t\n\t\tif(str.length()==0 && mmDetected)\n\t\t{\n\t\t\treturn NormalTridasUnit.MILLIMETRES;\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tval = Integer.parseInt(str.trim());\n\t\t} catch (NumberFormatException e)\n\t\t{\n\t\t\tthrow new Exception(\"Unable to parse units from units string\");\n\t\t}\n\t\t\n\t\tswitch(val)\n\t\t{\t\n\t\t\tcase 10: return NormalTridasUnit.TENTH_MM; \n\t\t\tcase 20: return NormalTridasUnit.TWENTIETH_MM;\n\t\t\tcase 50: return NormalTridasUnit.FIFTIETH_MM;\n\t\t\tcase 100: return NormalTridasUnit.HUNDREDTH_MM; \n\t\t\tcase 1000: return NormalTridasUnit.MICROMETRES; \n\t\t}\n\t\t\n\t\tthrow new Exception(\"Unable to parse units from units string\");\n\t}", "private Token scanNumber(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(firstChar.getCharacter());\n\t\tappendSubsequentDigits(buffer);\n\t\tif(input.peek().getCharacter() == DECIMAL_POINT) {\n\t\t\tLocatedChar c = input.next();\n\t\t\tif(input.peek().getCharacter() == DECIMAL_POINT) {\n\t\t\t\tinput.pushback(c);\n\t\t\t\treturn IntToken.make(firstChar, buffer.toString());\n\t\t\t}\n\t\t\tbuffer.append(c.getCharacter());\n\t\t\tif(input.peek().isDigit()) {\n\t\t\t\tappendSubsequentDigits(buffer);\n\t\t\t\tif(input.peek().getCharacter() == CAPITAL_E) {\n\t\t\t\t\tLocatedChar expChar = input.next();\n\t\t\t\t\tbuffer.append(expChar.getCharacter());\n\t\t\t\t\tif(input.peek().getCharacter() == '+' || input.peek().getCharacter() == '-') {\n\t\t\t\t\t\tbuffer.append(input.next().getCharacter());\n\t\t\t\t\t}\n\t\t\t\t\tif(input.peek().isDigit()) {\n\t\t\t\t\t\tappendSubsequentDigits(buffer);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlexicalError(expChar, \"malformed floating exponent literal\");\n\t\t\t\t\t\treturn findNextToken();\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\treturn FloatToken.make(firstChar, buffer.toString());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlexicalError(firstChar, \"malformed floating literal\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn IntToken.make(firstChar, buffer.toString());\n\t\t}\n\t}", "@Test\n public void fixedTests() {\n assertEquals(69978 , Day02.parseInt(\"sixty nine thousand nine hundred seventy eight\"));\n }", "private void createNumber() {\n\t\tString value = \"\";\n\t\tvalue += data[currentIndex++];\n\t\t// minus is no longer allowed\n\t\twhile (currentIndex < data.length\n\t\t\t\t&& Character.isDigit(data[currentIndex])) {\n\t\t\tvalue += data[currentIndex++];\n\t\t}\n\n\t\tif (currentIndex + 1 < data.length && (data[currentIndex] == '.'\n\t\t\t\t&& Character.isDigit(data[currentIndex + 1]))) {\n\t\t\tvalue += data[currentIndex++]; // add .\n\t\t} else {\n\t\t\ttoken = new Token(TokenType.NUMBER, Integer.parseInt(value));\n\t\t\treturn;\n\t\t}\n\t\t// get decimals of number\n\t\twhile (currentIndex < data.length\n\t\t\t\t&& Character.isDigit(data[currentIndex])) {\n\t\t\tvalue += data[currentIndex++];\n\t\t}\n\t\ttoken = new Token(TokenType.NUMBER, Double.parseDouble(value));\n\t}", "public static double parseHumanReadable(String datum, String separator, String unit)\n {\n int end = datum.length();\n if (unit != null)\n {\n if (!datum.endsWith(unit))\n throw new NumberFormatException(datum + \" does not end in unit \" + unit);\n end -= unit.length();\n }\n\n Matcher m = BASE_NUMBER_PATTERN.matcher(datum);\n m.region(0, end);\n if (!m.lookingAt())\n throw new NumberFormatException();\n double v = Double.parseDouble(m.group(0));\n\n int pos = m.end();\n if (m.group(2) == null) // possible binary exponent, parse\n {\n m = BINARY_EXPONENT.matcher(datum);\n m.region(pos, end);\n if (m.lookingAt())\n {\n int power = Integer.parseInt(m.group(1));\n v = Math.scalb(v, power);\n pos = m.end();\n }\n }\n\n if (separator != null)\n {\n if (!datum.startsWith(separator, pos))\n throw new NumberFormatException(\"Missing separator \" + separator + \" in \" + datum);\n pos += separator.length();\n }\n else\n {\n while (pos < end && Character.isWhitespace(datum.charAt(pos)))\n ++pos;\n }\n\n if (pos < end)\n {\n char prefixChar = datum.charAt(pos);\n int prefixIndex = UNIT_PREFIXES.indexOf(prefixChar);\n if (prefixIndex >= 0)\n {\n prefixIndex -= UNIT_PREFIXES_BASE;\n ++pos;\n if (pos < end && datum.charAt(pos) == 'i')\n {\n ++pos;\n v = Math.scalb(v, prefixIndex * 10);\n }\n else\n {\n v *= Math.exp(Math.log(1000.0) * prefixIndex);\n }\n }\n }\n\n if (pos != end && unit != null)\n throw new NumberFormatException(\"Unexpected characters between pos \" + pos + \" and \" + end + \" in \" + datum);\n\n return v;\n }", "public int convertToInt(String i) {\n\t\tswitch (i) {\n\t\t\tcase \".\": return 0;\n\t\t\tcase \"1\": return 1;\n\t\t\tcase \"2\": return 2;\n\t\t\tcase \"3\": return 3;\n\t\t\tcase \"4\": return 4;\n\t\t\tcase \"5\": return 5;\n\t\t\tcase \"6\": return 6;\n\t\t\tcase \"7\": return 7;\n\t\t\tcase \"8\": return 8;\n\t\t\tcase \"9\": return 9;\n\t\t\tcase \"A\": return 10;\n\t\t\tcase \"B\": return 11;\n\t\t\tcase \"C\": return 12;\n\t\t\tcase \"D\": return 13;\n\t\t\tcase \"E\": return 14;\n\t\t\tcase \"F\": return 15;\n\t\t\tcase \"G\": return 16;\n\t\t\tcase \"H\": return 17;\n\t\t\tcase \"I\": return 18;\n\t\t\tcase \"J\": return 19;\n\t\t\tcase \"K\": return 20;\n\t\t\tcase \"L\": return 21;\n\t\t\tcase \"M\": return 22;\n\t\t\tcase \"N\": return 23;\n\t\t\tcase \"O\": return 24;\n\t\t\tcase \"P\": return 25;\n\t\t\tcase \"Q\": return 26;\n\t\t\tcase \"R\": return 27;\n\t\t\tcase \"S\": return 28;\n\t\t\tcase \"T\": return 29;\n\t\t\tcase \"U\": return 30;\n\t\t\tcase \"V\": return 31;\n\t\t\tcase \"W\": return 32;\n\t\t\tcase \"X\": return 33;\n\t\t\tcase \"Y\": return 34;\n\t\t\tcase \"Z\": return 35;\n\t\t\tdefault: System.out.println(\"The number is too high.\");\n\t\t\t return 9000;\n\t\t}\n }", "public int parseAmount(String goods) {\n return Integer.parseInt(goods.split(\"\\\\s+\")[3]);\n }", "public boolean isNumPart(final int i, final String exp) {\n final char ch = exp.charAt(i);\n return(Character.isDigit(ch)\n || ch=='.'\n || (i+1<exp.length() && ch=='-' \n && Character.isDigit(exp.charAt(i+1)))\n );\n }", "void insertDecimalPoint();", "public int parse (String text, int offset) {\n\t\tParsing t = new Parsing(text, offset);\n\t\tif (true) {\n\t\t\tthis.parsing(t);\n\t\t}\n\t\telse {\t\t\t\t//*** OLD CODE\n\t\t\tdouble val;\n\t\t\tint pos1, pos2, pos3;\n\t\t\tboolean has_value, has_unit;\n\t\t\tif (!initialized) init();\t// Be sure everyting in place\n\n\t\t\t/* Ignore the leading blanks */\n\t\t\tt.gobbleSpaces();\n\t\t\tpos1 = t.pos;\t\t\t// Just before the possible value\n\n\t\t\t/* Interpret the Value, if any */\n\t\t\tval = t.parseFactor();\t\t// Default value is 1\n\t\t\tpos2 = t.pos;\t\t\t// After interpretation of Value\n\t\t\thas_value = pos2 > pos1; \t// Something was found.\n\n\t\t\t/* Skip blanks between value and Unit */\n\t\t\tt.gobbleSpaces();\n\n\t\t\t/* It may happen that interpreting the Value first generates an error,\n\t for instance 1/4. That means that the number (1) is part of the\n\t unit, and is not the value in front of the unit.\n\t\t\t */\n\t\t\tif (t.lookup(op_symb) >= 0) {\n\t\t\t\thas_value = false;\n\t\t\t\tt.pos = pos1;\n\t\t\t\tpos2 = pos1;\n\t\t\t}\n\n\t\t\t/* Interpret the Unit */\n\t\t\thas_unit = true;\n\t\t\tpos3 = t.pos;\t\t\t// Starting offset of unit\n\t\t\ttry { unitec(t, null) ; }\n\t\t\tcatch (Exception e) {\n\t\t\t\thas_unit = false;\n\t\t\t\tt.pos = pos2;\n\t\t\t\tif (!has_value) t.pos = offset;\n\t\t\t}\n\t\t\tif (has_unit) symbol = text.substring(pos3, t.pos);\n\t\t\tvalue = has_value ? val : 0./0. ;\n\t\t}\n\t\treturn(t.pos);\n\t}", "private static float parse_number() {\n skip_spaces();\n\n if (i == l) {\n throw new Error(String.format(\"Unexpected end (s=%s)\", s));\n }\n\n int start = i;\n\n char c = s.charAt(i);\n\n // Consume sign.\n if (c == '-' || c == '+') {\n i += 1;\n c = s.charAt(i);\n }\n\n // Consume integer.\n if (c >= '0' && c <= '9') {\n skip_digits();\n if (i < l) {\n c = s.charAt(i);\n }\n } else if (c != '.') {\n throw new Error(\n String.format(\"Invalid number formating character '%c' (i=%d, s=%s)\", c, i, s));\n }\n\n // Consume fraction.\n if (c == '.') {\n i += 1;\n skip_digits();\n if (i < l) {\n c = s.charAt(i);\n }\n }\n\n if ((c == 'e' || c == 'E') && i + 1 < l) {\n char c2 = s.charAt(i + 1);\n // Check for `em`/`ex`.\n if (c2 != 'm' && c2 != 'x') {\n i += 1;\n c = s.charAt(i);\n\n if (c == '+' || c == '-') {\n i += 1;\n skip_digits();\n } else if (c >= '0' && c <= '9') {\n skip_digits();\n } else {\n throw new Error(\n String.format(\"Invalid number formating character '%c' (i=%d, s=%s)\", c, i, s));\n }\n }\n }\n\n String num = s.substring(start, i);\n float n = Float.parseFloat(num);\n\n // inf, nan, etc. are an error.\n if (Float.isInfinite(n) || Float.isNaN(n)) {\n throw new Error(\n String.format(\"Invalid number '%s' (start=%d, i=%d, s=%s)\", num, start, i, s));\n }\n\n return n;\n }", "public int binToDec (String input) {\r\n\t int decimal = Integer.parseInt(input,2);\t\r\n\t\treturn decimal;\t\t\r\n\t}", "private String getDecimalPattern(String str) {\n int decimalCount = str.length() - str.indexOf(\".\") - 1;\n StringBuilder decimalPattern = new StringBuilder();\n for (int i = 0; i < decimalCount && i < MAX_DECIMAL; i++) {\n decimalPattern.append(\"0\");\n }\n return decimalPattern.toString();\n }", "public int parsePrice(String goods) {\n return Integer.parseInt(goods.split(\"\\\\s+\")[2]);\n }", "private void outputBasedOnText(Editable s) {\n String stringValue = s.toString();\n if (stringValue.length() > 1 && stringValue.substring(stringValue.length() - 1).equals(\".\")) { // If the last char in string is \".\"\n convertInput(Double.parseDouble(stringValue.substring(0, stringValue.length() - 1)));\n } else if (!stringValue.matches(\"[-+]?\\\\d*\\\\.?\\\\d+\")) { // Check if stringValue is numeric\n convertInput(0);\n } else {\n convertInput(Double.parseDouble(stringValue));\n }\n }", "public static double atof(String s)\n {\n int i = 0;\n int sign = 1;\n double r = 0; // integer part\n // double f = 0; // fractional part\n double p = 1; // exponent of fractional part\n int state = 0; // 0 = int part, 1 = frac part\n\n while ((i < s.length()) && Character.isWhitespace(s.charAt(i)))\n {\n i++;\n }\n\n if ((i < s.length()) && (s.charAt(i) == '-'))\n {\n sign = -1;\n i++;\n }\n else if ((i < s.length()) && (s.charAt(i) == '+'))\n {\n i++;\n }\n\n while (i < s.length())\n {\n char ch = s.charAt(i);\n\n if (('0' <= ch) && (ch <= '9'))\n {\n if (state == 0)\n {\n r = ((r * 10) + ch) - '0';\n }\n else if (state == 1)\n {\n p = p / 10;\n r = r + (p * (ch - '0'));\n }\n }\n else if (ch == '.')\n {\n if (state == 0)\n {\n state = 1;\n }\n else\n {\n return sign * r;\n }\n }\n else if ((ch == 'e') || (ch == 'E'))\n {\n long e = (int) parseLong(s.substring(i + 1), 10);\n\n return sign * r * Math.pow(10, e);\n }\n else\n {\n return sign * r;\n }\n\n i++;\n }\n\n return sign * r;\n }", "public static int parseFractionForNumerator(String fraction) {\n int length = fraction.length();\n int underscore = fraction.indexOf(\"_\");\n int slash = fraction.indexOf(\"/\");\n String numerator = \"0\"; // default\n if (underscore != -1) { // underscore will equal -1 if the String is not found, \n // so this tests that an underscore exists in the String\n if (slash != -1) { // underscore and a slash ==> mixed number\n numerator = fraction.substring(underscore + 1, slash);\n }\n } else {\n if (slash != -1) { // no underscore and a slash ==> fraction\n numerator = fraction.substring(0, slash);\n } else { // no underscore and no slash ==> whole number\n numerator = \"0\";\n }\n }\n int numeratorNumber = Integer.parseInt(numerator);\n String whole = \"0\"; // default\n if (underscore != -1) { // underscore will equal -1 if the String is not found, \n // so this tests that an underscore exists in the String\n whole = fraction.substring(0, underscore);\n } else {\n if (slash != -1) { // no underscore and a slash ==> fraction\n whole = \"0\";\n } else { // no underscore and no slash ==> whole number\n whole = fraction.substring(0, length);\n }\n }\n int wholeNumber = Integer.parseInt(whole);\n if (wholeNumber < 0) {\n numeratorNumber = -numeratorNumber;\n }\n return numeratorNumber;\n }", "static int find(int decimal_number) \r\n { \r\n if (decimal_number == 0) \r\n return 0; \r\n \r\n else\r\n \r\n return (decimal_number % 2 + 10 * \r\n find(decimal_number / 2)); \r\n }", "public int parseUnit (String text, int offset) {\n\t\tint o = parse(text, offset);\n\t\tthis.setUnit();\n\t\treturn(o);\n\t}", "public int getDecimalDigits() { return 1; }", "public int getDecimalDigits() { return 1; }", "private static String removeZeroDecimal(String s) {\r\n // Make sure to add check for existance of decimal sign to\r\n // prevent StringIndexOutOfBoundsException\r\n if (s.indexOf(\".\") != -1 && s.substring(s.indexOf(\".\"), s.length()).equals(\".0\"))\r\n s = s.replace(\".0\", \"\");\r\n return s;\r\n }", "public static int parseFractionForWholeNumber(String fraction) {\n int length = fraction.length();\n int underscore = fraction.indexOf(\"_\");\n int slash = fraction.indexOf(\"/\");\n String whole = \"0\"; // default\n if (underscore != -1) { // underscore will equal -1 if the String is not found, \n // so this tests that an underscore exists in the String\n whole = fraction.substring(0, underscore);\n } else {\n if (slash != -1) { // no underscore and a slash ==> fraction\n whole = \"0\";\n } else { // no underscore and no slash ==> whole number\n whole = fraction.substring(0, length);\n }\n }\n int wholeNumber = Integer.parseInt(whole);\n return wholeNumber;\n }", "private double parseAmount(String amount){\n return Double.parseDouble(amount.replace(\",\", \".\"));\n }", "public static double ensureDecimal(String rawValue, int place) {\r\n\t\tString returnValue = \"\";\r\n\t\tif (rawValue.indexOf(\".\") == -1) {\r\n\t\t\treturnValue = rawValue.substring(0, (place - 1)) + \".\"\r\n\t\t\t\t\t+ rawValue.substring(place - 1);\r\n\t\t\t// System.out.println(returnValue);\r\n\t\t\treturn (Double.parseDouble(returnValue));\r\n\t\t} else\r\n\t\t\treturn Double.parseDouble(rawValue);\r\n\t}", "@Test\n\tpublic void castWordNumbersFollowedByMultipleDots() {\n\t\tString input = \"Alice has one... not two or three apples..\";\n\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\n\t\tString correctlyCastedString = \"Alice has 1... not 2 or 3 apples..\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}", "public static double ParseCurrency(String s) throws ParseException{\r\n String regex = \"[^\\\\d.-]+\";\r\n String newStr = s.replace(\",\", \".\");\r\n newStr = newStr.replaceAll(regex, \"\");\r\n double resultat = Double.parseDouble(newStr);\r\n //System.out.println(\"String s: \"+s + \" resultat: \"+resultat);\r\n if(resultat <0){\r\n throw new ParseException(MSG_PARSECURRENCY,0);\r\n }\r\n return resultat;\r\n }", "private int validate(final String lcono) {\n\n if (lcono == null || lcono.isEmpty())\n return 1;\n else if (!lcono.matches(\"\\\\d*\\\\.?\\\\d+\"))\n return 2;\n\n return 0;\n }", "private Double parseNumber(String num) {\r\n\t\tDouble tempnum = (double) 0;\r\n\t\tint opos; //operator position\r\n\t\tif ((num == null) || (num.length() < 1) ) {\r\n\t\t\treturn tempnum;\r\n\t\t}\r\n\r\n\t\t//replace constants with their value\r\n\t\twhile (num.indexOf(\"P\") >= 0) { //PI constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'P', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.PI)+numparts[1];\r\n\t\t}\r\n\t\twhile (num.indexOf(\"X\") >= 0) { //e constant\r\n\t\t\tString[] numparts = StringUtil.splitData(num, 'X', 2);\r\n\t\t\tnum = numparts[0]+String.valueOf(Math.E)+numparts[1];\r\n\t\t}\r\n\r\n\t\tif (num.indexOf(\"^\") >= 0) { //allows to specify powers (e.g.: 2^10)\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '^', 2);\r\n\t\t\ttempnum = Math.pow(parseNumber(numparts[0]), parseNumber(numparts[1]));\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"-\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '-', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) - parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if ( ((opos = num.indexOf(\"+\")) > 0) && (num.charAt(opos-1) != 'E') && (num.charAt(opos-1) != '^')) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '+', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) + parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"/\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '/', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) / parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse if (num.indexOf(\"*\") >= 0) {\r\n\t\t\tString[] numparts = StringUtil.splitData(num, '*', 2);\r\n\t\t\ttempnum = parseNumber(numparts[0]) * parseNumber(numparts[1]);\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttempnum = Double.valueOf(num);\r\n\t\t}\r\n\r\n\t\treturn tempnum;\r\n\t}", "private void parseSecsBAT(String str)\n {\n // The value.\n long theValue;\n\n // Try to parse the string as a double.\n try {\n // theValue = (long)(Double.parseDouble(str) * 1000000.0);\n theValue = (long) ((new Double(str)).doubleValue() * 1000000.0);\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Check for a negative number.\n if (theValue <= 0) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Set the value in the object.\n itsValue = theValue;\n }", "public abstract double fromBasicUnit(double valueJTextInsert);", "private void convertLabelsToInt(){\n String sec = tSec.getText();\n sec = sec.replaceAll(\"[^0-9\\\\s+]\", \"\");\n seconds = Integer.parseInt(sec.trim());\n \n String min = tMin.getText();\n min = min.replaceAll(\"[^0-9\\\\s+]\", \"\");\n minutes = Integer.parseInt(min.trim());\n \n String hour = tHours.getText();\n hour = hour.replaceAll(\"[^0-9\\\\s+]\", \"\");\n hours = Integer.parseInt(hour.trim());\n }", "private int parseExponentString(String str) {\n\t\treturn Integer.parseInt(str.substring(1));\n\t}", "private ChronoUnit parseUnit(String unitStr) {\n unitStr = unitStr.toUpperCase();\n // If the unitStr ends with a 'S' then do nothing otherwise add a 'S' to the end\n unitStr = unitStr.charAt(unitStr.length() - 1) == 'S' ? unitStr : unitStr + \"S\";\n // Return the corresponding ChronoUnit\n switch (unitStr) {\n case \"DAYS\":\n return ChronoUnit.DAYS;\n case \"WEEKS\":\n return ChronoUnit.WEEKS;\n case \"HOURS\":\n return ChronoUnit.HOURS;\n case \"SECONDS\":\n return ChronoUnit.SECONDS;\n case \"MINUTES\":\n return ChronoUnit.MINUTES;\n }\n return ChronoUnit.DAYS;\n }", "public static int decimals() {\n return 0;\n }", "@Test\n public void testLog() throws IOException {\n System.out.println(Double.parseDouble(\"3.123124354657668698\"));\n }", "@Test\n public void testDecodeObjectWithInvalidNumberLeadingDot() throws Exception {\n try {\n JSONDecoder.decode(\"{ \\\"myValue\\\": .123456 }\");\n fail(\"Expected NumberFormatException\");\n } catch (Exception e) {\n assertEquals(NumberFormatException.class, findRootCause(e).getClass());\n }\n }", "public static long parseLongPennies(String numStr)\r\n\t{\r\n\t\tnumStr = numStr.trim();\r\n\t\t// strip commas, spaces, + etc\r\n\t\tStringBuffer b = new StringBuffer(numStr.length());\r\n\t\tboolean negative = false;\r\n\t\tint decpl = -1;\r\n\t\tfor (int i = 0; i < numStr.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = numStr.charAt(i);\r\n\t\t\tswitch (c)\r\n\t\t\t{\r\n\t\t\tcase '-':\r\n\t\t\t\tnegative = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase '.':\r\n\t\t\t\tif (decpl == -1)\r\n\t\t\t\t{\r\n\t\t\t\t\tdecpl = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new NumberFormatException(\"more than one decimal point\");\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase '0':\r\n\t\t\tcase '1':\r\n\t\t\tcase '2':\r\n\t\t\tcase '3':\r\n\t\t\tcase '4':\r\n\t\t\tcase '5':\r\n\t\t\tcase '6':\r\n\t\t\tcase '7':\r\n\t\t\tcase '8':\r\n\t\t\tcase '9':\r\n\t\t\t\tif (decpl != -1)\r\n\t\t\t\t{\r\n\t\t\t\t\tdecpl++;\r\n\t\t\t\t}\r\n\t\t\t\tb.append(c);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t// ignore junk chars\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t// end switch\r\n\t\t}\r\n\t\t// end for\r\n\t\tif (numStr.length() != b.length())\r\n\t\t{\r\n\t\t\tnumStr = b.toString();\r\n\t\t}\r\n\t\tif (numStr.length() == 0)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tlong num = Long.parseLong(numStr);\r\n\t\tif (decpl == -1 || decpl == 0)\r\n\t\t{\r\n\t\t\tnum *= 100;\r\n\t\t}\r\n\t\telse if (decpl == 2)\r\n\t\t{\r\n\t\t\t/* it is fine as is */\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new NumberFormatException(\"wrong number of decimal places.\");\r\n\t\t}\r\n\t\tif (negative)\r\n\t\t{\r\n\t\t\tnum = -num;\r\n\t\t}\r\n\t\treturn num;\r\n\t}", "private void setDigitsAfterDot(int digits) {\n // check for logical error\n if(digits < 0) {\n // error ..\n eHandler.newError(ErrorType.INVALID_ARGUMENT, \"setDigitsAfterDot\" , \"Negative digits number\");\n\n // exit from method\n return;\n } // end of if statement\n\n // set the digitsAfterDot\n digitsAfterDot = digits;\n\n }", "private static int intValueStr(NodeValue nv, int valueNan) {\n if ( nv.isInteger() )\n return nv.getInteger().intValue() ;\n if ( nv.isDecimal() )\n return (int)Math.round(nv.getDecimal().doubleValue()) ;\n\n if ( nv.isFloat() ) {\n float f = nv.getFloat() ;\n if ( Float.isNaN(f) )\n return valueNan ;\n return Math.round(f) ;\n }\n if ( nv.isDouble() ) {\n double d = nv.getDouble() ;\n if ( Double.isNaN(d) )\n return valueNan ;\n return (int)Math.round(d) ;\n }\n throw new ExprEvalException(\"Not a number:\" + nv) ;\n }", "private double processFactor() throws ParsingException {\n if (tryCaptureChar('-')) {\n return -processFactor();\n }\n\n double result;\n int startPos = this.pos;\n\n if (tryCaptureChar('(')) {\n result = processExpression();\n tryCaptureChar(')');\n } else if (Character.isDigit(ch) || ch == '.') {\n\n while (Character.isDigit(ch) || ch == '.') {\n getNextChar();\n }\n\n // Number of points in a string\n // Without a hack :(\n int countPoints = 0;\n for (int i = startPos; i < this.pos; ++i) {\n countPoints += expression.charAt(i) == '.' ? 1 : 0;\n }\n\n if (countPoints > 1) {\n throw new ParsingException(\"Number with many points found\");\n }\n\n result = Double.parseDouble(expression.substring(startPos, this.pos));\n } else {\n throw new ParsingException(\"Unexpected appearance of: \" + ch);\n }\n\n return result;\n }", "private void processNumericModifier() {\n\n Token token = tokens.get(currentTokenPointer);\n\n if (currentVersionComponent == 3) {\n\n raiseParseProblem(\"cannot specify a numerical +/- value for the qualifier, found '\" + string(token) + \"' at position \" + token.start,\n\n token.start);\n\n }\n\n String tokenString = string(token);\n\n try {\n\n Integer value = null;\n\n if (token.kind == TokenKind.PLUSNUMBER) {\n\n value = Integer.parseInt(tokenString.substring(1));\n\n } else {\n\n value = Integer.parseInt(tokenString);\n\n }\n\n pushIt(new SumTransformer(value));\n\n } catch (NumberFormatException nfe) {\n\n raiseParseProblem(\"cannot parse numerical value '\" + tokenString + \"' at position \" + token.start, token.start);\n\n }\n\n }", "private int getNumberFromString(String text){\n\t\t\n\t\tint result = 0;\n\t\t\n\t\tfor(int i=text.length() - 1, j=0; i >= 0 ; i--, j++){\n\t\t\t\n\t\t\tresult += (Character.getNumericValue(text.charAt(i))) * Math.pow(10, j);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private int parseAccountOrNum(String name) {\n \tint rtn;\n if (name.charAt(0) >= '0' && name.charAt(0) <= '9') {\n rtn = new Integer(name).intValue();\n }\n else {\n \trtn = parseAccount(name).readCache();\n }\n return rtn;\n }", "public String get_fraction_part();", "private static int eatNumber (String s, int pos[]) {\r\n int sign = 1;\r\n int result = 0;\r\n int i = 0;\r\n if (s.charAt(pos[0])=='-') {\r\n pos[0]++;\r\n sign = -1;\r\n }\r\n for (; pos[0]<s.length(); i++) {\r\n char c=s.charAt(pos[0]);\r\n if (! Character.isDigit(c)) {\r\n break;\r\n }\r\n result = 10*result + (c-'0');\r\n pos[0]++;\r\n if (i==0 && result==0) return 0;\r\n }\r\n if (i==0) throw new RuntimeException();\r\n return result*sign;\r\n }", "private static int convertToCents(String amount) {\n\n /* First check if the format of the amount is correct */\n if(!validAmount(amount)) {\n return -1;\n }\n\n /* Look for the dot (if there is one), to separate cents from dollars */\n int dotIdx = amount.indexOf('.');\n\n /* Calculate the number of cents */\n int numCents = 0;\n if(dotIdx != -1){\n for(int i = dotIdx+1; i < Math.min(dotIdx+3, amount.length()); i++){\n numCents = numCents*10 + amount.charAt(i) - '0';\n }\n if(numCents < 10){\n numCents *= 10;\n }\n }\n\n /* Calculate the number of dollars */\n if(dotIdx == -1){\n dotIdx = amount.length();\n }\n int numDollars = 0;\n for(int i = 0; i < dotIdx; i++){\n if(Character.isDigit(amount.charAt(i))){\n numDollars = numDollars*10 + amount.charAt(i) - '0';\n }\n }\n\n if (numDollars >= 100000) { return -2; }\n\n return numDollars*100 + numCents;\n }", "private Token number() {\n\t\tStringBuffer sb = new StringBuffer();\n\t\twhile(isDigit(this.currentChar) && this.pos != Integer.MIN_VALUE) {\n\t\t\tsb.append(this.currentChar);\n\t\t\tnext_char();\n\t\t}\n\t\t//处理小数\n\t\tif(this.currentChar == '.') {\n\t\t\tsb.append(this.currentChar);\n\t\t\tnext_char();\n\t\t\t\n\t\t\twhile(isDigit(this.currentChar) && this.pos != Integer.MIN_VALUE) {\n\t\t\t\tsb.append(this.currentChar);\n\t\t\t\tnext_char();\n\t\t\t}\n\t\t\treturn new Token(Type.REAL_CONST, sb.toString());\n\t\t}else {\n\t\t\treturn new Token(Type.INTEGER_CONST, sb.toString());\n\t\t}\n\t}", "private static float parseCoOrdinate(String value) {\n\t\tfloat result = 0f;\n\n\t\t// Quick and dirty way to determine if the value appears to have a units suffix.\n\t\tif (value.charAt(value.length() - 1) >= 'a') {\n\t\t\tif (value.endsWith(\"px\")) {\n\t\t\t\tvalue = value.substring(0, value.length() - 2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// TODO: Add support in future for other units here.\n\t\t\t\t// TODO: Call our error reporting function.\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tresult = Float.parseFloat(value);\n\t\t}\n\t\tcatch (final NumberFormatException nfe) {\n\n\t\t}\n\t\treturn result;\n\t}", "public static int findWhole(String fraction) {\t//method to find the whole #\r\n \tif(fraction.contains(\"_\")) {\t//check if the fraction has an _\r\n \t\tint whole= Integer.parseInt(fraction.substring(0, fraction.indexOf(\"_\"))); //if so use substring to get num from index 0 to the _ ; set as a variable\r\n \t\treturn whole;\t//return the number; use parseint to convert answer to an int\r\n \t} else {\r\n \t\tif(fraction.contains(\"/\")) { //else if it contains a /\r\n \t\t\treturn 0;\t//just return a 0\r\n \t\t} \r\n \t\treturn Integer.parseInt(fraction); //if it doesnt match any of conditionals then its probably just a whole num so just return it; convert to int\r\n \t}\t\t\r\n }", "void milestone2(double num){\n System.out.println(\"Integer part: \" + (int)num);\n double fractionPart = num - (int)num;\n fractionPart *= 100;\n System.out.println(\"Fractional part: \" + (int)fractionPart);\n }", "private static long parseNumber(CharSequence text, String parsed, int multiplier, String errorText) {\n if (parsed == null) {\n return 0;\n }\n try {\n long val = Long.parseLong(parsed);\n return Math.multiplyExact(val, multiplier);\n } catch (NumberFormatException | ArithmeticException ex) {\n throw (DateTimeParseException) new DateTimeParseException(\"Text cannot be parsed to a Duration: \" + errorText, text, 0).initCause(ex);\n }\n }", "@Test\n public void testDigits() {\n final String result = calc.type(\"1 + 2 - 3\")\n .press_equalBtn()\n .result();\n\n Assert.assertEquals(result, \"0\");\n }", "public String addDecimal();", "private void processNumericValues(ReportConcept entry, ConceptLabel lbl) {\n\t\tif (isNumber(entry.getConceptClass()) && !entry.getConceptEntry().hasNumericValue()) {\n\t\t\tentry.setNumericValue(TextHelper.parseDecimalValue(lbl.getText()));\n\t\t}\n\t}", "@Test\n public void intFromFloat() throws Exception {\n String retVal = new SynapseHelper().serializeToSynapseType(MOCK_TEMP_DIR, TEST_PROJECT_ID, TEST_RECORD_ID,\n TEST_FIELD_NAME, UploadFieldTypes.INT, new DecimalNode(new BigDecimal(\"-13.9\")));\n assertEquals(retVal, \"-13\");\n }", "public static double MyParseFloat(String s) throws Exception {\n\t\tStateFloat state;\n\n\t\tstate = StateFloat.SA;\n\n\t\tint i = 0;\n\t\tBoolean neg = false;\n\t\tBoolean nege = false;\n\t\tdouble divider = 10;\n\t\tdouble value = 0;\n\t\tint exponent = 0;\n\n\twhile (i < s.length() && (state != StateFloat.SC || state != StateFloat.SF || state != StateFloat.SH)) {\n\t\t\tchar ch = s.charAt(i);\n\t\t\tswitch (state) {\n\t\t\t\tcase SA:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SC;\n\t\t\t\t\t\tvalue = Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '+' || ch == '-') {\n\t\t\t\t\t\tstate = StateFloat.SB;\n\t\t\t\t\t\tif (ch == '-') neg = true;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SB:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SC;\n\t\t\t\t\t\tif (neg) value = 10*value - Character.getNumericValue(ch);\n\t\t\t\t\t\telse value = 10*value + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SC:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tif (neg) value = 10*value - Character.getNumericValue(ch);\n\t\t\t\t\t\telse value = 10*value + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '.') {\n\t\t\t\t\t\tstate = StateFloat.SD;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == 'e' || ch == 'E') {\n\t\t\t\t\t\tstate = StateFloat.SE;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SD:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SF;\n\t\t\t\t\t\tif (neg) value -= Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\telse value += Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\tdivider *= 10;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SE:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SH;\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == '+' || ch == '-') {\n\t\t\t\t\t\tstate = StateFloat.SG;\n\t\t\t\t\t\tif (ch == '-') nege = true;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SF:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\t//Divider comes here\n\t\t\t\t\t\tif (neg) value -= Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\telse value += Character.getNumericValue(ch)/divider;\n\t\t\t\t\t\tdivider *= 10;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else if (ch == 'e' || ch == 'E') {\n\t\t\t\t\t\tstate = StateFloat.SE;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SG:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tstate = StateFloat.SH;\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SH:\n\t\t\t\t\tif (Character.isDigit(ch)) {\n\t\t\t\t\t\tif (nege) exponent = 10*exponent - Character.getNumericValue(ch);\n\t\t\t\t\t\telse exponent = 10*exponent + Character.getNumericValue(ch);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception(\"Bad Format\");\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (state != StateFloat.SC && state != StateFloat.SF && state != StateFloat.SH) throw new Exception(\"Bad Format\");\n\t\tvalue = value * Math.pow(10, exponent);\n\t\treturn value;\n\t}", "private void parseAndFormatInput() {\n try {\n String input = getText();\n if (input == null || input.length() == 0) {\n return;\n }\n Number parsedNumber = nf.parse(input);\n BigDecimal newValue = new BigDecimal(parsedNumber.toString());\n setNumber(newValue);\n selectAll();\n } catch (ParseException ex) {\n // If parsing fails keep old number\n setText(nf.format(number.get()));\n }\n }", "public static void Promedio(){\n int ISumaNotas=0;\n int IFila=0,ICol=0;\n int INota;\n float FltPromedio;\n for(IFila=0;IFila<10;IFila++)\n {\n ISumaNotas+=Integer.parseInt(StrNotas[IFila][1]);\n }\n FltPromedio=ISumaNotas/10;\n System.out.println(\"El promedio de la clase es:\"+FltPromedio);\n }", "public static String toDotDecimalSeparator(String str) {\r\n return str.replaceAll(\",(?=[0-9]+,)\", \"\").replaceAll(\",\", \".\");\r\n }", "public void testGetNumericValue2() {\n ValueString vs = new ValueString(\"2.8\");\n\n assertEquals(\"2.8\", vs.getString());\n assertEquals(2.8D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n assertEquals(2.8D, vs.getBigNumber().doubleValue(), 0.1D);\n }", "public static int findNumerator(String fraction) {\n \tif(fraction.contains(\"_\")) {\t//check if the frac has an _\r\n \t\tint numerator= Integer.parseInt(fraction.substring(fraction.indexOf(\"_\") +1, fraction.indexOf(\"/\")));\t//if so use substring from _ to the /; convert to int ant make variable for numerator\r\n \t\treturn numerator;\t//return the numerator\r\n \t} else {\r\n \t\tif(fraction.contains(\"/\")) {\t//check if the frac just had a /\r\n \t\t\tint numeratorSlash= Integer.parseInt(fraction.substring(0, fraction.indexOf(\"/\")));\t//use substring to get numbers from index 0 to / ; make variable and convert to int\r\n \t\t\treturn numeratorSlash;\t//return the number\r\n \t\t} \r\n \t}\r\n \treturn 0;\t//else if it doesnt apply to any of the conditionals above it's most likely a whole number so just return 0\r\n }", "public void printDecimal(String title, int processType, int unitNum, String binaryChunk, String type) {\n\n // Convert string to a decimal value\n int decimal = Integer.parseInt(binaryChunk, 2);\n\n // The resulting value\n String result = title == \"Type\" ? decimal + getICMPType(decimal) : \"\" + decimal;\n\n // Print the values\n String formatted = String.format(type + \"%-25s = %20s\", title, result);\n System.out.println(formatted);\n }", "public static void main(String[] args) {\n\n\n String a=\"95.244522094727\";\n int score = (int)Double.parseDouble(a);\n System.out.println(score);\n }", "public abstract void getIntImpl(String str, double d, Resolver<Double> resolver);", "private String removeContainsDot(String amount) {\n if (amount != null && !TextUtils.isEmpty(amount)) {\n if (amount.contains(\".\")) {\n String result = amount.substring(0, amount.indexOf(\".\"));\n return result;\n } else {\n return amount;\n }\n }\n return \"0\";\n }", "private int extractInt() {\n\t\tint startIndex = index;\n\t\tfor (; index < exprLen; index++) {\n\t\t\tchar c = expr.charAt(index);\n\t\t\tif (!Character.isDigit(c)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tint endIndex = index;\n\t\tint value;\n\t\ttry {\n\t\t\tvalue = Integer.parseInt(expr.substring(startIndex, endIndex));\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(e.getMessage());\n\t\t}\n\n\t\treturn value;\n\t}", "String getPvalue(String num) {\n\t\tif (Double.parseDouble(num) >= 30) return \"0.000000\";\n\t\telse \n\t\t\treturn pvalues.get(num);\n\t}", "private void parseUnitLengthDegreeScaler(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tif(tokens.length == 2) {\n\t\t\tthis.setUnitLengthDegreeScaler(Double.parseDouble(tokens[1]));\n\t\t}\n\t\telse if(tokens.length == 3) {\n\t\t\tdouble firstNumber = Double.parseDouble(tokens[1].replace(\"/\", \"\"));\n\t\t\tdouble secondNumber = Double.parseDouble(tokens[2].replace(\"/\", \"\"));\n\t\t\tdouble degreeScaler = firstNumber / secondNumber;\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse if(tokens.length == 4 && tokens[2].equals(\"/\")) {\n\t\t\tdouble degreeScaler = Double.parseDouble(tokens[1]) / Double.parseDouble(tokens[3]);\n\t\t\tthis.setUnitLengthDegreeScaler(degreeScaler);\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Invalid unitLengthDegreeScaler\");\n\t\t}\n\t}", "private double parseHTMLForTemp(String line){\n String output = \"\";\n int end = 0;\n char charInt;\n for (int i=0; i<line.length(); i++){\n charInt=line.charAt(i);\n if(charInt>=45 && charInt<=57){\n output = output + charInt;\n end+=1;\n }\n else{\n if (end > 1){\n break;\n }\n }\n }\n\n return Double.parseDouble(output.substring(1));\n }", "public double numberDots(LocationSet dot){\n\t\treturn -(dot.size()*10)/250;\n\t}", "static int getNumberFromString(String s) {\n if (s == null) {\n throw new NumberFormatException(\"null\");\n }\n int result = 0;\n int startIndex = 0;\n int length = s.length();\n boolean negative = false;\n char firstChar = s.charAt(0);\n if (firstChar == '-') {\n negative = true;\n startIndex = 1;\n }\n\n for (int i = startIndex; i < length; i++) {\n char num = s.charAt(i);\n result = result * 10 + num - '0';\n }\n\n return negative ? -result : result;\n }", "public static int decimalToAnyBase(int n, int b){\n int val = 0;\n\n int p = 1;\n while(n > 0){\n int d = n % b;\n n = n / b;\n val += p * d;\n p = p * 10;\n }\n\n return val;\n}", "private double tranferStringToNum(String num){\r\n double number = 0;\r\n try{\r\n\tnumber = Double.parseDouble(num);\r\n }catch(Exception ex){\r\n\tnumber = 0;\r\n }\r\n return number;\r\n }", "public String decimalNumberOct(double d) {\n m = \"\";\n c = 0;\n i = 0;\n long z = (long) d;\n while (z != 0) {\n //11001 ------- 25\n c += ((z % 10) * (Math.pow(8, i)));\n z /= 10;\n i++;\n }\n if ((long) d != d) {\n i = -1;\n m += d;\n f = m.indexOf('.') + 1;\n f = m.length() - f;\n f = -f;\n double a = d - (long) d;\n while (i >= f) {\n //11001 ------- 25\n a *= 10;\n c += (long) a * ((Math.pow(8, i)));\n i--;\n a -= (long) a;\n }\n }\n m = \"\";\n m += c;\n return m;\n }", "public static long inetAton(String add) {\n long result = 0;\n // number between a dot\n long section = 0;\n // which digit in a number\n int times = 1;\n // which section\n int dots = 0;\n for (int i = add.length() - 1; i >= 0; --i) {\n if (add.charAt(i) == '.') {\n times = 1;\n section <<= dots * 8;\n result += section;\n section = 0;\n ++dots;\n } else {\n section += (add.charAt(i) - '0') * times;\n times *= 10;\n }\n }\n section <<= dots * 8;\n result += section;\n return result;\n }", "private void converToDecimalValue(int inputValue, int inputSystemType) {\n\t\t// Adding stack to support string loop\n\t\tStack<Integer> letters = new Stack<Integer>();\n\t\tString inputValueString = Integer.toString(inputValue);\n\t\t// Adding the string loop to push the chars to a stack\n\t\tfor (int index = 0; index < inputValueString.length(); index++) {\n\t\t\tCharacter aChar = new Character(inputValueString.charAt(index));\n\t\t\tString s = aChar.toString();\n\t\t\tint number = Integer.parseInt(s);\n\t\t\tletters.push(number);\n\t\t}\n\t\t// Counter is needed to tell the position of the digit and the number\n\t\tint counter = 0;\n\t\twhile (!letters.empty()) {\n\t\t\tInteger value = ((Integer) letters.pop());\n\t\t\t// Checking the result with a println\n\t\t\t// System.out.println(value.intValue() + \" \" +\n\t\t\t// this.convertedToDecimalValue);\n\t\t\tthis.convertedToDecimalValue += (int) (Math.pow(inputSystemType,\n\t\t\t\t\tcounter++) * value.intValue());\n\n\t\t}\n\t}", "private static String toNumber(String in) {\n in = in.toLowerCase();\n for (int i = 0; i < MONTHS.length; i++)\n if (MONTHS[i].equals(in))\n return Integer.toString(i + 1);\n for (int i = 0; i < DAYS.length; i++)\n if (DAYS[i].equals(in))\n return Integer.toString(i);\n try {\n Integer.parseInt(in);\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"'\" + in + \"' is not a number!\");\n }\n return in;\n }", "@Test\n public void canConvertValidRomanString() {\n String romanStr = \"mMmCMxciX\";\n //when\n BigDecimal b = RomanNumberUtil.toDecimal(romanStr);\n //then\n Assert.assertEquals(b, BigDecimal.valueOf(3999L));\n\n }", "private Token scanRealOrIntegerLiteral() {\n Token tok;\n Pair<Integer, Integer> pos = new Pair<>(in.line(), in.pos());\n while (Character.isDigit(c) && c != '.' && c != -1) {\n buffer.add(c);\n c = in.read();\n }\n\n if (c == '.') {\n int nextChar = in.read();\n if (nextChar == '.') { // which means '..' operator was encountered\n tok = new Token(buffer.toString(),\n TokenType.INTEGER, pos);\n enqueuedToken = new Token(\"..\", TokenType.RANGE, pos);\n buffer.flush();\n c = in.read(); // reading in the next unprocessed character\n } else if (Character.isDigit(nextChar)) { // which means a real literal was encountered\n buffer.add(c);\n while (Character.isDigit(nextChar)) {\n buffer.add(nextChar);\n nextChar = in.read();\n }\n tok = new Token(buffer.toString(), TokenType.REAL_LITERAL, pos);\n buffer.flush();\n c = nextChar;\n\n } else { // which means a real literal without digits after dot (like 1. <=> 1.0)\n\n buffer.add(c);\n tok = new Token(buffer.toString(), TokenType.REAL_LITERAL, pos);\n buffer.flush();\n c = nextChar;\n\n }\n } else {\n tok = new Token(buffer.toString(), TokenType.INTEGER_LITERAL, pos);\n buffer.flush();\n }\n return tok;\n }", "@Test\n public void testParseInt() {\n IntegerSpec integerSpec = new IntegerSpec();\n integerSpec.setDefaultValue(0);\n dataTypeParser.setDataTypeSpec(integerSpec);\n dataTypeParser.parse();\n IntegerSpec parsedIntegerSpec = (IntegerSpec) dataTypeParser.getDataTypeSpec();\n\n assertNull(parsedIntegerSpec.getMinValue());\n assertNull(parsedIntegerSpec.getMaxValue());\n }", "public static String cleanStringToNumber(String string) {\r\n\t\treturn string = string.replaceAll(\"([^0-9.])\", \"\");\r\n\t}", "private void parsePlateau(String s) {\r\n String[] parsedString = s.split(\" \");\r\n plateau[0] = Integer.parseInt(parsedString[0]);\r\n plateau[1] = Integer.parseInt(parsedString[1]);\r\n }" ]
[ "0.6254443", "0.6141617", "0.604423", "0.57974446", "0.57083106", "0.5665501", "0.563801", "0.56263864", "0.5579575", "0.55669814", "0.5557735", "0.55571353", "0.54925865", "0.54784256", "0.5467571", "0.54653436", "0.54395145", "0.5406407", "0.53956246", "0.5372804", "0.53546256", "0.53242564", "0.53219354", "0.53074265", "0.5292074", "0.52791494", "0.5275047", "0.5266912", "0.5245902", "0.5240611", "0.5240526", "0.52208924", "0.5218404", "0.52089596", "0.52071434", "0.5201067", "0.51964694", "0.51964694", "0.5177842", "0.517709", "0.51752764", "0.51748425", "0.5171848", "0.5157135", "0.51533353", "0.514377", "0.5140538", "0.5139942", "0.51351416", "0.5124983", "0.5105819", "0.51006186", "0.5097573", "0.50952536", "0.5094253", "0.5085383", "0.5083972", "0.5078251", "0.50760925", "0.5063926", "0.5038987", "0.50388914", "0.50368935", "0.50318855", "0.5024406", "0.501841", "0.50181234", "0.5016975", "0.5014757", "0.5014035", "0.50093216", "0.5007659", "0.49937946", "0.49863997", "0.49849916", "0.49723864", "0.4971556", "0.4967451", "0.496588", "0.49622685", "0.4957843", "0.49532932", "0.49503627", "0.49347615", "0.49297953", "0.49278626", "0.49252486", "0.49250966", "0.49241582", "0.49222007", "0.49066564", "0.49019682", "0.4897933", "0.4897904", "0.48975837", "0.48920873", "0.4890131", "0.48865697", "0.4884395", "0.4877868" ]
0.58073306
3
Created by anahisalgado on 20/06/17.
public interface Service { @GET(Constants.URL_GET_USER) Call<JsonObject> getDataUser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void func_104112_b() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n void init() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n public void init() {}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\n public int describeContents() { return 0; }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "private void init() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void m50366E() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n public void initialize() { \n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n public int getSize() {\n return 1;\n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }" ]
[ "0.6139526", "0.6011606", "0.5905214", "0.5840368", "0.5840368", "0.58314675", "0.57903874", "0.5786642", "0.5770986", "0.57481194", "0.57358956", "0.5733392", "0.5732354", "0.5707103", "0.57050586", "0.5696147", "0.56904006", "0.5684311", "0.567321", "0.567321", "0.567321", "0.567321", "0.567321", "0.5660176", "0.56601554", "0.56525755", "0.5644761", "0.56261283", "0.56167763", "0.5614078", "0.5607401", "0.5604297", "0.5596261", "0.5596261", "0.55787057", "0.55787057", "0.55787057", "0.55787057", "0.55787057", "0.55787057", "0.55668074", "0.55594736", "0.5558277", "0.5540725", "0.55406904", "0.55400527", "0.5535462", "0.5535462", "0.5535462", "0.5534444", "0.5527076", "0.5525932", "0.5525932", "0.55209756", "0.55209756", "0.5518815", "0.5518815", "0.5518815", "0.55164915", "0.55121076", "0.5510381", "0.5509453", "0.5509453", "0.5509453", "0.5494383", "0.5486829", "0.5482819", "0.54826", "0.54795986", "0.5475505", "0.5474557", "0.5468281", "0.5464749", "0.54608995", "0.54538876", "0.54530394", "0.5444265", "0.5435819", "0.54269314", "0.5417549", "0.53945875", "0.5387867", "0.5387867", "0.53854424", "0.53793657", "0.5374099", "0.53717756", "0.53717756", "0.5367156", "0.5367156", "0.5367156", "0.5367156", "0.5367156", "0.5367156", "0.5367156", "0.53608644", "0.5354463", "0.5351643", "0.53465116", "0.53444767", "0.53383404" ]
0.0
-1
/ TODO: Warning this method won't work in the case the id fields are not set.
@Override public boolean equals(Object object) { if (!(object instanceof UserInfo)) { return false; } UserInfo other = (UserInfo) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public int getId(){ return id; }", "public int getId() {return id;}", "public int getId(){return id;}", "public int id() {return id;}", "public int getId() {return Id;}", "public void setId(long id) {\n id_ = id;\n }", "public Integer getId(){return id;}", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public long getId(){return this.id;}", "@Override public String getID() { return id;}", "public Integer getId() { return id; }", "@Override\n\tpublic Integer getId() {\n return id;\n }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public int getId(){\r\n return this.id;\r\n }", "public Long id() { return this.id; }", "@Override\n public long getId() {\n return id;\n }", "@Override\n public Long getId () {\n return id;\n }", "public String getId(){return id;}", "@Override\r\n public int getId() {\n return id;\r\n }", "public void setId(String id) {\n this.id = id;\n }", "@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}", "public Long getId() {return id;}", "public Long getId() {return id;}", "public int getID() {return id;}", "public int getID() {return id;}", "public Integer getId() { return this.id; }", "public int getId() {\n return id;\n }", "public long getId() { return _id; }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}", "public long getId() { return id; }", "public long getId() { return id; }", "@Override\n\tpublic void setId(Long id) {\n\t}", "public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "public void setId(Long id) \n {\n this.id = id;\n }", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public void setId(int id){\r\n this.id = id;\r\n }", "@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }", "public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }", "public long getId() { return this.id; }", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "protected abstract String getId();", "public int getId()\n {\n return id;\n }", "@Override\n public Integer getId() {\n return id;\n }", "void setId(int id) {\n this.id = id;\n }", "@Override\n public int getId() {\n return id;\n }", "@Override\n public int getId() {\n return id;\n }", "public void setId(String id)\r\n/* 19: */ {\r\n/* 20:17 */ this.id = id;\r\n/* 21: */ }", "public Long getId() {\n return id;\n }", "@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}", "public void setId(int id)\n {\n this.id=id;\n }", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@Override\n public int getField(int id) {\n return 0;\n }", "public int getId()\r\n {\r\n return id;\r\n }", "@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public int getId(){\r\n return localId;\r\n }", "final protected int getId() {\n\t\treturn id;\n\t}", "@Override\n\tpublic void setId(Integer arg0) {\n\n\t}", "public void setId(int id) {\n\tthis.id = id;\n}", "public int getID(){\n return id;\n }", "public void setId( Integer id )\n {\n this.id = id ;\n }", "public void setId(Long id) \r\n {\r\n this.id = id;\r\n }", "@Override\n\tpublic int getID() {\n\t\treturn 0;\n\t}", "@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }", "public int getId()\n {\n return id;\n }", "@Override\n\tpublic Object getId() {\n\t\treturn null;\n\t}", "@Override\n public long getId() {\n return this.id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "public String getId(){ return id.get(); }", "public void setID(String id){\n this.id = id;\n }", "public String getId(){ return ID; }", "@Test\r\n public void testSetId() {\r\n System.out.println(\"setId\");\r\n int lId = 0;\r\n \r\n instance.setId(lId);\r\n assertEquals(lId, instance.getId());\r\n \r\n }", "@Override\n public long getId() {\n return super.getId();\n }", "public Long getId() \n {\n return id;\n }", "@Override\n public String getId() {\n return null;\n }" ]
[ "0.7100596", "0.6991922", "0.6905593", "0.67859083", "0.67859083", "0.6777196", "0.6777196", "0.6768104", "0.6765827", "0.6765827", "0.6765827", "0.6765827", "0.6765827", "0.6765827", "0.6743894", "0.6743894", "0.6741255", "0.67247486", "0.66896564", "0.66767627", "0.66712844", "0.66502064", "0.6607225", "0.6587063", "0.6572345", "0.6568829", "0.6530458", "0.65060776", "0.6497751", "0.64932036", "0.6492398", "0.64810926", "0.6474825", "0.6463012", "0.6458314", "0.64496356", "0.6439234", "0.6431956", "0.6431956", "0.64293605", "0.64293605", "0.64292943", "0.6424778", "0.6422098", "0.6420378", "0.6416975", "0.6416975", "0.64150894", "0.64065546", "0.64053327", "0.64053327", "0.64045143", "0.6374887", "0.6374887", "0.6374887", "0.6374452", "0.63687277", "0.63654035", "0.63640773", "0.63622504", "0.6362248", "0.6361594", "0.6357898", "0.6347687", "0.63453275", "0.63449454", "0.63449454", "0.633724", "0.6333305", "0.6328792", "0.6324993", "0.63239306", "0.6323337", "0.63170207", "0.63170207", "0.63140893", "0.6310856", "0.6299761", "0.62956756", "0.6281561", "0.6275032", "0.62610865", "0.62551767", "0.6254129", "0.625078", "0.6248138", "0.6246044", "0.62391406", "0.6238673", "0.6237121", "0.62366027", "0.62328964", "0.62328964", "0.6232659", "0.6227697", "0.6226349", "0.62255263", "0.6222735", "0.62213004", "0.62212193", "0.62195355" ]
0.0
-1
Called when the activity is first created.
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.item_list); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar ab = getSupportActionBar(); if (ab != null) { ab.setDisplayHomeAsUpEnabled(true); ab.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE); } Window window = getWindow(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { window.setStatusBarColor(getResources().getColor(R.color.colorPrimary)); } listView = (AbsListView) findViewById(R.id.list); listView.setOnItemClickListener(this); findViewById(R.id.placeholder).setVisibility(View.GONE); FloatingActionButton fabAddSchedule = (FloatingActionButton) findViewById(R.id.add_schedule); fabAddSchedule.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { createReminder(); } }); mDbHelper = new ScheduleDbAdapter(this); mDbHelper.open(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n }", "@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "@Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n }", "protected void onCreate() {\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tLog.e(TAG, \"onActivityCreated-------\");\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle arg0) {\n\t\tsuper.onActivityCreated(arg0);\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tinitData(savedInstanceState);\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitView();\r\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\tsetview();\r\n\t}", "@Override\n public void onCreate()\n {\n\n super.onCreate();\n }", "@Override\n public void onCreate() {\n initData();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tLogUtil.d(TAG, \"onActivityCreated---------\");\n\t\tinitData(savedInstanceState);\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n public void onCreate() {\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(@Nullable Bundle savedInstanceState) {\n\t\tinitView();\n\t\tinitListener();\n\t\tinitData();\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\n public void onCreate() {\n L.d(\"onCreate is called\");\n super.onCreate();\n }", "@Override\n\tpublic void onActivityCreated(Activity activity, Bundle savedInstanceState)\n\t{\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}", "protected void onFirstTimeLaunched() {\n }", "@Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n initData(savedInstanceState);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {\n }", "@Override\n public void onCreate() {\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tsetupTextviews();\n\t\tsetupHorizontalScrollViews();\n\t\tsetupHorizontalSelectors();\n\t\tsetupButtons();\n\t}", "@Override\n public void onCreate() {\n\n }", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t\t\r\n\t\tinitViewPager();\r\n\t\t\r\n\t\tinitView();\r\n\r\n\t\tinitCursor();\r\n\t\t\r\n\t\tinithuanxin(savedInstanceState);\r\n\t\r\n \r\n\t}", "public void onCreate() {\n }", "@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"onCreate\");\n\t\tsuper.onCreate();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n init();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsetContentView(R.layout.caifushi_record);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tinitview();\n\t\tMyApplication.getInstance().addActivity(this);\n\t\t\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_recent_activity);\n\t\tsetTitleFromActivityLabel(R.id.title_text);\n\t\tsetupStartUp();\n\t}", "@Override\n\tpublic void onCreate() {\n\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tgetLocation();\n\n\t\tregisterReceiver();\n\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle savedInstanceState) {\n eventManager.fire(Event.ACTIVITY_ON_CREATE, activity);\n }", "@Override\n public void onCreate()\n {\n\n\n }", "@Override\n\tprotected void onCreate() {\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tAnnotationProcessor.processActivity(this);\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n if (!KramPreferences.hasStartedAppBefore(this)) {\n // First time app is started\n requestFirstHug();\n HugRequestService.scheduleHugRequests(this);\n KramPreferences.putHasStartedAppBefore(this);\n }\n\n setContentView(R.layout.activity_main);\n initMonthView(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.act_myinfo);\n\t\tinitView();\n\t\tinitEvents();\n\n\t}", "public void onCreate();", "public void onCreate();", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.auth_activity);\n connectVariablesToViews();\n listenToFields();\n WorkSpace.authorizationCompleted = false;\n }", "@Override\n public void onCreate() {\n Log.d(TAG, TAG + \" onCreate\");\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) \r\n\t{\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\t\r\n\t\t// Get a reference to the tranistbuddy model.\r\n\t\tTransitBuddyApp app = (TransitBuddyApp)this.getApplicationContext();\r\n\t\tmModel = app.getTransitBuddyModel();\r\n\t\tmSettings = app.getTransitBuddySettings();\r\n\t\t\r\n\t\tsetTitle( getString(R.string.title_prefix) + \" \" + mSettings.getSelectedCity());\r\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tinit();\r\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n // Prepare the loader. Either re-connect with an existing one,\n // or start a new one.\n\t\tgetLoaderManager().initLoader(FORECAST_LOADER_ID, null, this);\n\t\tsuper.onActivityCreated(savedInstanceState); // From instructor correction\n\t}", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\tgetWindowManager().getDefaultDisplay().getMetrics(dm);\n\n\t\tintScreenX = dm.widthPixels;\n\t\tintScreenY = dm.heightPixels;\n\t\tscreenRect = new Rect(0, 0, intScreenX, intScreenY);\n\n\t\thideTheWindowTitle();\n\n\t\tSampleView view = new SampleView(this);\n\t\tsetContentView(view);\n\n\t\tsetupRecord();\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tif (BuildConfig.DEBUG) {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.FULL).hideThreadInfo();\n\t\t} else {\n\t\t\tLogger.init(getClass().getSimpleName()).setLogLevel(LogLevel.NONE).hideThreadInfo();\n\t\t}\n\t\tBaseApplication.totalList.add(this);\n\t}", "@Override\n public void onActivityPreCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {/**/}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n setupAddPotLaunch();\n setupListView();\n setupPotClick();\n }", "public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tcontext = getApplicationContext();\n\t\t\n\t\tApplicationContextUtils.init(context);\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n\n }", "@Override\n public void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n initArguments();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\t\t\n\t\tappManager = AppManager.getAppManager();\n\t\tappManager.addActivity(this);\n\t}", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\n\t\tmContext = (LFActivity) getActivity();\n\t\tinit();\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceBundle)\n\t{\n\t\tsuper.onCreate(savedInstanceBundle);\n\t\tView initView = initView();\n\t\tsetBaseView(initView);\n\t\tinitValues();\n\t\tinitListeners();\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.listexcursionscreen);\n\n ActionsDelegator.getInstance().synchronizeActionsWithServer(this);\n runId = PropertiesAdapter.getInstance(this).getCurrentRunId();\n\n RunDelegator.getInstance().loadRun(this, runId);\n ResponseDelegator.getInstance().synchronizeResponsesWithServer(this, runId);\n\n }", "@Override\n\tprotected void onCreate() {\n\t\tSystem.out.println(\"onCreate\");\n\t}", "@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAppManager.getInstance().addActivity(this);\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n }", "@Override\n\tpublic void onCreate() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate();\n\t}", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.add_daily_task);\n init_database();\n init_view();\n init_click();\n init_data();\n init_picker();\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t\n\t\tactivity = (MainActivity)getActivity(); \n\t\t\n\t\tactivity.setContListener(this);\n\t\t\n\t\tif(MODE == Const.MODE_DEFAULT){\n\t\t\tinitializeInfoForm();\n\t\t}else{\n\t\t\tinitializeAddEditForm();\t\t\t\n\t\t}\n\t\t\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tinitView();\n\n\t\tinitData();\n\n\t\tinitEvent();\n\n\t\tinitAnimation();\n\n\t\tshowUp();\n\t}", "@Override\n public void onCreate() {\n Thread.setDefaultUncaughtExceptionHandler(new TryMe());\n\n super.onCreate();\n\n // Write the content of the current application\n context = getApplicationContext();\n display = context.getResources().getDisplayMetrics();\n\n\n // Initializing DB\n App.databaseManager.initial(App.context);\n\n // Initialize user secret\n App.accountModule.initial();\n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t}", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n }" ]
[ "0.791686", "0.77270156", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7693263", "0.7637394", "0.7637394", "0.7629958", "0.76189965", "0.76189965", "0.7543775", "0.7540053", "0.7540053", "0.7539505", "0.75269467", "0.75147736", "0.7509639", "0.7500879", "0.74805456", "0.7475343", "0.7469598", "0.7469598", "0.7455178", "0.743656", "0.74256307", "0.7422192", "0.73934627", "0.7370002", "0.73569906", "0.73569906", "0.7353011", "0.7347353", "0.7347353", "0.7333878", "0.7311508", "0.72663945", "0.72612154", "0.7252271", "0.72419256", "0.72131634", "0.71865886", "0.718271", "0.71728176", "0.7168954", "0.7166841", "0.71481615", "0.7141478", "0.7132933", "0.71174103", "0.7097966", "0.70979583", "0.7093163", "0.7093163", "0.7085773", "0.7075851", "0.7073558", "0.70698684", "0.7049258", "0.704046", "0.70370424", "0.7013127", "0.7005552", "0.7004414", "0.7004136", "0.69996923", "0.6995201", "0.69904065", "0.6988358", "0.69834954", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69820535", "0.69783133", "0.6977392", "0.69668365", "0.69660246", "0.69651115", "0.6962911", "0.696241", "0.6961096", "0.69608897", "0.6947069", "0.6940148", "0.69358927", "0.6933102", "0.6927288", "0.69265485", "0.69247025" ]
0.0
-1
0 iguales /1 param mayor /1 param menor
public int compareTo(Estudiante z){ String nombreCompleto1=z.getNombre()+z.getApellido(); String nombreCompleto2=getNombre()+getApellido(); int comparacion=nombreCompleto1.compareTo(nombreCompleto2); if(comparacion>0){ return 1; } if(comparacion<0){ return -1; } return comparacion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override \n\t\tprotected int getNumParam() {\n\t\t\treturn 1;\n\t\t}", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "public void setParam0(java.lang.String param){\n \n if (param != null){\n //update the setting tracker\n localParam0Tracker = true;\n } else {\n localParam0Tracker = true;\n \n }\n \n this.localParam0=param;\n \n\n }", "private static boolean isParamSettable(String parameter)\n {\n if (parameter.equalsIgnoreCase(\"vdhe\") ||\n parameter.equalsIgnoreCase(\"vspe\") ||\n parameter.equalsIgnoreCase(\"dvle\") ||\n parameter.equalsIgnoreCase(\"dvme\") ||\n parameter.equalsIgnoreCase(\"ngon\") ||\n parameter.equalsIgnoreCase(\"ieon\") ||\n parameter.equalsIgnoreCase(\"deon\") ||\n parameter.equalsIgnoreCase(\"geon\") ||\n parameter.equalsIgnoreCase(\"dhsb\") ||\n parameter.equalsIgnoreCase(\"dhrg\") ||\n parameter.equalsIgnoreCase(\"dssb\") ||\n parameter.equalsIgnoreCase(\"dssa\") ||\n parameter.equalsIgnoreCase(\"dssf\") ||\n parameter.equalsIgnoreCase(\"dvla\") ||\n parameter.equalsIgnoreCase(\"iebt\") ||\n parameter.equalsIgnoreCase(\"iea\") ||\n parameter.equalsIgnoreCase(\"dea\") ||\n parameter.equalsIgnoreCase(\"ded\") ||\n parameter.equalsIgnoreCase(\"gebg\") ||\n parameter.equalsIgnoreCase(\"aoon\") ||\n parameter.equalsIgnoreCase(\"plb\") ||\n parameter.equalsIgnoreCase(\"plmd\") ||\n parameter.equalsIgnoreCase(\"vmon\") ||\n parameter.equalsIgnoreCase(\"vmb\") ||\n parameter.equalsIgnoreCase(\"dvli\") ||\n parameter.equalsIgnoreCase(\"dvlo\") ||\n parameter.equalsIgnoreCase(\"dvmc\") ||\n parameter.equalsIgnoreCase(\"ienb\") ||\n parameter.equalsIgnoreCase(\"iebf\") ||\n parameter.equalsIgnoreCase(\"genb\") ||\n parameter.equalsIgnoreCase(\"gebf\") ||\n parameter.equalsIgnoreCase(\"aonb\") ||\n parameter.equalsIgnoreCase(\"aobf\") ||\n parameter.equalsIgnoreCase(\"aobg\") ||\n parameter.equalsIgnoreCase(\"arnb\") ||\n parameter.equalsIgnoreCase(\"arbf\") ||\n parameter.equalsIgnoreCase(\"aocc\") ||\n parameter.equalsIgnoreCase(\"arbi\") ||\n parameter.equalsIgnoreCase(\"arbl\") ||\n parameter.equalsIgnoreCase(\"arbh\") ||\n parameter.equalsIgnoreCase(\"arod\") ||\n parameter.equalsIgnoreCase(\"artp\") )\n return true;\n else\n return false;\n }", "@Override\n public final int parseArguments(Parameters params) {\n return 1;\n }", "protected int checkParam(Object o, String name)\n {\n if (o == null) {\n System.err.println(format(\"Parameter %s is not set\", name));\n return 1;\n }\n return 0;\n }", "@Override\n\tprotected void initParams() {\n\t\t\n\t}", "protected void validatePreamp(int[] param) {\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"nosambungan\", nosambungan);\n return params;\n }", "public void setParameters(Map<String, String> param) {\n\n // check the occurrence of required parameters\n if(!(param.containsKey(\"Indri:mu\") && param.containsKey(\"Indri:lambda\"))){\n throw new IllegalArgumentException\n (\"Required parameters for IndriExpansion model were missing from the parameter file.\");\n }\n\n this.mu = Double.parseDouble(param.get(\"Indri:mu\"));\n if(this.mu < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"Indri:mu\") + \", mu is a real number >= 0\");\n\n this.lambda = Double.parseDouble(param.get(\"Indri:lambda\"));\n if(this.lambda < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"Indri:lambda\") + \", lambda is a real number between 0.0 and 1.0\");\n\n if((param.containsKey(\"fb\") && param.get(\"fb\").equals(\"true\"))) {\n this.fb = \"true\";\n\n this.fbDocs = Integer.parseInt(param.get(\"fbDocs\"));\n if (this.fbDocs <= 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbDocs\") + \", fbDocs is an integer > 0\");\n\n this.fbTerms = Integer.parseInt(param.get(\"fbTerms\"));\n if (this.fbTerms <= 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbTerms\") + \", fbTerms is an integer > 0\");\n\n this.fbMu = Integer.parseInt(param.get(\"fbMu\"));\n if (this.fbMu < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbMu\") + \", fbMu is an integer >= 0\");\n\n this.fbOrigWeight = Double.parseDouble(param.get(\"fbOrigWeight\"));\n if (this.fbOrigWeight < 0) throw new IllegalArgumentException\n (\"Illegal argument: \" + param.get(\"fbOrigWeight\") + \", fbOrigWeight is a real number between 0.0 and 1.0\");\n\n if (param.containsKey(\"fbInitialRankingFile\") && param.get(\"fbInitialRankingFile\") != \"\") {\n this.fbInitialRankingFile = param.get(\"fbInitialRankingFile\");\n try{\n this.initialRanking = readRanking();\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n\n if (param.containsKey(\"fbExpansionQueryFile\") && param.get(\"fbExpansionQueryFile\") != \"\")\n this.fbExpansionQueryFile = param.get(\"fbExpansionQueryFile\");\n }\n }", "String getZero_or_one();", "protected void validateAttenuator(int[] param) {\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public static void setConstantAkParam(String parameter, int[] values)\n {\n int i = 0;\n if (parameter.equalsIgnoreCase(\"genb\"))\n {\n DsLog.log1(LOG_TAG, \"The number of GEq bands is \" + values[0]);\n i = getAkParamIndex(\"gebf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"gebg\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"vcbf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"vcbg\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"vcbe\");\n akParams_[i].len = values[0];\n akParam_genb_ = values[0];\n }\n else if (parameter.equalsIgnoreCase(\"ienb\"))\n {\n DsLog.log1(LOG_TAG, \"The number of IEq bands is \" + values[0]);\n i = getAkParamIndex(\"iebf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"iebt\");\n akParams_[i].len = values[0];\n akParam_ienb_ = values[0];\n }\n else if (parameter.equalsIgnoreCase(\"aonb\"))\n {\n DsLog.log1(LOG_TAG, \"The number of Audio Optimizer bands is \" + values[0]);\n i = getAkParamIndex(\"aobf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"aobg\");\n akParams_[i].len = (values[0] + 1) * AKPARAM_AOCC;\n i = getAkParamIndex(\"arbf\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"arbi\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"arbl\");\n akParams_[i].len = values[0];\n i = getAkParamIndex(\"arbh\");\n akParams_[i].len = values[0];\n akParam_aonb_ = values[0];\n }\n else if (parameter.equalsIgnoreCase(\"gebf\"))\n {\n DsLog.log1(LOG_TAG, \"Initializing the graphic equalizer band center frequencies\");\n akParam_gebf_ = values;\n }\n\n // Define all the allowed settings once all the key parameters are settled down.\n if (!constantAkParamsDefined_ && akParam_genb_ != -1 && akParam_ienb_ != -1 && akParam_aonb_ != -1 && akParam_gebf_ != null)\n {\n defineSettings();\n constantAkParamsDefined_ = true;\n }\n }", "public boolean getParam0(){\n return localParam0;\n }", "public void setParam0(boolean param){\n \n // setting primitive attribute tracker to true\n \n if (false) {\n localParam0Tracker = false;\n \n } else {\n localParam0Tracker = true;\n }\n \n this.localParam0=param;\n \n\n }", "static int setCon(String input){\n if (input.equals(\"little\")||input.equals(\"1\")) return 1;\n if (input.equals(\"average\")||input.equals(\"2\"))return 2;\n if (input.equals(\"lot\") || input.equals(\"3\")) return 3;\n if (input.equals(\"manual\") || input.equals(\"4\")) return 4;\n throw new RuntimeException(\n \"Illigal second paramter on command line, use : <little,average,lot>\");\n }", "private static void menuno(int menuno2) {\n\t\t\r\n\t}", "private String checkParameters (HttpServletRequest request)\r\n\t{\r\n\t\tString ret = \"ok\";\r\n\t\tString paramName = null;\r\n\t\tString occNo = null;\r\n\t\tString encoding = null;\r\n\t\tString reqInd = null;\r\n\t\tString expression = \"^[-+]?[0-9]*\";\r\n\t\tPattern pattern = Pattern.compile(expression);\r\n\t\tMatcher matcher = null;\r\n\t\t\r\n\t\tfor (int i = 0; true; i++) {\r\n\t\t\tparamName = request.getParameter(\"paramName\" + i);\r\n\t\t\tif(paramName == null || paramName.equalsIgnoreCase(\"\")){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\toccNo = request.getParameter(\"paramOccNo\" + i);\r\n\t\t\t\r\n\t\t\t// WI 22224\r\n\t\t\tif(occNo != null){\r\n\t\t\t\tmatcher = pattern.matcher(occNo);\r\n\t\t\t}\r\n\t\t\tif(occNo!=null && !occNo.equalsIgnoreCase(\"\") && !matcher.matches()){ \r\n\t\t\t\tret = \"The Parameter Occurence Number should be integer.\"; \r\n\t\t\t\tbreak;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tencoding = request.getParameter(\"paramEncoding\" + i);\r\n\t\t\tif(encoding!=null && !encoding.equalsIgnoreCase(\"\") && !encoding.equalsIgnoreCase(Phrase.XML_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.ZIP_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.BASE64_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.ENCRYPT_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.DIGEST_TYPE)\r\n\t\t\t\t&& !encoding.equalsIgnoreCase(Phrase.NONE_TYPE)\r\n\t\t\t){\r\n\t\t\t\tret = \"The Parameter Encoding should be: \" \r\n\t\t\t\t\t+ Phrase.XML_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.ZIP_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.BASE64_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.ENCRYPT_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.DIGEST_TYPE + \",\"\r\n\t\t\t\t\t+ Phrase.NONE_TYPE + \".\"\r\n\t\t\t\t\t; \r\n\t\t\t\tbreak;\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\treqInd = request.getParameter(\"paramReqInd\" + i);\r\n\t\t\tif(reqInd!=null && !reqInd.equalsIgnoreCase(\"\") && !reqInd.equalsIgnoreCase(\"true\")\r\n\t\t\t\t&& !reqInd.equalsIgnoreCase(\"false\")\r\n\t\t\t){\r\n\t\t\t\tret = \"The Parameter Required Indicator should be: true or false.\"; \r\n\t\t\t\tbreak;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ret;\r\n\t\r\n\t}", "public abstract Result mo5059a(Params... paramsArr);", "static int type_of_ani(String passed){\n\t\treturn 1;\n\t}", "protected void validateParameter(String... param) throws NavigationException {\r\n\t\tif (param.length > 0){\r\n\t\t\tfor(int i = 0; i < param.length; i++){\r\n\t\t\t\tif (param[i] != null && param[i].isEmpty()) {\r\n\t\t\t\t\tthrow new NavigationException(\"parametro no enviado\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static int type_of_ori(String passed){\n\t\treturn 1;\n\t}", "public void setOrigen(java.lang.String param){\n \n this.localOrigen=param;\n \n\n }", "public void checkParameters() {\n }", "protected int getVillagerType(int par1)\n {\n return FantasticIds.fishermanID;\n }", "public lo(int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte paramByte1, byte paramByte2, boolean paramBoolean)\r\n/* 26: */ {\r\n/* 27:33 */ this.a = paramInt1;\r\n/* 28:34 */ this.b = paramInt2;\r\n/* 29:35 */ this.c = paramInt3;\r\n/* 30:36 */ this.d = paramInt4;\r\n/* 31:37 */ this.e = paramByte1;\r\n/* 32:38 */ this.f = paramByte2;\r\n/* 33:39 */ this.g = paramBoolean;\r\n/* 34: */ }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"id_pelanggan\", id_pelanggan);\n params.put(\"isi_pengaduan\", isi);\n return params;\n }", "public String overloadingMeth(int angka) { //contoh dari overloading method\n int x;\n x = angka % 10;\n valueword = \"\";\n if (angka == 0) {\n valueword = \"Nol\";\n\n } else if (angka == 100) {\n valueword = \"Seratus\";\n } else if (x == 0) {\n valueword += normalword[angka / 10] + \" Puluh\";\n\n } else if (angka < 12) {\n valueword += normalword[angka];\n } else if (angka < 20) {\n\n valueword += normalword[angka - 10] + \" Belas\";\n } else if (angka < 100) {\n valueword += normalword[angka / 10] + \" Puluh \" + normalword[angka % 10];\n } else if (angka > 100) {\n System.out.println(\"MASUKAN ERROR,ANGKA TIDAK BOLEH LEBIH DARI 100\");\n }\n return valueword;\n }", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noofconflicts);\n String checkconflicts = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"checkconflicts\", checkconflicts);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=0;m<noofstudent;m++){\n params.put(\"sid[\"+m+\"]\",sid[m]);\n }\n\n\n return params;\n }", "private static boolean default_formal_parameter_recover_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"default_formal_parameter_recover_0\")) return false;\n boolean r;\n r = consumeToken(b, RPAREN);\n if (!r) r = consumeToken(b, COMMA);\n if (!r) r = consumeToken(b, RBRACKET);\n if (!r) r = consumeToken(b, RBRACE);\n return r;\n }", "@Override\r\n\tpublic int getSecondArg() {\n\t\treturn 0;\r\n\t}", "private void validateInputParameters(){\n\n }", "public void faites(Langage param) {\n if (param.equals(Langage.JAVA)) {\n System.out.println(\"Faites à la façon n°1\");\n } else {\n System.out.println(\"Faites à la façon n°2\");\n }\n }", "public Joueur(int id, int pa)\r\n/* */ {\r\n/* 34 */ this.id_joueur = id;\r\n/* 35 */ this.points_action = pa;\r\n/* */ }", "@Override\n\tpublic RequestParams onParams(int paramFlag) {\n\t\treturn null;\n\t}", "public bcm a(World paramaqu, int paramInt)\r\n/* 17: */ {\r\n/* 18: 37 */ return null;\r\n/* 19: */ }", "public void setArgs0(java.lang.String param) {\r\n localArgs0Tracker = true;\r\n\r\n this.localArgs0 = param;\r\n\r\n\r\n }", "public void setArgs0(java.lang.String param) {\r\n localArgs0Tracker = true;\r\n\r\n this.localArgs0 = param;\r\n\r\n\r\n }", "public int getFirstParameterIndexForCallString() {\r\n return 1;\r\n }", "public boolean setModeParameter(long arg0) {\n\t\treturn false;\n\t}", "public String a(String paramString, int paramInt)\r\n/* 512: */ {\r\n/* 513:512 */ return a(paramString, paramInt, false);\r\n/* 514: */ }", "private String buildParams(){\n HashMap<String,String> items = new HashMap<>();\n if(paramValid(param1name,param1value))\n items.put(param1name,param1value);\n if(paramValid(param2name,param2value))\n items.put(param2name,param2value);\n if(paramValid(param3name,param3value))\n items.put(param3name,param3value);\n return JsonOutput.toJson(items);\n }", "@Override\n\tpublic boolean isParam() {\n\t\treturn false;\n\t}", "public int a(String paramString, float paramFloat1, float paramFloat2, int paramInt)\r\n/* 234: */ {\r\n/* 235:243 */ return a(paramString, paramFloat1, paramFloat2, paramInt, true);\r\n/* 236: */ }", "@Override\r\n public void setParameter(String parameters) {\r\n // dummy\r\n }", "private static boolean defaultFormalNamedParameter_1(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"defaultFormalNamedParameter_1\")) return false;\n defaultFormalNamedParameter_1_0(b, l + 1);\n return true;\n }", "public String param_id_TRY(Bounds.Inside ph)\n {\n if(ph.field_bit != 22 && !try_visit_field(ph, 22) || !try_visit_item(ph, 0)) return null;\n return new String(param_id_GET(ph, new char[ph.items], 0));\n }", "public int getFormalParameterIndex() {\n/* 401 */ return (this.value & 0xFF0000) >> 16;\n/* */ }", "@Override\n\tpublic String[] getParameterValues(String arg0) {\n\t\treturn null;\n\t}", "public String param_id_TRY(Bounds.Inside ph)\n {\n if(ph.field_bit != 38 && !try_visit_field(ph, 38) || !try_visit_item(ph, 0)) return null;\n return new String(param_id_GET(ph, new char[ph.items], 0));\n }", "public static SendResult check(LinkedHashMap param) {\n\t\tSet<Map.Entry<String, String>> paramsSet = param.entrySet();\r\n\t\tSendResult sr=new SendResult(\"0\",\"\",\"\");\r\n\t\tfor (Map.Entry<String, String> paramEntry : paramsSet) {\r\n\t\t\tString key=paramEntry.getKey();\r\n\t\t\tObject val=paramEntry.getValue();\r\n\t\t\tif(key.equals(\"gatewaycode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10001\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关通讯ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10002\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关通讯ID必须为10位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"gatewaycode2\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10003\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关唯一ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10004\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关唯一ID必须为10位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"roomcode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10005\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁编号不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=4||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10006\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁编号必须为4位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"timeout\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10007\");\r\n\t\t\t\t\tsr.setResultMsg(\"指令超时时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10021\");\r\n\t\t\t\t\tsr.setResultMsg(\"指令超时时间必须为数字\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"pass\") || key.equals(\"password\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10008\");\r\n\t\t\t\t\tsr.setResultMsg(\"密码不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=6||!val.toString().matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10009\");\r\n\t\t\t\t\tsr.setResultMsg(\"密码必须为6位数字\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"count\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10010\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10011\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数必须为0-254数字,0表示不限次数\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"edate\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10012\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().equals(\"-1\")&&(val.toString().length()!=10||!val.toString().matches(\"\\\\d+\"))) {\r\n\t\t\t\t\tsr.setResultCode(\"-10013\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间格式为yyMMddHHmm\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"unlockstime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10014\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10015\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10015\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10015\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"unlocketime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10016\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10017\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10017\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10017\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"callbackurl\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10018\");\r\n\t\t\t\t\tsr.setResultMsg(\"回调地址不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"roomcode2\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10019\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁唯一ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10020\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁唯一ID必须为10位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"openstime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10022\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10023\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10023\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"\\\\d+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10023\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"openetime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10024\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10025\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10025\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10025\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"cardtype\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10026\");\r\n\t\t\t\t\tsr.setResultMsg(\"卡片类型不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().equals(\"开门卡\")&&!val.toString().equals(\"管理卡\")&&!val.toString().equals(\"授权卡\")&&!val.toString().equals(\"身份证\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10027\");\r\n\t\t\t\t\tsr.setResultMsg(\"卡片类型必须为开门卡/管理卡/授权卡/身份证\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"cardcode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10028\");\r\n\t\t\t\t\tsr.setResultMsg(\"卡号不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().equals(\"开门卡\")||val.toString().equals(\"管理卡\")||val.toString().equals(\"授权卡\")) {\r\n\t\t\t\t\tif(val.toString().length()!=8||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tsr.setResultCode(\"-10029\");\r\n\t\t\t\t\t\tsr.setResultMsg(\"开门卡/管理卡/授权卡必须为8位十六进制字符串\");\r\n\t\t\t\t\t\treturn sr;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(val.toString().equals(\"身份证\")) {\r\n\t\t\t\t\tif(val.toString().length()!=16||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tsr.setResultCode(\"-10030\");\r\n\t\t\t\t\t\tsr.setResultMsg(\"身份证必须为16位十六进制字符串\");\r\n\t\t\t\t\t\treturn sr;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"cardedate\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10031\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().equals(\"-1\")&&(val.toString().length()!=10||!val.toString().matches(\"\\\\d+\"))) {\r\n\t\t\t\t\tsr.setResultCode(\"-10032\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间格式为yyMMddHHmm\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"opencount\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10033\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10034\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数必须为0-254数字,0表示不限次数\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"fingercode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10035\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹编号不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=8||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10036\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹编号必须为8位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"fingercontent\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10037\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹特征码不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=988||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10038\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹特征码必须为988位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"actioncount\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10039\");\r\n\t\t\t\t\tsr.setResultMsg(\"开门需按指纹次数不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10040\");\r\n\t\t\t\t\tsr.setResultMsg(\"开门需按指纹次数必须为数字\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"rclist\")) {\r\n\t\t\t}else if(key.equals(\"fpcode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10041\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹机唯一ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"roomimei\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10042\");\r\n\t\t\t\t\tsr.setResultMsg(\"IMEI不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"locktype\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10043\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁类型不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.equals(\"1\") && !val.equals(\"2\") && !val.equals(\"3\") && !val.equals(\"4\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10044\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁类型不存在\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sr;\r\n\t}", "public Tipo visitParameter(DECAFParser.ParameterContext ctx){\r\n\t\tVarDec var =new VarDec(ctx.ID().getText(),tablaSimbolos.searchTipo(ctx.parameterType().getText()),0,position);\r\n\t\tfirmaA.addParam(var);\r\n\t\taddComment(\"paramname: \"+var.getNombre()+\"-position: \"+position);\r\n\t\tposition+=var.getByteSize();\r\n\t\treturn tablaSimbolos.correct();\r\n\t}", "int getNumParameters();", "public Final_parametre() {\r\n\t}", "int parseParam(OpCode opcode, String param) {\n\t\tObject oparam = opcode.parseParam(param, typeByName);\n\n\t\tswitch (opcode) {\n\t\tcase NEW:\n\t\t\treturn bdsvm.addType((Type) oparam);\n\n\t\tcase ADDSM:\n\t\tcase NODE:\n\t\t\treturn ((int) oparam);\n\n\t\tdefault:\n\t\t\treturn bdsvm.addConstant(oparam);\n\t\t}\n\t}", "protected void a(int paramInt1, int paramInt2, boolean paramBoolean, EntityPlayer paramahd) {}", "static int type_of_adi(String passed){\n\t\treturn 1;\n\t}", "protected void a(int paramInt1, int paramInt2, boolean paramBoolean, yz paramyz) {}", "@Override\n public void setParameterMap(Map arg0) {\n\n }", "public void setArgs0(Facts param) {\r\n localArgs0Tracker = true;\r\n\r\n this.localArgs0 = param;\r\n\r\n\r\n }", "public void setArgs0(Facts param) {\r\n localArgs0Tracker = true;\r\n\r\n this.localArgs0 = param;\r\n\r\n\r\n }", "protected void initDefaultParameters(String name) {\n\t\t// default parameter - name\n\t\tCaselessParameter cslpar =\n\t\t\tnew CaselessParameter(ISchemaComponent.KEY_NAME, false, new Caseless(name));\n\t\tcslpar.setParameterEvent(new NameChanger());\n\t\tparameters.addParameter(cslpar);\n\t\t\n\t\t// default parameter - component orientation\n\t\tGenericParameter<Orientation> orientpar =\n\t\t\tnew GenericParameter<Orientation>(ISchemaComponent.KEY_ORIENTATION, false,\n\t\t\t\t\tnew Orientation());\n\t\torientpar.getConstraint().setPossibleValues(Orientation.allAllowed);\n\t\tparameters.addParameter(orientpar);\n\t}", "public int a(String paramString, int paramInt1, int paramInt2, int paramInt3)\r\n/* 239: */ {\r\n/* 240:247 */ return a(paramString, (float)paramInt1, (float)paramInt2, paramInt3, false);\r\n/* 241: */ }", "public void param(int direccionValorParam, int numeroParam){\n String valorParam = \"\";\n //traduce casos de direccionamiento indirecto\n direccionValorParam = traduceDirIndirecto(direccionValorParam);\n // obtener la direccion de la variable parametrizada en el procedimiento llamado\n int dirParamRegistro = this.directorioProcedimientos.\n obtenerProcedimientoPorId(this.pilaEras.peek().\n getIdentificadorProcedimiento()).getDireccionParametros().get(numeroParam);\n\n if (ManejadorMemoria.isGlobal(direccionValorParam)){\n // obtener el valor del parametro enviado\n valorParam = this.registroGlobal.getValor(direccionValorParam);\n\n } else if (ManejadorMemoria.isConstante(direccionValorParam)){\n // REVISAR QUE NO SEA UN PARAMETRO POR REFERENCIA\n if (this.directorioProcedimientos.\n obtenerProcedimientoPorId(this.pilaEras.peek().\n getIdentificadorProcedimiento()).getIndicadorPorReferencia().get(numeroParam)){\n // ERROR\n throw new IllegalArgumentException();\n }\n // obtener el valor del parametro enviado\n valorParam = this.directorioProcedimientos.getConstantes().get(direccionValorParam).getValorConstante();\n\n } else { // VARIABLE LOCAL\n // obtener el valor del parametro enviado\n valorParam = this.pilaRegistros.peek().getValor(direccionValorParam);\n }\n // asignar el valor del parametro a su variable correspondiente\n this.pilaEras.peek().guardaValor(dirParamRegistro, valorParam);\n }", "private static void variosParametros(String nombre, int ... numeros){\n System.out.println(\"nombre = \" + nombre);\n imprimirNumeros(numeros);\n }", "public void Metodo1(String valor1){\r\n\r\n }", "private Map<String, String> paramHandler(Map<String, String> params){\n\t\t\n\t\treturn params;\n\t}", "void mapChosen(int map);", "static int type_of_inx(String passed){\n\t\treturn 1;\n\t}", "public String param_id_TRY(Bounds.Inside ph)\n {\n if(ph.field_bit != 8 && !try_visit_field(ph, 8) || !try_visit_item(ph, 0)) return null;\n return new String(param_id_GET(ph, new char[ph.items], 0));\n }", "@Override\n\tprotected void validateParameterValues() {\n\t\t\n\t}", "private void recogerParametros(HttpServletRequest request) {\r\n\t\tif (request.getParameter(\"op\") != null) {\r\n\t\t\top = Integer.parseInt(request.getParameter(\"op\"));\r\n\t\t} else {\r\n\t\t\top = 0;\r\n\t\t}\r\n\t\t\r\n\t\tsearch = (request.getParameter(\"search\") != null) ? request.getParameter(\"search\") : \"\";\r\n\r\n\t\tif (request.getParameter(\"id\") != null) {\r\n\t\t\tid = Integer.parseInt(request.getParameter(\"id\"));\r\n\t\t} else {\r\n\t\t\tid = -1;\r\n\t\t}\r\n\r\n\t\tif (request.getParameter(\"nombre\") != null) {\r\n\t\t\t\r\n\t\t\tnombre = request.getParameter(\"nombre\");\r\n\t\t\tnombre = Utilidades.limpiarEspacios(nombre);\r\n\t\t\tnombre = nombre.substring(0, Math.min(nombre.length(), 44));\r\n\t\t} else {\r\n\t\t\tnombre = \"\";\r\n\t\t}\r\n\r\n\t\tif (request.getParameter(\"precio\") != null) {\r\n\t\t\ttry{\r\n\t\t\t\tprecio = Float.parseFloat(request.getParameter(\"precio\"));\r\n\t\t\t}\r\n\t\t\tcatch( Exception e){\r\n\t\t\t\tprecio=PRECIO_EN_LETRA;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} else {\r\n\t\t\tprecio = 0;\r\n\t\t}\r\n\t\tif(request.getParameter(\"id_usuario\")!=null) {\r\n\t\t\tusuario=daoUsuario.getById(Integer.parseInt(request.getParameter(\"id_usuario\")));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tusuario=new Usuario();\r\n\t\t}\r\n\t\tif(request.getParameter(\"id_usuario_cambio\")!=null) {\r\n\t\t\tusuario=daoUsuario.getById(Integer.parseInt(request.getParameter(\"id_usuario_cambio\")));\r\n\t\t}\r\n\t\telse {\r\n\t\t\tusuario=new Usuario();\r\n\t\t}\r\n\t}", "protected Integer getIntParam(HttpServletRequest request, String name) {\r\n String[] p = request.getParameterValues(name);\r\n \r\n Integer result = null;\r\n \r\n try{\r\n if (p != null) {\r\n \t//TODO: add the apache common package for pom.xml\r\n// result = NumberUtils.createInteger(p[0]);\r\n }\r\n }catch(NumberFormatException ex){\r\n \r\n }\r\n return result;\r\n }", "bdm mo1784a(akh akh);", "public abstract boolean a(e parame, b paramb, int paramInt1, int paramInt2);", "@Override\n\tpublic int parametersCount() {\n\t\treturn 0;\n\t}", "abstract int estimationParameter1();", "static int type_of_lda(String passed){\n\t\treturn 1;\n\t}", "static int type_of_cm(String passed){\n\t\treturn 1;\n\t}", "private static boolean defaultFormalNamedParameter_1_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"defaultFormalNamedParameter_1_0\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = defaultFormalNamedParameter_1_0_0(b, l + 1);\n r = r && expression(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "public String param_id_TRY(Bounds.Inside ph)\n {\n if(ph.field_bit != 32 && !try_visit_field(ph, 32) || !try_visit_item(ph, 0)) return null;\n return new String(param_id_GET(ph, new char[ph.items], 0));\n }", "public String getParameter(String name) throws IllegalArgumentException {\n\t if ( LogWriter.needsLogging(LogWriter.TRACE_DEBUG))\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"getParameter() \" \n\t\t+ name);\n Via via=(Via)sipHeader;\n \n if (name == null) throw new\n IllegalArgumentException(\"JAIN-EXCEPTION: null argument\");\n return via.getParameter(name);\n }", "int getParamType(String type);", "boolean match(String mnemonic, ParameterType[] parameters);", "public String param(String id) {\n if (online) return super.param(id);\n else return (String)params.get(id);\n}", "public Setparam() {\r\n super();\r\n }", "@Override\n\tprotected void prepare() {\n\t\t\n\t\t\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\tif (para[i].getParameter() == null);\n\t\t\t\n\t\t\telse if(name.equals(\"AD_Client_ID\"))\n\t\t\t\tp_AD_Client_ID = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"AD_Org_ID\"))\n\t\t\t\tp_AD_Org_ID = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param01\"))\n\t\t\t\tparam_01 = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param02\"))\n\t\t\t\tparam_02 = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param03\"))\n\t\t\t\tparam_03 = (String)para[i].getParameterAsString();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param04\"))\n\t\t\t\tparam_04 = (String)para[i].getParameterAsString();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param05\"))\n\t\t\t\tparam_05 = (Timestamp)para[i].getParameterAsTimestamp();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param06\"))\n\t\t\t\tparam_06 = (Timestamp)para[i].getParameterAsTimestamp();\n\t\t\t\n\t\t\telse if(name.equals(\"AD_User_ID\"))\n\t\t\t\tp_AD_User_ID = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"Report\"))\n\t\t\t\tp_Report = (int)para[i].getParameterAsInt();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"lapangan\", lapangan);\n params.put(\"jam\", jam);\n params.put(\"durasi\", durasi);\n\n return params;\n }", "@Override\r\n\tpublic int getInt(int arg) {\n\t\treturn 0;\r\n\t}", "protected abstract Boolean applicable(Map<String, Object> parameters);", "private void addParameter(int param) {\r\n command_parameters.addInt(param);\r\n }", "static int type_of_cmc(String passed){\n\t\treturn 1;\n\t}", "String getParam( String paraName );", "private void countParams() {\n if( paramCount >= 0 ) {\n return;\n }\n Iterator<AnyType> parser = name.getSignature( types );\n paramCount = needThisParameter ? 1 : 0;\n while( parser.next() != null ) {\n paramCount++;\n }\n valueType = parser.next();\n while( parser.hasNext() ) {\n valueType = parser.next();\n paramCount--;\n }\n }", "boolean hasParameters();" ]
[ "0.60155195", "0.57763416", "0.57763416", "0.57763416", "0.57763416", "0.5687356", "0.5675565", "0.56588393", "0.56390876", "0.56201273", "0.56181586", "0.5601303", "0.5574562", "0.5560959", "0.5557604", "0.5557604", "0.5557604", "0.5557604", "0.5516038", "0.5486353", "0.5457099", "0.5433926", "0.53810376", "0.537113", "0.53657067", "0.53409266", "0.53286433", "0.5327018", "0.53177124", "0.5305743", "0.5288107", "0.5285362", "0.52819693", "0.5280316", "0.5275577", "0.52393544", "0.52189076", "0.5207731", "0.5203126", "0.52006125", "0.5196304", "0.51863414", "0.51780504", "0.51780504", "0.5166274", "0.5164707", "0.5152804", "0.51136374", "0.51134074", "0.51130337", "0.509929", "0.50931066", "0.5092825", "0.50844556", "0.5084054", "0.507814", "0.5077016", "0.50563556", "0.5055731", "0.50421226", "0.5040421", "0.5040409", "0.5039531", "0.5035824", "0.5029035", "0.50073177", "0.50073177", "0.5004451", "0.49975774", "0.49963245", "0.49850833", "0.49822626", "0.49811912", "0.4974598", "0.49719837", "0.497051", "0.4966091", "0.49639788", "0.49563593", "0.49558455", "0.49546254", "0.49539775", "0.4952078", "0.49442178", "0.49437475", "0.49406147", "0.49390513", "0.49360058", "0.49258074", "0.4920071", "0.49108854", "0.49057233", "0.4903076", "0.4902133", "0.49019274", "0.48973116", "0.4891334", "0.48905972", "0.48877582", "0.48863703", "0.48832026" ]
0.0
-1
/ This method takes a data String and returns a predefined value if empty If data Sting is null, returns string "No Value Returned", else returns input
private static String null2unknown(String in) { if (in == null || in.length() == 0) { return null; } else { return in; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getOutputDataValue(String inputData) {\n\t\tString outputDataValue = inputData;\n\t\tif (!outputDataValue.isEmpty() && modificationRequired) {\n\t\t\toutputDataValue = modify(outputDataValue);\n\t\t}\n\t\tif (!outputDataValue.isEmpty() && translationRequired) {\n\t\t\toutputDataValue = translate(outputDataValue);\n\t\t}\n\t\tif (outputDataValue.isEmpty() && !defaultValue.isEmpty()) {\n\t\t\toutputDataValue = defaultValue;\n\t\t}\n\t\tif (!outputDataValue.isEmpty() && replaceNonPrintableCharacters) {\n\t\t\toutputDataValue = replaceNonPrintableCharacters(outputDataValue);\n\t\t}\n\t\t//System.out.println(\"Output data value for \" + dataItemName + \" is \" + outputDataValue);\t\n\t\treturn outputDataValue;\n\t}", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String displayNull (String input)\r\n {\r\n //because of short circuiting, if it's null, it never checks the length.\r\n if (input == null || input.length() == 0)\r\n return \"N/A\";\r\n else\r\n return input;\r\n }", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "private String getStringOrNull (String value) {\n if (value == null || value.isEmpty()) value = null;\n return value;\n }", "public String getValueOfArg() {\n\t\tif(index > data.length -1) return null;\n\t\t\n\t\twhile(isBlank()) {\n\t\t\tindex ++;\n\t\t}\n\t\t\n\t\tif(data[index] == '\\\"') {\n\t\t\tindex++;\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\twhile(index < data.length-1 && data[index] != '\\\"') {\n\t\t\t\tif(data[index] == '\\\\' && isEscape(data, index)) {\t\t\t\t\t\t\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tbuilder.append(data[index]);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn builder.toString();\n\t\t}\n\t\t\n\t\tif(Character.isLetter(data[index])){\t\t\n\t\t\treturn textValue();\n\t\t}\n\t\t\n\t\tthrow new IllegalArgumentException(\"Illegal arguments found!\");\n\t}", "org.hl7.fhir.String getValueString();", "public String getData() {\r\n Scanner sc = new Scanner(System.in);\r\n String s = sc.nextLine();\r\n while ((s.startsWith(\"\") && s.endsWith(\" \")) || (s.length() == 0) || (s.startsWith(\" \"))) {\r\n System.out.print(\"A space record, or a space at the beginning is not acceptable. \\n\"\r\n + \"Please try again: \");\r\n s = sc.nextLine();\r\n }\r\n return s;\r\n }", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getValue();", "String getFirstValue()\n {\n String value = \"0\";\n if (miscData.size() > 0)\n {\n String firstVal = miscData.get(0);\n if (firstVal.equals(ERC20_APPROVE_ALL))\n {\n value = \"All\"; //Can't localise here because no App context.\n }\n else\n {\n //convert to big integer\n BigInteger bi = new BigInteger(miscData.get(0), 16);\n value = bi.toString(10);\n }\n }\n return value;\n }", "java.lang.String getStringValue();", "java.lang.String getStringValue();", "String getStringValue();", "String getStringValue();", "public String verifyBlankValue(String object, String data) {\n\t\tlogger.debug(\"Verifying the text\");\n\t\ttry {\n\n\t\t\tString actual = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object)))).getText().trim();\n\t\t\tlogger.debug(\"act\" + actual);\n\t\t\tif (actual.length() == 0)\n\t\t\t\treturn Constants.KEYWORD_PASS;\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \" -- Some Value Present\";\n\t\t} \ncatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + \" Object not found \" + e.getMessage();\n\t\t}\n\t}", "java.lang.String getData();", "private String getValue(String s)\n {\n if(s.contains(\",\"))\n {\n return s.split(\",\")[0];\n }\n else\n {\n s = s.replaceAll(\"\\\\)\",\"\");\n return s;\n }\n }", "java.lang.String getOptionalValue();", "private static String getPropertyValueOrDefault(String value) {\n return value != null ? value : \"\";\n }", "public static String dato(){\n String dato=null;\n \n try {\n Scanner leer=new Scanner(System.in);\n dato=leer.next();\n } catch (Exception e) {\n System.out.println(\"Error: \" + e.getMessage());\n }\n return dato;\n }", "private String notNull(String value) {\n return value != null ? value : \"\";\n }", "static boolean containsNoData(String str) {\n return \"\".equals(str) || \"-\".equals(str);\n }", "public String verifyNullValue(String object, String data) {\n\t\tlogger.debug(\"Verifying the Textbox text is null\");\n\t\ttry {\n\t\t\tdata = \"\";\n\t\t\tString actual = wait.until(explicitWaitForElement(By.xpath(OR.getProperty(object)))).getAttribute(OR.getProperty(\"ATTRIBUTE_VALUE\"));\n\t\t\tString expected = data;\n\n\t\t\tlogger.debug(\"actual\" + actual);\n\t\t\tlogger.debug(\"expected\" + expected);\n\t\t\tif (actual.equals(expected))\n\t\t\t\treturn Constants.KEYWORD_PASS;\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \" -- text not verified--\" + actual + \" -- \" + expected;\n\t\t} \ncatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\t\n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + \" Object not found \" + e.getMessage();\n\t\t}\n\t}", "private static String filterJsonTotalInput(String input) {\n if (input.equals(\"null\")) {\n return total;\n }\n return input;\n }", "String getValueAsString();", "String getValueText();", "public String get(String data)\r\n\t{\n\t\t\r\n\t\tStringTokenizer st = new StringTokenizer(data);\r\n\t\t\r\n\t\twhile (st.hasMoreTokens()) {\r\n\t\t\tif(st.nextToken().startsWith(\"Room\")){\r\n\t\t\t\troom = st.nextToken(\":\").trim();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn(room);\r\n\t}", "String getDefaultValue();", "String getDefaultValue();", "public static String checkNull(String string1, String string2, String string3) {\n if (string1 != null)\n return string1;\n else if (string2 != null)\n return string2;\n else if (string3 != null)\n return string3;\n else\n return \"\";\n }", "public String getStringValue();", "protected String value () throws HTMLParseException {\r\n while (nextToken == EQUALS) {\r\n match (EQUALS);\r\n if (nextToken == STRING ||\r\n nextToken == SQSTRING ||\r\n nextToken == DQSTRING) {\r\n String val = stringValue;\r\n match (nextToken);\r\n return val;\r\n }\r\n return \"\";\r\n }\r\n return null;\r\n }", "private String getResult() {\n String result;\n if (location == null && requireGeolocation) {\n result = null;\n } else if (textEntry.isEnabled() && textEntry.getVisibility() == View.VISIBLE && !textEntry.getText().toString().isEmpty()\n && textEntry.getText().toString().matches(\"\\\\d+\")) {\n result = textEntry.getText().toString();\n } else if (radioButtons.getCheckedRadioButtonId() != -1) {\n result = radioButtons.getCheckedRadioButtonId() == R.id.radio_success ? \"true\" : \"false\";\n } else {\n // Result is not valid\n result = null;\n }\n return result;\n }", "private static float checkNull(String current) {\n if (current.equals(NULLSTR)) {\n return ZERO;\n } else {\n return Float.parseFloat(current);\n }\n }", "private String validateString(String data, String defaultValue, int minLength, int maxLength)\n {\n return (data.length() < minLength || data.length() > maxLength) ? defaultValue : data;\n }", "public String getCustomData(String key, String defaultValue){\n try{\n return customData.getString(key);\n }catch (Exception ignore){\n\n }\n\n return defaultValue;\n }", "public String checkReceivedData(String insertData){\r\n\t\tString insertDataType = \"undefined\";\t\t\r\n\t\t\r\n\t\tif(insertData.startsWith(\"{\"))\r\n\t\t{\r\n\t\t\tinsertDataType =\"json\";\r\n\t\t}\r\n\t\telse if(insertData.contains(\"<swes:InsertSensor\"))\r\n\t\t{\r\n\t\t\tinsertDataType = \"InsertSensor\";\t\t\t\r\n\t\t}\r\n\t\telse if(insertData.contains(\"<sos:InsertObservation\"))\r\n\t\t{\r\n\t\t\tinsertDataType =\"InsertObservation\";\t\t\t\t\t\t\r\n\t\t}\t\t\r\n\t\treturn insertDataType;\r\n\t}", "public String user_string() {\n Scanner input = new Scanner(System.in);\n boolean conditional = true;\n while (conditional) {\n boolean condition = input.hasNextInt();\n if (!condition) {\n String user_input = input.nextLine();\n conditional = false; \n return user_input; \n }\n else {\n System.out.println(\"Invalid Input!\");\n conditional = true;\n input.next();\n }\n }\n return \"0\";\n }", "String getIfElse();", "public String\ngetValueString();", "public String checkNull(String result) {\r\n\t\tif (result == null || result.equals(\"null\")) {\r\n\t\t\treturn \"\";\r\n\t\t} else {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "private String getParameterValue(final String parameterValue, final String defaultValue)\r\n {\r\n if (parameterValue == null || \"\".equals(parameterValue.trim()))\r\n {\r\n return defaultValue;\r\n }\r\n return parameterValue;\r\n }", "String getZero_or_one();", "private String getCellValue(Cell cell) {\r\n String value = null;\r\n if (cell != null) {\r\n CellValue cellValue = evaluator.evaluate(cell);\r\n if (cellValue != null) {\r\n switch (cellValue.getCellType()) {\r\n case NUMERIC:\r\n value = String.valueOf(cell.getNumericCellValue());\r\n break;\r\n case STRING:\r\n value = cell.getStringCellValue();\r\n break;\r\n case BLANK:\r\n break;\r\n case ERROR:\r\n break;\r\n default:\r\n value = cell.getStringCellValue();\r\n break;\r\n }\r\n }\r\n }\r\n return value;\r\n }", "public static String checkNull(String string1, String string2, String string3, String string4) {\n if (string1 != null)\n return string1;\n else if (string2 != null)\n return string2;\n else if (string3 != null)\n return string3;\n else if (string4 != null)\n return string4;\n else\n return \"\";\n }", "@Required\n @NotNull\n String getValue();", "private boolean hasValue (String s) { return s != null && s.length() != 0; }", "private static String getValue(Object o) {\n if (o != null) {\n return o.toString();\n }\n return \"null\";\n }", "public final String nullSafeGetString(final JSONObject data, final String key) {\n if ( data.get(key) != null ) {\n return data.get(key).toString();\n } else {\n return \"null\";\n }\n }", "private String retrieveValue(String key, ChartParameters params) {\r\n\t\tString result = params.getValue(key);\r\n\r\n\t\tif(result.equals(\"\")){\r\n\t\t\tthrow new NoResultException(\"value not retrieved\");\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "public String getString() {\r\n\t\tString s = value.getString();\r\n\t\t// System.out.println(\"Getting string of: \" + s);\r\n\t\tif (s == null)\r\n\t\t\treturn (s);\r\n\t\treturn (substitution(s));\r\n\t}", "public String getData(String rawData){\n\t\treturn \"1\";\n\t}", "public abstract String getValue();", "public abstract String getValue();", "public abstract String getValue();", "String getVal();", "String getData();", "private String setNullIfEmpty(String in) {\n if (in != null && in.trim().length() == 0) {\n return null;\n }\n return in;\n }", "@Override\r\n public Object getValueFromString(String text_p) throws Exception\r\n {\n return null;\r\n }", "public String getValue()\r\n\t{\r\n\t\tString value = textField.getText();\r\n\t\treturn value==null || value.length()==0 ? null : value;\r\n\t}", "public static String notNull(String p_in) {\n\t\tString ret = p_in;\n\t\tif (ret==null) ret=\"\";\n\t\treturn ret;\n\n\t}", "@Override\n public Data build(String input) {\n return null;\n }", "private String getStringValue(Object o) {\n if (o instanceof String) {\n return (String) o;\n } else if (o instanceof NodeArray) {\n NodeArray array = (NodeArray) o;\n switch (array.size()) {\n case 0:\n return null;\n case 1: {\n return getStringValue(array.get(0));\n }\n default:\n return getStringValue(array);\n }\n } else if (o instanceof Node) {\n return getStringValue((Node) o);\n } else if (o != null) {\n return o.toString();\n }\n return null;\n }", "public String getValue2();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "java.lang.String getSearchValue();", "private String defaultString(String sValue, String sDefault) {\n if (sValue == null || sValue.length() == 0)\n return sDefault;\n\n return sValue;\n }", "private String getDefaultValue(String str, String def) {\r\n\t\tif ( (str != null) && (str.length() > 0)) {\r\n\t\t\treturn str;\r\n\t\t}\r\n\t\treturn def;\r\n\t}", "private static String checkInputParamType(InputParam inputParam) {\r\n\t\tString type = inputParam.getType();\r\n\t\tString value = null;\r\n\t\tswitch (type) {\r\n\t\tcase BPConstant.STRING:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getStringValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.BOOLEAN:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getBooleanValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.DATE_TIME:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getDateValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.NUMBER:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getIntValue();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tvalue = BPConstant.EMPTY_STRING;\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "public static String getVariable(){\n Scanner kb = new Scanner(System.in);\n String variable = null;\n\n System.out.println(\"Enter the variable you would like to solve for: \");\n variable = kb.nextLine().toLowerCase();\n\n // check to make sure it is a valid variable name\n if( !variable.equals(\"height\") && !variable.equals(\"volume\") && !variable.equals(\"radius\")){\n System.out.println(\"Please enter in a valid variable (i.e. height, volume, or radius)...\");\n getVariable();\n }\n\n return variable;\n }", "public String get(String content)\n {\n String nValue = \"\";\n \n try {\n FileInputStream input;\n if(Global.dataFile ==null)\n {\n input = new FileInputStream(Global.workDir+\"\\\\TestData\\\\licensing.xls\");\n }\n else if((Global.dataFile.equals(\"\")))\n {\n input = new FileInputStream(Global.workDir+\"\\\\TestData\\\\licensing.xls\");\n }\n else\n {\n input = new FileInputStream(Global.dataFile);\n }\n HSSFWorkbook wb = new HSSFWorkbook(input);\n HSSFSheet sheet = wb.getSheetAt(0);\n nValue = findValue(sheet, content);\n return nValue;\n } catch (Exception e) {\n // TODO Auto-generated catch block\n// e.printStackTrace();\n return nValue=\"\";\n } \n }", "public static String getValueOrDefault(String value, String defaultValue) {\n return value != null && !value.isEmpty() ? value : defaultValue;\n }", "String getValue(String param)\n\t{\n\t\tString value = null;\n\n\t\tif (userSupplied != null && (value = this.userSupplied.get(param)) != null)\n\t\t{\n\t\t\treturn value;\n\t\t}\n\n\t\tElement element = this.parameters.get(param);\n\t\tif (element == null)\n\t\t{\n\t\t\tlog.debug(\"PISE FILE ERROR, expression uses undefined parameter: \" + param);\n\t\t\treturn null;\n\t\t} \n\t\t// When one parameter has an expression that references the value of a disabled parameter\n\t\t// return \"0\" if it's a switch or \"\" for anything else. Similar to what the gui does in\n\t\t// code generator pise2JSP.ftl getValue() function.\n\t\tif (!element.enabled) \n\t\t{\n\t\t\tif (element.type.equals(\"Switch\"))\n\t\t\t{\n\t\t\t\tlog.debug(\"\\tGETVALUE of disabled parameter: \" + param + \" returns '0'\");\n\t\t\t\treturn \"0\";\n\t\t\t} else\n\t\t\t{\n\t\t\t\tlog.debug(\"\\tGETVALUE of disabled parameter: \" + param + \" returns ''\");\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t\treturn element.value;\n\t}", "public static String mapEmptyToNull(String strIn)\r\n {\r\n if (strIn == null || strIn.trim().equals(\"\"))\r\n {\r\n return null;\r\n }\r\n return strIn;\r\n }", "public static String checkEmpty(String string1, String string2, String string3) {\n if (string1 != null && string1.length() > 0)\n return string1;\n else if (string2 != null && string2.length() > 0)\n return string2;\n else if (string3 != null && string3.length() > 0)\n return string3;\n else\n return \"\";\n }", "public String getValue(String s) {\n return s;\n }" ]
[ "0.71635205", "0.62442744", "0.62442744", "0.62287766", "0.6199608", "0.60750586", "0.60750586", "0.60750586", "0.60750586", "0.60750586", "0.60750586", "0.6063433", "0.60474706", "0.6047064", "0.5971488", "0.5967495", "0.5967495", "0.5967495", "0.5967495", "0.5967495", "0.5967495", "0.5967495", "0.5967495", "0.5967495", "0.5967495", "0.5937343", "0.59185755", "0.59185755", "0.5895591", "0.5895591", "0.585378", "0.57470554", "0.56886715", "0.56605285", "0.5624294", "0.55988294", "0.5595094", "0.55459183", "0.5510462", "0.5503614", "0.5501658", "0.5500031", "0.5496913", "0.54789287", "0.54789287", "0.547164", "0.5459468", "0.5439094", "0.5431512", "0.5402631", "0.5400167", "0.53976256", "0.5395528", "0.5393172", "0.5385419", "0.5375008", "0.53711206", "0.53505164", "0.53361", "0.5319022", "0.5317826", "0.53117776", "0.5311373", "0.53097516", "0.5306674", "0.52942556", "0.5292946", "0.5292657", "0.5285276", "0.5285276", "0.5285276", "0.5285239", "0.52787733", "0.5277569", "0.52713984", "0.526237", "0.5260803", "0.52569574", "0.52538484", "0.52493405", "0.5242836", "0.5242836", "0.5242836", "0.5242836", "0.5242836", "0.5242836", "0.5242836", "0.5242836", "0.5242836", "0.5239759", "0.52389985", "0.52262264", "0.522067", "0.5213374", "0.52073735", "0.5196401", "0.51949894", "0.51933837", "0.5180233", "0.5175205" ]
0.5778683
31
null2unknown() / This function uses the returned status code retrieved from the Digital Response and returns an appropriate description for the code
String getResponseDescription(String vResponseCode) { String result = ""; // check if a single digit response code if (vResponseCode.length() != 1) { // Java cannot switch on a string so turn everything to a char char input = vResponseCode.charAt(0); switch (input) { case '0': result = "Transaction Successful"; break; case '1': result = "Unknown Error"; break; case '2': result = "Bank Declined Transaction"; break; case '3': result = "No Reply from Bank"; break; case '4': result = "Expired Card"; break; case '5': result = "Insufficient Funds"; break; case '6': result = "Error Communicating with Bank"; break; case '7': result = "Payment Server System Error"; break; case '8': result = "Transaction Type Not Supported"; break; case '9': result = "Bank declined transaction (Do not contact Bank)"; break; case 'A': result = "Transaction Aborted"; break; case 'C': result = "Transaction Cancelled"; break; case 'D': result = "Deferred transaction has been received and is awaiting processing"; break; case 'F': result = "3D Secure Authentication failed"; break; case 'I': result = "Card Security Code verification failed"; break; case 'L': result = "Shopping Transaction Locked (Please try the transaction again later)"; break; case 'N': result = "Cardholder is not enrolled in Authentication Scheme"; break; case 'P': result = "Transaction has been received by the Payment Adaptor and is being processed"; break; case 'R': result = "Transaction was not processed - Reached limit of retry attempts allowed"; break; case 'S': result = "Duplicate SessionID (OrderInfo)"; break; case 'T': result = "Address Verification Failed"; break; case 'U': result = "Card Security Code Failed"; break; case 'V': result = "Address Verification and Card Security Code Failed"; break; case '?': result = "Transaction status is unknown"; break; default: result = "Unable to be determined"; } return result; } else { return "No Value Returned"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ResponseStatus(int code) {\n this.code = code;\n this.formatted = format(code, \"???\");\n this.symbolicName = String.format(\"0x%04x\", code);\n }", "abstract Integer getStatusCode();", "private String getRespDesc(String _code)\r\n {\r\n int resultCode = -1;\r\n\r\n try\r\n {\r\n resultCode = Integer.valueOf(_code);\r\n } catch (NumberFormatException e)\r\n {\r\n // just in case the code isn't a number\r\n return \"Format of RESULT code unexpected\";\r\n }\r\n\r\n if (resultCode < 0)\r\n {\r\n return \"Communication error\";\r\n }\r\n\r\n String ret = \"unknown\";\r\n switch (resultCode)\r\n {\r\n case 0:\r\n ret = \"Approved\";\r\n break;\r\n case 1:\r\n ret = \"User authentication failed\";\r\n break;\r\n case 2:\r\n ret = \"Invalid tender type\";\r\n break;\r\n case 3:\r\n ret = \"Invalid transaction type\";\r\n break;\r\n case 4:\r\n ret = \"Invalid amount format\";\r\n break;\r\n case 5:\r\n ret = \"Invalid merchant information\";\r\n break;\r\n case 6:\r\n ret = \"Invalid or unsupported currency code\";\r\n break;\r\n case 7:\r\n ret = \"Field format error\";\r\n break;\r\n case 8:\r\n ret = \"Not a transaction server\";\r\n break;\r\n case 9:\r\n ret = \"Too many parameters or invalid stream\";\r\n break;\r\n case 10:\r\n ret = \"Too many line items\";\r\n break;\r\n case 11:\r\n ret = \"Client time-out waiting for response\";\r\n break;\r\n case 12:\r\n ret = \"Declined\";\r\n break;\r\n case 13:\r\n ret = \"Referral\";\r\n break;\r\n case 19:\r\n ret = \"Original transaction ID not found\";\r\n break;\r\n case 20:\r\n ret = \"Cannot find the customer reference number\";\r\n break;\r\n case 22:\r\n ret = \"Invalid ABA number\";\r\n break;\r\n case 23:\r\n ret = \"Invalid account number\";\r\n break;\r\n case 24:\r\n ret = \"Invalid expiration date\";\r\n break;\r\n case 25:\r\n ret = \"Invalid Host Mapping\";\r\n break;\r\n case 26:\r\n ret = \"Invalid vendor account\";\r\n break;\r\n case 27:\r\n ret = \"Insufficient partner permissions\";\r\n break;\r\n case 28:\r\n ret = \"Insufficient user permissions\";\r\n break;\r\n case 29:\r\n ret = \"Invalid XML document\";\r\n break;\r\n case 30:\r\n ret = \"Duplicate transaction\";\r\n break;\r\n case 31:\r\n ret = \"Error in adding the recurring profile\";\r\n break;\r\n case 32:\r\n ret = \"Error in modifying the recurring profile\";\r\n break;\r\n case 33:\r\n ret = \"Error in canceling the recurring profile\";\r\n break;\r\n case 34:\r\n ret = \"Error in forcing the recurring profile\";\r\n break;\r\n case 35:\r\n ret = \"Error in reactivating the recurring profile\";\r\n break;\r\n case 36:\r\n ret = \"OLTP Transaction failed\";\r\n break;\r\n case 37:\r\n ret = \"Invalid recurring profile ID\";\r\n break;\r\n case 50:\r\n ret = \"Insufficient funds available in account\";\r\n break;\r\n case 51:\r\n ret = \"Exceeds per transaction limit\";\r\n break;\r\n case 99:\r\n ret = \"General error. See RESPMSG.\";\r\n break;\r\n case 100:\r\n ret = \"Transaction type not supported by host\";\r\n break;\r\n case 101:\r\n ret = \"Time-out value too small\";\r\n break;\r\n case 102:\r\n ret = \"Processor not available\";\r\n break;\r\n case 103:\r\n ret = \"Error reading response from host\";\r\n break;\r\n case 104:\r\n ret = \"Timeout waiting for processor response\";\r\n break;\r\n case 105:\r\n ret = \"Credit error\";\r\n break;\r\n case 106:\r\n ret = \"Host not available\";\r\n break;\r\n case 107:\r\n ret = \"Duplicate suppression time-out\";\r\n break;\r\n case 108:\r\n ret = \"Void error\";\r\n break;\r\n case 109:\r\n ret = \"Time-out waiting for host response\";\r\n break;\r\n case 110:\r\n ret = \"Referenced auth (against order) Error\";\r\n break;\r\n case 111:\r\n ret = \"Capture error\";\r\n break;\r\n case 112:\r\n ret = \"Failed AVS check\";\r\n break;\r\n case 113:\r\n ret = \"Merchant sale exceeds the sales cap\";\r\n break;\r\n case 114:\r\n ret = \"Card Security Code (CSC) Mismatch.\";\r\n break;\r\n case 115:\r\n ret = \"System busy, try again later\";\r\n break;\r\n case 116:\r\n ret = \"VPS Internal error\";\r\n break;\r\n case 117:\r\n ret = \"Failed merchant rule check\";\r\n break;\r\n case 118:\r\n ret = \"Invalid keywords found in string fields\";\r\n break;\r\n case 120:\r\n ret = \"Attempt to reference a failed transaction\";\r\n break;\r\n case 121:\r\n ret = \"Not enabled for feature\";\r\n break;\r\n case 122:\r\n ret = \"Merchant sale exceeds the credit cap\";\r\n break;\r\n case 125:\r\n ret = \"Declined by filters\";\r\n break;\r\n case 126:\r\n ret = \"Authorized but triggered a Fraud Filter\";\r\n break;\r\n case 127:\r\n ret = \"Not processed by filters\";\r\n break;\r\n case 128:\r\n ret = \"Declined by merchant\";\r\n break;\r\n case 132:\r\n ret = \"Card has not been submitted for update\";\r\n break;\r\n case 133:\r\n ret = \"Data mismatch in HTTP retry request\";\r\n break;\r\n case 150:\r\n ret = \"Issuing bank timed out\";\r\n break;\r\n case 151:\r\n ret = \"Issuing bank unavailable\";\r\n break;\r\n case 201:\r\n ret = \"Order error\";\r\n break;\r\n case 1000:\r\n ret = \"Generic host error\";\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return ret;\r\n }", "public String badOrMissingResponseData();", "@Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n mCode.setText(R.string.no_code);\n Toast.makeText(getApplicationContext(), R.string.no_code_explanation, Toast.LENGTH_SHORT).show();\n }", "Response.StatusType getStatus(Exception exception);", "int getStatusCode();", "int getStatusCode();", "int getStatusCode( );", "@Override\n protected void handleErrorResponseCode(int code, String message) {\n }", "@Test\n\tpublic void testIncorrectStatusCode() {\n\t\tgiven().\n\t\tget(Endpoint.GET_COUNTRY_invalid).then().statusCode(404);\n\t}", "public abstract int getHttpStatusErrorCode();", "private String httpNotOk() {\n return \"HTTP/1.1 404 not Found\\r\\n\"\n + \"Content-Type: text/html\\r\\n\"\n + \"\\r\\n\"\n + \"<!DOCTYPE html>\\n\"\n + \"<html>\\n\"\n + \"<head>\\n\"\n + \"<meta charset=\\\"UTF-8\\\">\\n\"\n + \"<title>Error</title>\\n\"\n + \"</head>\\n\"\n + \"<body>\\n\"\n + \"<h1>There is an error</h1>\\n\"\n + \"</body>\\n\"\n + \"</html>\\n\";\n }", "public SimpleResponse ERROR_NOT_FOUND() {\n this.state = HttpStatus.NOT_FOUND.value();\n return ERROR_CUSTOM();\n }", "public abstract int statusCode();", "private String getStatusDescription(String vStatus) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vStatus != null && !vStatus.equals(\"\")) {\r\n\r\n\t\t\tif (vStatus.equalsIgnoreCase(\"Unsupported\") || vStatus.equals(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"3DS not supported or there was no 3DS data provided\";\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a\r\n\t\t\t\t// character\r\n\t\t\t\tchar input = vStatus.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'Y':\r\n\t\t\t\t\tresult = \"The cardholder was successfully authenticated.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'E':\r\n\t\t\t\t\tresult = \"The cardholder is not enrolled.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"The cardholder was not verified.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"The cardholder's Issuer was unable to authenticate due to some system error at the Issuer.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'F':\r\n\t\t\t\t\tresult = \"There was an error in the format of the request from the merchant.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'A':\r\n\t\t\t\t\tresult = \"Authentication of your Merchant ID and Password to the ACS Directory Failed.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'D':\r\n\t\t\t\t\tresult = \"Error communicating with the Directory Server.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'C':\r\n\t\t\t\t\tresult = \"The card type is not supported for authentication.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"The signature on the response received from the Issuer could not be validated.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'P':\r\n\t\t\t\t\tresult = \"Error parsing input from Issuer.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'I':\r\n\t\t\t\t\tresult = \"Internal Payment Server system error.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "Object getNilReason();", "Pokemon.ResponseEnvelop.Unknown6.Unknown2 getUnknown2();", "public static ResponseStatus valueOf(int code) {\n code = code & 0xFFFF; // convert negative shorts to unsigned\n if (code < 256) {\n ResponseStatus status = values[code];\n if (status != null) {\n return status;\n }\n }\n return new ResponseStatus(code);\n }", "public interface HttpCode {\n\n int NO_RESOURCE = 404;\n int SUCCESS = 200;\n int NO_TOKEN_HEADER = 401;\n int NO_TOKEN_FOUND = 403;\n int SYSTEM_EXCEPTION = 500;\n int NO_ACCOUNT_PROJECT = 402;\n int NO_ACCOUNT_NORMAL = 405;\n int ACCOUNT_OVERDUE = 406;\n int ERROR_ACCOUN_TOKEN = 407;\n int NO_RESOURCE_RIGHT = 408;\n int NO_EXAM_TIMES = 40601;\n int NO_KNOWLEDEG_TIMES = 40501;\n int NO_COURSE_TIME = 40801;\n int NO_COURSE_RIGHT = 40802;\n int SYSTEM_ERROR_REJECT = 409;\n int SYSTEM_ERROR_REFRESH_REPEAT = 410;\n int BUSINESS_ERROR_REPEAT = 411;\n int BUSINESS_ERROR_REFRESH_TOO_FAST = 412;\n int SMS_VERIFYCODE_NEED_WAIT = 40101;\n int SMS_NO_TEMPLATE = 40102;\n int SMS_NO_SEND_TIMES = 40103;\n int VERIFYCODE_DIFFERENT = 40104;\n int VERIFYCODE_NO_MORE_CHECKTIMES = 40105;\n int VERIFYCODE_EXPIRE = 40106;\n int SMS_NO_TELEPHONE = 40107;\n int VERIFYCODE_NULL = 40108;\n int SMS_SUCCESS = 20101;\n int HAS_NULL_REQUEST_PARAM = 413;\n int TOO_LONG_LENGTH = 414;\n int TOO_SHORT_LENGTH = 415;\n\n //公共功能\n int NO_RULE_FOUND = 40001;\n int NO_RULE_HANDLER_FOUND = 40002;\n int NO_ACCOUNT_FOUND = 40003;\n\n //用户登录(03)\n int FIND_PASSWORD_SUCCESS = 20301;\n int CHECK_USER_LOGIN_FAILURE = 40301;\n int CHECK_LOGINFORM_FAILURE = 40302;\n int CHECK_FIND_PASSWORD_FORM_FAILURE = 40303;\n int CHECK_USER_BY_TELEPHONE_FAILURE = 40304;\n int USER_TELEPHONE_ISNULL_CODE = 40305;\n int USER_LOGIN_SUCCESS_CODE = 40306;\n\n //用户中心(04)\n int MODIFY_USERINFO_SUCCESS = 20401;\n int MODIFY_PASSWORD_SUCCESS = 20402;\n int CHECK_OLD_PASSWORD_FAILURE = 40401;\n int CHECK_MODIFY_PASSWORD_FORM_FAILURE = 40402;\n int CHECK_USERINFO_FORM_FAILURE = 40403;\n int CHECK_BIND_MOBILE_FAILURE = 40404;\n int REPETITION_BIND_MOBILE = 40405;\n int BIND_MOBILE_FAILURE = 40406;\n\n //用户注册(02)\n int CHECK_TELEPHONE_EXIST = 40201;\n int CHECK_IDCARD_EXIST = 40202;\n int CHECK_ACCOUNT_EXIST = 40203;\n int CHECK_VERIFYCODE_FAILURE = 40204;\n int TELEPHONE_NULL = 40205;\n int TELEPHONE_ERROR = 40206;\n int PASSWORD_NULL = 40207;\n int PASSWORD_LENGTH_OVERLONG = 40208;\n int REGISTER_FAILURE = 40209;\n //身份证校验\n int IDCARD_LENGTH_ERROR=40210;\n int IDCARD_NUMERIC_ERROR=40211;\n int IDCARD_BIRTHDAY_INVALID=40212;\n int IDCARD_BIRTHDAY_OVER_LIMIT=40213;\n int IDCARD_MONTH_INVALID=40214;\n int IDCARD_DATE_INVALID=40215;\n int IDCARD_AREACODE_ERROR=40216;\n int IDCARD_ILLEGAL=40217;\n //身份证号不能为空\n int IDCARD_NULL=40218;\n\n\n //学习卡绑定(09)\n int PAYCARD_USED = 40901;\n int PAYCARD_NOTEXIST = 40902;\n int PAYCARD_PASSWORD_ERROR = 40903;\n int PAYCARD_BOUND = 40904;\n int PAYCARD_INVALID = 40905;\n int PAYCARD_UNNORMAL = 40906;\n int PROJECT_EXIST = 40907;\n int BIND_PROJECT_ERROR = 40908;\n int ADD_RULES_ERROR = 40909;\n int ADD_PROJECT_COMPLETERATE_ERROR = 40910;\n int INIT_KNOWLEDGE_QUESTIONS_ERROR = 40911;\n int PAYCARD_MEAL_NOTEXIST = 40912;\n int PAYCARD_MEAL_MISMATCHING = 40913;\n int NO_AUTH_BIND_PROJECT = 40914;\n int PAYCARD_RENEW_NO_SAME_JG = 40915;\n int PAYCARD_RENEW_NO_SAME_PRICE = 40916;\n int PAYCARD_RENEW_NO_SAME_CARDTYPE = 40917;\n int PAYCARD_RENEW_NO_SAME_TRAINTYPE = 40918;\n int PAYCARD_RENEW_NO_ID_PASSWORD = 40919;\n int PAYCARD_RENEW_NO_ACCOUNT_PROJECT_ID = 40920;\n int REQUEST_VR_NODEJS_URL = 40921;\n int NO_PROVINCE_TK = 40922;\n\n //培训考核\n int NO_EXAM_QUESTIONS = 40602;\n int PAPER_NOT_COMPLETE = 40603;\n int NO_EXAM_RULES = 40604;\n int TOO_MANY_EXAM_RULES = 40605;\n int CHECK_MARK_EXAM_QUESTION_FORM_FAILURE = 40606;\n int CHECK_SAVE_EXAM_ANSWER_FORM_FAILURE = 40607;\n int PAPER_OR_SUBJECT_NOT_EXISTS = 40608;\n int SHORT_OF_WELD_SELECT = 40609;\n int NOT_WELD_PROJECT = 40610;\n\n //知识点学习(05)\n int GET_QUESTION_FAILURE = 40502;\n int NO_QUESTION_FLAG = 40503;\n int CHECK_ANSWER_QUESTION_FORM_FAILURE = 40504;\n int NO_FLAG = 40506;\n\n //(完成度)计算(10)\n int WCD_CALCULATE_TARGET_ERROR = 41001;\n\n //vr实操 知识点练习(11)\n int CHECK_VR_KNOWLEDGE_TRAIN_FORM_FAILURE = 41101;\n int NO_VR_KNOWLEDEG_TIMES = 41102;\n int CHECK_SAVE_VR_EXAM_ANSWER_FORM_FAILURE = 41103;\n int CHECK_VR_COMMIT_PAPER_FAILURE = 41104;\n int CONNECT_VR_FAILURE= 41105;\n int WRONG_STBH=41106;\n int NO_TRAIN_MX=41107;\n int NO_TRAIN=41108;\n int NO_PAPER_EXISTS=41109;\n\n int CHECK_VERSION_FAILURE = 42101;\n\n //机构登录(36)\n int FIND_JGPASSWORD_SUCCESS = 23601;\n int CHECK_JG_LOGIN_FAILURE = 43601;\n int CHECK_JGLOGINFORM_FAILURE = 43602;\n int CHECK_FIND_JGPASSWORD_FORM_FAILURE = 43603;\n int CHECK_JG_BY_TELEPHONE_FAILURE = 43604;\n int NO_MENUS = 43605;\n\n //机构信息(37)\n int MODIFY_JGINFO_SUCCESS = 23701;\n int MODIFY_JGPASSWORD_SUCCESS = 23702;\n int CHECK_OLD_JGPASSWORD_FAILURE = 43701;\n int CHECK_MODIFY_JGPASSWORD_FORM_FAILURE = 43702;\n int CHECK_JGINFO_FORM_FAILURE = 43703;\n // 公用查询(30)\n int CHECK_MANAGER_COMMON_EMPTY = 43001;\n\n // 注册绑卡(31)\n int CHECK_MANAGER_REGISTER_EMPTY = 43101;\n int CHECK_MANAGER_REGISTER_TO_LONG_NAME = 43102;\n int CHECK_MANAGER_REGISTER_TELEPHONE_FAILURE = 43103;\n int CHECK_MANAGER_REGISTER_RECHECK_NO_EXPIREDATE = 43104;\n int CHECK_MANAGER_REGISTER_SUBORG_NO_PAYSTATE = 43105;\n int CHECK_MANAGER_REGISTER_NO_PLAN = 43106;\n int CHECK_MANAGER_REGISTER_PROJECT_SAME = 43107;\n int CHECK_MANAGER_REGISTER_PROJECT_SAME_ALREADY = 43108;\n int CHECK_MANAGER_REGISTER_NO_PAR_CARD_NEW = 43109;\n int CHECK_MANAGER_REGISTER_NO_PAR_CARD_RECHECK = 43110;\n int CHECK_MANAGER_REGISTER_NO_PAR_CARD_PRACTICAL = 43111;\n int CHECK_MANAGER_REGISTER_PLANTYPE_FAILURE = 43112;\n int CHECK_MANAGER_REGISTER_PAYCARD_IS_EMPTY = 43113;\n\n /*培训记录提取成功*/\n int EXTRACT_TRAIN_CERTIFY_SUCCESS = 23201;\n /*存在已提取学员*/\n int EXTRACT_REPEAT = 43201;\n /*培训不及格*/\n int EXTRACT_NOT_PASS_TRAIN = 43202;\n /*未查询到学员*/\n int EXTRACT_NO_STUDENT = 43203;\n\n int STUDENT_REPORT_DATE_ERROR = 43301;\n int DATEBEGIN_NULL_ERROR = 43302;\n int DATEEND_NULL_ERROR = 43303;\n\n //班次名称是否已存在\n int CHECK_BATCH_NAME = 43403;\n\n //机构班次人员管理\n int CHECK_ADD_BATCH_STUDENT_FAILURE = 43501;\n int CHECK_DELETE_BATCH_STUDENT_FAILURE = 43502;\n\n int ADD_BATCH_STUDENT_ERROR = 43503;\n int DELETE_BATCH_STUDENT_ERROR = 43504;\n\n int BATCH_COUNT_ERROR = 43505;\n int BATCH_STATE_ERROR = 43506;\n\n /*微信返回空*/\n int DO_NOTHING = 43801;\n /*公众号配置错误*/\n int NO_CONFIG = 43802;\n /*签名错误*/\n int SIGN_ERROR = 43803;\n /*获取token异常*/\n int CAN_NOT_GET_TOKEN = 43804;\n /*获取token异常*/\n int CAN_NOT_GET_TICKET = 43805;\n\n /*未绑定微信账号*/\n int NO_BIND_WECHAT = 43806;\n /*未绑定培训项目*/\n int NO_BIND_PROJECT = 43807;\n\n /*项目数据异常*/\n int PROJECT_MESSAGE_ERROR = 43808;\n\n /*获取用户微信信息失败*/\n int GET_USERINFO_ERROR = 43809;\n\n /*成功绑定项目*/\n int SAVE_APID_SUCCESS = 43810;\n\n /*获取openId为空*/\n int GET_OPENID_ERROR= 43811;\n\n\n int EXAM_RULE_IS_NOT_REACH = 99001;// 开始考试前,有内容未达标。\n int EXAM_RULE_IS_NEED_NOTICE = 99002;// 开始考试前,有内容未达标,需要提示信息。\n\n /* Redis 相关参数 */\n int REDIS_PARAM_IS_EMPTY = 43900;\n\n /* 题库代码和题库版本为空*/\n int NO_TKDM_OR_VERSION_NOW = 43901;\n int NO_TKDM_OR_VERSION = 43902;\n}", "Response mo35726n0() throws IOException;", "public int statusCode(){\n return code;\n }", "private Integer getStatus(Map<String, Object> info) {\n return 200;\n }", "trinsic.services.common.v1.CommonOuterClass.ResponseStatus getStatus();", "@Given(\"^an invalid or missing token and making a GET request to account_ID_info then it should return a (\\\\d+) and an empty body$\")\n\tpublic void an_invalid_or_missing_token_and_making_a_GET_request_to_account_ID_info_then_it_should_return_a_and_an_empty_body(int StatusCode) throws Throwable {\n\t\tGetInfo.GET_account_id_info_UnAuthorized();\n\t try{}catch(Exception e){}\n\t}", "private String displayCSCResponse(String vCSCResultCode) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vCSCResultCode != null || vCSCResultCode.length() == 0) {\r\n\r\n\t\t\tif (vCSCResultCode.equalsIgnoreCase(\"Unsupported\") || vCSCResultCode.equalsIgnoreCase(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"CSC not supported or there was no CSC data provided\";\r\n\t\t\t} else {\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\t\tchar input = vCSCResultCode.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'M':\r\n\t\t\t\t\tresult = \"Exact code match\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"Merchant has indicated that CSC is not present on the card (MOTO situation)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'P':\r\n\t\t\t\t\tresult = \"Code not processed\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"Card issuer is not registered and/or certified\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"Code invalid or not matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Test\r\n\tpublic void testResponseCode(){\r\n\t\t\r\n\t\tint code = get(api1).getStatusCode();\r\n\t\tSystem.out.println(\"Code: \"+code);\r\n\t\tAssert.assertEquals(code, 200);\r\n\t}", "java.lang.String getPatStatusCode();", "java.lang.String getPatStatusCode();", "public static Integer getStatusCode() {\n Response res = (Response) Serenity.getCurrentSession().get(\"apiResponse\");\n return res.then().extract().statusCode();\n //return SerenityRest.then().extract().statusCode();\n }", "public static Fail fromHttpResponseCode(final Integer httpResponseCodeIn) {\n if (httpResponseCodeIn == null) {\n return null;\n }\n\n // If success, return normalized success\n if (GOOD_RESPONSE.matcher(httpResponseCodeIn.toString()).matches()) {\n return SUCCESS;\n }\n\n for (Fail f : Fail.values()) {\n if (f.getHttpResponseCode().equals(httpResponseCodeIn)) {\n return f;\n }\n }\n return null;\n }", "@SuppressWarnings(\"ThrowableNotThrown\") \n public static Response getSCIMInternalErrorResponse() {\n JSONEncoder encoder = new JSONEncoder();\n CharonException exception = new CharonException(\"Internal Error\");\n String responseStr = encoder.encodeSCIMException(exception);\n return Response.status(exception.getStatus()).entity(responseStr).build();\n }", "ch.epfl.dedis.proto.StatusProto.Response.Status getSystemOrThrow(\n java.lang.String key);", "private ResponseStatus(int code, String symbolicName, String description) {\n this.code = code;\n this.formatted = format(code, description);\n this.symbolicName = requireNonNull(symbolicName);\n\n if (code == MALFORMED_RESPONSE_CODE) {\n // skip further processing of the \"malformed response\" status\n return;\n }\n\n if (values[code] != null) {\n throw new IllegalStateException(\"already initialized status \" + values[code]);\n }\n\n values[code] = this;\n }", "HttpStatusCode getStatusCode();", "static String getDesc(String code) {\n\t\tString[] str = errorMap.get(code);\n\t\tif (str == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn str[1];\n\t}", "ch.epfl.dedis.proto.StatusProto.Response.Status getSystemOrDefault(\n java.lang.String key,\n ch.epfl.dedis.proto.StatusProto.Response.Status defaultValue);", "Pokemon.ResponseEnvelop.Unknown7 getUnknown7();", "@java.lang.Override public trinsic.services.common.v1.CommonOuterClass.ResponseStatus getStatus() {\n @SuppressWarnings(\"deprecation\")\n trinsic.services.common.v1.CommonOuterClass.ResponseStatus result = trinsic.services.common.v1.CommonOuterClass.ResponseStatus.valueOf(status_);\n return result == null ? trinsic.services.common.v1.CommonOuterClass.ResponseStatus.UNRECOGNIZED : result;\n }", "protected String getStatusMessage(int code) {\n\t\tStatus status = null;\n\n\t\ttry {\n\t\t\tstatus = Status.values()[code];\n\t\t} catch (Exception ex) {\n\t\t\tstatus = Status.ERROR;\n\t\t}\n\n\t\treturn status.toString();\n\t}", "public int getUnknown() throws FrameException {\n try {\n byte data[] = (byte[])infoElements.get(new Integer(InfoElement.UNKNOWN));\n ByteBuffer byteBuffer = new ByteBuffer(data);\n return byteBuffer.get16bits();\n } catch (Exception e) {\n throw new FrameException(e);\n }\n }", "public OpenAccessCardResponse readErrorResponse(int i, String s) {\n OpenAccessCardResponse response = new OpenAccessCardResponse();\n response.setReturnCode(i);\n response.setResultDesc(s);\n return response;\n }", "com.google.protobuf.ByteString getUnknown1();", "com.google.protobuf.ByteString getUnknown1();", "public BadRequestResponse()\n {\n super();\n codeSubfield = 0;\n payload = \"Bad Request\";\n }", "@Test\n public void shouldGiveNotFoundResponseCodeIfTryToRetrieveUnknownPayment() throws Exception {\n ResponseEntity<Payment> response = restTemplate.getForEntity(\"/payments/unKnownId\", Payment.class);\n //then: the response code should be 'not found'\n assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode());\n }", "@Override\n\t\t\tprotected Response<String> parseNetworkResponse(\n\t\t\t\t\tNetworkResponse response) {\n\n\t\t\t\treturn null;\n\t\t\t}", "@java.lang.Override\n public trinsic.services.common.v1.CommonOuterClass.ResponseStatus getStatus() {\n @SuppressWarnings(\"deprecation\")\n trinsic.services.common.v1.CommonOuterClass.ResponseStatus result = trinsic.services.common.v1.CommonOuterClass.ResponseStatus.valueOf(status_);\n return result == null ? trinsic.services.common.v1.CommonOuterClass.ResponseStatus.UNRECOGNIZED : result;\n }", "private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}", "public String getErrorCode();", "long getInnerStatusCode();", "private static String handleServerError(int statusCode, byte[] body,\r\n\t\t\tObject err, Context context) {\r\n\t\tIOException error = (IOException) err;\r\n\r\n\t\tswitch (statusCode) {\r\n\t\tcase 400:\r\n\t\t\ttry {\r\n\t\t\t\tString rspStr = new String(body);\r\n\t\t\t\tLog.i(TAG, \"error response : \" + rspStr.toString());\r\n\r\n\t\t\t\tResponseData rspData = new Gson().fromJson(rspStr,\r\n\t\t\t\t\t\tResponseData.class);\r\n\r\n\t\t\t\treturn rspStr;\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 401:\r\n\t\t\tLog.i(TAG, \"error response, statusCode = \" + statusCode);\r\n\t\tcase 404:\r\n\t\tcase 422:\r\n\t\t\ttry {\r\n\t\t\t\t// server might return error like this { \"error\":\r\n\t\t\t\t// \"Some error occured\" }\r\n\t\t\t\t// Use \"Gson\" to parse the result\r\n\t\t\t\tString rspStr = new String(body);\r\n\t\t\t\tHashMap<String, String> result = new Gson().fromJson(\r\n\t\t\t\t\t\tnew String(body), new TypeToken<Map<String, String>>() {\r\n\t\t\t\t\t\t}.getType());\r\n\r\n\t\t\t\tif (result != null && result.containsKey(\"error\")) {\r\n\t\t\t\t\treturn result.get(\"error\");\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t// invalid request\r\n\t\t\treturn error.getMessage();\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn context.getResources().getString(R.string.generic_server_down);\r\n\t}", "void notSupported(String errorcode);", "public SimpleResponse NOT_AUTHORIZED() {\n this.state = NOT_AUTHORIZED;\n return ERROR_CUSTOM();\n }", "protected com.android.volley.Response<T> parseNetworkResponse(com.android.volley.NetworkResponse r7) {\n /*\n r6 = this;\n r5 = 1;\n r0 = new java.lang.StringBuilder;\n r0.<init>();\n r1 = \"StatusCode=\";\n r0 = r0.append(r1);\n r1 = r7.statusCode;\n r0 = r0.append(r1);\n r0 = r0.toString();\n com.jd.fridge.util.k.a(r0);\n r0 = \"infoss\";\n r1 = new java.lang.StringBuilder;\n r1.<init>();\n r2 = \"code==\";\n r1 = r1.append(r2);\n r2 = r7.statusCode;\n r1 = r1.append(r2);\n r1 = r1.toString();\n com.jd.fridge.util.r.c(r0, r1);\n r2 = \"\";\n r0 = r7.statusCode;\n r1 = 200; // 0xc8 float:2.8E-43 double:9.9E-322;\n if (r0 != r1) goto L_0x013e;\n L_0x003b:\n r0 = org.greenrobot.eventbus.c.a();\n r1 = 3;\n r3 = 0;\n r1 = com.jd.fridge.bean.Event.newEvent(r1, r3);\n r0.c(r1);\n r1 = new java.lang.String;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x00f0, Exception -> 0x0114 }\n r0 = r7.data;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x00f0, Exception -> 0x0114 }\n r3 = r7.headers;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x00f0, Exception -> 0x0114 }\n r3 = com.android.volley.toolbox.HttpHeaderParser.parseCharset(r3);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x00f0, Exception -> 0x0114 }\n r1.<init>(r0, r3);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x00f0, Exception -> 0x0114 }\n r0 = r6.m;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n if (r0 == 0) goto L_0x005e;\n L_0x0059:\n r0 = r6.m;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0.a(r1);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n L_0x005e:\n r0 = new java.lang.StringBuilder;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0.<init>();\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2 = \"jsonStr===\";\n r0 = r0.append(r2);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0 = r0.append(r1);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0 = r0.toString();\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n com.jd.fridge.util.k.a(r0);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0 = \"infoss\";\n r2 = new java.lang.StringBuilder;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2.<init>();\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r3 = \"jsonStr==\";\n r2 = r2.append(r3);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2 = r2.append(r1);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2 = r2.toString();\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n com.jd.fridge.util.r.c(r0, r2);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0 = \"infoss\";\n r2 = new java.lang.StringBuilder;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2.<init>();\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r3 = \"gson==\";\n r2 = r2.append(r3);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r3 = r6.d;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r4 = r6.e;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r3 = r3.fromJson(r1, r4);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2 = r2.append(r3);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2 = r2.toString();\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n com.jd.fridge.util.r.c(r0, r2);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0 = r6.d;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2 = r6.e;\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0 = r0.fromJson(r1, r2);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r2 = com.android.volley.toolbox.HttpHeaderParser.parseCacheHeaders(r7);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n r0 = com.android.volley.Response.success(r0, r2);\t Catch:{ UnsupportedEncodingException -> 0x00bd, JsonSyntaxException -> 0x0187, Exception -> 0x0114 }\n L_0x00bc:\n return r0;\n L_0x00bd:\n r0 = move-exception;\n r0.printStackTrace();\n r1 = r6.f;\n r1.a(r5);\n r1 = new com.jd.fridge.util.a.c;\n r1.<init>(r0);\n com.android.volley.Response.error(r1);\n r1 = \"infoss\";\n r2 = new java.lang.StringBuilder;\n r2.<init>();\n r3 = \"jsonStr=1111111=\";\n r2 = r2.append(r3);\n r0 = r2.append(r0);\n r0 = r0.toString();\n com.jd.fridge.util.r.c(r1, r0);\n L_0x00e6:\n r0 = new com.jd.fridge.util.a.c;\n r0.<init>(r7);\n r0 = com.android.volley.Response.error(r0);\n goto L_0x00bc;\n L_0x00f0:\n r0 = move-exception;\n r1 = r2;\n L_0x00f2:\n r2 = r6.c;\n if (r2 == 0) goto L_0x00fb;\n L_0x00f6:\n r2 = r6.c;\n r2.a(r1);\n L_0x00fb:\n r1 = \"infoss\";\n r2 = new java.lang.StringBuilder;\n r2.<init>();\n r3 = \"JsonSyntaxException=222=\";\n r2 = r2.append(r3);\n r0 = r2.append(r0);\n r0 = r0.toString();\n com.jd.fridge.util.r.c(r1, r0);\n goto L_0x00e6;\n L_0x0114:\n r0 = move-exception;\n r0.printStackTrace();\n r1 = r6.f;\n r1.a(r5);\n r1 = new com.jd.fridge.util.a.c;\n r1.<init>(r0);\n com.android.volley.Response.error(r1);\n r1 = \"infoss\";\n r2 = new java.lang.StringBuilder;\n r2.<init>();\n r3 = \"jsonStr=333=\";\n r2 = r2.append(r3);\n r0 = r2.append(r0);\n r0 = r0.toString();\n com.jd.fridge.util.r.c(r1, r0);\n goto L_0x00e6;\n L_0x013e:\n r0 = \"infos\";\n r1 = new java.lang.StringBuilder;\n r1.<init>();\n r2 = \"response fail: \";\n r1 = r1.append(r2);\n r2 = r7.data;\n r2 = r2.toString();\n r1 = r1.append(r2);\n r1 = r1.toString();\n com.jd.fridge.util.r.c(r0, r1);\n r0 = new java.lang.StringBuilder;\n r0.<init>();\n r1 = \"result=\";\n r0 = r0.append(r1);\n r1 = r7.data;\n r1 = r1.toString();\n r0 = r0.append(r1);\n r0 = r0.toString();\n com.jd.fridge.util.k.a(r0);\n r0 = r6.f;\n r0.a(r5);\n r0 = new com.jd.fridge.util.a.c;\n r0.<init>(r7);\n com.android.volley.Response.error(r0);\n goto L_0x00e6;\n L_0x0187:\n r0 = move-exception;\n goto L_0x00f2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.jd.fridge.util.a.d.parseNetworkResponse(com.android.volley.NetworkResponse):com.android.volley.Response<T>\");\n }", "public static String getErrorDescription(int errCode) {\n switch (errCode) {\n case ERROR_PACKET_HEADER:\n return \"Invalid packet header\";\n case ERROR_PACKET_TYPE:\n return \"Invalid packet type\";\n case ERROR_PACKET_LENGTH:\n return \"Invalid packet length\";\n case ERROR_PACKET_ENCODING:\n return \"Unsupported packet encoding\";\n case ERROR_PACKET_PAYLOAD:\n return \"Invalid packet payload\";\n case ERROR_PACKET_CHECKSUM:\n return \"Invalid checksum\";\n case ERROR_PACKET_ACK:\n return \"Invalid ACL sequence\";\n case ERROR_PROTOCOL_ERROR:\n return \"Protocol error\";\n case ERROR_PROPERTY_READ_ONLY:\n return \"Property is read-only\";\n case ERROR_PROPERTY_WRITE_ONLY:\n return \"Property is write-only\";\n case ERROR_PROPERTY_INVALID_ID:\n return \"Invalid/Unrecognized property key\";\n case ERROR_PROPERTY_INVALID_VALUE:\n return \"Invalid propery value\";\n case ERROR_PROPERTY_UNKNOWN_ERROR:\n return \"Unknown property error\";\n case ERROR_COMMAND_INVALID:\n return \"Invalid/Unsupported command\";\n case ERROR_COMMAND_ERROR:\n return \"Command error\";\n case ERROR_UPLOAD_TYPE:\n return \"Invalid upload type\";\n case ERROR_UPLOAD_LENGTH:\n return \"Invalid upload length\";\n case ERROR_UPLOAD_OFFSET_OVERLAP:\n return \"Upload offset overlap\";\n case ERROR_UPLOAD_OFFSET_GAP:\n return \"Upload offset gap\";\n case ERROR_UPLOAD_OFFSET_OVERFLOW:\n return \"Upload offset overflow\";\n case ERROR_UPLOAD_FILE_NAME:\n return \"Invalid uploaded filename\";\n case ERROR_UPLOAD_CHECKSUM:\n return \"Invalid uploaded checksum\";\n case ERROR_UPLOAD_SAVE:\n return \"Unable to save uploaded file\";\n case ERROR_GPS_EXPIRED:\n return \"GPS fix expired\";\n case ERROR_GPS_FAILURE:\n return \"GPS failure\";\n }\n if ((errCode >= ERROR_INTERNAL_ERROR_00) && (errCode <= ERROR_INTERNAL_ERROR_0F)) {\n return \"Internal error\";\n }\n return \"Unknown [\" + StringTools.toHexString(errCode, 16) + \"]\";\n }", "private static String getCause(int statusCode) {\r\n\t\tString cause = null;\r\n\t\tswitch (statusCode) {\r\n\t\tcase NOT_MODIFIED:\r\n\t\t\tbreak;\r\n\t\tcase BAD_REQUEST:\r\n\t\t\tcause = \"The request was invalid. An accompanying error message will explain why.\";\r\n\t\t\tbreak;\r\n\t\tcase NOT_AUTHORIZED:\r\n\t\t\tcause = \"Authentication incorrect, the session is expired.\";\r\n\t\t\tbreak;\r\n\t\tcase FORBIDDEN:\r\n\t\t\tcause = \"The request is understood, but it has been refused. An accompanying error message will explain why.\";\r\n\t\t\tbreak;\r\n\t\tcase NOT_FOUND:\r\n\t\t\tcause = \"The URI requested is invalid or the resource requested does not exists.\";\r\n\t\t\tbreak;\r\n\t\tcase NOT_ACCEPTABLE:\r\n\t\t\tcause = \"Returned an invalid format is specified in the request.\";\r\n\t\t\tbreak;\r\n\t\tcase INTERNAL_SERVER_ERROR:\r\n\t\t\tcause = \"Something is broken. Please contact the service ISP.\";\r\n\t\t\tbreak;\r\n\t\tcase BAD_GATEWAY:\r\n\t\t\tcause = \"The server is down or being upgraded.\";\r\n\t\t\tbreak;\r\n\t\tcase SERVICE_UNAVAILABLE:\r\n\t\t\tcause = \"Service Unavailable: The servers are up, but overloaded with requests. Try again later.\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tcause = \"\";\r\n\t\t}\r\n\t\treturn statusCode + \":\" + cause;\r\n\t}", "public static void informNullResponse(Context context) {\n Log.e(context.getClass().getSimpleName(), \"Problem on client side\");\n Toast.makeText(context, context.getString(R.string.server_unreachable_error),\n Toast.LENGTH_SHORT).show();\n }", "public int getUnknown1() {\n return unknown1_;\n }", "public int getUnknown1() {\n return unknown1_;\n }", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "public int getUnknown1() {\n return unknown1_;\n }", "public int getUnknown1() {\n return unknown1_;\n }", "@Test\n public void teststatusCode() {\n\t \n\t given().\n\t \tget(\"https://reqres.in/api/unknown\").\n\t then().\t\t\n\t \tstatusCode(200);\n\t \n }", "@Override\n\tpublic Status onGetStatus(String name) {\n\t\treturn null;\n\t}", "@Test\n\tpublic void testStatusCode() {\n\t\tassertEquals(\"404\", myReply.getStatusCode());\n\t}", "public String handleResponse(final HttpResponse response) throws IOException{\n int status = response.getStatusLine().getStatusCode();\n if (status >= 200 && status < 300) {\n HttpEntity entity = response.getEntity();\n if(entity == null) {\n return \"\";\n } else {\n return EntityUtils.toString(entity);\n }\n } else {\n return \"\"+status;\n }\n }", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "public UnifiedFormat() {\n getMetadata().setStatus(HttpStatus.SC_OK);\n }", "public StatusCode GetStatus();", "public java.lang.CharSequence getResponseCode() {\n return ResponseCode;\n }", "static String getErrorDesc(String code) {\n\t\tString[] str = errorMap.get(code);\n\t\tif (str == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn str[0];\n\t}", "public int getStatusCode() {\n return code;\n }", "public int getUnknown1() {\n return unknown1_;\n }", "public int getUnknown1() {\n return unknown1_;\n }", "public int getUnknown1() {\n return unknown1_;\n }", "public int getUnknown1() {\n return unknown1_;\n }", "int getErrorCode();", "public String getFailResult(String response) {\n\n\t\tString result=\"failed\";\n\t\tPattern pattern = Pattern.compile(FAULT_CODE);\n\n\t\tMatcher match = pattern.matcher(response);\n\t\tif (match.find(1)) {\n\t\t\tresult= (match.group(1));\n\t\t}\n\t\treturn result;\t\n\t}", "String getStatusMessage( );", "Pokemon.RequestEnvelop.Unknown6.Unknown2 getUnknown2();", "@Override\n public void onFailure(int statusCode, Throwable error,\n String content) {\n\n if(statusCode == 404){\n Toast.makeText(context, \"Requested resource not found\", Toast.LENGTH_LONG).show();\n }else if(statusCode == 500){\n Toast.makeText(context, \"Something went wrong at server end\", Toast.LENGTH_LONG).show();\n }else{\n // Toast.makeText(context, \"Unexpected Error occcured! [Most common Error: Device might not be connected to Internet]\", Toast.LENGTH_LONG).show();\n }\n }", "public int getResponseType() {\n /*\n // Can't load method instructions: Load method exception: null in method: android.telephony.SmsCbCmasInfo.getResponseType():int, dex: in method: android.telephony.SmsCbCmasInfo.getResponseType():int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.getResponseType():int\");\n }", "public interface StatusCodes\n{\n\n// ----------------------------------------------------------------------------\n// Reserved status codes: [E0-00 through FF-FF]\n// Groups:\n// 0xF0.. - Generic\n// 0xF1.. - Motion\n// 0xF2.. - Geofence\n// 0xF4.. - Digital input/output\n// 0xF6.. - Sensor input\n// 0xF7.. - Temperature input\n// 0xF9.. - J1708\n// 0xFD.. - Device status\n// ----------------------------------------------------------------------------\n\n// ----------------------------------------------------------------------------\n// No status code: 0x0000\n\n public static final int STATUS_NONE = 0x0000;\n\n// ----------------------------------------------------------------------------\n// Generic codes: 0xF000 to 0xF0FF\n\n public static final int STATUS_INITIALIZED = 0xF010;\n // Description:\n // General Status/Location information (event generated by some\n // initialization function performed by the device).\n // Notes:\n // - This contents of the payload must at least contain the current\n // timestamp (and latitude and longitude if available).\n\n public static final int STATUS_LOCATION = 0xF020;\n // Description:\n // General Status/Location information. This status code indicates\n // no more than just the location of the device at a particular time.\n // Notes:\n // - This contents of the payload must at least contain the current\n // timestamp, latitude, and longitude.\n\n public static final int STATUS_WAYMARK = 0xF030;\n // Description:\n // General Status/Location information (event generated by manual user\n // intervention at the device. ie. By pressing a 'Waymark' button).\n // Notes:\n // - This contents of the payload must at least contain the current\n // timestamp, latitude, and longitude.\n\n public static final int STATUS_QUERY = 0xF040;\n // Description:\n // General Status/Location information (event generated by 'query'\n // from the server).\n // Notes:\n // - This contents of the payload must at least contain the current\n // timestamp, latitude, and longitude.\n\n// ----------------------------------------------------------------------------\n// Motion codes: 0xF100 to 0xF1FF\n\n public static final int STATUS_MOTION_START = 0xF111;\n // Description:\n // Device start of motion\n // Notes:\n // The definition of motion-start is provided by property PROP_MOTION_START\n\n public static final int STATUS_MOTION_IN_MOTION = 0xF112;\n // Description:\n // Device in-motion interval\n // Notes:\n // The in-motion interval is provided by property PROP_MOTION_IN_MOTION.\n // This status is typically used for providing in-motion events between\n // STATUS_MOTION_START and STATUS_MOTION_STOP events.\n\n public static final int STATUS_MOTION_STOP = 0xF113;\n // Description:\n // Device stopped motion\n // Notes:\n // The definition of motion-stop is provided by property PROP_MOTION_STOP\n\n public static final int STATUS_MOTION_DORMANT = 0xF114;\n // Description:\n // Device dormant interval (ie. not moving)\n // Notes:\n // The dormant interval is provided by property PROP_MOTION_DORMANT\n\n public static final int STATUS_MOTION_EXCESS_SPEED = 0xF11A;\n // Description:\n // Device exceeded preset speed limit\n // Notes:\n // The excess-speed threshold is provided by property PROP_MOTION_EXCESS_SPEED\n\n public static final int STATUS_MOTION_MOVING = 0xF11C;\n // Description:\n // Device is moving\n // Notes:\n // This status code may be used to indicating that the device was moving\n // at the time the event was generated. It is not typically associated\n // with the status codes STATUS_MOTION_START, STATUS_MOTION_STOP, and \n // STATUS_MOTION_IN_MOTION, and may be used independently of these codes.\n\n public static final int STATUS_ODOM_0 = 0xF130;\n public static final int STATUS_ODOM_1 = 0xF131;\n public static final int STATUS_ODOM_2 = 0xF132;\n public static final int STATUS_ODOM_3 = 0xF133;\n public static final int STATUS_ODOM_4 = 0xF134;\n public static final int STATUS_ODOM_5 = 0xF135;\n public static final int STATUS_ODOM_6 = 0xF136;\n public static final int STATUS_ODOM_7 = 0xF137;\n // Description:\n // Odometer value\n // Notes:\n // The odometer limit is provided by property PROP_ODOMETER_#_LIMIT\n\n public static final int STATUS_ODOM_LIMIT_0 = 0xF140;\n public static final int STATUS_ODOM_LIMIT_1 = 0xF141;\n public static final int STATUS_ODOM_LIMIT_2 = 0xF142;\n public static final int STATUS_ODOM_LIMIT_3 = 0xF143;\n public static final int STATUS_ODOM_LIMIT_4 = 0xF144;\n public static final int STATUS_ODOM_LIMIT_5 = 0xF145;\n public static final int STATUS_ODOM_LIMIT_6 = 0xF146;\n public static final int STATUS_ODOM_LIMIT_7 = 0xF147;\n // Description:\n // Odometer has exceeded a set limit\n // Notes:\n // The odometer limit is provided by property PROP_ODOMETER_#_LIMIT\n\n// ----------------------------------------------------------------------------\n// Geofence: 0xF200 to 0xF2FF\n\n public static final int STATUS_GEOFENCE_ARRIVE = 0xF210;\n // Description:\n // Device arrived at geofence\n // Notes:\n // - Client may wish to include FIELD_GEOFENCE_ID in the event packet.\n\n public static final int STATUS_GEOFENCE_DEPART = 0xF230;\n // Description:\n // Device departed geofence\n // Notes:\n // - Client may wish to include FIELD_GEOFENCE_ID in the event packet.\n\n public static final int STATUS_GEOFENCE_VIOLATION = 0xF250;\n // Description:\n // Geofence violation\n // Notes:\n // - Client may wish to include FIELD_GEOFENCE_ID in the event packet.\n\n public static final int STATUS_GEOFENCE_ACTIVE = 0xF270;\n // Description:\n // Geofence now active\n // Notes:\n // - Client may wish to include FIELD_GEOFENCE_ID in the event packet.\n\n public static final int STATUS_GEOFENCE_INACTIVE = 0xF280;\n // Description:\n // Geofence now inactive\n // Notes:\n // - Client may wish to include FIELD_GEOFENCE_ID in the event packet.\n\n// ----------------------------------------------------------------------------\n// Digital input/output (state change): 0xF400 to 0xF4FF\n\n public static final int STATUS_INPUT_STATE = 0xF400;\n // Description:\n // Current input ON state (bitmask)\n // Notes:\n // - Client should include FIELD_INPUT_STATE in the event packet,\n // otherwise this status code would have no meaning.\n\n public static final int STATUS_INPUT_ON = 0xF402;\n // Description:\n // Input turned ON\n // Notes:\n // - Client should include FIELD_INPUT_ID in the event packet,\n // otherwise this status code would have no meaning.\n // - This status code may be used to indicate that an arbitrary input\n // 'thing' turned ON, and the 'thing' can be identified by the 'Input ID'.\n // This 'ID' can also represent the index of a digital input.\n\n public static final int STATUS_INPUT_OFF = 0xF404;\n // Description:\n // Input turned OFF\n // Notes:\n // - Client should include FIELD_INPUT_ID in the event packet,\n // otherwise this status code would have no meaning.\n // - This status code may be used to indicate that an arbitrary input\n // 'thing' turned OFF, and the 'thing' can be identified by the 'Input ID'.\n // This 'ID' can also represent the index of a digital input.\n\n public static final int STATUS_OUTPUT_STATE = 0xF406;\n // Description:\n // Current output ON state (bitmask)\n // Notes:\n // - Client should include FIELD_OUTPUT_STATE in the event packet,\n // otherwise this status code would have no meaning.\n\n public static final int STATUS_OUTPUT_ON = 0xF408;\n // Description:\n // Output turned ON\n // Notes:\n // - Client should include FIELD_OUTPUT_ID in the event packet,\n // otherwise this status code would have no meaning.\n // - This status code may be used to indicate that an arbitrary output\n // 'thing' turned ON, and the 'thing' can be identified by the 'Output ID'.\n // This 'ID' can also represent the index of a digital output.\n\n public static final int STATUS_OUTPUT_OFF = 0xF40A;\n // Description:\n // Output turned OFF\n // Notes:\n // - Client should include FIELD_OUTPUT_ID in the event packet,\n // otherwise this status code would have no meaning.\n // - This status code may be used to indicate that an arbitrary output\n // 'thing' turned OFF, and the 'thing' can be identified by the 'Output ID'.\n // This 'ID' can also represent the index of a digital output.\n\n public static final int STATUS_INPUT_ON_00 = 0xF420;\n public static final int STATUS_INPUT_ON_01 = 0xF421;\n public static final int STATUS_INPUT_ON_02 = 0xF422;\n public static final int STATUS_INPUT_ON_03 = 0xF423;\n public static final int STATUS_INPUT_ON_04 = 0xF424;\n public static final int STATUS_INPUT_ON_05 = 0xF425;\n public static final int STATUS_INPUT_ON_06 = 0xF426;\n public static final int STATUS_INPUT_ON_07 = 0xF427;\n // Description:\n // Digital input state changed to ON\n\n public static final int STATUS_INPUT_OFF_00 = 0xF440;\n public static final int STATUS_INPUT_OFF_01 = 0xF441;\n public static final int STATUS_INPUT_OFF_02 = 0xF442;\n public static final int STATUS_INPUT_OFF_03 = 0xF443;\n public static final int STATUS_INPUT_OFF_04 = 0xF444;\n public static final int STATUS_INPUT_OFF_05 = 0xF445;\n public static final int STATUS_INPUT_OFF_06 = 0xF446;\n public static final int STATUS_INPUT_OFF_07 = 0xF447;\n // Description:\n // Digital input state changed to OFF\n\n public static final int STATUS_OUTPUT_ON_00 = 0xF460;\n public static final int STATUS_OUTPUT_ON_01 = 0xF461;\n public static final int STATUS_OUTPUT_ON_02 = 0xF462;\n public static final int STATUS_OUTPUT_ON_03 = 0xF463;\n public static final int STATUS_OUTPUT_ON_04 = 0xF464;\n public static final int STATUS_OUTPUT_ON_05 = 0xF465;\n public static final int STATUS_OUTPUT_ON_06 = 0xF466;\n public static final int STATUS_OUTPUT_ON_07 = 0xF467;\n // Description:\n // Digital output state set to ON\n\n public static final int STATUS_OUTPUT_OFF_00 = 0xF480;\n public static final int STATUS_OUTPUT_OFF_01 = 0xF481;\n public static final int STATUS_OUTPUT_OFF_02 = 0xF482;\n public static final int STATUS_OUTPUT_OFF_03 = 0xF483;\n public static final int STATUS_OUTPUT_OFF_04 = 0xF484;\n public static final int STATUS_OUTPUT_OFF_05 = 0xF485;\n public static final int STATUS_OUTPUT_OFF_06 = 0xF486;\n public static final int STATUS_OUTPUT_OFF_07 = 0xF487;\n // Description:\n // Digital output state set to OFF\n\n public static final int STATUS_ELAPSED_00 = 0xF4A0;\n public static final int STATUS_ELAPSED_01 = 0xF4A1;\n public static final int STATUS_ELAPSED_02 = 0xF4A2;\n public static final int STATUS_ELAPSED_03 = 0xF4A3;\n public static final int STATUS_ELAPSED_04 = 0xF4A4;\n public static final int STATUS_ELAPSED_05 = 0xF4A5;\n public static final int STATUS_ELAPSED_06 = 0xF4A6;\n public static final int STATUS_ELAPSED_07 = 0xF4A7;\n // Description:\n // Elapsed time\n // Notes:\n // - Client should include FIELD_ELAPSED_TIME in the event packet,\n // otherwise this status code would have no meaning.\n\n public static final int STATUS_ELAPSED_LIMIT_00 = 0xF4B0;\n public static final int STATUS_ELAPSED_LIMIT_01 = 0xF4B1;\n public static final int STATUS_ELAPSED_LIMIT_02 = 0xF4B2;\n public static final int STATUS_ELAPSED_LIMIT_03 = 0xF4B3;\n public static final int STATUS_ELAPSED_LIMIT_04 = 0xF4B4;\n public static final int STATUS_ELAPSED_LIMIT_05 = 0xF4B5;\n public static final int STATUS_ELAPSED_LIMIT_06 = 0xF4B6;\n public static final int STATUS_ELAPSED_LIMIT_07 = 0xF4B7;\n // Description:\n // Elapsed timer has exceeded a set limit\n // Notes:\n // - Client should include FIELD_ELAPSED_TIME in the event packet,\n // otherwise this status code would have no meaning.\n\n// ----------------------------------------------------------------------------\n// Analog/etc sensor values (extra data): 0xF600 to 0xF6FF\n\n public static final int STATUS_SENSOR32_0 = 0xF600;\n public static final int STATUS_SENSOR32_1 = 0xF601;\n public static final int STATUS_SENSOR32_2 = 0xF602;\n public static final int STATUS_SENSOR32_3 = 0xF603;\n public static final int STATUS_SENSOR32_4 = 0xF604;\n public static final int STATUS_SENSOR32_5 = 0xF605;\n public static final int STATUS_SENSOR32_6 = 0xF606;\n public static final int STATUS_SENSOR32_7 = 0xF607;\n // Description:\n // 32-bit unsigned sensor value\n // Notes:\n // - Client should include FIELD_SENSOR32 in the event packet,\n // otherwise this status code would have no meaning.\n // - The server must be able to convert this 32-bit value to something\n // meaningful to the user. This can be done using the following formula:\n // Actual_Value = ((double)Sensor32_Value * <Gain>) + <Offset>;\n // Where <Gain> & <Offset> are user configurable values provided at setup.\n // For instance: Assume Sensor32-0 contains a temperature value that can\n // have a range of -40.0C to +125.0C. The client would encode -14.7C\n // by adding 40.0 and multiplying by 10.0. The resulting value would be\n // 253. The server would then be configured to know how to convert this\n // value back into the proper temperature using the above formula by\n // substituting 0.1 for <Gain>, and -40.0 for <Offset>: eg.\n // -14.7 = ((double)253 * 0.1) + (-40.0);\n\n public static final int STATUS_SENSOR32_RANGE_0 = 0xF620;\n public static final int STATUS_SENSOR32_RANGE_1 = 0xF621;\n public static final int STATUS_SENSOR32_RANGE_2 = 0xF622;\n public static final int STATUS_SENSOR32_RANGE_3 = 0xF623;\n public static final int STATUS_SENSOR32_RANGE_4 = 0xF624;\n public static final int STATUS_SENSOR32_RANGE_5 = 0xF625;\n public static final int STATUS_SENSOR32_RANGE_6 = 0xF626;\n public static final int STATUS_SENSOR32_RANGE_7 = 0xF627;\n // Description:\n // 32-bit unsigned sensor value out-of-range violation\n // Notes:\n // - Client should include FIELD_SENSOR32 in the event packet,\n // otherwise this status code would have no meaning.\n\n// ----------------------------------------------------------------------------\n// Temperature sensor values (extra data): 0xF700 to 0xF7FF\n\n public static final int STATUS_TEMPERATURE_0 = 0xF710;\n public static final int STATUS_TEMPERATURE_1 = 0xF711;\n public static final int STATUS_TEMPERATURE_2 = 0xF712;\n public static final int STATUS_TEMPERATURE_3 = 0xF713;\n public static final int STATUS_TEMPERATURE_4 = 0xF714;\n public static final int STATUS_TEMPERATURE_5 = 0xF715;\n public static final int STATUS_TEMPERATURE_6 = 0xF716;\n public static final int STATUS_TEMPERATURE_7 = 0xF717;\n // Description:\n // Temperature value\n // Notes:\n // - Client should include at least the field FIELD_TEMP_AVER in the \n // event packet, and may also wish to include FIELD_TEMP_LOW and\n // FIELD_TEMP_HIGH.\n\n public static final int STATUS_TEMPERATURE_RANGE_0 = 0xF730;\n public static final int STATUS_TEMPERATURE_RANGE_1 = 0xF731;\n public static final int STATUS_TEMPERATURE_RANGE_2 = 0xF732;\n public static final int STATUS_TEMPERATURE_RANGE_3 = 0xF733;\n public static final int STATUS_TEMPERATURE_RANGE_4 = 0xF734;\n public static final int STATUS_TEMPERATURE_RANGE_5 = 0xF735;\n public static final int STATUS_TEMPERATURE_RANGE_6 = 0xF736;\n public static final int STATUS_TEMPERATURE_RANGE_7 = 0xF737;\n // Description:\n // Temperature value out-of-range [low/high/average]\n // Notes:\n // - Client should include at least one of the fields FIELD_TEMP_AVER,\n // FIELD_TEMP_LOW, or FIELD_TEMP_HIGH.\n\n public static final int STATUS_TEMPERATURE = 0xF7F1;\n // Description:\n // All temperature averages [aver/aver/aver/...]\n\n// ----------------------------------------------------------------------------\n// Miscellaneous\n\n public static final int STATUS_LOGIN = 0xF811;\n // Description:\n // Generic 'login'\n\n public static final int STATUS_LOGOUT = 0xF812;\n // Description:\n // Generic 'logout'\n\n public static final int STATUS_CONNECT = 0xF821;\n // Description:\n // Connect/Hook/On\n\n public static final int STATUS_DISCONNECT = 0xF822;\n // Description:\n // Disconnect/Drop/Off\n\n public static final int STATUS_ACK = 0xF831;\n // Description:\n // Acknowledge\n\n public static final int STATUS_NAK = 0xF832;\n // Description:\n // Negative Acknowledge\n\n// ----------------------------------------------------------------------------\n// Internal device status\n\n public static final int STATUS_LOW_BATTERY = 0xFD10;\n // Description:\n // Low battery indicator\n\n public static final int STATUS_POWER_FAILURE = 0xFD13;\n // Description:\n // Power failure indicator\n\n// ----------------------------------------------------------------------------\n \n}", "String getFaultReasonValue();", "private String getReason(){\r\n\t\tString reason=null;\r\n\t\tswitch (mReason) {\r\n\t\tcase TRANSPORTER_NOT_READY:\r\n\t\t\treason=\"Transporter not ready\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase INVALID_KEY:\r\n\t\t\treason=\"Invalid key\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase VALUE_NOT_FOUND:\r\n\t\t\treason=\"Value not found\";\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\treason=\"Unknown\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn reason;\r\n\t}", "@Given(\"^an invalid or missing token and making a POST request to account_ID_info then it should return a (\\\\d+) and an empty body$\")\n\tpublic void an_invalid_or_missing_token_and_making_a_POST_request_to_account_ID_info_then_it_should_return_a_and_an_empty_body(int StatusCode) throws Throwable {\n\t\tPostInfo.POST_account_id_info_API_UnAuthorized();\n\t try{}catch(Exception e){}\n\t}", "org.hl7.fhir.String getReason();", "public java.lang.CharSequence getResponseCode() {\n return ResponseCode;\n }", "protected Response checkResponse(Response plainAnswer) throws WSException{\n if(plainAnswer!=null)\n switch(plainAnswer.getStatus()){\n //good answers\n case 200: {\n return plainAnswer;\n }//OK\n case 202: {\n return plainAnswer;\n }//ACCEPTED \n case 201: {\n return plainAnswer;\n }//CREATED\n //To be evaluate\n case 204: {\n return plainAnswer;\n }//NO_CONTENT\n //bad answers\n case 400: {\n throw new WSException400(\"BAD REQUEST! The action can't be completed\");\n }//BAD_REQUEST \n case 409: {\n throw new WSException409(\"CONFLICT! The action can't be completed\");\n }//CONFLICT \n case 403: {\n throw new WSException403(\"FORBIDDEN!The action can't be completed\");\n }//FORBIDDEN \n case 410: {\n throw new WSException410(\"GONE! The action can't be completed\");\n }//GONE\n case 500: {\n throw new WSException500(\"INTERNAL_SERVER_ERROR! The action can't be completed\");\n }//INTERNAL_SERVER_ERROR \n case 301: {\n throw new WSException301(\"MOVED_PERMANENTLY! The action can't be completed\");\n }//MOVED_PERMANENTLY \n case 406: {\n throw new WSException406(\"NOT_ACCEPTABLE! The action can't be completed\");\n }//NOT_ACCEPTABLE\n case 404: {\n throw new WSException404(\"NOT_FOUND! The action can't be completed\");\n }//NOT_FOUND\n case 304: {\n throw new WSException304(\"NOT_MODIFIED! The action can't be completed\");\n }//NOT_MODIFIED \n case 412: {\n throw new WSException412(\"PRECONDITION_FAILED! The action can't be completed\");\n }//PRECONDITION_FAILED \n case 303: {\n throw new WSException303(\"SEE_OTHER! The action can't be completed\");\n }//SEE_OTHER\n case 503: {\n throw new WSException503(\"SERVICE_UNAVAILABLE! The action can't be completed\");\n }//SERVICE_UNAVAILABLE\n case 307: {\n throw new WSException307(\"TEMPORARY_REDIRECT! The action can't be completed\");\n }//TEMPORARY_REDIRECT \n case 401: {\n throw new WSException401(\"UNAUTHORIZED! The action can't be completed\");\n }//UNAUTHORIZED \n case 415: {\n throw new WSException415(\"UNSUPPORTED_MEDIA_TYPE! The action can't be completed\");\n }//UNSUPPORTED_MEDIA_TYPE \n }\n return plainAnswer;\n }", "@Test\n\tpublic void requestDataForCustomer99999_checkResponseCode_expect404() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "@Test\n public void negativeScenario(){\n // when().get(\"http://34.223.219.142:1212/ords/hr/employees/1234\")\n // .then().statusCode(404);\n Response response = when().get(\"http://34.223.219.142:1212/ords/hr/employees/1234\");\n assertEquals(response.statusCode(),404);\n assertTrue(response.asString().contains(\"Not Found\"));\n response.prettyPrint();\n\n }", "int getUnknown1();", "int getUnknown1();", "int getUnknown1();", "int getUnknown1();" ]
[ "0.64298767", "0.63812417", "0.6269923", "0.6268598", "0.6114375", "0.5882913", "0.586011", "0.586011", "0.58224994", "0.58183", "0.58076304", "0.57858354", "0.57736635", "0.5733148", "0.5708186", "0.5699124", "0.5684368", "0.5682947", "0.56318396", "0.5608846", "0.56069756", "0.5606131", "0.5582437", "0.55685955", "0.5565737", "0.55560976", "0.55535907", "0.5552171", "0.5552171", "0.5536467", "0.5533346", "0.5527261", "0.55224276", "0.55160713", "0.55159044", "0.5515068", "0.54961526", "0.54951227", "0.5493359", "0.5491325", "0.54783785", "0.54757273", "0.5475495", "0.5475495", "0.5469078", "0.54594785", "0.544523", "0.5444175", "0.5443611", "0.54373354", "0.5435768", "0.54237425", "0.5414194", "0.54138064", "0.5406785", "0.5389928", "0.5388187", "0.53850526", "0.53849196", "0.53849196", "0.53822196", "0.53822196", "0.5380416", "0.5380416", "0.5378675", "0.53644276", "0.535726", "0.5348232", "0.53447634", "0.53447634", "0.53447634", "0.53447634", "0.53390336", "0.532702", "0.5326656", "0.53176427", "0.53175724", "0.5305117", "0.5305117", "0.5305117", "0.5305117", "0.5304502", "0.5300069", "0.52958983", "0.52948475", "0.52931213", "0.52922463", "0.52904415", "0.5285153", "0.528223", "0.52783334", "0.5268718", "0.5267672", "0.5265815", "0.52656066", "0.52634394", "0.5254964", "0.5254964", "0.5254964", "0.5254964" ]
0.6024103
5
getResponseDescription() This function uses the QSI AVS Result Code retrieved from the Digital Receipt and returns an appropriate description for this code.
private String displayAVSResponse(String vAVSResultCode) { String result = ""; if (vAVSResultCode != null || vAVSResultCode.length() == 0) { if (vAVSResultCode.equalsIgnoreCase("Unsupported") || vAVSResultCode.equalsIgnoreCase("No Value Returned")) { result = "AVS not supported or there was no AVS data provided"; } else { // Java cannot switch on a string so turn everything to a char char input = vAVSResultCode.charAt(0); switch (input) { case 'X': result = "Exact match - address and 9 digit ZIP/postal code"; break; case 'Y': result = "Exact match - address and 5 digit ZIP/postal code"; break; case 'S': result = "Service not supported or address not verified (international transaction)"; break; case 'G': result = "Issuer does not participate in AVS (international transaction)"; break; case 'A': result = "Address match only"; break; case 'W': result = "9 digit ZIP/postal code matched, Address not Matched"; break; case 'Z': result = "5 digit ZIP/postal code matched, Address not Matched"; break; case 'R': result = "Issuer system is unavailable"; break; case 'U': result = "Address unavailable or not verified"; break; case 'E': result = "Address and ZIP/postal code not provided"; break; case 'N': result = "Address and ZIP/postal code not matched"; break; case '0': result = "AVS not requested"; break; default: result = "Unable to be determined"; } } } else { result = "null response"; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getResponseDescription(String vResponseCode) {\r\n\r\n\t\tString result = \"\";\r\n\r\n\t\t// check if a single digit response code\r\n\t\tif (vResponseCode.length() != 1) {\r\n\r\n\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\tchar input = vResponseCode.charAt(0);\r\n\r\n\t\t\tswitch (input) {\r\n\t\t\tcase '0':\r\n\t\t\t\tresult = \"Transaction Successful\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '1':\r\n\t\t\t\tresult = \"Unknown Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '2':\r\n\t\t\t\tresult = \"Bank Declined Transaction\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '3':\r\n\t\t\t\tresult = \"No Reply from Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '4':\r\n\t\t\t\tresult = \"Expired Card\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '5':\r\n\t\t\t\tresult = \"Insufficient Funds\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '6':\r\n\t\t\t\tresult = \"Error Communicating with Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '7':\r\n\t\t\t\tresult = \"Payment Server System Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '8':\r\n\t\t\t\tresult = \"Transaction Type Not Supported\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '9':\r\n\t\t\t\tresult = \"Bank declined transaction (Do not contact Bank)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'A':\r\n\t\t\t\tresult = \"Transaction Aborted\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'C':\r\n\t\t\t\tresult = \"Transaction Cancelled\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'D':\r\n\t\t\t\tresult = \"Deferred transaction has been received and is awaiting processing\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'F':\r\n\t\t\t\tresult = \"3D Secure Authentication failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'I':\r\n\t\t\t\tresult = \"Card Security Code verification failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'L':\r\n\t\t\t\tresult = \"Shopping Transaction Locked (Please try the transaction again later)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'N':\r\n\t\t\t\tresult = \"Cardholder is not enrolled in Authentication Scheme\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'P':\r\n\t\t\t\tresult = \"Transaction has been received by the Payment Adaptor and is being processed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'R':\r\n\t\t\t\tresult = \"Transaction was not processed - Reached limit of retry attempts allowed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'S':\r\n\t\t\t\tresult = \"Duplicate SessionID (OrderInfo)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'T':\r\n\t\t\t\tresult = \"Address Verification Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'U':\r\n\t\t\t\tresult = \"Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'V':\r\n\t\t\t\tresult = \"Address Verification and Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '?':\r\n\t\t\t\tresult = \"Transaction status is unknown\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t} else {\r\n\t\t\treturn \"No Value Returned\";\r\n\t\t}\r\n\t}", "private String getRespDesc(String _code)\r\n {\r\n int resultCode = -1;\r\n\r\n try\r\n {\r\n resultCode = Integer.valueOf(_code);\r\n } catch (NumberFormatException e)\r\n {\r\n // just in case the code isn't a number\r\n return \"Format of RESULT code unexpected\";\r\n }\r\n\r\n if (resultCode < 0)\r\n {\r\n return \"Communication error\";\r\n }\r\n\r\n String ret = \"unknown\";\r\n switch (resultCode)\r\n {\r\n case 0:\r\n ret = \"Approved\";\r\n break;\r\n case 1:\r\n ret = \"User authentication failed\";\r\n break;\r\n case 2:\r\n ret = \"Invalid tender type\";\r\n break;\r\n case 3:\r\n ret = \"Invalid transaction type\";\r\n break;\r\n case 4:\r\n ret = \"Invalid amount format\";\r\n break;\r\n case 5:\r\n ret = \"Invalid merchant information\";\r\n break;\r\n case 6:\r\n ret = \"Invalid or unsupported currency code\";\r\n break;\r\n case 7:\r\n ret = \"Field format error\";\r\n break;\r\n case 8:\r\n ret = \"Not a transaction server\";\r\n break;\r\n case 9:\r\n ret = \"Too many parameters or invalid stream\";\r\n break;\r\n case 10:\r\n ret = \"Too many line items\";\r\n break;\r\n case 11:\r\n ret = \"Client time-out waiting for response\";\r\n break;\r\n case 12:\r\n ret = \"Declined\";\r\n break;\r\n case 13:\r\n ret = \"Referral\";\r\n break;\r\n case 19:\r\n ret = \"Original transaction ID not found\";\r\n break;\r\n case 20:\r\n ret = \"Cannot find the customer reference number\";\r\n break;\r\n case 22:\r\n ret = \"Invalid ABA number\";\r\n break;\r\n case 23:\r\n ret = \"Invalid account number\";\r\n break;\r\n case 24:\r\n ret = \"Invalid expiration date\";\r\n break;\r\n case 25:\r\n ret = \"Invalid Host Mapping\";\r\n break;\r\n case 26:\r\n ret = \"Invalid vendor account\";\r\n break;\r\n case 27:\r\n ret = \"Insufficient partner permissions\";\r\n break;\r\n case 28:\r\n ret = \"Insufficient user permissions\";\r\n break;\r\n case 29:\r\n ret = \"Invalid XML document\";\r\n break;\r\n case 30:\r\n ret = \"Duplicate transaction\";\r\n break;\r\n case 31:\r\n ret = \"Error in adding the recurring profile\";\r\n break;\r\n case 32:\r\n ret = \"Error in modifying the recurring profile\";\r\n break;\r\n case 33:\r\n ret = \"Error in canceling the recurring profile\";\r\n break;\r\n case 34:\r\n ret = \"Error in forcing the recurring profile\";\r\n break;\r\n case 35:\r\n ret = \"Error in reactivating the recurring profile\";\r\n break;\r\n case 36:\r\n ret = \"OLTP Transaction failed\";\r\n break;\r\n case 37:\r\n ret = \"Invalid recurring profile ID\";\r\n break;\r\n case 50:\r\n ret = \"Insufficient funds available in account\";\r\n break;\r\n case 51:\r\n ret = \"Exceeds per transaction limit\";\r\n break;\r\n case 99:\r\n ret = \"General error. See RESPMSG.\";\r\n break;\r\n case 100:\r\n ret = \"Transaction type not supported by host\";\r\n break;\r\n case 101:\r\n ret = \"Time-out value too small\";\r\n break;\r\n case 102:\r\n ret = \"Processor not available\";\r\n break;\r\n case 103:\r\n ret = \"Error reading response from host\";\r\n break;\r\n case 104:\r\n ret = \"Timeout waiting for processor response\";\r\n break;\r\n case 105:\r\n ret = \"Credit error\";\r\n break;\r\n case 106:\r\n ret = \"Host not available\";\r\n break;\r\n case 107:\r\n ret = \"Duplicate suppression time-out\";\r\n break;\r\n case 108:\r\n ret = \"Void error\";\r\n break;\r\n case 109:\r\n ret = \"Time-out waiting for host response\";\r\n break;\r\n case 110:\r\n ret = \"Referenced auth (against order) Error\";\r\n break;\r\n case 111:\r\n ret = \"Capture error\";\r\n break;\r\n case 112:\r\n ret = \"Failed AVS check\";\r\n break;\r\n case 113:\r\n ret = \"Merchant sale exceeds the sales cap\";\r\n break;\r\n case 114:\r\n ret = \"Card Security Code (CSC) Mismatch.\";\r\n break;\r\n case 115:\r\n ret = \"System busy, try again later\";\r\n break;\r\n case 116:\r\n ret = \"VPS Internal error\";\r\n break;\r\n case 117:\r\n ret = \"Failed merchant rule check\";\r\n break;\r\n case 118:\r\n ret = \"Invalid keywords found in string fields\";\r\n break;\r\n case 120:\r\n ret = \"Attempt to reference a failed transaction\";\r\n break;\r\n case 121:\r\n ret = \"Not enabled for feature\";\r\n break;\r\n case 122:\r\n ret = \"Merchant sale exceeds the credit cap\";\r\n break;\r\n case 125:\r\n ret = \"Declined by filters\";\r\n break;\r\n case 126:\r\n ret = \"Authorized but triggered a Fraud Filter\";\r\n break;\r\n case 127:\r\n ret = \"Not processed by filters\";\r\n break;\r\n case 128:\r\n ret = \"Declined by merchant\";\r\n break;\r\n case 132:\r\n ret = \"Card has not been submitted for update\";\r\n break;\r\n case 133:\r\n ret = \"Data mismatch in HTTP retry request\";\r\n break;\r\n case 150:\r\n ret = \"Issuing bank timed out\";\r\n break;\r\n case 151:\r\n ret = \"Issuing bank unavailable\";\r\n break;\r\n case 201:\r\n ret = \"Order error\";\r\n break;\r\n case 1000:\r\n ret = \"Generic host error\";\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return ret;\r\n }", "public String getResponseDescription() {\n return responseDescription;\n }", "private String displayCSCResponse(String vCSCResultCode) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vCSCResultCode != null || vCSCResultCode.length() == 0) {\r\n\r\n\t\t\tif (vCSCResultCode.equalsIgnoreCase(\"Unsupported\") || vCSCResultCode.equalsIgnoreCase(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"CSC not supported or there was no CSC data provided\";\r\n\t\t\t} else {\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\t\tchar input = vCSCResultCode.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'M':\r\n\t\t\t\t\tresult = \"Exact code match\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"Merchant has indicated that CSC is not present on the card (MOTO situation)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'P':\r\n\t\t\t\t\tresult = \"Code not processed\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"Card issuer is not registered and/or certified\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"Code invalid or not matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private String getStatusDescription(String vStatus) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vStatus != null && !vStatus.equals(\"\")) {\r\n\r\n\t\t\tif (vStatus.equalsIgnoreCase(\"Unsupported\") || vStatus.equals(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"3DS not supported or there was no 3DS data provided\";\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a\r\n\t\t\t\t// character\r\n\t\t\t\tchar input = vStatus.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'Y':\r\n\t\t\t\t\tresult = \"The cardholder was successfully authenticated.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'E':\r\n\t\t\t\t\tresult = \"The cardholder is not enrolled.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"The cardholder was not verified.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"The cardholder's Issuer was unable to authenticate due to some system error at the Issuer.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'F':\r\n\t\t\t\t\tresult = \"There was an error in the format of the request from the merchant.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'A':\r\n\t\t\t\t\tresult = \"Authentication of your Merchant ID and Password to the ACS Directory Failed.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'D':\r\n\t\t\t\t\tresult = \"Error communicating with the Directory Server.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'C':\r\n\t\t\t\t\tresult = \"The card type is not supported for authentication.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"The signature on the response received from the Issuer could not be validated.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'P':\r\n\t\t\t\t\tresult = \"Error parsing input from Issuer.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'I':\r\n\t\t\t\t\tresult = \"Internal Payment Server system error.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public String getDescription() {\n\t\tif (iDescription == null) {\n\n\t\t\tif (iExtendedReason != null) {\n\t\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\t\tint i = 0;\n\n\t\t\t\tsb.append('(');\n\t\t\t\tsb.append(iReason);\n\t\t\t\tsb.append(\": \");\n\t\t\t\tfor (; i < iExtendedReason.length - 1; i++) {\n\t\t\t\t\tif (iExtendedReason[i] != null) {\n\t\t\t\t\t\tsb.append(iExtendedReason[i].toString());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsb.append(\"null\");\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(',');\n\t\t\t\t}\n\t\t\t\tsb.append(iExtendedReason[i]);\n\t\t\t\tsb.append(')');\n\t\t\t\tsb.insert(0, iReason);\n\t\t\t\treturn sb.toString();\n\t\t\t}\n\t\t\treturn iReason;\n\t\t}\n\t\treturn iDescription;\n\t}", "public String getDescription(){\r\n \tString retVal = this.description;\r\n return retVal;\r\n }", "java.lang.String getProductDescription();", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.CharSequence getResponseCode() {\n return ResponseCode;\n }", "public com.google.protobuf.ByteString\n getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "static String getDesc(String code) {\n\t\tString[] str = errorMap.get(code);\n\t\tif (str == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn str[1];\n\t}", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n description_ = s;\n }\n return s;\n }\n }", "public com.google.protobuf.ByteString\n getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getDescription() throws Exception{\n\treturn strDesc;\n }", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getREASON_DESC() {\r\n return REASON_DESC;\r\n }", "public com.google.protobuf.ByteString\n getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public java.lang.CharSequence getResponseCode() {\n return ResponseCode;\n }", "public com.google.protobuf.ByteString\n getDescriptionBytes() {\n Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "java.lang.String getDescription();", "public String getDescription() throws com.sun.star.uno.RuntimeException {\n\t\treturn _description;\n\t}", "public String getAVS()\n\t{\n\t\tif(response.containsKey(\"AVS\")) {\n\t\t\treturn response.get(\"AVS\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public ST getProductServiceCodeDescription() { \r\n\t\tST retVal = this.getTypedField(9, 0);\r\n\t\treturn retVal;\r\n }", "java.lang.String getBuyDescribe();", "com.google.protobuf.ByteString getDescriptionBytes();", "com.google.protobuf.ByteString getDescriptionBytes();", "com.google.protobuf.ByteString getDescriptionBytes();", "com.google.protobuf.ByteString getDescriptionBytes();", "com.google.protobuf.ByteString getDescriptionBytes();", "com.google.protobuf.ByteString getDescriptionBytes();", "@java.lang.Override\n public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public com.google.protobuf.ByteString\n getDescriptionBytes() {\n Object ref = description_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n }\n }", "public String getDescription() {\n return sdesc;\n }", "@java.lang.Override\n public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n }\n }", "@java.lang.Override\n public java.lang.String getDescription() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n description_ = s;\n return s;\n }\n }", "private String getResponseString(byte[] response, int errorCode) {\n if (errorCode == BluetoothReader.ERROR_SUCCESS) {\n if (response != null && response.length > 0) {\n return Utils.toHexString(response);\n }\n return \"\";\n }\n return getErrorString(errorCode);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getDescriptionBytes() {\n java.lang.Object ref = description_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n description_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public AXValue getDescription() {\n return description;\n }", "java.lang.String getDesc();", "public static String createDiscoverResponseMessage(){\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(\"HTTP/1.1 200 OK\").append(\"\\n\");\n\t\tsb.append(\"CACHE-CONTROL: max-age=1200\").append(\"\\n\");\n\t\tsb.append(\"DATE: Tue, 05 May 2009 13:31:51 GMT\").append(\"\\n\");\n\t\tsb.append(\"LOCATION: http://142.225.35.55:5001/description/fetch\").append(\"\\n\");\n\t\tsb.append(\"SERVER: Windows_XP-x86-5.1, UPnP/1.0, PMS/1.11\").append(\"\\n\");\n\t\tsb.append(\"ST: upnp:rootdevice\").append(\"\\n\");\n\t\tsb.append(\"EXT: \").append(\"\\n\");\n\t\tsb.append(\"USN: uuid:9dcf6222-fc4b-33eb-bf49-e54643b4f416::upnp:rootdevice\").append(\"\\n\");\n\t\tsb.append(\"Content-Length: 0\").append(\"\\n\");\n\t\t\n\t\treturn sb.toString();\n\t}", "public static String getGameDescription(int GAME_ID ) { \n\t\tSystem.out.println(\"--->[WebScraping][getGameDescription] Getting Description for game_id = \" + GAME_ID);\n\t\t\n\t\tString gameDescription = \"No description available\";\n\t\t//Create http object for request\n\t\tHttpClient objRequest = new HttpClient();\n\t\t\n\t\t try {\n\t System.out.println(\"--->[WebScraping][getGameDescription] Sending Http GET request for GameDescription\");\n\t try {\n\t\t\t\t\tgameDescription = objRequest.sendGetGameDescription(GAME_ID);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"--->[WebScraping][getGameDescription] Something went wrong in sending http request\" + e.getMessage());\n\t\t\t\t}\n\n\t } finally {\n\t try {\n\t\t\t\t\tobjRequest.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tSystem.out.println(\"--->[WebScraping][getGameDescription] Something went wrong in closing http request\" + e.getMessage());\n\t\t\t\t}\n\t }\n\t\t\n\t\t System.out.println(\"--->[WebScraping][getGameDescription] Returning Description\");\n\t\treturn gameDescription; \n\t}", "public String getDescription()\r\n {\r\n return this.aDescription ;\r\n }", "com.google.protobuf.ByteString\n getDescriptionBytes();", "@ApiModelProperty(value = \"The decoded text description for this amenity code, where available.\")\n public String getDescription() {\n return description;\n }", "public String getDescription(){\n return getString(KEY_DESCRIPTION);\n }", "public String getDescription() {\n Object ref = description_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n description_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public static String getErrorDescription(int errCode) {\n switch (errCode) {\n case ERROR_PACKET_HEADER:\n return \"Invalid packet header\";\n case ERROR_PACKET_TYPE:\n return \"Invalid packet type\";\n case ERROR_PACKET_LENGTH:\n return \"Invalid packet length\";\n case ERROR_PACKET_ENCODING:\n return \"Unsupported packet encoding\";\n case ERROR_PACKET_PAYLOAD:\n return \"Invalid packet payload\";\n case ERROR_PACKET_CHECKSUM:\n return \"Invalid checksum\";\n case ERROR_PACKET_ACK:\n return \"Invalid ACL sequence\";\n case ERROR_PROTOCOL_ERROR:\n return \"Protocol error\";\n case ERROR_PROPERTY_READ_ONLY:\n return \"Property is read-only\";\n case ERROR_PROPERTY_WRITE_ONLY:\n return \"Property is write-only\";\n case ERROR_PROPERTY_INVALID_ID:\n return \"Invalid/Unrecognized property key\";\n case ERROR_PROPERTY_INVALID_VALUE:\n return \"Invalid propery value\";\n case ERROR_PROPERTY_UNKNOWN_ERROR:\n return \"Unknown property error\";\n case ERROR_COMMAND_INVALID:\n return \"Invalid/Unsupported command\";\n case ERROR_COMMAND_ERROR:\n return \"Command error\";\n case ERROR_UPLOAD_TYPE:\n return \"Invalid upload type\";\n case ERROR_UPLOAD_LENGTH:\n return \"Invalid upload length\";\n case ERROR_UPLOAD_OFFSET_OVERLAP:\n return \"Upload offset overlap\";\n case ERROR_UPLOAD_OFFSET_GAP:\n return \"Upload offset gap\";\n case ERROR_UPLOAD_OFFSET_OVERFLOW:\n return \"Upload offset overflow\";\n case ERROR_UPLOAD_FILE_NAME:\n return \"Invalid uploaded filename\";\n case ERROR_UPLOAD_CHECKSUM:\n return \"Invalid uploaded checksum\";\n case ERROR_UPLOAD_SAVE:\n return \"Unable to save uploaded file\";\n case ERROR_GPS_EXPIRED:\n return \"GPS fix expired\";\n case ERROR_GPS_FAILURE:\n return \"GPS failure\";\n }\n if ((errCode >= ERROR_INTERNAL_ERROR_00) && (errCode <= ERROR_INTERNAL_ERROR_0F)) {\n return \"Internal error\";\n }\n return \"Unknown [\" + StringTools.toHexString(errCode, 16) + \"]\";\n }", "public String getResBookDesigCode() {\n return resBookDesigCode;\n }", "public ST getPsl9_ProductServiceCodeDescription() { \r\n\t\tST retVal = this.getTypedField(9, 0);\r\n\t\treturn retVal;\r\n }", "public String getDescription() {\n\t\treturn (String) get_Value(\"Description\");\n\t}", "public String getDescription() {\n\t\treturn (String) get_Value(\"Description\");\n\t}", "public String getDescription() {\n\t\treturn (String) get_Value(\"Description\");\n\t}", "public String getDescription() {\n\t\treturn (String) get_Value(\"Description\");\n\t}", "public java.lang.String getDescription() {\r\n return this._description;\r\n }", "public java.lang.String getDescription() {\r\n return this._description;\r\n }", "public String getDescriptionText() {\n return m_DescriptionText;\n }", "public java.lang.String getDescription()\n {\n return this._description;\n }", "public java.lang.String getDescription() {\n return this._description;\n }", "public java.lang.String getDescription(){\r\n return this.description;\r\n }", "String getSlingDescription();", "public String getRespcode() {\n\t\treturn respcode;\n\t}", "public String getDescription() {\r\n return _description;\r\n }", "x0401.oecdStandardAuditFileTaxPT1.SAFPTProductDescription xgetProductDescription();", "public java.lang.String getDescription() {\n return description;\n }", "protected String getDescription()\n {\n return description;\n }", "public String getResponseCode() {\n return responseCode;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"responseCode:\" + responseCode + \", dataType:\" + dataType + \", responseData.toString():\"\n\t\t\t\t+ responseData.toString();\n\t}", "public java.lang.String getDescription() {\n return description;\n }", "@Override\r\n\tpublic String getDescription() {\n\t\tString descr=\"Results\";\r\n\t\treturn descr;\r\n\t}", "java.lang.String getDescribe();", "public java.lang.String getDescription() {\r\n return description;\r\n }", "public java.lang.String getDescription() {\r\n return description;\r\n }", "public java.lang.String getDescription() {\r\n return description;\r\n }" ]
[ "0.7593404", "0.7113849", "0.6300301", "0.619742", "0.59471893", "0.5798079", "0.5693098", "0.5666145", "0.5651989", "0.56289566", "0.5625578", "0.5618323", "0.5613176", "0.56099105", "0.55937046", "0.559241", "0.5590374", "0.5590374", "0.5590374", "0.5590374", "0.5590374", "0.55882525", "0.55882525", "0.55882525", "0.55882525", "0.55882525", "0.5572288", "0.5570088", "0.5566033", "0.5554911", "0.551458", "0.551458", "0.551458", "0.551458", "0.551458", "0.551458", "0.551458", "0.551458", "0.551458", "0.55034333", "0.5492109", "0.5489959", "0.5470879", "0.54590267", "0.54590267", "0.54590267", "0.54590267", "0.54590267", "0.54590267", "0.5441352", "0.5441352", "0.5441352", "0.5441352", "0.5441352", "0.54293525", "0.5412439", "0.5410646", "0.54050624", "0.54050624", "0.54050624", "0.54050624", "0.54050624", "0.54045016", "0.5395403", "0.5394089", "0.5391877", "0.53877515", "0.53781605", "0.5376148", "0.53694725", "0.5342272", "0.5339322", "0.5336118", "0.5329125", "0.5326638", "0.53103536", "0.5306786", "0.5306786", "0.5306786", "0.5306786", "0.52916485", "0.52916485", "0.528528", "0.5272935", "0.5271848", "0.5265532", "0.525493", "0.52430534", "0.52387357", "0.5233252", "0.5226267", "0.5222593", "0.5221973", "0.5221496", "0.5220694", "0.5209208", "0.52008337", "0.5188192", "0.5188192", "0.5188192" ]
0.651103
2
This function uses the QSI CSC Result Code retrieved from the Digital Receipt and returns an appropriate description for this code.
private String displayCSCResponse(String vCSCResultCode) { String result = ""; if (vCSCResultCode != null || vCSCResultCode.length() == 0) { if (vCSCResultCode.equalsIgnoreCase("Unsupported") || vCSCResultCode.equalsIgnoreCase("No Value Returned")) { result = "CSC not supported or there was no CSC data provided"; } else { // Java cannot switch on a string so turn everything to a char char input = vCSCResultCode.charAt(0); switch (input) { case 'M': result = "Exact code match"; break; case 'S': result = "Merchant has indicated that CSC is not present on the card (MOTO situation)"; break; case 'P': result = "Code not processed"; break; case 'U': result = "Card issuer is not registered and/or certified"; break; case 'N': result = "Code invalid or not matched"; break; default: result = "Unable to be determined"; } } } else { result = "null response"; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getResponseDescription(String vResponseCode) {\r\n\r\n\t\tString result = \"\";\r\n\r\n\t\t// check if a single digit response code\r\n\t\tif (vResponseCode.length() != 1) {\r\n\r\n\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\tchar input = vResponseCode.charAt(0);\r\n\r\n\t\t\tswitch (input) {\r\n\t\t\tcase '0':\r\n\t\t\t\tresult = \"Transaction Successful\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '1':\r\n\t\t\t\tresult = \"Unknown Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '2':\r\n\t\t\t\tresult = \"Bank Declined Transaction\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '3':\r\n\t\t\t\tresult = \"No Reply from Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '4':\r\n\t\t\t\tresult = \"Expired Card\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '5':\r\n\t\t\t\tresult = \"Insufficient Funds\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '6':\r\n\t\t\t\tresult = \"Error Communicating with Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '7':\r\n\t\t\t\tresult = \"Payment Server System Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '8':\r\n\t\t\t\tresult = \"Transaction Type Not Supported\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '9':\r\n\t\t\t\tresult = \"Bank declined transaction (Do not contact Bank)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'A':\r\n\t\t\t\tresult = \"Transaction Aborted\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'C':\r\n\t\t\t\tresult = \"Transaction Cancelled\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'D':\r\n\t\t\t\tresult = \"Deferred transaction has been received and is awaiting processing\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'F':\r\n\t\t\t\tresult = \"3D Secure Authentication failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'I':\r\n\t\t\t\tresult = \"Card Security Code verification failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'L':\r\n\t\t\t\tresult = \"Shopping Transaction Locked (Please try the transaction again later)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'N':\r\n\t\t\t\tresult = \"Cardholder is not enrolled in Authentication Scheme\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'P':\r\n\t\t\t\tresult = \"Transaction has been received by the Payment Adaptor and is being processed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'R':\r\n\t\t\t\tresult = \"Transaction was not processed - Reached limit of retry attempts allowed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'S':\r\n\t\t\t\tresult = \"Duplicate SessionID (OrderInfo)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'T':\r\n\t\t\t\tresult = \"Address Verification Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'U':\r\n\t\t\t\tresult = \"Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'V':\r\n\t\t\t\tresult = \"Address Verification and Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '?':\r\n\t\t\t\tresult = \"Transaction status is unknown\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t} else {\r\n\t\t\treturn \"No Value Returned\";\r\n\t\t}\r\n\t}", "private String getRespDesc(String _code)\r\n {\r\n int resultCode = -1;\r\n\r\n try\r\n {\r\n resultCode = Integer.valueOf(_code);\r\n } catch (NumberFormatException e)\r\n {\r\n // just in case the code isn't a number\r\n return \"Format of RESULT code unexpected\";\r\n }\r\n\r\n if (resultCode < 0)\r\n {\r\n return \"Communication error\";\r\n }\r\n\r\n String ret = \"unknown\";\r\n switch (resultCode)\r\n {\r\n case 0:\r\n ret = \"Approved\";\r\n break;\r\n case 1:\r\n ret = \"User authentication failed\";\r\n break;\r\n case 2:\r\n ret = \"Invalid tender type\";\r\n break;\r\n case 3:\r\n ret = \"Invalid transaction type\";\r\n break;\r\n case 4:\r\n ret = \"Invalid amount format\";\r\n break;\r\n case 5:\r\n ret = \"Invalid merchant information\";\r\n break;\r\n case 6:\r\n ret = \"Invalid or unsupported currency code\";\r\n break;\r\n case 7:\r\n ret = \"Field format error\";\r\n break;\r\n case 8:\r\n ret = \"Not a transaction server\";\r\n break;\r\n case 9:\r\n ret = \"Too many parameters or invalid stream\";\r\n break;\r\n case 10:\r\n ret = \"Too many line items\";\r\n break;\r\n case 11:\r\n ret = \"Client time-out waiting for response\";\r\n break;\r\n case 12:\r\n ret = \"Declined\";\r\n break;\r\n case 13:\r\n ret = \"Referral\";\r\n break;\r\n case 19:\r\n ret = \"Original transaction ID not found\";\r\n break;\r\n case 20:\r\n ret = \"Cannot find the customer reference number\";\r\n break;\r\n case 22:\r\n ret = \"Invalid ABA number\";\r\n break;\r\n case 23:\r\n ret = \"Invalid account number\";\r\n break;\r\n case 24:\r\n ret = \"Invalid expiration date\";\r\n break;\r\n case 25:\r\n ret = \"Invalid Host Mapping\";\r\n break;\r\n case 26:\r\n ret = \"Invalid vendor account\";\r\n break;\r\n case 27:\r\n ret = \"Insufficient partner permissions\";\r\n break;\r\n case 28:\r\n ret = \"Insufficient user permissions\";\r\n break;\r\n case 29:\r\n ret = \"Invalid XML document\";\r\n break;\r\n case 30:\r\n ret = \"Duplicate transaction\";\r\n break;\r\n case 31:\r\n ret = \"Error in adding the recurring profile\";\r\n break;\r\n case 32:\r\n ret = \"Error in modifying the recurring profile\";\r\n break;\r\n case 33:\r\n ret = \"Error in canceling the recurring profile\";\r\n break;\r\n case 34:\r\n ret = \"Error in forcing the recurring profile\";\r\n break;\r\n case 35:\r\n ret = \"Error in reactivating the recurring profile\";\r\n break;\r\n case 36:\r\n ret = \"OLTP Transaction failed\";\r\n break;\r\n case 37:\r\n ret = \"Invalid recurring profile ID\";\r\n break;\r\n case 50:\r\n ret = \"Insufficient funds available in account\";\r\n break;\r\n case 51:\r\n ret = \"Exceeds per transaction limit\";\r\n break;\r\n case 99:\r\n ret = \"General error. See RESPMSG.\";\r\n break;\r\n case 100:\r\n ret = \"Transaction type not supported by host\";\r\n break;\r\n case 101:\r\n ret = \"Time-out value too small\";\r\n break;\r\n case 102:\r\n ret = \"Processor not available\";\r\n break;\r\n case 103:\r\n ret = \"Error reading response from host\";\r\n break;\r\n case 104:\r\n ret = \"Timeout waiting for processor response\";\r\n break;\r\n case 105:\r\n ret = \"Credit error\";\r\n break;\r\n case 106:\r\n ret = \"Host not available\";\r\n break;\r\n case 107:\r\n ret = \"Duplicate suppression time-out\";\r\n break;\r\n case 108:\r\n ret = \"Void error\";\r\n break;\r\n case 109:\r\n ret = \"Time-out waiting for host response\";\r\n break;\r\n case 110:\r\n ret = \"Referenced auth (against order) Error\";\r\n break;\r\n case 111:\r\n ret = \"Capture error\";\r\n break;\r\n case 112:\r\n ret = \"Failed AVS check\";\r\n break;\r\n case 113:\r\n ret = \"Merchant sale exceeds the sales cap\";\r\n break;\r\n case 114:\r\n ret = \"Card Security Code (CSC) Mismatch.\";\r\n break;\r\n case 115:\r\n ret = \"System busy, try again later\";\r\n break;\r\n case 116:\r\n ret = \"VPS Internal error\";\r\n break;\r\n case 117:\r\n ret = \"Failed merchant rule check\";\r\n break;\r\n case 118:\r\n ret = \"Invalid keywords found in string fields\";\r\n break;\r\n case 120:\r\n ret = \"Attempt to reference a failed transaction\";\r\n break;\r\n case 121:\r\n ret = \"Not enabled for feature\";\r\n break;\r\n case 122:\r\n ret = \"Merchant sale exceeds the credit cap\";\r\n break;\r\n case 125:\r\n ret = \"Declined by filters\";\r\n break;\r\n case 126:\r\n ret = \"Authorized but triggered a Fraud Filter\";\r\n break;\r\n case 127:\r\n ret = \"Not processed by filters\";\r\n break;\r\n case 128:\r\n ret = \"Declined by merchant\";\r\n break;\r\n case 132:\r\n ret = \"Card has not been submitted for update\";\r\n break;\r\n case 133:\r\n ret = \"Data mismatch in HTTP retry request\";\r\n break;\r\n case 150:\r\n ret = \"Issuing bank timed out\";\r\n break;\r\n case 151:\r\n ret = \"Issuing bank unavailable\";\r\n break;\r\n case 201:\r\n ret = \"Order error\";\r\n break;\r\n case 1000:\r\n ret = \"Generic host error\";\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return ret;\r\n }", "private String displayAVSResponse(String vAVSResultCode) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vAVSResultCode != null || vAVSResultCode.length() == 0) {\r\n\r\n\t\t\tif (vAVSResultCode.equalsIgnoreCase(\"Unsupported\") || vAVSResultCode.equalsIgnoreCase(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"AVS not supported or there was no AVS data provided\";\r\n\t\t\t} else {\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\t\tchar input = vAVSResultCode.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'X':\r\n\t\t\t\t\tresult = \"Exact match - address and 9 digit ZIP/postal code\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Y':\r\n\t\t\t\t\tresult = \"Exact match - address and 5 digit ZIP/postal code\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"Service not supported or address not verified (international transaction)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'G':\r\n\t\t\t\t\tresult = \"Issuer does not participate in AVS (international transaction)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'A':\r\n\t\t\t\t\tresult = \"Address match only\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'W':\r\n\t\t\t\t\tresult = \"9 digit ZIP/postal code matched, Address not Matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Z':\r\n\t\t\t\t\tresult = \"5 digit ZIP/postal code matched, Address not Matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'R':\r\n\t\t\t\t\tresult = \"Issuer system is unavailable\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"Address unavailable or not verified\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'E':\r\n\t\t\t\t\tresult = \"Address and ZIP/postal code not provided\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"Address and ZIP/postal code not matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '0':\r\n\t\t\t\t\tresult = \"AVS not requested\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public interface ResultCode {\r\n\r\n\t/**\r\n\t * The categories of result codes\r\n\t */\r\n\tpublic enum Category {\r\n\t\t/**\r\n\t\t * General result codes - should be used only by very general and not\r\n\t\t * use-case specific results\r\n\t\t */\r\n\t\tVALIDATION(1),\r\n\t\t/** Category for parsing related results */\r\n\t\tMAIL(2),\r\n\t\t/** Category for DNS lookup related results */\r\n\t\tDNS(3),\r\n\t\t/** Category for SMTP negotiation results */\r\n\t\tSMTP(4);\r\n\r\n\t\t/** Category code */\r\n\t\tprivate int code = -1;\r\n\r\n\t\t/**\r\n\t\t * Private contructor\r\n\t\t * \r\n\t\t * @param code\r\n\t\t * The category code\r\n\t\t */\r\n\t\tCategory(int code) {\r\n\t\t\tthis.code = code;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Returns the category code\r\n\t\t * \r\n\t\t * @return The category code\r\n\t\t */\r\n\t\tpublic int getCode() {\r\n\t\t\treturn code;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * The type of the Result code;\r\n\t */\r\n\tpublic enum Type {\r\n\t\tLOGICAL, TECHNICAL\r\n\t}\r\n\r\n\t/**\r\n\t * <p>\r\n\t * Returns the result code.\r\n\t * </p>\r\n\t * <p>\r\n\t * <b>Note:</b> The code has to be unique in the result code category and the ordinal of the enumeration should\r\n\t * <i>not</i> be used. When somebody shuffles the enumeration the ordinal of a result code will change!\r\n\t * </p>\r\n\t * \r\n\t * @return The code\r\n\t */\r\n\tpublic int getCode();\r\n\r\n\t/**\r\n\t * Returns the category of a result code\r\n\t * \r\n\t * @return The category of a result code\r\n\t */\r\n\tpublic Category getCategory();\r\n\r\n\t/**\r\n\t * Returns the identifier of the result code. It will be three digits long\r\n\t * (one digits of the category and two of the code)\r\n\t * \r\n\t * @return An identifier\r\n\t */\r\n\tpublic String getIdentifier();\r\n\r\n\t/**\r\n\t * The name (enumeration) of the result code\r\n\t * \r\n\t * @return The name\r\n\t */\r\n\tpublic String name();\r\n\r\n\t/**\r\n\t * The type of the result code\r\n\t * \r\n\t * @return The type\r\n\t */\r\n\tpublic Type getType();\r\n}", "public java.lang.String getCxcode() {\r\r\r\r\r\r\r\n return cxcode;\r\r\r\r\r\r\r\n }", "public ST getProductServiceCodeDescription() { \r\n\t\tST retVal = this.getTypedField(9, 0);\r\n\t\treturn retVal;\r\n }", "private String getStatusDescription(String vStatus) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vStatus != null && !vStatus.equals(\"\")) {\r\n\r\n\t\t\tif (vStatus.equalsIgnoreCase(\"Unsupported\") || vStatus.equals(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"3DS not supported or there was no 3DS data provided\";\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a\r\n\t\t\t\t// character\r\n\t\t\t\tchar input = vStatus.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'Y':\r\n\t\t\t\t\tresult = \"The cardholder was successfully authenticated.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'E':\r\n\t\t\t\t\tresult = \"The cardholder is not enrolled.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"The cardholder was not verified.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"The cardholder's Issuer was unable to authenticate due to some system error at the Issuer.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'F':\r\n\t\t\t\t\tresult = \"There was an error in the format of the request from the merchant.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'A':\r\n\t\t\t\t\tresult = \"Authentication of your Merchant ID and Password to the ACS Directory Failed.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'D':\r\n\t\t\t\t\tresult = \"Error communicating with the Directory Server.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'C':\r\n\t\t\t\t\tresult = \"The card type is not supported for authentication.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"The signature on the response received from the Issuer could not be validated.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'P':\r\n\t\t\t\t\tresult = \"Error parsing input from Issuer.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'I':\r\n\t\t\t\t\tresult = \"Internal Payment Server system error.\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "java.lang.String getProductCode();", "public abstract String getCrcdReimbTypeCd();", "String mo729c() throws RemoteException;", "public ST getPsl9_ProductServiceCodeDescription() { \r\n\t\tST retVal = this.getTypedField(9, 0);\r\n\t\treturn retVal;\r\n }", "public IS getProductServiceClarificationCodeType() { \r\n\t\tIS retVal = this.getTypedField(17, 0);\r\n\t\treturn retVal;\r\n }", "public IS getPsl17_ProductServiceClarificationCodeType() { \r\n\t\tIS retVal = this.getTypedField(17, 0);\r\n\t\treturn retVal;\r\n }", "public String getcCode() {\n\t\treturn this.cCode;\n\t}", "public static String getErrorDescription(int errCode) {\n switch (errCode) {\n case ERROR_PACKET_HEADER:\n return \"Invalid packet header\";\n case ERROR_PACKET_TYPE:\n return \"Invalid packet type\";\n case ERROR_PACKET_LENGTH:\n return \"Invalid packet length\";\n case ERROR_PACKET_ENCODING:\n return \"Unsupported packet encoding\";\n case ERROR_PACKET_PAYLOAD:\n return \"Invalid packet payload\";\n case ERROR_PACKET_CHECKSUM:\n return \"Invalid checksum\";\n case ERROR_PACKET_ACK:\n return \"Invalid ACL sequence\";\n case ERROR_PROTOCOL_ERROR:\n return \"Protocol error\";\n case ERROR_PROPERTY_READ_ONLY:\n return \"Property is read-only\";\n case ERROR_PROPERTY_WRITE_ONLY:\n return \"Property is write-only\";\n case ERROR_PROPERTY_INVALID_ID:\n return \"Invalid/Unrecognized property key\";\n case ERROR_PROPERTY_INVALID_VALUE:\n return \"Invalid propery value\";\n case ERROR_PROPERTY_UNKNOWN_ERROR:\n return \"Unknown property error\";\n case ERROR_COMMAND_INVALID:\n return \"Invalid/Unsupported command\";\n case ERROR_COMMAND_ERROR:\n return \"Command error\";\n case ERROR_UPLOAD_TYPE:\n return \"Invalid upload type\";\n case ERROR_UPLOAD_LENGTH:\n return \"Invalid upload length\";\n case ERROR_UPLOAD_OFFSET_OVERLAP:\n return \"Upload offset overlap\";\n case ERROR_UPLOAD_OFFSET_GAP:\n return \"Upload offset gap\";\n case ERROR_UPLOAD_OFFSET_OVERFLOW:\n return \"Upload offset overflow\";\n case ERROR_UPLOAD_FILE_NAME:\n return \"Invalid uploaded filename\";\n case ERROR_UPLOAD_CHECKSUM:\n return \"Invalid uploaded checksum\";\n case ERROR_UPLOAD_SAVE:\n return \"Unable to save uploaded file\";\n case ERROR_GPS_EXPIRED:\n return \"GPS fix expired\";\n case ERROR_GPS_FAILURE:\n return \"GPS failure\";\n }\n if ((errCode >= ERROR_INTERNAL_ERROR_00) && (errCode <= ERROR_INTERNAL_ERROR_0F)) {\n return \"Internal error\";\n }\n return \"Unknown [\" + StringTools.toHexString(errCode, 16) + \"]\";\n }", "public static String cS2Code( CS cd )\n\t{\n\t\ttry {\n\t\t\tString code = cd.getCode();\n\t\t\treturn code;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(); \n\t\t\tthrow new RuntimeException( \"cS2Code(\" + cd.toString() + \") had errors: \" + e.getMessage() );\n\t\t}\n\t}", "private String getCustCode(String xmlResponse) {\r\n\t\t\r\n\t\tString custCode = \"\"; \r\n\t\tElement root;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\troot = DOMUtils.openDocument(new ByteArrayInputStream(xmlResponse.getBytes()));\r\n\t\t\tElement data = DOMUtils.getElement(root, \"data\", true);\r\n\t\t\t\r\n\t\t\t//sets the subscriber name\r\n\t\t\tElement customerInfo = DOMUtils.getElement(data, \"customer\", true);\r\n\t\t\tcustomerInfo = DOMUtils.getElement(customerInfo, \"code\", true);\r\n\t\t\r\n\t\t\tcustCode = DOMUtils.getText(customerInfo).toString();\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n\t\t\tlog.error(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t\tthrow new ErrorMessageException(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t}\t\r\n\t\t\r\n\t\treturn custCode;\r\n\r\n\t}", "String getEACCode();", "java.lang.String getProductNumberCode();", "public String getIntermidiateCode(){\r\n\t\treturn iCode;\r\n\t}", "java.lang.String getCode();", "java.lang.String getCode();", "java.lang.String getTranCode();", "public static String cS2CSInternal( org.opencds.vmr.v1_0.schema.CS cs )\n\t{\n\t\ttry {\n\t\t\tString st = cs.getCode();\n\t\t\treturn st;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(); \n\t\t\tthrow new RuntimeException( \"cS2Code(\" + cs.toString() + \") had errors: \" + e.getMessage() );\n\t\t}\n\t}", "static String getDesc(String code) {\n\t\tString[] str = errorMap.get(code);\n\t\tif (str == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn str[1];\n\t}", "private String encodeCode11() {\n if (!checkNumericOnly(getRawData().replace(\"-\", \"\"))) {\n error(\"EC11-1: Numeric data and '-' Only\");\n }\n\n //calculate the checksums\n int weight = 1;\n int CTotal = 0;\n String dataToEncodeWithChecksums = getRawData();\n\n //figure the C checksum\n for (int i = getRawData().length() - 1; i >= 0; i--) {\n //C checksum weights go 1-10\n if (weight == 10) {\n weight = 1;\n }\n\n if (getRawData().charAt(i) != '-') {\n CTotal += Integer.parseInt(String.valueOf(getRawData().charAt(i))) * weight++;\n } else {\n CTotal += 10 * weight++;\n }\n }\n\n int checksumC = CTotal % 11;\n\n dataToEncodeWithChecksums += String.valueOf(checksumC);\n\n //K checksums are recommended on any message length greater than or equal to 10\n if (getRawData().length() >= 10) {\n weight = 1;\n int KTotal = 0;\n\n //calculate K checksum\n for (int i = dataToEncodeWithChecksums.length() - 1; i >= 0; i--) {\n //K checksum weights go 1-9\n if (weight == 9) {\n weight = 1;\n }\n\n if (dataToEncodeWithChecksums.charAt(i) != '-') {\n KTotal += Integer.parseInt(String.valueOf(dataToEncodeWithChecksums.charAt(i))) * weight++;\n } else {\n KTotal += 10 * weight++;\n }\n }\n\n int checksumK = KTotal % 9;\n dataToEncodeWithChecksums += checksumK;\n }\n\n //encode data\n String space = \"0\";\n StringBuilder builder = new StringBuilder();\n builder.append(C11_Code[11]);//start-stop char\n builder.append(space); //interchar space\n\n for (char c : dataToEncodeWithChecksums.toCharArray()) {\n int index = (c == '-' ? 10 : Integer.parseInt(String.valueOf(c)));\n builder.append(C11_Code[index]);\n\n //inter-character space\n builder.append(space);\n }//foreach\n\n //stop bars\n builder.append(C11_Code[11]);\n\n return builder.toString();\n }", "public String getCode()\r\n\t{\r\n\t\treturn code;\r\n\t}", "public ST getProductServiceClarificationCodeValue() { \r\n\t\tST retVal = this.getTypedField(18, 0);\r\n\t\treturn retVal;\r\n }", "public String getResBookDesigCode() {\n return resBookDesigCode;\n }", "public String getCode() {\t\t\t\t\t\t\t\t\treturn code;\t\t\t\t\t\t\t}", "public java.lang.String CC_GetProvCodebyCallCentre(java.lang.String accessToken, java.lang.String CCCode) throws java.rmi.RemoteException;", "private String m50388c(PaymentError paymentError) {\n try {\n return new JSONObject(paymentError.mo40763b()).getString(\"description\");\n } catch (Exception unused) {\n return paymentError.mo40764c();\n }\n }", "public String barcode(String UID){\n\t\ttry {\n\t\t\tString res=dorequest(strbaseUrlTas + \"?id=\" + UID);\n\t\t\treturn res;\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n//TODO valid error reply\t\t\n\t\treturn \"error-request failed\";\n\t}", "public String getLBR_ProtestCode();", "public BigDecimal getCODE() {\r\n return CODE;\r\n }", "public BigDecimal getCODE() {\r\n return CODE;\r\n }", "public protocol.Result.ResultCode getResultCode() {\n protocol.Result.ResultCode result = protocol.Result.ResultCode.valueOf(resultCode_);\n return result == null ? protocol.Result.ResultCode.SUCCESS : result;\n }", "public int getMessageCodeValue();", "com.google.protobuf.StringValue getCurrencyCode();", "public protocol.Result.ResultCode getResultCode() {\n protocol.Result.ResultCode result = protocol.Result.ResultCode.valueOf(resultCode_);\n return result == null ? protocol.Result.ResultCode.SUCCESS : result;\n }", "private static String getReservCodeOrQ() \n {\n Scanner input = new Scanner(System.in);\n System.out.print(\"Enter reservation code for more details \"\n\t + \"(or (q)uit to exit): \");\n String rvCode = input.next();\n return rvCode;\n }", "public String getResultCode() {\r\n\t\treturn resultCode;\r\n\t}", "private int getIccCardType(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.getIccCardType(int):int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.getIccCardType(int):int\");\n }", "public String onChangeResidenceCode()\r\n {\r\n\ttry\r\n\t{\r\n\r\n\t SessionCO sessionCO = returnSessionObject();\r\n\t residenceTypesSC.setCompCode(sessionCO.getCompanyCode());\r\n\t residenceTypesSC.setPreferredLanguage(sessionCO.getPreferredLanguage());\r\n\t residenceTypesVO = residenceTypesBO.returnDependencyByCode(residenceTypesSC);\r\n\t if(residenceTypesVO == null)\r\n\t {\r\n\t\tthrow new BOException(MessageCodes.INVALID_MISSING_CODE);\r\n\t }\r\n\r\n\t}\r\n\tcatch(Exception e)\r\n\t{\r\n\t residenceTypesVO = new RESIDENCE_TYPESVO();\r\n\t handleException(e, null, null);\r\n\t}\r\n\treturn SUCCESS;\r\n }", "@Test\n public void cscResultTest() {\n assertEquals(\"C\", authResponse.getCscResult());\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode() {\r\n return code;\r\n }", "public String getCode () {\r\n\t\treturn code;\r\n\t}", "public ST getPsl18_ProductServiceClarificationCodeValue() { \r\n\t\tST retVal = this.getTypedField(18, 0);\r\n\t\treturn retVal;\r\n }", "int getCodeValue();", "public String getlbr_Barcode2();", "public static SparseArray<BoxResponse> formatResponseCode(byte[] bytes) {\n\n String responseCode = JMLUtils.bytesToHexString(bytes);\n if (responseCode == null || responseCode.length() != 40 || !responseCode.toLowerCase().startsWith(\"dbde\")) {\n return null;\n }\n responseCode = responseCode.toLowerCase();//\n // 去掉dbde\n responseCode = responseCode.substring(4);\n\n // 新建数组,每两个放一起\n List<Integer> array = new ArrayList<>();\n char[] chars = responseCode.toCharArray();\n for (int i = 0; i < chars.length / 2; i++) {\n\n Integer tmp;\n try {\n tmp = JMLUtils.getIntBy16(\"\" + chars[i * 2] + chars[i * 2 + 1]);\n } catch (Exception e) {\n// e.printStackTrace();\n return null;\n }\n array.add(tmp);\n }\n\n // 应答数据长度\n int len1 = array.get(0);\n\n // 去掉长度 -- 上面的07\n array.remove(0);\n\n Integer _index, _be, _id, _success;\n\n // 判断是否是应答指令\n // 这边解析是否正确\n if (array.get(1) == BoxKey.HELM_NOTIFY_ID) {\n // db de 08 01 54 xxxxxxxx\n List<Integer> data1 = new ArrayList<>(array.subList(0, 2));\n array.subList(0, 2).clear(); // 删掉前2个\n len1 -= 2;\n _index = data1.get(0);\n _be = null;\n _id = data1.get(1);\n _success = 0;\n } else {\n // 序列号(值我发送的计数,每次不一样), be说明是应答指令, 51 应答命令ID, 00成功状态--成功\n List<Integer> data1 = new ArrayList<>(array.subList(0, 4));\n array.subList(0, 4).clear(); // 删掉前4个\n len1 -= 4;\n _index = data1.get(0);\n _be = data1.get(1);\n _id = data1.get(2);\n _success = data1.get(3);\n }\n\n if (_success != 0) {\n BleLog.d(\"_success\" + _success + \"\");\n return null;\n }\n\n // 开始递归 取传的值 = 应答数据\n\n SparseArray<BoxResponse> _detailValue = new SparseArray<>();\n\n if (_id == BoxKey.BOX_SEND_ID || _id == BoxKey.HELM_NOTIFY_ID) {\n while (true) {\n int _len = array.get(0);\n if (len1 <= 0) {\n break;\n } else {\n // 长度\n array.remove(0);\n\n // type\n int key = array.get(0);\n array.remove(0);\n\n _detailValue.put(key, new BoxResponse(_id, _index, key, new ArrayList<>(array.subList(0, _len - 1))));\n array.subList(0, _len - 1).clear();\n }\n len1 -= (_len + 1);\n }\n } else {\n // 只有一条命令 -- 没有分指令的长度\n // key 为 _id\n BleLog.d(len1 + \"\");\n if (len1 >= 0 && array.size() >= len1) {\n _detailValue.put(0, new BoxResponse(_id, _index, 0, new ArrayList<>(array.subList(0, len1))));\n }\n }\n return _detailValue;\n }", "public String getCode(){\n\t\treturn code;\n\t}", "public String code() {\n return this.code;\n }", "public String code() {\n return this.code;\n }", "public String getCrrAnswerString() {\n if (type.equals(\"txt\")) {\n return getTextCrrAnswer();\n }\n else {\n return answers[mcCrrAnswer - 1];\n }\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n\t\treturn Code;\n\t}", "public String getCode()\n {\n return code;\n }", "public ID getActionCodeRXA() { \r\n\t\tID retVal = this.getTypedField(21, 0);\r\n\t\treturn retVal;\r\n }", "public String getReturnCode()\r\n\t{\r\n\t\treturn returnCode;\r\n\t}", "@Override\n public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n IntentResult intentResult = IntentIntegrator.parseActivityResult(requestCode,resultCode,data);\n if (intentResult.getContents() != null) {\n String scannedText = intentResult.getContents();\n\n // Get product data associated with the UPC barcode\n Uri uri = api.getURL(scannedText);\n api.getData(uri, this::productBarcodeHandler);\n }\n else {\n Toast.makeText(getApplicationContext(),\"Nothing was scanned\", Toast.LENGTH_SHORT).show();\n }\n }", "public String getResultCode() {\n return resultCode;\n }", "public String getCode() {\r\n\t\treturn code;\r\n\t}", "public String getCode() {\r\n\t\treturn code;\r\n\t}", "@Override\n public String getDescription() {\n return \"Digital goods quantity change\";\n }", "public String getCode() {\n return super.getString(Constants.Properties.CODE);\n }", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "String getCode();", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }", "public String getCode() {\n return code;\n }" ]
[ "0.7002904", "0.68309635", "0.6338743", "0.6150451", "0.58723086", "0.58311236", "0.5824016", "0.5763357", "0.57328606", "0.5728108", "0.5691041", "0.56196386", "0.5607705", "0.55661315", "0.55222934", "0.5521028", "0.55005944", "0.54436034", "0.5427933", "0.54080284", "0.53974915", "0.53974915", "0.5384705", "0.5361126", "0.53608066", "0.53441423", "0.53323776", "0.53272516", "0.5321252", "0.5316637", "0.5315489", "0.5312831", "0.53090334", "0.53059435", "0.5297762", "0.5297762", "0.52950215", "0.52912676", "0.528916", "0.52723503", "0.5267409", "0.52659506", "0.52618563", "0.5248325", "0.5243274", "0.5238661", "0.5238661", "0.5238661", "0.5238661", "0.5238661", "0.5238661", "0.5238661", "0.5232361", "0.5225379", "0.522355", "0.52234876", "0.52183473", "0.5218311", "0.5211915", "0.5211915", "0.520151", "0.5199975", "0.5199975", "0.5199975", "0.5199975", "0.51822406", "0.5178115", "0.51623696", "0.5161338", "0.51544124", "0.51543814", "0.51537883", "0.51537883", "0.51535285", "0.5151714", "0.5151428", "0.5151428", "0.5151428", "0.5151428", "0.5151428", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846", "0.5149846" ]
0.7355459
0
This method uses the 3DS verStatus retrieved from the Response and returns an appropriate description for this code.
private String getStatusDescription(String vStatus) { String result = ""; if (vStatus != null && !vStatus.equals("")) { if (vStatus.equalsIgnoreCase("Unsupported") || vStatus.equals("No Value Returned")) { result = "3DS not supported or there was no 3DS data provided"; } else { // Java cannot switch on a string so turn everything to a // character char input = vStatus.charAt(0); switch (input) { case 'Y': result = "The cardholder was successfully authenticated."; break; case 'E': result = "The cardholder is not enrolled."; break; case 'N': result = "The cardholder was not verified."; break; case 'U': result = "The cardholder's Issuer was unable to authenticate due to some system error at the Issuer."; break; case 'F': result = "There was an error in the format of the request from the merchant."; break; case 'A': result = "Authentication of your Merchant ID and Password to the ACS Directory Failed."; break; case 'D': result = "Error communicating with the Directory Server."; break; case 'C': result = "The card type is not supported for authentication."; break; case 'S': result = "The signature on the response received from the Issuer could not be validated."; break; case 'P': result = "Error parsing input from Issuer."; break; case 'I': result = "Internal Payment Server system error."; break; default: result = "Unable to be determined"; break; } } } else { result = "null response"; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getResponseDescription(String vResponseCode) {\r\n\r\n\t\tString result = \"\";\r\n\r\n\t\t// check if a single digit response code\r\n\t\tif (vResponseCode.length() != 1) {\r\n\r\n\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\tchar input = vResponseCode.charAt(0);\r\n\r\n\t\t\tswitch (input) {\r\n\t\t\tcase '0':\r\n\t\t\t\tresult = \"Transaction Successful\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '1':\r\n\t\t\t\tresult = \"Unknown Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '2':\r\n\t\t\t\tresult = \"Bank Declined Transaction\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '3':\r\n\t\t\t\tresult = \"No Reply from Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '4':\r\n\t\t\t\tresult = \"Expired Card\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '5':\r\n\t\t\t\tresult = \"Insufficient Funds\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '6':\r\n\t\t\t\tresult = \"Error Communicating with Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '7':\r\n\t\t\t\tresult = \"Payment Server System Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '8':\r\n\t\t\t\tresult = \"Transaction Type Not Supported\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '9':\r\n\t\t\t\tresult = \"Bank declined transaction (Do not contact Bank)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'A':\r\n\t\t\t\tresult = \"Transaction Aborted\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'C':\r\n\t\t\t\tresult = \"Transaction Cancelled\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'D':\r\n\t\t\t\tresult = \"Deferred transaction has been received and is awaiting processing\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'F':\r\n\t\t\t\tresult = \"3D Secure Authentication failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'I':\r\n\t\t\t\tresult = \"Card Security Code verification failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'L':\r\n\t\t\t\tresult = \"Shopping Transaction Locked (Please try the transaction again later)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'N':\r\n\t\t\t\tresult = \"Cardholder is not enrolled in Authentication Scheme\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'P':\r\n\t\t\t\tresult = \"Transaction has been received by the Payment Adaptor and is being processed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'R':\r\n\t\t\t\tresult = \"Transaction was not processed - Reached limit of retry attempts allowed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'S':\r\n\t\t\t\tresult = \"Duplicate SessionID (OrderInfo)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'T':\r\n\t\t\t\tresult = \"Address Verification Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'U':\r\n\t\t\t\tresult = \"Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'V':\r\n\t\t\t\tresult = \"Address Verification and Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '?':\r\n\t\t\t\tresult = \"Transaction status is unknown\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t} else {\r\n\t\t\treturn \"No Value Returned\";\r\n\t\t}\r\n\t}", "private String displayAVSResponse(String vAVSResultCode) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vAVSResultCode != null || vAVSResultCode.length() == 0) {\r\n\r\n\t\t\tif (vAVSResultCode.equalsIgnoreCase(\"Unsupported\") || vAVSResultCode.equalsIgnoreCase(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"AVS not supported or there was no AVS data provided\";\r\n\t\t\t} else {\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\t\tchar input = vAVSResultCode.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'X':\r\n\t\t\t\t\tresult = \"Exact match - address and 9 digit ZIP/postal code\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Y':\r\n\t\t\t\t\tresult = \"Exact match - address and 5 digit ZIP/postal code\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"Service not supported or address not verified (international transaction)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'G':\r\n\t\t\t\t\tresult = \"Issuer does not participate in AVS (international transaction)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'A':\r\n\t\t\t\t\tresult = \"Address match only\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'W':\r\n\t\t\t\t\tresult = \"9 digit ZIP/postal code matched, Address not Matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Z':\r\n\t\t\t\t\tresult = \"5 digit ZIP/postal code matched, Address not Matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'R':\r\n\t\t\t\t\tresult = \"Issuer system is unavailable\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"Address unavailable or not verified\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'E':\r\n\t\t\t\t\tresult = \"Address and ZIP/postal code not provided\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"Address and ZIP/postal code not matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '0':\r\n\t\t\t\t\tresult = \"AVS not requested\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public String getVerDescription() {\n return verDescription;\n }", "private String displayCSCResponse(String vCSCResultCode) {\r\n\r\n\t\tString result = \"\";\r\n\t\tif (vCSCResultCode != null || vCSCResultCode.length() == 0) {\r\n\r\n\t\t\tif (vCSCResultCode.equalsIgnoreCase(\"Unsupported\") || vCSCResultCode.equalsIgnoreCase(\"No Value Returned\")) {\r\n\t\t\t\tresult = \"CSC not supported or there was no CSC data provided\";\r\n\t\t\t} else {\r\n\t\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\t\tchar input = vCSCResultCode.charAt(0);\r\n\r\n\t\t\t\tswitch (input) {\r\n\t\t\t\tcase 'M':\r\n\t\t\t\t\tresult = \"Exact code match\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'S':\r\n\t\t\t\t\tresult = \"Merchant has indicated that CSC is not present on the card (MOTO situation)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'P':\r\n\t\t\t\t\tresult = \"Code not processed\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'U':\r\n\t\t\t\t\tresult = \"Card issuer is not registered and/or certified\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'N':\r\n\t\t\t\t\tresult = \"Code invalid or not matched\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tresult = \"null response\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private ResponseStatus(int code) {\n this.code = code;\n this.formatted = format(code, \"???\");\n this.symbolicName = String.format(\"0x%04x\", code);\n }", "private String getRespDesc(String _code)\r\n {\r\n int resultCode = -1;\r\n\r\n try\r\n {\r\n resultCode = Integer.valueOf(_code);\r\n } catch (NumberFormatException e)\r\n {\r\n // just in case the code isn't a number\r\n return \"Format of RESULT code unexpected\";\r\n }\r\n\r\n if (resultCode < 0)\r\n {\r\n return \"Communication error\";\r\n }\r\n\r\n String ret = \"unknown\";\r\n switch (resultCode)\r\n {\r\n case 0:\r\n ret = \"Approved\";\r\n break;\r\n case 1:\r\n ret = \"User authentication failed\";\r\n break;\r\n case 2:\r\n ret = \"Invalid tender type\";\r\n break;\r\n case 3:\r\n ret = \"Invalid transaction type\";\r\n break;\r\n case 4:\r\n ret = \"Invalid amount format\";\r\n break;\r\n case 5:\r\n ret = \"Invalid merchant information\";\r\n break;\r\n case 6:\r\n ret = \"Invalid or unsupported currency code\";\r\n break;\r\n case 7:\r\n ret = \"Field format error\";\r\n break;\r\n case 8:\r\n ret = \"Not a transaction server\";\r\n break;\r\n case 9:\r\n ret = \"Too many parameters or invalid stream\";\r\n break;\r\n case 10:\r\n ret = \"Too many line items\";\r\n break;\r\n case 11:\r\n ret = \"Client time-out waiting for response\";\r\n break;\r\n case 12:\r\n ret = \"Declined\";\r\n break;\r\n case 13:\r\n ret = \"Referral\";\r\n break;\r\n case 19:\r\n ret = \"Original transaction ID not found\";\r\n break;\r\n case 20:\r\n ret = \"Cannot find the customer reference number\";\r\n break;\r\n case 22:\r\n ret = \"Invalid ABA number\";\r\n break;\r\n case 23:\r\n ret = \"Invalid account number\";\r\n break;\r\n case 24:\r\n ret = \"Invalid expiration date\";\r\n break;\r\n case 25:\r\n ret = \"Invalid Host Mapping\";\r\n break;\r\n case 26:\r\n ret = \"Invalid vendor account\";\r\n break;\r\n case 27:\r\n ret = \"Insufficient partner permissions\";\r\n break;\r\n case 28:\r\n ret = \"Insufficient user permissions\";\r\n break;\r\n case 29:\r\n ret = \"Invalid XML document\";\r\n break;\r\n case 30:\r\n ret = \"Duplicate transaction\";\r\n break;\r\n case 31:\r\n ret = \"Error in adding the recurring profile\";\r\n break;\r\n case 32:\r\n ret = \"Error in modifying the recurring profile\";\r\n break;\r\n case 33:\r\n ret = \"Error in canceling the recurring profile\";\r\n break;\r\n case 34:\r\n ret = \"Error in forcing the recurring profile\";\r\n break;\r\n case 35:\r\n ret = \"Error in reactivating the recurring profile\";\r\n break;\r\n case 36:\r\n ret = \"OLTP Transaction failed\";\r\n break;\r\n case 37:\r\n ret = \"Invalid recurring profile ID\";\r\n break;\r\n case 50:\r\n ret = \"Insufficient funds available in account\";\r\n break;\r\n case 51:\r\n ret = \"Exceeds per transaction limit\";\r\n break;\r\n case 99:\r\n ret = \"General error. See RESPMSG.\";\r\n break;\r\n case 100:\r\n ret = \"Transaction type not supported by host\";\r\n break;\r\n case 101:\r\n ret = \"Time-out value too small\";\r\n break;\r\n case 102:\r\n ret = \"Processor not available\";\r\n break;\r\n case 103:\r\n ret = \"Error reading response from host\";\r\n break;\r\n case 104:\r\n ret = \"Timeout waiting for processor response\";\r\n break;\r\n case 105:\r\n ret = \"Credit error\";\r\n break;\r\n case 106:\r\n ret = \"Host not available\";\r\n break;\r\n case 107:\r\n ret = \"Duplicate suppression time-out\";\r\n break;\r\n case 108:\r\n ret = \"Void error\";\r\n break;\r\n case 109:\r\n ret = \"Time-out waiting for host response\";\r\n break;\r\n case 110:\r\n ret = \"Referenced auth (against order) Error\";\r\n break;\r\n case 111:\r\n ret = \"Capture error\";\r\n break;\r\n case 112:\r\n ret = \"Failed AVS check\";\r\n break;\r\n case 113:\r\n ret = \"Merchant sale exceeds the sales cap\";\r\n break;\r\n case 114:\r\n ret = \"Card Security Code (CSC) Mismatch.\";\r\n break;\r\n case 115:\r\n ret = \"System busy, try again later\";\r\n break;\r\n case 116:\r\n ret = \"VPS Internal error\";\r\n break;\r\n case 117:\r\n ret = \"Failed merchant rule check\";\r\n break;\r\n case 118:\r\n ret = \"Invalid keywords found in string fields\";\r\n break;\r\n case 120:\r\n ret = \"Attempt to reference a failed transaction\";\r\n break;\r\n case 121:\r\n ret = \"Not enabled for feature\";\r\n break;\r\n case 122:\r\n ret = \"Merchant sale exceeds the credit cap\";\r\n break;\r\n case 125:\r\n ret = \"Declined by filters\";\r\n break;\r\n case 126:\r\n ret = \"Authorized but triggered a Fraud Filter\";\r\n break;\r\n case 127:\r\n ret = \"Not processed by filters\";\r\n break;\r\n case 128:\r\n ret = \"Declined by merchant\";\r\n break;\r\n case 132:\r\n ret = \"Card has not been submitted for update\";\r\n break;\r\n case 133:\r\n ret = \"Data mismatch in HTTP retry request\";\r\n break;\r\n case 150:\r\n ret = \"Issuing bank timed out\";\r\n break;\r\n case 151:\r\n ret = \"Issuing bank unavailable\";\r\n break;\r\n case 201:\r\n ret = \"Order error\";\r\n break;\r\n case 1000:\r\n ret = \"Generic host error\";\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return ret;\r\n }", "@DISPID(15)\n\t// = 0xf. The runtime will prefer the VTID if present\n\t@VTID(25)\n\tjava.lang.String status();", "String getVersionLabel();", "public Integer getVerCode() {\n return verCode;\n }", "public String getStatus()\r\n {\n return (\"1\".equals(getField(\"ApprovalStatus\")) && \"100\".equals(getField(\"HostRespCode\")) ? \"Approved\" : \"Declined\");\r\n }", "protected StatusLine createStatusLine(ProtocolVersion ver, int status, String reason) {\n/* 422 */ return new BasicStatusLine(ver, status, reason);\n/* */ }", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "java.lang.String getStatus();", "public String getVersion()\n {\n //\n // Send EFFECT_CMD_GET_PARAM\n //\n int verLen = 32;\n byte[] version = new byte[verLen];\n getParameter(EFFECT_PARAM_VERSION, version);\n String strFull = new String(version);\n // find the '\\0' in c/c++ format\n int endPos = strFull.indexOf(0);\n String strVer = new String(version, 0, endPos);\n return strVer;\n }", "public String getStatus() throws VlException\n\t{\n\t\treturn null; \n\t}", "public static void showVersion() {\r\n String apiTitle = ImdbApi.class.getPackage().getSpecificationTitle();\r\n \r\n if (StringUtils.isNotBlank(apiTitle)) {\r\n String apiVersion = ImdbApi.class.getPackage().getSpecificationVersion();\r\n String apiRevision = ImdbApi.class.getPackage().getImplementationVersion();\r\n StringBuilder sv = new StringBuilder();\r\n sv.append(apiTitle).append(\" \");\r\n sv.append(apiVersion).append(\" r\");\r\n sv.append(apiRevision);\r\n LOGGER.debug(sv.toString());\r\n } else {\r\n LOGGER.debug(\"API-IMDB version/revision information not available\");\r\n }\r\n }", "public short getVcode() {\n return vcode;\n }", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "public void setVerficationCode(String verficationCode) {\n VerficationCode = verficationCode;\n }", "public String toString() {\n return HTTP_VERSION + SP + code + SP + responseString;\n }", "public String getAVS()\n\t{\n\t\tif(response.containsKey(\"AVS\")) {\n\t\t\treturn response.get(\"AVS\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public void setVerCode(Integer verCode) {\n this.verCode = verCode;\n }", "private RLabel getVersionLabel() {\n if (versionLabel == null) {\n versionLabel = new RLabel();\n versionLabel.setText(\"<%= ivy.cms.co(\\\"/Dialogs/about/productVersion\\\") %>\");\n versionLabel.setStyleProperties(\"{/insetsTop \\\"2\\\"}\");\n versionLabel.setName(\"versionLabel\");\n }\n return versionLabel;\n }", "public void receiveResultgetVersion(\r\n es.mitc.redes.urbanismoenred.serviciosweb.v1_86.UrbrWSServiceStub.GetVersionResponseE result\r\n ) {\r\n }", "public static SparseArray<BoxResponse> formatResponseCode(byte[] bytes) {\n\n String responseCode = JMLUtils.bytesToHexString(bytes);\n if (responseCode == null || responseCode.length() != 40 || !responseCode.toLowerCase().startsWith(\"dbde\")) {\n return null;\n }\n responseCode = responseCode.toLowerCase();//\n // 去掉dbde\n responseCode = responseCode.substring(4);\n\n // 新建数组,每两个放一起\n List<Integer> array = new ArrayList<>();\n char[] chars = responseCode.toCharArray();\n for (int i = 0; i < chars.length / 2; i++) {\n\n Integer tmp;\n try {\n tmp = JMLUtils.getIntBy16(\"\" + chars[i * 2] + chars[i * 2 + 1]);\n } catch (Exception e) {\n// e.printStackTrace();\n return null;\n }\n array.add(tmp);\n }\n\n // 应答数据长度\n int len1 = array.get(0);\n\n // 去掉长度 -- 上面的07\n array.remove(0);\n\n Integer _index, _be, _id, _success;\n\n // 判断是否是应答指令\n // 这边解析是否正确\n if (array.get(1) == BoxKey.HELM_NOTIFY_ID) {\n // db de 08 01 54 xxxxxxxx\n List<Integer> data1 = new ArrayList<>(array.subList(0, 2));\n array.subList(0, 2).clear(); // 删掉前2个\n len1 -= 2;\n _index = data1.get(0);\n _be = null;\n _id = data1.get(1);\n _success = 0;\n } else {\n // 序列号(值我发送的计数,每次不一样), be说明是应答指令, 51 应答命令ID, 00成功状态--成功\n List<Integer> data1 = new ArrayList<>(array.subList(0, 4));\n array.subList(0, 4).clear(); // 删掉前4个\n len1 -= 4;\n _index = data1.get(0);\n _be = data1.get(1);\n _id = data1.get(2);\n _success = data1.get(3);\n }\n\n if (_success != 0) {\n BleLog.d(\"_success\" + _success + \"\");\n return null;\n }\n\n // 开始递归 取传的值 = 应答数据\n\n SparseArray<BoxResponse> _detailValue = new SparseArray<>();\n\n if (_id == BoxKey.BOX_SEND_ID || _id == BoxKey.HELM_NOTIFY_ID) {\n while (true) {\n int _len = array.get(0);\n if (len1 <= 0) {\n break;\n } else {\n // 长度\n array.remove(0);\n\n // type\n int key = array.get(0);\n array.remove(0);\n\n _detailValue.put(key, new BoxResponse(_id, _index, key, new ArrayList<>(array.subList(0, _len - 1))));\n array.subList(0, _len - 1).clear();\n }\n len1 -= (_len + 1);\n }\n } else {\n // 只有一条命令 -- 没有分指令的长度\n // key 为 _id\n BleLog.d(len1 + \"\");\n if (len1 >= 0 && array.size() >= len1) {\n _detailValue.put(0, new BoxResponse(_id, _index, 0, new ArrayList<>(array.subList(0, len1))));\n }\n }\n return _detailValue;\n }", "public NCCP_Response(int dl)\n {\n super(dl);\n }", "public String provideAlwasDefResponse()\n {\n return (\"d\") ;\n }", "public String getVersionTitle()\r\n\t{\r\n\t\treturn versionTitle;\r\n\t}", "public String getStatus() { return status; }", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "java.lang.String getResponse();", "public int getResponseType() {\n /*\n // Can't load method instructions: Load method exception: null in method: android.telephony.SmsCbCmasInfo.getResponseType():int, dex: in method: android.telephony.SmsCbCmasInfo.getResponseType():int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.getResponseType():int\");\n }", "String getDataStatus();", "public ReversionResponse() {\n\t\tthis.codigoBusqueda = \"\";\n\t\tthis.idTxnNeivorResponse = 0L;\n\t\tthis.idTxnRevertida = 0L;\n\t}", "String getVersion() throws IOException, SoapException;", "String getStatusMessage( );", "@Override\r\n public String toString() {\r\n return \" \" + this.getStatus() + \" \" + this.description;\r\n }", "public void receiveResultversionInfo(\n com.exacttarget.wsdl.partnerapi.VersionInfoResponseMsgDocument result\n ) {\n }", "public String getStatusDetails() { return statusDetails; }", "private String statusExtractorV2(Printer printer) {\n Document document = getStatusDocument(printer.getUrl());\n\n String text = document.text();\n String preProcessed = text.substring(text.indexOf(\"Host Name\"));\n return preProcessed.substring(preProcessed.indexOf(\"System Status\")+14,preProcessed.indexOf(\"Toner Status \")-1);\n }", "com.google.protobuf.ByteString getVersion();", "@Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n mCode.setText(R.string.no_code);\n Toast.makeText(getApplicationContext(), R.string.no_code_explanation, Toast.LENGTH_SHORT).show();\n }", "public void verifyRespStatus(OCSPResp resp) throws OCSPException\n {\n String statusInfo = \"\";\n if (resp != null)\n {\n int status = resp.getStatus();\n switch (status)\n {\n case OCSPResponseStatus.INTERNAL_ERROR:\n statusInfo = \"INTERNAL_ERROR\";\n LOG.error(\"An internal error occurred in the OCSP Server!\");\n break;\n case OCSPResponseStatus.MALFORMED_REQUEST:\n // This happened when the \"critical\" flag was used for extensions\n // on a responder known by the committer of this comment.\n statusInfo = \"MALFORMED_REQUEST\";\n LOG.error(\"Your request did not fit the RFC 2560 syntax!\");\n break;\n case OCSPResponseStatus.SIG_REQUIRED:\n statusInfo = \"SIG_REQUIRED\";\n LOG.error(\"Your request was not signed!\");\n break;\n case OCSPResponseStatus.TRY_LATER:\n statusInfo = \"TRY_LATER\";\n LOG.error(\"The server was too busy to answer you!\");\n break;\n case OCSPResponseStatus.UNAUTHORIZED:\n statusInfo = \"UNAUTHORIZED\";\n LOG.error(\"The server could not authenticate you!\");\n break;\n case OCSPResponseStatus.SUCCESSFUL:\n break;\n default:\n statusInfo = \"UNKNOWN\";\n LOG.error(\"Unknown OCSPResponse status code! \" + status);\n }\n }\n if (resp == null || resp.getStatus() != OCSPResponseStatus.SUCCESSFUL)\n {\n throw new OCSPException(\"OCSP response unsuccessful, status: \" + statusInfo);\n }\n }", "String getStatusMessage();", "void mo1927a(NLPResponseData nLPResponseData);", "@Test\n public void cavvTest() {\n assertEquals(\"cavvvvvvvvvvvvv\", authResponse.getCavv());\n }", "trinsic.services.common.v1.CommonOuterClass.ResponseStatus getStatus();", "public String versionNumber (){\r\n\t\t\treturn _versionNumber;\r\n\t\t}", "public abstract String getVersion();", "public abstract String getVersion();", "public abstract String getVersion();", "com.google.protobuf.ByteString getStatus();", "public java.lang.CharSequence getStatus() {\n return status;\n }", "public void status(int major_version,\n int minor_version,\n int code,\n String reason_phrase) {\n mStatusCode = code;\n }", "public int getStatusOrdinal() { return status.ordinal(); }", "public String getTitleVersion() {\n\t\treturn tvr;\n\t}", "String getStatus();", "String getStatus();", "String getStatus();", "String getStatus();", "String getStatus();", "private String statusExtractorV1(Printer printer) {\n Document document = getStatusDocument(printer.getUrl());\n\n String text = document.text();\n String status;\n String preProcessed = text.substring(text.indexOf(\"Host Name\"));\n if(\"Aficio SP 8200DN\".equals(printer.getModel()))\n status = preProcessed.substring(preProcessed.indexOf(\"Printer\")+8,preProcessed.indexOf(\"Toner\")-1);\n else\n status = preProcessed.substring(preProcessed.indexOf(\"Printer\")+8,preProcessed.indexOf(\"Copier\")-1);\n return status;\n }", "public String getVersion()\n {\n return ver;\n }", "private void setStatusCode(String statusLine) {\n \n \t\tString[] each = statusLine.split( \" \" );\n \t\tresponseHTTPVersion = each[0];\n \t\tstatusCode = each[1];\n\t\treasonPhrase = each[2];\n \t}", "@Override\n public void onSuccess(int code, Header[] header, byte[] data) {\n super.onSuccess(code, header, data);\n try {\n String consafdg = new String(data);\n if (!Util.isEmpty(consafdg)) {\n JSONObject jsonObject = new JSONObject(consafdg);\n if (jsonObject.has(\"AQI_class\")) {\n condition = jsonObject\n .getString(\"AQI_class\");\n if (condition.length() > 3) {\n tvCondition.setTextSize(\n TypedValue.COMPLEX_UNIT_SP, 10);\n }\n tvCondition.setText(condition);\n }\n }\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private String getStatusLine(int iStatusCode) {\n String sStatus = \"HTTP/1.1 \";\n if (iStatusCode == 200) {\n sStatus += iStatusCode + \" OK\";\n } else if (iStatusCode == 301) {\n sStatus += iStatusCode + \" Moved Permanently\";\n } else if (iStatusCode == 403) {\n sStatus += iStatusCode + \" Forbidden\";\n } else if (iStatusCode == 404) {\n sStatus += iStatusCode + \" Not Found\";\n } else if (iStatusCode == 415) {\n sStatus += iStatusCode + \" Unsupported Media Type\";\n } else if(iStatusCode == 500) {\n sStatus += iStatusCode + \" Internal Server Error\";\n }\n return sStatus;\n }", "public ST getProductServiceCodeDescription() { \r\n\t\tST retVal = this.getTypedField(9, 0);\r\n\t\treturn retVal;\r\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] response) {\n\n String res = new String(response);\n try {\n JSONObject object = new JSONObject(res);\n String objStr = object.get(\"vote_result\") + \"\";\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n Log.d(\"SUN\", \"e : \" + e.toString());\n }\n\n }", "public String getVersion(){\r\n return version;\r\n }", "public String getServerDescription();", "public java.lang.CharSequence getResponseCode() {\n return ResponseCode;\n }", "public String getVer() {\r\n return this.ver;\r\n }", "public java.lang.CharSequence getStatus() {\n return status;\n }", "Status(String description) {\n this.description = description;\n }", "public static String createDiscoverResponseMessage(){\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(\"HTTP/1.1 200 OK\").append(\"\\n\");\n\t\tsb.append(\"CACHE-CONTROL: max-age=1200\").append(\"\\n\");\n\t\tsb.append(\"DATE: Tue, 05 May 2009 13:31:51 GMT\").append(\"\\n\");\n\t\tsb.append(\"LOCATION: http://142.225.35.55:5001/description/fetch\").append(\"\\n\");\n\t\tsb.append(\"SERVER: Windows_XP-x86-5.1, UPnP/1.0, PMS/1.11\").append(\"\\n\");\n\t\tsb.append(\"ST: upnp:rootdevice\").append(\"\\n\");\n\t\tsb.append(\"EXT: \").append(\"\\n\");\n\t\tsb.append(\"USN: uuid:9dcf6222-fc4b-33eb-bf49-e54643b4f416::upnp:rootdevice\").append(\"\\n\");\n\t\tsb.append(\"Content-Length: 0\").append(\"\\n\");\n\t\t\n\t\treturn sb.toString();\n\t}", "public String getVersion()\r\n {\r\n return(\"Ver. 1.0\");\r\n }", "public String getVersionNumber ();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "public String description() {\r\n\t\treturn \"This is the Vancarrier_1st_P_Model description,\" + \"which means it is the first VanCarrier model in a \"\r\n\t\t\t\t+ \"process oriented version.\" + \" \" + \"This model is a service station model located at a \"\r\n\t\t\t\t+ \"container harbour. Conatinertrucks will arrive and \"\r\n\t\t\t\t+ \"require the loading of a container. A Vancarrier (VC) is \"\r\n\t\t\t\t+ \"on duty and will head off to find the required container \"\r\n\t\t\t\t+ \"in the storage. He will then deliver the container to the \"\r\n\t\t\t\t+ \"truck. The truck then leaves the area.\" + \"In case the VC is busy, the truck waits \"\r\n\t\t\t\t+ \"for his turn on the parking-lot.\" + \"If the VC is idle, it waits on his own parking spot for the \"\r\n\t\t\t\t+ \"truck to come.\";\r\n\t}", "public String getStatusLine() {\n\n StringBuilder builder = new StringBuilder(SL_11_START.length() + 4 + message.length());\n builder.append(SL_11_START).append(code).append(' ').append(message);\n return builder.toString();\n }" ]
[ "0.65329146", "0.5899492", "0.58937824", "0.5724681", "0.56456286", "0.5604969", "0.5601656", "0.55193317", "0.5510743", "0.5446387", "0.5440159", "0.5410867", "0.5410867", "0.5410867", "0.5410867", "0.5398084", "0.5395276", "0.5386403", "0.5377163", "0.53244364", "0.53244364", "0.53244364", "0.53244364", "0.53244364", "0.53244364", "0.53244364", "0.53244364", "0.52712226", "0.526248", "0.52447736", "0.5242166", "0.5242002", "0.52403754", "0.5229865", "0.52225274", "0.52200615", "0.5182711", "0.5165334", "0.5161133", "0.5161133", "0.51502544", "0.51431143", "0.5126753", "0.5107383", "0.5087168", "0.50819606", "0.5079472", "0.5051291", "0.5048537", "0.50467587", "0.5044833", "0.5044153", "0.50413024", "0.5039601", "0.5035142", "0.50319046", "0.50299907", "0.50222015", "0.50208604", "0.50208604", "0.50208604", "0.501954", "0.5017156", "0.501468", "0.50111204", "0.500421", "0.5003696", "0.5003696", "0.5003696", "0.5003696", "0.5003696", "0.50031495", "0.50007397", "0.4996392", "0.498127", "0.4975928", "0.49737337", "0.4973484", "0.49715534", "0.49696624", "0.49623114", "0.4961205", "0.49570605", "0.49528545", "0.4950028", "0.49463472", "0.49452388", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49452317", "0.49420315", "0.49366504" ]
0.69873667
0
/ If there has been a merchant secret set then sort and loop through all the data in the Virtual Payment Client response. while we have the data, we can append all the fields that contain values (except the secure hash) so that we can create a hash and validate it against the secure hash in the Virtual Payment Client response. NOTE: If the vpc_TxnResponseCode in not a single character then there was a Virtual Payment Client error and we cannot accurately validate the incoming data from the secure hash.
public String processResponse(Map<String, String> fields) { // remove the vpc_TxnResponseCode code from the response fields as we do // not // want to include this field in the hash calculation String vpc_Txn_Secure_Hash = null2unknown((String) fields.remove("vpc_SecureHash")); String hashValidated = null; String txtref = fields.get("vpc_MerchTxnRef"); // if(txtref==null || txtref.isEmpty()){ // //TODO Error Validating Data // } // // String city = getCity(txtref); // if(city==null || city.isEmpty()){ // //TODO Error Validating Data // } // defines if error message should be output boolean errorExists = false; // create secure hash and append it to the hash map if it was // created // remember if SECURE_SECRET = "" it wil not be created String secureHash = SHAEncrypt.hashAllFields(fields, secureHashMap.get("DUBAI")); // Validate the Secure Hash (remember MD5 hashes are not case // sensitive) if (vpc_Txn_Secure_Hash != null && vpc_Txn_Secure_Hash.equalsIgnoreCase(secureHash)) { // Secure Hash validation succeeded, add a data field to be // displayed later. hashValidated = "CORRECT"; } else { // Secure Hash validation failed, add a data field to be // displayed later. errorExists = true; hashValidated = "INVALID HASH"; } // Extract the available receipt fields from the VPC Response // If not present then let the value be equal to 'Unknown' // Standard Receipt Data String amount = null2unknown((String) fields.get("vpc_Amount")); String locale = null2unknown((String) fields.get("vpc_Locale")); String batchNo = null2unknown((String) fields.get("vpc_BatchNo")); String command = null2unknown((String) fields.get("vpc_Command")); String message = null2unknown((String) fields.get("vpc_Message")); String version = null2unknown((String) fields.get("vpc_Version")); String cardType = null2unknown((String) fields.get("vpc_Card")); String orderInfo = null2unknown((String) fields.get("vpc_OrderInfo")); String receiptNo = null2unknown((String) fields.get("vpc_ReceiptNo")); String merchantID = null2unknown((String) fields.get("vpc_Merchant")); String merchTxnRef = null2unknown((String) txtref); String authorizeID = null2unknown((String) fields.get("vpc_AuthorizeId")); String transactionNo = null2unknown((String) fields.get("vpc_TransactionNo")); String acqResponseCode = null2unknown((String) fields.get("vpc_AcqResponseCode")); String txnResponseCode = null2unknown((String) fields.get("vpc_TxnResponseCode")); // CSC Receipt Data String vCSCResultCode = null2unknown((String) fields.get("vpc_CSCResultCode")); String vCSCRequestCode = null2unknown((String) fields.get("vpc_CSCRequestCode")); String vACQCSCRespCode = null2unknown((String) fields.get("vpc_AcqCSCRespCode")); // 3-D Secure Data String transType3DS = null2unknown((String) fields.get("vpc_VerType")); String verStatus3DS = null2unknown((String) fields.get("vpc_VerStatus")); String token3DS = null2unknown((String) fields.get("vpc_VerToken")); String secureLevel3DS = null2unknown((String) fields.get("vpc_VerSecurityLevel")); String enrolled3DS = null2unknown((String) fields.get("vpc_3DSenrolled")); String xid3DS = null2unknown((String) fields.get("vpc_3DSXID")); String eci3DS = null2unknown((String) fields.get("vpc_3DSECI")); String status3DS = null2unknown((String) fields.get("vpc_3DSstatus")); String acqAVSRespCode = null2unknown((String) fields.get("vpc_AcqAVSRespCode")); String riskOverallResult = null2unknown((String) fields.get("vpc_RiskOverallResult")); String error = ""; // Show this page as an error page if error condition if (txnResponseCode == null || txnResponseCode.equals("7") || txnResponseCode.equals("No Value Returned") || errorExists) { error = "Error "; log.info("ERROR in Processing Transaction"); } PaymentResponse response = new PaymentResponse(); response.setAmount(amount); response.setLocale(locale); response.setBatchNo(batchNo); response.setCommand(command); response.setMessage(message); response.setVersion(version); response.setCard(cardType); response.setOrderInfo(orderInfo); response.setReceiptNo(receiptNo); response.setMerchant(merchantID); response.setMerchTxnRef(merchTxnRef); response.setAuthorizeId(authorizeID); response.setTransactionNo(transactionNo); response.setAcqResponseCode(acqResponseCode); response.setTxnResponseCode(txnResponseCode); response.setcSCResultCode(vCSCResultCode); response.setcSCRequestCode(vCSCRequestCode); response.setAcqCSCRespCode(vACQCSCRespCode); response.setVerType(transType3DS); response.setVerStatus(verStatus3DS); response.setVerToken(token3DS); response.setVerSecurityLevel(secureLevel3DS); response.setD3Senrolled(enrolled3DS); response.setD3sxid(xid3DS); response.setD3SECI(eci3DS); response.setD3Sstatus(status3DS); response.setAcqAVSRespCode(acqAVSRespCode); response.setSecureHash(vpc_Txn_Secure_Hash); response.setRiskOverallResult(riskOverallResult); Date date = Calendar.getInstance().getTime(); response.setUpdateDate(date); response.setCreationDate(date); try { FacadeFactory.getFacade().store(response); Transaction txn = getPaymentByTxnRef(merchTxnRef); if (txnResponseCode.equals("0")) { txn.setStatus("SUCCESS"); txn.setReceiptNo(receiptNo); txn.setSyncStatus(2); } else { txn.setStatus("FAIL"); } FacadeFactory.getFacade().store(txn); } catch (Exception e) { log.error("Error n saving response" + response.toString(), e); } return txnResponseCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateHashFromServer(PaymentParams mPaymentParams) {\n //nextButton.setEnabled(false); // lets not allow the user to click the button again and again.\n\n // lets create the post params\n StringBuffer postParamsBuffer = new StringBuffer();\n postParamsBuffer.append(concatParams(PayuConstants.KEY, mPaymentParams.getKey()));\n postParamsBuffer.append(concatParams(PayuConstants.AMOUNT, mPaymentParams.getAmount()));\n postParamsBuffer.append(concatParams(PayuConstants.TXNID, mPaymentParams.getTxnId()));\n postParamsBuffer.append(concatParams(PayuConstants.EMAIL, null == mPaymentParams.getEmail() ? \"\" : mPaymentParams.getEmail()));\n postParamsBuffer.append(concatParams(PayuConstants.PRODUCT_INFO, mPaymentParams.getProductInfo()));\n postParamsBuffer.append(concatParams(PayuConstants.FIRST_NAME, null == mPaymentParams.getFirstName() ? \"\" : mPaymentParams.getFirstName()));\n postParamsBuffer.append(concatParams(PayuConstants.UDF1, mPaymentParams.getUdf1() == null ? \"\" : mPaymentParams.getUdf1()));\n postParamsBuffer.append(concatParams(PayuConstants.UDF2, mPaymentParams.getUdf2() == null ? \"\" : mPaymentParams.getUdf2()));\n postParamsBuffer.append(concatParams(PayuConstants.UDF3, mPaymentParams.getUdf3() == null ? \"\" : mPaymentParams.getUdf3()));\n postParamsBuffer.append(concatParams(PayuConstants.UDF4, mPaymentParams.getUdf4() == null ? \"\" : mPaymentParams.getUdf4()));\n postParamsBuffer.append(concatParams(PayuConstants.UDF5, mPaymentParams.getUdf5() == null ? \"\" : mPaymentParams.getUdf5()));\n postParamsBuffer.append(concatParams(PayuConstants.USER_CREDENTIALS, mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials()));\n\n // for offer_key\n if (null != mPaymentParams.getOfferKey())\n postParamsBuffer.append(concatParams(PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey()));\n\n String postParams = postParamsBuffer.charAt(postParamsBuffer.length() - 1) == '&' ? postParamsBuffer.substring(0, postParamsBuffer.length() - 1).toString() : postParamsBuffer.toString();\n\n // lets make an api call\n GetHashesFromServerTask getHashesFromServerTask = new GetHashesFromServerTask();\n getHashesFromServerTask.execute(postParams);\n }", "public void generateHashFromSDK(PaymentParams mPaymentParams, String salt) {\n PayuHashes payuHashes = new PayuHashes();\n PostData postData = new PostData();\n\n // payment Hash;\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setAmount(mPaymentParams.getAmount());\n checksum.setKey(mPaymentParams.getKey());\n checksum.setTxnid(mPaymentParams.getTxnId());\n checksum.setEmail(mPaymentParams.getEmail());\n checksum.setSalt(salt);\n checksum.setProductinfo(mPaymentParams.getProductInfo());\n checksum.setFirstname(mPaymentParams.getFirstName());\n checksum.setUdf1(mPaymentParams.getUdf1());\n checksum.setUdf2(mPaymentParams.getUdf2());\n checksum.setUdf3(mPaymentParams.getUdf3());\n checksum.setUdf4(mPaymentParams.getUdf4());\n checksum.setUdf5(mPaymentParams.getUdf5());\n\n postData = checksum.getHash();\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setPaymentHash(postData.getResult());\n }\n\n // checksum for payemnt related details\n // var1 should be either user credentials or default\n String var1 = mPaymentParams.getUserCredentials() == null ? PayuConstants.DEFAULT : mPaymentParams.getUserCredentials();\n String key = mPaymentParams.getKey();\n\n if ((postData = calculateHash(key, PayuConstants.PAYMENT_RELATED_DETAILS_FOR_MOBILE_SDK, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // Assign post data first then check for success\n payuHashes.setPaymentRelatedDetailsForMobileSdkHash(postData.getResult());\n //vas\n if ((postData = calculateHash(key, PayuConstants.VAS_FOR_MOBILE_SDK, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setVasForMobileSdkHash(postData.getResult());\n\n // getIbibocodes\n if ((postData = calculateHash(key, PayuConstants.GET_MERCHANT_IBIBO_CODES, PayuConstants.DEFAULT, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setMerchantIbiboCodesHash(postData.getResult());\n\n if (!var1.contentEquals(PayuConstants.DEFAULT)) {\n // get user card\n if ((postData = calculateHash(key, PayuConstants.GET_USER_CARDS, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) // todo rename storedc ard\n payuHashes.setStoredCardsHash(postData.getResult());\n // save user card\n if ((postData = calculateHash(key, PayuConstants.SAVE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setSaveCardHash(postData.getResult());\n // delete user card\n if ((postData = calculateHash(key, PayuConstants.DELETE_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setDeleteCardHash(postData.getResult());\n // edit user card\n if ((postData = calculateHash(key, PayuConstants.EDIT_USER_CARD, var1, salt)) != null && postData.getCode() == PayuErrors.NO_ERROR)\n payuHashes.setEditCardHash(postData.getResult());\n }\n\n if (mPaymentParams.getOfferKey() != null) {\n postData = calculateHash(key, PayuConstants.OFFER_KEY, mPaymentParams.getOfferKey(), salt);\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n }\n\n if (mPaymentParams.getOfferKey() != null && (postData = calculateHash(key, PayuConstants.CHECK_OFFER_STATUS, mPaymentParams.getOfferKey(), salt)) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuHashes.setCheckOfferStatusHash(postData.getResult());\n }\n\n // we have generated all the hases now lest launch sdk's ui\n launchSdkUI(payuHashes);\n }", "com.google.protobuf.ByteString getMerchantData();", "com.google.protobuf.ByteString getMerchantData();", "public HashMap<String, String> getAllOneClickHashHelper(String merchantKey, String userCredentials) {\n\n // now make the api call.\n final String postParams = \"merchant_key=\" + merchantKey + \"&user_credentials=\" + userCredentials;\n HashMap<String, String> cardTokens = new HashMap<String, String>();\n\n try {\n //TODO Replace below url with your server side file url.\n URL url = new URL(\"https://payu.herokuapp.com/get_merchant_hashes\");\n\n byte[] postParamsByte = postParams.getBytes(\"UTF-8\");\n\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n conn.setRequestProperty(\"Content-Length\", String.valueOf(postParamsByte.length));\n conn.setDoOutput(true);\n conn.getOutputStream().write(postParamsByte);\n\n InputStream responseInputStream = conn.getInputStream();\n StringBuffer responseStringBuffer = new StringBuffer();\n byte[] byteContainer = new byte[1024];\n for (int i; (i = responseInputStream.read(byteContainer)) != -1; ) {\n responseStringBuffer.append(new String(byteContainer, 0, i));\n }\n\n JSONObject response = new JSONObject(responseStringBuffer.toString());\n\n JSONArray oneClickCardsArray = response.getJSONArray(\"data\");\n int arrayLength;\n if ((arrayLength = oneClickCardsArray.length()) >= 1) {\n for (int i = 0; i < arrayLength; i++) {\n cardTokens.put(oneClickCardsArray.getJSONArray(i).getString(0), oneClickCardsArray.getJSONArray(i).getString(1));\n }\n\n }\n // pass these to next activity\n\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (ProtocolException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return cardTokens;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((AppController) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "private PayUmoneySdkInitializer.PaymentParam calculateServerSideHashAndInitiatePayment1(final PayUmoneySdkInitializer.PaymentParam paymentParam) {\n\n StringBuilder stringBuilder = new StringBuilder();\n HashMap<String, String> params = paymentParam.getParams();\n stringBuilder.append(params.get(PayUmoneyConstants.KEY) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.TXNID) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.AMOUNT) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.PRODUCT_INFO) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.FIRSTNAME) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.EMAIL) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF1) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF2) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF3) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF4) + \"|\");\n stringBuilder.append(params.get(PayUmoneyConstants.UDF5) + \"||||||\");\n\n AppEnvironment appEnvironment = ((BaseApplication) getApplication()).getAppEnvironment();\n stringBuilder.append(appEnvironment.salt());\n\n String hash = hashCal(stringBuilder.toString());\n paymentParam.setMerchantHash(hash);\n\n return paymentParam;\n }", "public void generateHashFromServer(PayUmoneySdkInitializer.PaymentParam paymentParam) {\n //nextButton.setEnabled(false); // lets not allow the user to click the button again and again.\n\n HashMap<String, String> params = paymentParam.getParams();\n\n // lets create the post params\n StringBuffer postParamsBuffer = new StringBuffer();\n postParamsBuffer.append(concatParams(PayUmoneyConstants.KEY, params.get(PayUmoneyConstants.KEY)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.AMOUNT, params.get(PayUmoneyConstants.AMOUNT)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.TXNID, params.get(PayUmoneyConstants.TXNID)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.EMAIL, params.get(PayUmoneyConstants.EMAIL)));\n postParamsBuffer.append(concatParams(\"productinfo\", params.get(PayUmoneyConstants.PRODUCT_INFO)));\n postParamsBuffer.append(concatParams(\"firstname\", params.get(PayUmoneyConstants.FIRSTNAME)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.UDF1, params.get(PayUmoneyConstants.UDF1)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.UDF2, params.get(PayUmoneyConstants.UDF2)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.UDF3, params.get(PayUmoneyConstants.UDF3)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.UDF4, params.get(PayUmoneyConstants.UDF4)));\n postParamsBuffer.append(concatParams(PayUmoneyConstants.UDF5, params.get(PayUmoneyConstants.UDF5)));\n\n String postParams = postParamsBuffer.charAt(postParamsBuffer.length() - 1) == '&' ? postParamsBuffer.substring(0, postParamsBuffer.length() - 1).toString() : postParamsBuffer.toString();\n\n // lets make an api call\n GetHashesFromServerTask getHashesFromServerTask = new GetHashesFromServerTask();\n getHashesFromServerTask.execute(postParams);\n }", "private void fetchMerchantHashes(final Intent intent) {\n // now make the api call.\n final String postParams = \"merchant_key=\" + merchantKey + \"&user_credentials=\" + userCredentials;\n final Intent baseActivityIntent = intent;\n new AsyncTask<Void, Void, HashMap<String, String>>() {\n\n @Override\n protected HashMap<String, String> doInBackground(Void... params) {\n try {\n //TODO Replace below url with your server side file url.\n URL url = new URL(\"https://payu.herokuapp.com/get_merchant_hashes\");\n\n byte[] postParamsByte = postParams.getBytes(\"UTF-8\");\n\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n conn.setRequestProperty(\"Content-Length\", String.valueOf(postParamsByte.length));\n conn.setDoOutput(true);\n conn.getOutputStream().write(postParamsByte);\n\n InputStream responseInputStream = conn.getInputStream();\n StringBuffer responseStringBuffer = new StringBuffer();\n byte[] byteContainer = new byte[1024];\n for (int i; (i = responseInputStream.read(byteContainer)) != -1; ) {\n responseStringBuffer.append(new String(byteContainer, 0, i));\n }\n\n JSONObject response = new JSONObject(responseStringBuffer.toString());\n\n HashMap<String, String> cardTokens = new HashMap<String, String>();\n JSONArray oneClickCardsArray = response.getJSONArray(\"data\");\n int arrayLength;\n if ((arrayLength = oneClickCardsArray.length()) >= 1) {\n for (int i = 0; i < arrayLength; i++) {\n cardTokens.put(oneClickCardsArray.getJSONArray(i).getString(0), oneClickCardsArray.getJSONArray(i).getString(1));\n }\n return cardTokens;\n }\n // pass these to next activity\n\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (ProtocolException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(HashMap<String, String> oneClickTokens) {\n super.onPostExecute(oneClickTokens);\n\n baseActivityIntent.putExtra(PayuConstants.ONE_CLICK_CARD_TOKENS, oneClickTokens);\n startActivityForResult(baseActivityIntent, PayuConstants.PAYU_REQUEST_CODE);\n }\n }.execute();\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.VERIFY_PAYMENT);\n // var 1 is from date\n payUChecksum.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.VERIFY_PAYMENT);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(verifyPaymentTransactionIdEditText.getText().toString());\n if((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR ){\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n VerifyPaymentTask verifyPaymentTask = new VerifyPaymentTask(PayUVerifyApiActivity.this);\n verifyPaymentTask.execute(payuConfig);\n\n verifyPaymentDialog.dismiss();\n\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }else{\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private void storeMerchantHash(String cardToken, String merchantHash) {\n\n final String postParams = \"merchant_key=\" + merchantKey + \"&user_credentials=\" + userCredentials + \"&card_token=\" + cardToken + \"&merchant_hash=\" + merchantHash;\n\n new AsyncTask<Void, Void, Void>() {\n\n @Override\n protected Void doInBackground(Void... params) {\n try {\n\n //TODO Deploy a file on your server for storing cardToken and merchantHash nad replace below url with your server side file url.\n URL url = new URL(\"https://payu.herokuapp.com/store_merchant_hash\");\n\n byte[] postParamsByte = postParams.getBytes(\"UTF-8\");\n\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"POST\");\n conn.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n conn.setRequestProperty(\"Content-Length\", String.valueOf(postParamsByte.length));\n conn.setDoOutput(true);\n conn.getOutputStream().write(postParamsByte);\n\n InputStream responseInputStream = conn.getInputStream();\n StringBuffer responseStringBuffer = new StringBuffer();\n byte[] byteContainer = new byte[1024];\n for (int i; (i = responseInputStream.read(byteContainer)) != -1; ) {\n responseStringBuffer.append(new String(byteContainer, 0, i));\n }\n\n JSONObject response = new JSONObject(responseStringBuffer.toString());\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (ProtocolException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(Void aVoid) {\n super.onPostExecute(aVoid);\n this.cancel(true);\n }\n }.execute();\n }", "public void generateHashFromServer(PayUmoneySdkInitializer.PaymentParam paymentParam) {\n //nextButton.setEnabled(false); // lets not allow the user to click the button again and again.\n\n HashMap<String, String> params = paymentParam.getParams();\n\n // lets create the post params\n StringBuffer postParamsBuffer = new StringBuffer();\n //postParamsBuffer.append(concatParams(PayUmoneyConstants.KEY, params.get(PayUmoneyConstants.KEY)));\n postParamsBuffer.append(concatParams(\"amount\", params.get(PayUmoneyConstants.AMOUNT)));\n postParamsBuffer.append(concatParams(\"txnid\", params.get(PayUmoneyConstants.TXNID)));\n postParamsBuffer.append(concatParams(\"email\", params.get(PayUmoneyConstants.EMAIL)));\n postParamsBuffer.append(concatParams(\"productinfo\", params.get(PayUmoneyConstants.PRODUCT_INFO)));\n postParamsBuffer.append(concatParams(\"firstname\", params.get(PayUmoneyConstants.FIRSTNAME)));\n\n String postParams = postParamsBuffer.charAt(postParamsBuffer.length() - 1) == '&' ? postParamsBuffer.substring(0, postParamsBuffer.length() - 1).toString() : postParamsBuffer.toString();\n\n // lets make an api call\n SubscriptionActivity.GetHashesFromServerTask getHashesFromServerTask = new SubscriptionActivity.GetHashesFromServerTask();\n getHashesFromServerTask.execute(postParams);\n }", "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000020;\n merchantData_ = value;\n }", "@Override\n public void onClick(View v) {\n PayUChecksum payUChecksum = new PayUChecksum();\n payUChecksum.setKey(mPaymentParams.getKey());\n payUChecksum.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n // var 1 is from date\n payUChecksum.setVar1(fromDateEditText.getText().toString());\n payUChecksum.setSalt(bundle.getString(PayuConstants.SALT));\n if ((postData = payUChecksum.getHash()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n MerchantWebService merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.GET_TRANSACTION_INFO);\n merchantWebService.setHash(postData.getResult());\n merchantWebService.setVar1(fromDateEditText.getText().toString());\n merchantWebService.setVar2(fromDateEditText.getText().toString());\n if ((postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams()) != null && postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n // lets make api call\n GetTransactionInfoTask getTransactionInfoTask = new GetTransactionInfoTask(PayUVerifyApiActivity.this);\n getTransactionInfoTask.execute(payuConfig);\n\n getTransactionInformationAlertDialog.dismiss();\n\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private void setMerchantData(com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n bitField0_ |= 0x00000001;\n merchantData_ = value;\n }", "private GetMerchantByParkingResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "private static boolean verifyDeveloperPayload(Purchase p) {\n RequestParams params = new RequestParams();\n params.put(\"signed_data\", p.getOriginalJson());\n params.put(\"signature\", p.getSignature());\n\n String url = \"http://54.218.122.252/api/receipt/android\";\n\n AsyncHttpClient client = new AsyncHttpClient();\n\n client.post(url, params, new ResponseHandlerInterface() {\n @Override\n public void sendResponseMessage(HttpResponse httpResponse) throws IOException {\n\n }\n\n @Override\n public void sendStartMessage() {\n\n }\n\n @Override\n public void sendFinishMessage() {\n\n }\n\n @Override\n public void sendProgressMessage(long l, long l1) {\n\n }\n\n @Override\n public void sendCancelMessage() {\n\n }\n\n @Override\n public void sendSuccessMessage(int i, Header[] headers, byte[] bytes) {\n\n }\n\n @Override\n public void sendFailureMessage(int i, Header[] headers, byte[] bytes, Throwable throwable) {\n\n }\n\n @Override\n public void sendRetryMessage(int i) {\n\n }\n\n @Override\n public URI getRequestURI() {\n return null;\n }\n\n @Override\n public void setRequestURI(URI uri) {\n\n }\n\n @Override\n public Header[] getRequestHeaders() {\n return new Header[0];\n }\n\n @Override\n public void setRequestHeaders(Header[] headers) {\n\n }\n\n @Override\n public boolean getUseSynchronousMode() {\n return false;\n }\n\n @Override\n public void setUseSynchronousMode(boolean b) {\n\n }\n\n @Override\n public boolean getUsePoolThread() {\n return false;\n }\n\n @Override\n public void setUsePoolThread(boolean b) {\n\n }\n\n @Override\n public void onPreProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n\n }\n\n @Override\n public void onPostProcessResponse(ResponseHandlerInterface responseHandlerInterface, HttpResponse httpResponse) {\n try {\n String result = EntityUtils.toString(httpResponse.getEntity());\n JSONObject myObject = new JSONObject(result);\n if(myObject.getInt(\"status\") == 1) {\n unlockContentSuccess();\n } else {\n complain(\"Error purchasing. Authenticity verification failed.\");\n }\n }catch (Exception ex) {\n Log.d(TAG, ex.getMessage());\n }\n }\n\n @Override\n public Object getTag() {\n return null;\n }\n\n @Override\n public void setTag(Object o) {\n\n }\n });\n return false;\n\n /*\n * TODO: verify that the developer payload of the purchase is correct.\n * It will be the same one that you sent when initiating the purchase.\n *\n * WARNING: Locally generating a random string when starting a purchase\n * and verifying it here might seem like a good approach, but this will\n * fail in the case where the user purchases an item on one device and\n * then uses your app on a different device, because on the other device\n * you will not have access to the random string you originally\n * generated.\n *\n * So a good developer payload has these characteristics:\n *\n * 1. If two different users purchase an item, the payload is different\n * between them, so that one user's purchase can't be replayed to\n * another user.\n *\n * 2. The payload must be such that you can verify it even when the app\n * wasn't the one who initiated the purchase flow (so that items\n * purchased by the user on one device work on other devices owned by\n * the user).\n *\n * Using your own server to store and verify developer payloads across\n * app installations is recommended.\n */\n //return true;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return merchantData_;\n }", "public static String[] decryptIDTECHBlock(byte[] data) {\n /*\n * DATA[0]: CARD TYPE: 0x0 - payment card\n * DATA[1]: TRACK FLAGS\n * DATA[2]: TRACK 1 LENGTH\n * DATA[3]: TRACK 2 LENGTH\n * DATA[4]: TRACK 3 LENGTH\n * DATA[??]: TRACK 1 DATA MASKED\n * DATA[??]: TRACK 2 DATA MASKED\n * DATA[??]: TRACK 3 DATA\n * DATA[??]: TRACK 1 AND TRACK 2 TDES ENCRYPTED\n * DATA[??]: TRACK 1 SHA1 (0x14 BYTES)\n * DATA[??]: TRACK 2 SHA1 (0x14 BYTES)\n * DATA[??]: DUKPT SERIAL AND COUNTER (0x0A BYTES)\n */\n int cardType = data[0] & 0xff;\n int track1Len = data[2] & 0xff;\n int track2Len = data[3] & 0xff;\n int track3Len = data[4] & 0xff;\n int offset = 5;\n\n String[] result = new String[4];\n result[0] = (cardType == 0) ? \"PAYMENT\" : \"UNKNOWN\";\n\n if (track1Len > 0) {\n offset += track1Len;\n }\n\n if (track2Len > 0) {\n offset += track2Len;\n }\n\n if (track3Len > 0) {\n result[3] = new String(data, offset, track3Len);\n offset += track3Len;\n }\n\n if ((track1Len + track2Len) > 0) {\n int blockSize = (track1Len + track2Len + 7) & 0xFFFFFF8;\n byte[] encrypted = new byte[blockSize];\n System.arraycopy(data, offset, encrypted, 0, encrypted.length);\n offset += blockSize;\n\n byte[] track1Hash = new byte[20];\n System.arraycopy(data, offset, track1Hash, 0, track1Hash.length);\n offset += track1Hash.length;\n\n byte[] track2Hash = new byte[20];\n System.arraycopy(data, offset, track2Hash, 0, track2Hash.length);\n offset += track2Hash.length;\n\n byte[] ipek = IDTECH_DATA_KEY_BYTES;\n byte[] ksn = new byte[10];\n System.arraycopy(data, offset, ksn, 0, ksn.length);\n offset += ksn.length;\n\n byte[] dataKey = CryptoUtil.calculateDataKey(ksn, ipek);\n byte[] decrypted = CryptoUtil.decrypt3DESCBC(dataKey, encrypted);\n\n if (decrypted == null) throw new RuntimeException(\"Failed to decrypt\");\n\n if (track1Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, 0, track1Len);\n if (!Arrays.equals(track1Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track2Len > 0) {\n byte[] calcHash = CryptoUtil.calculateSHA1(decrypted, track1Len, track2Len);\n if (!Arrays.equals(track2Hash, calcHash)) {\n throw new RuntimeException(\"Wrong key\");\n }\n }\n\n if (track1Len > 0) {\n result[1] = new String(decrypted, 0, track1Len);\n }\n\n if (track2Len > 0) {\n result[2] = new String(decrypted, track1Len, track2Len);\n }\n }\n\n return result;\n }", "@Override\n protected String buildPaySign(Map<String, String> api_response_params, String api_key) throws PayException {\n Map<String,String > params = new LinkedHashMap<>();\n params.put(amount ,api_response_params.get(amount));\n params.put(order_no ,api_response_params.get(order_no));\n params.put(plat_num ,api_response_params.get(plat_num));\n params.put(app_id ,api_response_params.get(app_id));\n params.put(sign_type ,api_response_params.get(sign_type));\n params.put(pay_type ,api_response_params.get(pay_type));\n params.put(status ,api_response_params.get(status));\n params.put(back_status ,api_response_params.get(back_status));\n params.put(complete_time ,api_response_params.get(complete_time));\n String signMd5 = JSON.toJSONString(params);\n\n log.debug(\"[酷狗支付]-[响应支付]-2.生成加密URL签名完成:{}\", JSON.toJSONString(signMd5) );\n return signMd5;\n }", "private void getSecret() {\n\t\tAWSSecretsManager client = AWSSecretsManagerClientBuilder.standard().withRegion(region).build();\n\n\t\t// In this sample we only handle the specific exceptions for the\n\t\t// 'GetSecretValue' API.\n\t\t// See\n\t\t// https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html\n\t\t// We rethrow the exception by default.\n\n\t\tGetSecretValueRequest getSecretValueRequest = new GetSecretValueRequest().withSecretId(secretName);\n\t\tGetSecretValueResult getSecretValueResult = null;\n\n\t\ttry {\n\t\t\tgetSecretValueResult = client.getSecretValue(getSecretValueRequest);\n\t\t}\n\t\t// @TODO: Figure out what I should do here. Generic exception?.\n\t\tcatch (DecryptionFailureException e) {\n\t\t\t// Secrets Manager can't decrypt the protected secret text using the provided\n\t\t\t// KMS key.\n\t\t\t// Deal with the exception here, and/or rethrow at your discretion.\n\t\t\te.printStackTrace();\n\t\t} catch (InternalServiceErrorException e) {\n\t\t\t// An error occurred on the server side.\n\t\t\t// Deal with the exception here, and/or rethrow at your discretion.\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidParameterException e) {\n\t\t\t// You provided an invalid value for a parameter.\n\t\t\t// Deal with the exception here, and/or rethrow at your discretion.\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidRequestException e) {\n\t\t\t// You provided a parameter value that is not valid for the current state of the\n\t\t\t// resource.\n\t\t\t// Deal with the exception here, and/or rethrow at your discretion.\n\t\t\te.printStackTrace();\n\t\t} catch (ResourceNotFoundException e) {\n\t\t\t// We can't find the resource that you asked for.\n\t\t\t// Deal with the exception here, and/or rethrow at your discretion.\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (getSecretValueResult.getSecretString() != null) {\n\t\t\ttry {\n\t\t\t\tresult = new ObjectMapper().readValue(getSecretValueResult.getSecretString(), HashMap.class);\n\t\t\t} catch (JsonMappingException e) {\n\t\t\t\tlogger.error(\"ERROR :\", e);\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (JsonProcessingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}\n\t\t// AWS defualt else, unsure why it is in the default. Need to check.\n\t\t//Maybe encryption not setup right?\n\t\telse {\n\t\t\tdecodedBinarySecret = new String(\n\t\t\t\t\tBase64.getDecoder().decode(getSecretValueResult.getSecretBinary()).array());\n\t\t}\n\t}", "@Test(dependsOnMethods = \"testUpdateSecret\")\n public void testListSecretVersions() {\n SecretAttributes attributes = SecretAttributes.create(true, null, null, null, null, null);\n SecretBundle secretBundle = api().setSecret(vaultUri,\n SECRET_NAME,\n attributes,\n \"aNewSecretKey\",\n null,\n \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"MIIBvAIBAAKBgQDvgcVEyeU5gfw69xY2n1zHWGp/Z8O573SiWIcy29rW382W6jvn\\n\" +\n \"X5rF/LX8AscwRhf2pUTEy64ECkd08eRgEjRIKdGSaTZpBXxM25TPb2fF9k1/ObXd\\n\" +\n \"SkNOQNlwoCHdyQlvwdkVRohJoBX9u371owXObwLiBR1V597p3PdGNYD3DQIVAPtD\\n\" +\n \"dHQQaHCYMxAIXRsaCmOZfsjdAoGBANVOovY4XqS48hvi/RzcCMbRbuHMFBXh/lEM\\n\" +\n \"FmBdZ5sczpi1S3KpEjnBPQfOTzspTlEm5y6cHbkQjh1qT1tMdPAAr5aHYVLCTR+v\\n\" +\n \"CSSALXP48YiZrJcgdyfhbyr5h/Su2QuwX2DvYrR9d88fYHU4O0njEyMd8UFwQ6Uy\\n\" +\n \"qez/catgAoGAJ2AbSklFUXYvehmCVO6XVo3bgO++C3GMycJY3HHTTFQNAb3LJkeO\\n\" +\n \"fa2ZCSqWbd85M00Lt0VEkqlb0EkjDvAgL0R78IJUmvb3FH1RiUofP/yK3g1/3I/l\\n\" +\n \"jUa1fXXn2jSFYcyzGaDnC2U/B55g9G7hXsXJuldwATfDnLtqCdNPoWcCFQDx5K/k\\n\" +\n \"Ub4xHF/4Tau8wDAkxHeJiw==\\n\" +\n \"-----END DSA PRIVATE KEY-----\"\n );\n\n // List secret versions\n List<Secret> secrets = api().getSecretVersions(vaultUri, SECRET_NAME);\n assertNotNull(secrets);\n assertEquals(secrets.size(), 2);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString hppUrl = \"https://test.adyen.com/hpp/pay.shtml\";\n\t\tString hmacKey = \"YourHmacSecretKey\";\n\n\t\t/**\n\t\t * Defining variables\n\t\t * The HPP requires certain variables to be posted in order to create a payment possibility for the shopper.\n\t\t * \n\t\t * The variables that you can post to the HPP are the following:\n\t\t * \n\t\t * <pre>\n\t\t * merchantReference : Your reference for this payment.\n\t\t * paymentAmount : The transaction amount in minor units (e.g. EUR 1,00 = 100).\n\t\t * currencyCode : The three character ISO currency code.\n\t\t * shipBeforeDate : The date by which the goods or services specifed in the order must be shipped.\n\t\t * Format: YYYY-MM-DD\n\t\t * skinCode : The code of the skin to be used for the payment.\n\t\t * merchantAccount : The merchant account for which you want to process the payment.\n\t\t * sessionValidity : The time by which a payment needs to have been made.\n\t\t * Format: YYYY-MM-DDThh:mm:ssTZD\n\t\t * shopperLocale : A combination of language code and country code used to specify the language to be\n\t\t * used in the payment session (e.g. en_GB).\n\t\t * orderData : A fragment of HTML/text that will be displayed on the HPP. (optional)\n\t\t * countryCode : Country code according to ISO_3166-1_alpha-2 standard. (optional)\n\t\t * shopperEmail : The shopper's email address. (recommended)\n\t\t * shopperReference : An ID that uniquely identifes the shopper, such as a customer id. (recommended)\n\t\t * allowedMethods : A comma-separated list of allowed payment methods, i.e. \"ideal,mc,visa\". (optional)\n\t\t * blockedMethods : A comma-separated list of blocked payment methods, i.e. \"ideal,mc,visa\". (optional)\n\t\t * offset : An integer that is added to the normal fraud score. (optional)\n\t\t * merchantSig : The HMAC signature used by Adyen to test the validy of the form.\n\t\t * \n\t\t * recurringContract : Can be \"ONECLICK\", \"RECURRING\" or \"ONECLICK,RECURRING\". (optional)\n\t\t * This allows you to store the payment details as a ONECLICK and/or RECURRING contract.\n\t\t * Please note that if you supply recurringContract, shopperEmail and shopperReference\n\t\t * become mandatory. Please view the recurring examples in the repository as well.\n\t\t * shopperStatement : Submit a variable shopper statement. (optional)\n\t\t * merchantReturnData : This field will be passed back as-is on the return URL when the shopper completes\n\t\t * (or abandons) the payment and returns to your shop. (optional)\n\t\t * brandCode : The payment method the shopper likes to pay with, i.e. ideal. (optional)\n\t\t * issuerId : If brandCode specifies a redirect payment method, the issuer can be defined here\n\t\t * forcing the HPP to redirect directly to the payment method. (optional)\n\t\t * </pre>\n\t\t */\n\n\t\t// Generate dates\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tDate currentDate = calendar.getTime(); // current date\n\t\tcalendar.add(Calendar.DATE, 1);\n\t\tDate sessionDate = calendar.getTime(); // current date + 1 day\n\t\tcalendar.add(Calendar.DATE, 2);\n\t\tDate shippingDate = calendar.getTime(); // current date + 3 days\n\n\t\t// Define variables\n\t\tString merchantReference = \"TEST-PAYMENT-\" + new SimpleDateFormat(\"yyyy-MM-dd-HH:mm:ss\").format(currentDate);\n\t\tString paymentAmount = \"199\";\n\t\tString currencyCode = \"EUR\";\n\t\tString shipBeforeDate = new SimpleDateFormat(\"yyyy-MM-dd\").format(shippingDate);\n\t\tString skinCode = \"YourSkinCode\";\n\t\tString merchantAccount = \"YourMerchantAccount\";\n\t\tString sessionValidity = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ssXXX\").format(sessionDate);\n\t\tString shopperLocale = \"en_US\";\n\t\tString orderData = compressString(\"Orderdata to display on the HPP can be put here\");\n\t\tString countryCode = \"NL\";\n\t\tString shopperEmail = \"\";\n\t\tString shopperReference = \"\";\n\t\tString allowedMethods = \"\";\n\t\tString blockedMethods = \"\";\n\t\tString offset = \"\";\n\n\t\tString recurringContract = \"\";\n\t\tString shopperStatement = \"\";\n\t\tString merchantReturnData = \"\";\n\n\t\t// By providing the brandCode and issuerId the HPP will redirect the shopper directly to this payment method.\n\t\t// Please note: the form should be posted to https://test.adyen.com/hpp/details.shtml rather than pay.shtml,\n\t\t// change the hppUrl accordingly. While posting to details.shtml countryCode becomes a required as well.\n\t\tString brandCode = \"\";\n\t\tString issuerId = \"\";\n\n\t\t/**\n\t\t * Collecting Shopper Information\n\t\t * \n\t\t * Address Verification System (AVS) is a security feature that verifies the billing address and/or\n\t\t * delivery address and/or shopper information of the card holder. To enable AVS the Billing Address Fields\n\t\t * (AVS) field must be checked under Skin Options for each skin you wish to use. The following variables\n\t\t * can be send to the HPP:\n\t\t * \n\t\t * <pre>\n\t\t * - billingAddress.street : The street name.\n\t\t * - billingAddress.houseNumberOrName : The house number (or name).\n\t\t * - billingAddress.city : The city.\n\t\t * - billingAddress.postalCode : The postal/zip code.\n\t\t * - billingAddress.stateOrProvince : The state or province.\n\t\t * - billingAddress.country : The country in ISO 3166-1 alpha-2 format (e.g. NL).\n\t\t * - billingAddressType : Specify whether the shopper is allowed to view and/or modify these\n\t\t * personal details (see below).\n\t\t * - billingAddressSig : A separate merchant signature for these fields.\n\t\t * \n\t\t * - deliveryAddress.street : The street name.\n\t\t * - deliveryAddress.houseNumberOrName : The house number (or name).\n\t\t * - deliveryAddress.city : The city.\n\t\t * - deliveryAddress.postalCode : The postal/zip code.\n\t\t * - deliveryAddress.stateOrProvince : The state or province.\n\t\t * - deliveryAddress.country : The country in ISO 3166-1 alpha-2 format (e.g. NL).\n\t\t * - deliveryAddressType : Specify whether the shopper is allowed to view and/or modify these\n\t\t * personal details (see below).\n\t\t * - deliveryAddressSig : A separate merchant signature for these fields.\n\t\t * \n\t\t * - shopper.firstName : The shopper's firstname.\n\t\t * - shopper.infix : The shopper infx.\n\t\t * - shopper.lastName : The shopper's lastname.\n\t\t * - shopper.gender : The shopper's gender (MALE/FEMALE).\n\t\t * - shopper.dateOfBirthDayOfMonth : The day of the month of the shopper's birth.\n\t\t * - shopper.dateOfBirthMonth : The month of the shopper's birth.\n\t\t * - shopper.dateOfBirthYear : The year of the shopper's birth.\n\t\t * - shopper.telephoneNumber : The shopper's telephone number.\n\t\t * - shopperType : This field can be used if validation of the shopper fields is desired.\n\t\t * - shopperSig : A separate merchant signature for these fields.\n\t\t * (optional if shopperType is not supplied)\n\t\t * </pre>\n\t\t * \n\t\t * Please note: billingAddressType, deliveryAddressType and shopperType can have the following values:\n\t\t * - Not supplied: modifiable / visible\n\t\t * - 1: unmodifiable / visible\n\t\t * - 2: unmodifiable / invisible\n\t\t */\n\n\t\tString billingAddressStreet = \"Simon Carmiggeltstraat\";\n\t\tString billingAddressHouseNumberOrName = \"6-50\";\n\t\tString billingAddressCity = \"Amsterdam\";\n\t\tString billingAddressPostalCode = \"1011 DJ\";\n\t\tString billingAddressStateOrProvince = \"\";\n\t\tString billingAddressCountry = \"NL\";\n\t\tString billingAddressType = \"\";\n\n\t\tString deliveryAddressStreet = \"Simon Carmiggeltstraat\";\n\t\tString deliveryAddressHouseNumberOrName = \"6-50\";\n\t\tString deliveryAddressCity = \"Amsterdam\";\n\t\tString deliveryAddressPostalCode = \"1011 DJ\";\n\t\tString deliveryAddressStateOrProvince = \"\";\n\t\tString deliveryAddressCountry = \"NL\";\n\t\tString deliveryAddressType = \"1\";\n\n\t\tString shopperFirstName = \"John\";\n\t\tString shopperInfix = \"\";\n\t\tString shopperLastName = \"Doe\";\n\t\tString shopperGender = \"MALE\";\n\t\tString shopperDateOfBirthDayOfMonth = \"05\";\n\t\tString shopperDateOfBirthMonth = \"10\";\n\t\tString shopperDateOfBirthYear = \"1990\";\n\t\tString shopperTelephoneNumber = \"+31612345678\";\n\t\tString shopperType = \"1\";\n\n\t\t/**\n\t\t * Signing the form\n\t\t * \n\t\t * The signatures are used by Adyen to verify if the posted data is not altered by the shopper. The signatures\n\t\t * must be encrypted according to the procedures below.\n\t\t */\n\n\t\tString signingString;\n\n\t\t// Compute the merchantSig\n\t\tString merchantSig;\n\t\ttry {\n\t\t\tsigningString = paymentAmount + currencyCode + shipBeforeDate + merchantReference + skinCode\n\t\t\t\t\t+ merchantAccount + sessionValidity + shopperEmail + shopperReference + recurringContract\n\t\t\t\t\t+ allowedMethods + blockedMethods + shopperStatement + merchantReturnData + billingAddressType\n\t\t\t\t\t+ deliveryAddressType + shopperType + offset;\n\t\t\tmerchantSig = calculateHMAC(hmacKey, signingString);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ServletException(e);\n\t\t}\n\n\t\t// Compute the billingAddressSig\n\t\tString billingAddressSig;\n\t\ttry {\n\t\t\tsigningString = billingAddressStreet + billingAddressHouseNumberOrName + billingAddressCity\n\t\t\t\t\t+ billingAddressPostalCode + billingAddressStateOrProvince + billingAddressCountry;\n\t\t\tbillingAddressSig = calculateHMAC(hmacKey, signingString);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ServletException(e);\n\t\t}\n\n\t\t// Compute the deliveryAddressSig\n\t\tString deliveryAddressSig;\n\t\ttry {\n\t\t\tsigningString = deliveryAddressStreet + deliveryAddressHouseNumberOrName + deliveryAddressCity\n\t\t\t\t\t+ deliveryAddressPostalCode + deliveryAddressStateOrProvince + deliveryAddressCountry;\n\t\t\tdeliveryAddressSig = calculateHMAC(hmacKey, signingString);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ServletException(e);\n\t\t}\n\n\t\t// Compute the shopperSig\n\t\tString shopperSig;\n\t\ttry {\n\t\t\tsigningString = shopperFirstName + shopperInfix + shopperLastName + shopperGender\n\t\t\t\t\t+ shopperDateOfBirthDayOfMonth + shopperDateOfBirthMonth + shopperDateOfBirthYear\n\t\t\t\t\t+ shopperTelephoneNumber;\n\t\t\tshopperSig = calculateHMAC(hmacKey, signingString);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ServletException(e);\n\t\t}\n\n\t\t// Set request parameters for use on the JSP page\n\t\trequest.setAttribute(\"hppUrl\", hppUrl);\n\t\trequest.setAttribute(\"merchantReference\", merchantReference);\n\t\trequest.setAttribute(\"paymentAmount\", paymentAmount);\n\t\trequest.setAttribute(\"currencyCode\", currencyCode);\n\t\trequest.setAttribute(\"shipBeforeDate\", shipBeforeDate);\n\t\trequest.setAttribute(\"skinCode\", skinCode);\n\t\trequest.setAttribute(\"merchantAccount\", merchantAccount);\n\t\trequest.setAttribute(\"sessionValidity\", sessionValidity);\n\t\trequest.setAttribute(\"shopperLocale\", shopperLocale);\n\t\trequest.setAttribute(\"orderData\", orderData);\n\t\trequest.setAttribute(\"countryCode\", countryCode);\n\t\trequest.setAttribute(\"shopperEmail\", shopperEmail);\n\t\trequest.setAttribute(\"shopperReference\", shopperReference);\n\t\trequest.setAttribute(\"recurringContract\", recurringContract);\n\t\trequest.setAttribute(\"allowedMethods\", allowedMethods);\n\t\trequest.setAttribute(\"blockedMethods\", blockedMethods);\n\t\trequest.setAttribute(\"shopperStatement\", shopperStatement);\n\t\trequest.setAttribute(\"merchantReturnData\", merchantReturnData);\n\t\trequest.setAttribute(\"offset\", offset);\n\t\trequest.setAttribute(\"brandCode\", brandCode);\n\t\trequest.setAttribute(\"issuerId\", issuerId);\n\n\t\trequest.setAttribute(\"billingAddressStreet\", billingAddressStreet);\n\t\trequest.setAttribute(\"billingAddressHouseNumberOrName\", billingAddressHouseNumberOrName);\n\t\trequest.setAttribute(\"billingAddressCity\", billingAddressCity);\n\t\trequest.setAttribute(\"billingAddressPostalCode\", billingAddressPostalCode);\n\t\trequest.setAttribute(\"billingAddressStateOrProvince\", billingAddressStateOrProvince);\n\t\trequest.setAttribute(\"billingAddressCountry\", billingAddressCountry);\n\t\trequest.setAttribute(\"billingAddressType\", billingAddressType);\n\n\t\trequest.setAttribute(\"deliveryAddressStreet\", deliveryAddressStreet);\n\t\trequest.setAttribute(\"deliveryAddressHouseNumberOrName\", deliveryAddressHouseNumberOrName);\n\t\trequest.setAttribute(\"deliveryAddressCity\", deliveryAddressCity);\n\t\trequest.setAttribute(\"deliveryAddressPostalCode\", deliveryAddressPostalCode);\n\t\trequest.setAttribute(\"deliveryAddressStateOrProvince\", deliveryAddressStateOrProvince);\n\t\trequest.setAttribute(\"deliveryAddressCountry\", deliveryAddressCountry);\n\t\trequest.setAttribute(\"deliveryAddressType\", deliveryAddressType);\n\n\t\trequest.setAttribute(\"shopperFirstName\", shopperFirstName);\n\t\trequest.setAttribute(\"shopperInfix\", shopperInfix);\n\t\trequest.setAttribute(\"shopperLastName\", shopperLastName);\n\t\trequest.setAttribute(\"shopperGender\", shopperGender);\n\t\trequest.setAttribute(\"shopperDateOfBirthDayOfMonth\", shopperDateOfBirthDayOfMonth);\n\t\trequest.setAttribute(\"shopperDateOfBirthMonth\", shopperDateOfBirthMonth);\n\t\trequest.setAttribute(\"shopperDateOfBirthYear\", shopperDateOfBirthYear);\n\t\trequest.setAttribute(\"shopperTelephoneNumber\", shopperTelephoneNumber);\n\t\trequest.setAttribute(\"shopperType\", shopperType);\n\n\t\trequest.setAttribute(\"merchantSig\", merchantSig);\n\t\trequest.setAttribute(\"billingAddressSig\", billingAddressSig);\n\t\trequest.setAttribute(\"deliveryAddressSig\", deliveryAddressSig);\n\t\trequest.setAttribute(\"shopperSig\", shopperSig);\n\t\t\n\t\t// Set correct character encoding\n\t\tresponse.setCharacterEncoding(\"UTF-8\");\n\n\t\t// Forward request data to corresponding JSP page\n\t\trequest.getRequestDispatcher(\"/1.HPP/create-payment-on-hpp-advanced.jsp\").forward(request, response);\n\t}", "private void splitBankStatementLine(HttpServletResponse response, String strReconciliationId,\n String strBankStatementLineId, String strTransactionId) throws IOException, ServletException {\n JSONObject table = new JSONObject();\n boolean returnError = false;\n FIN_Reconciliation rec = OBDal.getInstance().get(FIN_Reconciliation.class, strReconciliationId);\n FIN_BankStatementLine bsl = OBDal.getInstance().get(FIN_BankStatementLine.class,\n strBankStatementLineId);\n FIN_FinaccTransaction trx = OBDal.getInstance().get(FIN_FinaccTransaction.class,\n strTransactionId);\n try {\n OBContext.setAdminMode(true);\n if (rec != null && \"Y\".equals(rec.getPosted())) {\n // reconciliation posted not possible to split a row\n returnError = true;\n table.put(\"showJSMessage\", \"APRM_SplitBSLReconciliationPosted\");\n }\n if (bsl.getFinancialAccountTransaction() != null\n && bsl.getFinancialAccountTransaction().getReconciliation() != null) {\n returnError = true;\n table.put(\"showJSMessage\", \"APRM_SplitBSLAlreadyMatched\");\n }\n\n // If validation was ok continue with the split\n if (!returnError) {\n BigDecimal bslAmount = bsl.getCramount().subtract(bsl.getDramount());\n BigDecimal trxAmount = trx.getDepositAmount().subtract(trx.getPaymentAmount());\n\n if (bslAmount.compareTo(trxAmount) != 0) {\n // prevent trigger\n FIN_BankStatement bs = bsl.getBankStatement();\n bs.setProcessed(false);\n OBDal.getInstance().save(bs);\n OBDal.getInstance().flush();\n\n // Duplicate bank statement line with pending amount\n FIN_BankStatementLine clonedBSLine = (FIN_BankStatementLine) DalUtil.copy(bsl, true);\n\n BigDecimal credit = bsl.getCramount().subtract(trx.getDepositAmount());\n BigDecimal debit = bsl.getDramount().subtract(trx.getPaymentAmount());\n\n clonedBSLine.setCramount(credit);\n clonedBSLine.setDramount(debit);\n\n if (credit.compareTo(BigDecimal.ZERO) != 0 && debit.compareTo(BigDecimal.ZERO) != 0) {\n BigDecimal total = credit.subtract(debit);\n if (total.compareTo(BigDecimal.ZERO) == -1) {\n clonedBSLine.setCramount(BigDecimal.ZERO);\n clonedBSLine.setDramount(total.abs());\n } else {\n clonedBSLine.setCramount(total);\n clonedBSLine.setDramount(BigDecimal.ZERO);\n }\n } else {\n if (credit.compareTo(BigDecimal.ZERO) == -1) {\n clonedBSLine.setCramount(BigDecimal.ZERO);\n clonedBSLine.setDramount(credit.abs());\n }\n if (debit.compareTo(BigDecimal.ZERO) == -1) {\n clonedBSLine.setDramount(BigDecimal.ZERO);\n clonedBSLine.setCramount(debit.abs());\n }\n\n }\n\n // link bank statement line with the transaction\n bsl.setFinancialAccountTransaction(trx);\n bsl.setCramount(trx.getDepositAmount());\n bsl.setDramount(trx.getPaymentAmount());\n bsl.setMatchingtype(FIN_MatchedTransaction.MANUALMATCH);\n trx.setStatus(\"RPPC\");\n trx.setReconciliation(rec);\n if (trx.getFinPayment() != null) {\n trx.getFinPayment().setStatus(\"RPPC\");\n }\n\n bs.setProcessed(true);\n\n // Save\n OBDal.getInstance().save(bs);\n OBDal.getInstance().save(clonedBSLine);\n OBDal.getInstance().save(bsl);\n OBDal.getInstance().flush();\n }\n }\n response.setContentType(\"text/html; charset=UTF-8\");\n PrintWriter out = response.getWriter();\n out.println(\"data = \" + table.toString());\n out.close();\n } catch (JSONException e) {\n throw new OBException(\"splitBankStatementLine - JSON object error: \" + table.toString(), e);\n } finally {\n OBContext.restorePreviousMode();\n }\n }", "public ThreeDSecureRequest hash(String secret) {\n\n //check for any null values and set them to empty string for hashing\n String timeStamp = null == this.timeStamp ? \"\" : this.timeStamp;\n String merchantId = null == this.merchantId ? \"\" : this.merchantId;\n String orderId = null == this.orderId ? \"\" : this.orderId;\n String payerRef = null == this.payerRef ? \"\" : this.payerRef;\n String amount = \"\";\n String currency = \"\";\n\n if (null != this.amount) {\n amount = null == this.amount.getAmount() ? \"\" : this.amount.getAmount().toString();\n currency = null == this.amount.getCurrency() ? \"\" : this.amount.getCurrency().toString();\n }\n\n String cardNumber = \"\";\n\n if (null != this.card) {\n cardNumber = null == this.card.getNumber() ? \"\" : this.card.getNumber();\n }\n\n //create String to hash\n String toHash;\n if (ThreeDSecureType.VERIFY_STORED_CARD_ENROLLED.getType().equals(this.type)) {\n toHash = new StringBuilder().append(timeStamp)\n .append(\".\")\n .append(merchantId)\n .append(\".\")\n .append(orderId)\n .append(\".\")\n .append(amount)\n .append(\".\")\n .append(currency)\n .append(\".\")\n .append(payerRef)\n .toString();\n } else {\n toHash = new StringBuilder().append(timeStamp)\n .append(\".\")\n .append(merchantId)\n .append(\".\")\n .append(orderId)\n .append(\".\")\n .append(amount)\n .append(\".\")\n .append(currency)\n .append(\".\")\n .append(cardNumber)\n .toString();\n }\n this.hash = GenerationUtils.generateHash(toHash, secret);\n\n return this;\n }", "Payment setPaymentFromBetalningsservice(List<String> paymentrows) throws ParseException {\n Payment payment = new Payment();\n List<PaymentLine> paymentLines = new ArrayList<>();\n for (String line: paymentrows) {\n String firstLetter = String.valueOf(line.charAt(0));\n if(firstLetter.equals(POST_TYPE_O)){\n payment.setOpeningType(firstLetter);\n payment.setAccountNumber(line.substring(1,16));\n String kd = line.substring(16,30).trim().replaceAll(\",\",\".\");\n BigDecimal bd = new BigDecimal(kd);\n payment.setTotalAmount(bd);\n payment.setNumberOfPaymentRows(Integer.valueOf(line.substring(30,40).trim()));\n Date date = dateform.parse(line.substring(40,48));\n payment.setPaymentDate(date);\n payment.setCurrency(line.substring(48,51));\n }else if(firstLetter.equals(POST_TYPE_B)){\n PaymentLine paymentLine = new PaymentLine();\n String kd = line.substring(1,15).trim().replaceAll(\",\",\".\");\n BigDecimal bd = new BigDecimal(kd);\n paymentLine.setAmount(bd);\n paymentLine.setReference(line.substring(15,50).trim());\n paymentLines.add(paymentLine);\n }\n }\n payment.setPaymentLines(paymentLines);\n return payment;\n }", "boolean hasMerchantData();", "boolean hasMerchantData();", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == REQUEST_CODE_PAYMENT) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectUpdatePayment(paymentId, rideAccept.getTotalAmount());\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n if (!utils.getPaymentStatus()) {\n showPayment();\n }\n }\n }\n\n if (requestCode == 3) {\n if (resultCode == Activity.RESULT_OK) {\n PaymentConfirmation confirm = data\n .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);\n if (confirm != null) {\n try {\n Log.e(TAG, confirm.toJSONObject().toString(4));\n Log.e(TAG, confirm.getPayment().toJSONObject()\n .toString(4));\n\n String paymentId = confirm.toJSONObject()\n .getJSONObject(\"response\").getString(\"id\");\n\n String payment_client = confirm.getPayment()\n .toJSONObject().toString();\n\n Log.e(TAG, \"paymentId: \" + paymentId\n + \", payment_json: \" + payment_client);\n\n\n // Now verify the payment on the server side\n if (IOUtils.isNetworkAvailable(context)) {\n createJsonobjectWaitingCharge(paymentId);\n }\n utils.setPaymentStatus(true);\n\n } catch (JSONException e) {\n Log.e(TAG, \"an extremely unlikely failure occurred: \",\n e);\n }\n }\n } else if (resultCode == Activity.RESULT_CANCELED) {\n Log.e(TAG, \"The user canceled.\");\n showPayment();\n\n } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {\n Log.e(TAG,\n \"An invalid Payment or PayPalConfiguration was submitted.\");\n showPayment();\n }\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getMerchantData() {\n return instance.getMerchantData();\n }", "private byte[] handleAuthPt1(byte[] payload) {\n\t\tboolean userIdentified = false;\n\t\tbyte[] supposedUser = null;\n\n//\n\t\tSystem.out.println(\"payload received by SecretServer:\");\n\t\tComMethods.charByChar(payload,true);\n//\n\n\t\tuserNum = -1;\n\t\twhile (userNum < validUsers.length-1 && !userIdentified) {\n\t\t\tuserNum++;\n\t\t\tsupposedUser = validUsers[userNum].getBytes();\n\t\t\tuserIdentified = Arrays.equals(Arrays.copyOf(payload, supposedUser.length), supposedUser);\n\n//\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\\"\"+validUsers[userNum]+\"\\\" in bytes:\");\n\t\t\tComMethods.charByChar(validUsers[userNum].getBytes(),true);\n\t\t\tSystem.out.println(\"\\\"Arrays.copyOf(payload, supposedUser.length\\\" in bytes:\");\n\t\t\tComMethods.charByChar(Arrays.copyOf(payload, supposedUser.length),true);\n\t\t\tSystem.out.println();\n//\n\t\t}\n\n\t\tif (!userIdentified) {\n\t\t\tComMethods.report(\"SecretServer doesn't recognize name of valid user.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Process second half of message, and verify format\n\t\t\tbyte[] secondHalf = Arrays.copyOfRange(payload, supposedUser.length, payload.length);\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tsecondHalf = ComMethods.decryptRSA(secondHalf, my_n, my_d);\n\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tComMethods.report(\"SecretServer has decrypted the second half of the User's message using SecretServer's private RSA key.\", simMode);\n\n\t\t\tif (!Arrays.equals(Arrays.copyOf(secondHalf, supposedUser.length), supposedUser)) {\n\t\t\t\t// i.e. plaintext name doesn't match the encrypted bit\n\t\t\t\tComMethods.report(\"ERROR ~ invalid first message in protocol.\", simMode);\t\t\t\t\n\t\t\t\treturn \"error\".getBytes();\n\t\t\t} else {\n\t\t\t\t// confirmed: supposedUser is legit. user\n\t\t\t\tcurrentUser = new String(supposedUser); \n\t\t\t\tuserSet = true;\n\t\t\t\tbyte[] nonce_user = Arrays.copyOfRange(secondHalf, supposedUser.length, secondHalf.length);\n\n\t\t\t\t// Second Message: B->A: E_kA(nonce_A || Bob || nonce_B)\n\t\t\t\tmyNonce = ComMethods.genNonce();\n\t\t\t\tComMethods.report(\"SecretServer has randomly generated a 128-bit nonce_srvr = \"+myNonce+\".\", simMode);\n\t\t\t\n\t\t\t\tbyte[] response = ComMethods.concatByteArrs(nonce_user, \"SecretServer\".getBytes(), myNonce);\n\t\t\t\tbyte[] responsePayload = ComMethods.encryptRSA(response, usersPubKeys1[userNum], BigInteger.valueOf(usersPubKeys2[userNum]));\n\t\t\t\treturn responsePayload;\n\t\t\t}\n\t\t}\n\t}", "private static boolean VerifyInput(String encrypteddata) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n //extract the data and signed message\n String[] data = encrypteddata.split(\"#\");\n String clientdataComputedhash = \"\";\n try {\n clientdataComputedhash = CalHash(data[0].getBytes());\n } catch (UnsupportedEncodingException ex) {\n System.out.println(\"Unsupported Encoding Exception\");\n }\n //compute the hash from the signed message\n byte[] clientHash = data[1].getBytes();\n String clientdecryptHash = RSAdecrypt(clientHash);\n boolean status = false;\n //status if the signature does not matches\n status = clientdecryptHash.equals(clientdataComputedhash);\n return status;\n }", "@RequestMapping(value = \"confirmpurchase/v1/wallets/{walletId}/serviceproviders/{spId}/widgets/{widgetId}\", method = RequestMethod.GET)\n public TicketPurchaseResponse confirmPurchaseV1(@PathVariable(value = \"walletId\") String walletId,\n @PathVariable(value = \"spId\") String spId, @PathVariable(value = \"widgetId\") String widgetId) {\n LOG.info(\"########confirmPurchaseV1 started\");\n TicketPurchaseResponse ticketPurchaseResponse = null;\n String result = \"Success\";\n String productRef;\n GenerateProductIDResponse generateProductIDResponse;\n String status = \"success\";\n try {\n /* MIFAREHttpClient mifareClient = new MIFAREHttpClient(DIGITIZE_BASE_URI, GENERATE_PRODUCT_REFERENCE); */\n // MIFAREHttpClient mifareClient = new MIFAREHttpClient.Builder().serviceURL(DIGITIZE_BASE_URI)\n // .apiURL(GENERATE_PRODUCT_REFERENCE).build();\n GenerateProductIDRequest request = new GenerateProductIDRequest();\n RequestContextV1 requestContext = new RequestContextV1();\n requestContext.setServiceProviderId(spId);\n String idRequest = \"\" + System.currentTimeMillis();\n requestContext.setCorrelationId(idRequest);\n requestContext.setRequestId(idRequest);\n request.setRequestContext(requestContext);\n Products products = new Products();\n products.setProductTypeId(widgetId);\n productRef = UUID.randomUUID().toString();\n products.setSpProductReference(productRef);\n request.setProductOrders(new ArrayList<>(Arrays.asList(products)));\n \n /** calling seglan service InitPurchaseOrder API if serviceProviderId is NAME_CRTM */\n if (spId.equals(configBean.getCrtmServiceProviderId())) {\n InitPurchaseOrderRequest InitPurchaseOrderRequest = new InitPurchaseOrderRequest();\n InitPurchaseOrderRequest.setDeviceId(\"1234\");\n InitPurchaseOrderRequest.setGoogleAccountId(\"[email protected]\");\n InitPurchaseOrderRequest.setProduct(widgetId);\n InitPurchaseOrderResponse initPurchaseOrderResponse = crtmService.processInitPurchaseOrder(InitPurchaseOrderRequest);\n if (!initPurchaseOrderResponse.getResponseCode().equals(\"00\")) {\n status = \"failed\";\n result = \"failed\";\n }\n ticketPurchaseResponse = TicketPurchaseResponse.builder().status(status).ticketId(productRef)\n .digitalTicketId(initPurchaseOrderResponse.getM2gReference()).build();\n } else {\n Header[] headers = new Header[] {\n new BasicHeader(\"content-type\", ContentType.APPLICATION_JSON.getMimeType())};\n // generateProductIDResponse = mifareClient.invokePost(request, GenerateProductIDResponse.class, headers);\n generateProductIDResponse = utils.postRequestWithAbsoluteURL1(request, configBean, configBean.getDIGITIZE_BASE_URI() + configBean.getGENERATE_PRODUCT_REFERENCE(),\n GenerateProductIDResponse.class);\n ticketPurchaseResponse = TicketPurchaseResponse.builder()\n .status(generateProductIDResponse.getResponseContext().getResponseMessage()).ticketId(productRef)\n .digitalTicketId(generateProductIDResponse.getReferences().get(0).getM2gReference()).build();\n result = JsonUtil.toJSON(generateProductIDResponse);\n }\n LOG.info(\"########confirmPurchaseV1 result:\" + result);\n } catch (Exception e) {\n LOG.info(\"#Error occurred during confirm purchase:\" + e);\n result = \"failed\";\n LOG.info(\"########confirmPurchaseV1 result:\" + result);\n ticketPurchaseResponse = TicketPurchaseResponse.builder().status(result).build();\n }\n return ticketPurchaseResponse;\n }", "private JsonObjectBuilder merchantToJsonBuilder(Merchant merchant) {\n\n // Any way to avoid converting to a String?\n String jsonMerchant = jsonb.toJson(merchant);\n try (JsonReader jsonReader = Json.createReader(new StringReader(jsonMerchant))) {\n JsonObject merchantJson = jsonReader.readObject();\n JsonObjectBuilder merchantBuilder = Json.createObjectBuilder();\n merchantJson.forEach((k, v) -> {\n merchantBuilder.add(k, v);\n });\n return merchantBuilder;\n }\n }", "public TransactionResponse processAllTransaction() throws ParseException {\n TransactionResponse response = new TransactionResponse();\n\n //User0\n response.setTransaction(new Transaction(\"user0\",\"0001\", \"type0\",\"user0_Billing\",\"user0_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-00\")));\n\n //User1\n response.setTransaction(new Transaction(\"user1\", \"0101\",\"type0\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user1\", \"0102\", \"type1\",\"user1_Billing\", \"user1_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-00\")));\n\n //User2\n response.setTransaction(new Transaction(\"user2\", \"0201\", \"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-01-00\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0202\", \"type2\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n response.setTransaction(new Transaction(\"user2\", \"0203\",\"type1\",\"user2_Billing\", \"user2_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n //User3\n response.setTransaction(new Transaction(\"user3\", \"0301\",\"type0\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-02-02\")));\n\n response.setTransaction(new Transaction(\"user3\", \"0302\",\"type1\",\"user3_Billing\", \"user3_Sub\",\n new SimpleDateFormat(\"yyyy-mm-dd-hh\").parse(\"2020-01-03-01\")));\n\n return response;\n }", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static BlockRecord toXMLForExistingRecord(String input, int pnum) {\n \n int UnverifiedBlockPort;\n int BlockChainPort;\n UnverifiedBlockPort = 4710 + pnum;\n BlockChainPort = 4820 + pnum;\n try {\n String[] tokens = new String[20];\n String stringXML;\n String InputLineStr;\n String suuid;\n UUID idA;\n BlockRecord[] blockArray = new BlockRecord[20];\n\n JAXBContext jaxbContext = JAXBContext.newInstance(BlockRecord.class);\n Marshaller jaxbMarshaller = jaxbContext.createMarshaller();\n StringWriter sw = new StringWriter();\n jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n int n = 0;\n \n //building the block\n blockArray[n] = new BlockRecord();\n blockArray[n].setABlockNum(input.substring(input.indexOf(\"<ABlockNum>\") + 11, input.indexOf(\"</ABlockNum>\")));\n blockArray[n].setACreatingProcess(\"Process\" + Integer.toString(pnum));\n blockArray[n].setASHA256String(input.substring(input.indexOf(\"<ASHA256String>\") + 15, input.indexOf(\"</ASHA256String>\")));\n blockArray[n].setASignedSHA256(input.substring(input.indexOf(\"<ASignedSHA256>\") + 15, input.indexOf(\"</ASignedSHA256>\")));\n blockArray[n].setAVerificationProcessID(Integer.toString(pnum));\n blockArray[n].setTimestamp(input.substring(input.indexOf(\"<ATimestamp>\") + 12, input.indexOf(\"</ATimestamp>\")));\n blockArray[n].setFSSNum(input.substring(input.indexOf(\"<FSSNum>\") + 8, input.indexOf(\"</FSSNum>\")));\n blockArray[n].setFFname(input.substring(input.indexOf(\"<FFname>\") + 8, input.indexOf(\"</FFname>\")));\n blockArray[n].setFLname(input.substring(input.indexOf(\"<FLname>\") + 8, input.indexOf(\"</FLname>\")));\n blockArray[n].setFDOB(input.substring(input.indexOf(\"<FDOB>\") + 6, input.indexOf(\"</FDOB>\")));\n blockArray[n].setGDiag(input.substring(input.indexOf(\"<GDiag>\") + 7, input.indexOf(\"</GDiag>\")));\n blockArray[n].setGTreat(input.substring(input.indexOf(\"<GTreat>\") + 8, input.indexOf(\"</GTreat>\")));\n blockArray[n].setGRx(input.substring(input.indexOf(\"<GRx>\") + 5, input.indexOf(\"</GRx>\")));\n \n // Generate a new block ID\n idA = UUID.randomUUID();\n suuid = new String(UUID.randomUUID().toString());\n blockArray[n].setABlockID(suuid);\n stringXML = sw.toString();\n for (int i = 0; i < n; i++) {\n jaxbMarshaller.marshal(blockArray[i], sw);\n }\n String fullBlock = sw.toString();\n String XMLHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\";\n String cleanBlock = fullBlock.replace(XMLHeader, \"\");\n String XMLBlock = XMLHeader + \"\\n<BlockLedger>\" + cleanBlock + \"</BlockLedger>\";\n System.out.println(XMLBlock);\n return blockArray[n];\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n return null;\n }", "@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }", "private void deleteMerchantHash(String cardToken) {\n\n final String postParams = \"card_token=\" + cardToken;\n\n new AsyncTask<Void, Void, Void>() {\n\n @Override\n protected Void doInBackground(Void... params) {\n try {\n //TODO Replace below url with your server side file url.\n URL url = new URL(\"https://payu.herokuapp.com/delete_merchant_hash\");\n\n byte[] postParamsByte = postParams.getBytes(\"UTF-8\");\n\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"POST\");\n conn.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n conn.setRequestProperty(\"Content-Length\", String.valueOf(postParamsByte.length));\n conn.setDoOutput(true);\n conn.getOutputStream().write(postParamsByte);\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (ProtocolException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(Void aVoid) {\n super.onPostExecute(aVoid);\n this.cancel(true);\n }\n }.execute();\n }", "private boolean getAddresses(){\n try {\n URLtoJSON URLtoJSON = new URLtoJSON();\n JSONObject json = URLtoJSON.open(this.URL+\"merchant/\"+this.GUID+\"/list?password=\"+this.pswd()+\"&api_code=\"+this.ApiCode);\n \n if(!json.isNull(\"error\")) return false; //If there is no transactions return false;\n JSONArray nameArray = json.names();\n JSONArray TotalArray = json.toJSONArray(nameArray);\n JSONArray JAddresses = TotalArray.getJSONArray(0);\n \n for(int i = 0; i < JAddresses.length(); i++){\n String O=\"false\";\n String S=\"false\";\n String N=\"false\";\n String[] Label=JAddresses.getJSONObject(i).getString(\"label\").split(\"_\",-1);\n if(Label.length==3){\n O=Label[1];\n S=Label[0];\n N=Label[2];\n }\n String[] Matched=this.matchDB(JAddresses.getJSONObject(i).getString(\"address\"));\n String[] Details= new String[]{\n \"S: \"+S, //0 Transaction ID\n Matched[0], //1 Sender\n Float.toString(JAddresses.getJSONObject(i).getLong(\"total_received\")/100000000)+\" (BTC)\",//2 Amount in btc\n O, //3 Choosen option\n \"btc\", //4 Currency\n \"O: \"+Matched[2], //5 Date\n Matched[1] //6 Senders nem or false \n };\n if(!this.list.contains(Details)){\n this.list.add(Details);\n if(!\"false\".equals(O) && !O.equals(\"\")){\n this.setAmountsAndEntries(Integer.parseInt(O), JAddresses.getJSONObject(i).getLong(\"total_received\"), Details[6]); //add the amount and rise the entries\n }\n }\n }\n return true;\n } catch (JSONException | NumberFormatException e) {\n e.printStackTrace();\n }\n return false;\n }", "private boolean isEncapsulatingBet(BetSlipResponse betSlipResponse) {\n boolean result = betSlipResponse.getTransactions().size() > 0;\n\n for (TransactionResponse transactionResponse : betSlipResponse.getTransactions()) {\n result &= transactionResponse.getTransactionTypeId() == TransactionType.BET.getId();\n }\n\n return result;\n }", "public VerificationResponse parseVerificationResponse(HashMap<String, Object> list) throws ParseException {\n HashMap<UUID, UUIDResponse> responses = new HashMap<UUID, UUIDResponse>();\n\n for(Map.Entry<String, Object> entry : list.entrySet()) {\n UUID mcUUID = m_minecraftUUIDParser.parseUUID(entry.getKey());\n UUIDResponse response = m_uuidRepsonseParser.parse(entry.getValue());\n\n responses.put(mcUUID, response);\n }\n\n return new VerificationResponse().setResponseMap(responses);\n }", "public Builder setPaymentHashBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n paymentHash_ = value;\n onChanged();\n return this;\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000020) != 0);\n }", "public static BlockRecord toXML(String input, int pnum) {\n \t\n String toReturn = \"\";\n int UnverifiedBlockPort;\n int BlockChainPort;\n UnverifiedBlockPort = 4710 + pnum;\n BlockChainPort = 4820 + pnum;\n\n System.out.println(\"Process number: \" + pnum + \" Ports: \" + UnverifiedBlockPort + \" \" +\n BlockChainPort + \"\\n\");\n\n try {\n String[] tokens = new String[10];\n String stringXML;\n String InputLineStr;\n String suuid;\n UUID idA;\n BlockRecord[] blockArray = new BlockRecord[20];\n JAXBContext jaxbContext = JAXBContext.newInstance(BlockRecord.class);\n Marshaller jaxbMarshaller = jaxbContext.createMarshaller();\n StringWriter sw = new StringWriter();\n jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n\n int n = 0;\n blockArray[n] = new BlockRecord();\n blockArray[n].setASHA256String(\"SHA string goes here...\");\n blockArray[n].setASignedSHA256(\"Signed SHA string goes here...\");\n\n idA = UUID.randomUUID();\n suuid = new String(UUID.randomUUID().toString());\n blockArray[n].setABlockID(suuid);\n blockArray[n].setACreatingProcess(\"Process\" + Integer.toString(pnum));\n blockArray[n].setAVerificationProcessID(\"To be set later...\");\n tokens = input.split(\" +\"); \n \n //build the block\n blockArray[n].setTimestamp(tokens[iTIME]);\n blockArray[n].setFSSNum(tokens[iSSNUM]);\n blockArray[n].setFFname(tokens[iFNAME]);\n blockArray[n].setFLname(tokens[iLNAME]);\n blockArray[n].setFDOB(tokens[iDOB]);\n blockArray[n].setGDiag(tokens[iDIAG]);\n blockArray[n].setGTreat(tokens[iTREAT]);\n blockArray[n].setGRx(tokens[iRX]);\n \n stringXML = sw.toString();\n for (int i = 0; i < n; i++) {\n jaxbMarshaller.marshal(blockArray[i], sw);\n }\n String fullBlock = sw.toString();\n String XMLHeader = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\";\n String cleanBlock = fullBlock.replace(XMLHeader, \"\");\n String XMLBlock = XMLHeader + \"\\n<BlockLedger>\" + cleanBlock + \"</BlockLedger>\";\n System.out.println(XMLBlock);\n return blockArray[n];\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n return null;\n\n }", "public com.google.protobuf.ByteString\n getPaymentHashBytes() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n paymentHash_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public void getOneClickHash(String cardToken, String merchantKey, String userCredentials) {\n\n }", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "private byte[] handleView() {\n\t\tString secret = ComMethods.getValueFor(currentUser, secretsfn);\n\t\tif (secret.equals(\"\")) {\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\tbyte[] secretInBytes = DatatypeConverter.parseBase64Binary(secret);\n\n\t\t\tComMethods.report(\"SecretServer has retrieved \"+currentUser+\"'s secret and will now return it.\", simMode);\n\t\t\treturn preparePayload(secretInBytes);\n\t\t}\n\t}", "public static String create_detail_list_like(String str,String publicKey) throws Exception\n {\n\n String detail_list_like=\"\";\n //定义第一次分割符\n String reg = \"[|]\";\n //声明map将String数组中的内容按照key=value放到map中\n Map<Integer, String> data=new HashMap<Integer, String>();\n //将获取的批量付款到银行卡交易列别按照|进行分割,放到数组中\n String[] arys=str.split(reg);\n String arys1=\"\";\n int i=0;\n\n //将获取String数组放到map中\n for(String item:arys)\n {\n data.put(i,item);\n i++;\n }\n Iterator s=data.entrySet().iterator();\n String data2=\"\";\n while(s.hasNext()){//只遍历一次,速度快\n @SuppressWarnings(\"rawtypes\")\n Map.Entry e=(Map.Entry)s.next();\n String regs=\"\\\\^\";\n String split=(String) e.getValue();\n String [] splitarray=split.split(regs);\n int b=0;\n\n for(String item1:splitarray)\n {\n if(b==1||b==2||b==3){\n if(item1!=\"\"&&item1!=null){\n item1=YaColPayRSAUtil.encryptByPublicKey(item1,publicKey);\n data2=data2+\"^\"+item1;\n }else\n {\n break;\n }\n }else\n {\n if(b==0){\n data2=data2+\"|\"+item1;\n }else{\n data2=data2+\"^\"+item1;\n }\n }\n\n b++;\n }\n }\n detail_list_like=data2.substring(1);\n return detail_list_like;\n }", "byte[] clientVerifyHash(String HashType, byte[] mastersecret, byte[] handshakemessages) throws NoSuchAlgorithmException, IOException{\n MessageDigest hasher = MessageDigest.getInstance(HashType);\r\n \r\n int padsize = 1;\r\n \r\n switch(HashType){\r\n case \"MD5\": \r\n padsize = 48;\r\n break;\r\n case \"SHA-1\":\r\n padsize = 40;\r\n break;\r\n }\r\n \r\n byte[] pad1 = new byte[padsize];\r\n byte[] pad2 = new byte[padsize];\r\n \r\n for (int i = 0; i < padsize; i++){\r\n pad1[i] = (0x36);\r\n pad2[i] = (0x5C);\r\n }\r\n \r\n baos.write(handshakemessages);\r\n baos.write(mastersecret);\r\n baos.write(pad1);\r\n \r\n byte[] before_HSM = baos.toByteArray();\r\n byte[] hashedHSM = hasher.digest(before_HSM);\r\n \r\n baos.reset();\r\n \r\n baos.write(mastersecret);\r\n baos.write(pad2);\r\n baos.write(hashedHSM);\r\n \r\n byte[] before_complete = baos.toByteArray();\r\n byte[] whole_hash = hasher.digest(before_complete);\r\n \r\n baos.reset();\r\n \r\n System.out.println(\"This is the client certificate verification: \" + Base64.getEncoder().encodeToString(whole_hash));\r\n \r\n return whole_hash;\r\n }", "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n }\n }", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "@GetMapping(\"/test\")\n public String test() throws Throwable {\n// List<Object> mempoolInfo = bitcoinRestApi.getBlockHeaders(5,\"000000000000011814d4acab99e4ee03267caa4193523fc2a894e0bf8d9b627d\");\n// return JSONObject.toJSONString(mempoolInfo);\n\n //JSONObject mempoolInfo = bitcoinRestApi.getBlockNoDetails(\"000000000000011814d4acab99e4ee03267caa4193523fc2a894e0bf8d9b627d\");\n JSONObject blockchainInfo = bitcoinJsonRpcApi.getBlockchainInfo();\n return null;\n }", "@Test\n public void test03ConfRespPbeProtectedByGlobalSharedSecret() throws Exception {\n log.trace(\">test03ConfRespPbeProtected\");\n\n this.cmpConfiguration.setRAMode(cmpAlias, true);\n this.cmpConfiguration.setResponseProtection(cmpAlias, \"pbe\");\n this.cmpConfiguration.setCMPDefaultCA(cmpAlias, \"\");\n this.cmpConfiguration.setAuthenticationModule(cmpAlias, CmpConfiguration.AUTHMODULE_HMAC);\n this.cmpConfiguration.setAuthenticationParameters(cmpAlias, \"password\");\n this.globalConfigurationSession.saveConfiguration(ADMIN, this.cmpConfiguration);\n\n byte[] nonce = CmpMessageHelper.createSenderNonce();\n byte[] transid = CmpMessageHelper.createSenderNonce();\n\n // Send a confirm message to the CA\n String hash = \"foo123\";\n PKIMessage confirm = genCertConfirm(userDN, this.cacert, nonce, transid, hash, 0, null);\n confirm = protectPKIMessage(confirm, false, \"password\", 567);\n assertNotNull(confirm);\n ByteArrayOutputStream bao = new ByteArrayOutputStream();\n ASN1OutputStream dOut = ASN1OutputStream.create(bao, ASN1Encoding.DER);\n dOut.writeObject(confirm);\n byte[] ba = bao.toByteArray();\n // Send request and receive response\n byte[] resp = sendCmpHttp(ba, 200, cmpAlias);\n checkCmpResponseGeneral(resp, this.testx509ca.getSubjectDN(), userDN, this.cacert, nonce, transid, false, \"password\", null /*response is not signed*/);\n checkCmpPKIConfirmMessage(userDN, this.cacert, resp);\n\n log.trace(\"<test03ConfRespPbeProtected\");\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return ((bitField0_ & 0x00000001) != 0);\n }", "public JSONResponse pay(HashMap<String, String> parameters) {\n\t\tString pos = parameters.get(\"pos\"); \t\t\t\t\t\t// the point of sale code.\n\t\tString reservationid = parameters.get(\"reservationid\");\t\t// the ID of the reservation.\n\t\tString date = parameters.get(\"date\"); \t\t\t\t\t\t// the date of the payment.\n\t\tString emailaddress = parameters.get(\"emailaddress\"); \t\t// the email address of the payer.\n\t\tString cardholder = parameters.get(\"cardholder\");\t\t\t// the card holder name.\n\t\tString cardnumber = parameters.get(\"cardnumber\");\t\t\t// the card number.\n\t\tString cardmonth = parameters.get(\"cardmonth\");\t\t\t\t// the card expiry month.\n\t\tString cardyear = parameters.get(\"cardyear\");\t\t\t\t// the card expiry year.\n\t\tString cardcode = parameters.get(\"cardcode\");\t\t\t\t// the card CCV code.\n\t\tString amount = parameters.get(\"amount\");\t\t\t\t\t// the amount to be charged to the card.\n\t\tString remote_host = parameters.get(\"remote_host\");\t\t\t// the remote host URL.\n\n\t\tDouble value = Double.valueOf(amount);\n\t\tif (pos == null || pos.isEmpty() || Model.decrypt(pos).length() > 10) {throw new ServiceException(Error.pos_invalid, pos);}\n\t\tif (reservationid == null || reservationid.isEmpty() || reservationid.length() > 10) {throw new ServiceException(Error.reservation_id, reservationid);}\n\t\tif (emailaddress == null || emailaddress.isEmpty() || !Party.isEmailAddress(emailaddress)) {throw new ServiceException(Error.party_emailaddress, emailaddress);}\n\t\tif (cardholder == null || cardholder.isEmpty() || cardholder.length() > 100) {throw new ServiceException(Error.card_holder, cardholder);}\n\t\tif (cardnumber == null || cardnumber.isEmpty() || cardnumber.length() > 20) {throw new ServiceException(Error.card_number, cardnumber);}\n\t\tif (cardmonth == null || cardmonth.isEmpty() || cardmonth.length() != 2) {throw new ServiceException(Error.card_month, cardmonth);}\n\t\tif (cardyear == null || cardyear.isEmpty() || cardyear.length() != 4) {throw new ServiceException(Error.card_year, cardyear);}\n\t\tif (cardcode == null || cardcode.isEmpty() || cardcode.length() < 3) {throw new ServiceException(Error.card_code, cardcode);}\n\t\tif (value == null || value <= 0.0) {throw new ServiceException(Error.card_amount, amount);}\n\n\t\tSqlSession sqlSession = RazorServer.openSession();\n\t\tPayWidgetItem result = new PayWidgetItem();\n\t\ttry {\n\t\t\tJSONService.getParty(sqlSession, pos);\n\t\t\tReservation reservation = sqlSession.getMapper(ReservationMapper.class).read(reservationid);\n//\t\t\tParty customer = JSONService.getCustomer (sqlSession, emailaddress, familyname, firstname, reservation.getOrganizationid(), agent.getId());\n//\t\t\treservation.setCustomerid(customer.getId());\n//\t\t\tFinance finance = JSONService.getFinance(sqlSession, customer.getId(), cardholder, cardnumber, cardmonth, cardyear,\tcardcode);\n//\t\t\treservation.setFinanceid(finance.getId());\n//\t\t\treservation.setNotes(notes);\n//\t\t\tsqlSession.getMapper(ReservationMapper.class).update(reservation);\n\n\t\t\tElement element = PaygateHandler.getXML(reservation.getName(), cardholder, cardnumber, cardmonth + cardyear, value, reservation.getCurrency(), cardcode, emailaddress, remote_host);\n\n\t\t\tEvent<Journal> event = JSONService.cardReceipt(sqlSession, reservation, element, cardholder, value);\n\t\t\tresult.setId(reservation.getOrganizationid());\n\t\t\tresult.setName(event.getName());\n\t\t\tresult.setState(RazorWidget.State.SUCCESS.name());\n\t\t\tresult.setAmount(value);\n\t\t\tresult.setCurrency(reservation.getCurrency());\n\t\t\tresult.setMessage(JSONService.getNotes(element));\n\t\t\tsqlSession.commit();\n\t\t}\n\t\tcatch (Throwable x) {\n\t\t\tsqlSession.rollback();\n\t\t\tresult.setId(null);\n\t\t\tresult.setName(null);\n\t\t\tresult.setState(RazorWidget.State.FAILURE.name());\n\t\t\tresult.setAmount(value == null ? 0.0 : value);\n\t\t\tresult.setCurrency(Currency.Code.USD.name());\n\t\t\tresult.setMessage(x.getMessage());\n\t\t}\n\t\tfinally {sqlSession.close();}\n\t\treturn result;\n\t}", "private void returnDeposit(String paymentInfo) {\n }", "void computeSecrets() {\n final Bytes agreedSecret =\n signatureAlgorithm.calculateECDHKeyAgreement(ephKeyPair.getPrivateKey(), partyEphPubKey);\n\n final Bytes sharedSecret =\n keccak256(\n concatenate(agreedSecret, keccak256(concatenate(responderNonce, initiatorNonce))));\n\n final Bytes32 aesSecret = keccak256(concatenate(agreedSecret, sharedSecret));\n final Bytes32 macSecret = keccak256(concatenate(agreedSecret, aesSecret));\n final Bytes32 token = keccak256(sharedSecret);\n\n final HandshakeSecrets secrets =\n new HandshakeSecrets(aesSecret.toArray(), macSecret.toArray(), token.toArray());\n\n final Bytes initiatorMac = concatenate(macSecret.xor(responderNonce), initiatorMsgEnc);\n final Bytes responderMac = concatenate(macSecret.xor(initiatorNonce), responderMsgEnc);\n\n if (initiator) {\n secrets.updateEgress(initiatorMac.toArray());\n secrets.updateIngress(responderMac.toArray());\n } else {\n secrets.updateIngress(initiatorMac.toArray());\n secrets.updateEgress(responderMac.toArray());\n }\n\n this.secrets = secrets;\n }", "public byte[] splityTheArray(byte[] clientmessage, SecretKey encryptionkey, int nonce) throws Exception\n {\n byte[] message = clientmessage;\n byte[] lengthmessage = new byte[7];\n for(int i = 0; i < 7; i++)\n lengthmessage[i] = message[i];\n // Split needed parameters\n int count = Integer.parseInt(new String(lengthmessage));\n int maclength = count - 1000000 - nonce;\n int messagelength = count - 1000000 - maclength - nonce;\n int takennonce = count - 1000000 - maclength - messagelength;\n\n byte[] takenmessage = new byte[message.length - 7 - maclength];\n byte[] takenmacmessage = new byte[maclength];\n\n System.arraycopy(message, 7, takenmessage, 0, takenmessage.length);\n System.arraycopy(message, 7 + takenmessage.length, takenmacmessage, 0, takenmacmessage.length);\n\n // To check mac message is right\n Boolean isright = checkMessageisRight(takenmacmessage, takenmessage, encryptionkey);\n\n return takenmessage;\n }", "public java.lang.String getPaymentHash() {\n java.lang.Object ref = paymentHash_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n paymentHash_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Test\n public void getSecretsRequest() {\n assertThat(this.secretRepository.count()).isEqualTo(2);\n final Resource request = new ClassPathResource(\"test-requests/getSecrets.xml\");\n final Resource expectedResponse = new ClassPathResource(\"test-responses/getSecrets.xml\");\n try {\n this.mockWebServiceClient.sendRequest(withPayload(request)).andExpect(\n (request2, response) -> {\n OutputStream outStream = new ByteArrayOutputStream();\n response.writeTo(outStream);\n String outputString = outStream.toString();\n assertThat(outputString.contains(\"<ns2:Result>OK</ns2:Result>\")).isTrue();\n assertThat(outputString.contains(\"E_METER_AUTHENTICATION\")).isTrue();\n assertThat(outputString.contains(\"E_METER_ENCRYPTION_KEY_UNICAST\")).isTrue();\n\n });\n } catch (final Exception exc) {\n Assertions.fail(\"Error\", exc);\n }\n }", "@Override\r\n\t@Transactional(\"transactionManager\")\r\n\tpublic Map getAllTransactionsForConsumer(Consumer consumer,String status,int start,int size,String fromDateParm,String toDateParm,String onDateParm,int transactionId,double startAmount,double endAmount,String merchantOrderId,String organizationName,String sort,String order)\r\n\t{\r\n\r\n\t\tMap<String,Object> Response = new HashMap<String,Object>();\r\n\t\tMap<String,Object> parm = new HashMap<String,Object>();\r\n\t\tMerchant merchant =null;\r\n\t\tDate fromDate=null;\r\n\t\tDate toDate=null;\r\n\t\tDate onDate=null;\r\n\t\t\r\n\t\tif(transactionId!=-1)\r\n\t\t\tparm.put(\"transactionId\", transactionId);\t\r\n\t\telse if(!merchantOrderId.equals(\"\"))\r\n\t\t{\r\n\t\t\tparm.put(\"merchantOrderId\", merchantOrderId);\r\n\t\t\tstart=0;\r\n\t\t\tsize=1;\r\n\t\t}else\r\n\t\t{\r\n\t\t\tif(!status.equals(\"\")) // Check only valid success states\r\n\t\t\t\tparm.put(\"status\", status);\r\n\t\t\tif(!sort.equals(\"\"))\r\n\t\t\t\tparm.put(\"sort\", sort);\r\n\t\t\tif(!order.equals(\"\"))\r\n\t\t\t\tparm.put(\"order\", order);\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t\t\tif(!fromDateParm.equals(\"\"))\r\n\t\t\t\t\tfromDate = df.parse(fromDateParm);\r\n\r\n\t\t\t\tif(!toDateParm.equals(\"\"))\r\n\t\t\t\t\ttoDate = df.parse(toDateParm);\r\n\r\n\t\t\t\tif(!onDateParm.equals(\"\"))\r\n\t\t\t\t\tonDate = df.parse(onDateParm);\r\n\r\n\t\t\t}catch(IllegalArgumentException ex)\r\n\t\t\t{\r\n\t\t\t\tthrow new CustomValidationException(ErrorConstants.INVALID_DATE, ErrorConstants.STR_INVALID_DATE); \r\n\t\t\t}catch(ParseException ex)\r\n\t\t\t{\r\n\t\t\t\tthrow new CustomValidationException(ErrorConstants.INVALID_DATE, ErrorConstants.STR_INVALID_DATE); \r\n\t\t\t}\r\n\r\n\t\t\tif(onDate!=null)\r\n\t\t\t{\r\n\t\t\t\tparm.put(\"onDate\", onDate);\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tif(fromDate!=null)\r\n\t\t\t\t\tparm.put(\"fromDate\", fromDate);\r\n\t\t\t\tif(toDate!=null)\r\n\t\t\t\t\tparm.put(\"toDate\", toDate);\r\n\t\t\t}\r\n\r\n\t\t\tif(startAmount != -1)\r\n\t\t\t\tparm.put(\"startAmount\", startAmount);\r\n\t\t\tif(endAmount != -1)\r\n\t\t\t\tparm.put(\"endAmount\", endAmount);\r\n\t\t\tif(!organizationName.equals(\"\"))\r\n\t\t\t{\r\n\t\t\t\tmerchant = userDao.getMerchantByOrganizationName(organizationName);\r\n\t\t\t\tif(merchant==null)\r\n\t\t\t\t{\r\n\t\t\t\t\tMap<String,Object> temp = new HashMap<String,Object>();\r\n\t\t\t\t\ttemp.put(\"Message\", \"No results found ! \");\r\n\t\t\t\t\ttemp.put(\"Transactions\", null);\r\n\t\t\t\t\treturn temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tResultSetSize resultSetSize = new ResultSetSize();\r\n\t\tMap<String,Object> array[]=null;\r\n\t\tArrayList<Transactions> transactions=this.orderDao.getTransactions(merchant,consumer, parm,start,size,resultSetSize);\r\n\r\n\t\tif(transactions.size()==0)\r\n\t\t{\r\n\t\t\tMap<String,Object> temp = new HashMap<String,Object>();\r\n\t\t\ttemp.put(\"Message\", \"No results found ! \");\r\n\t\t\ttemp.put(\"Transactions\", null);\r\n\t\t\treturn temp;\r\n\t\t}\r\n\t\tarray = new Map[transactions.size()];\r\n\t\tint i;\r\n\t\tfor(i=0;i<transactions.size();i++)\r\n\t\t{\r\n\t\t\tMap<String,Object> temp = new HashMap<String,Object>();\r\n\t\t\tTransactions trans= transactions.get(i);\r\n\t\t\ttemp.put(\"transaction_id\", trans.getTransaction_id());\r\n\t\t\ttemp.put(\"merchant_order_id\", trans.getMerchant_order_id());\r\n\t\t\ttemp.put(\"status\", trans.getStatus());\r\n\t\t\ttemp.put(\"amount\", trans.getTransaction_amount());\r\n\t\t\ttemp.put(\"date\",trans.getMerchant_activity_time().toString());\r\n\t\t\tarray[i]=temp;\r\n\t\t}\r\n\r\n\t\tif(resultSetSize.getRowCount()!=0){\r\n\t\t\tResponse.put(\"resultSetSize\", resultSetSize);\r\n\t\t}\r\n\t\t\r\n\t\tResponse.put(\"Transactions\", array);\r\n\t\t\r\n\t\treturn Response;\r\n\t}", "@Override\r\n\tpublic JSONObject init(Merchant merchant, PayeeVo v) {\n\t\tJSONObject valid = this.valid(merchant,v.getTotal_amount());\r\n\t\tif (valid.getBooleanValue(\"state\")){\r\n\t\t\tPayee payee = this.getPayee();\r\n\t\t\tif (payee != null){\r\n\t\t\t\tv.setCost(String.valueOf(merchant.getFee()));\r\n\t\t\t\tv.setmId(String.valueOf(merchant.getId()));\r\n\t\t\t\tJSONObject result = this.execute(payee, v);\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\treturn Result.error.toJson(\"代付服务关闭\");\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "public void navigateToBaseActivity() {\n\n //merchantKey = \"gtKFFx\"; //Testing\n merchantKey = \"ImrH8w\"; //Live\n //merchantKey = ((EditText) findViewById(R.id.editTextMerchantKey)).getText().toString();\n // String amount = ((EditText) findViewById(R.id.editTextAmount)).getText().toString();\n // String email = ((EditText) findViewById(R.id.editTextEmail)).getText().toString();\n\n // String value = environmentSpinner.getSelectedItem().toString();\n int environment;\n // String TEST_ENVIRONMENT = getResources().getString(R.string.test);\n // if (value.equals(TEST_ENVIRONMENT))\n //environment = PayuConstants.MOBILE_STAGING_ENV;\n // else\n environment = PayuConstants.PRODUCTION_ENV;\n\n userCredentials = merchantKey + \":\" + \"[email protected]\";// + new AppPreferences(PlaceOrderActivity.this).getEmail();\n\n //TODO Below are mandatory params for hash genetation\n mPaymentParams = new PaymentParams();\n /**\n * For Test Environment, merchantKey = \"gtKFFx\"\n * For Production Environment, merchantKey should be your live key or for testing in live you can use \"0MQaQP\"\n */\n mPaymentParams.setKey(merchantKey);\n mPaymentParams.setAmount(String.valueOf(discountedAmount));\n mPaymentParams.setProductInfo(\"FarmFresh24\");\n mPaymentParams.setFirstName(new AppPreferences(PlaceOrderActivity.this).getFname());\n mPaymentParams.setEmail(new AppPreferences(PlaceOrderActivity.this).getEmail());\n\n /*\n * Transaction Id should be kept unique for each transaction.\n * */\n mPaymentParams.setTxnId(\"\" + System.currentTimeMillis());\n\n /**\n * Surl --> Success url is where the transaction response is posted by PayU on successful transaction\n * Furl --> Failre url is where the transaction response is posted by PayU on failed transaction\n */\n mPaymentParams.setSurl(\"https://payu.herokuapp.com/success\");\n mPaymentParams.setFurl(\"https://payu.herokuapp.com/failure\");\n\n /*\n * udf1 to udf5 are options params where you can pass additional information related to transaction.\n * If you don't want to use it, then send them as empty string like, udf1=\"\"\n * */\n mPaymentParams.setUdf1(\"udf1\");\n mPaymentParams.setUdf2(\"udf2\");\n mPaymentParams.setUdf3(\"udf3\");\n mPaymentParams.setUdf4(\"udf4\");\n mPaymentParams.setUdf5(\"udf5\");\n\n /**\n * These are used for store card feature. If you are not using it then user_credentials = \"default\"\n * user_credentials takes of the form like user_credentials = \"merchant_key : user_id\"\n * here merchant_key = your merchant key,\n * user_id = unique id related to user like, email, phone number, etc.\n * */\n mPaymentParams.setUserCredentials(userCredentials);\n\n //TODO Pass this param only if using offer key\n //mPaymentParams.setOfferKey(\"cardnumber@8370\");\n\n //TODO Sets the payment environment in PayuConfig object\n payuConfig = new PayuConfig();\n payuConfig.setEnvironment(environment);\n\n //TODO It is recommended to generate hash from server only. Keep your key and salt in server side hash generation code.\n //generateHashFromServer(mPaymentParams);\n\n /**\n * Below approach for generating hash is not recommended. However, this approach can be used to test in PRODUCTION_ENV\n * if your server side hash generation code is not completely setup. While going live this approach for hash generation\n * should not be used.\n * */\n String salt = \"BBq8CTgS\"; //Live\n // String salt = \"eCwWELxi\"; //Test\n generateHashFromSDK(mPaymentParams, salt);\n\n }", "private void validaciónDeRespuesta()\n\t{\n\t\ttry {\n\n\t\t\tString valorCifrado = in.readLine();\n\t\t\tString hmacCifrado = in.readLine();\n\t\t\tbyte[] valorDecifrado = decriptadoSimetrico(parseBase64Binary(valorCifrado), llaveSecreta, algSimetrica);\n\t\t\tString elString = printBase64Binary(valorDecifrado);\n\t\t\tbyte[] elByte = parseBase64Binary(elString);\n\n\t\t\tSystem.out.println( \"Valor decifrado: \"+elString + \"$\");\n\n\t\t\tbyte[] hmacDescifrado = decriptarAsimetrico(parseBase64Binary(hmacCifrado), llavePublica, algAsimetrica);\n\n\t\t\tString hmacRecibido =printBase64Binary(hmacDescifrado);\n\t\t\tbyte[] hmac = hash(elByte, llaveSecreta, HMACSHA512);\n\t\t\tString hmacGenerado = printBase64Binary(hmac);\n\n\n\n\n\t\t\tboolean x= hmacRecibido.equals(hmacGenerado);\n\t\t\tif(x!=true)\n\t\t\t{\n\t\t\t\tout.println(ERROR);\n\t\t\t\tSystem.out.println(\"Error, no es el mismo HMAC\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Se confirmo que el mensaje recibido proviene del servidor mediante el HMAC\");\n\t\t\t\tout.println(OK);\n\t\t\t}\n\n\n\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error con el hash\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String generateURL(HashMap<String, String> params) throws java.security.NoSuchAlgorithmException{\n\t\tDBA = params.get(\"merchantName\");\n\t\tRETURN_URL = params.get(\"returnURL\");\n\t\tTRANSACTION_TYPE = params.get(\"transactionType\");\n\t\tDISCOVER_IMAGE = params.get(\"acceptDiscover\").toUpperCase().startsWith(\"Y\") ? \"discvr.gif\" : \"spacer.gif\";\n\t\tAMEX_IMAGE = params.get(\"acceptAmex\").toUpperCase().startsWith(\"Y\") ? \"amex.gif\" : \"spacer.gif\";\n\t\tAMOUNT = params.get(\"amount\");\n\t\tPROTECT_AMOUNT = params.get(\"protectAmount\");\n\t\tREBILLING = params.get(\"rebilling\").toUpperCase().startsWith(\"Y\") ? \"1\" : \"0\";\n\t\tREB_PROTECT = params.get(\"rebProtect\");\n\t\tREB_AMOUNT = params.get(\"rebAmount\");\n\t\tREB_CYCLES = params.get(\"rebCycles\");\n\t\tREB_FIRST_DATE = params.get(\"rebStartDate\");\n\t\tREB_EXPR = params.get(\"rebFrequency\");\n\t\tCUSTOM_ID1 = params.get(\"customID1\");\n\t\tPROTECT_CUSTOM_ID1 = params.get(\"protectCustomID1\");\n\t\tCUSTOM_ID2 = params.get(\"customID2\");\n\t\tPROTECT_CUSTOM_ID2 = params.get(\"protectCustomID2\");\n\t\tSHPF_FORM_ID = params.get(\"paymentTemplate\");\n\t\tRECEIPT_FORM_ID = params.get(\"receiptTemplate\");\n\t\tREMOTE_URL = params.get(\"receiptTempRemoteURL\");\n\t\tCARD_TYPES = setCardTypes();\n\t\tRECEIPT_TPS_DEF = \"SHPF_ACCOUNT_ID SHPF_FORM_ID RETURN_URL DBA AMEX_IMAGE DISCOVER_IMAGE SHPF_TPS_DEF\";\n\t\tRECEIPT_TPS_STRING = setReceiptTpsString();\n\t\tRECEIPT_TAMPER_PROOF_SEAL = calcURLTps(RECEIPT_TPS_STRING);\n\t\tRECEIPT_URL = setReceiptURL();\n\t\tBP10EMU_TPS_DEF = addDefProtectedStatus(\"MERCHANT APPROVED_URL DECLINED_URL MISSING_URL MODE TRANSACTION_TYPE TPS_DEF\");\n\t\tBP10EMU_TPS_STRING = setBp10emuTpsString();\n\t\tBP10EMU_TAMPER_PROOF_SEAL = calcURLTps(BP10EMU_TPS_STRING);\n\t\tSHPF_TPS_DEF = addDefProtectedStatus(\"SHPF_FORM_ID SHPF_ACCOUNT_ID DBA TAMPER_PROOF_SEAL AMEX_IMAGE DISCOVER_IMAGE TPS_DEF SHPF_TPS_DEF\");\n\t\tSHPF_TPS_STRING = setShpfTpsString();\n\t\tSHPF_TAMPER_PROOF_SEAL = calcURLTps(SHPF_TPS_STRING);\n\t\treturn calcURLResponse();\n\t}", "public static void get_amazon_bid_values_from_aaxCalls(String slotID, boolean clearList) throws Exception {\n\tFile fXmlFile = new File(CharlesFunctions.outfile.getName());\n\tif (clearList) {\n\t\tlistOf_b_Params.clear();\n\t\taaxcallsSize = 0;\n\t}\n\n\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n\tdbFactory.setValidating(false);\n\tdbFactory.setNamespaceAware(true);\n\tdbFactory.setFeature(\"http://xml.org/sax/features/namespaces\", false);\n\tdbFactory.setFeature(\"http://xml.org/sax/features/validation\", false);\n\tdbFactory.setFeature(\"http://apache.org/xml/features/nonvalidating/load-dtd-grammar\", false);\n\tdbFactory.setFeature(\"http://apache.org/xml/features/nonvalidating/load-external-dtd\", false);\n\n\tDocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n\n\tDocument doc = dBuilder.parse(fXmlFile);\n\t// Getting the transaction element by passing xpath expression\n\tNodeList nodeList = doc.getElementsByTagName(\"transaction\");\n\n\t// Read JSONs and get b value\n\t// List<String> jsonBValuesList = new ArrayList<String>();\n\n\t// String slotId = readExcelValues.data[21][Cap];\n\n\t// String slotId = \"c4dd8ec4-e40c-4a63-ae81-8f756793ac5e\";\n\n\tboolean flag = false;\n\tList<String> istofRequestBodies = new ArrayList<String>();\n\tList<String> istofResponseBodies = new ArrayList<String>();\n\t// List<String> listOf_b_Params = new ArrayList<String>();\n\n\tfor (int i = 0; i < nodeList.getLength(); i++) {\n\t\tif (nodeList.item(i) instanceof Node) {\n\t\t\tNode node = nodeList.item(i);\n\t\t\tif (node.hasChildNodes()) {\n\t\t\t\tNodeList nl = node.getChildNodes();\n\t\t\t\tfor (int j = 0; j < nl.getLength(); j++) {\n\t\t\t\t\tNode innernode = nl.item(j);\n\t\t\t\t\tif (innernode != null) {\n\t\t\t\t\t\tif (innernode.getNodeName().equals(\"request\")) {\n\t\t\t\t\t\t\tif (innernode.hasChildNodes()) {\n\t\t\t\t\t\t\t\tNodeList n2 = innernode.getChildNodes();\n\t\t\t\t\t\t\t\tfor (int k = 0; k < n2.getLength(); k++) {\n\t\t\t\t\t\t\t\t\tNode innernode2 = n2.item(k);\n\t\t\t\t\t\t\t\t\tif (innernode2 != null) {\n\t\t\t\t\t\t\t\t\t\tif (innernode2.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\t\t\t\tElement eElement = (Element) innernode2;\n\t\t\t\t\t\t\t\t\t\t\tif (eElement.getNodeName().equals(\"body\")) {\n\t\t\t\t\t\t\t\t\t\t\t\tString content = eElement.getTextContent();\n\t\t\t\t\t\t\t\t\t\t\t\tif (content.contains(slotID)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\taaxcallsSize++;\n\t\t\t\t\t\t\t\t\t\t\t\t\tistofRequestBodies.add(content);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"request body \"+content);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (flag) {\n\t\t\t\t\t\t\tif (innernode.getNodeName().equals(\"response\")) {\n\t\t\t\t\t\t\t\t// System.out.println(innernode.getNodeName());\n\t\t\t\t\t\t\t\tif (innernode.hasChildNodes()) {\n\t\t\t\t\t\t\t\t\tNodeList n2 = innernode.getChildNodes();\n\t\t\t\t\t\t\t\t\tfor (int k = 0; k < n2.getLength(); k++) {\n\t\t\t\t\t\t\t\t\t\tNode innernode2 = n2.item(k);\n\t\t\t\t\t\t\t\t\t\tif (innernode2 != null) {\n\t\t\t\t\t\t\t\t\t\t\tif (innernode2.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\t\t\t\t\tElement eElement = (Element) innernode2;\n\t\t\t\t\t\t\t\t\t\t\t\tif (eElement.getNodeName().equals(\"body\")) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tString content = eElement.getTextContent();\n\t\t\t\t\t\t\t\t\t\t\t\t\tistofResponseBodies.add(content);\n\t\t\t\t\t\t\t\t\t\t\t\t\tString tempBparam = get_b_value_inJsonResponseBody(content);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!\"\".contentEquals(tempBparam)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlistOf_b_Params.add(tempBparam);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"response body \"+content);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tflag = false;\n\t}\n\tSystem.out.println(listOf_b_Params);\n\tlogStep(listOf_b_Params.toString());\n\n\taaxcallsResponseSize = listOf_b_Params.size();\n\taaxbidErrorCount = 0;\n\tfor (String b : listOf_b_Params) {\n\t\tSystem.out.println(\" b values from JSON-----------> \" + b);\n\t\tif (b.contentEquals(\"error\")) {\n\t\t\taaxbidErrorCount++;\n\t\t}\n\t}\n\tSystem.out.println(\"aaxcalls Size is: \" + aaxcallsSize);\n\tSystem.out.println(\"aaxcallsResponse Size is: \" + aaxcallsResponseSize);\n\tSystem.out.println(\"aaxbidErrorCount size is: \" + aaxbidErrorCount);\n\n}", "@Test\n\tpublic void validateSignatureBlock()\n\t{\n\t\tDBSet databaseSet = DBSet.createEmptyDatabaseSet();\n\t\t\t\t\n\t\t//PROCESS GENESISBLOCK\n\t\tGenesisBlock genesisBlock = new GenesisBlock();\n\t\tgenesisBlock.process(databaseSet);\n\t\t\t\t\n\t\t//CREATE KNOWN ACCOUNT\n\t\tbyte[] seed = Crypto.getInstance().digest(\"test\".getBytes());\n\t\tbyte[] privateKey = Crypto.getInstance().createKeyPair(seed).getA();\n\t\tPrivateKeyAccount generator = new PrivateKeyAccount(privateKey);\n\t\t\t\t\t\t\n\t\t//PROCESS GENESIS TRANSACTION TO MAKE SURE GENERATOR HAS FUNDS\n\t\tTransaction transaction = new GenesisTransaction(generator, BigDecimal.valueOf(1000).setScale(8), NTP.getTime());\n\t\ttransaction.process(databaseSet);\n\t\t\t\t\n\t\t//GENERATE NEXT BLOCK\n\t\tBlockGenerator blockGenerator = new BlockGenerator();\n\t\tBlock newBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\tbyte[] transactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE VALID\n\t\tassertEquals(true, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\ttransactionsSignature = new byte[64];\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//INVALID GENERATOR SIGNATURE\n\t\tnewBlock = BlockFactory.getInstance().create(newBlock.getVersion(), newBlock.getReference(), newBlock.getTimestamp(), newBlock.getGeneratingBalance(), generator, new byte[32]);\n\t\ttransactionsSignature = Crypto.getInstance().sign(generator, newBlock.getGeneratorSignature());\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t///CHECK IF SIGNATURE INVALID\n\t\tassertEquals(false, newBlock.isSignatureValid());\n\t\t\n\t\t//VALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tAccount recipient = new Account(\"XUi2oga2pnGNcZ9es6pBqxydtRZKWdkL2g\");\n\t\tlong timestamp = newBlock.getTimestamp();\n\t\tbyte[] signature = PaymentTransaction.generateSignature(databaseSet, generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp);\n\t\tTransaction payment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(100).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK VALID TRANSACTION SIGNATURE\n\t\tassertEquals(true, newBlock.isSignatureValid());\t\n\t\t\n\t\t//INVALID TRANSACTION SIGNATURE\n\t\tnewBlock = blockGenerator.generateNextBlock(databaseSet, generator, genesisBlock);\t\n\t\t\n\t\t//ADD TRANSACTION\n\t\tpayment = new PaymentTransaction(generator, recipient, BigDecimal.valueOf(200).setScale(8), BigDecimal.valueOf(1).setScale(8), timestamp, generator.getLastReference(databaseSet), signature);\n\t\tnewBlock.addTransaction(payment);\n\t\t\t\t\n\t\t//ADD TRANSACTION SIGNATURE\n\t\ttransactionsSignature = blockGenerator.calculateTransactionsSignature(newBlock, generator);\n\t\tnewBlock.setTransactionsSignature(transactionsSignature);\n\t\t\n\t\t//CHECK INVALID TRANSACTION SIGNATURE\n\t\tassertEquals(false, newBlock.isSignatureValid());\t\n\t}", "public static SendResult checkTotal(LinkedHashMap param) {\n\t\tSendResult st=new SendResult<>(\"0\", \"\", \"\");\r\n\t\tString locktype=\"\";\r\n\t\tif(param.containsKey(\"locktype\")) {\r\n\t\t\tlocktype=param.get(\"locktype\")==null?\"\":param.get(\"locktype\").toString();\r\n\t\t\tif(locktype==null || locktype.trim().length()<1 || \"null\".equals(locktype)) {\r\n\t\t\t\tst.setResultCode(\"10001\");\r\n\t\t\t\tst.setResultMsg(\"门锁类型不能为空\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t\tif(!locktype.matches(\"[1-4]{1}\")) {\r\n\t\t\t\tst.setResultCode(\"10002\");\r\n\t\t\t\tst.setResultMsg(\"门锁类型必须为1-4的数字\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tst.setResultCode(\"10001\");\r\n\t\t\tst.setResultMsg(\"门锁类型为必传参数\");\r\n\t\t\treturn st;\r\n\t\t}\r\n\t\tif(locktype.equals(\"1\")) {\r\n\t\t\tSet<Map.Entry<String, String>> paramsSet = param.entrySet();\r\n\t\t\tfor (Map.Entry<String, String> paramEntry : paramsSet) {\r\n\t\t\t\tString key=paramEntry.getKey();\r\n\t\t\t\tObject val=paramEntry.getValue();\r\n\t\t\t\tif(\"gatewaycode\".equals(key)) {\r\n\t\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10001\");\r\n\t\t\t\t\t\tst.setResultMsg(\"网关通讯ID不允许为空\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10002\");\r\n\t\t\t\t\t\tst.setResultMsg(\"网关通讯ID必须是长度为10的16进制字符串\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(\"gatewaycode2\".equals(key)) {\r\n\t\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10003\");\r\n\t\t\t\t\t\tst.setResultMsg(\"网关唯一ID不允许为空\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10004\");\r\n\t\t\t\t\t\tst.setResultMsg(\"网关唯一ID必须是长度为10的16进制字符串\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(\"roomcode\".equals(key)) {\r\n\t\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10005\");\r\n\t\t\t\t\t\tst.setResultMsg(\"房间编号不允许为空\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}else if(val.toString().length()!=4||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10006\");\r\n\t\t\t\t\t\tst.setResultMsg(\"房间编号必须是长度为4的16进制字符串\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n//\t\t\t\tif() {\r\n//\t\t\t\t\t\r\n//\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}else {\r\n\t\t\tSet<Map.Entry<String, String>> paramsSet = param.entrySet();\r\n\t\t\tfor (Map.Entry<String, String> paramEntry : paramsSet) {\r\n\t\t\t\tString key=paramEntry.getKey();\r\n\t\t\t\tObject val=paramEntry.getValue();\r\n\t\t\t\tif(\"roomcode2\".equals(key)) {\r\n\t\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10019\");\r\n\t\t\t\t\t\tst.setResultMsg(\"门锁唯一ID不允许为空\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10020\");\r\n\t\t\t\t\t\tst.setResultMsg(\"门锁唯一ID必须是长度为10的16进制字符串\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(\"roomimei\".equals(key)) {\r\n\t\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\t\tst.setResultCode(\"-10042\");\r\n\t\t\t\t\t\tst.setResultMsg(\"IMEI不允许为空\");\r\n\t\t\t\t\t\treturn st;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tString timeout=param.get(\"timeout\")==null?\"\":param.get(\"timeout\").toString();\r\n\t\tif(timeout==null ||!timeout.matches(\"[0-9]*\")) {\r\n\t\t\tst.setResultCode(\"-10042\");\r\n\t\t\tst.setResultMsg(\"超时时间格式错误\");\r\n\t\t\treturn st;\r\n\t\t}\r\n\t\tString callbackurl=param.get(\"callbackurl\")==null?\"\":param.get(\"callbackurl\").toString();\r\n\t\tif(callbackurl==null || callbackurl.trim().length()<0) {\r\n\t\t\tst.setResultCode(\"-10042\");\r\n\t\t\tst.setResultMsg(\"回调地址不能为空\");\r\n\t\t\treturn st;\r\n\t\t}\r\n\t\tif(param.containsKey(\"pass\")) {\r\n\t\t\tString pass=(String)param.get(\"pass\");\r\n\t\t\tif(pass==null||pass.equals(\"\")||pass.equals(\"null\")) {\r\n\t\t\t\tst.setResultCode(\"-10008\");\r\n\t\t\t\tst.setResultMsg(\"密码不能为空\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(pass.length()!=6||!pass.matches(\"[0-9]+\")) {\r\n\t\t\t\tst.setResultCode(\"-10009\");\r\n\t\t\t\tst.setResultMsg(\"密码必须为6位数字\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(param.containsKey(\"count\")) {\r\n\t\t\tString count=(String)param.get(\"count\");\r\n\t\t\tif(count==null||count.equals(\"\")||count.equals(\"null\")) {\r\n\t\t\t\tst.setResultCode(\"-10010\");\r\n\t\t\t\tst.setResultMsg(\"可开门次数不能为空\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(!count.matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\tst.setResultCode(\"-10011\");\r\n\t\t\t\tst.setResultMsg(\"可开门次数必须为0-254数字,0表示不限次数\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(param.containsKey(\"edate\")) {\r\n\t\t\tString edate=(String)param.get(\"edate\");\r\n\t\t\tif(edate==null||edate.equals(\"\")||edate.equals(\"null\")) {\r\n\t\t\t\tst.setResultCode(\"-10012\");\r\n\t\t\t\tst.setResultMsg(\"授权结束时间不能为空\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(!edate.equals(\"-1\")&&(edate.length()!=10||!edate.matches(\"\\\\d+\"))) {\r\n\t\t\t\tst.setResultCode(\"-10013\");\r\n\t\t\t\tst.setResultMsg(\"授权结束时间格式为yyMMddHHmm\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(param.containsKey(\"cardtype\")) {\r\n\t\t\tString cardtype=(String) param.get(\"cardtype\");\r\n\t\t}\r\n\t\tif(param.containsKey(\"cardcode\")) {\r\n\t\t\tString cardcode=(String) param.get(\"cardcode\");\r\n\t\t}\r\n\t\tif(param.containsKey(\"personcode\")) {\r\n\t\t\tString personcode=(String) param.get(\"personcode\");\r\n\t\t}\r\n\t\tif(param.containsKey(\"openstime\")) {\r\n\t\t\tString openstime=(String) param.get(\"openstime\");\r\n\t\t\tif(openstime==null||openstime.equals(\"\")||openstime.equals(\"null\")) {\r\n\t\t\t\tst.setResultCode(\"-10022\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段开始时间不能为空\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(openstime.length()!=5) {\r\n\t\t\t\tst.setResultCode(\"-10023\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(!openstime.contains(\":\")) {\r\n\t\t\t\tst.setResultCode(\"-10023\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t\tString newp = openstime.replace(\":\", \"\");\r\n\t\t\tif(newp.length()!=4||!newp.matches(\"\\\\d+\")) {\r\n\t\t\t\tst.setResultCode(\"-10023\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(param.containsKey(\"openetime\")) {\r\n\t\t\tString openetime=(String) param.get(\"openetime\");\r\n\t\t\tif(openetime==null||openetime.equals(\"\")||openetime.equals(\"null\")) {\r\n\t\t\t\tst.setResultCode(\"-10022\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段结束时间不能为空\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(openetime.length()!=5) {\r\n\t\t\t\tst.setResultCode(\"-10023\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(!openetime.contains(\":\")) {\r\n\t\t\t\tst.setResultCode(\"-10023\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t\tString newp = openetime.replace(\":\", \"\");\r\n\t\t\tif(newp.length()!=4||!newp.matches(\"\\\\d+\")) {\r\n\t\t\t\tst.setResultCode(\"-10023\");\r\n\t\t\t\tst.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(param.containsKey(\"opencount\")) {\r\n\t\t\tString opencount=(String) param.get(\"opencount\");\r\n\t\t\tif(null==opencount||opencount.equals(\"\")||opencount.equals(\"null\")) {\r\n\t\t\t\tst.setResultCode(\"-10010\");\r\n\t\t\t\tst.setResultMsg(\"可开门次数不能为空\");\r\n\t\t\t\treturn st;\r\n\t\t\t}else if(!opencount.matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\tst.setResultCode(\"-10011\");\r\n\t\t\t\tst.setResultMsg(\"可开门次数必须为0-254数字,0表示不限次数\");\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn st;\r\n\t}", "@Test\n public void pledgeRedeemVoteTest() throws IOException {\n TestCommon.getAccountInfo(topj, account);\n\n // redeem vote\n// ResponseBase<XTransactionResponse> redeemTokenVote = topj.unStakeVote(account, new BigInteger(\"1000\"));\n// System.out.println(\"un stake vote hash >> \" + redeemTokenVote.getData().getOriginalTxInfo().getTxHash() + \" > is success > \" + redeemTokenVote.getData().isSuccess());\n// TestCommon.getAccountInfo(topj, account);\n\n // set vote\n// Map<String, BigInteger> voteInfo = new HashMap<>();\n// String nodeAddress = \"T-0-LaFmRAybSKTKjE8UXyf7at2Wcw8iodkoZ8\";\n// voteInfo.put(nodeAddress, BigInteger.valueOf(5000));\n// ResponseBase<XTransactionResponse> setVoteResult = topj.voteNode(account, voteInfo);\n// System.out.println(\"set vote hash >> \" + setVoteResult.getData().getOriginalTxInfo().getTxHash() + \" >> is success > \" + setVoteResult.getData().isSuccess());\n//\n// TestCommon.getAccountInfo(topj, account);\n\n // cancel vote\n// voteInfo.put(nodeAddress, BigInteger.valueOf(200));\n// ResponseBase<XTransactionResponse> cancelVoteResult = topj.unVoteNode(account, voteInfo);\n// System.out.println(\"cancel vote hash >> \" + cancelVoteResult.getData().getOriginalTxInfo().getTxHash() + \" >> is success > \" + setVoteResult.getData().isSuccess());\n//\n// TestCommon.getAccountInfo(topj, account);\n\n// account.setAddress(\"T-0-LeP9oXqB8uLCBNCd9BsfULUYhSyDknt1q2\");\n// ResponseBase<VoteUsedResponse> r = topj.listVoteUsed(account);\n// ResponseBase<VoteUsedResponse> r = topj.listVoteUsed(account, \"T00000LKF18dpN5yGuBBpg38ZQyC8vpdzy6YQfPe\");\n// System.out.println(\"list vote used > \" + r.getData().getVoteInfos().get(\"T00000LKF18dpN5yGuBBpg38ZQyC8vpdzy6YQfPe\"));\n\n Map<String, String> result = Topj.generateV3Args(\"T80000968927100f3cb7b23e8d477298311648978d8613\", Arrays.asList(\"f8a49466ab344963eaa071f9636faac26b0d1a399003259466ab344963eaa071f9636faac26b0d1a3990032586010203040506830304058801020304050607088831323334353637388b68656c6c6f20776f726c648d746f7020756e69742074657374b8410051a134afd1fc323b4477d774a249742860c0d200f874ad6f3299c5270304e7f501423897a3d8e1613d339102af7f3011f901d85b0f848a27434a261563e259ee\"));\n\n System.out.println(\"generateV3Args > \" + JSON.toJSONString(result));\n }", "public String hashSale(String pwd){\n char[] password = pwd.toCharArray();\n byte[] sel = SALT.getBytes();\n //String Hex = Hex.encodeHexString(res);\n\n try{\n SecretKeyFactory skf = SecretKeyFactory.getInstance(\"PBKDF2WithHmacSHA512\");\n PBEKeySpec spec = new PBEKeySpec(password, sel, 3567, 512);\n SecretKey key = skf.generateSecret(spec);\n byte[] res = key.getEncoded();\n return res.toString();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }", "private static String signSecondTime(String transactionString)\n {\n Transaction spendTx = new Transaction(params, hexStringToByteArray(transactionString));\n\n // Get the input chunks\n Script inputScript = spendTx.getInput(0).getScriptSig();\n List<ScriptChunk> scriptChunks = inputScript.getChunks();\n\n // Create a list of all signatures. Start by extracting the existing ones from the list of script schunks.\n // The last signature in the script chunk list is the redeemScript\n List<TransactionSignature> signatureList = new ArrayList<TransactionSignature>();\n Iterator<ScriptChunk> iterator = scriptChunks.iterator();\n Script redeemScript = null;\n\n while (iterator.hasNext())\n {\n ScriptChunk chunk = iterator.next();\n\n if (iterator.hasNext() && chunk.opcode != 0)\n {\n TransactionSignature transactionSignarture = TransactionSignature.decodeFromBitcoin(chunk.data, false);\n signatureList.add(transactionSignarture);\n } else\n {\n redeemScript = new Script(chunk.data);\n }\n }\n\n // Create the sighash using the redeem script\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature secondSignature;\n\n // Take out the key and sign the signhash\n //ECKey key2 = createKeyFromSha256Passphrase(\"Super secret key 2\");\n ECKey key2 = ECKey.fromPrivate(new BigInteger(\"68123968917867656952640885027449260190826636504009580537802764798766700329220\"));\n// ECKey key2 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n secondSignature = key2.sign(sighash);\n\n // Add the second signature to the signature list\n TransactionSignature transactionSignarture = new TransactionSignature(secondSignature, Transaction.SigHash.ALL, false);\n signatureList.add(transactionSignarture);\n\n // Rebuild p2sh multisig input script\n inputScript = ScriptBuilder.createP2SHMultiSigInputScript(signatureList, redeemScript);\n spendTx.getInput(0).setScriptSig(inputScript);\n\n //System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }", "public List updatePaymentDetailsInCRM(List inputList) {\n log.info(\"INSIDE update Payment Details In CRM json Input:\" + inputList.get(1));\n List retValue = new ArrayList();\n JSONObject jsonObject = null;\n retValue.add(0, \"false\");\n String str = null;\n log.info(\"update Payment Details list: \" + inputList);\n JSONObject jsonInput = new JSONObject();\n try {\n str =\n callServicePost(inputList.get(0).toString(), (JSONObject) (inputList.get(1)),\n EPICConstant.NON_SECURED_TOKEN,null);\n jsonObject = new JSONObject(str);\n log.info(\"json Response is: \" + jsonObject);\n if (jsonObject.getString(EPICConstant.ERROR_CODE) != null &&\n jsonObject.getString(EPICConstant.ERROR_CODE).equalsIgnoreCase(\"0\")) {\n retValue.set(0, \"true\");\n retValue.add(1, jsonObject);\n } else {\n retValue.set(0, \"false\");\n }\n } catch (Exception payUpd) {\n retValue.set(0, \"false\");\n\n try {\n throw payUpd;\n } catch (Exception payUpdf) {\n payUpdf.printStackTrace();\n }\n }\n return retValue;\n }", "byte[] genKeyBlock(byte[] mastersecret, int[]clientRandom, int[]serverRandom) throws NoSuchAlgorithmException, IOException{\n byte[] part1 = md5andshaprocessing(\"AA\", mastersecret, clientRandom, serverRandom);\r\n byte[] part2 = md5andshaprocessing(\"BB\", mastersecret, clientRandom, serverRandom);\r\n byte[] part3 = md5andshaprocessing(\"CCC\", mastersecret, clientRandom, serverRandom);\r\n byte[] part4 = md5andshaprocessing(\"DDDD\", mastersecret, clientRandom, serverRandom);\r\n byte[] part5 = md5andshaprocessing(\"EEEEE\", mastersecret, clientRandom, serverRandom);\r\n byte[] part6 = md5andshaprocessing(\"FFFFFF\", mastersecret, clientRandom, serverRandom);\r\n \r\n baos.write(part1);\r\n baos.write(part2);\r\n baos.write(part3);\r\n baos.write(part4);\r\n baos.write(part5);\r\n baos.write(part6);\r\n \r\n byte[] keyblock = baos.toByteArray();\r\n baos.reset();\r\n \r\n client_macsecret = new byte[20];\r\n server_macsecret = new byte[20];\r\n client_writekey = new byte[24];\r\n server_writekey = new byte[24];\r\n \r\n System.arraycopy(keyblock, 0, client_macsecret, 0, 20);\r\n System.arraycopy(keyblock, 20, server_macsecret, 0, 20);\r\n System.arraycopy(keyblock, 40, client_writekey, 0, 24);\r\n System.arraycopy(keyblock, 64, server_writekey, 0, 24);\r\n return keyblock;\r\n }", "com.google.protobuf.ByteString getSerializedPaymentDetails();", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@java.lang.Override\n public boolean hasMerchantData() {\n return instance.hasMerchantData();\n }", "@Test(priority = 1, dataProvider = \"verifytxTestData\")\r\n\tpublic void testResponseCode(HashMap<String, String> hm) {\r\n\r\n\t\t// Checking execution flag\r\n\t\tif (hm.get(\"ExecuteFlag\").trim().equalsIgnoreCase(\"No\"))\r\n\t\t\tthrow new SkipException(\"Skipping the test ---->> As per excel entry\");\r\n\t\t\r\n\t\t\tappURL = globalConfig.getString(\"VERIFYTX_API_CONFIG\");\r\n\r\n\r\n\t\t System.out.println(\"URL:\"+ appURL);\r\n\t\t\t\r\n\r\n\t\tHashMap<String, String> headerParameters = new HashMap<String, String>();\r\n\t\t\r\n\t\t\t\r\n\t\t\theaderParameters.put(\"txid\", hm.get(\"I_txid\"));\t\t\r\n\t\t\t\r\n\t\t\theaderParameters.put(\"txbytes\", hm.get(\"I_txbytes\"));\r\n\t\r\n\t\t\r\n\r\n\t\tint responseCode = 0;\r\n\t\tlogger.debug(\"requestURL is getting sent as {}\", appURL.toString());\r\n\r\n\t\ttry {\r\n\t\t\tresponseCode = HTTPUtil.sendGet(appURL, headerParameters);\r\n\r\n\t\t\tSystem.out.println(\"Response Code:\" +responseCode);\r\n\r\n\t\t\tif ((responseCode == 200) || (responseCode == 404)) {\r\n\t\t\t\ttry {\r\n\r\n\t\t\t\t\tString filePathOfJsonResponse = HelperUtil.createOutputDir(this.getClass().getSimpleName())\r\n\t\t\t\t\t\t\t+ File.separator + this.getClass().getSimpleName() + hm.get(\"SerialNo\") + \".json\";\r\n\r\n\t\t\t\t\tHTTPUtil.writeResponseToFile(filePathOfJsonResponse);\r\n\r\n\t\t\t\t} catch (UnsupportedOperationException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\treporter.writeLog(\"FAIL\", \"\", \"Caught Exception :\" + e.getMessage());\r\n\t\t\t\t\tAssertJUnit.fail(\"Caught Exception ...\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treporter.writeLog(\"FAIL\", \"\", \"Caught Exception :\" + e.getMessage());\r\n\t\t\tAssertJUnit.fail(\"Caught Exception ...\" + e.getMessage());\r\n\t\t}\r\n\r\n\t\tlogger.debug(\"The response code is {}\", Integer.valueOf(responseCode).toString());\r\n\t\tPreconditions.checkArgument(!hm.get(\"httpstatus\").equals(null), \"String httpstatus in excel must not be null\");\r\n\r\n\t\t// Verify response code\r\n\t\tif (responseCode==200) {\r\n\t\t\treporter.writeLog(\"PASS\", \"Status should be \" + hm.get(\"httpstatus\"), \"Status is \" + responseCode);\r\n\t\t\tAssertJUnit.assertEquals(responseCode, 200);\r\n\t\t} else {\r\n\t\t\treporter.writeLog(\"FAIL\", \"Status should be \" + hm.get(\"httpstatus\"), \"Status is \" + responseCode);\r\n\t\t\tAssertJUnit.assertEquals(responseCode, Integer.parseInt(hm.get(\"httpstatus\")));\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"-------------------------------------------\");\r\n\t}", "boolean verifyDeveloperPayload(Purchase p) {\n String payload = p.getDeveloperPayload();\n String messageAfterDecrypt = \"not_empty_line\";\n String password = getString(R.string.check_token);\n ;\n try {\n messageAfterDecrypt = AESCrypt.decrypt(password, payload);\n //Log.e(TAG, \"messageAfterDecrypt \" + messageAfterDecrypt);\n //Log.e(TAG, \"email \" + email);\n } catch (GeneralSecurityException e) {\n e.printStackTrace();\n //handle error - could be due to incorrect password or tampered encryptedMsg\n }\n// if (messageAfterDecrypt.equals(email)){\n// return true;\n// }\n if (Utils.isEmailValid(messageAfterDecrypt)) {\n return true;\n }\n\n return false;\n }", "public void VerifyBillingTabPaymentDetails(String payment0, String payment1, String payment2, String payment3){\r\n\t\tString[] Payment = {getValue(payment0),getValue(payment1),getValue(payment2),getValue(payment3)};\r\n\t\tString Payments=\"\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Payment Methods should be present in Checkout Page\");\r\n\r\n\t\ttry{\r\n\t\t\tsleep(8000);\r\n\t\t\tList<WebElement> ele = listofelements(locator_split(\"txtCheckoutPaymentMethods\"));\r\n\r\n\t\t\tfor(int i=0; i<ele.size(); i++){\r\n\t\t\t\tif(getText(ele.get(i)).contains(Payment[i])){\r\n\t\t\t\t\tSystem.out.println(getText(ele.get(i))+\" payment option is present\");\r\n\t\t\t\t\tPayments=Payments.concat(getText(ele.get(i))).concat(\", \");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"one or more Payment options are not present\");\r\n\t\t\t\t\tthrow new Error(\"one or more Payment options are not present\");\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- All the payment options\"+Payments+\" are present\");\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutPaymentMethods\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- one or more Payment options are not present\");\r\n\r\n\t\t}\r\n\t}", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000001);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "private void clearMerchantData() {\n bitField0_ = (bitField0_ & ~0x00000020);\n merchantData_ = getDefaultInstance().getMerchantData();\n }", "String getResponseDescription(String vResponseCode) {\r\n\r\n\t\tString result = \"\";\r\n\r\n\t\t// check if a single digit response code\r\n\t\tif (vResponseCode.length() != 1) {\r\n\r\n\t\t\t// Java cannot switch on a string so turn everything to a char\r\n\t\t\tchar input = vResponseCode.charAt(0);\r\n\r\n\t\t\tswitch (input) {\r\n\t\t\tcase '0':\r\n\t\t\t\tresult = \"Transaction Successful\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '1':\r\n\t\t\t\tresult = \"Unknown Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '2':\r\n\t\t\t\tresult = \"Bank Declined Transaction\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '3':\r\n\t\t\t\tresult = \"No Reply from Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '4':\r\n\t\t\t\tresult = \"Expired Card\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '5':\r\n\t\t\t\tresult = \"Insufficient Funds\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '6':\r\n\t\t\t\tresult = \"Error Communicating with Bank\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '7':\r\n\t\t\t\tresult = \"Payment Server System Error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '8':\r\n\t\t\t\tresult = \"Transaction Type Not Supported\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '9':\r\n\t\t\t\tresult = \"Bank declined transaction (Do not contact Bank)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'A':\r\n\t\t\t\tresult = \"Transaction Aborted\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'C':\r\n\t\t\t\tresult = \"Transaction Cancelled\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'D':\r\n\t\t\t\tresult = \"Deferred transaction has been received and is awaiting processing\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'F':\r\n\t\t\t\tresult = \"3D Secure Authentication failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'I':\r\n\t\t\t\tresult = \"Card Security Code verification failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'L':\r\n\t\t\t\tresult = \"Shopping Transaction Locked (Please try the transaction again later)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'N':\r\n\t\t\t\tresult = \"Cardholder is not enrolled in Authentication Scheme\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'P':\r\n\t\t\t\tresult = \"Transaction has been received by the Payment Adaptor and is being processed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'R':\r\n\t\t\t\tresult = \"Transaction was not processed - Reached limit of retry attempts allowed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'S':\r\n\t\t\t\tresult = \"Duplicate SessionID (OrderInfo)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'T':\r\n\t\t\t\tresult = \"Address Verification Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'U':\r\n\t\t\t\tresult = \"Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'V':\r\n\t\t\t\tresult = \"Address Verification and Card Security Code Failed\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '?':\r\n\t\t\t\tresult = \"Transaction status is unknown\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tresult = \"Unable to be determined\";\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t} else {\r\n\t\t\treturn \"No Value Returned\";\r\n\t\t}\r\n\t}", "public void syncApprovedApplicantsFromErp() {\n\t\tList<String> allErpCodes = applicationDao.getAllProcessedApplicationFileNos();\r\n\t\t// List<String> allErpCodes = Arrays.asList(\"C/20293\", \"C/20292\",\r\n\t\t// \"C/20390\");\r\n\t\tList<ApplicationSyncPayLoad> syncedApplicants = new ArrayList<>();\r\n\t\tint successCounter = 0;\r\n\t\tint totalToBeSynced = 0;\r\n\t\tif (!allErpCodes.isEmpty()) {\r\n\t\t\ttotalToBeSynced = allErpCodes.size();\r\n\t\t\tJSONArray mJSONArray = new JSONArray(allErpCodes);\r\n\r\n\t\t\t// Send this to ERP\r\n\t\t\ttry {\r\n\t\t\t\tString results = postErpCodesToERP(mJSONArray);\r\n\t\t\t\tif (results.equals(\"null\")) {\r\n\t\t\t\t\tlogger.error(\" ===>>><<<< === NO REPLY FROM ERP ===>><<<>>== \");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tJSONArray jo = null;\r\n\t\t\t\t\tjo = new JSONArray(results);\r\n\t\t\t\t\tfor (int i = 0; i < jo.length(); i++) {\r\n\t\t\t\t\t\tJSONObject jObject = null;\r\n\t\t\t\t\t\tjObject = jo.getJSONObject(i);\r\n\t\t\t\t\t\tApplicationSyncPayLoad syncPayLoad = new ApplicationSyncPayLoad();\r\n\t\t\t\t\t\tsyncPayLoad.setApplicationNo_(jObject.getString(\"Application No_\"));\r\n\t\t\t\t\t\tsyncPayLoad.setEmail(jObject.getString(\"email\"));\r\n\t\t\t\t\t\tsyncPayLoad.setReg_no(jObject.getString(\"reg_no\"));\r\n\t\t\t\t\t\tsyncedApplicants.add(syncPayLoad);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfor (ApplicationSyncPayLoad appSync : syncedApplicants) {\r\n\t\t\t\t\t\t// Update this Applications\r\n\t\t\t\t\t\tlogger.info(\"Finding application:\" + appSync.getApplicationNo_());\r\n\t\t\t\t\t\tList<ApplicationFormHeader> applications = applicationDao\r\n\t\t\t\t\t\t\t\t.findByErpCode(appSync.getApplicationNo_());\r\n\r\n\t\t\t\t\t\tApplicationFormHeader application = null;\r\n\t\t\t\t\t\tif (applications.size() > 0) {\r\n\t\t\t\t\t\t\tapplication = applications.get(0);\r\n\t\t\t\t\t\t\tif (application != null) {\r\n\t\t\t\t\t\t\t\t// Find the User and Member Object and User\r\n\t\t\t\t\t\t\t\tif (application.getUserRefId() != null) {\r\n\t\t\t\t\t\t\t\t\tlogger.info(\"marking this application as approved:\" + application.getRefId());\r\n\t\t\t\t\t\t\t\t\tapplication.setApplicationStatus(ApplicationStatus.APPROVED);\r\n\t\t\t\t\t\t\t\t\tUser user = userDao.findByUserId(application.getUserRefId(), false);\r\n\t\t\t\t\t\t\t\t\tMember m = null;\r\n\t\t\t\t\t\t\t\t\tif (user != null) {\r\n\t\t\t\t\t\t\t\t\t\tuser.setMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\tuserDao.deleteAllRolesForCurrentUser(user.getId());\r\n\t\t\t\t\t\t\t\t\t\tRole role = roleDao.getByName(\"MEMBER\");\r\n\t\t\t\t\t\t\t\t\t\tif (role != null) {\r\n\t\t\t\t\t\t\t\t\t\t\tuser.addRole(role);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Changing the user role from basic_member to member.\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (user.getMember() != null) {\r\n\t\t\t\t\t\t\t\t\t\t\tm = user.getMember();\r\n\t\t\t\t\t\t\t\t\t\t\tm.setMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\t\tm.setRegistrationDate(application.getCreated());\r\n\t\t\t\t\t\t\t\t\t\t\tm.setUserRefId(user.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tm.setMemberShipStatus(MembershipStatus.ACTIVE);\r\n\t\t\t\t\t\t\t\t\t\t\tm.setMemberQrCode(m.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(m);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Updating member record.\");\r\n\t\t\t\t\t\t\t\t\t\t\t// Save all this parameters\r\n\t\t\t\t\t\t\t\t\t\t\t// Applicant, Member, User\r\n\t\t\t\t\t\t\t\t\t\t\tapplicationDao.save(application);\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(user);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Updating user record.\");\r\n\t\t\t\t\t\t\t\t\t\t\tsuccessCounter = successCounter + 1;\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Member Record is Null for user with memberNo:\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ user.getMemberNo()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \". Checking if the member record exist or create a new record.\");\r\n\t\t\t\t\t\t\t\t\t\t\t// Check if there was a previous\r\n\t\t\t\t\t\t\t\t\t\t\t// member\r\n\t\t\t\t\t\t\t\t\t\t\t// Record created\r\n\t\t\t\t\t\t\t\t\t\t\tMember member = null;\r\n\t\t\t\t\t\t\t\t\t\t\tmember = memberDao.findByMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\t\tif (member == null) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tmember = new Member();\r\n\t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Member doesn't exist. Creating new MemberRecord\");\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Member already exist. Just ammending it.\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setMemberNo(appSync.getReg_no());\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setRegistrationDate(application.getCreated());\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setUserRefId(user.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setMemberShipStatus(MembershipStatus.ACTIVE);\r\n\t\t\t\t\t\t\t\t\t\t\tmember.setMemberQrCode(member.getRefId());\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(member);\r\n\t\t\t\t\t\t\t\t\t\t\tuser.setMember(member);\r\n\t\t\t\t\t\t\t\t\t\t\t// Save all this parameters\r\n\t\t\t\t\t\t\t\t\t\t\t// Applicant, Member, User\r\n\t\t\t\t\t\t\t\t\t\t\tapplicationDao.save(application);\r\n\t\t\t\t\t\t\t\t\t\t\tuserDao.save(user);\r\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Updating user record.\");\r\n\t\t\t\t\t\t\t\t\t\t\tsuccessCounter = successCounter + 1;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tSystem.err.println(\"Total To Be Synced:\" + totalToBeSynced + \"\\n\");\r\n\t\t\t\t\tSystem.err.println(\"Total Success:\" + successCounter + \"\\n\");\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (URISyntaxException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (JSONException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT && resultCode == RESULT_OK && data !=\n null) {\n TransactionResponse transactionResponse = data.getParcelableExtra(PayUmoneyFlowManager\n .INTENT_EXTRA_TRANSACTION_RESPONSE);\n\n ResultModel resultModel = data.getParcelableExtra(PayUmoneyFlowManager.ARG_RESULT);\n\n // Check which object is non-null\n if (transactionResponse != null && transactionResponse.getPayuResponse() != null) {\n if (transactionResponse.getTransactionStatus().equals(TransactionResponse.TransactionStatus.SUCCESSFUL)) {\n //Success Transaction\n AddPayment(name, ridequantity, Amount);\n } else {\n Intent intent = new Intent();\n setResult(RESULT_OK, intent);\n finish();\n\n }\n\n // Response from Payumoney\n// String payuResponse = transactionResponse.getPayuResponse();\n//\n//// Response from SURl and FURL\n// String merchantResponse = transactionResponse.getTransactionDetails();\n//\n// new AlertDialog.Builder(this)\n// .setCancelable(false)\n// .setMessage(\"Payu's Data : \" + payuResponse + \"\\n\\n\\n Merchant's Data: \" + merchantResponse)\n// .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {\n// public void onClick(DialogInterface dialog, int whichButton) {\n// dialog.dismiss();\n// }\n// }).show();\n\n } else if (resultModel != null && resultModel.getError() != null) {\n Log.d(TAG, \"Error response : \" + resultModel.getError().getTransactionResponse());\n } else {\n Log.d(TAG, \"Both objects are null!\");\n }\n }\n }", "private static CheckResult test6(String reply, String attach) {\n\n String[] blocks = reply.split(\"\\n(\\n+)?\\n\");\n\n if (blocks.length != 12) {\n return new CheckResult(false,\n \"Your program shows wrong blocks of output. Expected: 12\\n\" +\n \"You have: \" + blocks.length + \"\\n\" +\n \"Make sure that you print an empty line after each chosen action\");\n }\n\n String balanceAfterDownloadingPurchases = blocks[3];\n\n if (!balanceAfterDownloadingPurchases.replace(\",\", \".\").contains(\"785.64\")) {\n return new CheckResult(false,\n \"Your program reads balance from file wrong!\");\n }\n\n //All purchases list\n\n String allPurchases = blocks[6];\n\n String[] expectedPurchases = {\n \"Almond 250g $35.43\",\n \"Milk $3.50\",\n \"Red Fuji Apple $5.99\",\n \"Eggs $3.99\",\n \"FIJI Natural Artesian Water $25.98\",\n \"Hershey's milk chocolate bars $8.54\",\n \"Great Value Broccoli Florets $1.00\",\n \"Keystone Ground Bee $6.28\",\n \"Gildan LT $8.61\",\n \"Men's Dual Defense Crew Socks 12 Pairs $13.00\",\n \"Wrangler Men's Stretch Cargo Pant $19.97\",\n \"LEGO DUPLO Town Farm Animals $10.10\",\n \"Cinema $8.73\",\n \"Skate rental $30.00\",\n \"Sensodyne Pronamel Toothpaste $19.74\",\n \"Chick-fil-A $10 Gift Card $10.00\",\n \"Debt $3.50\"\n };\n\n for (String expectedPurchase : expectedPurchases) {\n if (!allPurchases.contains(expectedPurchase)) {\n return new CheckResult(false,\n \"Your all purchases list doesn't have purchase:\\n\" +\n expectedPurchase + \"\\n\" +\n \"But should have!\");\n }\n }\n\n String[] temp = allPurchases.split(\"\\n\");\n String totalSum = temp[temp.length - 1];\n\n Pattern doublePattern = Pattern.compile(\"\\\\d+[,.]\\\\d+\");\n Matcher matcher = doublePattern.matcher(totalSum);\n\n if (!matcher.find()) {\n return new CheckResult(false,\n \"Total sum of all purchases is wrong. Expected:\\n\" +\n \"Total sum: $214.36\\n\" +\n \"Your output:\\n\" +\n totalSum);\n }\n\n double allTotalSum = Double.parseDouble(matcher.group());\n\n if (Math.abs(allTotalSum - 214.36) > 0.0001) {\n return new CheckResult(false,\n \"Your all total sum is wrong!\");\n }\n\n //Food list\n\n String foodList = blocks[8];\n\n expectedPurchases = new String[]{\n \"Almond 250g $35.43\",\n \"Milk $3.50\",\n \"Red Fuji Apple $5.99\",\n \"Eggs $3.99\",\n \"FIJI Natural Artesian Water $25.98\",\n \"Hershey's milk chocolate bars $8.54\",\n \"Great Value Broccoli Florets $1.00\",\n \"Keystone Ground Bee $6.28\"\n };\n\n for (String expectedPurchase : expectedPurchases) {\n if (!foodList.contains(expectedPurchase)) {\n return new CheckResult(false,\n \"Your food list doesn't have purchase:\\n\" +\n expectedPurchase + \"\\n\" +\n \"But should have!\");\n }\n }\n\n temp = foodList.split(\"\\n\");\n totalSum = temp[temp.length - 1];\n\n matcher = doublePattern.matcher(totalSum);\n\n if (!matcher.find()) {\n return new CheckResult(false,\n \"Total sum of food list is wrong. Expected:\\n\" +\n \"Total sum: $90.71\\n\" +\n \"Your output:\\n\" + totalSum);\n }\n\n double foodTotalSum = Double.parseDouble(matcher.group());\n\n if (Math.abs(foodTotalSum - 90.71) > 0.0001) {\n return new CheckResult(false,\n \"Your food total sum is wrong!\");\n }\n\n return new CheckResult(true);\n }", "private void handleVerify(boolean isDoubleVerify) {\n if (listVerifyResult.isEmpty()) {\n return;\n }\n\n // Extract zip file input\n String folderSaveResult = helper.getFolderSave(\"Choose extract folder zip files\");\n if (folderSaveResult.isEmpty() || folderSaveResult == null) {\n return;\n }\n\n boolean usingInputKey = this.gui.getCheckboxVerify().isSelected();\n\n for (ModelResult modelResult : listVerifyResult) {\n int id = modelResult.getId();\n long startVerify = System.nanoTime();\n updateVerifyFileStatus(\"Unzip file...\", 0, id);\n String fileNameNoEx = helper.getFileNameNoExtension(modelResult.getFileName());\n // Unzip file\n String unzipedFolder = folderSaveResult + \"\\\\\" + fileNameNoEx;\n modelResult.setFolderRS(unzipedFolder);\n boolean unzipRs = helper.unZip(modelResult.getFilePath(), unzipedFolder);\n\n if (unzipRs) {\n updateVerifyFileStatus(\"Unzip file successfully\", 0, id);\n } else {\n updateVerifyFileStatus(\"Unzip file failed\", 0, id);\n return;\n }\n\n // Read Input Files from unzip folder\n ModelInputVerify miv = helper.readInputVerify(unzipedFolder);\n if (miv == null || miv.getPublickey().isEmpty() && usingInputKey) {\n updateVerifyFileStatus(\"Public key from input not found\", 0, id);\n return;\n }\n\n ModelFriendKey mFriendKey = null;\n if (usingInputKey) {\n mFriendKey = new ModelFriendKey(\"\", miv.getPublickey(), \"\");\n mFriendKey.setAlgorithm(miv.getPublickeyAlgorithm());\n } else {\n String frKeyNameSelected = String.valueOf(gui.getCbbFriendKeyVerify().getSelectedItem());\n mFriendKey = friendKey.get(frKeyNameSelected);\n\n if (mFriendKey == null) {\n updateVerifyFileStatus(\"Friend key not found\", 0, id);\n return;\n }\n\n }\n\n String hash = miv.getSignatureHashAlgorithm();\n String cryptoAlgorithm = mFriendKey.getAlgorithm();\n String algorithm = hash + \"with\" + cryptoAlgorithm;\n\n if (hash.equals(\"SHA512\") && cryptoAlgorithm.equals(\"DSA\")) {\n updateVerifyFileStatus(cryptoAlgorithm + \" is Not support \" + hash + \" algorithm\", 0, id);\n return;\n }\n\n boolean verifyRs = false;\n\n if (!isDoubleVerify) {\n verifyRs = Verify(miv.getFilePath(), miv.getSignature(), mFriendKey, algorithm);\n } else {\n verifyRs = VerifyDoubleSign(miv.getFilePath(), miv.getSignature(), mFriendKey, algorithm);\n }\n\n long endTime = System.nanoTime();\n long duration = (endTime - startVerify) / 1000000; //divide by 1000000 to get milliseconds.\n if (verifyRs) {\n updateVerifyFileStatus(\"File Valid\", (int) duration, id);\n } else {\n updateVerifyFileStatus(\"File Invalid\", (int) duration, id);\n }\n }\n }", "String[] getValidClientHashes();", "TxnResponseProto.TxnResponseOrBuilder getTxnresponseOrBuilder();", "private void verifyPaymentOnServer(final String paymentId,\n\t\t\tfinal String payment_client) {\n\t\t// Showing progress dialog before making request\n\t\tpDialog.setMessage(\"Verifying payment...\");\n\t\tshowpDialog();\n\n\t\tStringRequest verifyReq = new StringRequest(Method.POST,\n\t\t\t\tConfig.URL_VERIFY_PAYMENT, new Response.Listener<String>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onResponse(String response) {\n\t\t\t\t\t\tLog.d(TAG, \"verify payment: \" + response.toString());\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tJSONObject res = new JSONObject(response);\n\t\t\t\t\t\t\tboolean error = res.getBoolean(\"error\");\n\t\t\t\t\t\t\tString message = res.getString(\"message\");\n\n\t\t\t\t\t\t\t// user error boolean flag to check for errors\n\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), message,\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\n\t\t\t\t\t\t\tif (!error) {\n\t\t\t\t\t\t\t\t// empty the cart\n\t\t\t\t\t\t\t\tproductsInCart.clear();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// hiding the progress dialog\n\t\t\t\t\t\thidepDialog();\n\n\t\t\t\t\t}\n\t\t\t\t}, new Response.ErrorListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onErrorResponse(VolleyError error) {\n\t\t\t\t\t\tLog.e(TAG, \"Verify Error: \" + error.getMessage());\n\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\terror.getMessage(), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t// hiding the progress dialog\n\t\t\t\t\t\thidepDialog();\n\t\t\t\t\t}\n\t\t\t\t}) {\n\n\t\t\t@Override\n\t\t\tprotected Map<String, String> getParams() {\n\n\t\t\t\tMap<String, String> params = new HashMap<String, String>();\n\t\t\t\tparams.put(\"paymentId\", paymentId);\n\t\t\t\tparams.put(\"paymentClientJson\", payment_client);\n\n\t\t\t\treturn params;\n\t\t\t}\n\t\t};\n\n\t\t// Setting timeout to volley request as verification request takes sometime\n\t\tint socketTimeout = 60000;\n\t\tRetryPolicy policy = new DefaultRetryPolicy(socketTimeout,\n\t\t\t\tDefaultRetryPolicy.DEFAULT_MAX_RETRIES,\n\t\t\t\tDefaultRetryPolicy.DEFAULT_BACKOFF_MULT);\n\t\tverifyReq.setRetryPolicy(policy);\n\n\t\t// Adding request to request queue\n\t\tAppController.getInstance().addToRequestQueue(verifyReq);\n\t}", "public JsonObject raw_block() {\n \tJsonObject block = new JsonObject();\n \tblock.addProperty(\"BlockID\", blockId);\n \tif(!BlockChain.isEmpty())\n \t block.addProperty(\"PrevHash\", Hash.getHashString(getLongestBranch().last_block.toString()));\n \telse {\n \t\tblock.addProperty(\"PrevHash\", \"0000000000000000000000000000000000000000000000000000000000000000\");\n \t}\n \tblock.addProperty(\"Nonce\", \"00000000\");\n block.addProperty(\"MinerID\", \"Server\"+String.format(\"%02d\", minerId));\n \n \tJsonArray newTxPool = new JsonArray();\n \tJsonArray transactions = new JsonArray();\n \tint N = TxPool_new.size();\n \tint i;\n \tfor (i=0; i<N && i<50; i++) {\n \t\ttransactions.add(TxPool_new.get(i));\n \t\t//TxPool_used.add(TxPool_new.get(i));\n \t}\n \tfor (; i<N; i++)\n \t\tnewTxPool.add(TxPool_new.get(i));\n \tblock.add(\"Transactions\", transactions);\n\n \treturn block;\n }", "@Override\n public AdyenResponsesRecord getSuccessfulAuthorizationResponse(final UUID kbPaymentId, final UUID kbTenantId) throws SQLException {\n return execute(dataSource.getConnection(),\n new WithConnectionCallback<AdyenResponsesRecord>() {\n @Override\n public AdyenResponsesRecord withConnection(final Connection conn) throws SQLException {\n return DSL.using(conn, dialect, settings)\n .selectFrom(responsesTable)\n .where(DSL.field(responsesTable.getName() + \".\" + KB_PAYMENT_ID).equal(kbPaymentId.toString()))\n .and(\n DSL.field(responsesTable.getName() + \".\" + TRANSACTION_TYPE).equal(TransactionType.AUTHORIZE.toString())\n .or(DSL.field(responsesTable.getName() + \".\" + TRANSACTION_TYPE).equal(TransactionType.PURCHASE.toString()))\n )\n .and(DSL.field(responsesTable.getName() + \".\" + KB_TENANT_ID).equal(kbTenantId.toString()))\n .orderBy(DSL.field(responsesTable.getName() + \".\" + RECORD_ID).desc())\n .limit(1)\n .fetchOne();\n }\n });\n }", "public static SendResult check(LinkedHashMap param) {\n\t\tSet<Map.Entry<String, String>> paramsSet = param.entrySet();\r\n\t\tSendResult sr=new SendResult(\"0\",\"\",\"\");\r\n\t\tfor (Map.Entry<String, String> paramEntry : paramsSet) {\r\n\t\t\tString key=paramEntry.getKey();\r\n\t\t\tObject val=paramEntry.getValue();\r\n\t\t\tif(key.equals(\"gatewaycode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10001\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关通讯ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10002\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关通讯ID必须为10位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"gatewaycode2\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10003\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关唯一ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10004\");\r\n\t\t\t\t\tsr.setResultMsg(\"网关唯一ID必须为10位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"roomcode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10005\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁编号不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=4||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10006\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁编号必须为4位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"timeout\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10007\");\r\n\t\t\t\t\tsr.setResultMsg(\"指令超时时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10021\");\r\n\t\t\t\t\tsr.setResultMsg(\"指令超时时间必须为数字\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"pass\") || key.equals(\"password\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10008\");\r\n\t\t\t\t\tsr.setResultMsg(\"密码不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=6||!val.toString().matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10009\");\r\n\t\t\t\t\tsr.setResultMsg(\"密码必须为6位数字\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"count\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10010\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10011\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数必须为0-254数字,0表示不限次数\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"edate\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10012\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().equals(\"-1\")&&(val.toString().length()!=10||!val.toString().matches(\"\\\\d+\"))) {\r\n\t\t\t\t\tsr.setResultCode(\"-10013\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间格式为yyMMddHHmm\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"unlockstime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10014\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10015\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10015\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10015\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"unlocketime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10016\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10017\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10017\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10017\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"callbackurl\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10018\");\r\n\t\t\t\t\tsr.setResultMsg(\"回调地址不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"roomcode2\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10019\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁唯一ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=10||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10020\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁唯一ID必须为10位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"openstime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10022\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10023\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10023\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"\\\\d+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10023\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段开始时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"openetime\")) {\r\n\t\t\t\tString val2=val.toString().replace(\":\", \"\");\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10024\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=5) {\r\n\t\t\t\t\tsr.setResultCode(\"-10025\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().contains(\":\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10025\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val2.length()!=4||!val2.matches(\"[0-9]+\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10025\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门时间段结束时间格式为XX:XX,如00:00\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"cardtype\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10026\");\r\n\t\t\t\t\tsr.setResultMsg(\"卡片类型不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().equals(\"开门卡\")&&!val.toString().equals(\"管理卡\")&&!val.toString().equals(\"授权卡\")&&!val.toString().equals(\"身份证\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10027\");\r\n\t\t\t\t\tsr.setResultMsg(\"卡片类型必须为开门卡/管理卡/授权卡/身份证\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"cardcode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10028\");\r\n\t\t\t\t\tsr.setResultMsg(\"卡号不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().equals(\"开门卡\")||val.toString().equals(\"管理卡\")||val.toString().equals(\"授权卡\")) {\r\n\t\t\t\t\tif(val.toString().length()!=8||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tsr.setResultCode(\"-10029\");\r\n\t\t\t\t\t\tsr.setResultMsg(\"开门卡/管理卡/授权卡必须为8位十六进制字符串\");\r\n\t\t\t\t\t\treturn sr;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(val.toString().equals(\"身份证\")) {\r\n\t\t\t\t\tif(val.toString().length()!=16||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\t\tsr.setResultCode(\"-10030\");\r\n\t\t\t\t\t\tsr.setResultMsg(\"身份证必须为16位十六进制字符串\");\r\n\t\t\t\t\t\treturn sr;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"cardedate\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10031\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().equals(\"-1\")&&(val.toString().length()!=10||!val.toString().matches(\"\\\\d+\"))) {\r\n\t\t\t\t\tsr.setResultCode(\"-10032\");\r\n\t\t\t\t\tsr.setResultMsg(\"授权结束时间格式为yyMMddHHmm\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"opencount\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10033\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10034\");\r\n\t\t\t\t\tsr.setResultMsg(\"可开门次数必须为0-254数字,0表示不限次数\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"fingercode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10035\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹编号不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=8||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10036\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹编号必须为8位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"fingercontent\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10037\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹特征码不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(val.toString().length()!=988||val.toString().toUpperCase().matches(\".*[G-Z].*\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10038\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹特征码必须为988位十六进制字符串\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"actioncount\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10039\");\r\n\t\t\t\t\tsr.setResultMsg(\"开门需按指纹次数不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.toString().matches(\"[0-9]+|(-1)\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10040\");\r\n\t\t\t\t\tsr.setResultMsg(\"开门需按指纹次数必须为数字\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"rclist\")) {\r\n\t\t\t}else if(key.equals(\"fpcode\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10041\");\r\n\t\t\t\t\tsr.setResultMsg(\"指纹机唯一ID不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"roomimei\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10042\");\r\n\t\t\t\t\tsr.setResultMsg(\"IMEI不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}else if(key.equals(\"locktype\")) {\r\n\t\t\t\tif(val.toString()==null||val.toString().equals(\"\")||val.toString().equals(\"null\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10043\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁类型不能为空\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}else if(!val.equals(\"1\") && !val.equals(\"2\") && !val.equals(\"3\") && !val.equals(\"4\")) {\r\n\t\t\t\t\tsr.setResultCode(\"-10044\");\r\n\t\t\t\t\tsr.setResultMsg(\"门锁类型不存在\");\r\n\t\t\t\t\treturn sr;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sr;\r\n\t}", "@Transactional(\"transactionManager\")\r\n\tpublic ArrayList<String> checkIn(String parm[], Consumer consumer, Merchant merchant,Bank bank) {\r\n\r\n\t\tArrayList<String> encData = new ArrayList<String>();\r\n\t\tTransactions transaction = new Transactions();\r\n\t\ttransaction.setMerchant(merchant);\r\n\t\ttransaction.setConsumer(consumer);\r\n\r\n\t\t//Setting parameters\r\n\t\ttransaction.setMerchant_order_id(parm[1]);\r\n\t\t//country\r\n\r\n\t\t//Store bank detailsS if received from merchant\r\n\t\tTransactions temp = orderDao.checkTransactionExsist(merchant, transaction); //If transactions exsist then throw error\r\n\t\tif(temp!=null)\r\n\t\t\tthrow new CustomDataException(ErrorConstants.MERCHANT_INVALID_ORDER_ID,ErrorConstants.STR_MERCHANT_INVALID_ORDER_ID);\r\n\r\n\t\ttransaction.setCustomer_phonenumber(Long.parseLong(parm[7]));\r\n\t\ttransaction.setConsumer(consumer);\r\n\t\ttransaction.setMerchant_country(parm[3]);\r\n\t\ttransaction.setMerchant_currency(parm[4]);\r\n\t\ttransaction.setMerchant_activity_time(new Date());\r\n\t\ttransaction.setMerchant_amount(Double.parseDouble(parm[8]));\r\n\t\ttransaction.setMerchant_success_url(parm[9]);\r\n\t\ttransaction.setMerchant_fail_url(parm[10]);\r\n\t\ttransaction.setMerchant_paymode(parm[12]);\r\n\t\ttransaction.setMerchant_details(parm[13]);\r\n\r\n\t\ttransaction.setStatus(OrderState.INITIATED);\r\n\t\torderDao.addTransactions(transaction);\r\n\r\n\t\tlog.info(\"Transaction id : \"+transaction.getTransaction_id());\r\n\t\tlog.debug(\"Transaction id : \"+transaction.getTransaction_id());\r\n\t\tlog.info(\"Merchant id : \"+transaction.getMerchant().getUser_id());\r\n\t\tlog.debug(\"Merchant id : \"+transaction.getMerchant().getUser_id());\r\n\t\tlog.info(\"Customer id : \"+transaction.getConsumer().getUser_id());\r\n\t\tlog.debug(\"Customer id : \"+transaction.getConsumer().getUser_id());\r\n\t\tlog.info(\"Merchant amount : \"+transaction.getMerchant_amount());\r\n\t\tlog.debug(\"Merchant amount : \"+transaction.getMerchant_amount());\r\n\t\tlog.info(\"Time : \"+transaction.getMerchant_activity_time());\r\n\t\tlog.debug(\"Time : \"+transaction.getMerchant_activity_time());\r\n\r\n\t\t//Populating parameter for bank have to change the hard coded values\r\n\t\tencData.add(bank.getBank_merchant_id()); \r\n\t\tencData.add(\"DOM\"); //Have to change latter\r\n\t\tencData.add(transaction.getMerchant_country());\r\n\t\tencData.add(transaction.getMerchant_currency());\r\n\t\tencData.add(Double.toString(transaction.getMerchant_amount()));\r\n\t\tencData.add(transaction.getMerchant_details());\r\n\t\tencData.add(URLConstants.SBI_SUCCESS_URL); //change latter\r\n\t\tencData.add(URLConstants.SBI_FAIL_URL);\r\n\t\tencData.add(\"SBIEPAY\");\r\n\t\tencData.add(Integer.toString(transaction.getTransaction_id()));\r\n\t\tencData.add(Integer.toString((transaction.getConsumer().getUser_id())));\r\n\t\tencData.add(transaction.getMerchant_paymode());\r\n\t\tencData.add(\"ONLINE\");\r\n\t\tencData.add(\"ONLINE\");\r\n\r\n\t\treturn encData;\r\n\t}", "public String calculateHash() throws JsonProcessingException {\n ObjectMapper mapper = new ObjectMapper();\n String data = \"\";\n data += previousHash +\n Long.toString(timeStamp) +\n Integer.toString(nonce) +\n merkleRoot;\n\n data += \"\\\"transactions\\\":\";\n data += mapper.writeValueAsString(transactions);\n return Hashing.applySha256(data);\n }" ]
[ "0.56823087", "0.5585547", "0.5366651", "0.5366651", "0.527835", "0.52335817", "0.5175835", "0.5128044", "0.49907577", "0.48962", "0.48945922", "0.48544663", "0.47603375", "0.47472602", "0.47469157", "0.47395593", "0.4714977", "0.46574616", "0.46574616", "0.46296763", "0.46175256", "0.4593789", "0.45828572", "0.45652243", "0.45584354", "0.45544186", "0.44741532", "0.4453338", "0.4453338", "0.44415557", "0.4432898", "0.4432898", "0.44234398", "0.43953344", "0.43802655", "0.4378305", "0.4374764", "0.43569598", "0.4354482", "0.43521374", "0.43515795", "0.43455452", "0.4343378", "0.43433312", "0.4332357", "0.43302667", "0.43214312", "0.4320078", "0.4319453", "0.4311626", "0.43083856", "0.43075815", "0.4298448", "0.42957938", "0.4288048", "0.42751005", "0.4274623", "0.42717117", "0.42636377", "0.42502236", "0.42324916", "0.4232393", "0.42299506", "0.42149886", "0.42149854", "0.42002007", "0.41989905", "0.41987607", "0.4198449", "0.41904616", "0.41855526", "0.41843963", "0.41759697", "0.417009", "0.4167316", "0.4163253", "0.41606182", "0.4156164", "0.41456497", "0.41403422", "0.41343358", "0.41343358", "0.41278374", "0.41152886", "0.4113023", "0.41074398", "0.40989944", "0.40958735", "0.40955532", "0.40898183", "0.40874076", "0.40864247", "0.40853915", "0.4082898", "0.40781707", "0.40780815", "0.40775415", "0.40763876", "0.40733954", "0.40711084" ]
0.656124
0
TODO Autogenerated method stub
@SuppressWarnings("deprecation") @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder; if (convertView == null) { viewHolder = new ViewHolder(); convertView = inflater.inflate(R.layout.face, null, false); viewHolder.faceIV = (ImageView) convertView .findViewById(R.id.face_iv); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } if (position == setting.FACES_EACH_PAGE) { viewHolder.faceIV.setImageResource(R.drawable.emotion_del_selector); viewHolder.faceIV.setBackgroundDrawable(null); } else { int count = setting.FACES_EACH_PAGE * currentPage + position; if (count < 107) { viewHolder.faceIV.setImageResource(faceList.get(count)); } else { viewHolder.faceIV.setImageDrawable(null); } } return convertView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel6 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); txtInput = new javax.swing.JTextField(); txtStartState = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); txtStartHead = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); txtStates = new javax.swing.JTextArea(); jLabel7 = new javax.swing.JLabel(); btnOk = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel6.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel6.setText("StartHead"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(0, 153, 255)); txtInput.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N txtInput.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtInputActionPerformed(evt); } }); txtStartState.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel2.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel2.setText("Entrada"); txtStartHead.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel4.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel4.setText("Estado Inicial"); jLabel5.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel5.setText("Estados e Transiçoes"); txtStates.setColumns(20); txtStates.setFont(new java.awt.Font("Monospaced", 0, 20)); // NOI18N txtStates.setRows(5); jScrollPane1.setViewportView(txtStates); jLabel7.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel7.setText("Posição da Cabeça"); btnOk.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N btnOk.setText("Ok!"); btnOk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnOkActionPerformed(evt); } }); jLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel1MouseClicked(evt); } }); jLabel8.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel8MouseClicked(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 800, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnOk, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(txtStartHead, javax.swing.GroupLayout.PREFERRED_SIZE, 800, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtStartState) .addComponent(txtInput, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(25, 25, 25)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(838, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(151, 151, 151))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtInput, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtStartState, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtStartHead, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnOk, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 459, Short.MAX_VALUE)) .addGap(31, 31, 31)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(508, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(89, 89, 89))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public intrebarea() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public vpemesanan1() {\n initComponents();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public CovidGUI(){\n initComponents();\n }" ]
[ "0.73197734", "0.72908777", "0.72908777", "0.72908777", "0.72870827", "0.7248368", "0.7213462", "0.7208004", "0.7195763", "0.7189973", "0.7184436", "0.7159332", "0.71478266", "0.709268", "0.7080727", "0.7057287", "0.6986775", "0.6977119", "0.69554067", "0.69548035", "0.6945748", "0.69436246", "0.6936225", "0.69309264", "0.6927764", "0.6925464", "0.69240505", "0.6911828", "0.69114214", "0.6893614", "0.68917346", "0.6891525", "0.6891501", "0.6889125", "0.68829834", "0.6882533", "0.68808794", "0.687905", "0.687687", "0.68740726", "0.68708014", "0.68595254", "0.68561274", "0.68560076", "0.6854643", "0.6854604", "0.6853724", "0.685311", "0.685311", "0.6844816", "0.6836794", "0.6835743", "0.68294543", "0.6828841", "0.682637", "0.68245006", "0.6823792", "0.68175477", "0.6817179", "0.6811031", "0.68096155", "0.6809008", "0.68087083", "0.68081945", "0.6801884", "0.6795609", "0.6793828", "0.67930275", "0.67915165", "0.6789997", "0.6788734", "0.6788487", "0.67816335", "0.67663425", "0.6765744", "0.67648494", "0.6757314", "0.6755897", "0.67526966", "0.6750367", "0.67429197", "0.67399955", "0.6736908", "0.6736084", "0.6734342", "0.6726562", "0.67264515", "0.67205596", "0.6716381", "0.67154187", "0.67150515", "0.6709329", "0.6708348", "0.67050624", "0.67021835", "0.6700595", "0.6699073", "0.6698866", "0.66942847", "0.6690904", "0.66897583" ]
0.0
-1
Method was not decompiled
private final zzgy zzgb() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void method_2241() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2145() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void method_2046() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2247() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_2537() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_2537() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_1148() {\r\n // $FF: Couldn't be decompiled\r\n }", "private void method_7083() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_2226() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void method_2139() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void method_2113() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_6338() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void method_7081() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void method_2250() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_7086() {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_28() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2141() {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2045(class_1045 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "public void method_2197() {\r\n // $FF: Couldn't be decompiled\r\n }", "private void method_7082(class_1293 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "protected void method_2246(class_1045 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "static void method_461() {\r\n // $FF: Couldn't be decompiled\r\n }", "public int method_7084(String param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "public boolean method_2088(class_689 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "private boolean method_2253(class_1033 param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "private static class_1205 method_6442(String param0, int param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "public void method_2116(class_689 param1, boolean param2) {\r\n // $FF: Couldn't be decompiled\r\n }", "public java.lang.Object run() throws java.lang.Exception {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: javax.crypto.JarVerifier.1.run():java.lang.Object, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: javax.crypto.JarVerifier.1.run():java.lang.Object\");\n }", "public void method_7080(String param1, class_1293 param2) {\r\n // $FF: Couldn't be decompiled\r\n }", "public class_1293 method_7079(Class param1, String param2) {\r\n // $FF: Couldn't be decompiled\r\n }", "public boolean method_2243() {\r\n // $FF: Couldn't be decompiled\r\n }", "public void run() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.3.run():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.3.run():void\");\n }", "public void run() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.2.run():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.2.run():void\");\n }", "public void method_2249(boolean param1, class_81 param2) {\r\n // $FF: Couldn't be decompiled\r\n }", "AnonymousClass1(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public /* bridge */ /* synthetic */ java.lang.Object run() throws java.lang.Exception {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.Signer.1.run():java.lang.Object, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.Signer.1.run():java.lang.Object\");\n }", "public boolean method_2153(boolean param1) {\r\n // $FF: Couldn't be decompiled\r\n }", "AnonymousClass2(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.2.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.2.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "AnonymousClass3(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.3.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.3.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "static void m13383b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x000a }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x000a }\n r2 = 0;\t Catch:{ Exception -> 0x000a }\n r0.delete(r1, r2, r2);\t Catch:{ Exception -> 0x000a }\n L_0x000a:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.b():void\");\n }", "AnonymousClass1(android.telecom.ConnectionServiceAdapterServant r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: android.telecom.ConnectionServiceAdapterServant.1.<init>(android.telecom.ConnectionServiceAdapterServant):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.1.<init>(android.telecom.ConnectionServiceAdapterServant):void\");\n }", "@Override\n public final void run() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 1: monitorenter \n // 2: ldc \"-\"\n // 4: putstatic ao.j:Ljava/lang/String;\n // 7: aconst_null \n // 8: astore 9\n // 10: aconst_null \n // 11: astore 13\n // 13: aconst_null \n // 14: astore 12\n // 16: aconst_null \n // 17: astore 14\n // 19: aconst_null \n // 20: astore 15\n // 22: aconst_null \n // 23: astore 11\n // 25: aload_0 \n // 26: getfield ao.g:Z\n // 29: istore 8\n // 31: iload 8\n // 33: ifeq 70\n // 36: aload_0 \n // 37: invokespecial ao.b:()V\n // 40: aconst_null \n // 41: invokestatic cg.Code:(Ljava/io/OutputStream;)V\n // 44: aconst_null \n // 45: invokestatic cg.Code:(Ljava/io/InputStream;)V\n // 48: aload_0 \n // 49: invokespecial ao.f:()V\n // 52: aload_0 \n // 53: getfield ao.e:Z\n // 56: ifne 63\n // 59: aload_0 \n // 60: invokevirtual ao.J:()V\n // 63: aload_0 \n // 64: invokespecial ao.C:()V\n // 67: aload_0 \n // 68: monitorexit \n // 69: return \n // 70: aload_0 \n // 71: iconst_0 \n // 72: putfield ao.h:Z\n // 75: aload_0 \n // 76: iconst_1 \n // 77: putfield ao.e:Z\n // 80: getstatic u.c:Lap;\n // 83: aload_0 \n // 84: getfield ao.J:Ljava/lang/String;\n // 87: iconst_1 \n // 88: iconst_3 \n // 89: invokevirtual ap.Code:(Ljava/lang/String;ZI)Lar;\n // 92: astore 10\n // 94: aload 10\n // 96: astore 9\n // 98: aload_0 \n // 99: aload 9\n // 101: invokeinterface ar.I:()Ljava/lang/String;\n // 106: putfield ao.J:Ljava/lang/String;\n // 109: iconst_0 \n // 110: istore_3 \n // 111: aload_0 \n // 112: iconst_0 \n // 113: putfield ao.d:I\n // 116: aload_0 \n // 117: getfield ao.b:I\n // 120: iconst_4 \n // 121: if_icmpne 142\n // 124: aload 9\n // 126: invokeinterface ar.Z:()J\n // 131: l2i \n // 132: istore_3 \n // 133: aload_0 \n // 134: iload_3 \n // 135: putfield ao.d:I\n // 138: aload_0 \n // 139: invokespecial ao.b:()V\n // 142: aload 9\n // 144: iload_3 \n // 145: i2l \n // 146: invokeinterface ar.Code:(J)Ljava/io/OutputStream;\n // 151: astore 10\n // 153: aload 10\n // 155: astore 11\n // 157: aload 14\n // 159: astore 13\n // 161: aload 15\n // 163: astore 12\n // 165: aload_0 \n // 166: iconst_4 \n // 167: putfield ao.b:I\n // 170: aload 14\n // 172: astore 13\n // 174: aload 15\n // 176: astore 12\n // 178: aload_0 \n // 179: invokespecial ao.b:()V\n // 182: iconst_m1 \n // 183: istore_2 \n // 184: iconst_0 \n // 185: istore 4\n // 187: iconst_1 \n // 188: istore 7\n // 190: iconst_1 \n // 191: istore 6\n // 193: iconst_1 \n // 194: istore 5\n // 196: aload 14\n // 198: astore 13\n // 200: aload 15\n // 202: astore 12\n // 204: aload_0 \n // 205: getfield ao.h:Z\n // 208: ifne 1380\n // 211: aload 14\n // 213: astore 13\n // 215: aload 15\n // 217: astore 12\n // 219: aload_0 \n // 220: invokespecial ao.f:()V\n // 223: aload 14\n // 225: astore 13\n // 227: aload 15\n // 229: astore 12\n // 231: aload_0 \n // 232: getfield ao.f:Z\n // 235: ifeq 560\n // 238: aload 14\n // 240: astore 13\n // 242: aload 15\n // 244: astore 12\n // 246: ldc \"NB\"\n // 248: putstatic ao.j:Ljava/lang/String;\n // 251: aload 14\n // 253: astore 13\n // 255: aload 15\n // 257: astore 12\n // 259: getstatic u.Code:Lbn;\n // 262: astore 16\n // 264: aload 14\n // 266: astore 13\n // 268: aload 15\n // 270: astore 12\n // 272: aload_0 \n // 273: getfield ao.Code:Ljava/lang/String;\n // 276: aload_0 \n // 277: getfield ao.Code:Ljava/lang/String;\n // 280: iconst_0 \n // 281: invokestatic cg.Code:(Ljava/lang/String;Z)Ljava/lang/String;\n // 284: invokevirtual java/lang/String.equals:(Ljava/lang/Object;)Z\n // 287: ifeq 543\n // 290: aload 14\n // 292: astore 13\n // 294: aload 15\n // 296: astore 12\n // 298: aload_0 \n // 299: getfield ao.Code:Ljava/lang/String;\n // 302: iconst_1 \n // 303: invokestatic cg.Code:(Ljava/lang/String;Z)Ljava/lang/String;\n // 306: astore 10\n // 308: aload 14\n // 310: astore 13\n // 312: aload 15\n // 314: astore 12\n // 316: aload_0 \n // 317: aload 16\n // 319: aload 10\n // 321: aconst_null \n // 322: ldc \"GET\"\n // 324: invokeinterface bn.Code:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lah;\n // 329: putfield ao.a:Lah;\n // 332: iload_3 \n // 333: ifle 376\n // 336: aload 14\n // 338: astore 13\n // 340: aload 15\n // 342: astore 12\n // 344: aload_0 \n // 345: getfield ao.a:Lah;\n // 348: ldc \"Range\"\n // 350: new Ljava/lang/StringBuilder;\n // 353: dup \n // 354: ldc \"bytes=\"\n // 356: invokespecial java/lang/StringBuilder.<init>:(Ljava/lang/String;)V\n // 359: iload_3 \n // 360: invokevirtual java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;\n // 363: ldc \"-\"\n // 365: invokevirtual java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;\n // 368: invokevirtual java/lang/StringBuilder.toString:()Ljava/lang/String;\n // 371: invokeinterface ah.Code:(Ljava/lang/String;Ljava/lang/String;)V\n // 376: aload 14\n // 378: astore 13\n // 380: aload 15\n // 382: astore 12\n // 384: aload_0 \n // 385: getfield ao.a:Lah;\n // 388: invokeinterface ah.J:()I\n // 393: istore 4\n // 395: iload_3 \n // 396: ifne 1420\n // 399: sipush 200\n // 402: istore_1 \n // 403: goto 1394\n // 406: aload 14\n // 408: astore 13\n // 410: aload 15\n // 412: astore 12\n // 414: aload_0 \n // 415: getfield ao.a:Lah;\n // 418: invokeinterface ah.Z:()Ljava/io/DataInputStream;\n // 423: astore 10\n // 425: aload 10\n // 427: astore 13\n // 429: aload 10\n // 431: astore 12\n // 433: aload_0 \n // 434: getfield ao.a:Lah;\n // 437: invokeinterface ah.B:()J\n // 442: lconst_0 \n // 443: lcmp \n // 444: iflt 1405\n // 447: aload 10\n // 449: astore 13\n // 451: aload 10\n // 453: astore 12\n // 455: aload_0 \n // 456: getfield ao.a:Lah;\n // 459: invokeinterface ah.B:()J\n // 464: l2i \n // 465: iload_3 \n // 466: iadd \n // 467: istore_2 \n // 468: goto 1405\n // 471: iload 4\n // 473: ifeq 765\n // 476: aload 10\n // 478: astore 13\n // 480: aload 10\n // 482: astore 12\n // 484: aload_0 \n // 485: invokespecial ao.d:()V\n // 488: aload_0 \n // 489: invokespecial ao.b:()V\n // 492: aload 11\n // 494: invokestatic cg.Code:(Ljava/io/OutputStream;)V\n // 497: aload 10\n // 499: invokestatic cg.Code:(Ljava/io/InputStream;)V\n // 502: aload 9\n // 504: ifnull 514\n // 507: aload 9\n // 509: invokeinterface ar.C:()V\n // 514: aload_0 \n // 515: invokespecial ao.f:()V\n // 518: aload_0 \n // 519: getfield ao.e:Z\n // 522: ifne 529\n // 525: aload_0 \n // 526: invokevirtual ao.J:()V\n // 529: aload_0 \n // 530: invokespecial ao.C:()V\n // 533: goto 67\n // 536: astore 9\n // 538: aload_0 \n // 539: monitorexit \n // 540: aload 9\n // 542: athrow \n // 543: aload 14\n // 545: astore 13\n // 547: aload 15\n // 549: astore 12\n // 551: aload_0 \n // 552: getfield ao.Code:Ljava/lang/String;\n // 555: astore 10\n // 557: goto 308\n // 560: aload 14\n // 562: astore 13\n // 564: aload 15\n // 566: astore 12\n // 568: bipush 127\n // 570: anewarray Ljava/lang/Object;\n // 573: astore 10\n // 575: aload 14\n // 577: astore 13\n // 579: aload 15\n // 581: astore 12\n // 583: bipush 127\n // 585: newarray I\n // 587: astore 16\n // 589: aload 16\n // 591: bipush 29\n // 593: iconst_2 \n // 594: iastore \n // 595: aload 16\n // 597: bipush 37\n // 599: iload_3 \n // 600: iastore \n // 601: aload 16\n // 603: bipush 43\n // 605: aload 16\n // 607: bipush 43\n // 609: iaload \n // 610: ldc 16777216\n // 612: ior \n // 613: iastore \n // 614: aload 14\n // 616: astore 13\n // 618: aload 15\n // 620: astore 12\n // 622: aload 10\n // 624: bipush 53\n // 626: aload_0 \n // 627: getfield ao.Code:Ljava/lang/String;\n // 630: aastore \n // 631: aload 14\n // 633: astore 13\n // 635: aload 15\n // 637: astore 12\n // 639: invokestatic cg.J:()V\n // 642: aload 14\n // 644: astore 13\n // 646: aload 15\n // 648: astore 12\n // 650: aload_0 \n // 651: aload 10\n // 653: aload 16\n // 655: aload_0 \n // 656: getfield ao.I:Ljava/lang/String;\n // 659: aconst_null \n // 660: invokestatic ce.Code:(Ljava/lang/String;Ljava/lang/String;)I\n // 663: iconst_1 \n // 664: invokestatic bx.Code:([Ljava/lang/Object;[IIZ)Lby;\n // 667: putfield ao.C:Lby;\n // 670: aload 14\n // 672: astore 13\n // 674: aload 15\n // 676: astore 12\n // 678: new Ljava/io/DataInputStream;\n // 681: dup \n // 682: aload_0 \n // 683: getfield ao.C:Lby;\n // 686: invokespecial java/io/DataInputStream.<init>:(Ljava/io/InputStream;)V\n // 689: astore 10\n // 691: aload_0 \n // 692: aload 10\n // 694: invokespecial ao.Code:(Ljava/io/DataInputStream;)I\n // 697: istore_3 \n // 698: iload_3 \n // 699: ifgt 1372\n // 702: iload_3 \n // 703: invokestatic ao.I:(I)Z\n // 706: ifeq 1471\n // 709: ldc 16777216\n // 711: iload_3 \n // 712: iand \n // 713: ifne 1432\n // 716: ldc_w 1073741824\n // 719: iload_3 \n // 720: iand \n // 721: ifne 1450\n // 724: goto 1432\n // 727: aload 12\n // 729: putstatic ao.j:Ljava/lang/String;\n // 732: iload 4\n // 734: istore 5\n // 736: iload_1 \n // 737: istore 4\n // 739: iload 5\n // 741: istore_1 \n // 742: goto 471\n // 745: aload_0 \n // 746: aload 10\n // 748: invokespecial ao.Code:(Ljava/io/DataInputStream;)I\n // 751: istore_3 \n // 752: iconst_0 \n // 753: istore_1 \n // 754: goto 1437\n // 757: ldc_w \"B\"\n // 760: astore 12\n // 762: goto 727\n // 765: iload_1 \n // 766: istore 4\n // 768: iload_3 \n // 769: istore_1 \n // 770: iload 4\n // 772: ifne 795\n // 775: aload_0 \n // 776: getfield ao.c:I\n // 779: iconst_m1 \n // 780: if_icmpeq 912\n // 783: iload_1 \n // 784: aload_0 \n // 785: getfield ao.c:I\n // 788: if_icmpeq 912\n // 791: aload_0 \n // 792: invokespecial ao.d:()V\n // 795: getstatic cg.A:I\n // 798: newarray B\n // 800: astore 12\n // 802: aload_0 \n // 803: invokespecial ao.b:()V\n // 806: aload_0 \n // 807: getfield ao.h:Z\n // 810: ifne 859\n // 813: iload_1 \n // 814: istore_3 \n // 815: iload_1 \n // 816: ifeq 1485\n // 819: iload_1 \n // 820: iconst_m1 \n // 821: if_icmpne 1051\n // 824: sipush 512\n // 827: istore_3 \n // 828: aload 10\n // 830: aload 12\n // 832: iconst_0 \n // 833: iload_3 \n // 834: invokevirtual java/io/DataInputStream.read:([BII)I\n // 837: istore_3 \n // 838: iload_3 \n // 839: iconst_m1 \n // 840: if_icmpne 1062\n // 843: aload_0 \n // 844: getfield ao.c:I\n // 847: iconst_m1 \n // 848: if_icmpne 859\n // 851: aload_0 \n // 852: aload_0 \n // 853: getfield ao.d:I\n // 856: putfield ao.c:I\n // 859: aload 11\n // 861: invokevirtual java/io/OutputStream.flush:()V\n // 864: aload_0 \n // 865: invokespecial ao.b:()V\n // 868: aload 11\n // 870: invokestatic cg.Code:(Ljava/io/OutputStream;)V\n // 873: aload 10\n // 875: invokestatic cg.Code:(Ljava/io/InputStream;)V\n // 878: aload 9\n // 880: ifnull 890\n // 883: aload 9\n // 885: invokeinterface ar.C:()V\n // 890: aload_0 \n // 891: invokespecial ao.f:()V\n // 894: aload_0 \n // 895: getfield ao.e:Z\n // 898: ifne 905\n // 901: aload_0 \n // 902: invokevirtual ao.J:()V\n // 905: aload_0 \n // 906: invokespecial ao.C:()V\n // 909: goto 67\n // 912: aload_0 \n // 913: iload_1 \n // 914: putfield ao.c:I\n // 917: goto 795\n // 920: astore 13\n // 922: aload 11\n // 924: astore 12\n // 926: aload 10\n // 928: astore 11\n // 930: aload 13\n // 932: astore 10\n // 934: aload_0 \n // 935: getfield ao.b:I\n // 938: iconst_1 \n // 939: if_icmpeq 1003\n // 942: aload_0 \n // 943: getfield ao.b:I\n // 946: iconst_2 \n // 947: if_icmpeq 1003\n // 950: aload_0 \n // 951: getfield ao.h:Z\n // 954: ifne 1003\n // 957: aload_0 \n // 958: getfield ao.d:I\n // 961: aload_0 \n // 962: getfield ao.c:I\n // 965: if_icmplt 976\n // 968: aload_0 \n // 969: getfield ao.c:I\n // 972: iconst_m1 \n // 973: if_icmpne 1003\n // 976: aload 10\n // 978: instanceof Ljava/io/IOException;\n // 981: ifeq 1239\n // 984: getstatic u.Code:Lbn;\n // 987: invokeinterface bn.ap:()Z\n // 992: ifeq 1239\n // 995: aload_0 \n // 996: invokespecial ao.c:()V\n // 999: aload_0 \n // 1000: invokespecial ao.b:()V\n // 1003: aload_0 \n // 1004: invokespecial ao.b:()V\n // 1007: aload 12\n // 1009: invokestatic cg.Code:(Ljava/io/OutputStream;)V\n // 1012: aload 11\n // 1014: invokestatic cg.Code:(Ljava/io/InputStream;)V\n // 1017: aload 9\n // 1019: ifnull 1029\n // 1022: aload 9\n // 1024: invokeinterface ar.C:()V\n // 1029: aload_0 \n // 1030: invokespecial ao.f:()V\n // 1033: aload_0 \n // 1034: getfield ao.e:Z\n // 1037: ifne 1044\n // 1040: aload_0 \n // 1041: invokevirtual ao.J:()V\n // 1044: aload_0 \n // 1045: invokespecial ao.C:()V\n // 1048: goto 67\n // 1051: iload_1 \n // 1052: sipush 512\n // 1055: invokestatic java/lang/Math.min:(II)I\n // 1058: istore_3 \n // 1059: goto 828\n // 1062: aload 11\n // 1064: aload 12\n // 1066: iconst_0 \n // 1067: iload_3 \n // 1068: invokevirtual java/io/OutputStream.write:([BII)V\n // 1071: aload_0 \n // 1072: aload_0 \n // 1073: getfield ao.d:I\n // 1076: iload_3 \n // 1077: iadd \n // 1078: putfield ao.d:I\n // 1081: iload_1 \n // 1082: ifle 1369\n // 1085: iload_1 \n // 1086: iload_3 \n // 1087: isub \n // 1088: istore_1 \n // 1089: lconst_0 \n // 1090: iload_3 \n // 1091: i2l \n // 1092: iload_3 \n // 1093: i2l \n // 1094: invokestatic cg.Code:(JJJ)V\n // 1097: iload 4\n // 1099: ifne 1483\n // 1102: aload_0 \n // 1103: getfield ao.d:I\n // 1106: aload_0 \n // 1107: getfield ao.c:I\n // 1110: if_icmpeq 859\n // 1113: goto 1483\n // 1116: aload_0 \n // 1117: aload_0 \n // 1118: getfield ao.d:I\n // 1121: putfield ao.c:I\n // 1124: goto 859\n // 1127: astore 13\n // 1129: aload 10\n // 1131: astore 12\n // 1133: aload 13\n // 1135: astore 10\n // 1137: aload_0 \n // 1138: invokespecial ao.b:()V\n // 1141: aload 11\n // 1143: invokestatic cg.Code:(Ljava/io/OutputStream;)V\n // 1146: aload 12\n // 1148: invokestatic cg.Code:(Ljava/io/InputStream;)V\n // 1151: aload 9\n // 1153: ifnull 1163\n // 1156: aload 9\n // 1158: invokeinterface ar.C:()V\n // 1163: aload_0 \n // 1164: invokespecial ao.f:()V\n // 1167: aload_0 \n // 1168: getfield ao.e:Z\n // 1171: ifne 1178\n // 1174: aload_0 \n // 1175: invokevirtual ao.J:()V\n // 1178: aload_0 \n // 1179: invokespecial ao.C:()V\n // 1182: aload 10\n // 1184: athrow \n // 1185: aload_0 \n // 1186: aload 10\n // 1188: invokespecial ao.Code:(Ljava/io/DataInputStream;)I\n // 1191: istore_1 \n // 1192: iload_1 \n // 1193: invokestatic ao.I:(I)Z\n // 1196: ifeq 1214\n // 1199: ldc_w 536870912\n // 1202: iload_1 \n // 1203: iand \n // 1204: ifeq 1214\n // 1207: ldc 16777216\n // 1209: iload_1 \n // 1210: iand \n // 1211: ifeq 1501\n // 1214: aload_0 \n // 1215: invokespecial ao.d:()V\n // 1218: goto 859\n // 1221: aload_0 \n // 1222: aload 10\n // 1224: invokespecial ao.Code:(Ljava/io/DataInputStream;)I\n // 1227: istore_1 \n // 1228: invokestatic java/lang/Thread.yield:()V\n // 1231: goto 806\n // 1234: iconst_0 \n // 1235: istore_2 \n // 1236: goto 1221\n // 1239: aload_0 \n // 1240: invokevirtual ao.Z:()V\n // 1243: goto 1003\n // 1246: astore 10\n // 1248: aload 12\n // 1250: astore 13\n // 1252: aload 11\n // 1254: astore 12\n // 1256: aload 13\n // 1258: astore 11\n // 1260: goto 1137\n // 1263: astore 10\n // 1265: aconst_null \n // 1266: astore 11\n // 1268: aconst_null \n // 1269: astore 9\n // 1271: goto 1137\n // 1274: astore 10\n // 1276: aconst_null \n // 1277: astore 11\n // 1279: goto 1137\n // 1282: astore 10\n // 1284: aload 13\n // 1286: astore 12\n // 1288: goto 1137\n // 1291: astore 13\n // 1293: aload 10\n // 1295: astore 12\n // 1297: aload 13\n // 1299: astore 10\n // 1301: goto 1137\n // 1304: astore 10\n // 1306: aload 13\n // 1308: astore 12\n // 1310: goto 934\n // 1313: astore 10\n // 1315: aload 13\n // 1317: astore 12\n // 1319: goto 934\n // 1322: astore 10\n // 1324: aload 11\n // 1326: astore 13\n // 1328: aload 12\n // 1330: astore 11\n // 1332: aload 13\n // 1334: astore 12\n // 1336: goto 934\n // 1339: astore 14\n // 1341: aload 10\n // 1343: astore 12\n // 1345: aload 11\n // 1347: astore 13\n // 1349: aload 14\n // 1351: astore 10\n // 1353: aload 12\n // 1355: astore 11\n // 1357: aload 13\n // 1359: astore 12\n // 1361: goto 934\n // 1364: iload_3 \n // 1365: istore_1 \n // 1366: goto 1228\n // 1369: goto 1089\n // 1372: iconst_0 \n // 1373: istore_1 \n // 1374: iload 6\n // 1376: istore_2 \n // 1377: goto 1437\n // 1380: iconst_0 \n // 1381: istore 4\n // 1383: aconst_null \n // 1384: astore 10\n // 1386: iload_2 \n // 1387: istore_1 \n // 1388: iload 7\n // 1390: istore_2 \n // 1391: goto 770\n // 1394: iload 4\n // 1396: iload_1 \n // 1397: if_icmpeq 1427\n // 1400: iconst_1 \n // 1401: istore_1 \n // 1402: goto 406\n // 1405: iconst_0 \n // 1406: istore_3 \n // 1407: iload_1 \n // 1408: istore 4\n // 1410: iload_3 \n // 1411: istore_1 \n // 1412: iload_2 \n // 1413: istore_3 \n // 1414: iload 5\n // 1416: istore_2 \n // 1417: goto 471\n // 1420: sipush 206\n // 1423: istore_1 \n // 1424: goto 1394\n // 1427: iconst_0 \n // 1428: istore_1 \n // 1429: goto 406\n // 1432: iconst_1 \n // 1433: istore_1 \n // 1434: iload 6\n // 1436: istore_2 \n // 1437: iload 4\n // 1439: ifeq 757\n // 1442: ldc_w \"BS\"\n // 1445: astore 12\n // 1447: goto 727\n // 1450: iconst_1 \n // 1451: istore 4\n // 1453: ldc_w 268435456\n // 1456: iload_3 \n // 1457: iand \n // 1458: ifeq 1466\n // 1461: iconst_1 \n // 1462: istore_2 \n // 1463: goto 745\n // 1466: iconst_0 \n // 1467: istore_2 \n // 1468: goto 745\n // 1471: iload_3 \n // 1472: ifge 1372\n // 1475: iconst_1 \n // 1476: istore_1 \n // 1477: iload 6\n // 1479: istore_2 \n // 1480: goto 1437\n // 1483: iload_1 \n // 1484: istore_3 \n // 1485: iload_3 \n // 1486: ifne 1364\n // 1489: iload_2 \n // 1490: ifne 1116\n // 1493: iload 4\n // 1495: ifne 1185\n // 1498: goto 1116\n // 1501: iload_1 \n // 1502: ldc_w 268435456\n // 1505: iand \n // 1506: ifeq 1234\n // 1509: iconst_1 \n // 1510: istore_2 \n // 1511: goto 1221\n // Exceptions:\n // Try Handler\n // Start End Start End Type \n // ----- ----- ----- ----- ---------------------\n // 2 7 536 543 Any\n // 25 31 1304 1313 Ljava/lang/Throwable;\n // 25 31 1263 1274 Any\n // 36 63 536 543 Any\n // 63 67 536 543 Any\n // 70 94 1304 1313 Ljava/lang/Throwable;\n // 70 94 1263 1274 Any\n // 98 109 1313 1322 Ljava/lang/Throwable;\n // 98 109 1274 1282 Any\n // 111 116 1313 1322 Ljava/lang/Throwable;\n // 111 116 1274 1282 Any\n // 116 142 1313 1322 Ljava/lang/Throwable;\n // 116 142 1274 1282 Any\n // 142 153 1313 1322 Ljava/lang/Throwable;\n // 142 153 1274 1282 Any\n // 165 170 1322 1339 Ljava/lang/Throwable;\n // 165 170 1282 1291 Any\n // 178 182 1322 1339 Ljava/lang/Throwable;\n // 178 182 1282 1291 Any\n // 204 211 1322 1339 Ljava/lang/Throwable;\n // 204 211 1282 1291 Any\n // 219 223 1322 1339 Ljava/lang/Throwable;\n // 219 223 1282 1291 Any\n // 231 238 1322 1339 Ljava/lang/Throwable;\n // 231 238 1282 1291 Any\n // 246 251 1322 1339 Ljava/lang/Throwable;\n // 246 251 1282 1291 Any\n // 259 264 1322 1339 Ljava/lang/Throwable;\n // 259 264 1282 1291 Any\n // 272 290 1322 1339 Ljava/lang/Throwable;\n // 272 290 1282 1291 Any\n // 298 308 1322 1339 Ljava/lang/Throwable;\n // 298 308 1282 1291 Any\n // 316 332 1322 1339 Ljava/lang/Throwable;\n // 316 332 1282 1291 Any\n // 344 376 1322 1339 Ljava/lang/Throwable;\n // 344 376 1282 1291 Any\n // 384 395 1322 1339 Ljava/lang/Throwable;\n // 384 395 1282 1291 Any\n // 414 425 1322 1339 Ljava/lang/Throwable;\n // 414 425 1282 1291 Any\n // 433 447 1322 1339 Ljava/lang/Throwable;\n // 433 447 1282 1291 Any\n // 455 468 1322 1339 Ljava/lang/Throwable;\n // 455 468 1282 1291 Any\n // 484 488 1322 1339 Ljava/lang/Throwable;\n // 484 488 1282 1291 Any\n // 488 502 536 543 Any\n // 507 514 536 543 Any\n // 514 529 536 543 Any\n // 529 533 536 543 Any\n // 551 557 1322 1339 Ljava/lang/Throwable;\n // 551 557 1282 1291 Any\n // 568 575 1322 1339 Ljava/lang/Throwable;\n // 568 575 1282 1291 Any\n // 583 589 1322 1339 Ljava/lang/Throwable;\n // 583 589 1282 1291 Any\n // 622 631 1322 1339 Ljava/lang/Throwable;\n // 622 631 1282 1291 Any\n // 639 642 1322 1339 Ljava/lang/Throwable;\n // 639 642 1282 1291 Any\n // 650 670 1322 1339 Ljava/lang/Throwable;\n // 650 670 1282 1291 Any\n // 678 691 1322 1339 Ljava/lang/Throwable;\n // 678 691 1282 1291 Any\n // 691 698 1339 1364 Ljava/lang/Throwable;\n // 691 698 1291 1304 Any\n // 702 709 1339 1364 Ljava/lang/Throwable;\n // 702 709 1291 1304 Any\n // 727 732 1339 1364 Ljava/lang/Throwable;\n // 727 732 1291 1304 Any\n // 745 752 1339 1364 Ljava/lang/Throwable;\n // 745 752 1291 1304 Any\n // 775 795 920 934 Ljava/lang/Throwable;\n // 775 795 1127 1137 Any\n // 795 806 920 934 Ljava/lang/Throwable;\n // 795 806 1127 1137 Any\n // 806 813 920 934 Ljava/lang/Throwable;\n // 806 813 1127 1137 Any\n // 828 838 920 934 Ljava/lang/Throwable;\n // 828 838 1127 1137 Any\n // 843 859 920 934 Ljava/lang/Throwable;\n // 843 859 1127 1137 Any\n // 859 864 920 934 Ljava/lang/Throwable;\n // 859 864 1127 1137 Any\n // 864 878 536 543 Any\n // 883 890 536 543 Any\n // 890 905 536 543 Any\n // 905 909 536 543 Any\n // 912 917 920 934 Ljava/lang/Throwable;\n // 912 917 1127 1137 Any\n // 934 976 1246 1263 Any\n // 976 1003 1246 1263 Any\n // 1003 1017 536 543 Any\n // 1022 1029 536 543 Any\n // 1029 1044 536 543 Any\n // 1044 1048 536 543 Any\n // 1051 1059 920 934 Ljava/lang/Throwable;\n // 1051 1059 1127 1137 Any\n // 1062 1081 920 934 Ljava/lang/Throwable;\n // 1062 1081 1127 1137 Any\n // 1089 1097 920 934 Ljava/lang/Throwable;\n // 1089 1097 1127 1137 Any\n // 1102 1113 920 934 Ljava/lang/Throwable;\n // 1102 1113 1127 1137 Any\n // 1116 1124 920 934 Ljava/lang/Throwable;\n // 1116 1124 1127 1137 Any\n // 1137 1151 536 543 Any\n // 1156 1163 536 543 Any\n // 1163 1178 536 543 Any\n // 1178 1185 536 543 Any\n // 1185 1199 920 934 Ljava/lang/Throwable;\n // 1185 1199 1127 1137 Any\n // 1214 1218 920 934 Ljava/lang/Throwable;\n // 1214 1218 1127 1137 Any\n // 1221 1228 920 934 Ljava/lang/Throwable;\n // 1221 1228 1127 1137 Any\n // 1228 1231 920 934 Ljava/lang/Throwable;\n // 1228 1231 1127 1137 Any\n // 1239 1243 1246 1263 Any\n // \n // The error that occurred was:\n // \n // java.lang.IndexOutOfBoundsException: Index: 749, Size: 749\n // at java.util.ArrayList.rangeCheck(ArrayList.java:659)\n // at java.util.ArrayList.get(ArrayList.java:435)\n // at com.strobel.decompiler.ast.AstBuilder.convertToAst(AstBuilder.java:3379)\n // at com.strobel.decompiler.ast.AstBuilder.build(AstBuilder.java:113)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:206)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:94)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:840)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:733)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:610)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:577)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:193)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:160)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:135)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:333)\n // at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:254)\n // at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:144)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "private void m25427g() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = r2.f19111m;\n if (r0 == 0) goto L_0x000f;\n L_0x0004:\n r0 = r2.f19104f;\t Catch:{ Exception -> 0x000f }\n r0 = android.support.v4.content.C0396d.m1465a(r0);\t Catch:{ Exception -> 0x000f }\n r1 = r2.f19111m;\t Catch:{ Exception -> 0x000f }\n r0.m1468a(r1);\t Catch:{ Exception -> 0x000f }\n L_0x000f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.adapters.w.g():void\");\n }", "AnonymousClass1(javax.crypto.JarVerifier r1, java.net.URL r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: javax.crypto.JarVerifier.1.<init>(javax.crypto.JarVerifier, java.net.URL):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: javax.crypto.JarVerifier.1.<init>(javax.crypto.JarVerifier, java.net.URL):void\");\n }", "AnonymousClass1() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: android.telephony.SmsCbCmasInfo.1.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.1.<init>():void\");\n }", "public void method_2112(int param1, int param2, int param3, aji param4, int param5, int param6) {\r\n // $FF: Couldn't be decompiled\r\n }", "AnonymousClass2(android.telecom.ConnectionServiceAdapterServant r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: android.telecom.ConnectionServiceAdapterServant.2.<init>(android.telecom.ConnectionServiceAdapterServant):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.2.<init>(android.telecom.ConnectionServiceAdapterServant):void\");\n }", "static /* synthetic */ void m200-wrap4(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap4(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap4(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "@Override\n public final void run() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 3: invokevirtual cd.I:()V\n // 6: getstatic u.Code:Lbn;\n // 9: invokeinterface bn.p:()Z\n // 14: ifne 43\n // 17: aload_0 \n // 18: monitorenter \n // 19: invokestatic com/opera/mini/android/bf.c:()Z\n // 22: ifne 62\n // 25: aload_0 \n // 26: iconst_0 \n // 27: invokestatic cg.Code:(Ljava/lang/Object;I)V\n // 30: getstatic u.Code:Lbn;\n // 33: invokeinterface bn.p:()Z\n // 38: ifeq 62\n // 41: aload_0 \n // 42: monitorexit \n // 43: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 46: ifnull 55\n // 49: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 52: invokevirtual com/opera/mini/android/k.g:()V\n // 55: invokestatic com/opera/mini/android/bf.B:()Lcd;\n // 58: invokevirtual cd.Z:()V\n // 61: return \n // 62: invokestatic com/opera/mini/android/bf.d:()Z\n // 65: pop \n // 66: invokestatic com/opera/mini/android/bf.e:()I\n // 69: istore_1 \n // 70: invokestatic com/opera/mini/android/bf.f:()I\n // 73: istore_2 \n // 74: invokestatic com/opera/mini/android/bf.g:()I\n // 77: istore_3 \n // 78: invokestatic com/opera/mini/android/bf.h:()I\n // 81: istore 4\n // 83: iconst_0 \n // 84: invokestatic com/opera/mini/android/bf.Code:(I)I\n // 87: pop \n // 88: aload_0 \n // 89: monitorexit \n // 90: aload_0 \n // 91: getfield com/opera/mini/android/bg.Code:Lcom/opera/mini/android/bf;\n // 94: invokevirtual com/opera/mini/android/bf.getWidth:()I\n // 97: istore 5\n // 99: aload_0 \n // 100: getfield com/opera/mini/android/bg.Code:Lcom/opera/mini/android/bf;\n // 103: invokevirtual com/opera/mini/android/bf.getHeight:()I\n // 106: istore 6\n // 108: iload 5\n // 110: ifle 6\n // 113: iload 6\n // 115: ifle 6\n // 118: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 121: ifnull 146\n // 124: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 127: invokevirtual android/graphics/Bitmap.getWidth:()I\n // 130: iload 5\n // 132: if_icmpne 146\n // 135: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 138: invokevirtual android/graphics/Bitmap.getHeight:()I\n // 141: iload 6\n // 143: if_icmpeq 209\n // 146: aconst_null \n // 147: invokestatic com/opera/mini/android/bf.Code:(Lcom/opera/mini/android/k;)Lcom/opera/mini/android/k;\n // 150: pop \n // 151: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 154: ifnull 168\n // 157: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 160: invokevirtual android/graphics/Bitmap.recycle:()V\n // 163: aconst_null \n // 164: invokestatic com/opera/mini/android/bf.Code:(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;\n // 167: pop \n // 168: iload 5\n // 170: iload 6\n // 172: invokestatic com/opera/mini/android/bg.Code:(II)Landroid/graphics/Bitmap;\n // 175: invokestatic com/opera/mini/android/bf.Code:(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;\n // 178: pop \n // 179: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 182: ifnull 55\n // 185: aload_0 \n // 186: monitorenter \n // 187: invokestatic com/opera/mini/android/bf.j:()I\n // 190: pop \n // 191: invokestatic com/opera/mini/android/bf.k:()I\n // 194: pop \n // 195: iload 5\n // 197: invokestatic com/opera/mini/android/bf.Code:(I)I\n // 200: pop \n // 201: iload 6\n // 203: invokestatic com/opera/mini/android/bf.I:(I)I\n // 206: pop \n // 207: aload_0 \n // 208: monitorexit \n // 209: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 212: ifnonnull 242\n // 215: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 218: invokestatic com/opera/mini/android/k.I:(Landroid/graphics/Bitmap;)Lcom/opera/mini/android/k;\n // 221: invokestatic com/opera/mini/android/bf.Code:(Lcom/opera/mini/android/k;)Lcom/opera/mini/android/k;\n // 224: pop \n // 225: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 228: iconst_1 \n // 229: invokevirtual com/opera/mini/android/k.Code:(Z)V\n // 232: aload_0 \n // 233: getfield com/opera/mini/android/bg.Code:Lcom/opera/mini/android/bf;\n // 236: invokestatic com/opera/mini/android/bf.Code:(Lcom/opera/mini/android/bf;)Lcom/opera/mini/android/MiniView;\n // 239: invokevirtual com/opera/mini/android/MiniView.I:()V\n // 242: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 245: invokevirtual com/opera/mini/android/k.a:()Z\n // 248: ifeq 290\n // 251: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 254: iload_1 \n // 255: iload_2 \n // 256: iload_3 \n // 257: iload 4\n // 259: invokevirtual com/opera/mini/android/k.Code:(IIII)V\n // 262: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 265: iload_1 \n // 266: iload_2 \n // 267: iload_3 \n // 268: iload 4\n // 270: ldc 16777215\n // 272: invokevirtual com/opera/mini/android/k.Z:(IIIII)V\n // 275: getstatic com/opera/mini/android/Browser.Code:Lcom/opera/mini/android/a;\n // 278: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 281: invokevirtual com/opera/mini/android/a.Code:(Law;)V\n // 284: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 287: invokevirtual com/opera/mini/android/k.b:()V\n // 290: invokestatic com/opera/mini/android/bf.l:()Lcom/opera/mini/android/k;\n // 293: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 296: invokevirtual com/opera/mini/android/k.Code:(Landroid/graphics/Bitmap;)V\n // 299: aload_0 \n // 300: getfield com/opera/mini/android/bg.Code:Lcom/opera/mini/android/bf;\n // 303: invokestatic com/opera/mini/android/bf.I:(Lcom/opera/mini/android/bf;)Landroid/view/SurfaceHolder;\n // 306: invokeinterface android/view/SurfaceHolder.lockCanvas:()Landroid/graphics/Canvas;\n // 311: astore 7\n // 313: aload 7\n // 315: ifnull 6\n // 318: aload 7\n // 320: invokestatic com/opera/mini/android/bf.i:()Landroid/graphics/Bitmap;\n // 323: fconst_0 \n // 324: fconst_0 \n // 325: aconst_null \n // 326: invokevirtual android/graphics/Canvas.drawBitmap:(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V\n // 329: aload_0 \n // 330: getfield com/opera/mini/android/bg.Code:Lcom/opera/mini/android/bf;\n // 333: invokestatic com/opera/mini/android/bf.I:(Lcom/opera/mini/android/bf;)Landroid/view/SurfaceHolder;\n // 336: aload 7\n // 338: invokeinterface android/view/SurfaceHolder.unlockCanvasAndPost:(Landroid/graphics/Canvas;)V\n // 343: goto 6\n // 346: astore 7\n // 348: invokestatic com/opera/mini/android/bf.B:()Lcd;\n // 351: invokevirtual cd.Z:()V\n // 354: aload 7\n // 356: athrow \n // 357: astore 7\n // 359: aload_0 \n // 360: monitorexit \n // 361: aload 7\n // 363: athrow \n // 364: astore 7\n // 366: aload_0 \n // 367: monitorexit \n // 368: aload 7\n // 370: athrow \n // Exceptions:\n // Try Handler\n // Start End Start End Type\n // ----- ----- ----- ----- ----\n // 6 19 346 357 Any\n // 19 43 357 364 Any\n // 43 55 346 357 Any\n // 62 90 357 364 Any\n // 90 108 346 357 Any\n // 118 146 346 357 Any\n // 146 168 346 357 Any\n // 168 187 346 357 Any\n // 187 209 364 371 Any\n // 209 242 346 357 Any\n // 242 290 346 357 Any\n // 290 313 346 357 Any\n // 318 343 346 357 Any\n // 359 364 346 357 Any\n // 366 371 346 357 Any\n // \n // The error that occurred was:\n // \n // java.lang.IndexOutOfBoundsException: Index: 163, Size: 163\n // at java.util.ArrayList.rangeCheck(ArrayList.java:659)\n // at java.util.ArrayList.get(ArrayList.java:435)\n // at com.strobel.decompiler.ast.AstBuilder.convertToAst(AstBuilder.java:3379)\n // at com.strobel.decompiler.ast.AstBuilder.build(AstBuilder.java:113)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:206)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:94)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:840)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:733)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:610)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:577)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:193)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:160)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:135)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:333)\n // at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:254)\n // at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:144)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "AnonymousClass1() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: android.location.GpsClock.1.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.1.<init>():void\");\n }", "static /* synthetic */ void m201-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public void method_2111(int param1, int param2, int param3, aji param4, int param5, int param6) {\r\n // $FF: Couldn't be decompiled\r\n }", "SmsCbCmasInfo(android.os.Parcel r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.telephony.SmsCbCmasInfo.<init>(android.os.Parcel):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.<init>(android.os.Parcel):void\");\n }", "protected void finalize() throws java.lang.Throwable {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.conscrypt.OpenSSLBIOSource.finalize():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.conscrypt.OpenSSLBIOSource.finalize():void\");\n }", "public final void mo91715d() {\n }", "public List method_2154(class_1069 param1, boolean param2) {\r\n // $FF: Couldn't be decompiled\r\n }", "static /* synthetic */ void m204-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public List method_2245(int param1, int param2, int param3, int param4, int param5, int param6) {\r\n // $FF: Couldn't be decompiled\r\n }", "AnonymousClass1(android.widget.ColorListView r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: android.widget.ColorListView.1.<init>(android.widget.ColorListView):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.widget.ColorListView.1.<init>(android.widget.ColorListView):void\");\n }", "public void method_4270() {}", "public void method_2239(MinecraftServer param1, class_29 param2, String param3, int param4, class_1045 param5, class_1535 param6) {\r\n // $FF: Couldn't be decompiled\r\n }", "public java.lang.Void run() throws java.security.KeyManagementException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: java.security.Signer.1.run():java.lang.Void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.Signer.1.run():java.lang.Void\");\n }", "public final com.google.android.gms.internal.ads.zzafx mo4170d() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = r2.f19705f;\n monitor-enter(r0);\n r1 = r2.f19706g;\t Catch:{ IllegalStateException -> 0x000d, IllegalStateException -> 0x000d }\n r1 = r1.m26175a();\t Catch:{ IllegalStateException -> 0x000d, IllegalStateException -> 0x000d }\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n return r1;\t Catch:{ all -> 0x000b }\n L_0x000b:\n r1 = move-exception;\t Catch:{ all -> 0x000b }\n goto L_0x0010;\t Catch:{ all -> 0x000b }\n L_0x000d:\n r1 = 0;\t Catch:{ all -> 0x000b }\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n return r1;\t Catch:{ all -> 0x000b }\n L_0x0010:\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzafn.d():com.google.android.gms.internal.ads.zzafx\");\n }", "public long mo915b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:14)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r4 = this;\n r0 = -1;\n r2 = r4.f18088d;\t Catch:{ NumberFormatException -> 0x000e }\n if (r2 == 0) goto L_0x000d;\t Catch:{ NumberFormatException -> 0x000e }\n L_0x0006:\n r2 = r4.f18088d;\t Catch:{ NumberFormatException -> 0x000e }\n r2 = java.lang.Long.parseLong(r2);\t Catch:{ NumberFormatException -> 0x000e }\n r0 = r2;\n L_0x000d:\n return r0;\n L_0x000e:\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.b.b():long\");\n }", "public synchronized void release() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.android.org.conscrypt.OpenSSLBIOSource.release():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.conscrypt.OpenSSLBIOSource.release():void\");\n }", "static /* synthetic */ byte m316-set9(android.location.GpsClock r1, byte r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00ec in method: android.location.GpsClock.-set9(android.location.GpsClock, byte):byte, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.-set9(android.location.GpsClock, byte):byte\");\n }", "AnonymousClass1(java.security.Signer r1, java.security.PublicKey r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: java.security.Signer.1.<init>(java.security.Signer, java.security.PublicKey):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.Signer.1.<init>(java.security.Signer, java.security.PublicKey):void\");\n }", "public void method_2259(String param1, double param2, double param4, double param6, int param8, double param9, double param11, double param13, double param15) {\r\n // $FF: Couldn't be decompiled\r\n }", "static /* synthetic */ int m0-get0(android.widget.ColorListView r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e3 in method: android.widget.ColorListView.-get0(android.widget.ColorListView):int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.widget.ColorListView.-get0(android.widget.ColorListView):int\");\n }", "private java.lang.reflect.Method m16124a(java.lang.Class r3, java.lang.String r4, java.lang.Class[] r5) {\n /*\n r2 = this;\n r0 = 0\n if (r3 == 0) goto L_0x0028\n boolean r1 = r2.m16125a((java.lang.Object) r4)\n if (r1 == 0) goto L_0x000a\n goto L_0x0028\n L_0x000a:\n r3.getMethods() // Catch:{ Exception -> 0x0015 }\n r3.getDeclaredMethods() // Catch:{ Exception -> 0x0015 }\n java.lang.reflect.Method r3 = r3.getDeclaredMethod(r4, r5) // Catch:{ Exception -> 0x0015 }\n return r3\n L_0x0015:\n java.lang.reflect.Method r3 = r3.getMethod(r4, r5) // Catch:{ Exception -> 0x001a }\n return r3\n L_0x001a:\n java.lang.Class r1 = r3.getSuperclass()\n if (r1 == 0) goto L_0x0028\n java.lang.Class r3 = r3.getSuperclass()\n java.lang.reflect.Method r0 = r2.m16124a((java.lang.Class) r3, (java.lang.String) r4, (java.lang.Class[]) r5)\n L_0x0028:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.onesignal.shortcutbadger.impl.OPPOHomeBader.m16124a(java.lang.Class, java.lang.String, java.lang.Class[]):java.lang.reflect.Method\");\n }", "public JBlock _finally() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 0: iconst_0 \n // 1: nop \n // 2: nop \n // 3: nop \n // 4: aload_3 \n // 5: nop \n // 6: lconst_0 \n // 7: nop \n // 8: iaload \n // 9: nop \n // 10: ldc2_w \"Lcom/sun/codemodel/JFormatter;\"\n // 13: nop \n // 14: fload_0 /* this */\n // 15: nop \n // 16: nop \n // 17: nop \n // 18: lload_2 \n // 19: nop \n // 20: iconst_0 \n // 21: nop \n // 22: nop \n // LocalVariableTable:\n // Start Length Slot Name Signature\n // ----- ------ ---- ---- -----------------------------\n // 0 23 0 this Lcom/sun/codemodel/JTryBlock;\n // \n // The error that occurred was:\n // \n // java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number\n // at com.strobel.assembler.ir.StackMappingVisitor$InstructionAnalyzer.execute(StackMappingVisitor.java:935)\n // at com.strobel.assembler.ir.StackMappingVisitor$InstructionAnalyzer.visit(StackMappingVisitor.java:398)\n // at com.strobel.decompiler.ast.AstBuilder.performStackAnalysis(AstBuilder.java:2030)\n // at com.strobel.decompiler.ast.AstBuilder.build(AstBuilder.java:108)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:210)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:757)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:655)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:532)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:499)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:141)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:130)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:105)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:317)\n // at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:238)\n // at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:123)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "static /* synthetic */ void m203-wrap7(java.lang.String r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap7(java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap7(java.lang.String):void\");\n }", "private static void check(java.lang.String r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.Signer.check(java.lang.String):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.Signer.check(java.lang.String):void\");\n }", "private void initialize() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00ee in method: android.location.GpsClock.initialize():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.initialize():void\");\n }", "public ecDSAnone() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSAnone.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSAnone.<init>():void\");\n }", "public ecDSA512() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSA512.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSA512.<init>():void\");\n }", "private static void m13385d() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = java.lang.System.currentTimeMillis();\t Catch:{ Exception -> 0x0024 }\n r2 = java.util.concurrent.TimeUnit.DAYS;\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r2 = r2.toMillis(r3);\t Catch:{ Exception -> 0x0024 }\n r4 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = r0 - r2;\t Catch:{ Exception -> 0x0024 }\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x0024 }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x0024 }\n r2 = \"timestamp < ?\";\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r3 = new java.lang.String[r3];\t Catch:{ Exception -> 0x0024 }\n r6 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = java.lang.String.valueOf(r4);\t Catch:{ Exception -> 0x0024 }\n r3[r6] = r4;\t Catch:{ Exception -> 0x0024 }\n r0.delete(r1, r2, r3);\t Catch:{ Exception -> 0x0024 }\n L_0x0024:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.d():void\");\n }", "static /* synthetic */ int m0-get0(cm.android.mdm.manager.PackageManager2.PackageDeleteObserver2 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e3 in method: cm.android.mdm.manager.PackageManager2.PackageDeleteObserver2.-get0(cm.android.mdm.manager.PackageManager2$PackageDeleteObserver2):int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: cm.android.mdm.manager.PackageManager2.PackageDeleteObserver2.-get0(cm.android.mdm.manager.PackageManager2$PackageDeleteObserver2):int\");\n }", "boolean m25333a(java.lang.String r1) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r0 = this;\n java.lang.Class.forName(r1);\t Catch:{ ClassNotFoundException -> 0x0005 }\n r1 = 1;\n return r1;\n L_0x0005:\n r1 = 0;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mapbox.android.core.location.c.a(java.lang.String):boolean\");\n }", "private StdDSAEncoder() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.StdDSAEncoder.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.StdDSAEncoder.<init>():void\");\n }", "public ecDSA384() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSA384.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSA384.<init>():void\");\n }", "public void mo21779D() {\n }", "public void mo2485a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = r2.f11863a;\n monitor-enter(r0);\n r1 = r2.f11873l;\t Catch:{ all -> 0x002a }\n if (r1 != 0) goto L_0x0028;\t Catch:{ all -> 0x002a }\n L_0x0007:\n r1 = r2.f11872k;\t Catch:{ all -> 0x002a }\n if (r1 == 0) goto L_0x000c;\t Catch:{ all -> 0x002a }\n L_0x000b:\n goto L_0x0028;\t Catch:{ all -> 0x002a }\n L_0x000c:\n r1 = r2.f11875n;\t Catch:{ all -> 0x002a }\n if (r1 == 0) goto L_0x0015;\n L_0x0010:\n r1 = r2.f11875n;\t Catch:{ RemoteException -> 0x0015 }\n r1.cancel();\t Catch:{ RemoteException -> 0x0015 }\n L_0x0015:\n r1 = r2.f11870i;\t Catch:{ all -> 0x002a }\n m14216b(r1);\t Catch:{ all -> 0x002a }\n r1 = 1;\t Catch:{ all -> 0x002a }\n r2.f11873l = r1;\t Catch:{ all -> 0x002a }\n r1 = com.google.android.gms.common.api.Status.zzfnm;\t Catch:{ all -> 0x002a }\n r1 = r2.mo3568a(r1);\t Catch:{ all -> 0x002a }\n r2.m14217c(r1);\t Catch:{ all -> 0x002a }\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n return;\t Catch:{ all -> 0x002a }\n L_0x0028:\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n return;\t Catch:{ all -> 0x002a }\n L_0x002a:\n r1 = move-exception;\t Catch:{ all -> 0x002a }\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.common.api.internal.BasePendingResult.a():void\");\n }", "public void a(b.a.d.b r4) {\r\n /*\r\n // Method dump skipped, instructions count: 116\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.appcompat.widget.ActionBarContextView.a(b.a.d.b):void\");\r\n }", "static /* synthetic */ void m202-wrap6(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1, int r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap6(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01, int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap6(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01, int):void\");\n }", "static /* synthetic */ void m205-wrap9(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1, int r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap9(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01, int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap9(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01, int):void\");\n }", "public void mo3613a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:14)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r4 = this;\n r0 = r4.f18081b;\n monitor-enter(r0);\n r1 = r4.f18080a;\t Catch:{ all -> 0x001f }\n if (r1 == 0) goto L_0x0009;\t Catch:{ all -> 0x001f }\n L_0x0007:\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n return;\t Catch:{ all -> 0x001f }\n L_0x0009:\n r1 = 1;\t Catch:{ all -> 0x001f }\n r4.f18080a = r1;\t Catch:{ all -> 0x001f }\n r2 = r4.f18081b;\t Catch:{ all -> 0x001f }\n r3 = r2.f12200d;\t Catch:{ all -> 0x001f }\n r3 = r3 + r1;\t Catch:{ all -> 0x001f }\n r2.f12200d = r3;\t Catch:{ all -> 0x001f }\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n r0 = r4.f18083d;\n okhttp3.internal.C2933c.m14194a(r0);\n r0 = r4.f18082c;\t Catch:{ IOException -> 0x001e }\n r0.m14100c();\t Catch:{ IOException -> 0x001e }\n L_0x001e:\n return;\n L_0x001f:\n r1 = move-exception;\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.a.a():void\");\n }", "static /* synthetic */ short m311-set4(android.location.GpsClock r1, short r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00ee in method: android.location.GpsClock.-set4(android.location.GpsClock, short):short, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.-set4(android.location.GpsClock, short):short\");\n }", "public final void mo11687c() {\n }", "public final java.lang.Void call() {\n /*\n // Method dump skipped, instructions count: 303\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.oculus.durableiap.DurableIAPStorage.AnonymousClass2.call():java.lang.Object\");\n }", "public ecDSA256() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSA256.<init>():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecDSA256.<init>():void\");\n }", "public boolean mo3969a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r4 = this;\n r0 = r4.f19005h;\n if (r0 != 0) goto L_0x0011;\n L_0x0004:\n r0 = r4.f19004g;\n if (r0 == 0) goto L_0x000f;\n L_0x0008:\n r0 = r4.f19004g;\n r1 = com.facebook.ads.C1700b.f5123e;\n r0.mo1313a(r4, r1);\n L_0x000f:\n r0 = 0;\n return r0;\n L_0x0011:\n r0 = new android.content.Intent;\n r1 = r4.f19002e;\n r2 = com.facebook.ads.AudienceNetworkActivity.class;\n r0.<init>(r1, r2);\n r1 = \"predefinedOrientationKey\";\n r2 = r4.m25306b();\n r0.putExtra(r1, r2);\n r1 = \"uniqueId\";\n r2 = r4.f18999b;\n r0.putExtra(r1, r2);\n r1 = \"placementId\";\n r2 = r4.f19000c;\n r0.putExtra(r1, r2);\n r1 = \"requestTime\";\n r2 = r4.f19001d;\n r0.putExtra(r1, r2);\n r1 = \"viewType\";\n r2 = r4.f19009l;\n r0.putExtra(r1, r2);\n r1 = \"useCache\";\n r2 = r4.f19010m;\n r0.putExtra(r1, r2);\n r1 = r4.f19008k;\n if (r1 == 0) goto L_0x0052;\n L_0x004a:\n r1 = \"ad_data_bundle\";\n r2 = r4.f19008k;\n r0.putExtra(r1, r2);\n goto L_0x005b;\n L_0x0052:\n r1 = r4.f19006i;\n if (r1 == 0) goto L_0x005b;\n L_0x0056:\n r1 = r4.f19006i;\n r1.m18953a(r0);\n L_0x005b:\n r1 = 268435456; // 0x10000000 float:2.5243549E-29 double:1.32624737E-315;\n r0.addFlags(r1);\n r1 = r4.f19002e;\t Catch:{ ActivityNotFoundException -> 0x0066 }\n r1.startActivity(r0);\t Catch:{ ActivityNotFoundException -> 0x0066 }\n goto L_0x0072;\n L_0x0066:\n r1 = r4.f19002e;\n r2 = com.facebook.ads.InterstitialAdActivity.class;\n r0.setClass(r1, r2);\n r1 = r4.f19002e;\n r1.startActivity(r0);\n L_0x0072:\n r0 = 1;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.adapters.k.a():boolean\");\n }", "void build(android.icu.impl.coll.CollationData r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.icu.impl.coll.CollationDataBuilder.build(android.icu.impl.coll.CollationData):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.build(android.icu.impl.coll.CollationData):void\");\n }", "private void m14210a(java.io.IOException r4, java.io.IOException r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r3 = this;\n r0 = f12370a;\n if (r0 == 0) goto L_0x000f;\n L_0x0004:\n r0 = f12370a;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1 = 1;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1 = new java.lang.Object[r1];\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r2 = 0;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1[r2] = r5;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r0.invoke(r4, r1);\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n L_0x000f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.internal.connection.RouteException.a(java.io.IOException, java.io.IOException):void\");\n }", "public void mo115190b() {\n }", "static /* synthetic */ boolean m1-get1(android.widget.ColorListView r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00ef in method: android.widget.ColorListView.-get1(android.widget.ColorListView):boolean, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.widget.ColorListView.-get1(android.widget.ColorListView):boolean\");\n }", "public /* bridge */ /* synthetic */ java.lang.Object createFromParcel(android.os.Parcel r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.location.GpsClock.1.createFromParcel(android.os.Parcel):java.lang.Object, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.1.createFromParcel(android.os.Parcel):java.lang.Object\");\n }", "private final java.util.Map<java.lang.String, java.lang.String> m11967c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r7 = this;\n r0 = new java.util.HashMap;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r0.<init>();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1 = r7.f10169c;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r2 = r7.f10170d;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r3 = f10168i;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r4 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r5 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r6 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1 = r1.query(r2, r3, r4, r5, r6);\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n if (r1 == 0) goto L_0x0031;\n L_0x0014:\n r2 = r1.moveToNext();\t Catch:{ all -> 0x002c }\n if (r2 == 0) goto L_0x0028;\t Catch:{ all -> 0x002c }\n L_0x001a:\n r2 = 0;\t Catch:{ all -> 0x002c }\n r2 = r1.getString(r2);\t Catch:{ all -> 0x002c }\n r3 = 1;\t Catch:{ all -> 0x002c }\n r3 = r1.getString(r3);\t Catch:{ all -> 0x002c }\n r0.put(r2, r3);\t Catch:{ all -> 0x002c }\n goto L_0x0014;\n L_0x0028:\n r1.close();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n goto L_0x0031;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n L_0x002c:\n r0 = move-exception;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1.close();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n throw r0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n L_0x0031:\n return r0;\n L_0x0032:\n r0 = \"ConfigurationContentLoader\";\n r1 = \"PhenotypeFlag unable to load ContentProvider, using default values\";\n android.util.Log.e(r0, r1);\n r0 = 0;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzsi.c():java.util.Map<java.lang.String, java.lang.String>\");\n }", "void optimize(android.icu.text.UnicodeSet r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.icu.impl.coll.CollationDataBuilder.optimize(android.icu.text.UnicodeSet):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.optimize(android.icu.text.UnicodeSet):void\");\n }", "public final java.lang.Void call() {\n /*\n // Method dump skipped, instructions count: 303\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.oculus.durableiap.DurableIAPStorage.AnonymousClass2.call():java.lang.Object\");\n }", "private void m50366E() {\n }" ]
[ "0.82593614", "0.8251481", "0.82311714", "0.81875473", "0.81588984", "0.81588984", "0.81583995", "0.810011", "0.809811", "0.8064114", "0.80450493", "0.8032749", "0.7979893", "0.7971034", "0.7888678", "0.788416", "0.7876225", "0.7857277", "0.7828842", "0.7724343", "0.7646691", "0.7614281", "0.7601586", "0.7581619", "0.7576481", "0.745903", "0.729263", "0.7224569", "0.7137667", "0.69966865", "0.6981592", "0.68945193", "0.6888722", "0.6884861", "0.6858816", "0.6857632", "0.6841422", "0.6837751", "0.6789303", "0.6788954", "0.6787677", "0.67526037", "0.67516106", "0.673237", "0.6729975", "0.6728843", "0.66994286", "0.6682005", "0.6676277", "0.66629565", "0.66590214", "0.66103894", "0.66034174", "0.6590037", "0.65895444", "0.65718454", "0.65450627", "0.6538493", "0.651734", "0.6509532", "0.6486706", "0.6479682", "0.646641", "0.64124274", "0.64085287", "0.6403301", "0.6399853", "0.6373319", "0.6367325", "0.6365351", "0.63616616", "0.63605136", "0.63593686", "0.6357078", "0.6334758", "0.6331743", "0.6320057", "0.6311424", "0.6303539", "0.6297844", "0.6292434", "0.6275605", "0.6270156", "0.62639755", "0.62623453", "0.6261807", "0.62512124", "0.6247147", "0.6235118", "0.62312603", "0.62248605", "0.62091964", "0.6196538", "0.6191169", "0.6189805", "0.6188712", "0.61868846", "0.6184013", "0.6183897", "0.61772513", "0.61674273" ]
0.0
-1
constructor with fixed speeds setup for every lane
public MovingObj(float posX, String type, int lane, boolean rotate) { super(posX, 0, 0, 0, type); this.lane = lane; this.rotate = rotate; if (lane == 0) spdX = Constants.LANESPD0; if (lane == 1) spdX = Constants.LANESPD1; if (lane == 2) spdX = Constants.LANESPD2; if (lane == 3) spdX = Constants.LANESPD3; if (lane == 4) spdX = Constants.LANESPD4; if (lane == 6) spdX = Constants.LANESPD6; if (lane == 7) spdX = Constants.LANESPD7; if (lane == 8) spdX = Constants.LANESPD8; if (lane == 9) spdX = Constants.LANESPD9; if (lane == 10) spdX = Constants.LANESPD10; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Airplane(){\n\t\tsuper(106, 111);\n\t\tspeed = Math.random() + 2.0;\n\t}", "protected void initialize() {\r\n \t((Launcher) Robot.fuelLauncher).controlSpeed(i);\r\n }", "@Override\n\tprotected void init() {\n\t\t//Set movementSpeed in px/s\n\t\tmovementSpeed = 100;\n\t\t//Set previousTime to start at the \n\t}", "public Lab1(Integer speed1, Integer speed2) {\n trackStatus = new Semaphore[6];\n for (int i = 0; i < trackStatus.length; i++)\n trackStatus[i] = new Semaphore(1);\n new Thread(new Train(1, speed1, SOUTH, 0)).start();\n new Thread(new Train(2, speed2, NORTH, 5)).start();\n }", "public abstract void setSpeed(int sp);", "public void setSpeed(float val) {speed = val;}", "@Override\n protected void initialize() {\n Robot.tilt.setSpeed(speed);\n }", "public void setSpeed( Vector2 sp ) { speed = sp; }", "public void setSpeed(int s){\r\n\t\tspeed = s;\r\n\t}", "public Motor(int lSpeed, int rSpeed, long lPos, long rPos) {\n leftSpeed = lSpeed;\n rightSpeed = rSpeed;\n leftPosition = lPos;\n rightPosition = rPos;\n }", "NetTankSpeed(float speed)\n\t{\n\t\tthis.speed = speed;\n\t}", "@Override\n public void initialize() {\n\n distanceTraveled = 0.0;\n timer.start();\n startTime = timer.get();\n\n leftEncoderStart = drivetrain.getMasterLeftEncoderPosition();\n rightEncoderStart = drivetrain.getMasterRightEncoderPosition();\n\n angleCorrection = 0;\n angleError = 0;\n speedCorrection = 1;\n\n shifter.shiftUp();\n\n }", "public void setSpeed(int value) {\n this.speed = value;\n }", "public void setSpeed(int value) {\n speed = value;\n if (speed < 40) {\n speedIter = speed == 0 ? 0 : speed / 4 + 1;\n speedWait = (44 - speed) * 3;\n fieldDispRate = 20;\n listDispRate = 20;\n } else if (speed < 100) {\n speedIter = speed * 2 - 70;\n fieldDispRate = (speed - 40) * speed / 50;\n speedWait = 1;\n listDispRate = 1000;\n } else {\n speedIter = 10000;\n fieldDispRate = 2000;\n speedWait = 1;\n listDispRate = 4000;\n }\n }", "private void setSpeedValues(){\n minSpeed = trackingList.get(0).getSpeed();\n maxSpeed = trackingList.get(0).getSpeed();\n averageSpeed = trackingList.get(0).getSpeed();\n\n double sumSpeed =0.0;\n for (TrackingEntry entry:trackingList) {\n\n sumSpeed += entry.getSpeed();\n\n //sets min Speed\n if (minSpeed > entry.getSpeed()){\n minSpeed = entry.getSpeed();\n }\n //sets max Speed\n if (maxSpeed < entry.getSpeed()) {\n maxSpeed = entry.getSpeed();\n }\n\n }\n\n averageSpeed = sumSpeed/trackingList.size();\n }", "@Override\r\n\t\t\tpublic void speed(Double speed) {\n\t\t\t\tSystem.out.println(\"defining when object initciated\");\r\n\t\t\t}", "public DriveTrain() {\n for(int i = 0; i < 2; i++) {\n leftMotors[i] = new CANSparkMax(Constants.LEFT_DRIVE_CANS[i], MotorType.kBrushless);\n rightMotors[i] = new CANSparkMax(Constants.RIGHT_DRIVE_CANS[i], MotorType.kBrushless);\n rightMotors[i].setInverted(true);\n }\n }", "public void setSpeed() {\n //assigns the speed based on the shuffleboard with a default value of zero\n double tempSpeed = setpoint.getDouble(0.0);\n\n //runs the proportional control system based on the aquired speed\n controlRotator.proportionalSpeedSetter(tempSpeed);\n }", "public void moveConstructor() {\n this.loopAndAddMoves(1, 1);\n this.loopAndAddMoves(-1, 1);\n this.loopAndAddMoves(1, -1);\n this.loopAndAddMoves(-1, -1);\n this.loopAndAddMoves(0, 1);\n this.loopAndAddMoves(0, -1);\n this.loopAndAddMoves(1, 0);\n this.loopAndAddMoves(-1, 0);\n }", "public Builder setSpeed(int value) {\n bitField0_ |= 0x00000080;\n speed_ = value;\n onChanged();\n return this;\n }", "public ConstantSpeedMessageGenerator setSpeed(final double speed) {\n this.speed = speed;\n\n if (speed > 0) { // -1 = unlimited speed\n buffer = new long[(int) Math.round(Math.ceil(speed))];\n pointer = 0;\n\n for (int i = 0; i < (int) Math.round(Math.ceil(speed)); i++) {\n buffer[i] = 0;\n }\n\n breakDuration = (int) Math.round(1000 / speed); // will be 0 for speed > 1000\n }\n\n return this;\n }", "public void setSpeed() {\n\t\tthis.ySpd = this.MINSPEED + randGen.nextFloat() * (this.MAXSPEED - this.MINSPEED);\n\t\tthis.xSpd = this.MINSPEED + randGen.nextFloat() * (this.MAXSPEED - this.MINSPEED);\n\t}", "public Builder setSpeed(int value) {\n bitField0_ |= 0x00001000;\n speed_ = value;\n onChanged();\n return this;\n }", "public Builder setSpeed(int value) {\n bitField0_ |= 0x00001000;\n speed_ = value;\n onChanged();\n return this;\n }", "public Builder setSpeed(int value) {\n bitField0_ |= 0x00001000;\n speed_ = value;\n onChanged();\n return this;\n }", "public void setSpeed(double speed)\r\n {\r\n this.speed = speed;\r\n }", "public void initialize() {\n leftfrontmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n leftrearmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n rightfrontmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n rightrearmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n\n leftfrontmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n leftrearmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n rightfrontmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n rightrearmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n \n\n // More Motor Tunes (to occur during each initialization period):\n leftfrontmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n leftrearmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n rightfrontmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n rightrearmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n\n turnController.setSetpoint(Constants.DriveBase.Controllers.zero);\n turnController.setTolerance(Constants.DriveBase.Controllers.turntollerance);\n\n driveController.setSetpoint(Constants.DriveBase.Controllers.zero);\n driveController.setTolerance(Constants.DriveBase.Controllers.drivetollerance);\n\n ballTurnController.setSetpoint(Constants.DriveBase.Controllers.zero);\n ballTurnController.setTolerance(Constants.DriveBase.Controllers.balltollerance);\n\n ballDriveController.setSetpoint(Constants.DriveBase.Controllers.balldrive);\n ballDriveController.setTolerance(Constants.DriveBase.Controllers.balldrivetollerance);\n \n reset();\n }", "public void setSpeed() {\r\n\t\tthis.currSpeed = this.maxSpeed * this.myStrategy.setEffort(this.distRun);\r\n\t}", "@Override\n protected void initialize() {\n Robot.SCISSOR.extendLift(speed);\n }", "@Override\n protected void initialize() {\n rightTarget = this.distanceInches + Robot.driveTrain.getRightEncoderDistanceInches();\n leftTarget = this.distanceInches + Robot.driveTrain.getLeftEncoderDistanceInches();\n Robot.driveTrain.tankDrive(0, 0);\n this.direction = distanceInches > 0;\n turnPID.resetPID();\n }", "protected void initialize()\n\t{\n\t\tRobot.intake.setSpeed(new double[] { leftSpeed, rightSpeed });\n\t}", "protected OpenLoopSpeedController()\r\n\t{\r\n\t\t\r\n\t}", "public void setSpeed(double multiplier);", "public Builder setSpeed(int value) {\n bitField0_ |= 0x00000800;\n speed_ = value;\n onChanged();\n return this;\n }", "public void setSpeed(int speed) {\n this.speed = speed;\n }", "protected void initialize() {\n \ttarget = Robot.trackingCamera.getTarget();\n targetX = target[0];\n targetY = target[1];\n \tstopTime = System.currentTimeMillis() + timeOut;\n }", "protected void initialize() {\n \ttarget = (int) SmartDashboard.getNumber(\"target\", 120);\n \ttarget = (int) (target * Constants.TICKS_TO_INCHES);\n\t\tRobot.drive.stop();\n\t\tmaxCount = (int) SmartDashboard.getNumber(\"max count\", 0);\n\t\ttolerance = (int) SmartDashboard.getNumber(\"tolerance\", 0);\n\t\tRobot.drive.left.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\t\tRobot.drive.right.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n }", "@Override\n public void init()\n {\n target.setAbsoluteTolerance(ANGLE_ABSOLUTE_TOLERANCE); // Configure the target's absolute tolerance\n /*\n Limit the speed on the target between these values to prevent overshooting and damage to motors\n Normally we would leave the output range without bounds because we wish for the end affector to reach the setpoint\n as fast as possible, in a constant time, which would mean having an output proportional to it's error, but in this case\n We don't care how long it takes to reach its target, we just want it to get there in one piece */\n //System.out.println(\"INITIALIZING PID CONTROL\");\n target.setOutputRange(-0.15, 0.15);\n\n /* load percent control in because output is simply a percentage */\n target.loadLeftController(\"percent\");\n target.loadRightController(\"percent\");\n }", "public void init() {\n delayingTimer = new ElapsedTime();\n\n // Define and Initialize Motors and Servos: //\n tailMover = hwMap.dcMotor.get(\"tail_lift\");\n grabberServo = hwMap.servo.get(\"grabber_servo\");\n openGrabber();\n\n // Set Motor and Servo Directions: //\n tailMover.setDirection(DcMotorSimple.Direction.FORWARD);\n\n tailMover.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n tailMover.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n int prevEncoder = tailMover.getCurrentPosition();\n tailMover.setPower(-0.15);\n mainHW.opMode.sleep (300);\n Log.d(\"catbot\", String.format(\"tail lift power %.2f current position %2d prev %2d\", tailMover.getPower(), tailMover.getCurrentPosition(),prevEncoder));\n runtime.reset();\n while((Math.abs(prevEncoder - tailMover.getCurrentPosition()) > 10)&& (runtime.seconds()<3.0)){\n prevEncoder = tailMover.getCurrentPosition();\n mainHW.opMode.sleep(300);\n Log.d(\"catbot\", String.format(\"tail lift power %.2f current position %2d prev %2d\", tailMover.getPower(), tailMover.getCurrentPosition(),prevEncoder));\n }\n tailMover.setPower(0.0);\n // Set Motor and Servo Modes: //\n tailMover.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n\n tailMover.setTargetPosition(0);\n tailMover.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n closeGrabber();\n }", "protected void initialize() {\n \t_finalTickTargetLeft = _ticksToTravel + Robot.driveTrain.getEncoderLeft();\n \t_finalTickTargetRight = _ticksToTravel + Robot.driveTrain.getEncoderRight();\n \t\n }", "public void setSpeed(int wpm);", "public Builder setSpeed(int value) {\n \n speed_ = value;\n onChanged();\n return this;\n }", "public void setSpeed(double speed) {\n this.speed = speed;\n }", "public void setSpeed(double speed) {\n this.speed = speed;\n }", "@Override\n\tpublic void setSpeed(double speed) {\n\n\t}", "@Override\r\n\tpublic void initialise(Agent agent) {\n\t\tthis.maxSpeed = agent.getMaxSpeed();\r\n\t\tsprint = maxSpeed*1.5f;\r\n\t}", "public void setSpeed(float speed) {\n this.speed = speed;\n }", "public void setSpeed(float speed) {\n this.speed = speed;\n }", "public void setElevatorSpeed(double spd)\n {\n mSpeed = spd;\n }", "public Robot(int step, int speed) {\n\t\tthis.step = step; \n\t\tthis.speed = speed; \n\t}", "public void setSpeed(double speed) {\n \tthis.speed = speed;\n }", "@Override\n\tpublic void setSpeed(float speed) {\n\t\t\n\t}", "public EvolutionaryVehicleRouter() {\n super();\n initializeShippingPoints();\n individual_count = 0;\n generation_count = 0;\n }", "protected void initialize() {\n \t starttime = Timer.getFPGATimestamp();\n \tthis.startAngle = RobotMap.navx.getAngle();\n \tangleorientation.setSetPoint(RobotMap.navx.getAngle());\n \t\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \n //settting talon control mode\n \tRobotMap.motorLeftTwo.changeControlMode(TalonControlMode.MotionMagic);\t\t\n\t\tRobotMap.motorLeftOne.changeControlMode(TalonControlMode.Follower);\t\n\t\tRobotMap.motorRightTwo.changeControlMode(TalonControlMode.MotionMagic);\t\n\t\tRobotMap.motorRightOne.changeControlMode(TalonControlMode.Follower);\n\t\t//setting peak and nominal output voltage for the motors\n\t\tRobotMap.motorLeftTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorLeftTwo.configNominalOutputVoltage(0.00f, 0.0f);\n\t\tRobotMap.motorRightTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorRightTwo.configNominalOutputVoltage(0.0f, 0.0f);\n\t\t//setting who is following whom\n\t\tRobotMap.motorLeftOne.set(4);\n\t\tRobotMap.motorRightOne.set(3);\n\t\t//setting pid value for both sides\n\t//\tRobotMap.motorLeftTwo.setCloseLoopRampRate(1);\n\t\tRobotMap.motorLeftTwo.setProfile(0);\n\t RobotMap.motorLeftTwo.setP(0.000014f);\n \tRobotMap.motorLeftTwo.setI(0.00000001);\n\t\tRobotMap.motorLeftTwo.setIZone(0);//325);\n\t\tRobotMap.motorLeftTwo.setD(1.0f);\n\t\tRobotMap.motorLeftTwo.setF(this.fGainLeft+0.014);//0.3625884);\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t RobotMap.motorRightTwo.setCloseLoopRampRate(1);\n\t RobotMap.motorRightTwo.setProfile(0);\n\t\tRobotMap.motorRightTwo.setP(0.000014f);\n\t\tRobotMap.motorRightTwo.setI(0.00000001);\n\t\tRobotMap.motorRightTwo.setIZone(0);//325);\n\t\tRobotMap.motorRightTwo.setD(1.0f);\n\t\tRobotMap.motorRightTwo.setF(this.fGainRight);// 0.3373206);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t\t//setting Acceleration and velocity for the left\n\t\tRobotMap.motorLeftTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorLeftTwo.setMotionMagicCruiseVelocity(250);\n\t\t//setting Acceleration and velocity for the right\n\t\tRobotMap.motorRightTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorRightTwo.setMotionMagicCruiseVelocity(250);\n\t\t//resets encoder position to 0\t\t\n\t\tRobotMap.motorLeftTwo.setEncPosition(0);\n\t\tRobotMap.motorRightTwo.setEncPosition(0);\n\t //Set Allowable error for the loop\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(300);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(300);\n\t\t\n\t\t//sets desired endpoint for the motors\n RobotMap.motorLeftTwo.set(motionMagicEndPoint);\n RobotMap.motorRightTwo.set(-motionMagicEndPoint );\n \t\n }", "protected void initialize() {\n \t\n \ttimeStarted = System.currentTimeMillis();\n \tangle = driveTrain.gyro.getYaw();\n \tspeed = RobotMap.speedAtFullVoltage * power;\n \ttimeToGo = (long)(distance / speed) * 1000;\n }", "protected void setMotorSpeeds(int lSpeed, int rSpeed) {\n setLeftMotorSpeed(lSpeed);\n setRightMotorSpeed(rSpeed);\n }", "public void setEstimatedTrainLocations() {\n\t\t// TODO: for each train\n\t\tfor (Train t : trains) {\n\t\t\t// calculate the distance traveled since the last tick\n\t\t\tdouble speed = t.currSpeed * 0.488888889; // in yards/second\n\t\t\tdouble elapsedTime = SimClock.getDeltaMs() * 0.001; //in seconds\n\t\t\tdouble distanceTraveled = speed*elapsedTime; //yards\n\t\t\tDefaultBlock block = ((DefaultBlock)blockData.get(t.currentBlock));\n\t\t\tif (distanceTraveled > t.authority) {\n\t\t\t\tdistanceTraveled = t.authority;\n\t\t\t\tt.currSpeed = 0;\n\t\t\t}\n\t\t\telse if (trainRoutes.get(t.trainId).route.size() == 1) {\n\t\t\t\tif (t.distanceTraveledOnBlock + distanceTraveled > block.blockLength/2) {\n\t\t\t\t\tdistanceTraveled = block.blockLength/2 - t.distanceTraveledOnBlock;\n\t\t\t\t\tt.distanceTraveledOnBlock = block.blockLength/2;\n\t\t\t\t\tt.currSpeed = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check if the train has entered a new block\n\t\t\tif (block.occupied == false) {\n\t\t\t\t// it has.\n\t\t\t\tt.currentBlock = trainRoutes.get(t.trainId).route.get(1);\n\t\t\t\tt.distanceTraveledOnBlock = block.blockLength - t.distanceTraveledOnBlock;\n\t\t\t\tt.currSpeed = ((DefaultBlock) blockData.get(t.currentBlock)).speedLimit;\n\t\t\t\tif (t.currSpeed > t.maxSpeed) {\n\t\t\t\t\tt.currSpeed = t.maxSpeed;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// calculate the distance traveled on block\n\t\t\telse if ((t.distanceTraveledOnBlock + distanceTraveled) > block.blockLength) {\n\t\t\t\tt.distanceTraveledOnBlock = block.blockLength;\n\t\t\t}\n\t\t\tt.authority -= distanceTraveled;\n\t\t\tt.currSpeed = trainRoutes.get(t.trainId).speed;\n\t\t\tt.distanceTraveledOnBlock += distanceTraveled;\n\t\t\t\n\t\t}\n\t}", "protected void initialize() {\n ////TEST CODE\n \tRobotMap.frontLeftTurn.set(0);\n \tRobotMap.frontRightTurn.set(0);\n \tRobotMap.backLeftTurn.set(0);\n \tRobotMap.backRightTurn.set(0);\n \t\n \t//Spin motors\n \tRobotMap.frontLeftTurn.set(85);\n \tRobotMap.frontRightTurn.set(85);\n \tRobotMap.backLeftTurn.set(85);\n \tRobotMap.backRightTurn.set(85);\n \tTimer.delay(2.75);\n \t\n \t//Stop Spin\n \tRobotMap.frontLeftTurn.set(0);\n \tRobotMap.frontRightTurn.set(0);\n \tRobotMap.backLeftTurn.set(0);\n \tRobotMap.backRightTurn.set(0);\n \tTimer.delay(2.75);\n \t\n \t//Move Back\n \tRobotMap.frontLeftDrive.set(0.2);\n \tRobotMap.frontRightDrive.set(0.2);\n \tRobotMap.backLeftDrive.set(0.2);\n \tRobotMap.backRightDrive.set(0.2); \t\n \tTimer.delay(2.75); \n \t\n \t//Stop\n \t\n \tRobotMap.frontLeftDrive.set(0);\n \tRobotMap.frontRightDrive.set(0);\n \tRobotMap.backLeftDrive.set(0);\n \tRobotMap.backRightDrive.set(0);\n }", "protected void initialize() {\n encoder = winchAndLatchSS.getWinchEncoder();\n counter = 0;\n Robot3663.updateCommandStatus(\"C_WindWinch\", \"initialize \"+targetTicks);\n tightening = winchAndLatchSS.getWinchEncoder() > targetTicks;\n \n if (tightening){\n direction = speed = -1;\n }\n else{\n direction = speed = 1;\n }\n kill = false;\n if((encoder > targetTicks - LEWAY) && (encoder < targetTicks + LEWAY))\n {\n kill = true;\n speed = 0;\n }\n }", "public LoopController()\r\n\t{\r\n\t\tregulate = true;\r\n\t\tsmooth = true;\r\n\t\tresolution = 10000;\r\n\t\tfps = 60;\r\n\t\tlastCall = Sys.getTime();\r\n\t\tduration = 0;\r\n\t}", "public Train(int id, int speed, int direction, int ticket) {\n this.id = id;\n this.speed = speed;\n this.direction = direction;\n this.ticket = ticket;\n trackStatus[ticket].tryAcquire();\n }", "public void SpeedControl(long iDasherX, long iDasherY, double dFrameRate) {}", "public Bicycle(int gear, int speed)\r\n {\r\n this.gear = gear;\r\n this.speed = speed;\r\n }", "public void setSpeed(int speed) {\n thread.setSpeed(speed);\n }", "public void verifySpeeds() {\n double maxStartSpeed = 0.0;\n double[] startSpeeds = new double[segments.size() + 1];\n startSpeeds[segments.size()] = 0.0;\n for (int i = segments.size() - 1; i >= 0; i--) {\n PathSegment segment = segments.get(i);\n maxStartSpeed += Math\n .sqrt(maxStartSpeed * maxStartSpeed + 2 * maxAccel * segment.getLength());\n startSpeeds[i] = segment.getStartState().vel();\n if (startSpeeds[i] > maxStartSpeed) {\n startSpeeds[i] = maxStartSpeed;\n }\n maxStartSpeed = startSpeeds[i];\n }\n for (int i = 0; i < segments.size(); i++) {\n PathSegment segment = segments.get(i);\n double endSpeed = startSpeeds[i + 1];\n MotionState startState = (i > 0) ? segments.get(i - 1).getEndState() : new MotionState(0, 0, 0, 0);\n startState = new MotionState(0, 0, startState.vel(), startState.vel());\n segment.createMotionProfiler(startState, endSpeed);\n }\n }", "public Morse() {\n Set_Flag(ADAPT_SPEED);\n\n // ?\n Thread thread = new Thread(this);\n thread.start();\n }", "public void setSpeed(double left, double right){\n leftMasterVictor.setSpeed(left);\n rightMasterVictor.setSpeed(-right);\n }", "public void setSpeed() {\n if (this.equals(null)) {\n this.speedValue=-5;\n }\n }", "public void startEngine(){\n currentSpeed = 0.1;\n }", "private LineSystem()\r\n {\r\n super(sleepTime);\r\n \r\n left = new DigitalInput(1);\r\n middle = new DigitalInput(3);\r\n right = new DigitalInput(2);\r\n }", "public void setSpeed(float n)\n\t{\n\t\tthis.speed = n;\n\t}", "public void setVehicleSpeed(float value) {\n this.vehicleSpeed = value;\n }", "public void setWalkSpeed(int n)\n{\n walkSpeed = n;\n}", "void setSpeed(RobotSpeedValue newSpeed);", "@Override\n public void initialize() {\n shooter.setShooterVelocity(speed);\n }", "public Arm() {\n initializeLogger();\n initializeCurrentLimiting();\n setBrakeMode();\n encoder.setDistancePerPulse(1.0/256.0);\n lastTimeStep = Timer.getFPGATimestamp();\n }", "protected void initialize() {\n \t\n \tstart_time = System.currentTimeMillis();\n \t\n \tgoal = start_time + duration;\n }", "@Override\r\n\tpublic void speed() {\n\t}", "private void updatePointSpeeds() {\n\t\tfor (int i = 0; i < locations.size(); i++) {\n\t\t\tLocationStructure loc = locations.get(i);\t\t\n\t\t\tDouble dist = Double.MIN_VALUE;\n\t\t\tDouble lat1 = loc.getLatitude().doubleValue();\n\t\t\tDouble lon1 = loc.getLongitude().doubleValue();\n\t\t\t\n\t\t\tDate d = times.get(i);\n\t\t\t\n\t\t\tif( i+1 < locations.size()) {\n\t\t\t\tloc = locations.get(i+1);\n\t\t\t\tDouble lat2 = loc.getLatitude().doubleValue();\n\t\t\t\tDouble lon2 = loc.getLongitude().doubleValue();\n\t\t\t\tdist = calculateDistance(lat1, lon1, lat2, lon2);\n\t\t\t\t\n\t\t\t\tDate d1 = times.get(i+1);\n\t\t\t\tDateTime dt1 = new DateTime(d);\n\t\t\t\tDateTime dt2 = new DateTime(d1);\n\t\t\t\tint seconds = Seconds.secondsBetween(dt1, dt2).getSeconds();\t\t\t\n\t\t\t\tDouble pd = (dist/seconds)*60;\n\t\t\t\tif(!pd.isNaN()) {\n\t\t\t\t\tpointSpeed.add(pd);\t\t\n\t\t\t\t\tSystem.out.println(\"BUS STATE-- Added point speed of \"+ (dist/seconds)*60 + \" for \" +this.vehicleRef);\n\t\t\t\t}\n\t\t\t} else break;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "void setSpeedsArray(org.landxml.schema.landXML11.SpeedsDocument.Speeds[] speedsArray);", "public Simulator(Board board, double framesPerSecond) {\n this.board = board;\n this.fps = framesPerSecond; \n }", "public void initialization() {\n iterations_ = 1;\n\n swarm_ = new SolutionSet(swarmSize_);\n best_ = new Solution[swarmSize_];\n\n dominance_ = new DominanceComparator();\n crowdingDistanceComparator_ = new CrowdingDistanceComparator();\n distance_ = new Distance();\n\n speed_ = new double[swarmSize_][problem_.getNumberOfVariables()];\n\n deltaMax_ = new double[problem_.getNumberOfVariables()];\n deltaMin_ = new double[problem_.getNumberOfVariables()];\n for (int i = 0; i < problem_.getNumberOfVariables(); i++) {\n deltaMax_[i] = (problem_.getUpperLimit(i) -\n problem_.getLowerLimit(i)) / 2.0;\n deltaMin_[i] = -deltaMax_[i];\n }\n\n for (int i = 0; i < swarmSize_; i++) {\n for (int j = 0; j < problem_.getNumberOfVariables(); j++) {\n speed_[i][j] = 0.0;\n }\n }\n }", "public DriveTrain (int motorChannelL1,int motorChannelL2,int motorChannelR1,int motorChannelR2 ){\n leftMotor1 = new Victor(motorChannelL1);\n leftMotor2 = new Victor(motorChannelL2);\n rightMotor1 = new Victor(motorChannelR1);\n rightMotor2 = new Victor(motorChannelR2);\n highDrive = new RobotDrive(motorChannelL1, motorChannelR1);\n lowDrive = new RobotDrive(motorChannelL2, motorChannelR2);\n \n }", "Circles(LX lx) {\n super(lx);\n addModulator(wave360).start();\n addModulator(wave100).start();\n addParameter(waveSlope);\n addParameter(speedParam);\n\n for (BaseCube cube : model.baseCubes) {\n if (cube.z < minz) {minz = cube.z;}\n if (cube.z > maxz) {maxz = cube.z;}\n }\n }", "protected void initialize() {\n\t\t// startAngle = drive.getAngle();\n\t\tdrive.resetBothEncoders();\n\t\tpLeft = speed;\n\t\tpRight = speed;\n\t}", "public void SetSpeedRaw(double speed)\n {\n Motors.Set(speed);\n }", "public void setSpeed(int newSpeed)\n {\n speed = newSpeed;\n }", "public static void init(){\r\n CommandBase.magazine.setSpeed(0.0);\r\n CommandBase.loader.setSpeed(0.0);\r\n Init.manualTankDrive.start(); \r\n Init.runCompressor.start();\r\n Init.stopGyroDrift.start();\r\n \r\n }", "private void setBallSpeed() {\n RandomGenerator rgen = RandomGenerator.getInstance();\n vx = rgen.nextDouble(1.0, 3.0);\n if (rgen.nextBoolean(0.5)) {\n vx = - vx;\n }\n vy = BALL_SPEED;\n }", "public Quadcopter() {\r\n\t\tsuper();\r\n\t\tmaxFlyingSpeed = 0;\r\n\t}", "private void setUpPlayerSpeed() \n {\n \tcalculateMovementSpeeds();\n \t\n \tSystem.out.println(\"height : \" + height);\n \tSystem.out.println(\"\\nsetupPlayerSpeed\");\n \tSystem.out.println(\"==============\");\n \tSystem.out.println(\" walkSpeed : \" + walkSpeed);\n \tSystem.out.println(\" maxRunSpeed : \" + maxRunSpeed);\n \tSystem.out.println(\" accelerationRate : \" + accelerationRate);\n \tSystem.out.println(\" maxAccelRate : \" + maxAccelRate);\n \tSystem.out.println(\" initialJumpSpeed : \" + initialJumpSpeed);\n \tSystem.out.println(\" maxJumpSpeed : \" + maxJumpSpeed);\n \tSystem.out.println(\" jumpIncr : \" + jumpIncr);\n \tSystem.out.println(\" maxFallSpeed : \" + maxFallSpeed);\n \t\n \t//System.exit(-1);\n\t}", "void changeSpeed(int speed) {\n\n this.speed = speed;\n }", "protected void initialize() {\n Timer.delay(7);\n ballIntake.turnOnHorizontalConveyor();\n ballIntake.verticalConveyor.set(-.3);\n }", "public void setSpeed(float speed) {\n this.speed = (int) speed * 13;\n }", "@Test\r\n\tpublic final void testSetSpeed() {\n\t\t a=new airConditioner(\"ON\",33);\r\n\t\tassertEquals(33,a.getSpeed());\r\n\t}", "public void setCurrentSpeed (double speed);", "@Override\n @Deprecated // Deprecated so developer does not accidentally use\n public void setSpeed(int speed) {\n }", "public PeakSpeedFragment() {\n }", "public Drivetrain() {\n // Use inches as unit for encoder distances\n m_leftEncoder.setDistancePerPulse(initialDistancePerPulse);\n m_rightEncoder.setDistancePerPulse(initialDistancePerPulse);\n resetEncoders();\n }", "public MountainBike(int gear,int speed,\r\n int startHeight)\r\n {\r\n // invoking base-class(Bicycle) constructor\r\n super(gear, speed);\r\n seatHeight = startHeight;\r\n }", "public void setSpeed(int hz) {\n this.interval = 1000000000L / hz;\n if (!stopped.get()) {\n this.stop(); \n this.start();\n }\n }" ]
[ "0.6447263", "0.6316052", "0.6256123", "0.6211408", "0.61432844", "0.6139663", "0.61228853", "0.60713726", "0.60605216", "0.6044894", "0.60366815", "0.60211825", "0.59798986", "0.59748656", "0.595779", "0.5939167", "0.59057194", "0.58988565", "0.588993", "0.58597344", "0.5859289", "0.58515275", "0.5849368", "0.5848554", "0.5848554", "0.5822153", "0.5815876", "0.581249", "0.580497", "0.5801512", "0.57968426", "0.57783186", "0.5771047", "0.57555544", "0.5750601", "0.5731505", "0.57013357", "0.5699871", "0.56961834", "0.5695772", "0.5689464", "0.5679034", "0.56767386", "0.56767386", "0.56765705", "0.56756127", "0.56748015", "0.56748015", "0.5669033", "0.56486714", "0.56424713", "0.5636722", "0.56278783", "0.5605732", "0.56045765", "0.55946064", "0.55920726", "0.5587132", "0.5575194", "0.5570655", "0.55699307", "0.556919", "0.55666023", "0.5554086", "0.5545045", "0.55414474", "0.55404556", "0.5532128", "0.5517004", "0.5514072", "0.5513273", "0.5509144", "0.5490627", "0.54882383", "0.54849213", "0.54845124", "0.5483596", "0.54764426", "0.54652125", "0.54634064", "0.54620206", "0.5459398", "0.5459043", "0.54565513", "0.5454042", "0.54501545", "0.5448358", "0.5444529", "0.5440811", "0.5439746", "0.54302627", "0.542792", "0.5426551", "0.54252213", "0.5424272", "0.542277", "0.54142946", "0.5411141", "0.54050624", "0.54036856", "0.53965837" ]
0.0
-1
This method is used to read all lines in the csv file and parse the data
public boolean parse(String path){ try{ BufferedReader br=new BufferedReader(new FileReader(path)); String row; int nrighe=0; while((row=br.readLine())!=null){ nrighe++; if(!row.equals("")) if(nrighe>1) reader.read(row); } return true; }catch(FileNotFoundException ex){ return false; }catch(IOException e){ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processCSVFile( BufferedReader csvFile ) throws IOException {\r\n\t\t\r\n\t\tboolean headerRowRead = false;\r\n\t\tString[] headerArray = null;\r\n\t\t\r\n\t\t//loop through all rows and create contacts\r\n\t\tString row = csvFile.readLine();\r\n\t\t\r\n\t\twhile (row != null) {\r\n\t\t\t\r\n\t\t\tif (row.length()==0 || row.startsWith(\"#\") || row.startsWith(\";\") ) {\t\t\r\n\t\t\t\t\r\n\t\t\t\t//empty or comment row: skip\r\n\t\t\t\t\r\n\t\t\t} else if (!headerRowRead) {\r\n\t\t\t\t\r\n\t\t\t\t//header row is the first non-blank, not-comment row in the CSV file\r\n\t\t\t\t//the required header row contains the attribute names\r\n\t\t\t\t\r\n\t\t\t\theaderRowRead = true;\r\n\t\t\t\t\r\n\t\t\t\t//read header\r\n\t\t\t\theaderArray = parseCSVLine( row, true); \t\t\r\n\t\t\t\tLogger.debug(\"header: \" + row);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\r\n\t\t\t\tHashMap<String,String> contactObject = ContactsImport.getRowValues(headerArray, row);\r\n\t\t\t\tcreateContact(contactObject);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\trow = csvFile.readLine(); //read next line form csv file\r\n\t\t}\r\n\t\t\r\n\t\tLogger.debug(\"finished\");\r\n\r\n\t}", "@Override\n\tpublic void parseCSV(String csv) {\n\t\t\n\t}", "private ArrayList<CSVRecord> processCsvData(String csvFile) {\n ArrayList<CSVRecord> records = new ArrayList<>();\n\n File csvData = new File(\"src/main/resources/csv/\" + csvFile + \".csv\");\n\n try {\n CSVParser parser = CSVParser.parse(csvData, Charset.defaultCharset(), CSVFormat.EXCEL);\n records.addAll(parser.getRecords());\n } catch (IOException exception) {\n logger.error(\"Unable to parse CSV file: \" + exception.getMessage());\n }\n\n return records;\n }", "private void testDataReader() {\n File csv = new File(pathTest);\n try (FileReader fr = new FileReader(csv); BufferedReader bfr = new BufferedReader(fr)) {\n Logger.printInfo(\"Reading test data\");\n for (String line; (line = bfr.readLine()) != null; ) {\n String[] split = line.split(\",\");\n String data = textCleaner(split[indexData].toLowerCase());\n int label = Integer.parseInt(split[indexLabel].toLowerCase());\n\n linesTest.add(data);\n labelsTest.add(label);\n Logger.print(\"Reading size: \" + linesTest.size());\n }\n for (String l : linesTest) {\n matrixTest.add(wordVectorizer(l));\n }\n } catch (IOException ex) {\n Logger.printError(\"!! Test Data Not Reading !!\");\n System.exit(0);\n }\n }", "public void Read_Csv() {\n\t\t\n\t\tFile file = new File(\"Faucets.csv\");\n\t\tif(file.exists() == false) {\n\t\t\ttry {\n\t\t\t\t if (file.createNewFile()) {\n\t\t\t\t System.out.println(\"File created: \" + file.getName());\n\t\t\t\t } else {\n\t\t\t\t System.out.println(\"File already exists... Error\");\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\tFileWriter myWriter = new FileWriter(\"Faucets.csv\");\n\t\t\t\tmyWriter.write(\"Freebitco.in,3600,228,\");\n\t\t\t\tmyWriter.close();\n\t\t\t\t\n\t\t\t\t\n\t\t\t}catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Error\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//Reading the file\n\t\tString line = null;\n\t\ttry {\n\t\t\tFileReader fileReader = new FileReader(\"Faucets.csv\");\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\t\t\t\n\t\t\tint x = 0;\n\t\t\tint commacounter = 0;\n\t\t\tint commaposition[] = new int[3];\n\t\t\twhile((line = bufferedReader.readLine()) != null) {\n\t\t\t\t\n\t\t\t\twhile(x < line.length()) {\n\t\t\t\t\t\n\t\t\t\t\tif(line.charAt(x) == ',') {\n\t\t\t\t\t\tcommaposition[commacounter] = x;\n\t\t\t\t\t\tcommacounter +=1;\n\t\t\t\t\t}\n\t\t\t\t\tif(commacounter == 3) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tFaucets.site[amount_counter] = line.substring(0, commaposition[0]);\n\t\t\t\t\t\tFaucets.time[amount_counter] = Integer.parseInt(line.substring(commaposition[0]+1, commaposition[1]));\n\t\t\t\t\t\tFaucets.amount[amount_counter] = Integer.parseInt(line.substring(commaposition[1]+1, commaposition[2]));\n\t\t\t\t\t\tamount_counter += 1;\n\t\t\t\t\t\tcommacounter=0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tx+=1;\n\t\t\t\t}\n\t\t\t\tx=0;\n\t\t\t}\n\t\t\tbufferedReader.close();\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\n\t\t\t\n\t}", "public static void readCSV() throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\tString line;\n\t\tif((line = br.readLine()) != null) {\n\t\t\tsetCSVorder(line);\n\t\t}\n\t\t\n\t\twhile((line = br.readLine()) != null) {\n\t\t\tFlightState fs = getStateFromCSV(line);\n\t\t\tsendToKafka(fs);\n\t\t}\n\t\t\n\t\tbr.close();\n\t}", "@Override\n public void importCSV(File file) {\n System.out.println(\"oi\");\n System.out.println(file.isFile()+\" \"+file.getAbsolutePath());\n if(file.isFile() && file.getPath().toLowerCase().contains(\".csv\")){\n System.out.println(\"Entro\");\n try {\n final Reader reader = new FileReader(file);\n final BufferedReader bufferReader = new BufferedReader(reader);\n String[] cabecalho = bufferReader.readLine().split(\",\");\n int tipo;\n if(cabecalho.length == 3){\n if(cabecalho[2].equalsIgnoreCase(\"SIGLA\")){\n tipo = 1;\n System.out.println(\"TIPO PAIS\");\n }\n else {\n tipo = 2;\n System.out.println(\"TIPO CIDADE\");\n }\n }else {\n tipo = 3;\n System.out.println(\"TIPO ESTADO\");\n }\n \n while(true){\n String linha = bufferReader.readLine();\n if(linha == null){\n break;\n }\n String[] row = linha.split(\",\");\n switch (tipo) {\n case 1:\n Pais pais = new Pais();\n pais.setId(Long.parseLong(row[0]));\n pais.setNome(row[1]);\n pais.setSigla(row[2]);\n new PaisDaoImpl().insert(pais);\n break;\n case 2:\n Cidade cidade = new Cidade();\n cidade.setId(Long.parseLong(row[0]));\n cidade.setNome(row[1]);\n cidade.setEstado(Long.parseLong(row[2]));\n new CidadeDaoImpl().insert(cidade);\n break;\n default:\n Estado estado = new Estado();\n estado.setId(Long.parseLong(row[0]));\n estado.setNome(row[1]);\n estado.setUf(row[2]);\n estado.setPais(Long.parseLong(row[3]));\n new EstadoDaoImpl().insert(estado);\n break;\n }\n }\n \n } catch (FileNotFoundException ex) {\n Logger.getLogger(SQLUtilsImpl.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(SQLUtilsImpl.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "public List<Lender> readCSVFile(String path){\r\n\r\n List<Lender> inputList = new ArrayList<>();\r\n try{\r\n File inputF = new File(path);\r\n InputStream inputFS = new FileInputStream(inputF);\r\n BufferedReader br = new BufferedReader(new InputStreamReader(inputFS));\r\n // skip the header of the csv\r\n inputList = br.lines().skip(1).map(mapToItem).collect(Collectors.toList());\r\n br.close();\r\n } catch (IOException e) {\r\n throw new QuoteException(\"Error reading the csv file\", e);\r\n }\r\n\r\n return inputList ;\r\n }", "@Override\r\n\tpublic ArrayList<String> importCsv(File file) {\r\n\t\t\tFileReader monFichier = null;\r\n\t\t\tBufferedReader tampon = null;\r\n\t\t\tArrayList<String> aLImport = new ArrayList<String>();\r\n\t\t\tString[] tabString ;\r\n\t\t\tint sizeLine;\r\n\t\t\r\n\t\t\ttry {\r\n\t\t\t\t// file path\r\n\t\t\t\tmonFichier = new FileReader(file.getAbsolutePath());\r\n\t\t\t\ttampon = new BufferedReader(monFichier);\r\n\r\n\t\t\t\t// read the first line of the file .csv\r\n\t\t\t\tString ligneTemp = tampon.readLine();\r\n\t\t\t\ttabString = ligneTemp.split(\";\");\r\n\t\t\t\tthis.setNbColumnsRead(tabString.length);\r\n\t\t\t\t\r\n\t\t\t\t//Start of the actual content (first line only acting as a header)\r\n\t\t\t\tligneTemp = tampon.readLine();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t// faire la gestion des erreurs \r\n\t\t\t\t\t\t/*JOptionPane.showMessageDialog(this, \"Le fichier .csv n'est pas valide\", \"Erreur !\",\r\n\t\t\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);*/\r\n\t\t\t\t\r\n\t\t\t\t// read all the lines one by one and split them to keep the\r\n\t\t\t\t// structure's name\r\n\t\t\t\twhile (ligneTemp != null) {\t\t\t\t\t\r\n\t\t\t\t\ttabString = ligneTemp.split(\";\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tsizeLine = tabString.length;\r\n\t\t\t\t\t//This for start at 1 in order to skip the first cell, assuming it is always \"Start\" and is therefore not required in the ArrayList\r\n\t\t\t\t\tfor (int i = 1; i < sizeLine; i+=2) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!tabString[i].contains(\"End\")){\r\n\t\t\t\t\t\t\taLImport.add(tabString[i]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tligneTemp = tampon.readLine();\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (IOException exception) {\r\n\t\t\t\texception.printStackTrace();\r\n\t\t\t\treturn null;\r\n\t\t\t} finally {\r\n\t\t\t\ttry {\r\n\t\t\t\tif (tampon != null)\r\n\t\t\t\t{\r\n\t\t\t\t\ttampon.close();\r\n\t\t\t\t}\r\n\t\t\t\tif (monFichier != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmonFichier.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException exception1) {\r\n\t\t\t\t\texception1.printStackTrace();\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn aLImport;\t\r\n\t}", "public void readCsvFile(String path) {\n\n // make sure the ArrayList is empty before you start recording the data\n if (!Records.isEmpty()) {\n Records.clear();\n }\n try {\n // read data from the .csv file\n System.out.println(\"Reading array list....\");\n BufferedReader br = new BufferedReader(new FileReader(path));\n // Skip the first line\n String line = br.readLine();\n while ((line = br.readLine()) != null) {\n\n String[] fields = line.split(\",\");\n Record record = new Record( // the fields in .csv are jumbled\n Integer.parseInt(fields[2]), // skierID\n Integer.parseInt(fields[3]), // liftID\n Integer.parseInt(fields[1]), // dayNum\n Integer.parseInt(fields[4])); // time\n Records.add(record);\n }\n\n br.close();\n System.out.println(\"!!Reading completed!!\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void readInputDataFromCSV(String pathToCSVfile) throws IOException {\n\n // open the file\n BufferedReader reader = new BufferedReader(new FileReader(pathToCSVfile));\n // read line by line\n String line = null;\n Scanner scanner = null;\n int index = 0;\n inputPlayersList = new ArrayList<>();\n\n while ((line = reader.readLine()) != null) {\n Player pl = new Player();\n scanner = new Scanner(line);\n scanner.useDelimiter(\",\");\n while (scanner.hasNext()) {\n String data = scanner.next();\n if (index == 0)\n pl.setLastName(data);\n else if (index == 1)\n pl.setFirstName(data);\n else if (index == 2)\n pl.setCountry(data);\n else if (index == 3)\n pl.setTicketNumber(data);\n else\n System.out.println(\"Incorrect data: \" + data);\n index++;\n }\n index = 0;\n inputPlayersList.add(pl);\n\n }\n //close reader\n reader.close();\n }", "private void readFile() {\r\n\t\tcsvEntrys = new ArrayList<>();\r\n\t\tString line = \"\";\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(filepath)))) {\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tif (!line.contains(\"id\")) {\r\n\t\t\t\t\tcsvEntrys.add(line);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void loadAllCountData(){\n // load from csv\n try{\n FileReader file = new FileReader(\"/home/ubuntu/user_counts_small.csv\");\n //FileReader file = new FileReader(\"/Users/YHWH/Desktop/cloud computing/team project/user_counts.csv\");\n BufferedReader buff = new BufferedReader(file);\n String line = \"\";\n boolean eof = false;\n\n while(!eof){\n line = buff.readLine();\n if(line == null){\n eof = true;\n }\n else{\n String[] data = line.split(\"\\t\"); //0->id, 1->selfCount, 2->prevCount\n wholeCountData.put(data[0], Integer.parseInt(data[2]));\n }\n }\n buff.close();\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }", "@Override\n public List<TimetableUpload> parseCsvFile(MultipartFile file) {\n try (Reader reader = new BufferedReader(new InputStreamReader(file.getInputStream()))) {\n // create csv bean reader\n CsvToBean<TimetableUpload> csvToBean = new CsvToBeanBuilder(reader)\n .withType(TimetableUpload.class)\n .withIgnoreLeadingWhiteSpace(true)\n .build();\n return csvToBean.parse();\n } catch (IOException e) {\n System.err.println(\"Something went wrong while parsing the csv file\");\n return null;\n }\n }", "public void readEntityCSV(String line) {\n List<String> items = Arrays.asList(line.split(\",\"));\n this.setId(Long.valueOf(items.get(0)));\n this.noOfRounds = Integer.parseInt(items.get(1));\n this.caliber = Float.parseFloat(items.get(2));\n this.manufacturer = items.get(3);\n this.price = Float.parseFloat(items.get(4));\n }", "public void loadCSVData() throws IOException, SQLException {\r\n //SQL statement to load csv information into data table\r\n String insertvaluesSQL = \"INSERT INTO data\"\r\n + \"(InvoiceNo, StockCode, Description, Quantity, InvoiceDate, UnitPrice, CustomerID, Country)\"\r\n + \" VALUES (?,?,?,?,?,?,?,?);\";\r\n\r\n //code to read csv file taken from W03 practical\r\n BufferedReader br = new BufferedReader(new FileReader(filePath));\r\n String line = br.readLine();\r\n String[] informationArray;\r\n while (line != null) {\r\n informationArray = line.split(\",\");\r\n PreparedStatement preparedStatement = connection.prepareStatement(insertvaluesSQL);\r\n //the first '?' corresponds to the 0th term in the information array\r\n //the second '?' corresponds to the 1st term in the information array\r\n for (int i = 1; i < 9; i++) {\r\n preparedStatement.setString(i, informationArray[i - 1]);\r\n }\r\n preparedStatement.executeUpdate();\r\n line = br.readLine();\r\n }\r\n Statement statement = connection.createStatement();\r\n statement.executeUpdate(\"DELETE FROM data WHERE InvoiceNo = 'InvoiceNo';\");\r\n statement.close();\r\n }", "public void openPlayerDataFromCSV() throws FileNotFoundException {\n csvReader = new BufferedReader(new FileReader(PATH_TO_CSV));\n }", "public String[] parseLine() {\n String[] tokens = null;\n try {\n tokens = csvReader.readNext();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return tokens;\n }", "@Override\n public ToDoList readCSV(String csvPath) throws InvalidArgumentException {\n this.csvPath = csvPath;\n this.toDoList = new ToDoList();\n\n BufferedReader inputFile = null;\n try {\n inputFile = new BufferedReader(new FileReader(this.csvPath));\n\n String line = inputFile.readLine();\n if (line == null) {\n inputFile.close();\n return this.toDoList;\n } // Empty CSV file, no need for processing.\n this.processHeader(line);\n while ((line = inputFile.readLine()) != null) {\n this.processToDoItem(line);\n }\n inputFile.close();\n return this.toDoList;\n } catch (FileNotFoundException fnfe) {\n throw new InvalidArgumentException(\"OOPS! File not found!\");\n } catch (IOException ioe) {\n throw new InvalidArgumentException(\"There is somthing wrong!\");\n }\n }", "public void read()\r\n\t{\r\n\t\tScanner input = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint i = 0;\r\n\r\n\t\t\tinput = new Scanner(new File(\"netflix.csv\")).useDelimiter(\"[,\\r\\n]\");\r\n\r\n\t\t\twhile (input.hasNext())\r\n\t\t\t{\r\n\t\t\t\tinput.nextLine();\r\n\t\t\t\tString title = input.next();\r\n\r\n\t\t\t\tString rating = input.next();\r\n\r\n\t\t\t\tint year = Integer.parseInt(input.next());\r\n\r\n\t\t\t\tint score = Integer.parseInt(input.next());\r\n\t\t\t\tMovie a = new Movie(title, rating, year, score);\r\n\t\t\t\tdata[i] = a;\r\n\t\t\t\ti++;\r\n\t\t\t\tactualSize++;\r\n\r\n\t\t\t}\r\n\t\t\tinput.close();\r\n\r\n\t\t}\r\n\t\tcatch (FileNotFoundException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"File not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test\r\n public void readCsvFile() throws FileNotFoundException, IOException { \r\n CsvReader csvr = new CsvReader(CSV_FILE);\r\n \r\n List<NetworkElement> nes = csvr.getNetworkElements();\r\n assertEquals(55,nes.size()); \r\n }", "public void readFile(){\r\n\t\tFileInputStream inputStream = null;\r\n\t\tScanner scan = null;\r\n\t\tString path = \"C:/Users/spandya/workspace/LatestPrice.csv\";\r\n\t\ttry {\r\n\t\t\tinputStream = new FileInputStream(path);\r\n\t\t\tscan = new Scanner(inputStream, \"UTF-8\");\r\n\t\t\twhile(scan.hasNext()){\r\n\t\t\t\tString line = scan.nextLine();\r\n\t\t\t\tString firstWord = line.split(\",\")[0];\r\n\t\t\t\tString latestPrice = line.substring(line.lastIndexOf(\",\")+1);\r\n\t\t\t\tSystem.out.println(firstWord+\":\"+latestPrice);\r\n\t\t\t}\r\n\t\t\tif(scan.ioException() != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthrow scan.ioException();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tif(inputStream != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tinputStream.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(scan != null){\r\n\t\t\t\tscan.close();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static public List<Product> productReader() throws IOException {\n BufferedReader csvReader = new BufferedReader(new FileReader(PRODUCTS_REFERENCE_FILE));\n String row;\n List<Product> dataList = new ArrayList<>();\n\n row = csvReader.readLine();\n while ((row = csvReader.readLine()) != null){\n\n Product data = new Product();\n //I separate the row data by a separator, a coma in this case and add all the data in the class\n String[] datas = row.split(SEPARATOR_COLON);\n\n data.setProduct_id(Integer.parseInt(datas[0]));\n data.setName(datas[1]);\n data.setDescription(datas[2]);\n data.setCategory_id(Integer.parseInt(datas[3]));\n\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"MM/dd/yyyy\");\n\n //Since some dates had just one number for the month, I had to use this to add a 0\n //to make all the dates the same length after getting rid of the 0:01 that was not necessary\n String[] creationDate = datas[4].split(\" \");\n if(creationDate[0].length() == 9){\n creationDate[0] = \"0\"+ creationDate[0];\n }\n data.setCreation_date(LocalDate.parse(creationDate[0], formatter));\n\n creationDate = datas[5].split(\" \");\n if(creationDate[0].length() == 9){\n creationDate[0] = \"0\"+ creationDate[0];\n }\n data.setUpdate_date(LocalDate.parse(creationDate[0], formatter));\n\n creationDate = datas[6].split(\" \");\n if(creationDate[0].length() == 9){\n creationDate[0] = \"0\"+ creationDate[0];\n }\n data.setLast_purchased_date(LocalDate.parse(creationDate[0], formatter));\n\n dataList.add(data);\n\n }\n return dataList;\n\n }", "private void readData () throws SQLException {\n int currentFetchSize = getFetchSize();\n setFetchSize(0);\n close();\n setFetchSize(currentFetchSize);\n moveToInsertRow();\n\n CSVRecord record;\n\n for (int i = 1; i <= getFetchSize(); i++) {\n lineNumber++;\n try {\n\n if (this.records.iterator().hasNext()) {\n record = this.records.iterator().next();\n\n for (int j = 0; j <= this.columnsTypes.length - 1; j++) {\n\n switch (this.columnsTypes[j]) {\n case \"VARCHAR\":\n case \"CHAR\":\n case \"LONGVARCHAR\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateString(j + 1, record.get(j));\n break;\n case \"INTEGER\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateInt(j + 1, Integer.parseInt(record.get(j)));\n break;\n case \"TINYINT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateByte(j + 1, Byte.parseByte(record.get(j)));\n break;\n case \"SMALLINT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateShort(j + 1, Short.parseShort(record.get(j)));\n break;\n case \"BIGINT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateLong(j + 1, Long.parseLong(record.get(j)));\n break;\n case \"NUMERIC\":\n case \"DECIMAL\":\n /*\n * \"0\" [0,0]\n * \"0.00\" [0,2]\n * \"123\" [123,0]\n * \"-123\" [-123,0]\n * \"1.23E3\" [123,-1]\n * \"1.23E+3\" [123,-1]\n * \"12.3E+7\" [123,-6]\n * \"12.0\" [120,1]\n * \"12.3\" [123,1]\n * \"0.00123\" [123,5]\n * \"-1.23E-12\" [-123,14]\n * \"1234.5E-4\" [12345,5]\n * \"0E+7\" [0,-7]\n * \"-0\" [0,0]\n */\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateBigDecimal(j + 1, new BigDecimal(record.get(j)));\n break;\n case \"DOUBLE\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateDouble(j + 1, Double.parseDouble(record.get(j)));\n break;\n case \"FLOAT\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateFloat(j + 1, Float.parseFloat(record.get(j)));\n break;\n case \"DATE\":\n // yyyy-[m]m-[d]d\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateDate(j + 1, Date.valueOf(record.get(j)));\n break;\n case \"TIMESTAMP\":\n // yyyy-[m]m-[d]d hh:mm:ss[.f...]\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateTimestamp(j + 1, Timestamp.valueOf(record.get(j)));\n break;\n case \"TIME\":\n // hh:mm:ss\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateTime(j + 1, Time.valueOf(record.get(j)));\n break;\n case \"BOOLEAN\":\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateBoolean(j + 1, convertToBoolean(record.get(j)));\n break;\n default:\n if (getStringOrNull(record.get(j)) == null) updateNull(j + 1);\n else updateString(j + 1, record.get(j));\n break;\n }\n }\n\n insertRow();\n incrementRowCount();\n }\n } catch (Exception e) {\n LOG.error(\"An error has occurred reading line number {} of the CSV file\", lineNumber, e);\n throw e;\n }\n }\n\n moveToCurrentRow();\n beforeFirst(); \n }", "@Override\n DBO consume(String csv) throws TransformerException;", "private Iterable<CSVRecord> obtainCsvIterable()\n throws FileNotFoundException, IOException {\n return CSVFormat.RFC4180\n .withFirstRecordAsHeader()\n .parse(this.fileReader);\n\n }", "@SuppressWarnings(\"resource\")\r\n\tpublic static ArrayList<UserInfo> getUserDataFromCsvFile()\r\n\t{\r\n\t\t\r\n\t\tArrayList<UserInfo> unfList=null;\r\n\t\ttry{\r\n\t\t\tFile myObj= new File(\"E:\\\\Selenium Setup\\\\datadriven.csv\");\r\n\t\t\tunfList = new ArrayList<UserInfo>();\r\n\t\t\tScanner myReader= new Scanner(myObj);\r\n\t\t\tint count=0;\r\n\t\t\twhile (myReader.hasNextLine()) \r\n\t\t\t{\r\n\t\t\t\tString data= myReader.nextLine();\r\n\t\t\t\tif (count !=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tString[] info =data.split(\"\\\\,\");\r\n\t\t\t\t\tunfList.add(new UserInfo(info[0],info[1]));\r\n\t\t\t\t\t//unfList.add(new UserInfo(info[0], info[1]));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t++count;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}catch (Exception e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t}\r\n\t\t\treturn unfList;\r\n\t}", "@Override\n protected void processLine(String line) {\n String[] lines = line.split(\",\");\n for (String l : lines) {\n data.add(l);\n }\n }", "public void fillBoardFromCSV(String pathToCSV){\r\n \r\n BufferedReader br = null;\r\n String line = \" \";\r\n int index = 0;\r\n \r\n \r\n try{\r\n br = new BufferedReader(new FileReader(pathToCSV));\r\n while ((line = br.readLine()) != null) {\r\n String[] lines = line.split(\",\");\r\n System.out.println(lines.length);\r\n for(int i = 0; i < 11; i++){\r\n if(lines[i].equals(\"f\")){\r\n board[index][i] = new Flat(index,i);\r\n }\r\n if(lines[i].equals(\"s\")){\r\n board[index][i] = new Slot(index,i);\r\n }\r\n }\r\n index++; \r\n }\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n if (br != null) {\r\n try {\r\n br.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n \r\n \r\n }", "private boolean readData(String aCSVFilename)\n {\n try\n {\n // open the chosen file\n File file = new File(aCSVFilename);\n BufferedReader bufRdr = new BufferedReader(new FileReader(file));\n\n // read each line of text file\n String line = null;\n while ((line = bufRdr.readLine()) != null)\n {\n StringTokenizer st = new StringTokenizer(line, \",\");\n while (st.hasMoreTokens())\n {\n String key = st.nextToken();\n String value = st.nextToken();\n processKeyValuePair(key, value);\n }\n }\n //close the file\n bufRdr.close();\n return true;\n }\n catch (Exception e)\n {\n return false;\n }\n }", "@Test\r\n\tpublic void readCsvTest() throws IOException {\r\n\t\t\tfail(\"Not yet implemented\");\r\n\t}", "private static List<String> parseLine(String csvLine) {\n List<String> result = new ArrayList<>();\n if (Objects.isNull(csvLine) || csvLine.isEmpty()) {\n return result;\n }\n StringBuilder charSet = new StringBuilder();\n char[] chars = csvLine.toCharArray();\n for (char character : chars) {\n if (character == DEFAULT_SEPARATOR) {\n result.add(charSet.toString().trim());\n charSet = new StringBuilder();\n } else {\n charSet.append(character);\n }\n }\n result.add(charSet.toString().trim());\n return result;\n }", "@Test\n\tpublic void testReadCsvFile() throws FileNotFoundException {\n\t\tFileParser fp = new FileParser();\n\t\tArrayList<String> parsedLines = fp.readCsvFile(\"movies.csv\");\n\t\tassertEquals(\"toy story\", parsedLines.get(0));\n\t}", "void loadCrimeList(InputStream inputStream) {\n // Define a scanner\n try (Scanner scanner = new Scanner(inputStream)) {\n\n // While the scanner has another line to read\n while (scanner.hasNextLine()) {\n\n // Get the next link and split it into parts\n String line = scanner.nextLine();\n String parts[] = line.split(\",\");\n\n //Assign each part to a local var\n String id = parts[0];\n String title = parts[1];\n String dateString = parts[2];\n String solvedString = parts[3];\n\n UUID uuid = UUID.fromString(id);\n Date date = new SimpleDateFormat(\n \"yyyy-MM-dd\",\n Locale.getDefault()\n ).parse(dateString);\n boolean isSolved = (solvedString.equals(\"1\"));\n\n // Add the Crime to the Crime list\n mCrimes.add(\n new Crime(\n uuid,\n title,\n date,\n isSolved\n )\n );\n }\n\n // Date read in, so set the dataLoadedOnce flag to true.\n mDataLoadedOnce = true;\n\n } catch (Exception e) {\n Log.e(\"Read CSV\", e.toString());\n }\n }", "public static List readCsvFile(String fileName) {\n logger.info(\"Start executing readCsvFile method !!!\");\n FileReader fileReader = null;\n CSVParser csvFileParser = null;\n List csvRecords = null;\n try {\n //initialize FileReader object\n fileReader = new FileReader(fileName);\n //initialize CSVParser object\n csvFileParser = new CSVParser(fileReader, CSVFormat.EXCEL);\n //Get a list of CSV file records\n csvRecords = csvFileParser.getRecords();\n } catch (Exception e) {\n logger.error(\"Error in CsvFileReader !!!\");\n e.printStackTrace();\n logger.error(\"Exception : \", e);\n } finally {\n try {\n fileReader.close();\n csvFileParser.close();\n } catch (IOException e) {\n logger.error(\"Error while closing fileReader/csvFileParser !!!\");\n e.printStackTrace();\n logger.error(\"IOException : \", e);\n }\n }\n return csvRecords;\n }", "public void readRestaurantDetail (BufferedReader reader) {\n\n\n try {\n // Each line of CSV will be stored in this String\n String line = \"\";\n reader.readLine();\n int id = 0;\n while ((line = reader.readLine()) != null) {\n// count++;\n\n // line will be split by \",\", into an array of String\n String[] eachDetailsOfRestaurant = line.split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\n\n // Restaurant object created with the tracking number and name.\n Restaurant restaurant = new Restaurant(eachDetailsOfRestaurant[0], eachDetailsOfRestaurant[1], id);\n\n// Log.e(\"checking..............\", count.toString() + \" \" + restaurant.getName());\n\n // Converting coordinates to double and creating Location object\n for (int i = 0; i < eachDetailsOfRestaurant.length; i++) {\n Log.e(TAG, \"\" + i + \":\" + eachDetailsOfRestaurant[i]);\n }\n Double latitude = Double.parseDouble(eachDetailsOfRestaurant[5]);\n Double longitude = Double.parseDouble(eachDetailsOfRestaurant[6]);\n Location location = new Location(eachDetailsOfRestaurant[2], eachDetailsOfRestaurant[3], latitude, longitude);\n\n // Setting Location of the restaurant and adding to the Arraylist\n restaurant.setLocation(location);\n restaurants.add(restaurant);\n id++;\n }\n Collections.sort(restaurants);\n } catch (IOException e) {\n// e.printStackTrace();\n }\n }", "@Override\n\tpublic void configuration(String csv) {\n\n\t}", "public void readToCsv() {\r\n\r\n String seperator = \";\";\r\n\r\n try (BufferedReader reader = new BufferedReader(\r\n new FileReader(\"Products.csv\"))){\r\n\r\n String line = null;\r\n for(int i=1; (line = reader.readLine()) != null; i++) {\r\n String[] fields = line.split(seperator, -1);\r\n\r\n // For nutrients objects to read\r\n if(fields.length ==5){\r\n Nutrient object= new Nutrient();\r\n object.name = fields[0];\r\n object.price = Double.parseDouble(fields[1]);\r\n object.tag=fields[2];\r\n object.content = fields[3];\r\n object.numOfProduct = Integer.parseInt(fields[4]);\r\n //object.addFeatures(object.name,object.price,object.size,object.gender,object.tag,object.content,object.numOfProduct);\r\n NutrientList.add(object);\r\n allProducts.add(object);\r\n }\r\n // For Cosmetics objects to read\r\n if (fields.length==6){\r\n Cosmetics object2=new Cosmetics();\r\n object2.name = fields[0];\r\n object2.price = Double.parseDouble(fields[1]);\r\n object2.gender = fields[2];\r\n object2.tag=fields[3];\r\n object2.content = fields[4];\r\n object2.numOfProduct = Integer.parseInt(fields[5]);\r\n //object2.addFeatures(object2.name,object2.price,object2.size,object2.gender,object2.tag,object2.content,object2.numOfProduct);\r\n CosmeticsList.add(object2);\r\n allProducts.add(object2);\r\n }\r\n // For clothes objects to read\r\n if(fields.length ==7){\r\n\r\n Clothes object3=new Clothes();\r\n object3.name = fields[0];\r\n object3.price = Double.parseDouble(fields[1]);\r\n object3.size= fields[2];\r\n object3.tag=fields[4];\r\n object3.content = fields[5];\r\n object3.numOfProduct = Integer.parseInt(fields[6]);\r\n object3.addFeatures(object3.name,object3.price,object3.size,\"E\",object3.tag,object3.content,object3.numOfProduct);\r\n ClothesList.add(object3);\r\n allProducts.add(object3);\r\n }\r\n\r\n }}\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "protected static ArrayList<String> load() throws Exception {\r\n\t\tArrayList<String> list;\r\n\t\tFileReader fileRead = new FileReader(csv);\r\n\t\tBufferedReader buff = Files.newBufferedReader(Paths.get(\"story.csv\"));\r\n\t\tlist = buff.lines().map(line -> line.split(\",\")).flatMap(Arrays::stream)\r\n\t\t\t\t.collect(Collectors.toCollection(ArrayList::new));\r\n\t\tbuff.close();\r\n\t\tfileRead.close();\r\n\r\n\t\treturn list;\r\n\t}", "public static ArrayList<ArrayList<String>> getAllDataFromFile(String csvInputPath, char sep) {\n ArrayList<ArrayList<String>> allData = new ArrayList<>();\r\n try (CSVReader reader = new CSVReader(new InputStreamReader(new FileInputStream(csvInputPath)), sep, '\"', '|');) {\r\n String[] nextLine;\r\n int numRow = 0;\r\n while ((nextLine = reader.readNext()) != null && numRow < MAX_ROW_NUMBER) {\r\n ArrayList<String> allRow = new ArrayList<>();\r\n allRow.addAll(Arrays.asList(nextLine));\r\n allData.add(allRow);\r\n numRow += 1;\r\n }\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(ManageExcel.class\r\n .getName()).log(Level.SEVERE, null, ex);\r\n\r\n } catch (IOException ex) {\r\n Logger.getLogger(ManageExcel.class\r\n .getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return allData;\r\n }", "public static List<String> parseCSVFile(final String filePath) {\n\t\tLOG.info(\"Entred in to parseCSVFile()\");\n\t\tLOG.info(\"File path is : {}\", filePath);\n\n\t\tList<String> dataList = new ArrayList<>();\n\t\tCSVReader csvReader = null;\n\t\ttry {\n\t\t\tcsvReader = new CSVReader(new FileReader(filePath));\n\t\t\tString[] nextLine;\n\t\t\tint lineNumber = 0;\n\t\t\twhile ((nextLine = csvReader.readNext()) != null) {\n\t\t\t\tlineNumber++;\n\t\t\t\tif (lineNumber == 1)\n\t\t\t\t\tcontinue;\n\t\t\t\tString data = String.join(ReportingDataConstants.CSV_DATA_SPERATOR, nextLine);\n\t\t\t\tLOG.info(\"The data is {}\", data);\n\t\t\t\tdataList.add(data);\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"CSV File not found, please check the file paths\");\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"CSV File parse exception, please check the file format\");\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (csvReader != null)\n\t\t\t\t\tcsvReader.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tLOG.error(\"Exception occured while closing reader: {}\", e.getLocalizedMessage());\n\t\t\t}\n\t\t}\n\n\t\tLOG.info(\"Exit from parseCSVFile()\");\n\t\treturn dataList;\n\t}", "public void loadFromCsv(String filePath) throws Exception {\n\tBufferedReader br=new BufferedReader(new FileReader(filePath));\n\tString line=\"\";\n\tint i=0;\n\n\tline=br.readLine();\n\tthis.gen=Integer.parseInt(line);\n\t\n\twhile((line=br.readLine()) != null) {\n\t this.setBna(i,line);\n\t i++;\n\t}\n\tbr.close();\n }", "private static ArrayList<Ms3Person> readCSV(String fileName) {\r\n\t\tArrayList<Ms3Person> personsList = new ArrayList<>();\r\n\t\ttry (Scanner sc = new Scanner(new File(fileName))) {\r\n\t\t\t// skip the first line which is having column headers name\r\n\t\t\tsc.nextLine();\r\n\t\t\tint index = 1;\r\n\t\t\t// loop will go till end of file is reached ie.\r\n\t\t\twhile (sc.hasNextLine()) {\r\n\t\t\t\t// read single line at a time\r\n\t\t\t\tString personData = sc.nextLine();\r\n\t\t\t\tif(index >=5999)\r\n\t\t\t\t\tSystem.out.println(index+\" index\"+personData);\r\n\t\t\t\t//System.out.println(personData);\r\n\t\t\t\t//split the string by delimiter ,\r\n\t\t\t\tif(personData.length()>2) {\r\n\t\t\t\t\tString singlePersonRecord[] = personData.split(\",\");\r\n\t\t\t\t\t//the data we get is in form of sTring we need to convert\r\n\t\t\t\t\t//it to required data type for usage\r\n\t\t\t\t\tMs3Person person = convertDataToRequiredDataType(singlePersonRecord,index);\r\n\t\t\t\t\tif (person != null) {\r\n\t\t\t\t\t\t// add the person object in ArrayList\r\n\t\t\t\t\t\tpersonsList.add(person);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// bad data so create new file & write data\r\n // writing to the logfile\r\n \r\n \r\n\t\t\t\t\t}\r\n\t\t\t\t\tSystem.out.println(\"index: \" + index);\r\n\t\t\t\t}else {\r\n\t\t\t\t\tif(personData.length()<1) {//if no more line is there or only empty lines left\r\n\t\t\t\t\t\tSystem.out.println(\"finished reading the file...\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// if any exception arises while reading the file data that exception\r\n\t\t\t// will be caught in this block\r\n\t\t\tSystem.out.println(\"EXCEPTION: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn personsList;\r\n\t}", "private static List<String> readData(String path) throws IOException{\n ArrayList<String> data = new ArrayList<>();\n try (\n Reader reader = Files.newBufferedReader(Paths.get(path), StandardCharsets.UTF_8);\n CSVReader csvReader = new CSVReader(reader)\n ){\n String[] nextRecord;\n while ((nextRecord = csvReader.readNext()) != null) {\n if (nextRecord[0].contains(\"name\")){\n System.out.println(\"Skipping column headers...\");\n }else {\n data.add(nextRecord[0]);\n// System.out.println(nextRecord[0]);\n }\n }\n }\n return data;\n }", "public List<Country> readCountriesFromCSV(String fileName){\n try {\n Scanner scanner = new Scanner(new File(fileName));\n scanner.useDelimiter(\",\");\n scanner.nextLine();\n while(scanner.hasNextLine()){\n lsta.add(createCountry(scanner.nextLine().split(\",\")));\n// System.out.println(pyr.get_pharaoh()+\"|\"+pyr.get_modern_name()+\"|\"+pyr.get_site()+\"|\"+pyr.get_height()+\"|\");\n }\n scanner.close();\n } catch (FileNotFoundException ex) {\n Logger.getLogger(CityCSVDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return lsta;\n }", "public int loadData(Reader csv, KeywordFactory kwf) \n throws InterruptedException, IOException\n {\n return loadData(csv, kwf, false);\n }", "@Override\n\tpublic void importData(String filePath) {\n\t\tString[] allLines = readFile(filePath);\n\n\t\t//Obtains the date to give to all sales from the cell in the first line and first column of the csv\n\t\t//And formats it into the expected format.\n\t\tString[] firstLine = allLines[0].split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1);\n\t\tString[] title = firstLine[0].split(\"\\\\(\");\n\t\tSimpleDateFormat oldFormat = new SimpleDateFormat(\"MMMMM, yyyy\");\n\t\tSimpleDateFormat newFormat = new SimpleDateFormat(\"MMM yyyy\");\n\t\tDate date = null;\n\t\ttry {\n\t\t\tdate = oldFormat.parse(title[1].replaceAll(\"[()]\", \"\"));\n\t\t} catch (ParseException e) {\n\t\t\tSystem.out.println(\"There was parsing the date in the first cell of the first line of the csv.\\n\" \n\t\t\t\t\t+ \" A date of the format 'October, 2017' was expected.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.monthAndYear = newFormat.format(date);\n\n\t\t//Parses data for each currency and places it in class variable listForex by calling importForex() on each currency line of csv\n\t\t//Considers that the first line of currencies is the fourth line of csv.\n\t\t//Stops if counter reaches the total number of lines of csv, or if the line is shorter than 15 characters,\n\t\t//so that it doesn't try to parse the summary lines below the last currency line.\n\t\tint counter = 3;\n\t\twhile (counter< allLines.length && allLines[counter].length() > 15) {\n\t\t\timportForex(allLines[counter]);\n\t\t\tcounter++;\n\t\t}\n\n\t\tChannel apple = obtainChannel(\"Apple\", new AppleFileFormat(), false);\n\n\t\t//Places the imported data in the app,\n\t\t//making sure not to replace the existing list of FX rates for this month and year if there is one.\n\t\t//It does however update the FX rate value for currencies that are already in the data for this month.\n\t\tif (apple.getHistoricalForex().containsKey(monthAndYear)) {\n\t\t\tHashMap<String, Double> existingList = apple.getHistoricalForex().get(monthAndYear);\n\t\t\tfor (String s : existingList.keySet()) {\n\t\t\t\tlistForex.put(s, existingList.get(s));\n\t\t\t}\t\n\t\t}\n\t\tapple.addHistoricalForex(monthAndYear, listForex);\n\t}", "public void loadListFromCsv() {\n List<Publication> list = new ArrayList<>();\n String line;\n try(BufferedReader bufferedReader = new BufferedReader(new FileReader(\"saves/data.csv\"))){\n while ((line = bufferedReader.readLine()) != null){\n String[] attributes = line.split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\n String[] formattedAttributes = formatAttributes(attributes);\n Publication book = createPublicationFromAttributes(formattedAttributes);\n list.add(book);\n }\n } catch (IOException e){\n System.out.println(\"IOException occurred: \" + e.getMessage());\n }\n\n this.library = list;\n }", "private void loadConfigData() {\n Properties configProps = new Properties();\n FileInputStream fis = null;\n try {\n fis = new FileInputStream(\"/Users/mac/expenseTrackerCsv.config\");\n configProps.load(fis);\n fis.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n CSVReader reader = null;\n\t\tList<String> headings = new ArrayList<>();\n\t\ttry {\n\t\t\t/* CSV Positions */\n\t\t\treader = new CSVReader(new FileReader(CSV_SOURCE_POSITIONS), ',');\n\t\t\tString [] nextLine = null;\n\t\t\tint count = 0;\n\t\t\twhile ((nextLine = reader.readNext()) != null) {\n\t\t\t\ttry {\n\t\t\t\t\tfor (String heading : nextLine) {\n\t\t\t\t\t\tif (heading.equalsIgnoreCase(TranInfoBean.DATE)) {\n\t\t\t\t\t\t\tTranInfoBean.datePosSrc = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.AMOUNT)) {\n\t\t\t\t\t\t\tTranInfoBean.amtPosSrc = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.BALANCE)) {\n\t\t\t\t\t\t\tTranInfoBean.balPosSrc = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.DESCRIPTION)) {\n\t\t\t\t\t\t\tTranInfoBean.descPosSrc = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n }\n\t\t\t}\n\t\t\treader.close();\n\t\t\treader = new CSVReader(new FileReader(CSV_OUT_POSITIONS), ',');\n\t\t\tnextLine = null;\n\t\t\tcount = 0;\n\t\t\twhile ((nextLine = reader.readNext()) != null) {\n\t\t\t\ttry {\n\t\t\t\t\tfor (String heading : nextLine) {\n\t\t\t\t\t\tif (heading.equalsIgnoreCase(TranInfoBean.DATE)) {\n\t\t\t\t\t\t\tTranInfoBean.datePosOut = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.AMOUNT)) {\n\t\t\t\t\t\t\tTranInfoBean.amtPosOut = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.BALANCE)) {\n\t\t\t\t\t\t\tTranInfoBean.balPosOut = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.DESCRIPTION)) {\n\t\t\t\t\t\t\tTranInfoBean.descPosOut = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.CATEGORY1)) {\n\t\t\t\t\t\t\tTranInfoBean.cat1PosOut = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.CATEGORY2)) {\n\t\t\t\t\t\t\tTranInfoBean.cat2PosOut = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (heading.equalsIgnoreCase(TranInfoBean.MATCH)) {\n\t\t\t\t\t\t\tTranInfoBean.matchPosOut = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n }\n\t\t\t}\n\t\t\t/* Categories */\n\t\t\treader.close();\n\t\t\tnextLine = null;\n\t\t\tcount = 0;\n\t\t\ttry {\n\t\t\t\treader = new CSVReader(new FileReader(CATEGORY_FILE1), ',');\n\t\t\t\tnextLine = null;\n\t\t\t\tif ((nextLine = reader.readNext()) != null) {\n\t\t\t\t\tfor (String s : nextLine) {\n\t\t\t\t\t\tCAT1.add(s.toUpperCase());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\treader = new CSVReader(new FileReader(CATEGORY_FILE2), ',');\n\t\t\t\tnextLine = null;\n\t\t\t\tif ((nextLine = reader.readNext()) != null) {\n\t\t\t\t\tfor (String s : nextLine) {\n\t\t\t\t\t\tCAT2.add(s.toUpperCase());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tloadCategoryMatches();\n\t\t\n\t}", "public Set<Airport> loadFile(final String csvFile) throws CoreException;", "List<String[]> readCsv(String inputFilePath)throws IOException;", "public void readFile() \n\t{\n\t\tArrayList<String> tempStations = new ArrayList<>();\n\t\t//create arraylist local variable tempStations which will hold the list of stations temporarily for a specific line to be added to the stations hashmap \n\n\t\tString mtrSystemFile = \"MTRsystem_partial.csv\";\n\t\t//store the csv file name in a string\n\t\tFile file = new File(mtrSystemFile);\n\t\t//create a file object for the MTRSystems csv file\n\n\t\ttry \n\t\t{\n\t\t\tScanner inputStream = new Scanner(file);\n\t\t\t//pass the file through to new scanner object to be scanned\n\n\t\t\twhile (inputStream.hasNext())\n\t\t\t//so long as the scanner object has another token to read from the csv file\n\t\t\t{\n\t\t\t\tString line = inputStream.nextLine();\n\t\t\t\t//store the next line in the string variable\n\t\t\t\tcells = line.split(\",\");\n\t\t\t\t//split each line into cells separated by a comma\n\t\t\t\tint celli = 1;\n\t\t\t\t//assign int index to 1, so that only stations are read excluding line name stored at position 0\n\n\t\t\t\twhile (celli <= cells.length - 1)\n\t\t\t\t//whilst the index is less than or equal the last position of the array\n\t\t\t\t{\n\t\t\t\t\tif (celli == 1 || celli == cells.length - 1)\n\t\t\t\t\t//if the index is at the second position in the array or at the last\n\t\t\t\t\t{\n\t\t\t\t\t\tallTermini.add((cells[celli]));\n\t\t\t\t\t\t//add termini to the ArrayList\n\t\t\t\t\t}\n\t\t\t\t\ttempStations.add(cells[celli]);\n\t\t\t\t\t//add station to the ArrayList\n\t\t\t\t\tcelli++;\n\t\t\t\t}\n\n\t\t\t\taddToStations(cells[0], tempStations);\n\t\t\t\t//add the line name and the list of stations for that line to the hashmap\n\t\t\t\ttempStations.clear();\n\t\t\t\t//Clear the temporary list for the next line\n\n\t\t\t\tcells = null;\n\t\t\t}\n\t\t\tinputStream.close();\n\t\t} catch (FileNotFoundException e) \n\t\t{\n\t\t\tSystem.out.println(\"file not found\");\n\t\t}\n\t}", "static public void readCSVData(String csvFile, String imagePath)\n\t{\t\n String line = \"\";\n String cvsSplitBy = \"\\t\";\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(csvFile), \"UTF8\"))) {\n\n while ((line = br.readLine()) != null) {\n String[] dataMovie = line.split(cvsSplitBy);\n //System.out.println(\"Nom: \" + dataMovie[0] + \"\\nDate de sortie: \" + dataMovie[1] + \"\\nRealisateur: \" + dataMovie[2] + \"\\nDescription: \" + dataMovie[3] + \"\\nLien de la BA: \" + dataMovie[4] + \"\\nLiens sceances: \" + dataMovie[5] + \"\\nNom fichier image: \" + dataMovie[6] + \"\\n\");\n\t\t\t\tmoviesDataTab.add(dataMovie[0] + \"\\t\" + dataMovie[1] + \"\\t\" + dataMovie[2] + \"\\t\" + dataMovie[3] + \"\\t\" + dataMovie[4] + \"\\t\" + dataMovie[5]);\n\t\t\t\timageTab.add(imagePath +\"/images/\" +dataMovie[6]);\n\t\t\t}\n } catch (IOException e) {\n e.printStackTrace();\n }\t\n\t}", "public void LoadFromCSV(){\n InputStream inputStream = getResources().openRawResource(R.raw.movielist);\n CSVinput csVinput = new CSVinput(inputStream);\n final List<String[]> movList = csVinput.read();\n\n for(String[] data : movList) {\n itemArrAdapt.add(data);\n }\n }", "List<String[]> readCsv(String inputFilePath,int skipLine)throws IOException;", "public void readData(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\r\n\r\n String line = \"\";\r\n try {\r\n while ((line = reader.readLine()) != null) {\r\n //Split line by \",\"\r\n String[] fields = line.split(\",\");\r\n //Log.d(\"csvParseFieldLength\", String.valueOf(fields.length));\r\n ArrayList<Race> races = new ArrayList<>();\r\n if (fields[9].equals(\"\"))\r\n break;\r\n else {\r\n Swimmer s = new Swimmer(fields[0],fields[10], fields[9], Integer.parseInt(fields[8]), fields[7], races);\r\n swimmers.add(s);\r\n s.addRace(new Race(Integer.parseInt(fields[2]), Integer.parseInt(fields[3]), 0, null, (fields[4] + \" \" + fields[5])));\r\n \r\n EventID e = new EventID(eventId);\r\n String b = fields[12];\r\n \r\n \r\n if (!b.equals(\" \")) \r\n \te.addNames(b);\r\n \r\n \r\n \r\n }\r\n }\r\n } catch (IOException ex) {\r\n //Log.d(\"csvParseSwim\", \"Error reading data from file on line \" + line);\r\n }\r\n }", "public ArrayList<Player> importPlayerData() {\n \n try {\n //Try to access player.csv in the given directory\n\t\t\tFile file = new File(\"data\\\\player.csv\");\n Scanner fileIn = new Scanner(file);\n \n fileIn.skip(\"userName,fullName,password,gold,exp,noOfLand\");\n \n\t\t\t//Use comma as delimiter in extracting various player info\n\t\t\tfileIn.useDelimiter(\",|\\r\\n|\\n\");\n \n while (fileIn.hasNext()) {\n String userName = fileIn.next().trim();\n String fullName = fileIn.next().trim();\n String password = fileIn.next().trim();\n int gold = fileIn.nextInt();\n int exp = fileIn.nextInt();\n\t\t\t\tint noOfLand = fileIn.nextInt();\n\t\t\t\t\n\t\t\t\t//Create new players based on extracted info\n Player player = new Player(userName, fullName, password, gold, exp, noOfLand);\n\t\t\t\t\n\t\t\t\t//Add players to playerList\n playerList.add(player);\n }\n \n }\n \n catch (IOException e) {\n //Specify the location of IOException\n\t\t\te.printStackTrace();\n }\n\t\t\n\t\treturn playerList;\n\t}", "public static void readFromCSVIntoTable() {\n try {\n for (String tn : ORDERED_TABLE_NAMES) {\n handle.execute(buildInsertIntoFromCSV(tn));\n }\n } catch (Throwable e) {\n itsLogger.error(e.getMessage(), e);\n }\n\n }", "public void createArrayList() throws IOException,ParseException\r\n\t {\n\t \t\r\n\t try(ICsvBeanReader beanReader = new CsvBeanReader(new FileReader(CSV_FILENAME), \r\n\t \t\tCsvPreference.STANDARD_PREFERENCE))\r\n\t {\r\n\t // the header elements are used to map the values to the bean\r\n\t final String[] headers = beanReader.getHeader(true);\r\n\t final CellProcessor[] processors = getProcessors();\r\n\t Complete customer;\r\n\t String gender,fullname;\r\n\t while ((customer = beanReader.read(Complete.class, headers, processors)) != null)\r\n\t {\r\n\t fullname = customer.getFirstname() + \" \" + customer.getLastname();\r\n\t if(customer.getGender().equals(\"f\"))\r\n\t \t gender = \"female\";\r\n\t \telse\r\n\t gender = \"male\";\r\n\t Date dob=new SimpleDateFormat(\"MM/dd/yyyy\").parse(customer.getDob()); \r\n\t String pattern = \"dd/MM/yyyy\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n \tString date = simpleDateFormat.format(dob);\r\n\t String age = calcAge(date);\r\n\t if(customer.getCategory().equals(\"student\"))\r\n\t {\r\n\t \tString grade = calcGrade(customer.getSec_percent());\r\n\t \tstudentList.add(new Student(customer.getId(),fullname,gender,date,age,customer.getAadhar_number(),customer.getCity(),\r\n\t \tcustomer.getContact_number(),Integer.parseInt(customer.getRoll_no()),customer.getClass_no(),Integer.parseInt(customer.getTotal_marks())\r\n\t \t,grade,Integer.parseInt(customer.getSec_percent()),customer.getHs_stream()));\r\n\t \t\t\r\n\t } \r\n\t else //for teacher\r\n\t {\r\n\t \tDate doj=new SimpleDateFormat(\"MM/dd/yyyy\").parse(customer.getDoj()); \r\n\t \tString pattern1 = \"dd/MM/yyyy\";\r\n\t SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(pattern);\r\n \tString join_date = simpleDateFormat.format(doj);\r\n\t \tString str_sub_teachers = customer.getSubject_teaches();\r\n\t \tString service_period = calService(join_date);\r\n\t \tList<String> sub_teachers = new ArrayList<String>(Arrays.asList(str_sub_teachers.split(\"-\")));\r\n\t \t\t\t\r\n\t \t\tteacherList.add(new Teacher(customer.getId(),fullname,gender,date,age,customer.getAadhar_number(),customer.getCity(),\r\n \t\t\t\tcustomer.getContact_number(),customer.getEmp_no(),customer.getClass_teacher_of(),join_date,service_period\r\n \t\t\t\t,customer.getPrevious_school(),customer.getPost(),Integer.parseInt(customer.getSalary()),sub_teachers));\r\n }\r\n\t \r\n\t } //while\r\n\t }\r\n\t System.out.println(\"ArrayList Sucessfully Created\");\t\r\n\t \t\r\n\t }", "private void processRecords()\n {\n // This is the way to connect the file to an inputstream in android\n InputStream inputStream = getResources().openRawResource(R.raw.products);\n\n Scanner scanner = new Scanner(inputStream);\n\n\n // skipping first row by reading it before loop and displaying it as column names\n String[] tableRow = scanner.nextLine().split(\",\");\n\n //Log.e(\"COLUMN NAMES\", Arrays.toString(tableRow));\n //Log.e(\"COLUMN NAMES SIZE\", String.valueOf(tableRow.length));\n\n\n // --- Truncate table (delete all rows and reset auto increment --\n // this line of code will be useful because for now we are forced to read file\n // everytime we open app, this way we do not have duplicate data.\n db.resetTable();\n\n while (scanner.hasNextLine())\n {\n tableRow = scanner.nextLine().split(\",\");\n //Log.e(\"COLUMN VALUES\", Arrays.toString(tableRow));\n //Log.e(\"COLUMN VALUES SIZE\", String.valueOf(tableRow.length));\n\n /*\n * Possible Change:\n * On each iteration a new Product() can be created and call the setter to set\n * its fields to the elements of the String array, example\n * product = new Product();\n * product.setNumber(tableRow[0]);\n * product.setBusinessName(tableRow[1]);\n * ...\n * db.insertData(product); // because the new insertData method would expect a\n * Product object instead\n *\n */\n\n // insert data\n if (db.insertData(tableRow))\n {\n //Log.e(\"Insert\", \"SUCCESSFUL INSERT AT \" + tableRow[0]);\n }\n else\n {\n //Log.e(\"Insert\", \"UNSUCCESSFUL INSERT\");\n }\n\n }\n }", "public static List<String> extractData_CSV(String csvFile, String rowID) throws Exception {\n List<String> rows = new ArrayList<>();\n\n BufferedReader reader = new BufferedReader(new FileReader(csvFile));\n String line = \"\";\n\n while ( (line = reader.readLine()) != null) {\n if (line.startsWith(rowID)){\n rows.add(line);\n }\n }\n reader.close();\n return rows;\n }", "public ArrayList<Invoice> readFromCsv() throws IOException {\n if (!FileIOHelper.exists(this.orderCsv)) return new ArrayList<>(); // Empty array list\n BufferedReader csvFile = FileIOHelper.getFileBufferedReader(this.orderCsv);\n List<String[]> csvLines = readAll(csvFile, 1);\n ArrayList<Invoice> items = new ArrayList<>();\n if (csvLines.size() == 0) return items;\n csvLines.forEach((str) -> items.add(new Invoice(str)));\n return items;\n }", "public Set<Airport> loadFile(final File csvFile) throws CoreException;", "public int loadData(Reader csv, KeywordFactory kwf, boolean quiet) \n throws InterruptedException, IOException\n {\n if (! tablecreated) \n System.err.println(\"Warning: table not created yet?\");\n\n DbLoadCSV ldr = new DbLoadCSV(tbl, kwf, csv);\n ldr.addHMSCol(\"RA\");\n ldr.addDMSCol(\"Dec\");\n ldr.addDMSCol(\"Decl\");\n\n Process proc = startDbClient();\n Writer w = new OutputStreamWriter(proc.getOutputStream());\n ldr.sendData(w);\n\n w.close();\n proc.waitFor();\n if (!quiet) {\n if (proc.exitValue() > 0) {\n for (String line : emsgs) \n System.err.println(line);\n }\n else \n System.err.println(\"Table data loaded\");\n }\n\n return proc.exitValue();\n }", "public void readReports (BufferedReader reader) {\n try {\n // Each line of CSV will be stored in this String\n String line = \"\";\n reader.readLine();\n while ((line = reader.readLine()) != null) {\n // line will be split by \",\", into an array of String\n String[] eachDetailOfReportLine = line.split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\");\n\n if (eachDetailOfReportLine.length == 0) {\n continue;\n }\n\n // removing unnecessary quotation marks\n for (int i = 0; i < eachDetailOfReportLine.length; i++) {\n eachDetailOfReportLine[i] = eachDetailOfReportLine[i].replaceAll(\"\\\"\", \"\");\n }\n\n\n // finds restaurant using tracking code from restaurants' list\n Restaurant restaurant = null;\n for (Restaurant R : restaurants) {\n if (R.getTrackingNumber().equals(eachDetailOfReportLine[0])) {\n restaurant = R;\n break;\n }\n }\n\n if (restaurant == null) {\n continue;\n }\n\n// Log.e(\"checking..............\", restaurant.getName());\n\n // setting other values\n Integer day = Integer.parseInt(eachDetailOfReportLine[1]);\n Report reportToAdd = new Report(day, eachDetailOfReportLine[2]);\n\n String thatDay = day.toString();\n Date thatDayCalendar = new SimpleDateFormat(\"yyyyMMdd\").parse(thatDay);\n if (oldUpdateTime > 0) {\n if (thatDayCalendar.getTime() > oldUpdateTime) {\n restaurant.setHasUpdate(true);\n }\n }\n\n\n Integer numCriticalIssues = Integer.parseInt(eachDetailOfReportLine[3]);\n reportToAdd.setCritIssues(numCriticalIssues);\n\n Integer numNonCriticalIssues = Integer.parseInt(eachDetailOfReportLine[4]);\n reportToAdd.setNonCritIssues(numNonCriticalIssues);\n\n try {\n long daysSinceOccurrence = reportToAdd.getDaysSinceOccurrence();\n if (daysSinceOccurrence <= 365) {\n restaurant.addTotalCritViolations(numCriticalIssues);\n }\n } catch (ParseException e) {\n// e.printStackTrace();\n }\n\n // if there is any violation, then make a list of them\n // using processViolations method.\n // and set the list as restaurant's violation list\n if (eachDetailOfReportLine.length > 5) {\n\n List<Violation> violationsOfOneInspection =\n processViolations(eachDetailOfReportLine[5]);\n reportToAdd.setViolations(violationsOfOneInspection);\n } else {\n List<Violation> violationsOfOneInspection =\n processViolations(\"\");\n reportToAdd.setViolations(violationsOfOneInspection);\n }\n if (eachDetailOfReportLine.length > 6) {\n reportToAdd.setHazardLevel(eachDetailOfReportLine[6]);\n } else {\n reportToAdd.setHazardLevel(\"Low\");\n }\n\n restaurant.addReport(reportToAdd);\n }\n } catch (IOException e) {\n// e.printStackTrace();\n } catch (ParseException e) {\n// e.printStackTrace();\n }\n\n // sort alphabetically, using overridden compareTo\n for (int i = 0; i < restaurants.size(); i++) {\n Collections.sort(restaurants.get(i).getReportsList());\n }\n }", "public List<String[]> readCSV() {\n\t\tCSVReader reader;\n\t\tList<String[]> myEntries = new ArrayList<String[]>();\n\t\ttry {\n\t\t\treader = new CSVReader(new FileReader(getCSVFolder() + File.separator + getFileName() + \".csv\"));\n\t\t\tmyEntries = reader.readAll();\n\t\t\treader.close();\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn myEntries;\n\t}", "private static ArrayList<Glootie> loadAliensFromFile(String pathToCSV) throws Exception{\r\n\t\tArrayList<Glootie> alienArray = new ArrayList<>();\r\n\t\tBufferedReader csvReader = new BufferedReader(new FileReader(pathToCSV));\r\n\t\t//Read and ignore header row:\r\n\t\tString row = csvReader.readLine();\r\n\t\t//Read remain data from CSV file\r\n\t\twhile ((row = csvReader.readLine()) != null) {\r\n\t\t\tString[] data = row.split(\",\");\r\n\t\t\t// Add new Glootie to array\r\n\t\t\talienArray.add(new Glootie(data));\r\n\t\t}\r\n\t\tcsvReader.close();\r\n\r\n\t\treturn alienArray;\r\n\t}", "@Override\r\n public void init() throws HarvesterException {\r\n JsonSimple options = new JsonSimple(getJsonConfig().getObject(\"harvester\", \"csv\"));\r\n \r\n String filePath = options.getString(null, \"fileLocation\");\r\n if (filePath == null) {\r\n throw new HarvesterException(\"No data file provided!\");\r\n }\r\n File csvDataFile = new File(filePath);\r\n if (csvDataFile == null || !csvDataFile.exists()) {\r\n throw new HarvesterException(\"Could not find CSV file '\" + filePath + \"'\");\r\n }\r\n filename = csvDataFile.getName();\r\n \r\n idPrefix = options.getString(\"\", \"recordIDPrefix\");\r\n maxRows = options.getInteger(-1, \"maxRows\");\r\n ignoredFields = getStringList(options, \"ignoreFields\");\r\n includedFields = getStringList(options, \"includedFields\");\r\n payloadId = options.getString(DEFAULT_PAYLOAD_ID, \"payloadId\");\r\n batchSize = options.getInteger(DEFAULT_BATCH_SIZE, \"batchSize\");\r\n hasMore = true;\r\n \r\n try {\r\n // open the CSV file for reading\r\n Reader fileReader = new InputStreamReader(new FileInputStream(csvDataFile), \"UTF-8\");\r\n char delimiter = options.getString(String.valueOf(DEFAULT_DELIMITER), \"delimiter\").charAt(0);\r\n csvReader = new CSVReader(fileReader, delimiter);\r\n \r\n // configure the data fields\r\n if (options.getBoolean(true, \"headerRow\")) {\r\n dataFields = Arrays.asList(csvReader.readNext());\r\n } else {\r\n dataFields = getStringList(options, \"headerList\");\r\n }\r\n \r\n // check that the specified id column is valid\r\n idColumn = options.getString(null, \"idColumn\");\r\n if (idColumn != null && !dataFields.contains(idColumn)) {\r\n throw new HarvesterException(\"'\" + idColumn + \"' is invalid!\");\r\n }\r\n } catch (IOException ioe) {\r\n throw new HarvesterException(ioe);\r\n }\r\n }", "List<String[]> readCsv(String inputFilePath,int skipLine,char separator)throws IOException;", "public DataProcessor(String filename) throws FileNotFoundException{\n\tlst = new ArrayList();\n\tScanner input = new Scanner(new FileReader(filename));\n //skip the first line of the csv file\n\tString escapedLine = input.nextLine();\n \twhile(input.hasNextLine()){\n\t recordCount++;\n\t String line = input.nextLine();\n\t //CORRECTION BLOC to skip quoted commas\n\t if (line.contains(\"\\\"\")){\n\t\tint first= line.indexOf(\"\\\"\");\n\t\twhile(first >0 ){\n\t\t String problem = line.substring(first,line.indexOf(\"\\\"\",first+1)+1);\n\t\t \tint second = line.indexOf(\"\\\"\",first+1);\n\t\t\t//look for comma between quoted\n\t\t\tif(problem.contains(\",\")){\n\t\t\t //replace comma by space not to change string indices\n\t\t\t problem=problem.replace(\",\",\" \");\n\t\t\t line=line.replace(line.substring(first,line.indexOf(\"\\\"\",first+1)+1),problem);\n\t\t\t}\n\t\t\t//look for another quote symbol\n\t\t\tfirst = line.indexOf(\"\\\"\",second+1);\n\t\t}\n\t }\n\t String[] fields = line.split(\",\");\n\t //create Person object to store the suspect's data\n\t Person suspect = new Person(fields[SEX].charAt(0),fields[RACE].charAt(0),Integer.parseInt(fields[DOB]),Integer.parseInt(fields[HEIGHTFT]),fields[EYECOLOR],fields[BUILD].charAt(0));\n\t lst.add(suspect);\n\t}\n\t//close scanner\n\tinput.close();\n }", "public void loadActivitiesFromCsv(UserTrees tree, LocalDateTime timePeriodBegin, LocalDateTime timePeriodEnd) {\n\t\t\n\t\tActivity atividade;\n\t\tNode<Object> userNode, timeNode, pcNode;\n\t\tString csvLine = getNextLine();\n\t\t/*Verifies if the line is a header. ignores it if that's the case*/\n\t\tPattern p = Pattern.compile(\"/id|date|user|pc|activity/i\");\n\t\tMatcher m = p.matcher( csvLine );\n\t\tif(!m.find()) {\n\t\t\tatividade = (Activity) stringsToClass( parseCsvLine( csvLine ) );\n\t\t\t\n\t\t\tuserNode = tree.getUserNode( atividade.getUserIdentifier() );\n\t\t\ttimeNode = userNode.getChild(0);\n\t\t\tpcNode = loadPcIntoTime(timeNode, atividade.getPc());\n\t\t\tloadActivityIntoPc(pcNode, atividade);\t\n\t\t\tif(atividade.getDate().isAfter(timePeriodBegin) && atividade.getDate().isBefore(timePeriodEnd))\n\t\t\t{\n\t\t\t\ttimeNode = userNode.getChild(1);\n\t\t\t\tpcNode = loadPcIntoTime(timeNode, atividade.getPc());\n\t\t\t\tloadActivityIntoPc(pcNode, atividade);\n\t\t\t}\n\t\t}\n\t\tcsvLine = getNextLine();\n\t\twhile(csvLine != null)\n\t\t{\n\t\t\tatividade = (Activity) stringsToClass( parseCsvLine( csvLine ) );\n\t\t\tif(atividade==null)\n\t\t\t{\n\t\t\t\tcsvLine = getNextLine();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tuserNode = tree.getUserNode( atividade.getUserIdentifier() );\n\t\t\tif(userNode == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttimeNode = userNode.getChild(0);\n\t\t\tpcNode = loadPcIntoTime(timeNode, atividade.getPc());\n\t\t\tloadActivityIntoPc(pcNode, atividade);\t\n\t\t\tif(timePeriodBegin == null || timePeriodEnd == null) \n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(atividade.getDate().isAfter(timePeriodBegin) && atividade.getDate().isBefore(timePeriodEnd))\n\t\t\t{\n\t\t\t\ttimeNode = userNode.getChild(1);\n\t\t\t\tpcNode = loadPcIntoTime(timeNode, atividade.getPc());\n\t\t\t\tloadActivityIntoPc(pcNode, atividade);\n\t\t\t}\n\t\t\tcsvLine = getNextLine();\n\t\t}\n\t\t\n\t}", "public boolean checkCSVIntegrity(final ProgressMonitor monitor,\r\n final File csvFile)\r\n {\r\n if (monitor == null)\r\n throw new NullPointerException(\"monitor may not be null\");\r\n\r\n boolean valid = true;\r\n\r\n try\r\n {\r\n FileInputStream fis = new FileInputStream(csvFile);\r\n BufferedInputStream bis = new BufferedInputStream(fis);\r\n\r\n byte[] rCache = new byte[1024];\r\n int numberOfChars = 0;\r\n int numColumns = 0;\r\n int lastPosition = 0;\r\n boolean headerComplete = false;\r\n\r\n /* read header and identify amount of columns */\r\n while (!headerComplete)\r\n {\r\n numberOfChars = bis.read(rCache, 0, 1024);\r\n if (numberOfChars == -1)\r\n break;\r\n\r\n for (lastPosition = 0; lastPosition < numberOfChars; lastPosition++)\r\n {\r\n if (rCache[lastPosition] == SEPARATOR)\r\n {\r\n numColumns++;\r\n }\r\n else if (rCache[lastPosition] == '\\n')\r\n {\r\n numColumns++;\r\n headerComplete = true;\r\n break;\r\n }\r\n else\r\n {\r\n /*\r\n * for each other character nothing has to be done, this part will\r\n * be removed by the compiler so just leave for information\r\n */\r\n }\r\n }\r\n }\r\n\r\n /* not ending header */\r\n if (!headerComplete)\r\n {\r\n monitor\r\n .setStatusText(\"Keine Daten oder keine Kopfzeile oder Encoding falsch. Siehe http://http://www.jverein.de/administration_import.php\");\r\n valid = false;\r\n }\r\n\r\n /* the position needs to increased because of the break in the for loop */\r\n lastPosition++;\r\n\r\n int columnsPerLine = 0;\r\n int lineNo = 1;\r\n /* count columns in each line */\r\n do\r\n {\r\n\r\n for (; lastPosition < numberOfChars; lastPosition++)\r\n {\r\n if (rCache[lastPosition] == SEPARATOR)\r\n columnsPerLine++;\r\n else if (rCache[lastPosition] == ' ')\r\n {\r\n if (lastPosition - 1 >= 0 && rCache[lastPosition - 1] == SEPARATOR)\r\n {\r\n monitor\r\n .setStatusText(String\r\n .format(\r\n \"Leerzeichen nach einem Semikolon in Zeile: {0} und Spalte: {1}\",\r\n new Object[] { lineNo + \"\", columnsPerLine + \"\" }));\r\n valid = false;\r\n }\r\n if (lastPosition + 1 < numberOfChars\r\n && rCache[lastPosition + 1] == SEPARATOR)\r\n {\r\n monitor\r\n .setStatusText(String\r\n .format(\r\n \"Leerzeichen vor einem Semikolon in Zeile: {0} und Spalte: {1}\",\r\n new Object[] { lineNo + \"\", columnsPerLine + \"\" }));\r\n valid = false;\r\n }\r\n }\r\n else if (rCache[lastPosition] == '\\n')\r\n {\r\n columnsPerLine++;\r\n lineNo++;\r\n if (columnsPerLine != numColumns)\r\n {\r\n monitor\r\n .setStatusText(String\r\n .format(\r\n \"Anzahl der Spalten in Zeile: {0} passt nicht mit der Anzahl Spalten in der Kopfzeile ueberein.\",\r\n lineNo + \"\"));\r\n valid = false;\r\n }\r\n columnsPerLine = 0;\r\n }\r\n else\r\n {\r\n /*\r\n * for each other character nothing has to be done, this part will\r\n * be removed by the compiler so just leave it for information\r\n */\r\n }\r\n }\r\n lastPosition = 0;\r\n numberOfChars = bis.read(rCache, 0, 1024);\r\n }\r\n while (numberOfChars != -1);\r\n\r\n bis.close();\r\n fis.close();\r\n }\r\n catch (FileNotFoundException e)\r\n {\r\n Logger.error(\"Fehler\", e);\r\n valid = false;\r\n }\r\n catch (IOException e)\r\n {\r\n Logger.error(\"Fehler\", e);\r\n valid = false;\r\n }\r\n return valid;\r\n }", "private List<String[]> parseFileByName(String name){\n\n List<String[]> content = new ArrayList<>();\n String csvFile = name;\n BufferedReader br = null;\n String line = \"\";\n String cvsSplitBy = \",\";\n\n try {\n\n br = new BufferedReader(new FileReader(csvFile));\n while ((line = br.readLine()) != null) {\n\n // use comma as separator\n String[] data = line.split(cvsSplitBy);\n content.add(data);\n\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n return content;\n }", "public HashMap<Node, int[]> importCsv(String name) throws Exception {\n\t\t\n\t\tString path = \"./\" + name + \".csv\";\n\t\tCsvReader reader = new CsvReader(path, ';');\n\t\t\n\t\tboolean end = false;\n\t\tString[] headers;\n\t\tGraph graph = null;\n\t\tHashMap<Node, int[]> nodeDraws = new HashMap<Node, int[]>();\n\t\twhile(!end) {\n\t\t\treader.readHeaders();\n\t\t\theaders = reader.getHeaders();\n\t\t\tif(headers[0].equals(\"Graph\")) {\n\t\t\t\treader.readRecord();\n\t\t\t\tgraph = new Graph(reader.get(\"Graph\"));\n\t\t\t\tManagerMatlab.getInstance().createGraph(reader.get(\"Graph\"));\n\t\t\t\treader.skipRecord();\n\t\t\t} else if(headers[0].equals(\"Nodes\")) {\n\t\t\t\treader.readHeaders();\n\t\t\t\twhile(reader.readRecord() && reader.getColumnCount() > 1 && !reader.get(\"ID\").equals(\"\")) {\n\t\t\t\t\t//Possible problem with the encoding, so we replace  if we find it\n\t\t\t\t\tString nom = reader.get(\"Name\").replace(\"Â\", \"\");\n\t\t\t\t\tNode node = new Node(Integer.valueOf(reader.get(\"ID\")),nom);\n\t\t\t\t\tgraph.addNode(node);\n\t\t\t\t\tnodeDraws.put(node, new int[]{Integer.valueOf(reader.get(\"X\")),Integer.valueOf(reader.get(\"Y\"))});\n\t\t\t\t}\n\t\t\t }else if(headers[0].equals(\"Arcs\")) {\n\t\t\t\treader.readHeaders();\n\t\t\t\twhile(reader.readRecord() && reader.getColumnCount() > 1) {\n\t\t\t\t\tArc arc = new Arc(Integer.valueOf(reader.get(\"ID\")),\n\t\t\t\t\t\t\tgraph.getNode(Integer.valueOf(reader.get(\"headId\"))),graph.getNode(Integer.valueOf(reader.get(\"tailId\"))),\n\t\t\t\t\t\t\tBoolean.valueOf(reader.get(\"directed\")),Integer.valueOf(reader.get(\"color\")));\n\t\t\t\t\tgraph.addArc(arc);\n\t\t\t\t}\n\t\t\t\tif (reader.readRecord() == false) {\n\t\t\t\t\tend = true;\n\t\t\t\t} else {\n\t\t\t\t\treader.readHeaders();\n\t\t\t\t\twhile(reader.readRecord() && reader.getColumnCount() > 1) {\n\t\t\t\t\t\tint ID = Integer.valueOf(reader.get(\"ID\"));\n\t\t\t\t\t\tColor color = new Color(Integer.valueOf(reader.get(\"red\")),\n\t\t\t\t\t\t\t\tInteger.valueOf(reader.get(\"green\")), \n\t\t\t\t\t\t\t\tInteger.valueOf(reader.get(\"blue\")));\n\t\t\t\t\t\tManagerGraph.getInstance().addColor(ID, color);\n\t\t\t\t\t}\n\t\t\t\t\tend = true;\n\t\t\t\t}\n\t\t\t }\n\t\t}\n\t\tManagerGraph.getInstance().setGraph(graph);\n\t\treturn nodeDraws;\n\t}", "@Override\n\tpublic void executeParser() {\n\t\tString filepath = (!filePath.isEmpty() && !filePath.equals(null)) ? filePath : \"faculty.csv\";\n\n\t\tList<String> linesFromFile = loadLinesFromFile(filepath);\n\t\t// Convert the list to an Array of Strings.\n\t\tString[] lines = linesFromFile.toArray(new String[0]);\n\t\tList<AuthorAffiliation> authorAffiliationList = new ArrayList<AuthorAffiliation>();\n\n\t\tfor (int i = 1; i < lines.length; i++) {\n\t\t\tString[] nameAffiliation = lines[i].split(\",\");\n\n\t\t\tif (nameAffiliation.length == 2) {\n\t\t\t\tAuthorAffiliation authorAffiliation = new AuthorAffiliation();\n\t\t\t\tauthorAffiliation.setName(nameAffiliation[0]);\n\t\t\t\tauthorAffiliation.setAffiliation(nameAffiliation[1]);\n\t\t\t\tauthorAffiliationList.add(authorAffiliation);\n\t\t\t}\n\t\t}\n\n\t\tHandleFacultyAffiliation facultyAffiliation;\n\t\ttry {\n\t\t\tfacultyAffiliation = new HandleFacultyAffiliation();\n\t\t\tfacultyAffiliation.insertRecords(authorAffiliationList);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"Error while processing faculty affilications.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n public void csvImport(String filename) {\n try {\n FileReader r = new FileReader(filename);\n Scanner in = new Scanner(r);\n\n while (in.hasNext()) {\n String firstInput = in.next().trim();\n String firstName = firstInput.substring(0, firstInput.length() - 1).trim();\n String lastInput = in.next().trim();\n String lastName = lastInput.substring(0, lastInput.length() - 1).trim();\n String ID = in.next().substring(0, 5);\n int pID = Integer.parseInt(ID);\n String grade = in.next();\n\n Student s = new Student(firstName, lastName, pID);\n Grade g = new Grade(grade);\n\n map.put(s, g);\n }\n checker = true;\n } catch (FileNotFoundException ex) {\n System.out.println(\"File was not found\");\n checker = false;\n }\n }", "private void readingFiles() {\r\n\r\n File sdCard = Environment.getExternalStorageDirectory();\r\n File directory = new File(sdCard.getAbsoluteFile() + \"/MyApplication\");\r\n\r\n //List of names\r\n File name = new File(directory, \"nameList.csv\");\r\n FileInputStream fIn = null;\r\n try {\r\n fIn = new FileInputStream(name);\r\n InputStreamReader isr = new InputStreamReader(fIn);\r\n char[] inputBuffer = new char[READ_BLOCK_SIZE];\r\n String s = \"\";\r\n int charRead;\r\n while ((charRead = isr.read(inputBuffer)) > 0) {\r\n String readString = String.copyValueOf(inputBuffer, 0, charRead);\r\n s += readString;\r\n inputBuffer = new char[READ_BLOCK_SIZE];\r\n }\r\n\r\n String[] retrievedStringArray = s.split(\",\");\r\n nameList = new ArrayList<String>(Arrays.asList(retrievedStringArray));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n nameList = new ArrayList<String>();\r\n }\r\n\r\n //List of latitudes\r\n File lat = new File(directory, \"latList.csv\");\r\n FileInputStream fIn1 = null;\r\n try {\r\n fIn1 = new FileInputStream(lat);\r\n InputStreamReader isr = new InputStreamReader(fIn1);\r\n char[] inputBuffer1 = new char[READ_BLOCK_SIZE];\r\n String s1 = \"\";\r\n int charRead;\r\n while ((charRead = isr.read(inputBuffer1)) > 0) {\r\n String readString = String.copyValueOf(inputBuffer1, 0, charRead);\r\n s1 += readString;\r\n inputBuffer1 = new char[READ_BLOCK_SIZE];\r\n }\r\n\r\n String[] retrievedStringArray = s1.split(\",\");\r\n latList = new ArrayList<String>(Arrays.asList(retrievedStringArray));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n latList = new ArrayList<String>();\r\n }\r\n\r\n //List of longitudes\r\n File lng = new File(directory, \"lngList.csv\");\r\n FileInputStream fIn2 = null;\r\n try {\r\n fIn2 = new FileInputStream(lng);\r\n InputStreamReader isr = new InputStreamReader(fIn2);\r\n char[] inputBuffer2 = new char[READ_BLOCK_SIZE];\r\n String s2 = \"\";\r\n int charRead;\r\n while ((charRead = isr.read(inputBuffer2)) > 0) {\r\n String readString = String.copyValueOf(inputBuffer2, 0, charRead);\r\n s2 += readString;\r\n inputBuffer2 = new char[READ_BLOCK_SIZE];\r\n }\r\n\r\n String[] retrievedStringArray = s2.split(\",\");\r\n lngList = new ArrayList<String>(Arrays.asList(retrievedStringArray));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n lngList = new ArrayList<String>();\r\n }\r\n if (lngList.get(0) == \"\") {\r\n lngList.remove(0);\r\n }\r\n if (latList.get(0) == \"\") {\r\n latList.remove(0);\r\n }\r\n if (nameList.get(0) == \"\") {\r\n nameList.remove(0);\r\n }\r\n }", "public void readFile(File inputFile) throws IOException {\n\t\tCSVParser csvParser = CSVParser.parse(inputFile, charset, csvFormat);\n\t\trecordList = csvParser.getRecords();\n\t}", "public String[] parseCsv(Reader reader, String separator, boolean hasHeader) throws IOException {\n List<String> columnNames = new LinkedList<String>();\n String[] nodesInfo = new String[GlobalVar.numberOfNodes];\n int nodeCount=0;\n BufferedReader br = null;\n br = new BufferedReader(reader);\n String line;\n int numLines = 0;\n while ((line = br.readLine()) != null) {\n if (!line.startsWith(\"#\")) {\n String[] tokens = line.split(separator);\n if (tokens != null) {\n if (numLines == 0) {\n for (int i = 0; i < tokens.length; ++i) {\n columnNames.add(hasHeader ? tokens[i] : (\"row_\"+i));\n }\n } else {\n nodesInfo[nodeCount++]= tokens[0]; \n }\n \n }\n ++numLines; \n }\n }\n return nodesInfo;\n }", "default void process(Reader reader, Consumer<SafeCSVRecord> consumer) {\n CSVParser parser;\n try {\n parser = new CSVParser(reader, getFormat());\n } catch (IOException ex) {\n throw new RuntimeException(\"读取CSV文件失败\", ex);\n }\n Iterator<CSVRecord> iterator = parser.iterator();\n while (iterator.hasNext()) {\n try {\n CSVRecord record = iterator.next();\n SafeCSVRecord safe = SafeCSVRecord.of(record);\n /**\n * 判断是否是空白行\n */\n if (Streams.of(record.toMap().values()).anyMatch(Strings::isNotBlank)) {\n consumer.accept(safe);\n }\n } catch (Exception ex) {\n// logger.warn(\"处理CSV数据失败\", ex);\n }\n }\n }", "public static StockSetData getStockSetDataFromCSV(String filePath) {\r\n int TOP_HEADER_ROW_INDEX = 4;\r\n // Create our BuyOptionObject\r\n StockSetData stockSetData = new StockSetData();\r\n // Get all the data as records\r\n List<List<String>> records = getCSV2(filePath);\r\n // Label the columns\r\n List<String> topHeader = records.get(TOP_HEADER_ROW_INDEX);\r\n List<String> nameHeader = records.get(TOP_HEADER_ROW_INDEX + 1);\r\n\r\n // loop horizontally through the elements in the top header\r\n for (int i = 0; i < topHeader.size(); i++) {\r\n // decide the type of column\r\n\r\n if (topHeader.get(i).equals(\"l\")) {\r\n ArrayList<String> loaderArray = new ArrayList<>();\r\n for (int j = TOP_HEADER_ROW_INDEX + 2; j < records.size(); j++) {\r\n loaderArray.add(records.get(j).get(i));\r\n }\r\n ColumnAndName columnAndName = new ColumnAndName(loaderArray ,nameHeader.get(i));\r\n stockSetData.getLabelValues().add(columnAndName);\r\n }\r\n if (topHeader.get(i).equals(\"s\")) {\r\n ArrayList<String> loaderArray = new ArrayList<>();\r\n for (int j = TOP_HEADER_ROW_INDEX + 2; j < records.size(); j++) {\r\n loaderArray.add(records.get(j).get(i));\r\n }\r\n ColumnAndName columnAndName = new ColumnAndName(loaderArray ,nameHeader.get(i));\r\n stockSetData.getSortingValues().add(columnAndName);\r\n }\r\n if (topHeader.get(i).equals(\"f\")) {\r\n ArrayList<String> loaderArray = new ArrayList<>();\r\n for (int j = TOP_HEADER_ROW_INDEX + 2; j < records.size(); j++) {\r\n loaderArray.add(records.get(j).get(i));\r\n }\r\n ColumnAndName columnAndName = new ColumnAndName(loaderArray ,nameHeader.get(i));\r\n stockSetData.getFitnessValues().add(columnAndName);\r\n }\r\n\r\n\r\n }\r\n\r\n return stockSetData;\r\n }", "private ArrayList<String> getFileData(InputStream is) {\n ArrayList<String> restaurantData = new ArrayList<>();\n\n // Initialize the reader for the csv file\n BufferedReader reader = new BufferedReader(new InputStreamReader(is,\n Charset.forName(\"UTF-8\")));\n\n // Read each line into the ArrayList\n try {\n // Read the file\n String row;\n while ((row = reader.readLine()) != null) {\n restaurantData.add(row);\n }\n } catch (IOException ex) {\n Log.i(TAG, \"Error reading line\", ex);\n } finally {\n try {\n // Close the file\n reader.close();\n } catch (IOException ex) {\n Log.i(TAG, \"Error closing file\", ex);\n }\n }\n\n // Return data\n return restaurantData;\n }", "public String parseCSV(MultipartFile file, Model model) {\n\n\n\n String status = \"FAILED\";\n // parse CSV file to create a list of `User` objects\n try (Reader reader = new BufferedReader(new InputStreamReader(file.getInputStream()))) {\n\n // create csv bean reader\n CsvToBean<Category> csvToBean = new CsvToBeanBuilder(reader)\n .withType(Category.class)\n .withIgnoreLeadingWhiteSpace(true)\n .build();\n\n // convert `CsvToBean` object to list of users\n List<Category> categories = csvToBean.parse();\n\n //Stream Category to KAFKA Topic\n\n categories.stream().forEach(category -> {\n Logger.info(\"Category => \"+category.getCategories());\n kafkaTemplate.send(TOPIC,category);\n });\n\n // save users list on model\n model.addAttribute(\"users\", categories);\n model.addAttribute(\"status\", true);\n\n status = \"SUCCESS\";\n\n } catch (Exception ex) {\n model.addAttribute(\"message\", \"An error occurred while processing the CSV file.\");\n model.addAttribute(\"status\", false);\n //TODO - Add Logger Error\n ex.printStackTrace();\n }\n\n return status;\n }", "public static void main(String[] args) throws FileNotFoundException, IOException {\r\n \r\n Directory d = new Directory();\r\n \r\n if (args.length != 1) {\r\n System.out.println(\"Usage: java CSVReaderTest <filename>\");\r\n }\r\n else {\r\n FileReader fr = new FileReader(args[0]);\r\n BufferedReader c = new BufferedReader(fr);\r\n\r\n int lineNum = 0;\r\n boolean eof = false;\r\n \r\n while (!eof) {\r\n String line = c.readLine();\r\n \r\n if (line == null) {\r\n eof = true;\r\n }\r\n else{\r\n // Allocate an array of the necessary size to return the strings\r\n String[] values = new String[4];\r\n // Start beginIndex at the beginning of the String, position 0\r\n int beginIndex = 0;\r\n\r\n for (int i = 0; i < 3; i++) {\r\n int endIndex;\r\n endIndex = line.indexOf(',', beginIndex);\r\n\r\n // if the argument begins and ends with quotes, remove them\r\n if (line.charAt(beginIndex) == '\"' && line.charAt(endIndex - 1) == '\"') {\r\n values[i] = line.substring(beginIndex + 1, endIndex - 1);\r\n\r\n } else {\r\n values[i] = line.substring(beginIndex, endIndex);\r\n }\r\n\r\n beginIndex = endIndex + 1;\r\n }\r\n\r\n if (line.charAt(beginIndex) == '\"' && line.charAt(line.length() - 1) == '\"') {\r\n values[3] = line.substring(beginIndex + 1, line.length() - 1);\r\n } else {\r\n values[3] = line.substring(beginIndex, line.length());\r\n }\r\n \r\n if (lineNum > 1) {\r\n lineNum = lineNum + 1;\r\n Student s = new Student(values[0]);\r\n s.setFirstName(values[1]);\r\n s.setLastName(values[2]);\r\n s.setPhoneNumber(values[3]);\r\n d.addStudent(s);\r\n System.out.println(s);\r\n }\r\n\r\n }\r\n }\r\n c.close();\r\n }\r\n \r\n Student c = new Student(\"mengl1\");\r\n c.setFirstName(\"Meng\");\r\n c.setLastName(\"Li\");\r\n c.setPhoneNumber(\"412-807-0153\");\r\n \r\n Student a = new Student(\"mengl2\");\r\n a.setFirstName(\"Mengl\");\r\n a.setLastName(\"Li\");\r\n a.setPhoneNumber(\"412-807-0154\");\r\n \r\n Student b = new Student(\"terryhong\");\r\n b.setFirstName(\"terry\");\r\n b.setLastName(\"hong\");\r\n b.setPhoneNumber(\"412-464-475\");\r\n\r\n d.addStudent(c);\r\n d.addStudent(a);\r\n d.addStudent(b);\r\n \r\n //System.out.println(d.searchByAndrewId(\"mengl2\"));\r\n //d.deleteStudent(\"terryhong\");\r\n System.out.println(d.size());\r\n // System.out.println(d.searchByLastName(\"Li\"));\r\n\r\n }", "private static ArrayList<QueryCoordinates> loadCoordinatesFromCSVString(String csvStr, boolean debugMode) {\n\t\tArrayList<QueryCoordinates> records = new ArrayList<QueryCoordinates>();\n\t\ttry {\n\t\t\tCSVParser csv = CSVParser.parse(csvStr,\n\t\t\t\t\tCSVFormat.DEFAULT.withFirstRecordAsHeader().withIgnoreHeaderCase().withTrim());\n\t\t\tfor (CSVRecord csvRecord : csv) {\n\t\t\t\ttry {\n\t\t\t\t\tdouble startLon = Double.parseDouble(csvRecord.get(\"start_lon\"));\n\t\t\t\t\tdouble startLat = Double.parseDouble(csvRecord.get(\"start_lat\"));\n\t\t\t\t\tdouble endLon = Double.parseDouble(csvRecord.get(\"end_lon\"));\n\t\t\t\t\tdouble endLat = Double.parseDouble(csvRecord.get(\"end_lat\"));\n\t\t\t\t\trecords.add(new QueryCoordinates(startLon, startLat, endLon, endLat));\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t// ignore invalid rows and try to read all other...\n\t\t\t\t\tString errorMsg = \"CSV input file seems to be formatted incorrectly. Every data field has to contain a float value.\";\n\t\t\t\t\tprintError(errorMsg, null, 0, debugMode, e);\n\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tString errorMsg = \"CSV input file could not be read. Make sure the separator character is a comma: ','\";\n\t\t\tprintError(errorMsg, null, 1, debugMode, e);\n\t\t} catch (IllegalStateException e) {\n\t\t\tString errorMsg = \"CSV input file seems to be formatted incorrectly. Make sure the file has a header row like \\\"start_lon\\\",\\\"start_lat\\\",\\\"end_lon\\\",\\\"end_lat\\\".\";\n\t\t\tprintError(errorMsg, null, 1, debugMode, e);\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tString errorMsg = \"CSV input file seems to be formatted incorrectly. Make sure the file has a header row like \\\"start_lon\\\",\\\"start_lat\\\",\\\"end_lon\\\",\\\"end_lat\\\".\";\n\t\t\tprintError(errorMsg, null, 1, debugMode, e);\n\t\t}\n\t\treturn records;\n\t}", "private void init() throws FileNotFoundException, TransformerConfigurationException {\n try (Scanner filesscanner = new Scanner(new File(csvlocation))) {\n while (filesscanner.hasNext()) {\n filecontent.add(filesscanner.next());\n }\n if (!filecontent.isEmpty()) {\n this.header = filecontent.get(0);\n filecontent.remove(0);\n }\n setMailtemplate();\n } catch (FileNotFoundException | TransformerConfigurationException e) {\n LOGGER.error(\"Exception occured while reading the file\", e);\n throw e;\n }\n }", "public TreeSet<Product> readCSV() throws IOException, NumberFormatException {\n\r\n TreeSet<Product> products = new TreeSet<>();\r\n\r\n try (BufferedReader reader = new BufferedReader(new FileReader(\"src/Collection/file.csv_2.txt\"));) {\r\n while ((line = reader.readLine()) != null) {\r\n String[] row = line.split(\",\");\r\n\r\n Location location = new Location(\r\n Double.parseDouble(row[14]),\r\n Integer.parseInt(row[15]),\r\n Float.parseFloat(row[16]),\r\n row[17]);\r\n Address address = new Address(\r\n row[12],\r\n row[13],\r\n location\r\n );\r\n Organization organization = new Organization(\r\n Integer.parseInt(row[8]),\r\n row[9],\r\n row[10],\r\n OrganizationType.valueOf(row[11]),\r\n address\r\n );\r\n Coordinates coordinates = new Coordinates(\r\n Float.parseFloat(row[3]),\r\n Double.parseDouble(row[4])\r\n );\r\n try {\r\n\r\n\r\n Product product = new Product (\r\n Integer.parseInt(row[0]),\r\n row[1],\r\n LocalDate.parse(row[2].replace(\"/\", \"-\")),\r\n coordinates,\r\n Integer.parseInt(row[5]),\r\n row[6],\r\n UnitOfMeasure.valueOf(row[7]),\r\n organization\r\n );\r\n products.add(product);}\r\n catch (NumberFormatException e){\r\n System.out.println(\"wrong format\");\r\n }\r\n\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n products.forEach(System.out::println);\r\n return products;\r\n }", "private void parseCSVToBean(String url) throws Exception {\r\n\r\n\t\t// later we have to implement to check created time of the CSV file\r\n\r\n\t\tColumnPositionMappingStrategy<DealerDetails> strat = new ColumnPositionMappingStrategy<>();\r\n\t\tstrat.setType(DealerDetails.class);\r\n\t\tString[] columns = new String[] { \"firstName\", \"lastName\", \"username\",\r\n\t\t\t\t\"contactNumber\", \"panNumber\", \"vatNumber\", \"bankName\",\r\n\t\t\t\t\"bankAccountNumber\", \"websiteUrl\", \"address\",\r\n\t\t\t\t\"branchTelNumber\", \"country\", \"state\", \"city\", \"zipcode\" };\r\n\t\tstrat.setColumnMapping(columns);\r\n\r\n\t\tCsvToBean<DealerDetails> csvToBean = new CsvToBean<DealerDetails>();\r\n\r\n\t\t// URL fileURL = new URL(url);\r\n\t\t// BufferedReader br = new BufferedReader(new InputStreamReader(\r\n\t\t// fileURL.openStream()));\r\n\r\n\t\tURL csvFileURL = new URL(url);\r\n\t\tBufferedReader bufferedReader = new BufferedReader(\r\n\t\t\t\tnew InputStreamReader(csvFileURL.openStream()));\r\n\r\n\t\tCSVReader reader = new CSVReader(bufferedReader);\r\n\r\n\t\tList<DealerDetails> dealers = csvToBean.parse(strat, reader);\r\n\r\n\t\tfor (DealerDetails dealerDetails : dealers) {\r\n\t\t\t// create user\r\n\t\t\tcreateUser(dealerDetails);\r\n\t\t}\r\n\r\n\t}", "private Agent loadFromFile(String _login)\n {\n Agent agent = new Agent();\n File file = new File(_login + \".csv\");\n FileReader fr;\n BufferedReader br;\n String line;\n try {\n fr = new FileReader(file);\n br = new BufferedReader(fr);\n\n line = br.readLine();\n\n int numCients;\n { // to restrain the scope of csvData\n String[] csvData = line.split(\",\");\n agent.setID(Integer.parseInt(csvData[0]));\n agent.setName(csvData[1]);\n agent.setSalary(Double.parseDouble(csvData[2]));\n agent.setSalesBalance(Double.parseDouble(csvData[3]));\n\n numCients = Integer.parseInt(csvData[4]);\n }\n\n for(int i = 0; i<numCients; i++) {\n line = br.readLine();\n\n Client client = new Client();\n int numProp;\n\n {\n String[] csvData = line.split(\",\");\n client.setID(Integer.parseInt(csvData[0]));\n client.setName(csvData[1]);\n client.setIncome(Double.parseDouble(csvData[2]));\n\n numProp = Integer.parseInt(csvData[3]);\n }\n\n for(int j=0; j<numProp; j++)\n {\n line = br.readLine();\n\n String[] csvData = line.split(\",\");\n\n if(csvData[0].equals(\"house\")) {\n House property = new House();\n\n property.setAddress(csvData[1]);\n property.setNumRoom(Integer.parseInt(csvData[2]));\n property.setPrice(Double.parseDouble(csvData[3]));\n property.setSize(Double.parseDouble(csvData[4]));\n property.setHasGarage(Boolean.parseBoolean(csvData[5]));\n\n property.setHasGarden(Boolean.parseBoolean(csvData[6]));\n property.setHasPool(Boolean.parseBoolean(csvData[7]));\n\n client.addProperty(property);\n }\n else if(csvData[0].equals(\"apt\"))\n {\n Apartment property = new Apartment();\n\n property.setAddress(csvData[1]);\n property.setNumRoom(Integer.parseInt(csvData[2]));\n property.setPrice(Double.parseDouble(csvData[3]));\n property.setSize(Double.parseDouble(csvData[4]));\n property.setHasGarage(Boolean.parseBoolean(csvData[5]));\n\n property.setHasTerrace(Boolean.parseBoolean(csvData[6]));\n property.setHasElevator(Boolean.parseBoolean(csvData[7]));\n property.setFloor(Integer.parseInt(csvData[8]));\n property.setNumber(Integer.parseInt(csvData[9]));\n\n client.addProperty(property);\n }\n }\n\n agent.addClient(client);\n }\n fr.close();\n br.close();\n return agent;\n }\n catch (NumberFormatException nfEx) {\n JOptionPane.showMessageDialog(null, \"There was a problem when retrieving \" +\n \"the agent's data.\\n Please try again\");\n return null;\n }\n catch (IOException ioEx) {\n JOptionPane.showMessageDialog(null, \"This user doesn't exist....\");\n return null;\n }\n }", "public void run() {\n CsvParser parser = this.initializeParser();\n\n // Initialize data structures\n String[] firstLine = parser.parseNext();\n List<MutableRoaringBitmap> dataset = new ArrayList<>(firstLine.length);\n for (int i = 0; i < firstLine.length; i++) {\n dataset.add(new MutableRoaringBitmap());\n this.columnPlisMutable = ImmutableList.copyOf(dataset);\n }\n\n // Start parsing the file\n if (this.configuration.isNoHeader()) {\n this.addRow(firstLine);\n } else {\n this.columnIndexToNameMapping = firstLine;\n }\n\n String[] nextRow;\n while ((nextRow = parser.parseNext()) != null) {\n this.addRow(nextRow);\n this.nRows++;\n }\n\n this.transformRows();\n this.transformColumns();\n log.info(\"Deduplicated {} rows to {}, {} columns to {}\", this.nRows, this.nRowsDistinct,\n this.columnPlisMutable.size(), this.columnPlis.size());\n }", "public CSVReader(String filename) {\r\n try {\r\n File inFile = new File(filename);\r\n Scanner scanner = new Scanner(inFile);\r\n boolean hasNumberOfCountries = false;\r\n boolean hasYearLabels = false;\r\n while (scanner.hasNextLine()) {\r\n String nextLine = scanner.nextLine();\r\n if (nextLine.startsWith(\"Number of countries\")) {\r\n int numberOfCountries = Integer.parseInt(nextLine.split(\",\")[1]);\r\n countryNames = new String[numberOfCountries];\r\n cellularDataTable = new double[numberOfCountries][];\r\n countryIndex = 0;\r\n hasNumberOfCountries = true;\r\n continue;\r\n }\r\n if (nextLine.startsWith(\"Country Name\")) {\r\n parseYearLabels(nextLine);\r\n hasYearLabels = true;\r\n continue;\r\n }\r\n if (hasNumberOfCountries && hasYearLabels) {\r\n // if both number of countries and year labels are found, proceed to parse data\r\n if (!nextLine.isEmpty()) {\r\n parseCountryData(nextLine);\r\n }\r\n }\r\n }\r\n if (!hasNumberOfCountries || !hasYearLabels) {\r\n System.out.println(\"Invalid file: missing Number of countries or Year labels, exiting program\");\r\n System.exit(0);\r\n }\r\n scanner.close();\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"File \" + filename + \" not found, exiting program\");\r\n System.exit(0);\r\n }\r\n }", "public CSVFile(String path)\n\t{\n\t\tthis.filePath = path;\n\t\t File fl = new File(path);\n\t\t FileInputStream fin;\n\t\t\ttry {\n\t\t\t\t\t\tfin = new FileInputStream(fl);\n\t\t\t\t\t BufferedReader reader = new BufferedReader(new InputStreamReader(fin));\n\t\t\t\t \n\t\t\t\t\t String line = null;\n\t\t\t\t\t while ((line = reader.readLine()) != null) \n\t\t\t\t\t {\n\t\t\t\t\t \tif(line.contains(\";\"))\n\t\t\t\t\t \t{\n\t\t\t\t\t\t\t CSVItem item = new CSVItem(line);\n\t\t\t\t\t\t\t itemList.add(item);\n\t\t\t\t\t \t}\n\t\t\t\t\t }\n\t\t\t\t\t reader.close();\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\tcatch (Exception e) \n\t\t\t\t\t {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t }\n\t\t\n\t}", "public void read(){\n assert(inputStream.hasNext());\n\n while(inputStream.hasNextLine()){\n String line = inputStream.nextLine();\n String[] fields = line.split(\";\");\n\n //If Line is address line\n if(fields.length >= 4){\n Address adr = new Address(fields[0], fields[1], fields[2], fields[3]);\n if(fields.length == 5){\n parseGroups(fields[4], adr);\n }\n inputAddressList.add(adr);\n }\n\n //If Line is Group Line\n else if(fields.length <=3){\n Group group = new Group(fields[0], Integer.parseInt(fields[1]));\n if(fields.length == 3){\n parseGroups(fields[2], group);\n }\n inputGroupList.add(group);\n }\n }\n compose();\n assert(invariant());\n }", "public void globalParserExample() {\n\t\tGlobalContentParser parser = new GlobalContentParser(\n\t\t\t\t\"/sdcard/test.csv\", GlobalCSVFormat.v0);\n\n\t\ttry {\n\t\t\tList<GlobalRow> parsedRows = parser.load();\n\n\t\t\t// we can do something with parsedRows manually, or we can do some\n\t\t\t// filtered searches\n\t\t\t// NOTE: this method is currently unoptimized and thus kinda slow\n\t\t\tList<GlobalRow> filterResults = parser.filterByKeyword(\n\t\t\t\t\t\"SomeColumn\", new String[] { \"keyword1\", \"keyword2\" });\n\n\t\t\t// If we want to actuall examine the contents of the row, we look\n\t\t\t// them up by column name\n\t\t\tGlobalRow row = filterResults.get(0);\n\t\t\t// Note that we have to remember the type of data stored in that\n\t\t\t// particular row:\n\t\t\tString[] someKeywords = row.getKeywords(\"SomeKeywordsColumn\");\n\t\t\tDate myDate = row.getDate(\"SomeDateColumn\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tLog.e(\"CSVParser\", \"File not found\");\n\t\t\treturn;\n\t\t} catch (IOException e) {\n\t\t\tLog.e(\"CSVParser\", \"IO EXCEPTION!\");\n\t\t\treturn;\n\t\t}\n\n\t}", "private void loadTsvFile()\n {\n try\n {\n BufferedReader input = new BufferedReader(new FileReader(inFile));\n try\n {\n String line = null;\n\n Integer lineNum = 0;\n\n while ((line = input.readLine()) != null)\n {\n\n lineNum++;\n if (line.matches(\"^\\\\s+$\"))\n {\n System.err.println(\"Skipping line \" + lineNum + \" as it contains no data\");\n // Weird bug with TSV generated by excel\n // This line.match skips some empty lines because the println runs\n // However, it doesn't match all empty lines as some get put into the \"data\"\n // ArrayList\n // Can see this when using the debugger\n // It's difficult to inspect because the Mac command line tools such as tail\n // and less\n // don't recognise /r as a newline break. They display as ^M.\n // However, the java readLine doesn't have a problem.\n // Easy quick work around was to go into Excel and delete the blank row of\n // cells\n // so that they are truly empty\n\n } else\n {\n\n ArrayList<String> dataLine = new ArrayList<String>();\n\n Scanner tokenize = new Scanner(line).useDelimiter(\"\\t\");\n while (tokenize.hasNext())\n {\n dataLine.add(tokenize.next());\n }\n if (lineNum == headRow)\n {\n header = dataLine;\n\n } else if (ignoreRow.contains(lineNum))\n {\n // do nothing\n } else\n {\n data.add(dataLine);\n }\n }\n\n }\n } finally\n {\n input.close();\n }\n } catch (IOException ex)\n {\n ex.printStackTrace();\n }\n }", "public void loadData()\n\t{\n\t\tString fileName = \"YouthTobaccoUse.csv\"; //file to be read and loaded in\n\t\tScanner input = FileUtils.openToRead(fileName).useDelimiter(\",\");\n\t\tint count = 0;\n\t\tboolean isNewState = false;\n\t\tString state = \"\", measure = \"\", stateAbbr = \"\";\n\t\tdouble percent = 0.0;\n\t\tint stateDate = 0;\n\t\twhile(input.hasNext())\n\t\t{\n\t\t\tString line = input.nextLine();\n\t\t\tint tokenCount = 0;\n\t\t\ttokens[tokenCount] = \"\";\n\t\t\t//each line tokenized\n\t\t\tfor(int i = 0; i < line.length(); i++)\n\t\t\t{\n\t\t\t\tif(line.charAt(i) == ',')\n\t\t\t\t{\n\t\t\t\t\ttokenCount++;\n\t\t\t\t\ttokens[tokenCount] = \"\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\ttokens[tokenCount] += line.charAt(i);\n\t\t\t}\n\t\t\t//loads values into variables, converts String into integers and doubles\n\t\t\tString abbr = tokens[1];\n\t\t\tString name = tokens[2];\n\t\t\tString measureDesc = tokens[5];\n\t\t\tint date = convertInteger(tokens[0]);\n\t\t\tdouble percentage = 0.0;\n\t\t\tif(tokens[10].equals(\"\") == false)\n\t\t\t\tpercentage = convertDouble();\n\t\t\tif(abbr.equals(stateAbbr))\n\t\t\t{\n\t\t\t\tif(measureDesc.equals(\"Smoking Status\") \n\t\t\t\t\t\t\t\t\t|| measureDesc.equals(\"User Status\"))\n\t\t\t\t\tpercent += percentage;\n\t\t\t}\n\t\t\telse\n\t\t\t\tisNewState = true;\n\t\t\tif(isNewState)\n\t\t\t{\n\t\t\t\t//calculates the average values for each state, then adds to \n\t\t\t\t//array list, stored as fields\n\t\t\t\tpercent = (double)(percent/count);\n\t\t\t\tif(state.equals(\"Arizona\") && stateDate == 2017)\n\t\t\t\t\ttobacco.add(new StateTobacco(state, stateAbbr, 3.75, 2017));\n\t\t\t\telse if(state.equals(\"Guam\") == false && count != 0 && count != 1\n\t\t\t\t&& stateAbbr.equals(\"US\") == false)\n\t\t\t\t\ttobacco.add(new StateTobacco(state, stateAbbr, percent, stateDate));\n\t\t\t\tstate = name;\n\t\t\t\tstateAbbr = abbr; \n\t\t\t\tstateDate = date;\n\t\t\t\tisNewState = false;\n\t\t\t\tpercent = 0.0;\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\t}", "List<String[]> readCsv(String inputFilePath, char separator)throws IOException;", "public static List<List<String>> getCSV2(String filepath) { //this method words the best\r\n List<List<String>> records = new ArrayList<>();\r\n try (BufferedReader br = new BufferedReader(new FileReader(filepath))) {\r\n String line;\r\n int lineCounter = 1; // this is to stop it from reading lines after the data is done\r\n while ((line = br.readLine()) != null) {\r\n String[] values = line.split(\",\");\r\n if (values.length < 2 && lineCounter > 14) { // <----- the 14th line is chosen arbitrarily.\r\n System.out.println(\"end of file\");\r\n break;\r\n } else {\r\n records.add(Arrays.asList(values));\r\n lineCounter++;\r\n }\r\n }\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return records;\r\n }", "public static void loadcars() {\n Cars xx = new Cars();\n System.out.println(\"Load cars\");\n listcars.clear();\n try {\n File fileload = new File(\"cars.csv\");\n BufferedReader in = new BufferedReader(new FileReader(fileload));\n String st;\n while((st = in.readLine()) != null) {\n String[] strs = st.split(\"[,//;]\");\n addcar(strs[0], strs[1], strs[2],Integer.parseInt(strs[3]));\n }\n in.close();\n System.out.println(\"cars data restored from cars.csv\");\n } catch (IOException i) {\n i.printStackTrace();\n }\n\n\n }", "private ImportCommand parseLinesFromFile(BufferedReader br) {\n boolean hasContactWithInvalidField = false;\n boolean hasContactWithoutName = false;\n try {\n String line = br.readLine();\n while (line != null) {\n String[] attributes = line.split(\",\", -1);\n int numAttributes = attributes.length;\n\n if (attributes[NAME_FIELD].equalsIgnoreCase(\"Name\")\n || attributes[NAME_FIELD].equalsIgnoreCase(\"Name:\")) { // ignore headers\n line = br.readLine();\n continue;\n }\n\n if (contactHasNoName(attributes, numAttributes)) {\n hasContactWithoutName = true;\n line = br.readLine();\n continue;\n }\n\n Name name = null;\n Optional<Phone> phone = Optional.empty();\n Optional<Email> email = Optional.empty();\n Optional<Address> address = Optional.empty();\n Meeting meeting = null;\n\n try {\n name = ParserUtil.parseName(attributes[NAME_FIELD]);\n if (!attributes[PHONE_FIELD].matches(\"\")) {\n phone = Optional.of(ParserUtil.parsePhone(attributes[PHONE_FIELD]));\n }\n if (!attributes[EMAIL_FIELD].matches(\"\")) {\n email = Optional.of(ParserUtil.parseEmail(attributes[EMAIL_FIELD]));\n }\n if (!attributes[ADDRESS_FIELD].matches(\"\")) {\n address = Optional.of(ParserUtil.parseAddress(attributes[ADDRESS_FIELD]));\n }\n if (!attributes[MEETING_FIELD].matches(\"\")) {\n meeting = ParserUtil.parseMeeting(attributes[MEETING_FIELD]);\n }\n } catch (ParseException pe) {\n hasContactWithInvalidField = true;\n line = br.readLine();\n continue;\n }\n\n ArrayList<String> tags = new ArrayList<>();\n //Check for tags\n if (numAttributes > TAG_FIELD_START) {\n for (int i = TAG_FIELD_START; i < numAttributes; i++) {\n if (!attributes[i].matches(\"\")) {\n tags.add(attributes[i]);\n }\n }\n }\n\n Set<Tag> tagList = null;\n try {\n tagList = ParserUtil.parseTags(tags);\n } catch (ParseException e) {\n line = br.readLine();\n continue;\n }\n if (meeting == null) {\n persons.add(new Person(name, phone, email, address, tagList));\n } else {\n persons.add(new Person(name, phone, email, address, tagList, meeting));\n }\n line = br.readLine();\n }\n br.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n return new ImportCommand(persons, hasContactWithInvalidField, hasContactWithoutName);\n }", "private List<String> read_level_row(String line){\r\n List<String> row = new ArrayList<>();\r\n try (Scanner rowScanner = new Scanner(line)){\r\n rowScanner.useDelimiter(\",\");\r\n while (rowScanner.hasNext()) {\r\n row.add(rowScanner.next());\r\n }\r\n }\r\n return row;\r\n }" ]
[ "0.7387373", "0.7346296", "0.69983447", "0.696672", "0.6966642", "0.6910248", "0.6736483", "0.67113566", "0.6686741", "0.6668552", "0.6652483", "0.66478956", "0.6621533", "0.6602943", "0.65970224", "0.65680164", "0.65640855", "0.6555942", "0.65084106", "0.6502252", "0.6473938", "0.645021", "0.6442104", "0.64326483", "0.6405606", "0.64033854", "0.639743", "0.63538766", "0.6332704", "0.6329387", "0.63181186", "0.6310696", "0.6291783", "0.6281143", "0.6215419", "0.6206325", "0.61937153", "0.61825395", "0.6181188", "0.6179453", "0.61737037", "0.6171581", "0.6169866", "0.6120424", "0.61150223", "0.61123216", "0.61042714", "0.61037064", "0.60927725", "0.60899687", "0.60897607", "0.6085839", "0.6074861", "0.6068456", "0.6067424", "0.60635906", "0.6058297", "0.6057497", "0.6057025", "0.60561395", "0.60539275", "0.60361946", "0.6034968", "0.6030404", "0.6029481", "0.6029127", "0.6028661", "0.6022858", "0.6015541", "0.601118", "0.5988345", "0.5982707", "0.597916", "0.5973344", "0.59386957", "0.5922552", "0.5920653", "0.59192526", "0.58830565", "0.5882279", "0.5880068", "0.5873703", "0.58577025", "0.5850734", "0.5843229", "0.5841969", "0.58390933", "0.58274233", "0.5818452", "0.5801916", "0.57993966", "0.5797963", "0.57878137", "0.5783428", "0.5773048", "0.57613415", "0.5754978", "0.57543814", "0.5738322", "0.5733229", "0.5731103" ]
0.0
-1
Configurate negotiation manager bean.
@Bean("contentNegotiationManager") public ContentNegotiationManagerFactoryBean contentNegotiationManagerFactoryBean() { ContentNegotiationManagerFactoryBean manager = new ContentNegotiationManagerFactoryBean(); manager.setFavorParameter(false); manager.setIgnoreAcceptHeader(true); manager.setDefaultContentType(MediaType.APPLICATION_JSON); return manager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setContentNegotiationManager(ContentNegotiationManager contentNegotiationManager)\n/* */ {\n/* 630 */ this.contentNegotiationManager = contentNegotiationManager;\n/* */ }", "@Override\n\tpublic void init(NegotiationInfo info) {\n\t\tsuper.init(info);\n\t\tinit();\n\t}", "public void configure() {\n\t\tif (enumPositionerName != null) {\n\t\t\ttry {\n\t\t\t\tFindable obj = Finder.getInstance().find(enumPositionerName);\n\t\t\t\tif (obj != null && obj instanceof EnumPositioner) {\n\t\t\t\t\tthis.enumPositioner = (EnumPositioner) obj;\n\t\t\t\t\tenumPositioner.addIObserver(this);\n\t\t\t\t\tif (obj instanceof NamedEnumPositioner) {\n\t\t\t\t\t\tString[] positionNameList= ((NamedEnumPositioner)enumPositioner).getPositions();\n\t\t\t\t\t\tcommandPositions = positionNameList;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcommandPositions = enumPositioner.getPositions();\n\t\t\t\t\t}\n\t\t\t\t\tinitGUI();\n\t\t\t\t\tupdateDisplay();\n\t\t\t\t}\n\t\t\t} catch (DeviceException e) {\n\t\t\t\tlogger.error(\"deviceexception while retrieving positions from positioner: \" + e.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\tlogger.error(\"EnumPositionerComboBean cannot connect to object as information missing!\");\n\t\t}\n\t}", "@Override\n\t\t\tprotected void configure() {\n\t\t\t}", "private RelayConfig () {}", "@Override\n protected void configure(AuthenticationManagerBuilder authenticationManagerBuilderObj) throws Exception {\n\t authenticationManagerBuilderObj.authenticationProvider(authenticationProvider());\n }", "@Override\n\tpublic Service duplexstreamReceiveMsgPluginManagerServiceInit(\n\t\t\tList<String> confiList) {\n\t\treturn null;\n\t}", "@Override\n\tpublic Service duplexstreamResponseMsgPluginManagerServiceInit() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Service duplexstreamResponseMsgPluginManagerServiceInit(\n\t\t\tList<String> configList) {\n\t\treturn null;\n\t}", "public ContentNegotiationManager getContentNegotiationManager()\n/* */ {\n/* 638 */ return this.contentNegotiationManager;\n/* */ }", "@Override\r\n\tpublic void configHandler(Handlers me) {\n\r\n\t}", "@Override\r\n\tprotected void configure() {\n\t\t\r\n\t}", "@Override\n\tpublic Service duplexstreamReceiveMsgPluginManagerServiceInit() {\n\t\treturn null;\n\t}", "public BinderConfiguration() {\n this(new PropertyResolverRegistry());\n }", "private void configure() {\r\n LogManager manager = LogManager.getLogManager();\r\n String className = this.getClass().getName();\r\n String level = manager.getProperty(className + \".level\");\r\n String filter = manager.getProperty(className + \".filter\");\r\n String formatter = manager.getProperty(className + \".formatter\");\r\n\r\n //accessing super class methods to set the parameters\r\n\r\n\r\n }", "@Override\n\tpublic void agentSetup() {\n\n\t\t// load the class names of each object\n\t\tString os = dagent.getOfferingStrategy().getClassname();\n\t\tString as = dagent.getAcceptanceStrategy().getClassname();\n\t\tString om = dagent.getOpponentModel().getClassname();\n\t\tString oms = dagent.getOMStrategy().getClassname();\n\n\t\t// createFrom the actual objects using reflexion\n\n\t\tofferingStrategy = BOAagentRepository.getInstance().getOfferingStrategy(os);\n\t\tacceptConditions = BOAagentRepository.getInstance().getAcceptanceStrategy(as);\n\t\topponentModel = BOAagentRepository.getInstance().getOpponentModel(om);\n\t\tomStrategy = BOAagentRepository.getInstance().getOMStrategy(oms);\n\n\t\t// init the components.\n\t\ttry {\n\t\t\topponentModel.init(negotiationSession, dagent.getOpponentModel().getParameters());\n\t\t\topponentModel.setOpponentUtilitySpace(fNegotiation);\n\t\t\tomStrategy.init(negotiationSession, opponentModel, dagent.getOMStrategy().getParameters());\n\t\t\tofferingStrategy.init(negotiationSession, opponentModel, omStrategy,\n\t\t\t\t\tdagent.getOfferingStrategy().getParameters());\n\t\t\tacceptConditions.init(negotiationSession, offeringStrategy, opponentModel,\n\t\t\t\t\tdagent.getAcceptanceStrategy().getParameters());\n\t\t\tacceptConditions.setOpponentUtilitySpace(fNegotiation);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// remove the reference to the information object such that the garbage\n\t\t// collector can remove it.\n\t\tdagent = null;\n\t}", "@Override\n protected void configure() {\n }", "@Override\n\tpublic Service duplexstreamDeliverMsgPluginManagerServiceInit(\n\t\t\tList<String> configList) {\n\t\treturn null;\n\t}", "@Override\n public void configure() {\n }", "@Override\n public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {\n\n Map<String, MediaType> types = new HashMap<>();\n types.put(\"json\", MediaType.APPLICATION_JSON);\n types.put(\"xml\", MediaType.APPLICATION_XML);\n\n configurer.favorPathExtension(false).\n useJaf(false).\n defaultContentType(MediaType.APPLICATION_JSON).\n mediaType(\"xml\", MediaType.APPLICATION_XML).\n mediaType(\"json\", MediaType.APPLICATION_JSON);\n }", "@Override\n\tpublic void configure() {\n\t\t\n\t}", "void initializeConfiguration(@Observes AfterDeploymentValidation adv, BeanManager beanManager) {\n ROOT_LOGGER.picketlinkBootstrap();\n\n SecurityConfigurationEvent securityConfigurationEvent = new SecurityConfigurationEvent();\n\n beanManager.fireEvent(securityConfigurationEvent);\n\n // TODO: best is fire an event. We're not doing that because of issues in EAP and WildFly when using PL jars from modules.\n this.securityConfigurationBuilder = securityConfigurationEvent.getBuilder();\n\n this.securityConfiguration = this.securityConfigurationBuilder.build();\n\n this.identityBeanDefinition.setSecurityConfiguration(this.securityConfiguration);\n }", "@Override\n\tpublic Service duplexstreamDeliverMsgPluginManagerServiceInit() {\n\t\treturn null;\n\t}", "public ServerConfigImpl() {\n this.expectations = new ExpectationsImpl(globalEncoders, globalDecoders);\n this.requirements = new RequirementsImpl();\n }", "@Override\n\tpublic void configure() {\n\n\t}", "public ParameterContentNegotiationStrategy(Map<String, MediaType> mediaTypes) {\n\t\tsuper(mediaTypes);\n\t}", "@Override\n\tprotected void configure() {\n\n\t}", "@Override\n\tpublic void configure(AuthenticationManagerBuilder builder)\n\t\t\tthrows Exception {\n\t\tbuilder.authenticationProvider(discoveryAuthenticationProvider);\n\t}", "NegotiationType getNegotiationType();", "@Override\n public void configure() throws Exception {\n restConfiguration()\n .component(\"netty-http\")\n .host(\"0.0.0.0\")\n .port(8099);\n\n rest()\n .post(\"/webhook\")\n .route()\n .setBody(constant(\"{\\\"ok\\\": true}\"))\n .endRest()\n .post(\"/slack/api/conversations.list\")\n .route()\n .setBody(constant(\n \"{\\\"ok\\\":true,\\\"channels\\\":[{\\\"id\\\":\\\"ABC12345\\\",\\\"name\\\":\\\"general\\\",\\\"is_channel\\\":true,\\\"created\\\":1571904169}]}\"))\n .endRest()\n .post(\"/slack/api/conversations.history\")\n .route()\n .setBody(constant(\n \"{\\\"ok\\\":true,\\\"messages\\\":[{\\\"type\\\":\\\"message\\\",\\\"subtype\\\":\\\"bot_message\\\",\\\"text\\\":\\\"Hello Camel Quarkus Slack\\\"\"\n + \",\\\"ts\\\":\\\"1571912155.001300\\\",\\\"bot_id\\\":\\\"ABC12345C\\\"}],\\\"has_more\\\":true\"\n + \",\\\"channel_actions_ts\\\":null,\\\"channel_actions_count\\\":0}\"));\n }", "@Override\n public void init(NegotiationInfo info)\n {\n super.init(info);\n\n // initializes User Model and Opponent Model\n userModelInterface = new UserModelInterfaceImpl(this);\n utilitySpace = userModelInterface.estimateUtilitySpace();\n\n // search all outcomes and sort\n sortedOutcomeSpace = new SortedOutcomeSpace(utilitySpace);\n feasibleBids = sortedOutcomeSpace.getAllOutcomes();\n\n // initializes acceptance and offering strategy\n acceptanceStrategy = new DefaultAcceptanceStrategyImpl(this);\n offeringStrategy = new DefaultOfferingStrategyBasedOpponentImpl(this);\n }", "protected NegotiationParty init() throws InstantiateException {\n\t\tNegotiationParty party1 = load();\n\t\tprotocolClassPath = party1.getProtocol().getCanonicalName();\n\t\tinitialized = true;\n\t\treturn party1;\n\t}", "@Override\r\n\tpublic void configPlugin(Plugins me) {\n\r\n\t}", "@Override\n\tprotected void configure() {\n\n\t\tbind(AddNetworkView.class).to(AddNetworkDesktopView.class).in(Singleton.class);\n\t\tbind(AddNetworkActivity.class);\n\n\t}", "@Override\r\n\tpublic void configure() throws Exception {\n\t\t\r\n\t}", "@Override\n protected void configure() {\n bind(EurekaInstanceConfig.class).toProvider(MyDataCenterInstanceConfigProvider.class).in(Scopes.SINGLETON);\n }", "@Override\n\tpublic Service upstreamResponseMsgPluginManagerServiceInit(\n\t\t\tList<String> configList) {\n\t\treturn null;\n\t}", "public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}", "@Override\n public void configure(@Nonnull AbstractConfigNode node) throws ConfigurationException {\n Preconditions.checkArgument(node instanceof ConfigPathNode);\n try {\n ConfigurationAnnotationProcessor.readConfigAnnotations(getClass(), (ConfigPathNode) node, this);\n Map<String, Object> config = configuration(node);\n ClientBuilder builder = ClientBuilder.newBuilder();\n if (config != null && !config.isEmpty()) {\n for (String key : config.keySet()) {\n builder.property(key, config.get(key));\n }\n }\n builder.connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS);\n builder.readTimeout(readTimeout, TimeUnit.MILLISECONDS);\n\n if (useSSL) {\n builder.sslContext(SSLContext.getDefault());\n }\n client = builder.register(JacksonJaxbJsonProvider.class).build();\n state().setState(EConnectionState.Open);\n } catch (Exception ex) {\n state().setError(ex);\n throw new ConfigurationException(ex);\n }\n }", "@Override\n protected void configure() {\n MorphiaLoggerFactory.reset();\n init();\n bind();\n }", "private ApplicationProtocolConfig()\r\n/* 40: */ {\r\n/* 41: 92 */ this.supportedProtocols = Collections.emptyList();\r\n/* 42: 93 */ this.protocol = Protocol.NONE;\r\n/* 43: 94 */ this.selectorBehavior = SelectorFailureBehavior.CHOOSE_MY_LAST_PROTOCOL;\r\n/* 44: 95 */ this.selectedBehavior = SelectedListenerFailureBehavior.ACCEPT;\r\n/* 45: */ }", "@Override\n\tpublic void receivedNegotiation(int arg0, int arg1) {\n\t\t\n\t}", "@Override\n\tpublic Service upstreamResponseMsgPluginManagerServiceInit() {\n\t\treturn null;\n\t}", "void setNegotiationTransactionType(NegotiationTransactionType negotiationTransactionType);", "void setTransmissionType(NegotiationTransmissionType negotiationTransmissionType);", "@Bean\n public ViewResolver contentNegotiatingViewResolver(\n ContentNegotiationManager manager) {\n ViewResolver beanNameViewResolver = new BeanNameViewResolver();\n List<ViewResolver> resolvers = Lists.newArrayList(beanNameViewResolver);\n\n ContentNegotiatingViewResolver resolver = new ContentNegotiatingViewResolver();\n resolver.setViewResolvers(resolvers);\n resolver.setContentNegotiationManager(manager);\n return resolver;\n }", "public interface SecurityConfigurator {\n\n /**\n * The provider to use for {@link SSLEngine}.\n */\n enum SslProvider {\n /**\n * Use the stock JDK implementation.\n */\n JDK,\n /**\n * Use the openssl implementation.\n */\n OPENSSL,\n /**\n * Auto detect which implementation to use.\n */\n AUTO\n }\n\n /**\n * Trusted certificates for verifying the remote endpoint's certificate. The input stream should\n * contain an {@code X.509} certificate chain in {@code PEM} format.\n *\n * @param trustCertChainSupplier a supplier for the certificate chain input stream.\n * <p>\n * The responsibility to call {@link InputStream#close()} is transferred to callers of the returned\n * {@link Supplier}. If this is not the desired behavior then wrap the {@link InputStream} and override\n * {@link InputStream#close()}.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(Supplier<InputStream> trustCertChainSupplier);\n\n /**\n * Trust manager for verifying the remote endpoint's certificate.\n * The {@link TrustManagerFactory} which take preference over any configured {@link Supplier}.\n *\n * @param trustManagerFactory the {@link TrustManagerFactory} to use.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(TrustManagerFactory trustManagerFactory);\n\n /**\n * The SSL protocols to enable, in the order of preference.\n *\n * @param protocols the protocols to use.\n * @return {@code this}.\n * @see SSLEngine#setEnabledProtocols(String[])\n */\n SecurityConfigurator protocols(String... protocols);\n\n /**\n * The cipher suites to enable, in the order of preference.\n *\n * @param ciphers the ciphers to use.\n * @return {@code this}.\n */\n SecurityConfigurator ciphers(Iterable<String> ciphers);\n\n /**\n * Set the size of the cache used for storing SSL session objects.\n *\n * @param sessionCacheSize the cache size.\n * @return {@code this}.\n */\n SecurityConfigurator sessionCacheSize(long sessionCacheSize);\n\n /**\n * Set the timeout for the cached SSL session objects, in seconds.\n *\n * @param sessionTimeout the session timeout.\n * @return {@code this}.\n */\n SecurityConfigurator sessionTimeout(long sessionTimeout);\n\n /**\n * Sets the {@link SslProvider} to use.\n *\n * @param provider the provider.\n * @return {@code this}.\n */\n SecurityConfigurator provider(SslProvider provider);\n}", "public void configure() {\n /*from(ServiceDefinitions.EP_SWITCHYARD + ServiceDefinitions.SVC_SEND_RESULT)\n // Bei Mail ist Body ein\n // org.apache.camel.component.exec.ExecResult, daher umwandeln\n // in String.\n .convertBodyTo(String.class)\n .log(\"Received message for 'OutgoingResultRoute' : ${body}\")\n .to(ServiceDefinitions.EP_SWITCHYARD + ServiceDefinitions.SVC_CALL_NAVISION);*/\n }", "public ClientManager(ResourceManager rManager) {\n super();\n this.automaticLogin = false;\n\n // 1 - We load the ProfileConfigList\n this.profileConfigList = ProfileConfigList.load();\n\n if (this.profileConfigList == null) {\n Debug.signal(Debug.NOTICE, this, \"no client's profile found : creating a new one...\");\n this.profileConfigList = new ProfileConfigList();\n } else {\n Debug.signal(Debug.NOTICE, null, \"Client Configs loaded with success !\");\n }\n\n if (!ClientManager.rememberPasswords) {\n this.profileConfigList.deletePasswords(); // make sure we don't save any password here\n this.profileConfigList.save();\n }\n\n // 2 - We load the ServerConfigManager\n this.serverConfigManager = new ServerConfigManager(rManager);\n this.serverConfigManager.setRemoteServerConfigHomeURL(ClientDirector.getRemoteServerConfigHomeURL());\n Debug.signal(Debug.NOTICE, null, \"Server config Manager started with success !\");\n\n // 3 - We get the font we are going to use...\n this.f = FontFactory.getDefaultFontFactory().getFont(\"Lucida Blackletter Regular\");\n }", "@Override\n public void init(ConfigurationContext cfgCtx, TransportOutDescription transportOut)\n throws AxisFault {\n super.init(cfgCtx, transportOut);\n rabbitMQConnectionFactoryManager = new RabbitMQConnectionFactoryManager(transportOut);\n log.info(\"RabbitMQ AMQP Transport Sender initialized...\");\n\n }", "@Override\r\n protected void configure() {\r\n bindRequiredName(\"LTAS_SERVICE_NAME\", \"LTAS_SERVICE_NAME\");\r\n bindRequiredName(\"RABBITMQ_HOST\", \"RABBITMQ_HOST\");\r\n bindRequiredName(\"RABBITMQ_PORT\", \"RABBITMQ_PORT\");\r\n bindRequiredName(\"RABBITMQ_USERNAME\", \"RABBITMQ_USERNAME\");\r\n bindRequiredName(\"RABBITMQ_PWD\", \"RABBITMQ_PWD\");\r\n bindRequiredName(\"RABBITMQ_VIRTUALHOST\", \"RABBITMQ_VIRTUALHOST\");\r\n\r\n bind(RabbitMQAPI.class);\r\n bind(RabbitMQService.class);\r\n\r\n }", "void configureWith(Message message);", "private DefaultSaslConfig(String mechanism) {\n this.mechanism = mechanism;\n }", "@Override\n\tpublic Service upstreamDeliverMsgPluginManagerServiceInit(\n\t\t\tList<String> configList) {\n\t\treturn null;\n\t}", "void configure();", "public MechanismReadOptions() {\n initComponents();\n }", "public void initialConfig() {\n }", "public MyEncodableWithEncoderDecoderSpecifiedUsingConfiguration() {}", "protected void configureClient() {\n\t\tswitch (getVariant(ClientRegistration.class)) {\n\t\tcase STATIC_CLIENT:\n\t\t\tcallAndStopOnFailure(GetStaticClientConfiguration.class);\n\t\t\tconfigureStaticClient();\n\t\t\tbreak;\n\t\tcase DYNAMIC_CLIENT:\n\t\t\tcallAndStopOnFailure(StoreOriginalClientConfiguration.class);\n\t\t\tcallAndStopOnFailure(ExtractClientNameFromStoredConfig.class);\n\t\t\tconfigureDynamicClient();\n\t\t\tbreak;\n\t\t}\n\n\t\texposeEnvString(\"client_id\");\n\n\t\tcompleteClientConfiguration();\n\t}", "protected void additionalConfig(ConfigType config){}", "public void registerSelf(ParserManager manager, String namespace)\n {\n // We support parsing of both a single ImageProviderRequest as \n // well as a set of ImageProviderRequests.\n manager.registerFactory(Color.class, namespace, this);\n }", "@Override\n public void initialize(ServerConfiguration config) {\n }", "public void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager) {\r\n\t\t//register ZK contexts\r\n\t\tevent.addContext(new DesktopContext());\r\n\t\tevent.addContext(new PageContext());\r\n\t\tevent.addContext(new IdSpaceContext());\r\n\t\tevent.addContext(new ComponentContext());\r\n\t\tevent.addContext(new ExecutionContext());\r\n\t\tlog.info(\"ZK Weld Extension \"+Version.UID);\r\n\t}", "abstract public TunnelConfig createTunnelConfig();", "@Override\r\n\tprotected void configure(AuthenticationManagerBuilder auth) throws Exception {\n\t\tauth.authenticationProvider(authenticateionProvider());\r\n\t}", "@PostConstruct\n\tpublic void config() {\n\t\tthis.configureSwaggerV1();\n\t}", "public void configure() {\n from(INBOUND_URI + \"?serviceClass=\" + WsTwitterService.class.getName())\n .marshal().xmljson() // convert xml to json\n .transform().jsonpath(\"$.query\") // extract arg0 contents\n .removeHeaders(\"*\")\n .setHeader(Exchange.HTTP_METHOD, new SimpleExpression(\"GET\"))\n // Note, prefer HTTP_PATH + to(<uri>) instead of toD(<uri with path>) for easier unit testing\n .setHeader(Exchange.HTTP_PATH, new SimpleExpression(\"/twitter/${body}\"))\n .to(TWITTER_URI)\n .removeHeader(Exchange.HTTP_PATH)\n .convertBodyTo(byte[].class) // load input stream to memory\n .setHeader(Exchange.HTTP_METHOD, new SimpleExpression(\"POST\"))\n .setHeader(\"recipientList\", new SimpleExpression(\"{{env:WS_RECIPIENT_LIST:http4://localhost:8882/filesystem/}}\"))\n .recipientList().header(\"recipientList\")\n .transform().constant(null);\n }", "@Override\n default ManagerPrx ice_endpointSelection(com.zeroc.Ice.EndpointSelectionType newType)\n {\n return (ManagerPrx)_ice_endpointSelection(newType);\n }", "public ConfigParserHandler() {\n\t}", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public static Configurable configure() {\n return new RecoveryServicesManager.ConfigurableImpl();\n }", "public JerseyConfig() {\n\t\tregister(StudentService.class);\n\t\tregister(PromotionService.class);\n\t\tregister(GroupService.class);\n\t\tregister(RoleService.class);\n\t\tregister(RightService.class);\n\t\tregister(AccountService.class);\n\t\tregister(TimesheetService.class);\n\t\tthis.configureSwagger();\n\t}", "public JerseyInitializer() {\n this.register(new JacksonJsonProvider(ObjectMapperFactory.create()));\n this.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);\n this.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);\n this.packages(true, \"com.hh.resources\");\n }", "@Override\n\tpublic Service upstreamDeliverMsgPluginManagerServiceInit() {\n\t\treturn null;\n\t}", "private PSConfigDeNormalizer()\n {\n\n }", "private void configureNode() {\n\t\twaitConfigData();\n\t\tpropagateConfigData();\n\n\t\tisConfigured = true;\n\t}", "@Override\n\t\tprotected void configure() {\n\t\t\tbind(NamedItem.class).annotatedWith(Names.named(\"Mariano\")).to(Mariano.class).asEagerSingleton();\n\t\t\tbind(NamedItem.class).annotatedWith(Names.named(\"Francisco\")).to(Francisco.class).asEagerSingleton();\n\t\t}", "public void configure(ZMonitorManager manager) {\n\t\tmanager.addTimelineHandler(\"DUMMY_TOSTRING_HANDLER\", new ToStringTimelineHandler());\n\t}", "@Override\n public void configureForXmlConformance() {\n mConfig.configureForXmlConformance();\n }", "private void initProtocol() {\n\t\tprotocol = new MixingProtocol();\n\n\t\tRectangleMixingStep step1 = new RectangleMixingStep(1.25, true, true);\n\t\tRectangleMixingStep step2 = new RectangleMixingStep(2.50, true, false);\n\t\tRectangleMixingStep step3 = new RectangleMixingStep(3.75, false, true);\n\t\tRectangleMixingStep step4 = new RectangleMixingStep(4.0, false, false);\n\n\t\tprogram = new ArrayList<MixingStep>();\n\t\tprogram.add(step1);\n\t\tprogram.add(step2);\n\t\tprogram.add(step3);\n\t\tprogram.add(step4);\n\n\t\tprotocol.setProgram(program);\n\t}", "@SuppressWarnings(\"rawtypes\")\n\t@Override\n\tpublic void configure() throws Exception {\n\t\t\n\t\tfrom(\"direct:addtraitshierarchy-repos\").process(new Processor() {\n\t\t\t@Override\n\t\t\tpublic void process(Exchange ex) throws Exception { // NOSONAR Must throw Exception because of inherited definition\n\t\t\t\tTraitHierarchy newTraitHierarchy = ex.getIn().getBody(TraitHierarchy.class);\n\t\t\t\tex.getOut().setBody(new Work<TraitHierarchy>(TraitHierarchy.class, null, newTraitHierarchy, Action.CREATE));\n\t\t\t}\n\t\t}).process(new DroolsCommandTransformer<Work>(\"work\", Work.class)).to(\"drools:node/ksession\")\n\t\t\t.transform().simple(\"${body.getValue('work').newContainer}\")\n\t\t\t.process(new TraitHierarchyParentIdProcessor())\n\t\t\t.choice()\n\t\t\t\t.when(body().isNull())\n\t\t\t\t\t.enrich(\"direct:getNextParentId-repos\", new TraitHierarchyEnrichAggregationStrategy(Action.GET))\n\t\t\t\t.end()\n\t\t\t.choice()\n\t\t\t\t.when(body().isNotNull())\n\t\t\t\t\t.process(new TraitHierarchyProcessor())\n\t\t\t\t.end()\n\t\t\t.bean(traitsHierarchiesRepo, \"add\");\n\t\t\n\t\t//Get next parent id for trait department creation\n\t\tfrom(\"direct:getNextParentId-repos\")\n\t\t\t\t.bean(traitsHierarchiesRepo, \"getNextParentId\");\n\t\t\n\t\t/*\n\t\t * get the basic trait hierarchy information. Input will either be the id.\n\t\t */\n\t\tfrom(\"direct:gettraitshierarchy-repos\").convertBodyTo(TraitHierarchy.class)\n\t\t.process(new Processor() {\n\t\t\t@Override\n\t\t\tpublic void process(Exchange ex) throws Exception { // NOSONAR Must throw Exception because of inherited definition\n\t\t\t\tTraitHierarchy newTraitHierarchy = ex.getIn().getBody(TraitHierarchy.class);\n\t\t\t\tex.setProperty(APPINIMAP, newTraitHierarchy.getAppIniMap());\n\t\t\t}\n\t\t\t})\n\t\t\t.choice()\n\t\t\t\t.when(simple(\"${body} is 'com.walmart.traits.TraitHierarchy'\")).transform().simple(\"${body.id}\") // NOSONAR \n\t\t\t.end()\n\t\t.bean(traitsHierarchiesRepo, \"withId\")\n\t\t.choice()\n\t\t\t.when(body().isNotNull())\n\t\t\t\t.process(new TraitHODeptProcessor())\n\t\t\t\t.choice()\n\t\t\t\t\t.when(body().isNotNull())\n\t\t\t\t\t\t.enrich(\"direct:getHoMerchDept\", new TraitHOEnrichAggregationStrategy())\n\t\t\t\t.end()\n\t\t\t\t.choice()\n\t\t\t\t\t.when(body().isNull())\n\t\t\t\t\t\t.process(new TraitHierarchyProcessor())\n\t\t\t\t.end()\n\t\t.end();\n\t\t//Get all trait departments available\n\t\tfrom(\"direct:getAllTraitDepartments-repos\")\n\t\t\t.choice()\n\t\t\t\t.when(simple(\"${body} is 'com.walmart.traits.TraitHierarchy'\")).transform().simple(\"${body.level}\") // NOSONAR \n\t\t\t.end()\n\t\t.bean(traitsHierarchiesRepo, \"withTraitsHierarchyLevel\");\n\t\t\n\t\t//Get all trait departments details for admin\n\t\tfrom(\"direct:getDeptDetails-repos\")\n\t\t.bean(traitsHierarchiesRepo, \"get\");\n\t\t\n\t\t//Get all trait categories available for a trait department.\n\t\tfrom(\"direct:getAllTraitCategories-repos\")\n\t\t\t.choice()\n\t\t\t\t.when(simple(\"${body} is 'com.walmart.traits.TraitHierarchy'\")).transform().simple(\"${body.parentId}\") // NOSONAR \n\t\t\t.end()\n\t\t.bean(traitsHierarchiesRepo, \"withTraitsDepartment\");\n\t\t\n\t\t//Delete trait hierarchy information. Input will either be the id.\n\t\tfrom(\"direct:removetraitshierarchy-repos\").convertBodyTo(TraitHierarchy.class)\n\t\t\t.enrich(\"direct:gettraitshierarchy-repos\", new TraitHierarchyEnrichAggregationStrategy(Action.DELETE))\n\t\t\t.process(new DroolsCommandTransformer<Work>(\"work\", Work.class)).to(\"drools:node/ksession\")\n\t\t.transform().simple(\"${body.getValue('work').oldContainer}\").bean(traitsHierarchiesRepo, \"remove\");\n\t\t\n\t\t//Update trait hierarchy information.\n\t\tfrom(\"direct:updatetraitshierarchy-repos\").convertBodyTo(TraitHierarchy.class)\n\t\t .enrich(\"direct:gettraitshierarchy-repos\", new TraitHierarchyEnrichAggregationStrategy(Action.UPDATE))\n\t\t\t.process(new DroolsCommandTransformer<Work>(\"work\", Work.class)).to(\"drools:node/ksession\")\n\t\t\t.transform().simple(\"${body.getValue('work')}\").process(new ValidateCategoryUpdate())\n\t\t\t.choice().when(body().isNotNull())\n\t\t\t\t.enrich(\"direct:validateMaxForCat-repos\").process(new ValidateMaxError())\n\t\t\t.end()\t\n\t\t\t.process(new Processor() {\n\t\t\t\t\tpublic void process(Exchange ex) throws Exception { // NOSONAR Must throw Exception because of inherited definition\n\t\t\t\t\t\tex.getOut().setBody(ex.getIn().getHeader(TRAIT_HIERARCHY));\n\t\t\t\t\t}\n\t\t \t })\n\t\t\t.choice().when(simple(\"${body.errorMessage} == null\"))\n\t\t\t\t.bean(traitsHierarchiesRepo, \"update\")\n\t\t\t\t.choice()\n\t\t\t\t\t.when(body().isNotNull())\n\t\t\t\t\t\t.process(new TraitCatgHODeptProcessor())\n\t\t\t\t\t\t.choice()\n\t\t\t\t\t\t\t.when(body().isNotNull())\n\t\t\t\t\t\t\t\t.bean(traitsHierarchiesRepo, \"updateHoDeptCatgAssociation\")\n\t\t\t\t\t\t\t\t.bean(traitsHierarchiesRepo, \"updateHoDeptTraitsAssociation\")\n\t\t\t\t\t\t.end()\n\t\t\t\t\t\t.choice()\n\t\t\t\t\t\t \t.when(body().isNull())\n\t\t\t\t\t\t \t\t.process(new TraitHierarchyProcessor())\n\t\t\t\t\t\t .end()\n\t\t\t\t.end()\n\t\t\t.end();\n\t\t\t\n\t\t//Get trait departments available with given name\n\t\tfrom(\"direct:getTraitDepartmentsWithName-repos\")\n\t\t\t.choice()\n\t\t\t\t.when(simple(\"${body} is 'com.walmart.traits.TraitHierarchy'\")).transform().simple(\"${body.name}\") // NOSONAR \n\t\t\t.end()\n\t\t.bean(traitsHierarchiesRepo, \"withDepartmentName\");\n\t\t\n\t // DO NOT ADD NEW ROUTES AFTER THIS LINE!!!\n\t /* Includes the transactional routes \n\t\t* (Adds the transacted() DSL) \n\t\t* corresponding to all the routes in this class.*/ \n\t\tfinal List<String> hierarchyRoutes = transactionalRoutes\n\t\t\t\t.getRouteUris(getRouteCollection().getRoutes());\n\t\tincludeRoutes(transactionalRoutes.configureTransactionalRoutes(hierarchyRoutes));\n\t\tincludeRoutes(transactionalRoutes.configureResourceRoutes(hierarchyRoutes));\n\t\t\n\t}", "private void config() {\n\t}", "public interface ClientConfig\n{\n /**\n * Allow IRC version 3 capabilities.\n *\n * @return returns <tt>true</tt> if IRC version 3 capabilities are allowed,\n * or <tt>false</tt> if we explicitly disallow anything related to\n * IRCv3. (Disabling may regress the connection to \"classic\" IRC\n * (RFC1459).)\n */\n boolean isVersion3Allowed();\n\n /**\n * Enable contact presence periodic task for keeping track of contact\n * presence (offline or online).\n *\n * @return returns <tt>true</tt> to use contact presence task or\n * <tt>false</tt> otherwise.\n */\n boolean isContactPresenceTaskEnabled();\n\n /**\n * Enable channel presence periodic task for keeping track of channel\n * members presence (available or away).\n *\n * @return returns <tt>true</tt> to use channel presence task or\n * <tt>false</tt> otherwise.\n */\n boolean isChannelPresenceTaskEnabled();\n\n /**\n * Use a SOCKS proxy to connect to the configured IRC server.\n *\n * The proxy may be <tt>null</tt> which means that no proxy will be used\n * when connecting to the IRC server.\n *\n * @return returns Proxy configuration or <tt>null</tt> if no proxy should\n * be used.\n */\n Proxy getProxy();\n\n /**\n * Resolve addresses through the proxy, instead of using a (local) DNS\n * resolver.\n *\n * @return returns <tt>true</tt> if addresses should be resolved through\n * proxy, or <tt>false</tt> if it should NOT be resolved through\n * proxy\n */\n boolean isResolveByProxy();\n\n /**\n * Get the configured SASL authentication data.\n *\n * @return Returns the SASL authentication data if set, or null if no\n * authentication data is set. If no authentication data is set,\n * this would mean SASL authentication need not be used.\n */\n SASL getSASL();\n\n /**\n * SASL authentication data.\n *\n * @author Danny van Heumen\n */\n static interface SASL\n {\n /**\n * Get user name.\n *\n * @return Returns the user name.\n */\n String getUser();\n\n /**\n * Get password.\n *\n * @return Returns the password.\n */\n String getPass();\n\n /**\n * Get authorization role.\n *\n * @return Returns the authorization role if set. (Optional)\n */\n String getRole();\n }\n}", "private void initialiseByHand() {\n Configuration production = new Configuration(\"api.example.com\", false, 2000);\n Configuration staging = new Configuration(\"api-staging.example.com\", false, 2000);\n Configuration debug = new Configuration(\"api-dev.example.com\", true, 1000);\n Map<String, Configuration> baseVariants = new HashMap<>();\n baseVariants.put(PRODUCTION, production);\n baseVariants.put(STAGING, staging);\n baseVariants.put(DEBUG, debug);\n Neanderthal.initialise(this, baseVariants, PRODUCTION);\n }", "@Override\n\tpublic void configure(CommandLineParser parser) {\n\t\tparser.addOptions(plugins);\n\t}", "private void init()\n {\n SystrayActivator.bundleContext\n .addServiceListener(new ProtocolProviderServiceListener());\n \n ServiceReference[] protocolProviderRefs = null;\n try\n {\n protocolProviderRefs\n = SystrayActivator.bundleContext.getServiceReferences(\n ProtocolProviderService.class.getName(),null);\n }\n catch (InvalidSyntaxException ex)\n {\n // this shouldn't happen since we're providing no parameter string\n // but let's log just in case.\n logger .error(\"Error while retrieving service refs\", ex);\n return;\n }\n \n // in case we found any\n if (protocolProviderRefs != null)\n {\n \n for (int i = 0; i < protocolProviderRefs.length; i++)\n {\n ProtocolProviderService provider\n = (ProtocolProviderService) SystrayActivator.bundleContext\n .getService(protocolProviderRefs[i]);\n \n this.addAccount(provider);\n }\n }\n }", "private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}", "public void initialize(InfoflowManager manager);", "public void setManager(String manager) {\n this.manager = manager;\n }", "@Override\n\tprotected void setup() {\n\t\tgetContentManager().registerLanguage(new SLCodec());\n\t\tgetContentManager().registerOntology(MobilityOntology.getInstance());\n\t\tthis.addBehaviour(new ReceiveMessage());\n\t}", "public ConversorManagedBean() {\r\n }", "@Override\n public void setupConfiguration(Configuration config)\n {\n\n }", "void setTransmissionState(NegotiationTransmissionState negotiationTransmissionState);", "@Override\n\tpublic void configure() {\n\t\tfrom(\"switchyard://EnrichService\").log(\"Received message for 'EnrichService' : ${body}\").process(new Processor() {\n\n\t\t\t@Override\n\t\t\tpublic void process(Exchange exchange) throws Exception {\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tList<AdaptationTO> adaptationDirective = exchange.getIn().getHeader(\"adaptationDirective\", List.class);\n\t\t\t\tString message = (String)exchange.getIn().getBody();\n\t\t\t\t\n\t\t\t\tString xslt = (String) adaptationDirective.get(0).getData();\n\t\t\t\tStringReader reader = new StringReader(message);\n\t\t\t\tStringWriter writer = new StringWriter();\n\t\t\t\ttry {\n\t\t\t\t\tTemplates templates = tFactory.newTemplates(new StreamSource(new StringReader(xslt)));\n\t\t\t\t\tjavax.xml.transform.Transformer transformer = templates.newTransformer();\n\t\t\t\t\ttransformer.transform(new StreamSource(reader), new StreamResult(writer));\n\t\t\t\t\tmessage = writer.toString();\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tadaptationDirective.remove(0);\n\t\t\t\texchange.getIn().setBody(message);\n\t\t\t}\n\t\t}).log(\"Enrich body : ${body}\");\n\t\t;\n\t}", "public ServerConfig() {\n initComponents();\n try {\n UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(ServerConfig.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "@Override\r\n\t@Autowired\r\n\tpublic void configure(AuthenticationManagerBuilder auth) throws Exception {\n\t\tauth.authenticationProvider(authenticationProvider());\r\n\t}", "public void setConfig(WeberknechtConf conf, AreaPathResolver areaPathResolver);", "public void initReceiver() {\n }", "@Override\n\tpublic void init() {\n\t\tregisterBeanDefinitionParser(\"processorEventMulticaster\",\n\t\t\t\tnew ProcessorEventMulticasterDefinitionParser());\n\t\tregisterBeanDefinitionParser(\"processorEventListener\",\n\t\t\t\tnew ProcessorEventListenerDefinitionParser());\n\t}", "public void setConfigManager(ConfigManager configManager) {\n\t\tthis.configManager = configManager;\n\t}" ]
[ "0.6023941", "0.57405597", "0.54455876", "0.5445243", "0.5437322", "0.5400766", "0.53774446", "0.5247238", "0.5243522", "0.5225156", "0.5218059", "0.5174868", "0.51573473", "0.5147735", "0.5121657", "0.5120672", "0.51164234", "0.51132345", "0.510655", "0.5085554", "0.50799286", "0.50746906", "0.50626445", "0.5056104", "0.5047468", "0.5045889", "0.504033", "0.5034984", "0.50256515", "0.500566", "0.50045073", "0.50010407", "0.4979815", "0.49639115", "0.4953371", "0.49441054", "0.4943943", "0.49173358", "0.49141595", "0.49102098", "0.49099547", "0.49069953", "0.48949257", "0.48852825", "0.487971", "0.48774105", "0.48698545", "0.48593652", "0.48407763", "0.48362336", "0.4792608", "0.47917745", "0.47805426", "0.47758025", "0.47665474", "0.476594", "0.47629327", "0.47339123", "0.47044995", "0.47019714", "0.4700011", "0.46922538", "0.46802765", "0.46793768", "0.46749458", "0.46668315", "0.46445465", "0.4642595", "0.46401948", "0.4639742", "0.4639742", "0.46377128", "0.46374792", "0.46342552", "0.46332058", "0.46331903", "0.46307966", "0.46214917", "0.46209002", "0.461145", "0.4603835", "0.45998365", "0.45856577", "0.45828065", "0.45799127", "0.45796257", "0.45773786", "0.45728046", "0.4571759", "0.45649168", "0.4561134", "0.4556535", "0.45503753", "0.4547826", "0.4544708", "0.4543361", "0.45424977", "0.45417583", "0.45413896", "0.45367703" ]
0.5813596
1
Configurate message source bean.
@Bean("messageSource") public ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource() { ReloadableResourceBundleMessageSource mesSource = new ReloadableResourceBundleMessageSource(); mesSource.setBasename("classpath:messages/messages"); mesSource.setDefaultEncoding("UTF-8"); return mesSource; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Autowired(required = true)\n public void setMessageSource(MessageSource messageSource) {\n MessageUtils.messageSource = messageSource;\n }", "@Autowired\n\tpublic MyUtil(MessageSource messageSource){\n\t\tMyUtil.messageSource=messageSource;\n\t}", "@Bean(\"messageSource\")\n\tpublic MessageSource messageSource() {\n\t\tReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();\n\t\tmessageSource.setBasename(\"classpath:strings\");\n\t\tmessageSource.setDefaultEncoding(\"UTF-8\");\n\t\tmessageSource.setUseCodeAsDefaultMessage(true);\n\t\treturn messageSource;\n\t}", "@Autowired\n public SimpleSourceBean(Source source){\n this.source = source;\n }", "@Autowired\n public final void setMessageSource(final MessageSource messageSource) {\n this.messageSource = messageSource;\n }", "@Bean(name = \"messageSource\")\n public DistributedResourceBundleMessageSource messageSource() {\n return new DistributedResourceBundleMessageSource();\n }", "void configuration(String source, String name, String value);", "private static ConfigSource config()\n {\n return CONFIG_MAPPER_FACTORY.newConfigSource()\n .set(\"type\", \"mailchimp\")\n .set(\"auth_method\", \"api_key\")\n .set(\"apikey\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"access_token\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"list_id\", \"xxxxxxxxxxxxxxxxxxx\")\n .set(\"email_column\", \"email\")\n .set(\"fname_column\", \"fname\")\n .set(\"lname_column\", \"lname\");\n }", "@Bean\n\tpublic ReloadableResourceBundleMessageSource messageSource() {\n\t\tReloadableResourceBundleMessageSource r = new ReloadableResourceBundleMessageSource();\n\t\tr.setBasename(\"classpath:message\");\n\t\tr.setDefaultEncoding(\"UTF-8\");\n\t\treturn r;\n\t}", "@Bean\n\tpublic ResourceBundleMessageSource messageSource() {\n\n\t\tSystem.out.println(\"\\n\" + \"execution is reaching messageSource()\");\n\t\tResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();\n\t\tmessageSource.setBasename(\"Messages\");\n\t\treturn messageSource;\n\t}", "@Bean\n public MessageSourceAccessor messageSourceAccessor(){\n MessageSourceAccessor accessor = new MessageSourceAccessor(messageSource());\n return accessor;\n }", "@Autowired\n public SimpleSourceBean(Source source) {\n this.source = source;\n }", "public void setMessageSource(MessageSource messageSource) {\n this.messageSource = messageSource;\n }", "@Bean(name = \"messageSource\")\n\tpublic ReloadableResourceBundleMessageSource messageSource() {\n\t\tReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource();\n\t\tmessageBundle.setBasename(\"classpath:messages/messages\");\n\t\tmessageBundle.setDefaultEncoding(\"UTF-8\");\n\t\tLocaleContextHolder.setLocale(Locale.US);\n\t\treturn messageBundle;\n\t}", "public void set_source(String name) throws ConnectorConfigException{\n\t\tsource = name.trim();\n\t\tif (source.equals(\"\"))\n\t\t\tthrow new ConnectorConfigException(\"Source of data can't be empty\");\n\t}", "@Bean\r\n\tpublic MessageSource messageSource() {\r\n\t\tResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();\r\n\r\n\t\tmessageSource.setBasenames(\"messages\");\r\n\t\tmessageSource.setDefaultEncoding(\"UTF-8\");\r\n\r\n\t\treturn messageSource;\r\n\t}", "public MessageDestinationFactory() {\n this.properties = new ConfigMap();\n }", "void configureWith(Message message);", "@Bean\n\t\tpublic MessageSource<File> sourceDirectory() {\n\t\t\tFileReadingMessageSource messageSource = new FileReadingMessageSource();\n\t\t\tmessageSource.setDirectory(new File(\"Source\"));\n\t\t\treturn messageSource;\n\t\t}", "@Bean\n\tpublic ResourceBundleMessageSource messageSource() {\n\t\tResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();\n\t\tmessageSource.setBasename(\"messages\");\n\t\t// use this setting to apply consistent single-quote escaping to all messages \n\t\tmessageSource.setAlwaysUseMessageFormat( true );\n\t\t\n\t\treturn messageSource;\n\t}", "public List<MessageSource> createMessageSources(){\n\n List<MessageSource> messageSourceList = new ArrayList<>();\n\n String messageSourceConfig = Configurations.map.getProperty(\"messageSourceChannels\");\n String[] sourceConfigArray = messageSourceConfig.split(\",\");\n\n for(String sourceConfig : sourceConfigArray) {\n MessageSource messageSource = null;\n\n // there is only file message source option for instance, but it's extendable\n if(sourceConfig.equals(\"file\")){\n messageSource = new FileSource();\n }\n\n if(messageSource != null){\n messageSourceList.add(messageSource);\n }\n }\n\n if(messageSourceList.size() == 0){\n return null;\n }\n\n return messageSourceList;\n }", "@Bean\n\tpublic ResourceBundleMessageSource messageSource() {\n\t\tResourceBundleMessageSource source = new ResourceBundleMessageSource();\n\t\t/*\n\t\t * By default, Spring will try to find messages_XX.properties under\n\t\t * src/main/resources. To change such location we need to call\n\t\t * setBasenames. This indicates that all messagesXXX will be under i18n\n\t\t * folder(NOT i18n/messages/messages_XXXX)\n\t\t */\n\t\tsource.setBasenames(\"i18n/messages\");\n\t\tsource.setUseCodeAsDefaultMessage(true);\n\t\tsource.setDefaultEncoding(StandardCharsets.UTF_8.name());\n\t\tlog.info(\"Setting message source \" + source.toString());\n\t\treturn source;\n\t}", "@Bean\r\n public MessageSource messageSource() {\r\n\r\n ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();\r\n messageSource.setBasename(\"messages\");\r\n\r\n return messageSource;\r\n }", "@Bean\n public MessageSource messageSource() {\n ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();\n messageSource.setBasename(\"messages\");\n return messageSource;\n }", "public Builder setConfigSource(com.google.api.servicemanagement.v1.ConfigSource value) {\n if (configSourceBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n configSource_ = value;\n onChanged();\n } else {\n configSourceBuilder_.setMessage(value);\n }\n\n return this;\n }", "@Bean\n public ResourceBundleMessageSource messageSource() {\n \tResourceBundleMessageSource messageSource =new ResourceBundleMessageSource();\n \t//messageSource.setBasename(\"classpath:messages\");\n \tmessageSource.setBasename(\"messages\");\n \treturn messageSource;\n }", "@Bean\n public MessageSource messageSource(){\n ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource();\n resourceBundleMessageSource.setBasenames(\"/messages\");\n return resourceBundleMessageSource;\n }", "public void setSource (String source);", "public void setSource(String source);", "@Override\n\tpublic void configure() throws Exception {\n\t\t\n\t\t\n\t\tProcessor upProcessor = new UpperCaseProcessor();\n\t\t\n\t\t from(\"kafka:{{kafka.topic}}?brokers={{kafka.host}}:{{kafka.port}}\")\n .log(\"Message received from Kafka : ${body}\")\n .log(\" on the topic ${headers[kafka.TOPIC]}\")\n .log(\" on the partition ${headers[kafka.PARTITION]}\")\n .log(\" with the offset ${headers[kafka.OFFSET]}\")\n .log(\" with the key ${headers[kafka.KEY]}\")\n .process(upProcessor)\n .log(\"${body}\");\n\t\t\n\t\t\n\t}", "public MessageSource getMessageSource() {\n return messageSource;\n }", "public LoggingXmlConfiguration(ConfigurationSource configSource) {\n super(configSource);\n }", "public void setMsgsource(String msgsource) {\n this.msgsource = msgsource == null ? null : msgsource.trim();\n }", "@Bean\n public MessageSource messageSource() {\n ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();\n messageSource.setBasename(\"i18n/messages\");\n messageSource.setUseCodeAsDefaultMessage(true);\n return messageSource;\n }", "@Override\n protected final void initializeSpecific() {\n initializeSpringSpecific();\n\n // Once the subclasses have had their opportunity, compute configurations belonging to SpringTemplateEngine\n super.initializeSpecific();\n\n final MessageSource messageSource =\n this.templateEngineMessageSource == null ? this.messageSource : this.templateEngineMessageSource;\n\n final IMessageResolver messageResolver;\n if (messageSource != null) {\n final SpringMessageResolver springMessageResolver = new SpringMessageResolver();\n springMessageResolver.setMessageSource(messageSource);\n messageResolver = springMessageResolver;\n } else {\n messageResolver = new StandardMessageResolver();\n }\n\n super.setMessageResolver(messageResolver);\n\n }", "public void setSource(String value) {\n/* 304 */ setValue(\"source\", value);\n/* */ }", "void configureSource(Job job, int inputId) throws IOException;", "@Override\n public void configure() throws Exception {\n from(\"direct:populateKafka\")\n // .threads(Integer.parseInt(Config.getProperty(\"threadPoolSize\")), Integer.parseInt(Config.getProperty(\"maxthreadPoolSize\")))\n .process(new Processor() {\n @Override\n public void process(Exchange exchange) throws Exception {\n try {\n exchange.getOut().setHeaders(exchange.getIn().getHeaders());\n DataSource ds = exchange.getIn().getHeader(\"dataSource\", DataSource.class);\n String kafkaPath = \"kafka:\" + Config.getProperty(\"kafkaURI\") + \"?topic=ds\" + ds.getSrcID() + \"&serializerClass=\" + Config.getProperty(\"kafkaSerializationClass\");\n exchange.getOut().setBody(exchange.getIn().getBody());\n exchange.getOut().setHeader(KafkaConstants.PARTITION_KEY, \"1\");\n exchange.getOut().setHeader(\"kPath\", kafkaPath);\n System.out.println(\"Successfully populated Kafka\");\n } catch (Exception e) {\n\n e.printStackTrace();\n }\n }\n })\n .recipientList(header(\"kPath\"));\n\n }", "@Override\n\t\t\tprotected void configure() {\n\t\t\t}", "public void setSource(String value) {\n configuration.put(ConfigTag.SOURCE, value);\n }", "public void setSource(String source) {\n _source = source;\n }", "@Bean\r\n public DataSource dataSource() {\r\n String message = messageSource.getMessage(\"begin\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\r\n dataSource.setDriverClassName(propDatabaseDriver);\r\n dataSource.setUrl(propDatabaseUrl);\r\n dataSource.setUsername(propDatabaseUserName);\r\n dataSource.setPassword(propDatabasePassword);\r\n\r\n message = messageSource.getMessage(\"end\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n return dataSource;\r\n }", "public SpringJmsProvider(ApplicationContext context, String connectionFactoryBean, String destinationBean){\n this.connectionFactory = (ConnectionFactory)context.getBean(connectionFactoryBean);\n this.destination = (Destination)context.getBean(destinationBean);\n }", "public String getMsgsource() {\n return msgsource;\n }", "public ServiceConfig(ServiceConfig source) {\n if (source.Product != null) {\n this.Product = new String(source.Product);\n }\n if (source.UniqVpcId != null) {\n this.UniqVpcId = new String(source.UniqVpcId);\n }\n if (source.Url != null) {\n this.Url = new String(source.Url);\n }\n if (source.Path != null) {\n this.Path = new String(source.Path);\n }\n if (source.Method != null) {\n this.Method = new String(source.Method);\n }\n if (source.UpstreamId != null) {\n this.UpstreamId = new String(source.UpstreamId);\n }\n if (source.CosConfig != null) {\n this.CosConfig = new CosConfig(source.CosConfig);\n }\n }", "public void setSource(String source) {\r\n this.source = source;\r\n }", "@Bean\n public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer()\n {\n return new PropertySourcesPlaceholderConfigurer();\n }", "public void addSourceChanger(Component component, Class sourceClass)\n {\n component.addAttribute(GlobalAttributes.Value, sourceClass.getCanonicalName().replace(\".\", \"/\"));\n component.setID(sourceClass.getSimpleName() + \"_source\");\n getSourceChanges().put(component, sourceClass);\n }", "public void setSource(String source) {\n this.source = source;\n }", "public void setSource(String source) {\n this.source = source;\n }", "public final MessageSource getMessageSource() {\n return messageSource;\n }", "public void setSource(Source s)\n\t{\n\t\tsource = s;\n\t}", "@Override\n\tpublic void configure() {\n\t\tfrom(\"switchyard://EnrichService\").log(\"Received message for 'EnrichService' : ${body}\").process(new Processor() {\n\n\t\t\t@Override\n\t\t\tpublic void process(Exchange exchange) throws Exception {\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tList<AdaptationTO> adaptationDirective = exchange.getIn().getHeader(\"adaptationDirective\", List.class);\n\t\t\t\tString message = (String)exchange.getIn().getBody();\n\t\t\t\t\n\t\t\t\tString xslt = (String) adaptationDirective.get(0).getData();\n\t\t\t\tStringReader reader = new StringReader(message);\n\t\t\t\tStringWriter writer = new StringWriter();\n\t\t\t\ttry {\n\t\t\t\t\tTemplates templates = tFactory.newTemplates(new StreamSource(new StringReader(xslt)));\n\t\t\t\t\tjavax.xml.transform.Transformer transformer = templates.newTransformer();\n\t\t\t\t\ttransformer.transform(new StreamSource(reader), new StreamResult(writer));\n\t\t\t\t\tmessage = writer.toString();\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tadaptationDirective.remove(0);\n\t\t\t\texchange.getIn().setBody(message);\n\t\t\t}\n\t\t}).log(\"Enrich body : ${body}\");\n\t\t;\n\t}", "public ConfigSource getConfigSource() {\n return _configSource;\n }", "@Override\n public void configure() {\n\n final GroupedMessageAggregationStrategy groupedMessageAggregationStrategy = new GroupedMessageAggregationStrategy();\n final SizeAwareAggregationStrategy aggregationStrategy = new SizeAwareAggregationStrategy(groupedMessageAggregationStrategy);\n final AggregatedSizeCompletionPredicate completionPredicate = new AggregatedSizeCompletionPredicate(MAX_SIZE, aggregationStrategy);\n\n // @formatter:off\n\n from(\"timer:TIMER_1?period=1\")\n .bean(PersonProducer.class)\n .setHeader(GROUP, () -> RANDOM.nextInt(1))\n .marshal().json(Jackson)\n .to(\"seda:persons\")\n ;\n\n from(\"seda:persons?concurrentConsumers=5\")\n .aggregate()\n .header(GROUP)\n .aggregationStrategy(aggregationStrategy)\n .completionPredicate(completionPredicate)\n .parallelProcessing()\n .bean(ResultsPrinter.class)\n ;\n\n // @formatter:on\n }", "public SetCustomizedConfigForLoadBalancerRequest(SetCustomizedConfigForLoadBalancerRequest source) {\n if (source.OperationType != null) {\n this.OperationType = new String(source.OperationType);\n }\n if (source.UconfigId != null) {\n this.UconfigId = new String(source.UconfigId);\n }\n if (source.ConfigContent != null) {\n this.ConfigContent = new String(source.ConfigContent);\n }\n if (source.ConfigName != null) {\n this.ConfigName = new String(source.ConfigName);\n }\n if (source.LoadBalancerIds != null) {\n this.LoadBalancerIds = new String[source.LoadBalancerIds.length];\n for (int i = 0; i < source.LoadBalancerIds.length; i++) {\n this.LoadBalancerIds[i] = new String(source.LoadBalancerIds[i]);\n }\n }\n }", "public void set_source(EndpointID source) {\r\n\t\tsource_ = source;\r\n\t}", "public void setConfigSource(ConfigSource configSource) {\n JodaBeanUtils.notNull(configSource, \"configSource\");\n this._configSource = configSource;\n }", "@Override\r\n\tprotected void configure() {\n\t\t\r\n\t}", "public BindingConfiguration(final String name, final InjectionSource source) {\n if (name == null) {\n throw new IllegalArgumentException(\"Name cannot be null while constructing \" + this.getClass().getName());\n }\n if (source == null) {\n throw new IllegalArgumentException(\"Source cannot be null while constructing \" + this.getClass().getName());\n }\n this.name = name;\n this.source = source;\n }", "@NonNull\n\t\tBuilder addSource(@NonNull ConfigSource source);", "public SourceTypeConfiguration() {\n\n\t}", "@Override\n\tpublic void configure() {\n\n\t}", "@Override\n public void configure() {\n }", "public void setSource(String Source) {\r\n this.Source = Source;\r\n }", "public void configure() {\n\n // here is a sample which processes the input files\n // (leaving them in place - see the 'noop' flag)\n // then performs content based routing on the message using XPath\n\n }", "@Override\n\tprotected void configure() {\n\n\t}", "@Override\n protected void configure() {\n }", "@Override\n\tpublic void configure() {\n\t\t\n\t}", "public void setIpSource(String value) {\n setProperty(IP_SOURCE, value, \"\");\n }", "@Override\n\tpublic void configure(ComponentConfiguration arg0) {\n\t\t\n\t}", "@Override\n\tpublic void configure(ComponentConfiguration arg0) {\n\n\t}", "void setupExternalMessages();", "@Override\n public void configure() throws Exception {\n\n from(\"activemq:split-cola\").to(\"log:mensaje-recivido-de-active-mq\");\n }", "interface WithSource {\n /**\n * Specifies the source property: Source of the event channel. This represents a unique resource in the\n * partner's resource model..\n *\n * @param source Source of the event channel. This represents a unique resource in the partner's resource\n * model.\n * @return the next definition stage.\n */\n WithCreate withSource(EventChannelSource source);\n }", "public SourceTypeConfiguration(String sourceType, String source,\n\t\t\tString logPatternlayout, String sourceIndex) {\n\t\tthis.sourceType = sourceType;\n\t\tthis.source = source;\n\t\tthis.logPatternlayout = logPatternlayout;\n\t\tthis.sourceIndex = sourceIndex;\n\t}", "public DemoEventSource( T source ) {\n super(source);\n }", "interface WithSource {\n /**\n * Specifies the source property: Source of the event channel. This represents a unique resource in the\n * partner's resource model..\n *\n * @param source Source of the event channel. This represents a unique resource in the partner's resource\n * model.\n * @return the next definition stage.\n */\n Update withSource(EventChannelSource source);\n }", "private CanonizeSource() {}", "public void setSourceId(String source) {\n this.sourceId = sourceId;\n }", "private EventProcessorBuilder baseConfig(MockEventSender es) {\n return sendEvents().eventSender(senderFactory(es));\n }", "public SpringJmsProviderMain(String appContextClasspathResource, String connectionFactoryBean, String destinationBean, String jmsTemplateBean) {\r\n\t\tApplicationContext context = new ClassPathXmlApplicationContext(appContextClasspathResource);\r\n\t\tthis.jmsTemplate = (JmsTemplate) context.getBean(jmsTemplateBean);\r\n\t}", "public ChessclubJinListenerManager(JinChessclubConnection source){\r\n super(source);\r\n\r\n this.source = source;\r\n }", "@Override\n\tprotected void initDataSource() {\n\t}", "public void setSourceChanges(Map<Component, Class> sourceChanges)\n {\n this.sourceChanges = sourceChanges;\n }", "@Bean\n public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() {\n return new PropertySourcesPlaceholderConfigurer();\n }", "public void configure() {\n /*from(ServiceDefinitions.EP_SWITCHYARD + ServiceDefinitions.SVC_SEND_RESULT)\n // Bei Mail ist Body ein\n // org.apache.camel.component.exec.ExecResult, daher umwandeln\n // in String.\n .convertBodyTo(String.class)\n .log(\"Received message for 'OutgoingResultRoute' : ${body}\")\n .to(ServiceDefinitions.EP_SWITCHYARD + ServiceDefinitions.SVC_CALL_NAVISION);*/\n }", "public SmooksTransformModel setConfig(String config);", "public void setDataSourceBean(String dataSourceBean) {\n this.dataSourceBean = dataSourceBean;\n }", "EventChannelSource source();", "private void setupSource() {\n source = new GeoJsonSource( geojsonSourceId, featureCollection );\n map.addSource( source );\n }", "public void setDatasource(DataSource source) {\n datasource = source;\n }", "@Override\n public void initialize(ConfigurableApplicationContext applicationContext) {\n\n System.out.println(\"========ApplicationContextInitializer===================\");\n\n ConfigurableEnvironment environment = applicationContext.getEnvironment();\n\n\n MutablePropertySources propertySources = environment.getPropertySources();\n\n // 模拟远程拉配置信息\n Map<String, Object> config = ConfigServer.getRemoteConfig();\n\n MapPropertySource propertySource = new MapPropertySource(\"test-config\", config);\n propertySources.addFirst(propertySource);\n }", "public void setSource(java.lang.String param) {\r\n localSourceTracker = true;\r\n\r\n this.localSource = param;\r\n\r\n\r\n }", "public Builder setConfigSource(\n com.google.api.servicemanagement.v1.ConfigSource.Builder builderForValue) {\n if (configSourceBuilder_ == null) {\n configSource_ = builderForValue.build();\n onChanged();\n } else {\n configSourceBuilder_.setMessage(builderForValue.build());\n }\n\n return this;\n }", "public Builder setSource(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n source_ = value;\n onChanged();\n return this;\n }", "public Builder setSource(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n source_ = value;\n onChanged();\n return this;\n }", "public ObjectStoreSinkConnectorConfig(ConfigDef config, Map<String, String> parsedConfig) {\n super(config, parsedConfig);\n }", "@Override\n public void setDataSource(DataSource dataSource) {\n }", "@Override\n public void setDataSource(DataSource dataSource) {\n }" ]
[ "0.65112734", "0.6189805", "0.61803824", "0.6173806", "0.6147951", "0.6104612", "0.60652673", "0.60262066", "0.60164475", "0.5985588", "0.5985088", "0.59698313", "0.5947951", "0.5931065", "0.591817", "0.5903722", "0.58960295", "0.5868666", "0.58075505", "0.57929134", "0.57591784", "0.5741345", "0.57353306", "0.56514287", "0.5601557", "0.5590879", "0.5577064", "0.5564384", "0.55543953", "0.55235004", "0.55151016", "0.55070364", "0.55059844", "0.54893416", "0.54887676", "0.5481532", "0.54596645", "0.54190654", "0.5380607", "0.5380425", "0.53718674", "0.53633916", "0.53603864", "0.53578955", "0.53512806", "0.53134984", "0.530552", "0.52932197", "0.5262591", "0.5262591", "0.5256498", "0.5230493", "0.5221146", "0.52118415", "0.5189123", "0.5181689", "0.5181247", "0.5171981", "0.51447374", "0.5138741", "0.51353", "0.5119771", "0.50828695", "0.5079786", "0.5078784", "0.5077508", "0.50694495", "0.5068591", "0.5068007", "0.505955", "0.50549215", "0.5052971", "0.5045738", "0.5042432", "0.50419706", "0.503377", "0.50301695", "0.50220215", "0.50213844", "0.50178194", "0.5006379", "0.499685", "0.4988262", "0.49851924", "0.4957915", "0.49459925", "0.49369293", "0.49300337", "0.49227545", "0.49216336", "0.49205056", "0.49033093", "0.49005112", "0.48968592", "0.4896663", "0.48957726", "0.48957726", "0.48953044", "0.48930526", "0.48930526" ]
0.5649659
24
TODO: some form of indexing to speed up group operations would be desirable. However it would need to keep up to date with the underlying data structure. Questionable whether it should be part of serialisation... Maybe it should... transient Map groupData = new HashMap(); The answer I think is to map this directly from R into an in memory H2 database table (indexed on grouping structures).
public RDataframe() { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void DoGroupBy()\n\t{\n\n\t\tArrayList<Attribute> inAtts = new ArrayList<Attribute>();\n\t\tinAtts.add(new Attribute(\"Int\", \"o_orderkey\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"o_custkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderstatus\"));\n\t\tinAtts.add(new Attribute(\"Float\", \"o_totalprice\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderdate\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_orderpriority\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_clerk\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"o_shippriority\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"o_comment\"));\n\n\t\tArrayList<Attribute> outAtts = new ArrayList<Attribute>();\n\t\toutAtts.add(new Attribute(\"Str\", \"att1\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att2\"));\n\t\toutAtts.add(new Attribute(\"Float\", \"att3\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att4\"));\n\n\t\tArrayList<String> groupingAtts = new ArrayList<String>();\n\t\tgroupingAtts.add(\"o_orderdate\");\n\t\tgroupingAtts.add(\"o_orderstatus\");\n\n\t\tHashMap<String, AggFunc> myAggs = new HashMap<String, AggFunc>();\n\t\tmyAggs.put(\"att1\", new AggFunc(\"none\",\n\t\t\t\t\"Str(\\\"status: \\\") + o_orderstatus\"));\n\t\tmyAggs.put(\"att2\", new AggFunc(\"none\", \"Str(\\\"date: \\\") + o_orderdate\"));\n\t\tmyAggs.put(\"att3\", new AggFunc(\"avg\", \"o_totalprice * Int (100)\"));\n\t\tmyAggs.put(\"att4\", new AggFunc(\"sum\", \"Int (1)\"));\n\n\t\t// run the selection operation\n\t\ttry\n\t\t{\n\t\t\tnew Grouping(inAtts, outAtts, groupingAtts, myAggs, \"orders.tbl\", \"out.tbl\", \"g++\", \"cppDir/\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public Group getGroupData(String groupName);", "private void loadGroup(IMemento group)\n\t{\n\t\tRegistersGroupData groupData = new RegistersGroupData();\n\n\t\t// get group name\n\t\tString groupName = group.getString(FIELD_NAME);\n\t\tif (groupName == null)\n\t\t\treturn;\n\n\t\t// get group size\n\t\tIMemento mem = group.getChild(ELEMENT_TOTAL);\n\t\tif (mem == null)\n\t\t\treturn;\n\n\t\tInteger tempInt = mem.getInteger(FIELD_SIZE);\n\t\tif (tempInt == null)\n\t\t\treturn;\n\n\t\tgroupData.totalSize = tempInt.intValue();\n\n\t\t// check add total field\n\t\tgroupData.addTotalField = true;\n\t\tString tempStr = mem.getString(FIELD_ADD_TOTAL);\n\t\tif (tempStr != null && tempStr.equalsIgnoreCase(\"false\"))\n\t\t\tgroupData.addTotalField = false;\n\n\t\t// get sub-division\n\t\tIMemento[] mems = group.getChildren(ELEMENT_SUB);\n\t\tgroupData.indicies = new int[mems.length];\n\t\tgroupData.sizes = new int[mems.length];\n\t\tgroupData.names = new String[mems.length];\n\n\t\tfor (int ind=0; ind < mems.length; ind++)\n\t\t{\n\t\t\ttempInt = mems[ind].getInteger(FIELD_INDEX);\n\t\t\tif (tempInt == null)\n\t\t\t\treturn;\n\t\t\tgroupData.indicies[ind] = tempInt.intValue();\n\n\t\t\ttempInt = mems[ind].getInteger(FIELD_SIZE);\n\t\t\tif (tempInt == null)\n\t\t\t\treturn;\n\t\t\tgroupData.sizes[ind] = tempInt.intValue();\n\n\t\t\tgroupData.names[ind] = mems[ind].getString(FIELD_NAME);\n\t\t\tif (groupData.names[ind] == null)\n\t\t\t\treturn;\n\t\t}\n\n\t\t// add group data\n\t\tmapper.addGroup(groupName/*, groupData*/);\n\n\t\tmems = group.getChildren(ELEMENT_REGISTER);\n\t\tString[] register = new String[mems.length];\n\n\t\tfor (int ind=0; ind < mems.length; ind++)\n\t\t\tregister[ind] = mems[ind].getString(FIELD_NAME);\n\n\t\t// add registers\n\t\tmapper.addRegisters(groupName, register);\n\t}", "@Override\n public void groupBy(StructuredRecord record, Emitter<StructuredRecord> emitter) throws Exception {\n StructuredRecord.Builder builder = StructuredRecord.builder(getGroupKeySchema(record.getSchema()));\n for (String groupByField : conf.getGroupByFields()) {\n builder.set(groupByField, record.get(groupByField));\n }\n emitter.emit(builder.build());\n }", "private Grouping mapGrouping(String groupingPath) throws Exception {\n ObjectMapper objectMapper = new ObjectMapper();\n\n MvcResult result = mockMvc.perform(get(API_BASE + \"groupings/\" + groupingPath))\n .andExpect(status().isOk())\n .andReturn();\n\n return objectMapper.readValue(result.getResponse().getContentAsByteArray(), Grouping.class);\n }", "public Relation group(ArrayList<String> params, ArrayList<String> aggregates, ArrayList<String> groupBy){\n Relation table = new Relation();\n\n // Create columns for new table\n for(int i = 0; i < params.size(); i++){\n Col c = getColumnByName(params.get(i));\n\n String name = params.get(i);\n\n if(!aggregates.get(i).isEmpty()){\n name += \"-\" + aggregates.get(i);\n }\n\n table.insertColumn(new Col(name, c.getType(), c.getMaxLength(), c.getDecimalsAllowed(), false));\n }\n\n if(groupBy.size() == 1 && groupBy.get(0).charAt(0) == '('){\n\n Relation r = select(params, EMPTY_LIST, EMPTY_LIST);\n ArrayList<String> values = new ArrayList<>();\n\n for(int i = 0; i < params.size(); i++){\n\n if(aggregates.get(i).isEmpty()){\n values.add(r.getColumnByName(params.get(i)).getRec(0).getLastEntry().getData());\n }\n else{\n if(aggregates.get(i).equals(\"avg\")){\n values.add(Double.toString(r.average(params.get(i))));\n }\n else if(aggregates.get(i).equals(\"count\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Integer.toString(r.count(p, c, a)));\n }\n else if(aggregates.get(i).equals(\"sum\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Double.toString(r.sum(p, c, a)));\n }\n else if(aggregates.get(i).equals(\"min\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Double.toString(r.min(p, c, a)));\n }\n else if(aggregates.get(i).equals(\"max\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Double.toString(r.max(p, c, a)));\n\n }\n else{\n System.out.println(\"Relation.group: Unexpected scenerio occurred\");\n System.exit(2);\n }\n }\n\n }\n\n table.insert(values);\n values.clear();\n\n return table;\n }\n\n //Get distinct group values\n HashSet<String> distinct = new HashSet<>();\n HashMap<String, Relation> tables = new HashMap<>();\n Relation temp = new Relation();\n\n ArrayList<Col> columns = new ArrayList<>();\n for(String group : groupBy){\n columns.add(getColumnByName(group));\n temp.insertColumn(getColumnByName(group));\n }\n\n for(int i = 0; i < columns.get(0).size(); i++){\n ArrayList<Rec> rec = temp.getRecordsByRowIndex(i);\n String groups = \"\";\n\n for(Rec value : rec){\n groups += value.getLastEntry().getData() + \",\";\n }\n\n groups = groups.substring(0, groups.length()-1);\n\n distinct.add(groups);\n }\n\n /*Col col = getColumnByName(groupBy);\n for(Rec rec : col.getRecs()){\n distinct.add(rec.getLastEntry().getData());\n }*/\n\n for(String d : distinct) {\n\n ArrayList<String> p = new ArrayList<>();\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n String[] split = d.split(\",\");\n for(int i = 0; i < split.length; i++) {\n c.add(groupBy.get(i) + \" = \" + split[i]);\n }\n\n for(int i = 1; i < split.length; i++){\n a.add(\"AND\");\n }\n\n Relation r = this.select(p, c, a);\n tables.put(d, r);\n }\n\n for(String d : distinct){\n\n Relation r = tables.get(d);\n ArrayList<String> values = new ArrayList<>();\n\n for(int i = 0; i < params.size(); i++){\n\n if(aggregates.get(i).isEmpty()){\n values.add(r.getColumnByName(params.get(i)).getRec(0).getLastEntry().getData());\n }\n else{\n if(aggregates.get(i).equals(\"avg\")){\n values.add(Double.toString(r.average(params.get(i))));\n }\n else if(aggregates.get(i).equals(\"count\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n String[] split = d.split(\",\");\n for(int j = 0; j < split.length; j++) {\n c.add(groupBy.get(j) + \" = \" + split[j]);\n }\n\n for(int j = 1; j < split.length; j++){\n a.add(\"AND\");\n }\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Integer.toString(r.count(p, c, a)));\n }\n else if(aggregates.get(i).equals(\"sum\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n String[] split = d.split(\",\");\n for(int j = 0; j < split.length; j++) {\n c.add(groupBy.get(j) + \" = \" + split[j]);\n }\n\n for(int j = 1; j < split.length; j++){\n a.add(\"AND\");\n }\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Double.toString(r.sum(p, c, a)));\n }\n else if(aggregates.get(i).equals(\"min\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n String[] split = d.split(\",\");\n for(int j = 0; j < split.length; j++) {\n c.add(groupBy.get(j) + \" = \" + split[j]);\n }\n\n for(int j = 1; j < split.length; j++){\n a.add(\"AND\");\n }\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Double.toString(r.min(p, c, a)));\n }\n else if(aggregates.get(i).equals(\"max\")){\n ArrayList<String> c = new ArrayList<>();\n ArrayList<String> a = new ArrayList<>();\n\n String[] split = d.split(\",\");\n for(int j = 0; j < split.length; j++) {\n c.add(groupBy.get(j) + \" = \" + split[j]);\n }\n\n for(int j = 1; j < split.length; j++){\n a.add(\"AND\");\n }\n\n ArrayList<String> p = new ArrayList<>();\n p.add(params.get(i));\n\n values.add(Double.toString(r.max(p, c, a)));\n\n }\n else{\n System.out.println(\"Relation.group: Unexpected scenerio occurred\");\n System.exit(2);\n }\n }\n\n }\n\n table.insert(values);\n values.clear();\n\n }\n\n return table;\n\n }", "private List<Group> extractGroupsFromResult(ResultSet resultSet) throws SQLException {\n\t\tList<Group> result = new ArrayList<Group>();\n\t\t\n\t\tlookupService.init();\n\t\n\t\t// process the groups\n\t\t//\n\t\t\n\t\t// extract the main data about the organization\n\t\twhile (resultSet.next()) {\n\t\t\tGroup group = new Group();\n\t\t\tGroupType groupType = new GroupType();\n\t\t\tList<DocumentType> allowedDocTypes = new ArrayList<DocumentType>();\n\t\t\t\n\t\t\t// extract the data\n\t\t\tlong organizationId = resultSet.getLong(\"parent_org_id\");\n\t\t\tlong groupId = resultSet.getLong(\"group_id\");\n String name = resultSet.getString(\"name\");\n String description = resultSet.getString(\"description\");\n String groupTypeName = resultSet.getString(\"group_type\");\n String groupTypeColor = resultSet.getString(\"group_type_color\");\n long groupTypeId= resultSet.getLong(\"group_type_id\");\n int groupTypeOrderIndex = resultSet.getInt(\"group_type_order_index\");\n String allowedDocTypeIds = resultSet.getString(\"doc_type_ids\");\n \n // populate the allowed doc types for this user\n //\n if(allowedDocTypeIds != null && !allowedDocTypeIds.isEmpty()){\n \tString[] ids = allowedDocTypeIds.split(\",\");\n \ttry {\n\t\t\t\t\tList<DocumentType> allDocTypes = lookupService.getAllDocumentTypes();\n\t\t\t\t\tfor(int i=0; i< ids.length; i++){\n\t \t\tlong docTypeId = Long.parseLong(ids[i]);\n\t \t\tfor(int j=0; j< allDocTypes.size(); j++){\n\t\t \t\tif(allDocTypes.get(j).getId() == docTypeId){\n\t\t \t\t\tallowedDocTypes.add(allDocTypes.get(j));\n\t\t \t\t}\n\t \t\t}\n\t \t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n \n // populate the Group entity\n //\n \n // populate group type\n groupType.setId(groupTypeId);\n groupType.setName(groupTypeName);\n groupType.setHexColorCode(groupTypeColor);\n groupType.setOrderIndex(groupTypeOrderIndex);\n \n // set the group data\n group.setOrganizationId(organizationId);\n group.setId(groupId);\n group.setName(name);\n group.setDescription(description);\n group.setGroupType(groupType);\n group.setAllowedDocTypes(allowedDocTypes);\n\n // add the user to the list\n result.add(group);\n }\n\t\treturn result;\n\t}", "public Group(Hashtable group) {\n\t\tisReadOnly = false;\n\t\tisSystemGroup = false;\n\t\t\n\t\tif (null == group) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tgroupIDs = new long[1];\n\t\tgroupNames = new String[1];\n\t\tgroupNetworks = new String[1];\n\t\t\n\t\t\n\t\tif (group.containsKey(KEY_GROUP_ID)) {\n\t\t\ttry {\n\t\t\t\tgroupIDs[0] = ((Long) group.get(KEY_GROUP_ID)).longValue();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//#debug error\n\t\t\t\tSystem.out.println(\"Failed parsing group id\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (group.containsKey(KEY_GROUP_NAME)) {\n\t\t\ttry {\n\t\t\t\tgroupNames[0] = (String) group.get(KEY_GROUP_NAME);\n\t\t\t\t\n\t\t\t\t//#debug debug\n\t\t\t\tSystem.out.println(\"Added group \" + groupNames[0]);\n\t\t\t} catch (Exception e) {\n\t\t\t\t//#debug error\n\t\t\t\tSystem.out.println(\"Failed parsing group name\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (group.containsKey(KEY_READ_ONLY)) {\n\t\t\ttry {\n\t\t\t\tisReadOnly = \n\t\t\t\t\t((Boolean) group.get(KEY_READ_ONLY)).booleanValue();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//#debug info\n\t\t\t\tSystem.out.println(\"Failed parsing read only\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (group.containsKey(KEY_SYSTEM_GROUP)) {\n\t\t\ttry {\n\t\t\t\tisSystemGroup = \n\t\t\t\t\t((Boolean) group.get(KEY_SYSTEM_GROUP)).booleanValue();\n\t\t\t\t//#debug debug\n\t\t\t\tSystem.out.println(\"isSystemGroup: \" + isSystemGroup);\n\t\t\t} catch (Exception e) {\n\t\t\t\t//#debug error\n\t\t\t\tSystem.out.println(\"Failed parsing system group\");\n\t\t\t}\n\t\t}\n\n\t\tif (group.containsKey(KEY_NETWORK)) {\n\t\t\ttry {\n\t\t\t\tgroupNetworks[0] = (String) group.get(KEY_NETWORK);\n\t\t\t\t//#debug debug\n\t\t\t\tSystem.out.println(\"Added group with network \" + groupNetworks[0]);\n\t\t\t} catch (Exception e) {\n\t\t\t\t//#debug error\n\t\t\t\tSystem.out.println(\"Failed parsing group network\");\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t\n\t}", "Group getGroupById(String id);", "@Override\n public Group buildEntity(ResultSet resultSet) throws DAOExceptions {\n Group group = new Group();\n\n try{\n int id = resultSet.getInt(ID_COLUMN_LABEL);\n group.setId(id);\n\n int adminId = resultSet.getInt(ADMIN_ID_COLUMN_LABEL);\n group.setAdminId(adminId);\n\n String name = resultSet.getString(NAME__COLUMN_LABEL);\n group.setGroupName(name);\n\n Date dateCreate = resultSet.getDate(DATE_CREATED_COLUMN_LABEL);\n group.setDateCreated(dateCreate);\n\n String groupDescription = resultSet.getString(GROUP_DESCRIPTION_COLUMN_LABEL);\n group.setGroupDescription(groupDescription);\n }\n catch (SQLException exception){\n throw new DAOExceptions(exception.getMessage(), exception);\n }\n return group;\n }", "public Grouping getGrouping() {\n JsonObject groupingInfo = definition.getObject(GROUPING);\n try {\n return Serializer.<Grouping>deserialize(groupingInfo);\n }\n catch (SerializationException e) {\n return null;\n }\n }", "private void addGroupsToGroupCache(ModelGroupReader modelGroupReader,\n\t\t ResourceHandler resourceHandler)\n throws OfbizDataException {\n\t\tif(modelGroupReader == null || resourceHandler == null) {\n\t\t\tLOG.warn(String.format(\"Null timereport group reader or resource \" +\n\t\t\t\t\t \"handler in addGroupsToGroupCache() method.\" +\n\t\t\t\t\t \" Model reader: %s resource handler: %s\",\n\t\t\t\t\t modelGroupReader, resourceHandler));\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tMap<?, ?> groupCache = modelGroupReader.getGroupCache();\n Document document;\n\n\t\t\tsynchronized (ModelGroupReader.class) {\n\n\t\t\t\ttry {\n\t\t\t\t\tdocument = resourceHandler.getDocument();\n\t\t\t\t} catch (GenericConfigException e) {\n\t\t\t\t\tString msg = \"Error loading entity group timereport\";\n\t\t\t\t\tLOG.error(msg, e);\n\t\t\t\t\tthrow new OfbizDataException(msg, e);\n\t\t\t\t}\n\t\t\t\tif (document == null) {\n\t\t\t\t\tString msg = String.format(\"Could not get document for %s\",\n resourceHandler);\n\t\t\t\t\tLOG.error(msg);\n\t\t\t\t\tthrow new OfbizDataException(msg);\n\t\t\t\t}\n\n\t\t\t\tElement docElement = document.getDocumentElement();\n\n\t\t\t\tif (docElement == null) {\n String msg = \"NULL doc element.\";\n\t\t\t\t\tLOG.error(msg);\n\t\t\t\t\tthrow new OfbizDataException(msg);\n\t\t\t\t}\n\t\t\t\tdocElement.normalize();\n\t\t\t\tNode curChild = docElement.getFirstChild();\n\n\t\t\t\tif (curChild != null) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (curChild.getNodeType() == Node.ELEMENT_NODE &&\n\t\t\t\t\t\t\t\"entity-group\".equals(curChild.getNodeName())) {\n\t\t\t\t\t\t\tElement curEntity = (Element) curChild;\n\t\t\t\t\t\t\tString entityName =\n UtilXml.checkEmpty(curEntity.getAttribute(\"entity\"));\n\t\t\t\t\t\t\tString groupName =\n UtilXml.checkEmpty(curEntity.getAttribute(\"group\"));\n\n\t\t\t\t\t\t\tif(groupName == null ||\n\t\t\t\t\t\t\t entityName == null) {\n\t\t\t\t\t\t\t continue;\n }\n safelyMapAdd(groupCache, entityName, groupName);\n\t\t\t\t\t\t}\n\t\t\t\t\t} while ((curChild = curChild.getNextSibling()) != null);\n\t\t\t\t} else {\n\t\t\t\t\tLOG.warn(\"[addGroupsToGroupCache()] No child nodes found.\");\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tString msg = String.format(\"Got exception when adding groups \" +\n\t\t\t\t\t \"from resource handler: %s\", resourceHandler);\n\t\t\tLOG.error(msg, ex);\n\t\t\tthrow new OfbizDataException(msg, ex);\n\t\t}\n\t}", "public Wrapper getGroups() {\n Wrapper<List<HashMap<String, String>>> wrapper = new Wrapper();\n try {\n List<HashMap<String, String>> out = new ArrayList<>();\n List<ObjectId> groupIds = user.getGroups();\n\n if (groupIds.size() != 0) {\n\n for (ObjectId groupId : groupIds) {\n HashMap<String, String> group = new HashMap<>();\n String name = mongoOperations.findById(groupId, Group.class, \"users\").getName();\n\n group.put(\"name\", name);\n group.put(\"id\", groupId.toHexString());\n\n out.add(group);\n }\n }\n wrapper.setData(out);\n wrapper.setSucces(true);\n } catch (Exception e) {\n wrapper.setSucces(false);\n wrapper.setMsg(e.toString());\n }\n return wrapper;\n }", "private static Group getObjectFromCursor(ResultSet resultset) throws SQLException {\r\n\t\tGroup group = new Group();\r\n\t\tgroup.id = resultset.getInt(\"id\");\r\n\t\tgroup.name = resultset.getString(\"name\");\r\n group.keyword = resultset.getString(\"keyword\");\r\n group.level = resultset.getInt(\"level\");\r\n\t\treturn group;\r\n\t}", "public Input groupBy(Grouping grouping) {\n definition.putObject(GROUPING, Serializer.serialize(grouping));\n return this;\n }", "Object getGroupID(String groupName) throws Exception;", "@Override\r\n public Object getGroup(int groupPosition) {\n return mDataList.get(\"\" + groupPosition);\r\n }", "@GetMapping(\"/group\")\n\tResponseEntity<String> getAllGroup() {\n\t\tArrayList<Group> groupList = new ArrayList<Group>();\n\n\t\ttry {\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tConnection conn = DriverManager.getConnection(connectionString());\n\n\t\t\tString storedProc = \"select * from get_all_group()\";\n\t\t\tPreparedStatement pstmt = conn.prepareStatement(storedProc);\n\t\t\tResultSet rs = pstmt.executeQuery();\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tlong groupId = rs.getLong(\"id\");\n\t\t\t\tString groupName = rs.getString(\"name\");\n\t\t\t\tint subscriberCount = rs.getInt(\"subscriber_count\");\n\t\t\t\tString groupDesc = rs.getString(\"descr\");\n\t\t\t\tDate createdDate = rs.getDate(\"created_date\");\n\t\t\t\tDate updatedDate = rs.getDate(\"updated_date\");\n\t\t\t\tint categoryId = rs.getInt(\"category_id\");\n\n\t\t\t\tGroup group = new Group(groupId, groupName, subscriberCount, groupDesc, createdDate, updatedDate,\n\t\t\t\t\t\tcategoryId);\n\t\t\t\tgroupList.add(group);\n\t\t\t}\n\t\t} catch (SQLException err) {\n\t\t\tSystem.out.println(err.getMessage());\n\t\t\treturn ResponseEntity.status(HttpStatus.BAD_REQUEST).body(err.getMessage());\n\t\t} catch (ClassNotFoundException err) {\n\t\t\tSystem.out.println(err.getMessage());\n\t\t\treturn ResponseEntity.status(HttpStatus.BAD_REQUEST).body(err.getMessage());\n\t\t}\n\n\t\t// Convert group list to json\n\t\tString json = \"\";\n\n\t\ttry {\n\t\t\tObjectMapper mapper = new ObjectMapper();\n\t\t\tjson = mapper.writeValueAsString(groupList);\n\t\t} catch (Exception err) {\n\t\t\tSystem.out.println();\n\t\t\treturn ResponseEntity.status(HttpStatus.BAD_REQUEST).body(err.getMessage());\n\t\t}\n\n\t\treturn ResponseEntity.ok(json);\n\t}", "GroupByColumnFull createGroupByColumnFull();", "SeGroup selectByPrimaryKey(SeGroupKey key);", "Collection getUniqueKeysInGroup(Object groupID) throws Exception;", "public void mergeTupleIntoGroup(Tuple tup) {\n // some code goes here\n int bucket = -1;\n if (gbfield != NO_GROUPING) {\n if (gbfieldtype == Type.STRING_TYPE) {\n bucket = ((StringField)tup.getField(gbfield)).hashCode();\n hashstr.put(((StringField)tup.getField(gbfield)).hashCode(), ((StringField)tup.getField(gbfield)));\n\n }\n else {\n bucket = ((IntField)tup.getField(gbfield)).getValue();\n }\n }\n int aggval = 0;\n int gkey = 0;\n if (gbfieldtype == Type.STRING_TYPE) {\n gkey = ((StringField)tup.getField(gbfield)).hashCode();\n }\n else {\n gkey = ((IntField)tup.getField(gbfield)).getValue();\n }\n\n if (groups.containsKey(gkey)) {\n groups.put(bucket, groups.get(bucket) + 1);\n }\n else {\n groups.put(bucket, 1);\n }\n }", "public void mergeTupleIntoGroup(Tuple tup) {\n // some code goes here\n if(gbfield == NO_GROUPING) {\n // ArrayList<Integer> arr = (ArrayList<Integer>) group;\n // IntField f = (IntField) tup.getField(afield);\n ((ArrayList<Integer>) group).add(((IntField) tup.getField(afield)).getValue());\n } else {\n if(gbfieldtype == Type.INT_TYPE) {\n HashMap<Integer, ArrayList<Integer>> hmap = (HashMap<Integer, ArrayList<Integer>>) group;\n int key =((IntField) tup.getField(gbfield)).getValue();\n int value = ((IntField) tup.getField(afield)).getValue();\n boolean isContained = hmap.containsKey(key);\n if(isContained) {\n ArrayList<Integer> arr = hmap.get(key);\n arr.add(value);\n } else {\n ArrayList<Integer> arr = new ArrayList<>();\n arr.add(value);\n hmap.put(key, arr);\n }\n } else {\n assert (gbfieldtype == Type.STRING_TYPE);\n HashMap<String, ArrayList<Integer>> hmap = (HashMap<String, ArrayList<Integer>>) group;\n String key = ((StringField) tup.getField(gbfield)).getValue();\n int value = ((IntField) tup.getField(afield)).getValue();\n boolean isContained = hmap.containsKey(key);\n if(isContained) {\n ArrayList<Integer> arr = hmap.get(key);\n arr.add(value);\n } else {\n ArrayList<Integer> arr = new ArrayList<>();\n arr.add(value);\n hmap.put(key, arr);\n }\n }\n }\n }", "@Override\n\t\tpublic Object getGroup(int groupPosition) {\n\t\t\treturn data.get(groupPosition);\n\t\t}", "public Map getPaymentGroupMap();", "public Groups getGroupsEntity() {\n\t\tGroups groupsDefinition = new Groups();\n\n\t\tVector<String> search = new Vector<String>();\n\t\tsearch.add(groupsDefinition.getPrimaryKeyName() + getFields().getField(groupsDefinition.getPrimaryKeyName()));\n\n\t\treturn (Groups) Orm.getInstance().select(new Groups(), search).get(0);\n\t}", "public interface GroupingService {\n Grouping getById(long id) throws ResourceNotFoundException;\n\n void create(Grouping grouping) throws InvalidDataProvidedException;\n\n void delete(Grouping grouping) throws ResourceNotFoundException;\n\n void update(Grouping grouping) throws InvalidDataProvidedException;\n\n List<Grouping> getByUser(User user);\n}", "@Override\n public Void call(DBConnection c) throws SQLException {\n DBPreparedStatement groups = c.run(\"select lower(replace(ggd.group_id, ':', '-')) group_id, ggd.description, ggd.ready_for_sync_time\" +\n \" from \" + groupInfoTable + \" ggd \" +\n \" where ggd.ready_for_sync_time >= ?\");\n\n groups.param(time);\n\n for (ResultSet rs : groups.executeQuery()) {\n String groupName = rs.getString(\"group_id\");\n String description = rs.getString(\"description\");\n long lastModifiedTime = rs.getLong(\"ready_for_sync_time\");\n\n Group group = result.createOrGetGroup(new Group(groupName, description));\n group.setLastModifiedTime(lastModifiedTime);\n }\n\n // Populate any members for non-deleted groups\n DBPreparedStatement members = c.run(\"select lower(replace(ggu.group_id, ':', '-')) group_id, ggu.role, ggu.email\" +\n \" from \" + groupInfoTable + \" ggd \" +\n \" inner join \" + memberInfoTable + \" ggu \" +\n \" on ggd.group_id = ggu.group_id\" +\n \" where ggd.ready_for_sync_time >= ? AND ggd.deleted = 0\");\n\n members.param(time);\n\n for (ResultSet rs : members.executeQuery()) {\n String groupName = rs.getString(\"group_id\");\n String email = rs.getString(\"email\");\n String role = mapRole(rs.getString(\"role\"));\n\n if (result.hasGroup(groupName)) {\n Group group = result.get(groupName);\n group.addMembership(email, role);\n } else {\n // This can happen if a membership row is added after we\n // pull our initial group list, and if our database\n // doesn't give us repeatable reads. This should be\n // very rare.\n logger.warn(String.format(\"Got a row referencing group %s but that group wasn't in our set\",\n groupName));\n }\n }\n\n return null;\n }", "@Override\n\tpublic GroupSet getAllGroups() throws DataBackendException\n {\n GroupSet groupSet = new GroupSet();\n Connection con = null;\n\n try\n {\n \n con = Transaction.begin();\n\n List<Group> groups = doSelectAllGroups(con);\n\n for (Group group : groups)\n {\n // Add dependent objects if they exist\n ((TorqueAbstractSecurityEntity)group).retrieveAttachedObjects(con, getLazyLoading());\n\n groupSet.add(group);\n }\n\n Transaction.commit(con);\n con = null;\n }\n catch (TorqueException e)\n {\n throw new DataBackendException(\"Error retrieving group information\", e);\n }\n finally\n {\n if (con != null)\n {\n Transaction.safeRollback(con);\n }\n }\n\n return groupSet;\n }", "GroupBuckets buckets();", "Object getGroup(int groupPosition);", "private void newGroup()\n\t{\n\t\t// There is no need anymore to take care of the meta-data.\n\t\t// That is done once in DenormaliserMeta.getFields()\n\t\t//\n data.targetResult = new Object[meta.getDenormaliserTargetFields().length];\n \n for (int i=0;i<meta.getDenormaliserTargetFields().length;i++)\n {\n data.targetResult[i] = null;\n\n data.counters[i]=0L; // set to 0\n data.sum[i]=null;\n }\n\t}", "GroupQuery createQuery();", "public long getGroup()\r\n { return group; }", "private static List<Group> getCollectionFromResultSet(ResultSet resultset) throws SQLException {\r\n\t\t\r\n\t\tList<Group> collection = new LinkedList<Group>();\r\n\t\t\r\n\t\twhile (resultset.next()) { \r\n\t\t\t// Appending all the objects to the collection.\r\n\t\t\tGroup group = getObjectFromCursor(resultset);\r\n\t\t\tcollection.add(group);\r\n\t\t\tlog.trace(\"Loaded client group: \" + group.toString());\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn Collections.unmodifiableList(collection);\r\n\r\n\t}", "private Group getMibObjectGroup(String groupName) {\n for (DatacollectionGroup group : externalGroupsMap.values()) {\n for (Group g : group.getGroupCollection()) {\n if (g.getName().equals(groupName)) {\n return g;\n }\n }\n }\n return null;\n }", "private List<Group> extractGroupOrganizationsFromResult(ResultSet resultSet) throws SQLException {\n\t\tList<Group> result = new ArrayList<Group>();\n\t\t\n\t\t// process the extractions - there will only be one user\n\t\t//\n\t\twhile (resultSet.next()) {\n\t\t\t// extract the data\n\t\t\tlong id = resultSet.getLong(\"id\");\n String name = resultSet.getString(\"organization_name\");\n long organizationId = resultSet.getLong(\"org_id\");\n String description = resultSet.getString(\"organization_description\");\n \n long organizationTypeId = resultSet.getLong(\"group_data_type_id\");\n String organizationType = resultSet.getString(\"organization_type\");\n int organizationTypeOrderIndex = resultSet.getInt(\"order_index\");\n \n // populate the Group entity\n Group org = new Group();\n org.setId(id);\n org.setName(name);\n org.setDescription(description);\n org.setOrganizationId(organizationId);\n \n GroupType orgType = new GroupType();\n orgType.setId(organizationTypeId);\n orgType.setName(organizationType);\n orgType.setOrderIndex(organizationTypeOrderIndex);\n org.setGroupType(orgType);\n \n result.add(org);\n }\n\t\t\n\t\treturn result;\n\t}", "private static List<Element> buildGroups(SegmentLibrary segmentLibrary,\n\t\t\tMap<Integer, gov.nist.healthcare.hl7tools.service.util.mock.hl7.domain.Group> map) {\n\t\tList<Element> topLevelGroup = new ArrayList<Element>();\n\t\tMap<Integer, Element> gm = new HashMap<Integer, Element>();\n\t\t// create groups map\n\t\tlog.info(\"group count=\" + map.values().size());\n\t\tfor (gov.nist.healthcare.hl7tools.service.util.mock.hl7.domain.Group g : map.values()) {\n//\t\t\tlog.info(\"group name=\" + g.getName());\n\t\t\tElement e = new Element();\n\t\t\te.setName(g.getName());\n\t\t\te.setType(g.isChoice() ? ElementType.CHOICE : ElementType.GROUP);\n\t\t\tgm.put(g.getId(), e);\n\t\t\tif (g.getName().contains(\".ROOT\"))\n\t\t\t\ttopLevelGroup.add(e);\n\t\t\tif (e.getName() == null) {\n\t\t\t\tlog.info(\"here=\" + e.toString());\n\t\t\t}\n\t\t}\n\t\t// update groups children\n\t\tfor (gov.nist.healthcare.hl7tools.service.util.mock.hl7.domain.Group g : map.values()) {\n\t\t\tList<Element> children = new ArrayList<Element>();\n\t\t\tif (g.getChildren() != null) {\n\t\t\t\t// Some messages in old versions don't have children\n\t\t\t\t// log.info(\"o loop=\" + \" gid=\" + g.getId() + \" g.name=\" +\n\t\t\t\t// g.getName() + \" size=\" + g.getChildren().size());\n\t\t\t\tfor (gov.nist.healthcare.hl7tools.service.util.mock.hl7.domain.Element ee : g.getChildren()) {\n//\t\t\t\t\tlog.info(\"ee group id=\" + ee.getGroupId());\n\t\t\t\t\t// FIXME: Temporary hack to fix the position\n\t\t\t\t\tElement tmp = updateChildren(ee, map, gm, segmentLibrary);\n\t\t\t\t\tchildren.add(tmp);\n\t\t\t\t\ttmp.setPosition(children.size());\n\t\t\t\t}\n\t\t\t}\n\t\t\tgm.get(g.getId()).setChildren(children);\n\t\t}\n\t\treturn topLevelGroup;\n\t}", "protected void sequence_BY_GROUP_GroupBy(ISerializationContext context, GroupBy semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "GroupCell createGroupCell();", "public void setGroup(entity.Group value);", "public interface GroupDescription {\n /**\n * Types of the group supported by ONOS.\n */\n enum Type {\n /**\n * Load-balancing among different buckets in a group.\n */\n SELECT,\n /**\n * Single Bucket Group.\n */\n INDIRECT,\n /**\n * Multicast to all buckets in a group.\n */\n ALL,\n /**\n * Similar to {@link Type#ALL} but used for cloning of packets\n * independently of the egress decision (singleton treatment or other\n * group).\n */\n CLONE,\n /**\n * Uses the first live bucket in a group.\n */\n FAILOVER\n }\n\n /**\n * Returns type of a group object.\n *\n * @return GroupType group type\n */\n Type type();\n\n /**\n * Returns device identifier on which this group object is created.\n *\n * @return DeviceId device identifier\n */\n DeviceId deviceId();\n\n /**\n * Returns application identifier that has created this group object.\n *\n * @return ApplicationId application identifier\n */\n ApplicationId appId();\n\n /**\n * Returns application cookie associated with a group object.\n *\n * @return GroupKey application cookie\n */\n GroupKey appCookie();\n\n /**\n * Returns groupId passed in by caller.\n *\n * @return Integer group id passed in by caller. May be null if caller\n * passed in null to let groupService determine the group id.\n */\n Integer givenGroupId();\n\n /**\n * Returns group buckets of a group.\n *\n * @return GroupBuckets immutable list of group bucket\n */\n GroupBuckets buckets();\n}", "public void executeGroupByCriteria() {\n Session session = getSession();\n Transaction transaction = session.beginTransaction();\n\n // SELECT name, price\n ProjectionList projectionList = Projections.projectionList();\n projectionList.add(Projections.groupProperty(\"name\"));\n projectionList.add(Projections.property(\"price\"));\n\n // FROM Product p\n Criteria criteria = session.createCriteria(Product.class);\n\n // GROUP BY p.name\n criteria.setProjection(projectionList);\n\n displayObjectsList(criteria.list());\n transaction.commit();\n }", "public Group saveGroup(Group group);", "public ParticipationGroupData addParticipationGroupData(ParticipationGroupData group) \n { \n Connection con = null;\n PreparedStatement ps1 = null;\n PreparedStatement ps2 = null;\n Integer groupPk = null;\n \n try {\n \n con = DBUtil.getConnection();\n \n // insert into Participation_Cd_Group\n ps1 = con.prepareStatement(SQL_INSERT_PARTICIPATION_CD_GROUP);\n\n //set the values to insert\n ps1.setString(1, group.getName());\n DBUtil.setNullableVarchar(ps1, 2, group.getDescription());\n groupPk = DBUtil.insertAndGetIdentity(con, ps1);\n \n //if successful, set the pk\n group.setGroupPk(groupPk);\n \n // DEBUG\n if (logger.isDebugEnabled())\n logger.debug(\"Insert statement: [\" + SQL_INSERT_PARTICIPATION_CD_TYPE + \"] \");\n \n // insert the default Participation_Cd_Type for a new Group...\n ps2 = con.prepareStatement(SQL_INSERT_PARTICIPATION_CD_TYPE);\n\n ps2.setString(1, ParticipationTypeData.TYPE_GENERAL);\n ps2.setNull(2, Types.VARCHAR);\n ps2.setInt(3, groupPk.intValue());\n \n // insert into Participation_Cd_Type\n ps2.executeUpdate();\n \n } catch (SQLException e) {\n throw new EJBException(\"Error inserting participation group in MaintainParticipationGroupsBean.addParticipationGroupData()\", e);\n } finally {\n DBUtil.cleanup(null, ps1, null);\n DBUtil.cleanup(con, ps2, null);\n }\n \n //return the group data with new PK\n return group;\n }", "public static List<KirolakObject> listByGroup(Group group)\n\t{\n\t\tSession session = HibernateUtil.getSessionFactory().getCurrentSession();\n\t\tList<KirolakObject> items = session.createQuery(\"from Round r where r.compositeId.group = :group\").setParameter(\"group\", group).list();\n\t\tIterator<KirolakObject> iterator = items.iterator();\n\t\twhile(iterator.hasNext())\n\t\t{\n\t\t\tRound round = (Round)iterator.next();\t\t\t\t\n\t\t\tround.setMatches(MatchDAO.listByRound(round));\n\t\t}\n\t\treturn items;\n\t}", "String getGroupingCode();", "private void readGroups(List<Element> groupElements, Model model)\n throws ObjectExistsException {\n // Add the groups.\n for (int i = 0; i < groupElements.size(); i++) {\n Element curGroupElement = groupElements.get(i);\n Integer groupID;\n try {\n groupID = Integer.valueOf(curGroupElement.getAttributeValue(\"id\"));\n }\n catch (NumberFormatException e) {\n groupID = null;\n }\n Group curGroup = model.createGroup(groupID);\n TCSObjectReference<Group> groupRef = curGroup.getReference();\n String groupName = curGroupElement.getAttributeValue(\"name\");\n if (groupName == null || groupName.isEmpty()) {\n groupName = \"GroupName\" + i + \"Unknown\";\n }\n model.getObjectPool().renameObject(curGroup.getReference(), groupName);\n // Add members.\n List<Element> memberElements = curGroupElement.getChildren(\"member\");\n for (int j = 0; j < memberElements.size(); j++) {\n Element curMemberElement = memberElements.get(j);\n String memberName = curMemberElement.getAttributeValue(\"name\");\n if (memberName == null || memberName.isEmpty()) {\n memberName = \"MemberName\" + j + \"Unknown\";\n }\n TCSObject<?> curMember = model.getObjectPool().getObject(memberName);\n curGroup.addMember(curMember.getReference());\n }\n List<Element> properties = curGroupElement.getChildren(\"property\");\n for (int k = 0; k < properties.size(); k++) {\n Element curPropElement = properties.get(k);\n String curKey = curPropElement.getAttributeValue(\"name\");\n if (curKey == null || curKey.isEmpty()) {\n curKey = \"Key\" + k + \"Unknown\";\n }\n String curValue = curPropElement.getAttributeValue(\"value\");\n if (curValue == null || curValue.isEmpty()) {\n curValue = \"Value\" + k + \"Unknown\";\n }\n model.getObjectPool().setObjectProperty(groupRef, curKey, curValue);\n }\n }\n }", "@Override\n\tpublic long getGroupId() {\n\t\treturn _dataset.getGroupId();\n\t}", "@Schema(description = \"Specifies the grouping attribute to use when rolling several instances. Instances that share the same value for the provided attribute key are rolled together as a unit. Examples that make sense to use are '\\\\_\\\\_all\\\\_\\\\_' (roll all instances as a single unit), 'logical_zone_name' (roll instances by zone), '\\\\_\\\\_name\\\\_\\\\_' (roll one instance at a time, the default if not specified). Note that '\\\\_\\\\_all\\\\_\\\\_' is required when performing a major version upgrade\")\n public String getGroupBy() {\n return groupBy;\n }", "public boolean createGroup(String groupName) {\r\n \t\tboolean result = this.dataLayer.addGroup(groupName);\r\n \r\n \t\t// if succesfuly created on dataLayer, then add into GroupList\r\n \t\tif (result)\r\n \t\t\tthis.groupList.addGroup(groupName);\r\n \r\n \t\treturn result;\r\n \t}", "@Override\n\t\tpublic int getGroupCount() {\n\t\t\treturn data.size();\n\t\t}", "public Group getGroup(Long id);", "@Override\n\tpublic void getGroupAndCount(RpcController controller, ExpandAggregationRequest request,\n\t\t\tRpcCallback<ExpandAggregationResponse> done) {\n\t\tInternalScanner scanner = null;\n\t\ttry {\n\t\t\t// 通过protobuf传来的Scan,scan已经添加groupBy column和count lie\n\t\t\tScan scan = ProtobufUtil.toScan(request.getScan());\n\t\t\tscanner = environment.getRegion().getScanner(scan);\n\t\t\tList<ExpandCell> groupList = request.getGroupColumnsList();\n\t\t\tList<ExpandCell> countList = request.getCountColumnsList();\n\t\t\tboolean hashNext = false;\n\t\t\tList<Cell> results = new ArrayList<Cell>();\n\t\t\tArrayList<TempRow> rows = new ArrayList<TempRow>();\n\t\t\tdo {\n\t\t\t\thashNext = scanner.next(results);//id 4\n\t\t\t\tTempRow tempRow = new TempRow();\n\t\t\t\tfor (Cell cell : results) {\n\t\t\t\t\tString family = Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(),\n\t\t\t\t\t\t\tcell.getFamilyLength());\n\t\t\t\t\tString qualify = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(),\n\t\t\t\t\t\t\tcell.getQualifierLength());\n\t\t\t\t\tfor (ExpandCell gCell : groupList) {\n\t\t\t\t\t\tif (family.equals(gCell.getFamily()) && qualify.equals(gCell.getQualify())) {\n\t\t\t\t\t\t\tString value = Bytes.toString(cell.getValueArray(), cell.getValueOffset(),\n\t\t\t\t\t\t\t\t\tcell.getValueLength());\n\t\t\t\t\t\t\tSystem.out.println(value);\n\t\t\t\t\t\t\ttempRow.setKey(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (Cell cell : results) {\n\t\t\t\t\tString family = Bytes.toString(cell.getFamilyArray(), cell.getFamilyOffset(),\n\t\t\t\t\t\t\tcell.getFamilyLength());\n\t\t\t\t\tString qualify = Bytes.toString(cell.getQualifierArray(), cell.getQualifierOffset(),\n\t\t\t\t\t\t\tcell.getQualifierLength());\n\t\t\t\t\tfor (ExpandCell gCell : countList) {\n\t\t\t\t\t\tif (family.equals(gCell.getFamily()) && qualify.equals(gCell.getQualify())) {\n\t\t\t\t\t\t\tString value = Bytes.toString(cell.getValueArray(), cell.getValueOffset(),\n\t\t\t\t\t\t\t\t\tcell.getValueLength());\n\t\t\t\t\t\t\ttempRow.setValue(value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trows.add(tempRow);\n\t\t\t} while (hashNext);\n\t\t\tArrayList<ResultRow> ResultRows = analyzeRow(rows);\n\t\t\tArrayList<RpcResultRow> rpcResultRows = changeToRpcResultRow(ResultRows);\n\t\t\tWxsGroupByProto3.ExpandAggregationResponse.Builder responsBuilder = WxsGroupByProto3.ExpandAggregationResponse\n\t\t\t\t\t.newBuilder();\n\t\t\tfor (RpcResultRow rpcResultRow : rpcResultRows) {\n\t\t\t\tresponsBuilder.addResults(rpcResultRow);\n\t\t\t}\n\t\t\tdone.run(responsBuilder.build());\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tscanner.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "Map<Goods, Integer> getQuantityByGroup(GoodsGroup group) throws StoreKeeperWorkException;", "public int getIdGroup() {\n return idGroup;\n }", "public void allocateGroupId(){\n\t\trecords.add(new pair(this.groupname,currentId));\n\t\tthis.groupid = currentId;\n\t\tcurrentId++;\n\t\tConnection c = null;\n\t\tStatement stmt = null;\n\t\ttry{\n\t\t\tSystem.out.println(\"group setup\");\n\t\t\tSystem.out.println(this.groupid);\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tc = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/ifoundclassmate\");\n\t\t\tc.setAutoCommit(false);\n\t\t\tstmt = c.createStatement();\n\t\t\tString sql = \"INSERT INTO GROUPS (GROUPID,GROUPNAME,DESCRIPTION) \"+\n\t\t\t\t\t\"VALUES (\" + this.groupid + \", \" + \"'\" +this.groupname + \"'\"\n\t\t\t\t\t+\" , \" + \"'\" + this.description + \"' \" + \");\" ;\n\t\t\tstmt.executeUpdate(sql);\n\t\t\t\n\t\t\tstmt.close();\n\t\t\tc.commit();\n\t\t\tc.close();\n\t\t} catch (Exception e ){\n\t\t\tSystem.out.println(e.getClass().getName() + e.getMessage() );\n\t\t\treturn;\n\t\t}\n\t\treturn;\n\t}", "@Override\n\tpublic long getGroupId() {\n\t\treturn _dictData.getGroupId();\n\t}", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }", "public Group getGroup() { return cGroup; }" ]
[ "0.6458128", "0.62540287", "0.6105227", "0.5980742", "0.5974725", "0.5908066", "0.5879467", "0.5838754", "0.582644", "0.5753994", "0.57349145", "0.57268345", "0.5725706", "0.57124394", "0.56820536", "0.5640094", "0.56322986", "0.56267154", "0.5605441", "0.5598285", "0.5591515", "0.55738276", "0.55521697", "0.554814", "0.5532727", "0.5519284", "0.550788", "0.5502382", "0.54927224", "0.54911596", "0.5481214", "0.5408087", "0.53889996", "0.53865886", "0.5371042", "0.5353679", "0.5343457", "0.53401035", "0.53399533", "0.5338095", "0.53330165", "0.5325037", "0.5315683", "0.53156555", "0.5304036", "0.5302556", "0.5302126", "0.5300351", "0.5291726", "0.5275972", "0.5268268", "0.5260328", "0.525974", "0.52573395", "0.52571833", "0.52550364", "0.5249363", "0.5223871", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006", "0.5219006" ]
0.0
-1
Filter a dataframe and return a new dataframe containing entrie that pass predicate
public synchronized <Y extends RPrimitive> RDataframe filter(String name, Class<Y> type, Predicate<Y> predicate) { return filter(RFilter.from(name, type, predicate)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dataset FilterDataset(Dataset dataset)\n {\n Dataset result = new Dataset();\n for(HashMap<String, Object> row : dataset.dataset){\n if(this.eventExpression.MatchExpression(row))\n result.addRow(row);\n }\n return result;\n }", "public <Y extends RPrimitive> RDataframe filter(String name, Predicate<Y> predicate) {\n\t\treturn filter(RFilter.from(name, predicate));\n\t}", "public synchronized RDataframe filter(RFilter<?>... tests) {\n\t\t\n\t\t// return everything if no conditions\n\t\tBitSet filter = (new BitSet(this.nrow()));\n\t\tfilter.set(0, this.nrow(), true);\n\t\t\n\t\tfor (RFilter<?> test: tests) {\n\t\t\tBitSet and = this.get(test.name()).matches(test.predicate());\n\t\t\tfilter.and(and); \n\t\t}\n\t\tfinal BitSet filter2 = filter;\n\t\tRDataframe out = new RDataframe();\n\t\tthis.columnIterator().forEachRemaining(n -> {\n\t\t\tout.addCol(n.getKey(), n.getValue().subset(filter2));\n\t\t});\n\t\tout.groupBy(this.getGroups());\n\t\treturn out;\n\t}", "KTable<K, V> filter(Predicate<K, V> predicate);", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "KTable<K, V> filterOut(Predicate<K, V> predicate);", "public List<PedidoIndividual> filtrar(PedidoIndividual filtro);", "public Artikel [] filter(Predicate<Artikel> predicate) {\n Artikel[] filteredList = new Artikel[key];\n Artikel [] liste = new Artikel[key];\n int i = 0;\n for (Map.Entry<Integer, Artikel> integerArtikelEntry : lager.entrySet()) {\n liste[i] = integerArtikelEntry.getValue();\n i++;\n }\n int p = 0;\n for (i = 0; i < key; i++) {\n if (predicate.test(liste[i])) {\n filteredList[p] = liste [i];\n p++;\n }\n }\n liste = filteredList;\n return liste;\n }", "default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }", "public void filter(String query) {\n\n\tTableRowSorter sorter = new TableRowSorter(table_1.getModel());\n\tsorter.setRowFilter(RowFilter.regexFilter(query));\n\ttable_1.setRowSorter(sorter);\n\n }", "public QueryIterable<T> where(\n final Func2<Boolean, T> predicate\n ) {\n return Query.where(iterable, predicate);\n }", "public List<StudentRecord> filter(IFilter filter) {\n\t\tList<StudentRecord> temporaryList = new ArrayList<>();\n\n\t\tfor (StudentRecord studentRecord : studentRecords) {\n\t\t\tif (filter.accepts(studentRecord)) {\n\t\t\t\ttemporaryList.add(studentRecord);\n\t\t\t}\n\t\t}\n\t\treturn temporaryList;\n\t}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "@Query(\"from Flight as f where f.fare.fare <= 5000\")\n\tList<Flight> filterFlightsByPrice();", "public Filter condition();", "@Override\n public SqlDatabaseTable filter(SqlDatabaseTable table, List<FilterRule> filterRules) {\n if (filterRules.isEmpty()) return table;\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"SELECT * FROM \").append(table.getFullRef());\n sql.append(\" WHERE\");\n for (int i = 0; i < filterRules.size(); i++) {\n FilterRule filterRule = filterRules.get(i);\n if (filterRule instanceof ColumnFilterRule) {\n int lhs = ((ColumnFilterRule) filterRule).getRowId();\n int rhs = ((ColumnFilterRule) filterRule).getAnotherRowId();\n sql.append(\" `_\").append(lhs).append(\"`=`_\").append(rhs).append(\"`\");\n } else if (filterRule instanceof ConstantFilterRule) {\n int rowId = ((ConstantFilterRule) filterRule).getRowId();\n String value = ((ConstantFilterRule) filterRule).getValue();\n sql.append(\" `_\").append(rowId).append(\"`='\").append(value).append(\"'\");\n } else {\n throw new IllegalArgumentException();\n }\n if (i != filterRules.size() - 1) {\n sql.append(\" AND\");\n }\n }\n\n return new SqlDatabaseQueryTable(sql.toString(), table.getArity());\n }", "@Override\n public Filter getFilter() {\n\n return new Filter() {\n @Override\n protected FilterResults performFiltering(CharSequence charSequence) {\n\n String charString = charSequence.toString();\n\n if (charString.isEmpty()) {\n\n mDataset = mArrayList;\n } else {\n\n ArrayList<DataObject> filteredList = new ArrayList<>();\n\n for (DataObject data : mArrayList) {\n\n if (data.getid().toLowerCase().contains(charString.toLowerCase()) || data.getname().toLowerCase().contains(charString.toLowerCase())) {\n\n filteredList.add(data);\n }\n }\n\n mDataset = filteredList;\n }\n\n FilterResults filterResults = new FilterResults();\n filterResults.values = mDataset;\n return filterResults;\n }\n\n @Override\n protected void publishResults(CharSequence charSequence, FilterResults filterResults) {\n mDataset = (ArrayList<DataObject>) filterResults.values;\n notifyDataSetChanged();\n }\n };\n }", "private static Predicate<Person> predicate(CrudFilter filter) {\n return filter.getConstraints().entrySet().stream()\n .map(constraint -> (Predicate<Person>) person -> {\n try {\n Object value = valueOf(constraint.getKey(), person);\n return value != null && value.toString().toLowerCase()\n .contains(constraint.getValue().toLowerCase());\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n })\n .reduce(Predicate::and)\n .orElse(e -> true);\n }", "FeatureHolder filter(FeatureFilter filter);", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter1);", "ColumnInfoFilter getColumnInfoFilter();", "public abstract void filter();", "Stream<T> filter(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate);", "private Reviews filterByFunc(FilterFunction filterFunc)\n\t{\n\t\tArrayList<Review> filteredList = new ArrayList<Review>();\n\t\tfor(Review review : list)\n\t\t\tif(filterFunc.filter(review))\n\t\t\t\tfilteredList.add(review);\n\t\treturn new Reviews(filteredList);\n\t}", "ObservableList<Patient> getFilteredPatientList();", "List<Income> findAll(Predicate predicate);", "public FilterCriterion createFilter(String column, Object value, FilterCriterion.FilterType type)\n {\n return new FilterCriterion(column, value, type);\n }", "boolean filter(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);", "public static List<Student> filterExample(){\n\t\tList<Student> genderFilter = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(stu->stu.getGender().equals(\"female\")).collect(Collectors.toList());\n\t\treturn genderFilter;\n\t}", "private RowFilter<Object, Object> getFilter(List<String> selectedCheckBoxes, final String regex) {\n FilterMapKey key = new FilterMapKey(selectedCheckBoxes);\n if (tableFilterMap.containsKey(key)) {\n return tableFilterMap.get(key);\n }\n\n RowFilter<Object, Object> filter = new RowFilter<Object, Object>() {\n @Override\n public boolean include(RowFilter.Entry entry) {\n String severity = (String) entry.getValue(1);\n return severity.matches(regex);\n }\n };\n tableFilterMap.put(key, filter);\n return filter;\n }", "public abstract Filter<T> filter();", "public void filterTable(String filter) {\n\t\tif (fullBackup.isEmpty() || fullBackup == null) {\n\t\t\tfullBackup.addAll(list);\n\t\t}\n\n\t\t// always clear selected items\n\t\tselectionModel.clear();\n\t\tlist.clear();\n\n\t\tif (filter.equalsIgnoreCase(\"\")) {\n\t\t\tlist.addAll(fullBackup);\n\t\t} else {\n\t\t\tfor (Attribute attr : fullBackup){\n\t\t\t\t// store facility by filter\n\t\t\t\tif (attr.getFriendlyName().toLowerCase().startsWith(filter.toLowerCase())) {\n\t\t\t\t\tlist.add(attr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t\tloaderImage.loadingFinished();\n\n\t}", "public QbWhere where();", "public Boolean filter(Entry e) {\n\t\t//TODO you will need to implement this method\n\t\treturn false;\n\t}", "List<Condition> composeFilterConditions(F filter);", "public List<TableData> filter(List<TableData> incomeData) throws Exception{\r\n return filterByNote(filterByCategory(filterByDate(incomeData)));\r\n }", "private void searchTableDetailFilter() {\n DefaultTableModel table = (DefaultTableModel) tblLimitDetail.getModel();\n String search;\n search = txtSearchFilterDetail.getText();\n TableRowSorter<DefaultTableModel> tr;\n tr = new TableRowSorter<>(table);\n tblLimitDetail.setRowSorter(tr);\n tr.setRowFilter(RowFilter.regexFilter(\"(?i)\" + search, 1, 2, 3, 4));\n }", "boolean isFilterByExpression();", "public abstract AisPacketStream filter(Predicate<? super AisPacket> predicate);", "public Collection<T> filter(Query query) throws DataAccessException;", "public ItemAdapter<Item> withFilterPredicate(Predicate<Item> filterPredicate) {\n this.mFilterPredicate = filterPredicate;\n return this;\n }", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter2, Predicate<DeviceDetails> deviceFilter3);", "public static List<Apple> filter(List<Apple> apples, Predicate<Apple> predicate) {\n\n\t\tList<Apple> result = new ArrayList<>();\n\t\tfor (Apple apple : apples) {\n\t\t\tif (predicate.test(apple)) {\n\t\t\t\tresult.add(apple);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\n\t}", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter);", "ObservableList<Person> getFilteredPersonList();", "public Map<Integer, Boolean> getFilter(Geometry geom) throws SQLException {\n return retrieveExpected(createNativeFilterStatement(geom), BOOLEAN);\n }", "void setFilterByExpression(boolean filterByExpression);", "public QueryIterable<T> where(\n final Predicate<T> predicate\n ) {\n return Query.where(iterable, predicate);\n }", "public static ArrayList<Sample> filterSample(ArrayList<Sample> samples , Predicate<Sample> predicate)\n\t{\n\t\treturn (ArrayList<Sample>) samples.stream().filter(predicate).collect(Collectors.<Sample>toList());\n\t}", "public FieldPredicate withPredicate(Predicate<Field> predicate) {\n this.predicate = predicate;\n return this;\n }", "DataFilter getDataFilter(Connection con, SqlSearch search) throws FxSqlSearchException;", "boolean isPreFiltered();", "public boolean hqlFilterAttrDefsWhereClause(GrouperSession grouperSession, \r\n Subject subject, HqlQuery hqlQuery, StringBuilder hqlTables, StringBuilder hqlWhereClause, \r\n String attrDefColumn, Set<Privilege> privInSet);", "@Override\n public boolean isMatch(DataTable table, TableRow row) {\n return !subFilter.isMatch(table, row);\n }", "public static VcfIterator filter(final VcfIterator delegate,final Predicate<VariantContext> predicate)\n \t{\n class FilteringVcfIterator\n \textends AbstractIterator<VariantContext>\n \t\timplements VcfIterator\n \t\t{\n \tprivate final VcfIterator delegate;\n \tprivate final Predicate<VariantContext> predicate;\n \tFilteringVcfIterator(final VcfIterator delegate,final Predicate<VariantContext> predicate) {\n \t\t\tthis.delegate = delegate;\n \t\t\tthis.predicate=predicate;\n \t\t\t}\n \t\t@Override\n \t\tpublic AbstractVCFCodec getCodec() { return this.delegate.getCodec();}\n \t\t@Override\n \t\tpublic VCFHeader getHeader() { return this.delegate.getHeader();}\n \t\t@Override\n \t\tpublic void close() throws IOException {this.delegate.close();}\n \t\t@Override\n \t\tprotected VariantContext advance() {\n \t\t\twhile(this.delegate.hasNext())\n \t\t\t\t{\n \t\t\t\tfinal VariantContext ctx=this.delegate.next();\n \t\t\t\tif(this.predicate.test(ctx)) return ctx;;\n \t\t\t\t}\n \t\t\treturn null;\n \t\t\t}\n \t\t}\n \treturn new FilteringVcfIterator(delegate,predicate);\n \t}", "DataFrame<R,C> mapToBooleans(ToBooleanFunction<DataFrameValue<R,C>> mapper);", "public RecordBuffer prepareRecordBuffer(Column[] columns, FilterPredicate predicate) {\n return prepareRecordBuffer(columns, predicate, null);\n }", "public List<Object> queryByWhere(String col_name, String dto, List<List<Triple>> filter, List<String> keys) {\n\t\tList<Object> res = new ArrayList<Object>();\n\t\tDBCollection dbc = db.getCollection(col_name);\n\t\t// filter\n\t\tBasicDBObject all_ref = new BasicDBObject();\n\t\tDBObject _keys = new BasicDBObject();\n\t\t\n\t\tif(keys != null)\n\t\t\tfor(String key : keys) \n\t\t\t\t_keys.put(key, true);\n\t\t\n\t\tBasicDBList list = new BasicDBList();\n\t\tfor(List<Triple> and : filter) {\n\t\t\tBasicDBObject ref = new BasicDBObject();\n\t\t\tfor(Triple tri : and) {\n\t\t\t\tif(!ref.containsField(tri.key_name)) {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) \n\t\t\t\t\t\tref.put(tri.key_name, tri.value);\n\t\t\t\t\t\n\t\t\t\t\telse \n\t\t\t\t\t\tref.put(tri.key_name, new BasicDBObject(tri.condition, tri.value));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) {\n\t\t\t\t\t\t// TODO It is impossible\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tBasicDBObject bo = (BasicDBObject)ref.get(tri.key_name);\n\t\t\t\t\t\tbo.append(tri.condition, tri.value);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // end an \"and\" query\n\t\t\tlist.add(ref);\n\t\t}\n\t\t\n\t\tall_ref.put(\"$or\", list);\n\t\t\n\t\ttry {\n\t DBCursor cur = dbc.find(all_ref, _keys);\n\t \twhile (cur.hasNext()) {\n\t \t\tDBObject doc = cur.next();\n\t \t\ttry {\n\t \t\t\tres.add(Util.deserialize(doc, dto));\n\t \t\t} catch(InvocationTargetException ite) {\n\t \t\t\tite.printStackTrace();\n\t \t\t} \t\t\n\t \t\t//System.out.println(doc);\n\t }\n\n\t\t} catch(ClassNotFoundException cnfe) {\n \tcnfe.printStackTrace();\n } catch(InstantiationException ie) {\n \tie.printStackTrace();\n } catch(IllegalAccessException iae) {\n \tiae.printStackTrace();\n }\n\n \treturn res;\n\t}", "public ColumnBasedTableFilter(RowObjectTableModel<R> model) {\n\t\tthis.model = model;\n\t\tthis.name = null;\n\t}", "public List<Element> filter(Predicate<Element> p)\n\t{\n\t\treturn recursive_filter(new ArrayList<Element>(), p, group);\n\t}", "public void filtro() {\n int columnaABuscar = 0;\n \n \n if (comboFiltro.getSelectedItem() == \"nombre\") {\n columnaABuscar = 0;\n }\n if (comboFiltro.getSelectedItem().toString() == \"Apellido\") {\n columnaABuscar = 1;\n }\n \n trsFiltro.setRowFilter(RowFilter.regexFilter(txtfiltro.getText(), columnaABuscar));\n }", "private boolean predicateCheck(Game game) {\n boolean showOnTextFilter;\n if (txtFilter.getText().isEmpty()) {\n showOnTextFilter = true;\n } else {\n showOnTextFilter = game.getName().toLowerCase().contains(txtFilter.getText().toLowerCase());\n }\n\n boolean showOnCheckBoxFilter;\n if (!cbFilterNonAchievement.isSelected()) {\n showOnCheckBoxFilter = true;\n } else {\n showOnCheckBoxFilter = game.getHasStats();\n }\n\n return showOnTextFilter && showOnCheckBoxFilter;\n }", "protected abstract NativeSQLStatement createNativeFilterStatement(Geometry geom);", "Try<T> filter(Predicate<? super T> p);", "PolynomialNode filter(Predicate test);", "private void changeTableBookOnSearch(){\n FilteredList<TeacherBookIssue> filteredData = new FilteredList<>(teacherBooksData,p -> true);\r\n \r\n //set the filter predicate whenever the filter changes\r\n teacher_searchTeacherID.textProperty().addListener((observable,oldValue,newValue)->{\r\n \r\n filteredData.setPredicate(TeacherBookIssue -> {\r\n \r\n //if filter text is empty, display all product\r\n if (newValue == null || newValue.isEmpty()) {\r\n return true;\r\n }\r\n \r\n //compare product id and product name of every product with the filter text\r\n String lowerCaseFilter =newValue.toLowerCase();\r\n \r\n if (TeacherBookIssue.getTeacherID().toLowerCase().contains(lowerCaseFilter)) {\r\n return true; // Filter matches product Id\r\n } \r\n \r\n return false; // Do not match \r\n });\r\n \r\n });\r\n \r\n //wrap the filteredList in a sortedList\r\n SortedList<TeacherBookIssue> sortedData = new SortedList<>(filteredData);\r\n \r\n //bind the sortedData to the Tableview\r\n sortedData.comparatorProperty().bind(teachserIssuedTable.comparatorProperty());\r\n \r\n //add sorted and filtered data to the table\r\n teachserIssuedTable.setItems(sortedData); \r\n }", "ObservableList<Appointment> getFilteredAppointmentList();", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getChannelRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new ChannelDao(uriInfo,header).getChannelByFilter();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getChannelRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public boolean hqlFilterAttributeDefsWithPrivWhereClause(GrouperSession grouperSession, \r\n Subject subject, HqlQuery hqlQuery, StringBuilder hql, \r\n String attributeDefColumn, Privilege privilege, boolean considerAllSubject);", "private List<Thing> filter(List<Thing> source, List<WeatherType> weatherTypes, List<Gender> genders) {\n List<Thing> filtered = new ArrayList<>();\n for (Thing thing : source) {\n if (hasAnyWeatherType(thing, weatherTypes) && belongsTo(thing, genders)) {\n filtered.add(thing);\n }\n }\n return filtered;\n }", "boolean doFilter() { return false; }", "@FXML\n public void filterIngredients(){\n String searchText = searchIngredient.getText();\n List<Ingredient> filteredList = ingredientsFromDatabase.stream().filter(new Predicate<Ingredient>() {\n @Override\n public boolean test(Ingredient ingredient) {\n //inclusive of the upper cases makes it case insensitive\n if (ingredient.getName().toUpperCase().contains(searchText.toUpperCase())){\n return true;\n } else {\n return false;\n }\n }\n }).collect(Collectors.toList());\n filterObservableList = FXCollections.observableList(filteredList);\n ingredientsList.setItems(filterObservableList);\n }", "BPredicate createBPredicate();", "private List<moneda> filter(List<moneda> p1, String query)\n {\n query = query.toLowerCase();\n final List<moneda> filteredModeList = new ArrayList<>();\n for (moneda model:p1)\n {\n final String text = model.getNombre().toLowerCase();\n if(text.startsWith(query))\n {\n filteredModeList.add(model);\n }\n }\n return filteredModeList;\n }", "public SubsetFilter createFilter(Dimension dimension);", "FeatureHolder filter(FeatureFilter fc, boolean recurse);", "public HistoryCollection slice(HistoryCollection hc, Predicate p) {\n\t\tHistoryCollection result = options.newHistoryCollection();\n\t\tfor (History h : hc.getHistories()) {\n\t\t\tif (p.passes(h)) result.addHistory(h);\n\t\t}\n\t\treturn result;\n\t}", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseByFilter();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getWarehouseRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public static List<List<String>> filterRecords(List<List<String>> rows, Query query, List<String> header) {\r\n\r\n\t\tlogger.debug(\"filterRecords\");\r\n\r\n\t\tif (query.getRestrictions() != null) {\r\n\r\n\t\t\trows = evaluateRestrictions(rows, query);\r\n\t\t}\r\n\r\n\t\treturn rows;\r\n\t}", "public void filterMapExample() {\n List<String> result = createPeople()\n .stream()\n .filter(predicate)\n .map(Person::getName)\n .map(String::toUpperCase)\n .collect(Collectors.toUnmodifiableList());\n print.accept(result);\n }", "public Person[] search(Predicate<Person> predicate) {\n\t\tPerson[] tempArr = new Person[nElems];\n\t\tint count = 0;\n\t\tfor(int i = 0; i < nElems; i++) {\n\t\t\tif(predicate.test(arr[i])) {\n\t\t\t\ttempArr[count++] = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Arrays.copyOf(tempArr, count);\n\t}", "@Test void testInterpretProjectFilterValues() {\n final String sql = \"select y, x\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\\n\"\n + \"where x > 1\";\n sql(sql).returnsRows(\"[b, 2]\", \"[c, 3]\");\n }", "private void btnFiltrareActionPerformed(java.awt.event.ActionEvent evt) { \n List<Contact> lista = (List<Contact>) listaContacte.stream().filter(Agenda.predicate).sorted(Agenda.map.get(Agenda.criteriu)).collect(Collectors.toList());\n model.clear();\n lista.forEach((o) -> {\n model.addElement(o);\n });\n }", "@Override\n public void actionPerformed(ActionEvent e) //\n {\n if(!flag)\n rs.setRowFilter(RowFilter.regexFilter(FilterText.getText(), 0, selectedColumn.getModelIndex()));\n }", "public ArrayList<Stock> filter(Stock low, Stock high){\n ArrayList<Stock> result = new ArrayList<Stock>();\n ArrayList<Stock> all = this.ShowAll();\n\n//\t\tSystem.out.println(\"in filter\");\n\n for (Stock current : all) {\n StockFilter filter = new StockFilter(low, high, current);\n//\t\t\tSystem.out.println(low.getHigh()+\" \"+high.getHigh());\n//\t\t\tSystem.out.println(current.getHigh());\n\n if (filter.filt())\n result.add(current);\n }\n return result;\n }", "@Override\n protected SerializablePredicate<T> getFilter(Query<T, Void> query) {\n return Optional.ofNullable(inMemoryDataProvider.getFilter())\n .orElse(item -> true);\n }", "public void interactiveTestColumnControlAndFilters() {\n final JXTable table = new JXTable(new AncientSwingTeam());\n table.setColumnControlVisible(true);\n // table.setFilters(createPipeline());\n Action toggleFilter = new AbstractAction(\"Toggle Filters\") {\n boolean hasFilters;\n public void actionPerformed(ActionEvent e) {\n if (hasFilters) {\n table.setFilters(null);\n } else {\n table.setFilters(createPipeline());\n // FilterPipeline pipeline = new FilterPipeline(new Filter[] {});\n // table.setFilters(pipeline);\n }\n hasFilters = !hasFilters;\n \n }\n \n };\n toggleFilter.putValue(Action.SHORT_DESCRIPTION, \"filtering first column - problem if invisible \");\n JXFrame frame = wrapWithScrollingInFrame(table, \"JXTable ColumnControl and Filters\");\n addAction(frame, toggleFilter);\n frame.setVisible(true);\n }", "public Artikel[] filterAll (Predicate<Artikel> ... predicates){\n Artikel [] temp = new Artikel[key];\n for (Predicate<Artikel> predicate : predicates) {\n temp = filter(predicate);\n }\n return temp;\n }", "DbQuery setEqualsFilter(boolean value) {\n filter = Filter.EQUALS;\n filterType = FilterType.BOOLEAN;\n this.equals = value;\n return this;\n }", "public Results cloneResults(boolean matchesFilterOnly) {\r\n Results clone = new Results(this);\r\n for (int irow = 0; irow < this.getActualRowCount(); irow++) {\r\n ResultRow row = this.getRow(irow);\r\n if (matchesFilterOnly) {\r\n Boolean match = (Boolean) row.getRowAnnotation(AnomalySearchConstants.ROWANNOTATIONKEY_MATCHED_SEARCH);\r\n if (match != null && match) {\r\n clone.addRow(row);\r\n }\r\n } else {\r\n clone.addRow(row);\r\n }\r\n }\r\n return clone;\r\n }", "GeneralPredicate createGeneralPredicate();", "protected abstract Instances filterData(PipelineData data) throws Exception;", "private static Filter newFilter()\r\n {\r\n Filter filter = new Filter(\"filter1\", new Source(\"display1\", \"name1\", \"server\", \"key1\"));\r\n filter.getOtherSources().add(filter.getSource());\r\n Group group = new Group();\r\n group.addFilterCriteria(new Criteria(\"field1\", Conditional.EQ, \"123\"));\r\n Group group2 = new Group();\r\n group2.addFilterCriteria(new Criteria(\"field1\", Conditional.EQ, \"124\"));\r\n group.addFilterGroup(group2);\r\n filter.setFilterGroup(group);\r\n return filter;\r\n }", "@VTID(9)\n void treeFilter(\n IUIAutomationCondition filter);", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getEquipserviceRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new EquipserviceDao(uriInfo,header).getEquipserviceByFilter();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getEquipserviceRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public<T> List<T> takeWhile(final Collection<T> collection, final Filter<T> filter ){\t\t\n\t\tList<T> result = create.createLinkedList();\n\t\tfor(T t:query.getOrEmpty(collection)){\t\t\t\n\t\t\tif(!filter.applicable(t)){\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tresult.add(t);\n\t\t}\n\t\treturn result;\n\t}", "public interface IFilter {\n\t\n\t/**\n\t * Returns true if student record satisfies\n\t * condition\n\t * @param record - student record\n\t * @return {@code true} if student record satisfies\n\t *\t\t\t condition\n\t */\n\tpublic boolean accepts(StudentRecord record);\n}", "public abstract Query<T> buildFilter(Query<T> builder, T exampleObj);", "public void testKeepSelectionOnFilterChange() {\n JXTable table = new JXTable(ascendingModel);\n int selectedRow = 0;\n table.setRowSelectionInterval(selectedRow, selectedRow);\n // sanity assert\n assertEquals(selectedRow, table.getSelectedRow());\n PatternFilter filter = new PatternFilter(\".*\", 0, 0);\n table.setFilters(new FilterPipeline(new Filter[] {filter}));\n assertEquals(ascendingModel.getRowCount(), table.getRowCount());\n assertEquals(\"table must keep selection after setting filter\", selectedRow, table.getSelectedRow());\n }", "public static void filter() {\n\t\t\n\t\tResult.filter(toggleGroup.getSelectedToggle().getUserData(), ((ComboBox)hbox3.getChildren().get(0)).getValue());\n\t\t\n\t}" ]
[ "0.6455435", "0.63141686", "0.5960276", "0.59112775", "0.5801308", "0.5659218", "0.52679473", "0.5250563", "0.5191359", "0.51336974", "0.5130687", "0.51054054", "0.5069243", "0.5066091", "0.5053062", "0.49972448", "0.499104", "0.49771434", "0.4976466", "0.4967604", "0.4966695", "0.49051782", "0.48802903", "0.48712087", "0.48688382", "0.4851576", "0.48499173", "0.48409602", "0.48333845", "0.48256046", "0.48234427", "0.48002693", "0.4797602", "0.478242", "0.4779687", "0.47536233", "0.47534955", "0.474168", "0.47260672", "0.47140983", "0.47093856", "0.47052014", "0.46912307", "0.4691202", "0.46694383", "0.46641037", "0.46498674", "0.46489453", "0.46417528", "0.45926926", "0.45652667", "0.4557094", "0.4538345", "0.4532827", "0.45313016", "0.45203835", "0.45146698", "0.45129943", "0.45089638", "0.45073673", "0.45059267", "0.44946703", "0.44891006", "0.44832972", "0.44832402", "0.44658977", "0.44644964", "0.4457727", "0.44471508", "0.444673", "0.4441074", "0.44346657", "0.44342488", "0.4428265", "0.44258973", "0.4424601", "0.4422024", "0.44177064", "0.44147265", "0.43990937", "0.4395664", "0.4395639", "0.43911552", "0.43905616", "0.43898174", "0.43873438", "0.43855405", "0.43835098", "0.4382096", "0.43806663", "0.4361176", "0.43607572", "0.43572882", "0.4354738", "0.43512088", "0.43460217", "0.43381026", "0.4328058", "0.4324886", "0.43217066" ]
0.6091573
2
Filter a dataframe and return a new dataframe containing entries that pass predicate
public <Y extends RPrimitive> RDataframe filter(String name, Predicate<Y> predicate) { return filter(RFilter.from(name, predicate)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dataset FilterDataset(Dataset dataset)\n {\n Dataset result = new Dataset();\n for(HashMap<String, Object> row : dataset.dataset){\n if(this.eventExpression.MatchExpression(row))\n result.addRow(row);\n }\n return result;\n }", "KTable<K, V> filter(Predicate<K, V> predicate);", "public synchronized <Y extends RPrimitive> RDataframe filter(String name, Class<Y> type, Predicate<Y> predicate) {\n\t\treturn filter(RFilter.from(name, type, predicate));\n\t}", "public synchronized RDataframe filter(RFilter<?>... tests) {\n\t\t\n\t\t// return everything if no conditions\n\t\tBitSet filter = (new BitSet(this.nrow()));\n\t\tfilter.set(0, this.nrow(), true);\n\t\t\n\t\tfor (RFilter<?> test: tests) {\n\t\t\tBitSet and = this.get(test.name()).matches(test.predicate());\n\t\t\tfilter.and(and); \n\t\t}\n\t\tfinal BitSet filter2 = filter;\n\t\tRDataframe out = new RDataframe();\n\t\tthis.columnIterator().forEachRemaining(n -> {\n\t\t\tout.addCol(n.getKey(), n.getValue().subset(filter2));\n\t\t});\n\t\tout.groupBy(this.getGroups());\n\t\treturn out;\n\t}", "KTable<K, V> filterOut(Predicate<K, V> predicate);", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }", "public QueryIterable<T> where(\n final Func2<Boolean, T> predicate\n ) {\n return Query.where(iterable, predicate);\n }", "public Artikel [] filter(Predicate<Artikel> predicate) {\n Artikel[] filteredList = new Artikel[key];\n Artikel [] liste = new Artikel[key];\n int i = 0;\n for (Map.Entry<Integer, Artikel> integerArtikelEntry : lager.entrySet()) {\n liste[i] = integerArtikelEntry.getValue();\n i++;\n }\n int p = 0;\n for (i = 0; i < key; i++) {\n if (predicate.test(liste[i])) {\n filteredList[p] = liste [i];\n p++;\n }\n }\n liste = filteredList;\n return liste;\n }", "public void filter(String query) {\n\n\tTableRowSorter sorter = new TableRowSorter(table_1.getModel());\n\tsorter.setRowFilter(RowFilter.regexFilter(query));\n\ttable_1.setRowSorter(sorter);\n\n }", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "public List<StudentRecord> filter(IFilter filter) {\n\t\tList<StudentRecord> temporaryList = new ArrayList<>();\n\n\t\tfor (StudentRecord studentRecord : studentRecords) {\n\t\t\tif (filter.accepts(studentRecord)) {\n\t\t\t\ttemporaryList.add(studentRecord);\n\t\t\t}\n\t\t}\n\t\treturn temporaryList;\n\t}", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter1);", "Stream<T> filter(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate);", "private RowFilter<Object, Object> getFilter(List<String> selectedCheckBoxes, final String regex) {\n FilterMapKey key = new FilterMapKey(selectedCheckBoxes);\n if (tableFilterMap.containsKey(key)) {\n return tableFilterMap.get(key);\n }\n\n RowFilter<Object, Object> filter = new RowFilter<Object, Object>() {\n @Override\n public boolean include(RowFilter.Entry entry) {\n String severity = (String) entry.getValue(1);\n return severity.matches(regex);\n }\n };\n tableFilterMap.put(key, filter);\n return filter;\n }", "ColumnInfoFilter getColumnInfoFilter();", "public List<PedidoIndividual> filtrar(PedidoIndividual filtro);", "@Query(\"from Flight as f where f.fare.fare <= 5000\")\n\tList<Flight> filterFlightsByPrice();", "ObservableList<Patient> getFilteredPatientList();", "public ItemAdapter<Item> withFilterPredicate(Predicate<Item> filterPredicate) {\n this.mFilterPredicate = filterPredicate;\n return this;\n }", "@Override\n public SqlDatabaseTable filter(SqlDatabaseTable table, List<FilterRule> filterRules) {\n if (filterRules.isEmpty()) return table;\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"SELECT * FROM \").append(table.getFullRef());\n sql.append(\" WHERE\");\n for (int i = 0; i < filterRules.size(); i++) {\n FilterRule filterRule = filterRules.get(i);\n if (filterRule instanceof ColumnFilterRule) {\n int lhs = ((ColumnFilterRule) filterRule).getRowId();\n int rhs = ((ColumnFilterRule) filterRule).getAnotherRowId();\n sql.append(\" `_\").append(lhs).append(\"`=`_\").append(rhs).append(\"`\");\n } else if (filterRule instanceof ConstantFilterRule) {\n int rowId = ((ConstantFilterRule) filterRule).getRowId();\n String value = ((ConstantFilterRule) filterRule).getValue();\n sql.append(\" `_\").append(rowId).append(\"`='\").append(value).append(\"'\");\n } else {\n throw new IllegalArgumentException();\n }\n if (i != filterRules.size() - 1) {\n sql.append(\" AND\");\n }\n }\n\n return new SqlDatabaseQueryTable(sql.toString(), table.getArity());\n }", "public static ArrayList<Sample> filterSample(ArrayList<Sample> samples , Predicate<Sample> predicate)\n\t{\n\t\treturn (ArrayList<Sample>) samples.stream().filter(predicate).collect(Collectors.<Sample>toList());\n\t}", "public static List<Apple> filter(List<Apple> apples, Predicate<Apple> predicate) {\n\n\t\tList<Apple> result = new ArrayList<>();\n\t\tfor (Apple apple : apples) {\n\t\t\tif (predicate.test(apple)) {\n\t\t\t\tresult.add(apple);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\n\t}", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter);", "private Reviews filterByFunc(FilterFunction filterFunc)\n\t{\n\t\tArrayList<Review> filteredList = new ArrayList<Review>();\n\t\tfor(Review review : list)\n\t\t\tif(filterFunc.filter(review))\n\t\t\t\tfilteredList.add(review);\n\t\treturn new Reviews(filteredList);\n\t}", "@Override\n public Filter getFilter() {\n\n return new Filter() {\n @Override\n protected FilterResults performFiltering(CharSequence charSequence) {\n\n String charString = charSequence.toString();\n\n if (charString.isEmpty()) {\n\n mDataset = mArrayList;\n } else {\n\n ArrayList<DataObject> filteredList = new ArrayList<>();\n\n for (DataObject data : mArrayList) {\n\n if (data.getid().toLowerCase().contains(charString.toLowerCase()) || data.getname().toLowerCase().contains(charString.toLowerCase())) {\n\n filteredList.add(data);\n }\n }\n\n mDataset = filteredList;\n }\n\n FilterResults filterResults = new FilterResults();\n filterResults.values = mDataset;\n return filterResults;\n }\n\n @Override\n protected void publishResults(CharSequence charSequence, FilterResults filterResults) {\n mDataset = (ArrayList<DataObject>) filterResults.values;\n notifyDataSetChanged();\n }\n };\n }", "public abstract AisPacketStream filter(Predicate<? super AisPacket> predicate);", "public Filter condition();", "FeatureHolder filter(FeatureFilter filter);", "public abstract void filter();", "public Boolean filter(Entry e) {\n\t\t//TODO you will need to implement this method\n\t\treturn false;\n\t}", "List<DeviceDetails> getDevices(Predicate<DeviceDetails> deviceFilter, Predicate<DeviceDetails> deviceFilter2, Predicate<DeviceDetails> deviceFilter3);", "public QueryIterable<T> where(\n final Predicate<T> predicate\n ) {\n return Query.where(iterable, predicate);\n }", "public void filterTable(String filter) {\n\t\tif (fullBackup.isEmpty() || fullBackup == null) {\n\t\t\tfullBackup.addAll(list);\n\t\t}\n\n\t\t// always clear selected items\n\t\tselectionModel.clear();\n\t\tlist.clear();\n\n\t\tif (filter.equalsIgnoreCase(\"\")) {\n\t\t\tlist.addAll(fullBackup);\n\t\t} else {\n\t\t\tfor (Attribute attr : fullBackup){\n\t\t\t\t// store facility by filter\n\t\t\t\tif (attr.getFriendlyName().toLowerCase().startsWith(filter.toLowerCase())) {\n\t\t\t\t\tlist.add(attr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t\tloaderImage.loadingFinished();\n\n\t}", "public FilterCriterion createFilter(String column, Object value, FilterCriterion.FilterType type)\n {\n return new FilterCriterion(column, value, type);\n }", "private static Predicate<Person> predicate(CrudFilter filter) {\n return filter.getConstraints().entrySet().stream()\n .map(constraint -> (Predicate<Person>) person -> {\n try {\n Object value = valueOf(constraint.getKey(), person);\n return value != null && value.toString().toLowerCase()\n .contains(constraint.getValue().toLowerCase());\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n })\n .reduce(Predicate::and)\n .orElse(e -> true);\n }", "List<Condition> composeFilterConditions(F filter);", "public RecordBuffer prepareRecordBuffer(Column[] columns, FilterPredicate predicate) {\n return prepareRecordBuffer(columns, predicate, null);\n }", "public abstract Filter<T> filter();", "public Map<Integer, Boolean> getFilter(Geometry geom) throws SQLException {\n return retrieveExpected(createNativeFilterStatement(geom), BOOLEAN);\n }", "ObservableList<Person> getFilteredPersonList();", "public Collection<T> filter(Query query) throws DataAccessException;", "public FieldPredicate withPredicate(Predicate<Field> predicate) {\n this.predicate = predicate;\n return this;\n }", "boolean filter(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);", "private void searchTableDetailFilter() {\n DefaultTableModel table = (DefaultTableModel) tblLimitDetail.getModel();\n String search;\n search = txtSearchFilterDetail.getText();\n TableRowSorter<DefaultTableModel> tr;\n tr = new TableRowSorter<>(table);\n tblLimitDetail.setRowSorter(tr);\n tr.setRowFilter(RowFilter.regexFilter(\"(?i)\" + search, 1, 2, 3, 4));\n }", "public List<Element> filter(Predicate<Element> p)\n\t{\n\t\treturn recursive_filter(new ArrayList<Element>(), p, group);\n\t}", "public static List<List<String>> filterRecords(List<List<String>> rows, Query query, List<String> header) {\r\n\r\n\t\tlogger.debug(\"filterRecords\");\r\n\r\n\t\tif (query.getRestrictions() != null) {\r\n\r\n\t\t\trows = evaluateRestrictions(rows, query);\r\n\t\t}\r\n\r\n\t\treturn rows;\r\n\t}", "public HistoryCollection slice(HistoryCollection hc, Predicate p) {\n\t\tHistoryCollection result = options.newHistoryCollection();\n\t\tfor (History h : hc.getHistories()) {\n\t\t\tif (p.passes(h)) result.addHistory(h);\n\t\t}\n\t\treturn result;\n\t}", "DataFrame<R,C> mapToBooleans(ToBooleanFunction<DataFrameValue<R,C>> mapper);", "List<Income> findAll(Predicate predicate);", "public Results cloneResults(boolean matchesFilterOnly) {\r\n Results clone = new Results(this);\r\n for (int irow = 0; irow < this.getActualRowCount(); irow++) {\r\n ResultRow row = this.getRow(irow);\r\n if (matchesFilterOnly) {\r\n Boolean match = (Boolean) row.getRowAnnotation(AnomalySearchConstants.ROWANNOTATIONKEY_MATCHED_SEARCH);\r\n if (match != null && match) {\r\n clone.addRow(row);\r\n }\r\n } else {\r\n clone.addRow(row);\r\n }\r\n }\r\n return clone;\r\n }", "Try<T> filter(Predicate<? super T> p);", "public static List<Student> filterExample(){\n\t\tList<Student> genderFilter = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(stu->stu.getGender().equals(\"female\")).collect(Collectors.toList());\n\t\treturn genderFilter;\n\t}", "public void filterMapExample() {\n List<String> result = createPeople()\n .stream()\n .filter(predicate)\n .map(Person::getName)\n .map(String::toUpperCase)\n .collect(Collectors.toUnmodifiableList());\n print.accept(result);\n }", "ObservableList<Appointment> getFilteredAppointmentList();", "@Override\n public boolean isMatch(DataTable table, TableRow row) {\n return !subFilter.isMatch(table, row);\n }", "public static VcfIterator filter(final VcfIterator delegate,final Predicate<VariantContext> predicate)\n \t{\n class FilteringVcfIterator\n \textends AbstractIterator<VariantContext>\n \t\timplements VcfIterator\n \t\t{\n \tprivate final VcfIterator delegate;\n \tprivate final Predicate<VariantContext> predicate;\n \tFilteringVcfIterator(final VcfIterator delegate,final Predicate<VariantContext> predicate) {\n \t\t\tthis.delegate = delegate;\n \t\t\tthis.predicate=predicate;\n \t\t\t}\n \t\t@Override\n \t\tpublic AbstractVCFCodec getCodec() { return this.delegate.getCodec();}\n \t\t@Override\n \t\tpublic VCFHeader getHeader() { return this.delegate.getHeader();}\n \t\t@Override\n \t\tpublic void close() throws IOException {this.delegate.close();}\n \t\t@Override\n \t\tprotected VariantContext advance() {\n \t\t\twhile(this.delegate.hasNext())\n \t\t\t\t{\n \t\t\t\tfinal VariantContext ctx=this.delegate.next();\n \t\t\t\tif(this.predicate.test(ctx)) return ctx;;\n \t\t\t\t}\n \t\t\treturn null;\n \t\t\t}\n \t\t}\n \treturn new FilteringVcfIterator(delegate,predicate);\n \t}", "public List<TableData> filter(List<TableData> incomeData) throws Exception{\r\n return filterByNote(filterByCategory(filterByDate(incomeData)));\r\n }", "public<T> List<T> takeWhile(final Collection<T> collection, final Filter<T> filter ){\t\t\n\t\tList<T> result = create.createLinkedList();\n\t\tfor(T t:query.getOrEmpty(collection)){\t\t\t\n\t\t\tif(!filter.applicable(t)){\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tresult.add(t);\n\t\t}\n\t\treturn result;\n\t}", "private boolean predicateCheck(Game game) {\n boolean showOnTextFilter;\n if (txtFilter.getText().isEmpty()) {\n showOnTextFilter = true;\n } else {\n showOnTextFilter = game.getName().toLowerCase().contains(txtFilter.getText().toLowerCase());\n }\n\n boolean showOnCheckBoxFilter;\n if (!cbFilterNonAchievement.isSelected()) {\n showOnCheckBoxFilter = true;\n } else {\n showOnCheckBoxFilter = game.getHasStats();\n }\n\n return showOnTextFilter && showOnCheckBoxFilter;\n }", "boolean isPreFiltered();", "public QbWhere where();", "BPredicate createBPredicate();", "void setFilterByExpression(boolean filterByExpression);", "public Person[] search(Predicate<Person> predicate) {\n\t\tPerson[] tempArr = new Person[nElems];\n\t\tint count = 0;\n\t\tfor(int i = 0; i < nElems; i++) {\n\t\t\tif(predicate.test(arr[i])) {\n\t\t\t\ttempArr[count++] = arr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Arrays.copyOf(tempArr, count);\n\t}", "boolean isFilterByExpression();", "boolean doFilter() { return false; }", "PolynomialNode filter(Predicate test);", "FeatureHolder filter(FeatureFilter fc, boolean recurse);", "@Override\n protected SerializablePredicate<T> getFilter(Query<T, Void> query) {\n return Optional.ofNullable(inMemoryDataProvider.getFilter())\n .orElse(item -> true);\n }", "public static <T> Predicate<T> asPredicate(Function<T, Boolean> function) {\n\t\treturn function::apply;\n\t}", "private void applyFilters() {\n Task task = new Task() {\n @Override\n public Object call() {\n long start = System.currentTimeMillis();\n System.out.println(\"Applying filters! \" + filterList.size());\n filteredRowItemList = fullCustomerRowItemList;\n for (CustomerListFilter eachFilter : filterList) {\n eachFilter.setCustomerList(filteredRowItemList);\n filteredRowItemList = eachFilter.run();\n }\n System.out.println(\"Filtering took : \" + (System.currentTimeMillis() - start) + \" ms\");\n searchResultsTable.setItems(filteredRowItemList);\n customerCountStatus.setText(Integer.toString(filteredRowItemList.size()));\n return null;\n }\n };\n task.run();\n }", "public void testKeepSelectionOnFilterChange() {\n JXTable table = new JXTable(ascendingModel);\n int selectedRow = 0;\n table.setRowSelectionInterval(selectedRow, selectedRow);\n // sanity assert\n assertEquals(selectedRow, table.getSelectedRow());\n PatternFilter filter = new PatternFilter(\".*\", 0, 0);\n table.setFilters(new FilterPipeline(new Filter[] {filter}));\n assertEquals(ascendingModel.getRowCount(), table.getRowCount());\n assertEquals(\"table must keep selection after setting filter\", selectedRow, table.getSelectedRow());\n }", "public final MF ignoreColumns(Predicate<? super K> predicate) {\n \treturn addColumnProperty(predicate, new IgnoreProperty());\n\t}", "public ColumnBasedTableFilter(RowObjectTableModel<R> model) {\n\t\tthis.model = model;\n\t\tthis.name = null;\n\t}", "MapComp<K, V> removeAll(Predicate<K> p);", "public SubsetFilter createFilter(Dimension dimension);", "GeneralPredicate createGeneralPredicate();", "private List<moneda> filter(List<moneda> p1, String query)\n {\n query = query.toLowerCase();\n final List<moneda> filteredModeList = new ArrayList<>();\n for (moneda model:p1)\n {\n final String text = model.getNombre().toLowerCase();\n if(text.startsWith(query))\n {\n filteredModeList.add(model);\n }\n }\n return filteredModeList;\n }", "protected abstract NativeSQLStatement createNativeFilterStatement(Geometry geom);", "@Override\n public void actionPerformed(ActionEvent e) //\n {\n if(!flag)\n rs.setRowFilter(RowFilter.regexFilter(FilterText.getText(), 0, selectedColumn.getModelIndex()));\n }", "public static void filter() {\n\t\t\n\t\tResult.filter(toggleGroup.getSelectedToggle().getUserData(), ((ComboBox)hbox3.getChildren().get(0)).getValue());\n\t\t\n\t}", "public static Mapper filter(final Mapper mapper, @Nullable final Predicate<Statement> predicate) {\n if (predicate != null) {\n final Value[] empty = new Value[0];\n return new Mapper() {\n\n @Override\n public Value[] map(final Statement statement) throws RDFHandlerException {\n if (predicate.test(statement)) {\n return mapper.map(statement);\n } else {\n return empty;\n }\n }\n };\n } else {\n return mapper;\n }\n }", "public void filterBy(String id, Function<Trip, Boolean> flt) {\n filters.put(id, flt);\n modifiedSinceLastResult = true;\n }", "private void btnFiltrareActionPerformed(java.awt.event.ActionEvent evt) { \n List<Contact> lista = (List<Contact>) listaContacte.stream().filter(Agenda.predicate).sorted(Agenda.map.get(Agenda.criteriu)).collect(Collectors.toList());\n model.clear();\n lista.forEach((o) -> {\n model.addElement(o);\n });\n }", "public boolean hqlFilterAttrDefsWhereClause(GrouperSession grouperSession, \r\n Subject subject, HqlQuery hqlQuery, StringBuilder hqlTables, StringBuilder hqlWhereClause, \r\n String attrDefColumn, Set<Privilege> privInSet);", "@Test void testInterpretProjectFilterValues() {\n final String sql = \"select y, x\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\\n\"\n + \"where x > 1\";\n sql(sql).returnsRows(\"[b, 2]\", \"[c, 3]\");\n }", "private void changeTableBookOnSearch(){\n FilteredList<TeacherBookIssue> filteredData = new FilteredList<>(teacherBooksData,p -> true);\r\n \r\n //set the filter predicate whenever the filter changes\r\n teacher_searchTeacherID.textProperty().addListener((observable,oldValue,newValue)->{\r\n \r\n filteredData.setPredicate(TeacherBookIssue -> {\r\n \r\n //if filter text is empty, display all product\r\n if (newValue == null || newValue.isEmpty()) {\r\n return true;\r\n }\r\n \r\n //compare product id and product name of every product with the filter text\r\n String lowerCaseFilter =newValue.toLowerCase();\r\n \r\n if (TeacherBookIssue.getTeacherID().toLowerCase().contains(lowerCaseFilter)) {\r\n return true; // Filter matches product Id\r\n } \r\n \r\n return false; // Do not match \r\n });\r\n \r\n });\r\n \r\n //wrap the filteredList in a sortedList\r\n SortedList<TeacherBookIssue> sortedData = new SortedList<>(filteredData);\r\n \r\n //bind the sortedData to the Tableview\r\n sortedData.comparatorProperty().bind(teachserIssuedTable.comparatorProperty());\r\n \r\n //add sorted and filtered data to the table\r\n teachserIssuedTable.setItems(sortedData); \r\n }", "@FXML\n public void filterIngredients(){\n String searchText = searchIngredient.getText();\n List<Ingredient> filteredList = ingredientsFromDatabase.stream().filter(new Predicate<Ingredient>() {\n @Override\n public boolean test(Ingredient ingredient) {\n //inclusive of the upper cases makes it case insensitive\n if (ingredient.getName().toUpperCase().contains(searchText.toUpperCase())){\n return true;\n } else {\n return false;\n }\n }\n }).collect(Collectors.toList());\n filterObservableList = FXCollections.observableList(filteredList);\n ingredientsList.setItems(filterObservableList);\n }", "@Nonnull\r\n\tpublic static <T> Observable<T> takeWhile(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func2<? super T, ? super Integer, Boolean> predicate) {\r\n\t\treturn new Take.WhileIndexed<T>(source, predicate);\r\n\t}", "public IterableIterator<T> select(String predicate);", "public List<Object> queryByWhere(String col_name, String dto, List<List<Triple>> filter, List<String> keys) {\n\t\tList<Object> res = new ArrayList<Object>();\n\t\tDBCollection dbc = db.getCollection(col_name);\n\t\t// filter\n\t\tBasicDBObject all_ref = new BasicDBObject();\n\t\tDBObject _keys = new BasicDBObject();\n\t\t\n\t\tif(keys != null)\n\t\t\tfor(String key : keys) \n\t\t\t\t_keys.put(key, true);\n\t\t\n\t\tBasicDBList list = new BasicDBList();\n\t\tfor(List<Triple> and : filter) {\n\t\t\tBasicDBObject ref = new BasicDBObject();\n\t\t\tfor(Triple tri : and) {\n\t\t\t\tif(!ref.containsField(tri.key_name)) {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) \n\t\t\t\t\t\tref.put(tri.key_name, tri.value);\n\t\t\t\t\t\n\t\t\t\t\telse \n\t\t\t\t\t\tref.put(tri.key_name, new BasicDBObject(tri.condition, tri.value));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(tri.condition.equals(Condition.EQUAL)) {\n\t\t\t\t\t\t// TODO It is impossible\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tBasicDBObject bo = (BasicDBObject)ref.get(tri.key_name);\n\t\t\t\t\t\tbo.append(tri.condition, tri.value);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // end an \"and\" query\n\t\t\tlist.add(ref);\n\t\t}\n\t\t\n\t\tall_ref.put(\"$or\", list);\n\t\t\n\t\ttry {\n\t DBCursor cur = dbc.find(all_ref, _keys);\n\t \twhile (cur.hasNext()) {\n\t \t\tDBObject doc = cur.next();\n\t \t\ttry {\n\t \t\t\tres.add(Util.deserialize(doc, dto));\n\t \t\t} catch(InvocationTargetException ite) {\n\t \t\t\tite.printStackTrace();\n\t \t\t} \t\t\n\t \t\t//System.out.println(doc);\n\t }\n\n\t\t} catch(ClassNotFoundException cnfe) {\n \tcnfe.printStackTrace();\n } catch(InstantiationException ie) {\n \tie.printStackTrace();\n } catch(IllegalAccessException iae) {\n \tiae.printStackTrace();\n }\n\n \treturn res;\n\t}", "@Override\n public Possible<T> filter(Predicate<? super T> predicate) {\n AbstractDynamicPossible<T> self = this;\n return new AbstractDynamicPossible<T>() {\n @Override\n public boolean isPresent() {\n if (self.isPresent()) {\n boolean reallyPresent = true;\n T t = null;\n try {\n t = self.get();\n } catch (NoSuchElementException e) {\n // in case there was a race and the value became absent\n reallyPresent = false;\n }\n if (reallyPresent) {\n return predicate.test(t);\n }\n }\n return false;\n }\n\n @Override\n public T get() {\n T result = self.get();\n if (predicate.test(result)) {\n return result;\n }\n throw new NoSuchElementException();\n }\n };\n }", "protected Set<String> filterColumns() {\n return columnSelectionMap.keySet();\n }", "DbQuery setEqualsFilter(boolean value) {\n filter = Filter.EQUALS;\n filterType = FilterType.BOOLEAN;\n this.equals = value;\n return this;\n }", "public MapComp<K, V> removeAll(Predicate<K> p) {\n return new MapBST<K, V>(this.bst.removeAll(i -> p.test(i.left)));\n }", "private List<Thing> filter(List<Thing> source, List<WeatherType> weatherTypes, List<Gender> genders) {\n List<Thing> filtered = new ArrayList<>();\n for (Thing thing : source) {\n if (hasAnyWeatherType(thing, weatherTypes) && belongsTo(thing, genders)) {\n filtered.add(thing);\n }\n }\n return filtered;\n }", "private void filteringAndSortingWithDataView() {\n ComboBox<Person> comboBox = new ComboBox<>(\"Persons\");\n PersonService personService = new PersonService();\n\n // We fetch the items to the memory and bind the obtained collection\n // to the combo box\n Collection<Person> persons = personService.fetchAll();\n\n ComboBoxListDataView<Person> dataView = comboBox.setItems(persons);\n\n /*\n * Providing a predicate item filter allows filtering by any field of\n * the business entity and apply a combo box's text filter independently\n */\n IntegerField personAgeFilter = new IntegerField(\n event -> dataView.setFilter(person -> event.getValue() == null\n || person.getAge() > event.getValue()));\n\n /*\n * Providing a value provider or comparator allows sorting combo box's\n * items by custom field, or combination of fields\n */\n Button sortPersons = new Button(\"Sort Persons by Name\",\n event -> dataView.setSortOrder(Person::toString,\n SortDirection.ASCENDING));\n\n personAgeFilter.setLabel(\"Filter Persons with age more than:\");\n personAgeFilter.setWidth(WIDTH_STRING);\n addCard(\"Filtering\", \"Filtering and Sorting with Data View\", comboBox,\n personAgeFilter, sortPersons);\n }", "public QueryResultBuilder<T> applyFilter(Option<QueryFilter<T>> filter, Option<Map<String, Object>> params);", "private void collectUsingStream() {\n List<Person> persons =\n Arrays.asList(\n new Person(\"Max\", 18),\n new Person(\"Vicky\", 23),\n new Person(\"Ron\", 23),\n new Person(\"Harry\", 12));\n\n List<Person> filtered = persons\n .stream()\n .filter(p -> p.name.startsWith(\"H\"))\n .collect(Collectors.toList());\n\n System.out.println(\"collectUsingStream Filtered: \" + filtered);\n }" ]
[ "0.61105204", "0.59279704", "0.59027594", "0.588029", "0.5756213", "0.5746413", "0.52347314", "0.51532286", "0.51282334", "0.5037796", "0.4976162", "0.4968816", "0.49007368", "0.48721966", "0.48411718", "0.48034382", "0.4797007", "0.47861367", "0.4772612", "0.47613037", "0.47406226", "0.4734584", "0.47202823", "0.47187608", "0.47163895", "0.4710974", "0.47029746", "0.47013724", "0.46991923", "0.46925387", "0.46884072", "0.46616837", "0.4657348", "0.4654613", "0.46534547", "0.46280077", "0.46268603", "0.46098423", "0.4585519", "0.45853707", "0.45832932", "0.45716304", "0.454999", "0.45457807", "0.4536192", "0.45315444", "0.45222554", "0.4512495", "0.45102137", "0.44820255", "0.44807622", "0.4464094", "0.4452741", "0.44349965", "0.4431867", "0.44278598", "0.44237795", "0.44165793", "0.4396283", "0.43915662", "0.4387811", "0.43841454", "0.4379674", "0.4379361", "0.436748", "0.43650836", "0.436147", "0.4352165", "0.4343239", "0.43163252", "0.43087593", "0.4302239", "0.42951283", "0.42949304", "0.429492", "0.42850545", "0.4279867", "0.42758745", "0.42701876", "0.4266072", "0.42642605", "0.42567903", "0.42535213", "0.42523092", "0.42503548", "0.42460847", "0.4241959", "0.4240384", "0.42397657", "0.42313126", "0.42300004", "0.4226965", "0.42265263", "0.42207077", "0.4206049", "0.4203646", "0.42000377", "0.4195618", "0.41929743", "0.41869345" ]
0.60960215
1
Filter a dataframe and return a new dataframe
public synchronized RDataframe filter(RFilter<?>... tests) { // return everything if no conditions BitSet filter = (new BitSet(this.nrow())); filter.set(0, this.nrow(), true); for (RFilter<?> test: tests) { BitSet and = this.get(test.name()).matches(test.predicate()); filter.and(and); } final BitSet filter2 = filter; RDataframe out = new RDataframe(); this.columnIterator().forEachRemaining(n -> { out.addCol(n.getKey(), n.getValue().subset(filter2)); }); out.groupBy(this.getGroups()); return out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dataset FilterDataset(Dataset dataset)\n {\n Dataset result = new Dataset();\n for(HashMap<String, Object> row : dataset.dataset){\n if(this.eventExpression.MatchExpression(row))\n result.addRow(row);\n }\n return result;\n }", "public <Y extends RPrimitive> RDataframe filter(String name, Predicate<Y> predicate) {\n\t\treturn filter(RFilter.from(name, predicate));\n\t}", "public synchronized <Y extends RPrimitive> RDataframe filter(String name, Class<Y> type, Predicate<Y> predicate) {\n\t\treturn filter(RFilter.from(name, type, predicate));\n\t}", "DataFrame<R,C> select(Predicate<DataFrameRow<R,C>> rowPredicate, Predicate<DataFrameColumn<R,C>> colPredicate);", "ColumnInfoFilter getColumnInfoFilter();", "public void filter(String query) {\n\n\tTableRowSorter sorter = new TableRowSorter(table_1.getModel());\n\tsorter.setRowFilter(RowFilter.regexFilter(query));\n\ttable_1.setRowSorter(sorter);\n\n }", "public List<StudentRecord> filter(IFilter filter) {\n\t\tList<StudentRecord> temporaryList = new ArrayList<>();\n\n\t\tfor (StudentRecord studentRecord : studentRecords) {\n\t\t\tif (filter.accepts(studentRecord)) {\n\t\t\t\ttemporaryList.add(studentRecord);\n\t\t\t}\n\t\t}\n\t\treturn temporaryList;\n\t}", "public DataFrame copy() {\n return new DataFrame(data.values, header.values, index.values);\n }", "public void filterTable(String filter) {\n\t\tif (fullBackup.isEmpty() || fullBackup == null) {\n\t\t\tfullBackup.addAll(list);\n\t\t}\n\n\t\t// always clear selected items\n\t\tselectionModel.clear();\n\t\tlist.clear();\n\n\t\tif (filter.equalsIgnoreCase(\"\")) {\n\t\t\tlist.addAll(fullBackup);\n\t\t} else {\n\t\t\tfor (Attribute attr : fullBackup){\n\t\t\t\t// store facility by filter\n\t\t\t\tif (attr.getFriendlyName().toLowerCase().startsWith(filter.toLowerCase())) {\n\t\t\t\t\tlist.add(attr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t\tloaderImage.loadingFinished();\n\n\t}", "protected Set<String> filterColumns() {\n return columnSelectionMap.keySet();\n }", "public abstract void filter();", "@Override\n public Filter getFilter() {\n\n return new Filter() {\n @Override\n protected FilterResults performFiltering(CharSequence charSequence) {\n\n String charString = charSequence.toString();\n\n if (charString.isEmpty()) {\n\n mDataset = mArrayList;\n } else {\n\n ArrayList<DataObject> filteredList = new ArrayList<>();\n\n for (DataObject data : mArrayList) {\n\n if (data.getid().toLowerCase().contains(charString.toLowerCase()) || data.getname().toLowerCase().contains(charString.toLowerCase())) {\n\n filteredList.add(data);\n }\n }\n\n mDataset = filteredList;\n }\n\n FilterResults filterResults = new FilterResults();\n filterResults.values = mDataset;\n return filterResults;\n }\n\n @Override\n protected void publishResults(CharSequence charSequence, FilterResults filterResults) {\n mDataset = (ArrayList<DataObject>) filterResults.values;\n notifyDataSetChanged();\n }\n };\n }", "DataFrame<R,C> copy();", "public void filtro() {\n int columnaABuscar = 0;\n \n \n if (comboFiltro.getSelectedItem() == \"nombre\") {\n columnaABuscar = 0;\n }\n if (comboFiltro.getSelectedItem().toString() == \"Apellido\") {\n columnaABuscar = 1;\n }\n \n trsFiltro.setRowFilter(RowFilter.regexFilter(txtfiltro.getText(), columnaABuscar));\n }", "KTable<K, V> filter(Predicate<K, V> predicate);", "private void searchTableDetailFilter() {\n DefaultTableModel table = (DefaultTableModel) tblLimitDetail.getModel();\n String search;\n search = txtSearchFilterDetail.getText();\n TableRowSorter<DefaultTableModel> tr;\n tr = new TableRowSorter<>(table);\n tblLimitDetail.setRowSorter(tr);\n tr.setRowFilter(RowFilter.regexFilter(\"(?i)\" + search, 1, 2, 3, 4));\n }", "public static void filter() {\n\t\t\n\t\tResult.filter(toggleGroup.getSelectedToggle().getUserData(), ((ComboBox)hbox3.getChildren().get(0)).getValue());\n\t\t\n\t}", "KTable<K, V> filterOut(Predicate<K, V> predicate);", "@Query(\"from Flight as f where f.fare.fare <= 5000\")\n\tList<Flight> filterFlightsByPrice();", "public void refreshDataFilter();", "FeatureHolder filter(FeatureFilter filter);", "public abstract Filter<T> filter();", "public void interactiveTestColumnControlAndFilters() {\n final JXTable table = new JXTable(new AncientSwingTeam());\n table.setColumnControlVisible(true);\n // table.setFilters(createPipeline());\n Action toggleFilter = new AbstractAction(\"Toggle Filters\") {\n boolean hasFilters;\n public void actionPerformed(ActionEvent e) {\n if (hasFilters) {\n table.setFilters(null);\n } else {\n table.setFilters(createPipeline());\n // FilterPipeline pipeline = new FilterPipeline(new Filter[] {});\n // table.setFilters(pipeline);\n }\n hasFilters = !hasFilters;\n \n }\n \n };\n toggleFilter.putValue(Action.SHORT_DESCRIPTION, \"filtering first column - problem if invisible \");\n JXFrame frame = wrapWithScrollingInFrame(table, \"JXTable ColumnControl and Filters\");\n addAction(frame, toggleFilter);\n frame.setVisible(true);\n }", "boolean doFilter() { return false; }", "public ColumnBasedTableFilter(RowObjectTableModel<R> model) {\n\t\tthis.model = model;\n\t\tthis.name = null;\n\t}", "ObservableList<Patient> getFilteredPatientList();", "public Collection<T> filter(Query query) throws DataAccessException;", "public FilterBySeriesResponse filterBySeries(FilterBySeriesRequest request) throws GPUdbException {\n FilterBySeriesResponse actualResponse_ = new FilterBySeriesResponse();\n submitRequest(\"/filter/byseries\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Override\n public void resetFilter() {\n getTableRowSorter().setRowFilter(null);\n }", "public SubsetFilter createFilter(Dimension dimension);", "DataFilter getDataFilter(Connection con, SqlSearch search) throws FxSqlSearchException;", "private static Filter newFilter()\r\n {\r\n Filter filter = new Filter(\"filter1\", new Source(\"display1\", \"name1\", \"server\", \"key1\"));\r\n filter.getOtherSources().add(filter.getSource());\r\n Group group = new Group();\r\n group.addFilterCriteria(new Criteria(\"field1\", Conditional.EQ, \"123\"));\r\n Group group2 = new Group();\r\n group2.addFilterCriteria(new Criteria(\"field1\", Conditional.EQ, \"124\"));\r\n group.addFilterGroup(group2);\r\n filter.setFilterGroup(group);\r\n return filter;\r\n }", "public DataFrame getSubset(String[] columns) {\n\n // get the indices matching the columns\n int[] c = this.header.getIndices(columns);\n\n Object[][] data = new Object[this.data.rows][c.length];\n Object[] idx = new Object[this.data.rows];\n String[] hdr = new String[c.length];\n\n int rr = 0;\n int cc;\n for (int row = 0; row < this.data.rows; row++) {\n cc = 0;\n for (int col : c) {\n data[rr][cc] = this.data.values[col][row];\n idx[rr] = this.index.values[row];\n hdr[cc] = this.header.values[col];\n cc++;\n }\n rr++;\n }\n\n return new DataFrame(data, hdr, idx, \"SubSet of \" + name);\n }", "private void filterData(String tit, String loc, String datef, String datet, String cat, String cou){\n String t = tit;\n String l = loc;\n String df = datef;\n String dt = datet;\n String c = cat;\n String country = cou;\n filteredData.clear();\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\", Locale.US);\n\n //All empty\n if(t.length() == 0 && country.length() == 0 && c.length() == 0){\n for(int i = 0; i < data.size(); i++){\n filteredData.add(data.get(i));\n }\n }\n\n //only title\n if(t.length() != 0 && country.length() == 0 && c.length() == 0 && df.length() == 0){\n for(int i = 0; i < data.size(); i++){\n if(data.get(i).getTitle().equals(t)){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //only country\n if(t.length() == 0 && country.length() != 0 && c.length() == 0 && df.length() == 0){\n for(int i = 0; i < data.size(); i++){\n if(data.get(i).getCountry().equals(country)){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //only category\n if(t.length() == 0 && country.length() == 0 && c.length() != 0 && df.length() == 0){\n for(int i = 0; i < data.size(); i++){\n if(data.get(i).getCategory().equals(c)){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //only date\n if(t.length() == 0 && country.length() == 0 && c.length() == 0 && df.length() != 0 && dt.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //title and country\n if(t.length() != 0 && country.length() != 0 && c.length() == 0 && df.length() == 0){\n for(int i = 0; i < data.size(); i++){\n if(data.get(i).getTitle().equals(t) && data.get(i).getCountry().equals(country)){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //title and category\n if(t.length() != 0 && country.length() == 0 && c.length() != 0 && df.length() == 0){\n for(int i = 0; i < data.size(); i++){\n if(data.get(i).getCategory().equals(c) && data.get(i).getTitle().equals(t)){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //title, date\n if(t.length() != 0 && country.length() == 0 && c.length() == 0 && df.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(data.get(i).getTitle().equals(t) && datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //country, category\n if(t.length() == 0 && country.length() != 0 && c.length() != 0 && df.length() == 0){\n for(int i = 0; i < data.size(); i++){\n if(data.get(i).getCategory().equals(c) && data.get(i).getCountry().equals(country)){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //country, date\n if(t.length() == 0 && country.length() != 0 && c.length() == 0 && df.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(data.get(i).getCountry().equals(country) && data.get(i).getTitle().equals(t) && datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //category, date\n if(t.length() == 0 && country.length() == 0 && c.length() != 0 && df.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(data.get(i).getCategory().equals(c) && datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //title, country, category\n if(t.length() != 0 && country.length() != 0 && c.length() != 0 && df.length() == 0){\n for(int i = 0; i < data.size(); i++){\n if(data.get(i).getTitle().equals(t) && data.get(i).getCountry().equals(country) && data.get(i).getCategory().equals(c)){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //title, country, date\n if(t.length() != 0 && country.length() != 0 && c.length() == 0 && df.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(data.get(i).getTitle().equals(t) && data.get(i).getCountry().equals(country) && datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //title, category, date\n if(t.length() != 0 && country.length() == 0 && c.length() != 0 && df.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(data.get(i).getTitle().equals(t) && data.get(i).getCategory().equals(c) && datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n\n\n //country, category, date\n if(t.length() == 0 && country.length() != 0 && c.length() != 0 && df.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(data.get(i).getCategory().equals(c) && data.get(i).getCountry().equals(country) && datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n\n //title, country, category and date\n if(t.length() != 0 && country.length() != 0 && c.length() != 0 && df.length() != 0){\n for(int i = 0; i < data.size(); i++){\n String dateeee = data.get(i).getDate();\n try {\n datefrom = dateFormat.parse(df);\n dateto = dateFormat.parse(dt);\n datadate = dateFormat.parse(dateeee);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(data.get(i).getTitle().equals(t) && data.get(i).getCategory().equals(c) && data.get(i).getCountry().equals(country) && datadate.compareTo(datefrom) >= 0 && datadate.compareTo(dateto) <= 0){\n filteredData.add(data.get(i));\n }\n }\n }\n }", "@Override\n public SqlDatabaseTable filter(SqlDatabaseTable table, List<FilterRule> filterRules) {\n if (filterRules.isEmpty()) return table;\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"SELECT * FROM \").append(table.getFullRef());\n sql.append(\" WHERE\");\n for (int i = 0; i < filterRules.size(); i++) {\n FilterRule filterRule = filterRules.get(i);\n if (filterRule instanceof ColumnFilterRule) {\n int lhs = ((ColumnFilterRule) filterRule).getRowId();\n int rhs = ((ColumnFilterRule) filterRule).getAnotherRowId();\n sql.append(\" `_\").append(lhs).append(\"`=`_\").append(rhs).append(\"`\");\n } else if (filterRule instanceof ConstantFilterRule) {\n int rowId = ((ConstantFilterRule) filterRule).getRowId();\n String value = ((ConstantFilterRule) filterRule).getValue();\n sql.append(\" `_\").append(rowId).append(\"`='\").append(value).append(\"'\");\n } else {\n throw new IllegalArgumentException();\n }\n if (i != filterRules.size() - 1) {\n sql.append(\" AND\");\n }\n }\n\n return new SqlDatabaseQueryTable(sql.toString(), table.getArity());\n }", "public FilterSearchData getAsServerFilter() {\n FilterSearchData fsd = new FilterSearchData();\n\n if (this.getCombination() == Combination.ALL) {\n if (getReporter() != null) {\n fsd.setReporter_id(new BigInteger[]{getReporter().getId()});\n }\n if (getAssignedTo() != null) {\n fsd.setHandler_id(new BigInteger[]{getAssignedTo().getId()});\n }\n if (getCategory() != null) {\n fsd.setCategory(new String[]{getCategory()});\n }\n if (getSeverity() != null) {\n fsd.setSeverity_id(new BigInteger[]{getSeverity().getId()});\n }\n if (getResolution() != null) {\n fsd.setResolution_id(new BigInteger[]{getResolution().getId()});\n }\n if (getStatus() != null) {\n fsd.setStatus_id(new BigInteger[]{getStatus().getId()});\n }\n if (getPriority() != null) {\n fsd.setPriority_id(new BigInteger[]{getPriority().getId()});\n }\n if (getViewStatus() != null) {\n fsd.setView_state_id(new BigInteger[]{getViewStatus().getId()});\n }\n if (getProjectId() != null) {\n fsd.setProject_id(new BigInteger[]{getProjectId()});\n }\n } else {\n if (getProjectId() != null && getProjectId().compareTo(BigInteger.ZERO) != 0) {\n fsd.setProject_id(new BigInteger[]{getProjectId()});\n }\n }\n return fsd;\n }", "public List<TableData> filter(List<TableData> incomeData) throws Exception{\r\n return filterByNote(filterByCategory(filterByDate(incomeData)));\r\n }", "private void filteringAndSortingWithDataView() {\n ComboBox<Person> comboBox = new ComboBox<>(\"Persons\");\n PersonService personService = new PersonService();\n\n // We fetch the items to the memory and bind the obtained collection\n // to the combo box\n Collection<Person> persons = personService.fetchAll();\n\n ComboBoxListDataView<Person> dataView = comboBox.setItems(persons);\n\n /*\n * Providing a predicate item filter allows filtering by any field of\n * the business entity and apply a combo box's text filter independently\n */\n IntegerField personAgeFilter = new IntegerField(\n event -> dataView.setFilter(person -> event.getValue() == null\n || person.getAge() > event.getValue()));\n\n /*\n * Providing a value provider or comparator allows sorting combo box's\n * items by custom field, or combination of fields\n */\n Button sortPersons = new Button(\"Sort Persons by Name\",\n event -> dataView.setSortOrder(Person::toString,\n SortDirection.ASCENDING));\n\n personAgeFilter.setLabel(\"Filter Persons with age more than:\");\n personAgeFilter.setWidth(WIDTH_STRING);\n addCard(\"Filtering\", \"Filtering and Sorting with Data View\", comboBox,\n personAgeFilter, sortPersons);\n }", "DataFrame<R,C> left(int count);", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseByFilter();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getWarehouseRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getChannelRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new ChannelDao(uriInfo,header).getChannelByFilter();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getChannelRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public boolean isFiltered()\n\t{\n\t\tfinal TiTableView tableView = getTableView();\n\n\t\tif (tableView != null) {\n\t\t\treturn tableView.isFiltered();\n\t\t}\n\n\t\treturn false;\n\t}", "public Results cloneResults(boolean matchesFilterOnly) {\r\n Results clone = new Results(this);\r\n for (int irow = 0; irow < this.getActualRowCount(); irow++) {\r\n ResultRow row = this.getRow(irow);\r\n if (matchesFilterOnly) {\r\n Boolean match = (Boolean) row.getRowAnnotation(AnomalySearchConstants.ROWANNOTATIONKEY_MATCHED_SEARCH);\r\n if (match != null && match) {\r\n clone.addRow(row);\r\n }\r\n } else {\r\n clone.addRow(row);\r\n }\r\n }\r\n return clone;\r\n }", "public List<RefineriesFilter> getRefineriesFilter();", "@Override\n public boolean shouldFilter() {\n return true;\n }", "boolean filter(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);", "public FilterCriterion createFilter(String column, Object value, FilterCriterion.FilterType type)\n {\n return new FilterCriterion(column, value, type);\n }", "boolean isPreFiltered();", "public ArrayList<Stock> filter(Stock low, Stock high){\n ArrayList<Stock> result = new ArrayList<Stock>();\n ArrayList<Stock> all = this.ShowAll();\n\n//\t\tSystem.out.println(\"in filter\");\n\n for (Stock current : all) {\n StockFilter filter = new StockFilter(low, high, current);\n//\t\t\tSystem.out.println(low.getHigh()+\" \"+high.getHigh());\n//\t\t\tSystem.out.println(current.getHigh());\n\n if (filter.filt())\n result.add(current);\n }\n return result;\n }", "private void setUniqueToViewTableAndFilter() {\n\t\tsearchColumns.setItems(fillComboBox());\n\t\t//tableView.getColumns().setAll(fillColumns());\n\t}", "public Filter condition();", "public Map<Integer, Boolean> getFilter(Geometry geom) throws SQLException {\n return retrieveExpected(createNativeFilterStatement(geom), BOOLEAN);\n }", "public List<PedidoIndividual> filtrar(PedidoIndividual filtro);", "private void updateFilteredData() {\n\t\tswitch (currentTabScreen) {\n\t\tcase INVENTORY:\n\t\t\tpresentationInventoryData.clear();\n\n\t\t\tfor (RecordObj record: masterInventoryData) {\n\t\t\t\tif (matchesFilter(record)) {\n\t\t\t\t\tpresentationInventoryData.add(record);\n\t\t\t\t} // End if statement\n\t\t\t} // End for loop \n\t\t\tbreak;\n\t\tcase INITIAL:\n\t\t\tpresentationInitialData.clear();\n\n\t\t\tfor (RecordObj record: masterInitialData) {\n\t\t\t\tif (matchesFilter(record)) {\n\t\t\t\t\tpresentationInitialData.add(record);\n\t\t\t\t} // End if statement\n\t\t\t} // End for loop \n\t\t\tbreak;\n\t\tcase SEARCH:\n\t\t\tpresentationSearchData.clear();\n\n\t\t\tfor (RecordObj record: masterSearchData) {\n\t\t\t\tif (matchesFilter(record)) {\n\t\t\t\t\tpresentationSearchData.add(record);\n\t\t\t\t} // End if statement\n\t\t\t} // End for loop \n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}// End switch statement\n\t}", "private void showFilter() {\n dtmStok.getDataVector().removeAllElements();\n String pilih = cbFilter.getSelectedItem().toString();\n List<Stokdigudang> hasil = new ArrayList<>();\n\n int pan = tfFilter.getText().length();\n String banding = \"\";\n\n if (pilih.equals(\"Brand\")) {\n for (Stokdigudang s : listStok) {\n banding = s.getBrand().substring(0, pan);\n if (banding.equals(tfFilter.getText())) {\n hasil.add(s);\n }\n }\n } else if (pilih.equals(\"Kategori\")) {\n for (Stokdigudang s : listStok) {\n banding = s.getIDKategori().getNamaKategori().substring(0, pan);\n if (banding.equals(tfFilter.getText())) {\n hasil.add(s);\n }\n }\n } else if (pilih.equals(\"Supplier\")) {\n for (Stokdigudang s : listStok) {\n banding = s.getIDSupplier().getNamaPerusahaan().substring(0, pan);\n if (banding.equals(tfFilter.getText())) {\n hasil.add(s);\n }\n }\n } else {\n JOptionPane.showMessageDialog(this, \"Pilih Filter !\");\n }\n\n if (hasil.isEmpty()) {\n JOptionPane.showMessageDialog(this, \"Tidak ada stok yang ditemukan !\");\n } else {\n for (Stokdigudang s : hasil) {\n dtmStok.addRow(new Object[]{\n s.getIDBarang(),\n s.getNamaBarang(),\n s.getStok(),\n s.getBrand(),\n s.getHarga(),\n s.getIDKategori().getNamaKategori(),\n s.getIDSupplier().getNamaPerusahaan(),\n s.getTanggalDidapat()\n });\n }\n\n tableStok.setModel(dtmStok);\n }\n }", "public static void generalFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(general);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT DISTINCT * FROM articulos WHERE fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectos(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2)); \r\n }\r\n }else{\r\n searchAll();\r\n }\r\n break;\r\n default:\r\n \r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "private RowFilter<Object, Object> getFilter(List<String> selectedCheckBoxes, final String regex) {\n FilterMapKey key = new FilterMapKey(selectedCheckBoxes);\n if (tableFilterMap.containsKey(key)) {\n return tableFilterMap.get(key);\n }\n\n RowFilter<Object, Object> filter = new RowFilter<Object, Object>() {\n @Override\n public boolean include(RowFilter.Entry entry) {\n String severity = (String) entry.getValue(1);\n return severity.matches(regex);\n }\n };\n tableFilterMap.put(key, filter);\n return filter;\n }", "@Test void testInterpretProjectFilterValues() {\n final String sql = \"select y, x\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\\n\"\n + \"where x > 1\";\n sql(sql).returnsRows(\"[b, 2]\", \"[c, 3]\");\n }", "public ParticleMeasure filter(final Filter filter)\n\t\t{\n\t\tParticleMeasure out=new ParticleMeasure();\n\t\t\n\t\t//Copy all the columns\n\t\tout.columns.addAll(columns);\n\t\t\n\t\t//Copy all frames\n\t\tfor(Map.Entry<EvDecimal, FrameInfo> f:frameInfo.entrySet())\n\t\t\tif(filter.acceptFrame(f.getKey()))\n\t\t\t\t{\n\t\t\t\t//Create place-holder for frame\n\t\t\t\tfinal FrameInfo oldInfo=f.getValue();\n\t\t\t\tfinal FrameInfo newInfo=new FrameInfo();\n\t\t\t\tout.frameInfo.put(f.getKey(), newInfo);\n\n\t\t\t\t//Filter need to execute lazily as well\n\t\t\t\tnewInfo.calcInfo=new CalcInfo()\n\t\t\t\t\t{\n\t\t\t\t\tpublic void calc()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t//Execute calculation if not done already\n\t\t\t\t\t\tif(oldInfo.calcInfo!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\toldInfo.calcInfo.calc();\n\t\t\t\t\t\t\toldInfo.calcInfo=null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Filter particles\n\t\t\t\t\t\tfor(int id:oldInfo.keySet())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tParticleInfo pInfo=oldInfo.get(id);\n\t\t\t\t\t\t\tif(filter.acceptParticle(id, pInfo))\n\t\t\t\t\t\t\t\tnewInfo.put(id,pInfo);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\n\t\treturn out;\n\t\t}", "public boolean shouldFilter() {\n return true;\n }", "public static List<Student> filterExample(){\n\t\tList<Student> genderFilter = StudentDataBase.getAllStudents().stream()\n\t\t\t\t.filter(stu->stu.getGender().equals(\"female\")).collect(Collectors.toList());\n\t\treturn genderFilter;\n\t}", "private FechaCierreXModulo queryData() {\n\t\ttry {\n\n\t\t\tSystem.out.println(\"Los filtros son \"\n\t\t\t\t\t+ this.filterBI.getBean().toString());\n\n\t\t\t// Notification.show(\"Los filtros son \"\n\t\t\t// + this.filterBI.getBean().toString());\n\n\t\t\tFechaCierreXModulo item = mockData(this.filterBI.getBean());\n\n\t\t\treturn item;\n\n\t\t} catch (Exception e) {\n\t\t\tLogAndNotification.print(e);\n\t\t}\n\n\t\treturn new FechaCierreXModulo();\n\t}", "public static void ramFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n singleton.dtm.setColumnIdentifiers(ram);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Tipo\":\r\n //BUSCA POR TIPO\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND tipo LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Capacidad\":\r\n //BUSCA POR CAPACIDAD\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND capacidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n case \"Velocidad\":\r\n //BUSCA POR VELOCIDAD \r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT *,r.tipo,r.capacidad,r.velocidad FROM articulos a,ram r WHERE a.codigo = r.codart AND velocidad = '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosRam(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipo\"),rs.getInt(\"capacidad\"),rs.getInt(\"velocidad\")));\r\n }\r\n }else{\r\n searchRam();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "FeatureHolder filter(FeatureFilter fc, boolean recurse);", "public void testKeepSelectionOnFilterChange() {\n JXTable table = new JXTable(ascendingModel);\n int selectedRow = 0;\n table.setRowSelectionInterval(selectedRow, selectedRow);\n // sanity assert\n assertEquals(selectedRow, table.getSelectedRow());\n PatternFilter filter = new PatternFilter(\".*\", 0, 0);\n table.setFilters(new FilterPipeline(new Filter[] {filter}));\n assertEquals(ascendingModel.getRowCount(), table.getRowCount());\n assertEquals(\"table must keep selection after setting filter\", selectedRow, table.getSelectedRow());\n }", "public RecordBuffer prepareRecordBuffer(Column[] columns, FilterPredicate predicate) {\n return prepareRecordBuffer(columns, predicate, null);\n }", "protected abstract Graph filterGraph();", "@Override\n\tpublic boolean shouldFilter() {\n\t\treturn true;\n\t}", "public PSFilterResultSetWrapper(PSExecutionData data, ResultSet rs,\n IPSResultSetDataFilter filter)\n {\n if (data == null)\n throw new IllegalArgumentException(\"Need a valid execution data!\");\n\n if (rs == null)\n throw new IllegalArgumentException(\"There must be a result set!\");\n\n if (rs.getClass().isAssignableFrom(PSFilterResultSetWrapper.class))\n throw new IllegalArgumentException(\"Result set already wrapped!\");\n\n m_data = data;\n m_rs = rs;\n m_filter = filter;\n if (filter != null)\n {\n m_cols = m_filter.getColumns().toArray();\n }\n }", "Filter getFilter();", "private Dataset<Row> takeOtherRowsFirstWay(Dataset<Row> input) {\n\t\n\t\tString[] colulmsString = input.columns();\n\t\t\n\t\tfor( int i = 0; i < colulmsString.length; i++) {\n\t\t\t\n\t\t\t// Determinate if the current colum is to drop or not\n\t\t\tboolean drop = false;\n\t\t\tfor(SingleTakeColumn single: this.columsTarget) {\n\t\t\t\tif(single.value.equals(colulmsString[i])) \n\t\t\t\t\tdrop = true;\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(drop) // drop column\n\t\t\t\tinput = input.drop(input.col(colulmsString[i]));\n\t\t\n\t\t}\n\t\treturn input;\n\t}", "@Override\n public void actionPerformed(ActionEvent e) //\n {\n if(!flag)\n rs.setRowFilter(RowFilter.regexFilter(FilterText.getText(), 0, selectedColumn.getModelIndex()));\n }", "private Reviews filterByFunc(FilterFunction filterFunc)\n\t{\n\t\tArrayList<Review> filteredList = new ArrayList<Review>();\n\t\tfor(Review review : list)\n\t\t\tif(filterFunc.filter(review))\n\t\t\t\tfilteredList.add(review);\n\t\treturn new Reviews(filteredList);\n\t}", "private Dataset<Row> takeOtherRowsSecondWay(Dataset<Row> input) {\n\t\t\n\tString[] colulmsString = input.columns();\n\t\t\n\t\tfor( int i = 0; i < colulmsString.length; i++) {\n\t\t\t\n\t\t\tif (i >= this.indexFrom && i <= this.indexTo)\n\t\t\t\t// drop column\n\t\t\t\tinput = input.drop(input.col(colulmsString[i]));\n\t\t\n\t\t}\n\t\treturn input;\n\t}", "private void updateFilteredData() {\n mainApp.getFilteredData().clear();\n\n for (FilmItem p : mainApp.getFilmData()) {\n if (matchesFilter(p)) {\n \tmainApp.getFilteredData().add(p);\n }\n }\n }", "default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }", "public static void mbFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(mb);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,pb r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosPB(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipoprocesador\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchMotherboard();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,pb r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosPB(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipoprocesador\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchMotherboard();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,pb r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosPB(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipoprocesador\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchMotherboard();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,pb r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosPB(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipoprocesador\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchMotherboard();\r\n }\r\n break;\r\n case \"Tipo Procesador\":\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,pb r WHERE a.codigo = r.producto_id AND tipoprocesador LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosPB(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getString(\"tipoprocesador\"),rs.getString(\"caracteristicas\")));\r\n }\r\n }else{\r\n searchMotherboard();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }", "ObservableList<Appointment> getFilteredAppointmentList();", "private void filterInputData(){\r\n char[] rowFilterChar = rowFilter.toCharArray();\r\n char[] columnFilterChar = columnFilter.toCharArray();\r\n int oldInt=0;\r\n int i;\r\n //Converts the String containing all the Columns into a list array \r\n for(i=0;i<columnFilter.length();i++){\r\n if(columnFilterChar[i]==44){\r\n if(oldInt==0){\r\n try{\r\n columns.add(Integer.parseInt(columnFilter.substring(oldInt,i)));\r\n }catch(Exception e){\r\n System.err.println(\"ERROR: You have placed a column value which is not an value \\\"\"+columnFilter.substring(oldInt,i)+\"\\\"\");\r\n }\r\n oldInt=i; \r\n }else{\r\n try{\r\n columns.add(Integer.parseInt(columnFilter.substring(oldInt+1,i)));\r\n }catch(Exception e){\r\n System.err.println(\"ERROR: You have placed a column value which is not an value \\\"\"+columnFilter.substring(oldInt+1,i)+\"\\\"\");\r\n }\r\n oldInt=i;\r\n } \r\n } \r\n }\r\n try{\r\n columns.add(Integer.parseInt(columnFilter.substring(oldInt+1)));\r\n }catch(Exception e){\r\n System.err.println(\"ERROR: You have placed a column value which is not an value \\\"\"+columnFilter.substring(oldInt+1)+\"\\\"\");\r\n }\r\n //Converts the String containing all the rows into a list array \r\n oldInt=0;\r\n for(i=0;i<rowFilter.length();i++){\r\n if(rowFilterChar[i]==44){\r\n if(oldInt==0){\r\n try{\r\n rows.add(Integer.parseInt(rowFilter.substring(oldInt,i),10)); \r\n }catch(Exception e){\r\n System.err.println(\"ERROR: You have placed a row value which is not an value \\\"\"+rowFilter.substring(oldInt,i)+\"\\\"\");\r\n } \r\n \r\n oldInt=i; \r\n }else{\r\n try{\r\n rows.add(Integer.parseInt(rowFilter.substring(oldInt+1,i),10)); \r\n }catch(Exception e){\r\n System.err.println(\"ERROR: You have placed a row value which is not an value \\\"\"+rowFilter.substring(oldInt+1,i)+\"\\\"\");\r\n }\r\n oldInt=i;\r\n } \r\n } \r\n }\r\n try{\r\n rows.add(Integer.parseInt(rowFilter.substring(oldInt+1),10)); \r\n }catch(Exception e){\r\n System.err.println(\"ERROR: You have placed a row3 value which is not an value \\\"\"+rowFilter.substring(oldInt+1,i)+\"\\\"\");\r\n }\r\n filteredData.add(new ArrayList<String>());\r\n filteredData.get(filteredData.size()-1).add(inputData.get(0).get(0));\r\n for(i=0;i<columns.size();i++){\r\n if(columns.get(i)<inputData.get(inputData.size()-1).size()){\r\n filteredData.get(filteredData.size()-1).add(inputData.get(0).get(columns.get(i)));\r\n }\r\n }\r\n //This is what takes the information from the arraylists and creates the filtered data. The if statements are designed to filter out all the values written which do not fall in the domain of the table.\r\n for(i=0;i<rows.size();i++){\r\n // filters out all the row values which do not fall in the domain of the data set\r\n if(rows.get(i)<=inputData.size()){\r\n filteredData.add(new ArrayList<String>());\r\n filteredData.get(filteredData.size()-1).add(\"OURID\"+i);\r\n for(int j=0;j<columns.size();j++){\r\n if(columns.get(j)<=inputData.get(inputData.size()-1).size()){\r\n filteredData.get(filteredData.size()-1).add(inputData.get(rows.get(i)).get(columns.get(j)));\r\n }\r\n } \r\n } \r\n }\r\n \r\n }", "private Dataset<Row> takeRowsSecondWay(Dataset<Row> input) {\n\t\t\n\t\tString[] colulmsString = input.columns();\n\t\t\n\t\tfor( int i = 0; i < colulmsString.length; i++) {\n\t\t\t\n\t\t\tif ( !(i >= this.indexFrom && i <= this.indexTo))\n\t\t\t\t// drop column\n\t\t\t\tinput = input.drop(input.col(colulmsString[i]));\n\t\t\n\t\t}\n\t\treturn input;\n\t}", "public void setFiltered(boolean filtered) {\n this.filtered = filtered;\n }", "boolean isFilterByDate();", "public void filterEdges(String filter) {\n\n\n tree_graphs.getChildren().clear();\n populate(universe, filter, this.showNodes, this.showEdges,\n this.showHyperEdges);\n\n\n tree_edges.getChildren().clear();\n for (IEdge edge : universe.getEdges()) {\n if (edge.toString().contains(filter)) {\n parseEdge(edge, tree_edges, filter);\n }\n }\n\n }", "private Object [] getFilterVals()\n throws java.sql.SQLException\n {\n Object [] ret = new Object[m_cols.length];\n\n for (int i = 0; i < m_cols.length; i++)\n {\n ret[i] = m_rs.getString((String)m_cols[i]);\n }\n return ret;\n }", "protected abstract Instances filterData(PipelineData data) throws Exception;", "@FunctionalInterface\n public interface FilterMethod<T> {\n Slice<T> load( @Nullable Filters filters, @Nullable Sort sort, int offset, int limit );\n }", "DataFrame<R,C> mapToBooleans(ToBooleanFunction<DataFrameValue<R,C>> mapper);", "public Filter getFilter(final boolean isHistory) {\n\t\tisHistory_global = isHistory;\n\t\tFilter filter = new Filter() {\n\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t@Override\n\t\t\tprotected void publishResults(CharSequence constraint,\n\t\t\t\t\tFilterResults results) {\n\n\t\t\t\tbookingsList = (List<Bookings>) results.values;\n\t\t\t\tnotifyDataSetChanged();\n\t\t\t\temptyviewHandler.sendEmptyMessage(0);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected FilterResults performFiltering(CharSequence constraint) {\n\n\t\t\t\tFilterResults results = new FilterResults();\n\t\t\t\tfilteredBookingsList = new ArrayList<Bookings>();\n\n\t\t\t\tif (constraint == null || constraint.length() == 0) {\n\t\t\t\t\tresults.count = bookingsList.size();\n\t\t\t\t\tresults.values = bookingsList;\n\t\t\t\t} else {\n\t\t\t\t\tconstraint = constraint.toString().toLowerCase();\n\t\t\t\t\tfor (int i = 0; i < bookingsList.size(); i++) {\n\n\t\t\t\t\t\tif (isHistory) {\n\t\t\t\t\t\t\tif (bookingsList.get(i).getCompletedAt().equals(\"\")\n\t\t\t\t\t\t\t\t\t|| bookingsList.get(i).getStatus()\n\t\t\t\t\t\t\t\t\t\t\t.get(\"currentStatus\").toString()\n\t\t\t\t\t\t\t\t\t\t\t.equals(\"\")) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tString pickupAddress, dropoffAddress;\n\t\t\t\t\t\tpickupAddress = bookingsList.get(i).getPickupLocation()\n\t\t\t\t\t\t\t\t.getAddressLine1().toString();\n\n\t\t\t\t\t\tdropoffAddress = bookingsList.get(i).getDropLocation()\n\t\t\t\t\t\t\t\t.getAddressLine1().toString();\n\n\t\t\t\t\t\tif (pickupAddress.toLowerCase().contains(\n\t\t\t\t\t\t\t\tconstraint.toString())\n\t\t\t\t\t\t\t\t|| dropoffAddress.toLowerCase().contains(\n\t\t\t\t\t\t\t\t\t\tconstraint.toString())) {\n\t\t\t\t\t\t\tfilteredBookingsList.add(bookingsList.get(i));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tresults.count = filteredBookingsList.size();\n\t\t\t\t\tresults.values = filteredBookingsList;\n\n\t\t\t\t}\n\n\t\t\t\treturn results;\n\t\t\t}\n\t\t};\n\n\t\treturn filter;\n\t}", "@Override\r\n\tpublic List<Filtering> selectByAll() {\n\t\treturn filteringMapper.selectByAll();\r\n\t}", "List<Trueorfalse> selectByExample(RowBounds rowBounds);", "@Override\n protected SerializablePredicate<T> getFilter(Query<T, Void> query) {\n return Optional.ofNullable(inMemoryDataProvider.getFilter())\n .orElse(item -> true);\n }", "ObservableList<Person> getFilteredPersonList();", "private void filter(Node<Context> node) {\n if (node != null && node.parent != null) {\n Node<Context> parent = tree.getNode(node.parent);\n FilterInfo filterInfo = new FilterInfo(parent, node);\n filterStack.add(filterInfo);\n filter(filterInfo);\n tree.openNode(MODEL_BROWSER_ROOT, () -> tree.selectNode(MODEL_BROWSER_ROOT));\n }\n }", "protected abstract NativeSQLStatement createNativeFilterStatement(Geometry geom);", "@Test\n public void testFilterGoodData() throws Exception {\n assertEquals(300.0, maxFilter.filter(300.0), .01);\n assertEquals(2342342.213, maxFilter.filter(2342342.213), .01);\n assertEquals(840958239423.123213123, maxFilter.filter(840958239423.123213123), .01);\n assertEquals(840958239423.123213123, maxFilter.filter(0.000001232123), .01);\n assertEquals(840958239423.123213123, maxFilter.filter(-123210.000001232123), .01);\n assertEquals(840958239423.123213123, maxFilter.filter(-0.00087868761232123), .01);\n }", "@Override\n public boolean isMatch(DataTable table, TableRow row) {\n return !subFilter.isMatch(table, row);\n }", "public void explore( Object bean, String[] filter )\n {\n if ( bean == null )\n {\n if ( treeTable != null )\n {\n remove( treePane );\n repaint();\n }\n return;\n }\n\n this.bean = bean;\n ComponentModel mdl = ComponentFactory.getModel( bean, ComponentFactory.Policy.UI );\n ComponentModel fmdl = ComponentFactory.filterComponentModel( mdl, filter );\n setComponentModel( fmdl );\n\n this.treeTable.getTree().setRootVisible( false );\n }", "String getTypeFilter(String column, Collection<FxType> types);", "@Override\n\tpublic void filterChange() {\n\t\t\n\t}", "public static void hddFilter(){\r\n try {\r\n String choice = home_RegisterUser.comboFilter.getSelectedItem().toString();\r\n ResultSet rs = null;\r\n singleton.dtm = new DefaultTableModel();\r\n \r\n singleton.dtm.setColumnIdentifiers(hdd);\r\n home_RegisterUser.table.setModel(singleton.dtm);\r\n Statement stmt = singleton.conn.createStatement();\r\n \r\n switch (choice) {\r\n case \"Nombre\":\r\n //BUSCA POR NOMBRE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND nombre LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Precio mayor que\":\r\n //BUSCA POR PRECIO MAYOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND precio > '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Precio menor que\":\r\n //BUSCA POR PRECIO MENOR\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND precio < '\"+home_RegisterUser.filterField.getText()+\"'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break; \r\n case \"Fabricante\":\r\n //BUSCA POR FABRICANTE\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND fabricante LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Capacidad\":\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND capacidad LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"RPM\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND rpm LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n case \"Tipo\":\r\n //BUSCA POR RESOLUCION\r\n if(!home_RegisterUser.filterField.getText().equals(\"\")){\r\n rs = stmt.executeQuery(\"SELECT * FROM articulos a,dd r WHERE a.codigo = r.codart AND tipo LIKE '%\"+home_RegisterUser.filterField.getText()+\"%'\");\r\n while(rs.next()){\r\n int stock = rs.getInt(\"stock\");\r\n String stock2;\r\n if(stock>0){\r\n stock2 = \"Esta en Stock\";\r\n }else{\r\n stock2 = \"No esta en Stock\";\r\n }\r\n singleton.dtm.addRow(getArrayDeObjectosHDD(rs.getInt(\"codigo\"),rs.getString(\"nombre\"),rs.getString(\"fabricante\"),rs.getFloat(\"precio\"),stock2,rs.getInt(\"capacidad\"),rs.getInt(\"rpm\"),rs.getString(\"tipo\")));\r\n }\r\n }else{\r\n searchHdd();\r\n }\r\n break;\r\n }\r\n } catch (SQLException ex) {\r\n System.err.println(\"SQL Error: \"+ex);\r\n }catch(Exception ex){\r\n System.err.println(\"Error: \"+ex);\r\n }\r\n }" ]
[ "0.6071182", "0.5656396", "0.5452324", "0.52613306", "0.5221807", "0.51234806", "0.4915133", "0.48516914", "0.48512957", "0.4844768", "0.48414424", "0.4825073", "0.47395593", "0.46974906", "0.46880493", "0.4684081", "0.4643127", "0.46406585", "0.46288282", "0.46286717", "0.4617394", "0.46107322", "0.4577686", "0.4571134", "0.45675567", "0.4561727", "0.45613813", "0.45569497", "0.4543808", "0.4539177", "0.45335442", "0.45237356", "0.45073617", "0.450444", "0.44993904", "0.449465", "0.44776085", "0.44754058", "0.44642687", "0.44620308", "0.44411626", "0.4436839", "0.44319242", "0.440868", "0.43858117", "0.43845135", "0.4382705", "0.4377928", "0.43665007", "0.43542632", "0.43534228", "0.43476605", "0.43425396", "0.4336725", "0.4335039", "0.43346304", "0.43267754", "0.4317613", "0.430531", "0.42982098", "0.42974475", "0.4282271", "0.42794847", "0.4271228", "0.4267601", "0.42570028", "0.42340317", "0.42316625", "0.42253938", "0.42203024", "0.42190155", "0.42188117", "0.42169175", "0.42058295", "0.4204396", "0.41993806", "0.41982841", "0.41934112", "0.41895103", "0.41885528", "0.41884476", "0.4187709", "0.4187229", "0.41756806", "0.41739348", "0.41639197", "0.41628596", "0.41602957", "0.4159374", "0.41551614", "0.41551507", "0.4150681", "0.414148", "0.41351438", "0.4130394", "0.41249692", "0.4124543", "0.41163138", "0.4114395", "0.411254" ]
0.5773225
1
Returns the same data frame with the column "columnName"
public synchronized <X extends RPrimitive,Y extends RPrimitive> RDataframe mutate(String columnName, Class<X> inputType, Function<X,Y> mapping) { return mutate(columnName,mapping); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Column getColumn(String columnName);", "SqlColumns(String columnName){\n\t\t\t this.columnName = columnName; \n\t\t}", "public void setColumnName(String columnName) {\n this.columnName = columnName;\n }", "public void setColumnName(String columnName)\n {\n this.columnName = columnName;\n }", "public void setColumnName(String columnName);", "String getColumnName();", "public void setColumnName(java.lang.String columnName) {\r\n this.columnName = columnName;\r\n }", "public String getColumnName() {\n return columnName; \n }", "public String getColumnName();", "public void setColumnName (String ColumnName);", "public String getColumnName() {\n return this.columnName;\n }", "public DataFrame copy() {\n return new DataFrame(data.values, header.values, index.values);\n }", "public Object getStruct(String columnName) {\n StructVector vector = (StructVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "public void createColumn(String columnName){\n addColumnBtn.click();\n wait.until(ExpectedConditions.visibilityOf(columnNameLbl));\n columnNameLbl.click();\n columnNameInput.sendKeys(columnName);\n columnNameInput.sendKeys(Keys.ENTER);\n }", "public void setColumnName(String columnName) {\r\n dataBinder.setColumnName(columnName);\r\n }", "public Object getObject(String columnName) throws SQLException\n {\n return m_rs.getObject(columnName);\n }", "private static TextColumnBuilder getColumnByNameField(String nameField){ \n return drColumns.get(nameField);\n }", "public RColumn getRColumn (String columnName)\n\t{\n\t\tif (columnName == null)\n\t\t\treturn null;\n\t\tfor (RColumn col : m_data.cols) {\n\t\t\tif (columnName.equals(col.getColumnName())) {\n\t\t\t\treturn col;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public java.lang.String getColumnName() {\r\n return columnName;\r\n }", "public void setColumnName(String columnName) {\r\n navBinder.setColumnName(columnName);\r\n }", "public Object getResult(ResultSet rs, String columnName) throws SQLException;", "public <T> List<T> queryColumn(String columnName, String sql) throws SQLException {\n return queryColumn(columnName, sql, (Object[])null);\n }", "Column getColumns(int index);", "WebElement getColumnByName(WebElement tableRecord, String columnName);", "public void addColumn(String columnName);", "String getColumn(int index);", "String getColumn(int index);", "DataFrame<R,C> copy();", "public ResultSet getdata(String dataFileName, String columnname, String sheetname, String location) {\r\n\t\tResultSet rs = null;\r\n\t\tString query = \"\";\r\n\t\ttry {\r\n\t\t\tif (dataFileName.isEmpty()) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tconnection = connect(dataFileName);\r\n\t\t\tif (connection == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tstmnt = connection.createStatement();\r\n\t\t\tif (stmnt == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tif (columnname.equalsIgnoreCase(\"ALL\")) {\r\n\t\t\t\tif (location == null || location.equalsIgnoreCase(\"\")) {\r\n\t\t\t\t\tquery = \"select * from [\" + sheetname + \"$];\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tquery = \"select * from [\" + sheetname + \"$] where \" + location + \";\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (location == null || location.equalsIgnoreCase(\"\")) {\r\n\t\t\t\t\tquery = \"select \" + columnname + \" from [\" + sheetname + \"$];\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tquery = \"select \" + columnname + \" from [\" + sheetname + \"$] where \" + location + \";\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\trs = stmnt.executeQuery(query);\r\n\t\t} catch (Exception ex) {\r\n\r\n\t\t\treturn rs;\r\n\t\t}\r\n\r\n\t\treturn rs;\r\n\t}", "ColumnNames createColumnNames();", "public SQLXML getSQLXML(String columnName) throws SQLException {\n\n throw Message.getUnsupportedException();\n }", "public <T> List<T> queryColumn(String columnName, String sql, Object... params) throws SQLException {\n logger.debug(\"SQL= \\n\" + sql);\n // Print the parameters to the logger.\n printParams(params);\n ResultSetHandler<List<T>> h = new ColumnListHandler<T>(columnName);\n return qr.query(conn, sql, h, params);\n }", "Column createColumn();", "java.lang.String getColumn();", "public TableCell get(String columnName) {\n if (ownerTable == null) {\n throw new IllegalStateException(\n \"This table row does not belong to a table. Use \" +\n \"get(int) instead.\");\n }\n \n Integer columnIndex = \n ownerTable.tableColumnNameIndexMap.get(columnName);\n \n if (columnIndex == null) {\n throw new IllegalArgumentException(\"\\\"\" +\n columnName + \"\\\": no such column.\");\n }\n \n return tableCellList.get(columnIndex);\n }", "Column(String column) {\n this.column = column;\n }", "Column(String column) {\n this.column = column;\n }", "public String getCertainColumn(ResultSet rs, String columnName) throws SQLException\n {\n String result=\"\";\n while (rs.next())\n {\n\n String temp = rs.getString(columnName);\n result+=\"<p>\"+temp+\"</p>\";\n }\n return result;\n }", "static DataFrameRead read() {\n return DataFrameFactory.getInstance().read();\n }", "public static Dataset<Row> getDataset(String... columnNames) throws IOException {\n\t\t// form query URL\n\t\tString query = CURRENT_URL + columNamesString(columnNames);\n\n\t\t// run tabular report query\n\t\tInputStream input = postQuery(query);\n\n\t\t// save as a temporary CSV file\n\t\tPath tempFile = saveTempFile(input);\n\n\t\tSparkSession spark = SparkSession.builder().getOrCreate();\n\n\t\t// load temporary CSV file into Spark dataset\n\t\tDataset<Row> dataset = readCsv(spark, tempFile.toString());\n\n\t\treturn concatIds(spark, dataset, columnNames);\n\t}", "public PgColumn getColumn(final String name) {\n PgColumn column = null;\n \n for (PgColumn curColumn : columns) {\n if (curColumn.getName().equals(name)) {\n column = curColumn;\n \n break;\n }\n }\n \n return column;\n }", "public DataFrame getSubset(String[] columns) {\n\n // get the indices matching the columns\n int[] c = this.header.getIndices(columns);\n\n Object[][] data = new Object[this.data.rows][c.length];\n Object[] idx = new Object[this.data.rows];\n String[] hdr = new String[c.length];\n\n int rr = 0;\n int cc;\n for (int row = 0; row < this.data.rows; row++) {\n cc = 0;\n for (int col : c) {\n data[rr][cc] = this.data.values[col][row];\n idx[rr] = this.index.values[row];\n hdr[cc] = this.header.values[col];\n cc++;\n }\n rr++;\n }\n\n return new DataFrame(data, hdr, idx, \"SubSet of \" + name);\n }", "public Object getObject(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getObject\", columnName);\n Value v = get(columnName);\n return conn.convertToDefaultObject(v);\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n public String getColumnName(int column) { return columnnames[column]; }", "public ResultSet getCertainRow(String itemname, String tableName, String columnName)\n {\n\n String selectStr;\n ResultSet rs=null;\n String itemn=\"%\"+itemname+\"%\";\n\n try{\n\n selectStr=\"SELECT * FROM \"+tableName+\" WHERE \"+ columnName+\" LIKE \"+quotate(itemn);\n rs = stmt.executeQuery(selectStr);\n\n\n\n\n\n }catch(Exception e){\n System.out.println(\"Error occurred in searchLogin\");\n }\n\n return rs;\n }", "public String getName() {\n return columnName;\n }", "public String getColumnName() {\r\n return dataBinder.getColumnName();\r\n }", "public ResultSet selectData(String sql) throws java.sql.SQLException {\n\t\treturn selectData(sql, -1);\n\t}", "DataFrameColumns<R,C> cols();", "@Override\n @Nullable\n public Column findColumn(String name)\n {\n if (columnCache.containsKey(name)) {\n return columnCache.get(name);\n } else {\n final Column column = rac.findColumn(name);\n if (column == null) {\n columnCache.put(name, null);\n return null;\n }\n\n final ColumnAccessor accessor = column.toAccessor();\n return new ColumnAccessorBasedColumn(\n new ColumnAccessor()\n {\n @Override\n public ColumnType getType()\n {\n return accessor.getType();\n }\n\n @Override\n public int numRows()\n {\n return end - start;\n }\n\n @Override\n public boolean isNull(int rowNum)\n {\n return accessor.isNull(pointers[start + rowNum]);\n }\n\n @Nullable\n @Override\n public Object getObject(int rowNum)\n {\n return accessor.getObject(pointers[start + rowNum]);\n }\n\n @Override\n public double getDouble(int rowNum)\n {\n return accessor.getDouble(pointers[start + rowNum]);\n }\n\n @Override\n public float getFloat(int rowNum)\n {\n return accessor.getFloat(pointers[start + rowNum]);\n }\n\n @Override\n public long getLong(int rowNum)\n {\n return accessor.getLong(pointers[start + rowNum]);\n }\n\n @Override\n public int getInt(int rowNum)\n {\n return accessor.getInt(pointers[start + rowNum]);\n }\n\n @Override\n public int compareRows(int lhsRowNum, int rhsRowNum)\n {\n return accessor.compareRows(pointers[lhsRowNum], pointers[start + rhsRowNum]);\n }\n }\n );\n }\n }", "protected abstract String getFavoriteColumnName();", "public java.sql.Date getDate(String columnName) throws SQLException\n {\n return m_rs.getDate(columnName);\n }", "public List<Column> getColumns();", "public SqlWindow createCurrentRowWindow(final String columnName) {\n return SqlWindow.create(\n null,\n null,\n new SqlNodeList(SqlParserPos.ZERO),\n new SqlNodeList(\n ImmutableList.of(\n new SqlIdentifier(columnName, SqlParserPos.ZERO)),\n SqlParserPos.ZERO),\n SqlLiteral.createBoolean(true, SqlParserPos.ZERO),\n SqlWindow.createCurrentRow(SqlParserPos.ZERO),\n SqlWindow.createCurrentRow(SqlParserPos.ZERO),\n SqlLiteral.createBoolean(true, SqlParserPos.ZERO),\n SqlParserPos.ZERO);\n }", "public DatabaseQueryColumn(String name) {\n this.formula = null;\n this.name = name;\n }", "String getColumn();", "public DataColumn getCol(String colName) {\n\t\tif (containsColumn(colName)) {\n\t\t\treturn dc.get(colName);\n\t\t}\n\t\treturn null;\n\t}", "public abstract T getEntityByColumnName(String columnName, String value);", "@Override\n\tpublic Map<String, String[]> loadColumnMetas(String databaseName) throws SQLException {\n\t\tString sql=\"select utc.*,UCC.comments from user_tab_columns utc\\n\" + \n\t\t\t\t\"left join user_col_comments ucc on UCC.table_name=UTC.table_name and UCC.column_name=UTC.column_name\";\n\t\tMap<String, String[]> ret=new HashMap<>();\n\t\t try(PreparedStatement preparedStatement= connection.prepareStatement(sql);\n\t \t\tResultSet resultSet=preparedStatement.executeQuery();){\n\t\t\twhile(resultSet.next()) {\n\t\t\t\tString tableName=resultSet.getString(\"TABLE_NAME\")\n\t\t\t\t\t\t,columnName=resultSet.getString(\"COLUMN_NAME\")\n\t\t\t\t\t\t,dataLength=resultSet.getString(\"DATA_LENGTH\")\n\t\t ,nullable=resultSet.getString(\"NULLABLE\")\n\t\t ,comments=resultSet.getString(\"COMMENTS\")\n\t\t\t\t\t\t;\n\t\t\t\tString key=tableName+\":\"+columnName;\n\t\t\t\tret.put(key, new String[] {dataLength,nullable,comments});\n\t\t\t\t\n\t\t\t}\n\t }\n\t\t\n\t\treturn ret;\n\t}", "public String getName(){\n\t\t\treturn columnName;\n\t\t}", "private Object getDataSetData(MapDataSet dataSet, DataSetColumn column) {\n \t\tif (dataSet.getRowMap().containsKey(new Integer(0))) {\n \t\t\treturn dataSet.getColumnValue(0, column.getName());\n \t\t}\n \t\telse {\n \t\t\treturn dataSet.getData(column);\n \t\t}\n \t}", "protected String getByColumn(boolean all, String table_name, String column_name, String name)\n\t{\n\t\tStatement statement = null;\n\t\tResultSet rs = null;\n\t\tString result = \"\";\n\t\tif(!table_name.equals(\"\"))\n\t\t{\n\t\t\t// initializing the query statement\n\t\t\ttry {statement = connection.createStatement();} \n\t\t\tcatch (SQLException e) {}\n\t\t\t\n\t\t\t\t\t\n\t\t\t// executing query to database\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tif(all) // Check if we need to get all the data on this column\n\t\t\t\t{\n\t\t\t\t\trs = statement.executeQuery(\"SELECT \" + column_name + \" FROM \" + table_name + \"\");\n\t\t\t\t\twhile(rs.next()) result = rs.getString(column_name);\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trs = statement.executeQuery(\"SELECT \" + column_name + \" FROM \" + table_name + \" WHERE name = \\\"\" + name + \"\\\"\");\n\t\t\t\t\twhile(rs.next()) result = rs.getString(column_name); // Putting the data in result variable to be return\n\t\t\t\t}\n\n\t\t\t} catch (SQLException e) {e.printStackTrace();}\n\t\t}\n\n\t\treturn result;\n\t}", "public Date getDate(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getDate\", columnName);\n return get(columnName).getDate();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "Table setColumn(int index, String name);", "public String getString(String columnName) throws SQLException\n {\n return m_rs.getString(columnName);\n }", "int getColumnIndex (String columnName);", "Column[] getColumns() { return columns; }", "public DBColumn getColumn(String p_colName)\n\t{\n\t\treturn _RowData.get(p_colName);\n\t}", "@Override\n public String getColumnName(int column) {\n return columnNames[column];\n }", "@Override\n public String getColumnName(int column) {\n return columnNames[column];\n }", "@Override\n public DatabaseQueryColumn clone() {\n return new DatabaseQueryColumn(this.formula, this.name);\n }", "public DataFrame saveTable(String tableName){\n input = instance.getSqlContext().read()\n .format(\"com.databricks.spark.csv\")\n .option(\"header\",\"true\")\n .option(\"inferSchema\",\"true\")\n .load(crimeFilePath);\n\n //create temp table for get unique format\n String tmptbl=tableName+\"_temp\";\n input.registerTempTable(tmptbl);\n\n List<String> list=getUserRevisedColumns();\n String exp=\"\";\n\n for(int i=0;i<list.size();i++){\n if(i!=0) {\n exp = exp + \",\"+list.get(i);\n }else {\n exp = list.get(0);\n }\n }\n input=instance.getSqlContext().sql(\"Select \"+exp+\" from \"+tmptbl);\n\n List<CrimeDataBean> crimeDataBeanList = input.javaRDD().map(new Function<Row, CrimeDataBean>() {\n public CrimeDataBean call(Row row) {\n\n CrimeDataBean crimeDataBean=new CrimeDataBean(\"\"+row.getAs(datesCol),row.getAs(categoryCol),row.getAs(dayOfWeekCol),row.getAs(pdDistrictCol),row.getAs(resolution),row.getAs(latitudeCol),row.getAs(longitudeCol));\n return crimeDataBean;\n }\n }).collect();\n\n\n input=instance.getSqlContext().createDataFrame(crimeDataBeanList,CrimeDataBean.class);\n input.show(50);\n\n input.registerTempTable(tableName);\n //set table name for further use\n initailtableName=tableName;\n //drop registed tmp table\n instance.getSqlContext().dropTempTable(tmptbl);\n cache_data(1);\n return input;\n }", "public Map<String, ColumnMetaData> getColumns();", "public Reader getNCharacterStream(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getNCharacterStream\", columnName);\n return get(columnName).getReader();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public String getColumnName(int columnIndex){\n return COLUMN_NAMES[columnIndex];\n }", "@FromString\n public static ColumnName of(String name) {\n return new ColumnName(name);\n }", "protected ValidationComponent createColumnExistenceComponent (\n\t\tfinal String columnName)\n\t{\n\t\treturn createColumnExistenceComponent(columnName, null);\n\t}", "ColumnFull createColumnFull();", "List<String> getColumns();", "DataFrameContent<R,C> data();", "public ResultSet getFactory(){\n ResultSet rs = null;\r\n try {\r\n rs = conn.getResultSetF();\r\n ResultSetMetaData rsmetadata = rs.getMetaData();\r\n int column = rsmetadata.getColumnCount();\r\n // String[] factoryString = null;\r\n\r\n for(int i=1; i<=column; i++){\r\n data_raws.add(rsmetadata.getColumnName(i));\r\n }\r\n //dtm.setColumnIdentifiers(columns_name);\r\n\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ApplicationData.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n return rs;\r\n }", "public String getColumnName() {\r\n return navBinder.getColumnName();\r\n }", "public boolean addColumn(String columnName, DataType valueType) {\n boolean added = false;\n\n if (!columns.containsKey(columnName)) {\n\n columns.put(columnName, valueType);\n added = true;\n }\n\n return added;\n }", "Column getColumnForAttribute(String name) {\n name = Strings.underscore(name);\n for (Column column : getColumns()) {\n if (column.getName().equals(name)) return column;\n }\n return null;\n }", "@Override\r\n\tpublic Object getObject(int row, String columnName) throws java.sql.SQLException {\r\n\t\tint colNumber = getColumnNumber(columnName);\r\n\t\tif (colNumber > 0)\r\n\t\t\treturn this.getObject(row, colNumber);\r\n\t\telse\r\n\t\t\treturn \"&nbsp;\";\r\n\t}", "java.lang.String getSourceColumnName();", "public Reader getCharacterStream(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getCharacterStream\", columnName);\n return get(columnName).getReader();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n public String getColumnName(int column) {\n return colName[column];\n }", "public List<?> getList(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "public Column[] getColumns() {return columns;}", "Object getColumnValue(int colIndex);", "public boolean getBoolean(String columnName) throws SQLException\n {\n return m_rs.getBoolean(columnName);\n }", "public boolean addColumn(String columnName, ArrayList<String> columnValues) {\r\n\t\tif(columnValues.size() != this.df.size()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(this.columnMapping.containsKey(columnName)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tint nsize = this.fieldNames.length;\r\n\t\tthis.columnMapping.put(columnName, nsize);\r\n\t\tString[] newFieldNames = new String[nsize+1];\r\n\t\tfor(int i = 0; i < this.fieldNames.length; i++) {\r\n\t\t\tnewFieldNames[i] = this.fieldNames[i];\r\n\t\t}\r\n\t\tnewFieldNames[nsize] = columnName;\r\n\t\tthis.fieldNames = newFieldNames;\r\n\t\t\r\n\t\tfor(int i = 0; i < this.nrow(); i++) {\r\n\t\t\tString[] newRow = new String[nsize+1];\r\n\t\t\tfor(int k = 0; k < this.get(i).length; k++) {\r\n\t\t\t\tnewRow[k] = this.get(i, k);\r\n\t\t\t}\r\n\t\t\tnewRow[nsize] = columnValues.get(i);\r\n\t\t\tthis.df.set(i, newRow);\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public int findColumn(final String columnName) {\n for (int index = 0; index < _columns.size(); index++) {\n if (_columns.get(index).compareTo(columnName) == 0) {\n return index;\n }\n }\n return -1;\n }", "public RawGetRecordsByColumnResponse getRecordsByColumnRaw(GetRecordsByColumnRequest request) throws GPUdbException {\n RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse();\n submitRequest(\"/get/records/bycolumn\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Dataset withName(String name) {\n setName(name);\n return this;\n }", "public String fetchData(String tableName, int id, String columnName) throws SQLException {\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Id of the Products is \" + id);\n\n\t\t\tSystem.out.println(\"select \" + columnName + \" from \" + tableName + \" where \"\n\t\t\t\t\t+ getPrimaryKeyColumnName(tableName) + \" = \" + id);\n\n\t\t\trs = stmt.executeQuery(\"select \" + columnName + \" from \" + tableName + \" where \"\n\t\t\t\t\t+ getPrimaryKeyColumnName(tableName) + \" = \" + id);\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tSystem.out.println(rs.getString(1));\n\t\t\t\treturn rs.getString(1);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Sorry! wrong Input\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn rs.getString(1);\n\t}", "public List<String> getColumns();", "private static String [] getColumnName(){\r\n\t\tString [] columnNames = { DBSAResourceBundle.res.getString(\"no\"), DBSAResourceBundle.res.getString(\"title\"), \r\n\t\t\t\tDBSAResourceBundle.res.getString(\"authors\"), DBSAResourceBundle.res.getString(\"link\"),\r\n\t\t\t\tDBSAResourceBundle.res.getString(\"year\"),DBSAResourceBundle.res.getString(\"abstract\"), \r\n\t\t\t\tDBSAResourceBundle.res.getString(\"publisher\"),(\"X\"), \r\n\t\t\t\t(\"duplicate\"), \"id\"};\r\n\t\t\t\r\n\t\treturn columnNames;\r\n\t}", "public List<?> getMap(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "public Builder setColumn(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n column_ = value;\n onChanged();\n return this;\n }" ]
[ "0.597303", "0.5867559", "0.5864804", "0.5804989", "0.57675403", "0.57666576", "0.5690055", "0.5671139", "0.5671133", "0.5662886", "0.5576736", "0.54621214", "0.5457063", "0.5398153", "0.53795195", "0.53718257", "0.53629076", "0.53543997", "0.52988034", "0.5283229", "0.5172714", "0.5130278", "0.5101171", "0.50621575", "0.5038222", "0.50081295", "0.50081295", "0.49935552", "0.49908003", "0.49793178", "0.49775335", "0.49735874", "0.49531633", "0.49350217", "0.49338865", "0.49263942", "0.49263942", "0.49143535", "0.49096322", "0.49082643", "0.4895538", "0.48815092", "0.48787582", "0.48766512", "0.4875141", "0.4855755", "0.48525643", "0.48507044", "0.48008052", "0.47988278", "0.47982055", "0.47776526", "0.4775442", "0.47531402", "0.47202742", "0.47197846", "0.47031558", "0.46943378", "0.46912912", "0.46838868", "0.46837458", "0.46825796", "0.46741813", "0.46703437", "0.46647212", "0.4660484", "0.46594083", "0.46563518", "0.46532398", "0.46532398", "0.46292278", "0.46286127", "0.46252108", "0.4620967", "0.46200982", "0.4619895", "0.46184665", "0.46141645", "0.46110982", "0.4598771", "0.45943502", "0.45921266", "0.45845833", "0.4584506", "0.45817795", "0.45747238", "0.45721772", "0.45646292", "0.45604104", "0.45569286", "0.45555353", "0.45498297", "0.45446905", "0.45441705", "0.45340514", "0.45313117", "0.45309272", "0.45271248", "0.4521493", "0.45192897", "0.45179287" ]
0.0
-1
Returns the same data frame with the column "columnName"
@SuppressWarnings("unchecked") public synchronized <X extends RPrimitive,Y extends RPrimitive> RDataframe mutate(String columnName, Function<X,Y> mapping) { try { RVector<X> tmp = (RVector<X>) this.get(columnName); List<Y> tmp2 = tmp.stream().map(mapping).collect(Collectors.toList()); RVector<Y> tmp3 = (RVector<Y>) RVector.empty(tmp2.get(0).getClass()); tmp2.forEach(tmp3::add); this.replace(columnName, tmp3); } catch (ClassCastException e) { throw new IncompatibleTypeException("The column type is not compatible with the function class"); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Column getColumn(String columnName);", "SqlColumns(String columnName){\n\t\t\t this.columnName = columnName; \n\t\t}", "public void setColumnName(String columnName) {\n this.columnName = columnName;\n }", "public void setColumnName(String columnName)\n {\n this.columnName = columnName;\n }", "public void setColumnName(String columnName);", "String getColumnName();", "public void setColumnName(java.lang.String columnName) {\r\n this.columnName = columnName;\r\n }", "public String getColumnName() {\n return columnName; \n }", "public String getColumnName();", "public void setColumnName (String ColumnName);", "public String getColumnName() {\n return this.columnName;\n }", "public DataFrame copy() {\n return new DataFrame(data.values, header.values, index.values);\n }", "public Object getStruct(String columnName) {\n StructVector vector = (StructVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "public void createColumn(String columnName){\n addColumnBtn.click();\n wait.until(ExpectedConditions.visibilityOf(columnNameLbl));\n columnNameLbl.click();\n columnNameInput.sendKeys(columnName);\n columnNameInput.sendKeys(Keys.ENTER);\n }", "public void setColumnName(String columnName) {\r\n dataBinder.setColumnName(columnName);\r\n }", "public Object getObject(String columnName) throws SQLException\n {\n return m_rs.getObject(columnName);\n }", "private static TextColumnBuilder getColumnByNameField(String nameField){ \n return drColumns.get(nameField);\n }", "public RColumn getRColumn (String columnName)\n\t{\n\t\tif (columnName == null)\n\t\t\treturn null;\n\t\tfor (RColumn col : m_data.cols) {\n\t\t\tif (columnName.equals(col.getColumnName())) {\n\t\t\t\treturn col;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public java.lang.String getColumnName() {\r\n return columnName;\r\n }", "public void setColumnName(String columnName) {\r\n navBinder.setColumnName(columnName);\r\n }", "public Object getResult(ResultSet rs, String columnName) throws SQLException;", "public <T> List<T> queryColumn(String columnName, String sql) throws SQLException {\n return queryColumn(columnName, sql, (Object[])null);\n }", "Column getColumns(int index);", "WebElement getColumnByName(WebElement tableRecord, String columnName);", "public void addColumn(String columnName);", "String getColumn(int index);", "String getColumn(int index);", "DataFrame<R,C> copy();", "public ResultSet getdata(String dataFileName, String columnname, String sheetname, String location) {\r\n\t\tResultSet rs = null;\r\n\t\tString query = \"\";\r\n\t\ttry {\r\n\t\t\tif (dataFileName.isEmpty()) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tconnection = connect(dataFileName);\r\n\t\t\tif (connection == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tstmnt = connection.createStatement();\r\n\t\t\tif (stmnt == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tif (columnname.equalsIgnoreCase(\"ALL\")) {\r\n\t\t\t\tif (location == null || location.equalsIgnoreCase(\"\")) {\r\n\t\t\t\t\tquery = \"select * from [\" + sheetname + \"$];\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tquery = \"select * from [\" + sheetname + \"$] where \" + location + \";\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (location == null || location.equalsIgnoreCase(\"\")) {\r\n\t\t\t\t\tquery = \"select \" + columnname + \" from [\" + sheetname + \"$];\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tquery = \"select \" + columnname + \" from [\" + sheetname + \"$] where \" + location + \";\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\trs = stmnt.executeQuery(query);\r\n\t\t} catch (Exception ex) {\r\n\r\n\t\t\treturn rs;\r\n\t\t}\r\n\r\n\t\treturn rs;\r\n\t}", "ColumnNames createColumnNames();", "public SQLXML getSQLXML(String columnName) throws SQLException {\n\n throw Message.getUnsupportedException();\n }", "public <T> List<T> queryColumn(String columnName, String sql, Object... params) throws SQLException {\n logger.debug(\"SQL= \\n\" + sql);\n // Print the parameters to the logger.\n printParams(params);\n ResultSetHandler<List<T>> h = new ColumnListHandler<T>(columnName);\n return qr.query(conn, sql, h, params);\n }", "Column createColumn();", "java.lang.String getColumn();", "public TableCell get(String columnName) {\n if (ownerTable == null) {\n throw new IllegalStateException(\n \"This table row does not belong to a table. Use \" +\n \"get(int) instead.\");\n }\n \n Integer columnIndex = \n ownerTable.tableColumnNameIndexMap.get(columnName);\n \n if (columnIndex == null) {\n throw new IllegalArgumentException(\"\\\"\" +\n columnName + \"\\\": no such column.\");\n }\n \n return tableCellList.get(columnIndex);\n }", "Column(String column) {\n this.column = column;\n }", "Column(String column) {\n this.column = column;\n }", "public String getCertainColumn(ResultSet rs, String columnName) throws SQLException\n {\n String result=\"\";\n while (rs.next())\n {\n\n String temp = rs.getString(columnName);\n result+=\"<p>\"+temp+\"</p>\";\n }\n return result;\n }", "static DataFrameRead read() {\n return DataFrameFactory.getInstance().read();\n }", "public static Dataset<Row> getDataset(String... columnNames) throws IOException {\n\t\t// form query URL\n\t\tString query = CURRENT_URL + columNamesString(columnNames);\n\n\t\t// run tabular report query\n\t\tInputStream input = postQuery(query);\n\n\t\t// save as a temporary CSV file\n\t\tPath tempFile = saveTempFile(input);\n\n\t\tSparkSession spark = SparkSession.builder().getOrCreate();\n\n\t\t// load temporary CSV file into Spark dataset\n\t\tDataset<Row> dataset = readCsv(spark, tempFile.toString());\n\n\t\treturn concatIds(spark, dataset, columnNames);\n\t}", "public PgColumn getColumn(final String name) {\n PgColumn column = null;\n \n for (PgColumn curColumn : columns) {\n if (curColumn.getName().equals(name)) {\n column = curColumn;\n \n break;\n }\n }\n \n return column;\n }", "public DataFrame getSubset(String[] columns) {\n\n // get the indices matching the columns\n int[] c = this.header.getIndices(columns);\n\n Object[][] data = new Object[this.data.rows][c.length];\n Object[] idx = new Object[this.data.rows];\n String[] hdr = new String[c.length];\n\n int rr = 0;\n int cc;\n for (int row = 0; row < this.data.rows; row++) {\n cc = 0;\n for (int col : c) {\n data[rr][cc] = this.data.values[col][row];\n idx[rr] = this.index.values[row];\n hdr[cc] = this.header.values[col];\n cc++;\n }\n rr++;\n }\n\n return new DataFrame(data, hdr, idx, \"SubSet of \" + name);\n }", "public Object getObject(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getObject\", columnName);\n Value v = get(columnName);\n return conn.convertToDefaultObject(v);\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n public String getColumnName(int column) { return columnnames[column]; }", "public ResultSet getCertainRow(String itemname, String tableName, String columnName)\n {\n\n String selectStr;\n ResultSet rs=null;\n String itemn=\"%\"+itemname+\"%\";\n\n try{\n\n selectStr=\"SELECT * FROM \"+tableName+\" WHERE \"+ columnName+\" LIKE \"+quotate(itemn);\n rs = stmt.executeQuery(selectStr);\n\n\n\n\n\n }catch(Exception e){\n System.out.println(\"Error occurred in searchLogin\");\n }\n\n return rs;\n }", "public String getName() {\n return columnName;\n }", "public String getColumnName() {\r\n return dataBinder.getColumnName();\r\n }", "public ResultSet selectData(String sql) throws java.sql.SQLException {\n\t\treturn selectData(sql, -1);\n\t}", "DataFrameColumns<R,C> cols();", "@Override\n @Nullable\n public Column findColumn(String name)\n {\n if (columnCache.containsKey(name)) {\n return columnCache.get(name);\n } else {\n final Column column = rac.findColumn(name);\n if (column == null) {\n columnCache.put(name, null);\n return null;\n }\n\n final ColumnAccessor accessor = column.toAccessor();\n return new ColumnAccessorBasedColumn(\n new ColumnAccessor()\n {\n @Override\n public ColumnType getType()\n {\n return accessor.getType();\n }\n\n @Override\n public int numRows()\n {\n return end - start;\n }\n\n @Override\n public boolean isNull(int rowNum)\n {\n return accessor.isNull(pointers[start + rowNum]);\n }\n\n @Nullable\n @Override\n public Object getObject(int rowNum)\n {\n return accessor.getObject(pointers[start + rowNum]);\n }\n\n @Override\n public double getDouble(int rowNum)\n {\n return accessor.getDouble(pointers[start + rowNum]);\n }\n\n @Override\n public float getFloat(int rowNum)\n {\n return accessor.getFloat(pointers[start + rowNum]);\n }\n\n @Override\n public long getLong(int rowNum)\n {\n return accessor.getLong(pointers[start + rowNum]);\n }\n\n @Override\n public int getInt(int rowNum)\n {\n return accessor.getInt(pointers[start + rowNum]);\n }\n\n @Override\n public int compareRows(int lhsRowNum, int rhsRowNum)\n {\n return accessor.compareRows(pointers[lhsRowNum], pointers[start + rhsRowNum]);\n }\n }\n );\n }\n }", "protected abstract String getFavoriteColumnName();", "public java.sql.Date getDate(String columnName) throws SQLException\n {\n return m_rs.getDate(columnName);\n }", "public List<Column> getColumns();", "public SqlWindow createCurrentRowWindow(final String columnName) {\n return SqlWindow.create(\n null,\n null,\n new SqlNodeList(SqlParserPos.ZERO),\n new SqlNodeList(\n ImmutableList.of(\n new SqlIdentifier(columnName, SqlParserPos.ZERO)),\n SqlParserPos.ZERO),\n SqlLiteral.createBoolean(true, SqlParserPos.ZERO),\n SqlWindow.createCurrentRow(SqlParserPos.ZERO),\n SqlWindow.createCurrentRow(SqlParserPos.ZERO),\n SqlLiteral.createBoolean(true, SqlParserPos.ZERO),\n SqlParserPos.ZERO);\n }", "public DatabaseQueryColumn(String name) {\n this.formula = null;\n this.name = name;\n }", "String getColumn();", "public DataColumn getCol(String colName) {\n\t\tif (containsColumn(colName)) {\n\t\t\treturn dc.get(colName);\n\t\t}\n\t\treturn null;\n\t}", "public abstract T getEntityByColumnName(String columnName, String value);", "@Override\n\tpublic Map<String, String[]> loadColumnMetas(String databaseName) throws SQLException {\n\t\tString sql=\"select utc.*,UCC.comments from user_tab_columns utc\\n\" + \n\t\t\t\t\"left join user_col_comments ucc on UCC.table_name=UTC.table_name and UCC.column_name=UTC.column_name\";\n\t\tMap<String, String[]> ret=new HashMap<>();\n\t\t try(PreparedStatement preparedStatement= connection.prepareStatement(sql);\n\t \t\tResultSet resultSet=preparedStatement.executeQuery();){\n\t\t\twhile(resultSet.next()) {\n\t\t\t\tString tableName=resultSet.getString(\"TABLE_NAME\")\n\t\t\t\t\t\t,columnName=resultSet.getString(\"COLUMN_NAME\")\n\t\t\t\t\t\t,dataLength=resultSet.getString(\"DATA_LENGTH\")\n\t\t ,nullable=resultSet.getString(\"NULLABLE\")\n\t\t ,comments=resultSet.getString(\"COMMENTS\")\n\t\t\t\t\t\t;\n\t\t\t\tString key=tableName+\":\"+columnName;\n\t\t\t\tret.put(key, new String[] {dataLength,nullable,comments});\n\t\t\t\t\n\t\t\t}\n\t }\n\t\t\n\t\treturn ret;\n\t}", "public String getName(){\n\t\t\treturn columnName;\n\t\t}", "private Object getDataSetData(MapDataSet dataSet, DataSetColumn column) {\n \t\tif (dataSet.getRowMap().containsKey(new Integer(0))) {\n \t\t\treturn dataSet.getColumnValue(0, column.getName());\n \t\t}\n \t\telse {\n \t\t\treturn dataSet.getData(column);\n \t\t}\n \t}", "protected String getByColumn(boolean all, String table_name, String column_name, String name)\n\t{\n\t\tStatement statement = null;\n\t\tResultSet rs = null;\n\t\tString result = \"\";\n\t\tif(!table_name.equals(\"\"))\n\t\t{\n\t\t\t// initializing the query statement\n\t\t\ttry {statement = connection.createStatement();} \n\t\t\tcatch (SQLException e) {}\n\t\t\t\n\t\t\t\t\t\n\t\t\t// executing query to database\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tif(all) // Check if we need to get all the data on this column\n\t\t\t\t{\n\t\t\t\t\trs = statement.executeQuery(\"SELECT \" + column_name + \" FROM \" + table_name + \"\");\n\t\t\t\t\twhile(rs.next()) result = rs.getString(column_name);\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trs = statement.executeQuery(\"SELECT \" + column_name + \" FROM \" + table_name + \" WHERE name = \\\"\" + name + \"\\\"\");\n\t\t\t\t\twhile(rs.next()) result = rs.getString(column_name); // Putting the data in result variable to be return\n\t\t\t\t}\n\n\t\t\t} catch (SQLException e) {e.printStackTrace();}\n\t\t}\n\n\t\treturn result;\n\t}", "public Date getDate(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getDate\", columnName);\n return get(columnName).getDate();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "Table setColumn(int index, String name);", "public String getString(String columnName) throws SQLException\n {\n return m_rs.getString(columnName);\n }", "int getColumnIndex (String columnName);", "Column[] getColumns() { return columns; }", "public DBColumn getColumn(String p_colName)\n\t{\n\t\treturn _RowData.get(p_colName);\n\t}", "@Override\n public String getColumnName(int column) {\n return columnNames[column];\n }", "@Override\n public String getColumnName(int column) {\n return columnNames[column];\n }", "@Override\n public DatabaseQueryColumn clone() {\n return new DatabaseQueryColumn(this.formula, this.name);\n }", "public DataFrame saveTable(String tableName){\n input = instance.getSqlContext().read()\n .format(\"com.databricks.spark.csv\")\n .option(\"header\",\"true\")\n .option(\"inferSchema\",\"true\")\n .load(crimeFilePath);\n\n //create temp table for get unique format\n String tmptbl=tableName+\"_temp\";\n input.registerTempTable(tmptbl);\n\n List<String> list=getUserRevisedColumns();\n String exp=\"\";\n\n for(int i=0;i<list.size();i++){\n if(i!=0) {\n exp = exp + \",\"+list.get(i);\n }else {\n exp = list.get(0);\n }\n }\n input=instance.getSqlContext().sql(\"Select \"+exp+\" from \"+tmptbl);\n\n List<CrimeDataBean> crimeDataBeanList = input.javaRDD().map(new Function<Row, CrimeDataBean>() {\n public CrimeDataBean call(Row row) {\n\n CrimeDataBean crimeDataBean=new CrimeDataBean(\"\"+row.getAs(datesCol),row.getAs(categoryCol),row.getAs(dayOfWeekCol),row.getAs(pdDistrictCol),row.getAs(resolution),row.getAs(latitudeCol),row.getAs(longitudeCol));\n return crimeDataBean;\n }\n }).collect();\n\n\n input=instance.getSqlContext().createDataFrame(crimeDataBeanList,CrimeDataBean.class);\n input.show(50);\n\n input.registerTempTable(tableName);\n //set table name for further use\n initailtableName=tableName;\n //drop registed tmp table\n instance.getSqlContext().dropTempTable(tmptbl);\n cache_data(1);\n return input;\n }", "public Map<String, ColumnMetaData> getColumns();", "public Reader getNCharacterStream(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getNCharacterStream\", columnName);\n return get(columnName).getReader();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public String getColumnName(int columnIndex){\n return COLUMN_NAMES[columnIndex];\n }", "@FromString\n public static ColumnName of(String name) {\n return new ColumnName(name);\n }", "protected ValidationComponent createColumnExistenceComponent (\n\t\tfinal String columnName)\n\t{\n\t\treturn createColumnExistenceComponent(columnName, null);\n\t}", "ColumnFull createColumnFull();", "List<String> getColumns();", "DataFrameContent<R,C> data();", "public ResultSet getFactory(){\n ResultSet rs = null;\r\n try {\r\n rs = conn.getResultSetF();\r\n ResultSetMetaData rsmetadata = rs.getMetaData();\r\n int column = rsmetadata.getColumnCount();\r\n // String[] factoryString = null;\r\n\r\n for(int i=1; i<=column; i++){\r\n data_raws.add(rsmetadata.getColumnName(i));\r\n }\r\n //dtm.setColumnIdentifiers(columns_name);\r\n\r\n } catch (SQLException ex) {\r\n Logger.getLogger(ApplicationData.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n return rs;\r\n }", "public String getColumnName() {\r\n return navBinder.getColumnName();\r\n }", "public boolean addColumn(String columnName, DataType valueType) {\n boolean added = false;\n\n if (!columns.containsKey(columnName)) {\n\n columns.put(columnName, valueType);\n added = true;\n }\n\n return added;\n }", "Column getColumnForAttribute(String name) {\n name = Strings.underscore(name);\n for (Column column : getColumns()) {\n if (column.getName().equals(name)) return column;\n }\n return null;\n }", "@Override\r\n\tpublic Object getObject(int row, String columnName) throws java.sql.SQLException {\r\n\t\tint colNumber = getColumnNumber(columnName);\r\n\t\tif (colNumber > 0)\r\n\t\t\treturn this.getObject(row, colNumber);\r\n\t\telse\r\n\t\t\treturn \"&nbsp;\";\r\n\t}", "java.lang.String getSourceColumnName();", "public Reader getCharacterStream(String columnName) throws SQLException {\n\n try {\n debugCodeCall(\"getCharacterStream\", columnName);\n return get(columnName).getReader();\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n public String getColumnName(int column) {\n return colName[column];\n }", "public List<?> getList(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "public Column[] getColumns() {return columns;}", "Object getColumnValue(int colIndex);", "public boolean getBoolean(String columnName) throws SQLException\n {\n return m_rs.getBoolean(columnName);\n }", "public boolean addColumn(String columnName, ArrayList<String> columnValues) {\r\n\t\tif(columnValues.size() != this.df.size()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(this.columnMapping.containsKey(columnName)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tint nsize = this.fieldNames.length;\r\n\t\tthis.columnMapping.put(columnName, nsize);\r\n\t\tString[] newFieldNames = new String[nsize+1];\r\n\t\tfor(int i = 0; i < this.fieldNames.length; i++) {\r\n\t\t\tnewFieldNames[i] = this.fieldNames[i];\r\n\t\t}\r\n\t\tnewFieldNames[nsize] = columnName;\r\n\t\tthis.fieldNames = newFieldNames;\r\n\t\t\r\n\t\tfor(int i = 0; i < this.nrow(); i++) {\r\n\t\t\tString[] newRow = new String[nsize+1];\r\n\t\t\tfor(int k = 0; k < this.get(i).length; k++) {\r\n\t\t\t\tnewRow[k] = this.get(i, k);\r\n\t\t\t}\r\n\t\t\tnewRow[nsize] = columnValues.get(i);\r\n\t\t\tthis.df.set(i, newRow);\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public int findColumn(final String columnName) {\n for (int index = 0; index < _columns.size(); index++) {\n if (_columns.get(index).compareTo(columnName) == 0) {\n return index;\n }\n }\n return -1;\n }", "public RawGetRecordsByColumnResponse getRecordsByColumnRaw(GetRecordsByColumnRequest request) throws GPUdbException {\n RawGetRecordsByColumnResponse actualResponse_ = new RawGetRecordsByColumnResponse();\n submitRequest(\"/get/records/bycolumn\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Dataset withName(String name) {\n setName(name);\n return this;\n }", "public String fetchData(String tableName, int id, String columnName) throws SQLException {\n\n\t\ttry {\n\t\t\tSystem.out.println(\"Id of the Products is \" + id);\n\n\t\t\tSystem.out.println(\"select \" + columnName + \" from \" + tableName + \" where \"\n\t\t\t\t\t+ getPrimaryKeyColumnName(tableName) + \" = \" + id);\n\n\t\t\trs = stmt.executeQuery(\"select \" + columnName + \" from \" + tableName + \" where \"\n\t\t\t\t\t+ getPrimaryKeyColumnName(tableName) + \" = \" + id);\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tSystem.out.println(rs.getString(1));\n\t\t\t\treturn rs.getString(1);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Sorry! wrong Input\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn rs.getString(1);\n\t}", "public List<String> getColumns();", "private static String [] getColumnName(){\r\n\t\tString [] columnNames = { DBSAResourceBundle.res.getString(\"no\"), DBSAResourceBundle.res.getString(\"title\"), \r\n\t\t\t\tDBSAResourceBundle.res.getString(\"authors\"), DBSAResourceBundle.res.getString(\"link\"),\r\n\t\t\t\tDBSAResourceBundle.res.getString(\"year\"),DBSAResourceBundle.res.getString(\"abstract\"), \r\n\t\t\t\tDBSAResourceBundle.res.getString(\"publisher\"),(\"X\"), \r\n\t\t\t\t(\"duplicate\"), \"id\"};\r\n\t\t\t\r\n\t\treturn columnNames;\r\n\t}", "public List<?> getMap(String columnName) {\n ListVector vector = (ListVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }", "public Builder setColumn(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n column_ = value;\n onChanged();\n return this;\n }" ]
[ "0.597303", "0.5867559", "0.5864804", "0.5804989", "0.57675403", "0.57666576", "0.5690055", "0.5671139", "0.5671133", "0.5662886", "0.5576736", "0.54621214", "0.5457063", "0.5398153", "0.53795195", "0.53718257", "0.53629076", "0.53543997", "0.52988034", "0.5283229", "0.5172714", "0.5130278", "0.5101171", "0.50621575", "0.5038222", "0.50081295", "0.50081295", "0.49935552", "0.49908003", "0.49793178", "0.49775335", "0.49735874", "0.49531633", "0.49350217", "0.49338865", "0.49263942", "0.49263942", "0.49143535", "0.49096322", "0.49082643", "0.4895538", "0.48815092", "0.48787582", "0.48766512", "0.4875141", "0.4855755", "0.48525643", "0.48507044", "0.48008052", "0.47988278", "0.47982055", "0.47776526", "0.4775442", "0.47531402", "0.47202742", "0.47197846", "0.47031558", "0.46943378", "0.46912912", "0.46838868", "0.46837458", "0.46825796", "0.46741813", "0.46703437", "0.46647212", "0.4660484", "0.46594083", "0.46563518", "0.46532398", "0.46532398", "0.46292278", "0.46286127", "0.46252108", "0.4620967", "0.46200982", "0.4619895", "0.46184665", "0.46141645", "0.46110982", "0.4598771", "0.45943502", "0.45921266", "0.45845833", "0.4584506", "0.45817795", "0.45747238", "0.45721772", "0.45646292", "0.45604104", "0.45569286", "0.45555353", "0.45498297", "0.45446905", "0.45441705", "0.45340514", "0.45313117", "0.45309272", "0.45271248", "0.4521493", "0.45192897", "0.45179287" ]
0.0
-1
Find the nearest node
private SkipNode<K, V> findNode(Object key) { SkipNode<K, V> nodeOut; nodeOut = headNode; while (true) { while ((nodeOut.getNext().getKey()) != posInf && (nodeOut.getNext().getKey()).compareTo((Integer) key) <= 0) nodeOut = nodeOut.getNext(); if (nodeOut.getDown() != null) nodeOut = nodeOut.getDown(); else break; } return nodeOut; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getNearestNode(LatLng vic) {\n\t\tint node = 0;\n\t\tfor(int j=0; j<nodeList.size()-1; j++){\n\t\t\tdouble dist1 = getWeight(vic, nodeList.get(node));\n\t\t\tdouble dist2 = getWeight(vic, nodeList.get(j));\n\t\t\tif(dist1 > dist2){\n\t\t\t\tnode = j;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}", "public final Node getNearestNode(Point p) {\n double minDistanceSq = Double.MAX_VALUE;\n Node minPrimitive = null;\n for (Node n : getData().nodes) {\n if (n.deleted || n.incomplete)\n continue;\n Point sp = getPoint(n.eastNorth);\n double dist = p.distanceSq(sp);\n if (minDistanceSq > dist && dist < snapDistance) {\n minDistanceSq = p.distanceSq(sp);\n minPrimitive = n;\n }\n // prefer already selected node when multiple nodes on one point\n else if(minDistanceSq == dist && n.selected && !minPrimitive.selected)\n {\n minPrimitive = n;\n }\n }\n return minPrimitive;\n }", "public Node closestPrecedingNode(int id);", "public Node getClosest(int x, int y)\n {\n if(NodeList.isEmpty()) return null;\n\n\n double distance = 0;\n //big fat pixel number... Stupidest way to initializa that value, but it's working flawlessly so...\n double reference = 1000000000;\n Node closest = null;\n\n //for each Node in NodeList\n for(Node myNode : NodeList)\n {\n\n //calculate distance\n distance = getDistance(myNode,x,y);\n //System.out.println(\"distance : \" + distance);\n\n if(distance < reference)\n {\n closest = myNode;\n reference = distance;\n }\n }\n\n return closest;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) {\n return null;\n }\n\n Node nearestNode = new Node(root.point, true);\n nearestNode.left = root.left;\n nearestNode.right = root.right;\n nearest(root, nearestNode, new RectHV(0.0, 0.0, 1.0, 1.0), p);\n return nearestNode.point;\n }", "private Node closestUnvisitedNeighbour(HashMap <Node, Integer > shortestPathMap){\n int shortestDistance = Integer.MAX_VALUE;\n Node closestReachableNode = null;\n for (Node node : getNodes()) {\n if (node.isVisited())\n continue;\n\n int currentDistance = shortestPathMap.get(node);\n if (currentDistance == Integer.MAX_VALUE)\n continue;\n\n if (currentDistance < shortestDistance) {\n shortestDistance = currentDistance;\n closestReachableNode = node;\n }\n }\n return closestReachableNode;\n }", "public Node findClosest(int search_key){\n\n Node current, closest; //จำตำแหน่ง node ตอนนี้\n closest = current = root; // เก็บตำแหน่ง node ที่ใกล้ค่าที่หามากสุด\n int min_diff = Integer.MAX_VALUE; // ตัวเปรียบเทียบคสาต่าง\n while (current!= null){ // Use while loop to traverse from root to the closest leaf\n if (search_key == current.key){ //ถ้าเจอก็ return\n return current;\n }\n else{\n if(Math.abs(current.key - search_key) < min_diff){ //หาค่าความต่าง ถ้าอันใหม่ต่างน้อยกว่า แสดงว่าใกล้กว่า\n min_diff = Math.abs(current.key - search_key);\n closest = current;\n }\n\n }\n\n if(search_key < current.key) // กำหยดว่าจะลงไปในทิศทางไหนของ subtree\n {current = current.left;}\n else{current = current.right;}\n }\n\n\n\n return closest;\n }", "public GPSNode getClosestNodeOnRoad(double lat, double lon) {\n\tGPSNode closest = null;\n\tdouble min = Double.MAX_VALUE;\n\t\n\tSet<String> wayList = ways.keySet();\n\tfor(String str : wayList) {\n\t Way way = ways.get(str);\n\t if(way != null && way.canDrive()) {\n\t\tArrayList<String> refs = way.getRefs();\n\t\tif(refs != null && refs.size() > 0) {\n\t\t for(String ref: refs) {\n\t\t\tGPSNode node = (GPSNode) getNode(ref);\n\t\t\t\n\t\t\tif(node == null)\n\t\t\t continue;\n\t\t\t\n\t\t\tdouble nodeLat = node.getLatitude();\n\t\t\tdouble nodeLon = node.getLongitude();\n\t\t\t \n\t\t\tdouble dist = calcDistance(lat, lon, nodeLat, nodeLon);\n\t\t\t \n\t\t\tif(dist < min) {\n\t\t\t min = dist;\n\t\t\t closest = node;\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n\t\n\treturn closest;\n }", "public Node getNearestNode(Point mousePos,\n\t\t\tPredicate<OsmPrimitive> isSelectablePredicate) {\n\t\treturn null;\n\t}", "public Id GetNearestNode(Coordinate coord, int cz){\n\t\tfloat distsq = Float.MAX_VALUE;\n\t\tfloat cx = coord.getX();\n\t\tfloat cy = coord.getY();\n\t\tId nearest = null;\n\t\tfor(Node n : listOfNodes){\n\t\t\tif(n == null) continue;\n\t\t\tfloat mx = n.getCoordinate().getX() - cx;\n\t\t\tfloat my = n.getCoordinate().getY() - cy;\n\t\t\tfloat mz = n.getCoordinate().getZ() - cz;\n\t\t\tfloat mydistsq = mx * mx + my * my;\n\t\t\tif(mydistsq < distsq && mz == 0){\n\t\t\t\tdistsq = mydistsq;\n\t\t\t\tnearest = n.getId();\n\t\t\t}\n\t\t}\n\t\treturn nearest;\n\t}", "public ReferenceNode searchMatchNode(Set<String> data) {\n // Try the first first\n ReferenceNode node = nodeList.get(0);\n double similarity = node.calculateSimilarity(data);\n ReferenceNode winningNode = node;\n double newSim = 0.0;\n for (int i = 1; i < nodeList.size(); i++) {\n node = nodeList.get(i);\n newSim = node.calculateSimilarity(data);\n if (newSim > similarity) {\n winningNode = node;\n similarity = newSim;\n }\n if (newSim == 1.0d)\n break; // The highest\n }\n if (similarity == 0.0d) {\n // Try to find an empty node. Otherwise, pathways will be grouped in the\n // first node\n for (ReferenceNode tmp : nodeList) {\n if (tmp.isEmpty()) {\n winningNode = tmp;\n break;\n }\n }\n }\n return winningNode;\n }", "public NavNode getClosestNodeByCenterPosition(Point2D location){\n int i = (int) (location.getX() /eachDisY); // 16.0 means the value of tanks 1/2 width and height\n int j = (int) (location.getY() / eachDisX);\n int c = j*rowNums + i;\n NavNode n1 = (NavNode)this.nodeVector.get(c);\n return n1;\n }", "public Point nearestNeighbor(Point p) {\n\t\tif (p == null) {\n System.out.println(\"Point is null\");\n }\n if (isEmpty()) {\n return null;\n }\n\n return nearest(head, p, head).item;\n\t}", "public OsmPrimitive getNearest(Point p) {\n OsmPrimitive osm = getNearestNode(p);\n if (osm == null)\n {\n osm = getNearestWay(p);\n }\n return osm;\n }", "long closest(double lon, double lat) {\n double smallestDist = Double.MAX_VALUE;\n long smallestId = 0;\n Iterable<Node> v = world.values();\n for (Node n : v) {\n double tempLat = n.getLat();\n double tempLon = n.getLon();\n double tempDist = distance(lon, lat, tempLon, tempLat);\n if (tempDist < smallestDist) {\n smallestDist = tempDist;\n smallestId = n.getId();\n }\n }\n return smallestId;\n }", "public Point2D nearest(Point2D p) \n\t {\n\t\t if(p==null)\n\t\t\t throw new java.lang.NullPointerException();\n\t\t if(root == null)\n\t\t\t return null;\n\t\t RectHV rect = new RectHV(0,0,1,1);\n\t\t return nearest(root,p,root.p,rect,true);\n\t }", "public Point2D nearest(Point2D p)\n {\n if (p != null && !isEmpty())\n {\n Node current = root;\n Node nearest = null;\n while (current != null)\n {\n nearest = current;\n if (current.isVertical()) // compare by x\n {\n if (p.x() < current.getPoint().x())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n else // compare by y\n {\n if (p.y() < current.getPoint().y())\n {\n current = current.getLeft();\n }\n else\n {\n current = current.getRight();\n }\n }\n }\n return nearest.getPoint();\n }\n return null;\n }", "public Node getBestSuccessor(){\n\t\t// Send false to the method to not save the neighbors.\n\t\treturn state.neighborWithlowestAttachNo(false);\n\t}", "public Node selectNode(List<Node> nodes){\n float minCost = Integer.MAX_VALUE;\n Node bestNode = null;\n float costToStart = 0, totalCost = 0;\n\n for(Node n:nodes){\n costToStart = n.getCostEstimated();\n int distance = Math.abs(n.getX()-finish.getX())+Math.abs(n.getY()-finish.getY());\n totalCost = costToStart+distance;\n\n if(minCost>totalCost){\n minCost = totalCost;\n bestNode = n;\n }\n }\n return bestNode;\n }", "public Point2D nearest(Point2D p) {\n return nearestHelper(root, new RectHV(0,0,1,1), p.x(), p.y(), null);\n }", "public Point2D nearest(Point2D p) {\n if (bst.isEmpty()) {\n return null;\n }\n\n Point2D nearest = null;\n double nearestDist = Double.POSITIVE_INFINITY;\n \n \n for (Point2D point: bst.keys()) {\n\n if (nearest == null \n || point != null \n && (nearestDist > point.distanceSquaredTo(p)\n && (!point.equals(p)))) {\n nearest = point;\n nearestDist = point.distanceSquaredTo(p);\n }\n \n }\n return nearest;\n }", "public Point2D nearest(Point2D p) \r\n\t{\r\n\t\treturn nearest(p, null, root, new RectHV(0,0,1,1));\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public Graph<NodeData,EdgeData>.Node findNearbyNode(int x, int y) {\r\n Graph.Node nearbyNode = null;\r\n for (Graph<NodeData,EdgeData>.Node node:canvas.graph.getNode()){\r\n Point p = node.getData().getPosition();\r\n if (p.distance(x,y)<=40){\r\n nearbyNode = node;\r\n }\r\n }\r\n return nearbyNode;\r\n }", "public closest(){\n\t\tthis.pnt = null;\n\t}", "public void insertNearest(Point p) {\n if (size() == 0) {\n first.next = first;\n first.p = p;\n return;\n }\n double distanceBetweenNode;\n double minimumDistance = Double.POSITIVE_INFINITY;\n Node nearestN = null;\n Node n = first;\n do {\n distanceBetweenNode = n.p.distanceTo(p);\n if (distanceBetweenNode < minimumDistance) {\n nearestN = n;\n minimumDistance = distanceBetweenNode;\n }\n n = n.next;\n } while (!n.equals(first));\n Node newNode = new Node();\n newNode.p = p;\n newNode.next = nearestN.next;\n nearestN.next = newNode;\n }", "public GraphNode getGraphNode(FloorPoint loc){\n\n\n List<GraphNode> sameFloor = getGraphNodesOnFloor(loc.getFloor());\n if(sameFloor.isEmpty()) {\n return null;\n }\n // get the closest point to the node\n GraphNode closestNode = sameFloor.get(0);\n double minDistance = closestNode.getLocation().distance(loc);\n\n // find the minimum distance on the same floor\n for (int i = 0 ; i < sameFloor.size(); i++) {\n GraphNode currentNode = sameFloor.get(i);\n double currentDistance = currentNode.getLocation().distance(loc);\n if(currentDistance < minDistance){\n minDistance = currentDistance;\n closestNode = currentNode;\n }\n }\n return closestNode;\n }", "public Point2D nearest(Point2D p) {\n checkNull(p);\n Node n = nearest(p, root);\n if (n == null) return null;\n return n.p;\n }", "private SearchNode findFirstNode(HashSet<SearchNode> set){\n\t\t\tSearchNode min = null;\n\t\t\tfor (SearchNode cur : set){\n\t\t\t\tif (min == null || cur.fScore < min.fScore)\n\t\t\t\t\tmin = cur;\n\t\t\t}\n\t\t\treturn min;\n\t\t}", "private int nextNode(int rid) {\n if (!my_game.getMy_game().isRunning()) {\n return -1;\n }\n Robot robot = my_game.getRobots().get(rid);\n List<node_data> tmp = robots_paths.get(rid);\n if (tmp.isEmpty()) {\n fruits_status.remove(rid);\n synchronized (my_game.getFruits()) {\n if (my_game.getFruits().size() > 0) {\n Fruit fruit = findClosestFruit(robot);\n tmp = algo_g.shortestPath(robot.getSrc(),fruit.getEdge().getSrc());\n node_data dest = my_game.getGraph().getNode(fruit.getEdge().getDest());\n tmp.add(dest);\n robots_paths.put(robot.getId(),tmp);\n fruits_status.put(rid,fruit);\n }\n }\n }\n\n node_data n = tmp.get(0);\n tmp.remove(0);\n return n.getKey();\n\n\n// for (int i = 0; i < tmp.size(); i++) {\n// node_data n = tmp.get(i);\n// tmp.remove(i);\n// if (n.getKey() == robot.getSrc())\n// continue;\n// return n.getKey();\n// }\n// return -1;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n if (root == null) return null;\n nearest = root.point;\n searchForNearest(root, p, new RectHV(0.0, 0.0, 1.0, 1.0));\n return nearest;\n }", "public Point2D nearest(Point2D p) {\n if (root == null) {\n return null;\n }\n\n currentNearest = root.p;\n currentMinDistance = root.p.distanceTo(p);\n nearest(root, p, ORIENTATION_VERTICAL);\n return currentNearest;\n }", "public NavNode getClosestNodeByPosition(Point2D location,Point2D radius){\n int i = (int) (location.getX() + radius.getX()/2) /eachDisY; // 16.0 means the value of tanks 1/2 width and height\n int j = (int) (location.getY() + radius.getY()/2) / eachDisX;\n int c = j*rowNums + i;\n NavNode n1 = (NavNode)this.nodeVector.get(c);\n return n1;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"p cannot be null\");\n if (isEmpty()) return null;\n Point2D champ = root.p;\n champ = nearest(p, champ, root, inftyBbox);\n return champ;\n }", "Point findNearestActualPoint(Point a, Point b) {\n\t\tPoint left = new Point(a.x-this.delta/3,a.y);\n\t\tPoint right = new Point(a.x+this.delta/3,a.y);\n\t\tPoint down = new Point(a.x,a.y-this.delta/3);\n\t\tPoint up = new Point(a.x,a.y+this.delta/3);\n\t\tPoint a_neighbor = left;\n\t\tif (distance(right,b) < distance(a_neighbor,b)) a_neighbor = right;\n\t\tif (distance(down,b) < distance(a_neighbor,b)) a_neighbor = down;\n\t\tif (distance(up,b) < distance(a_neighbor,b)) a_neighbor = up;\n\n\t\treturn a_neighbor;\n\t}", "private Node findNode(int index){\n Node current = start;\n for(int i = 0; i < index; i++){\n current = current.getNext();\n }\n return current;\n }", "private void findNeighbour(int offset) {\n TreeNodeImpl node = (TreeNodeImpl) projectTree.getLastSelectedPathComponent();\n TreePath parentPath = projectTree.getSelectionPath().getParentPath();\n NodeList list = (NodeList) node.getParent().children();\n\n for (int i = 0; i < list.size(); ++i) {\n if (list.get(i).equals(node)) {\n if (offset > 0 && i < list.size() - offset) {\n projectTree.setSelectionPath(parentPath.pathByAddingChild(list.get(i + offset)));\n break;\n }\n if (offset < 0 && i >= offset) {\n projectTree.setSelectionPath(parentPath.pathByAddingChild(list.get(i + offset)));\n break;\n }\n }\n }\n }", "private ProblemModel findCheapestNode(){\n\t\tProblemModel ret = unvisitedPM.peek();\n\t\t\n\t\tfor(ProblemModel p : unvisitedPM){ \n\t\t\t//f(s) = depth + cost to make this move\n\t\t\tif(p.getCost() + p.getDepth() <= ret.getCost() + ret.getDepth()) ret = p;\n\t\t}\n\t\tunvisitedPM.remove(ret);\n\t\treturn ret;\n\t}", "private Node find(Order ord){\n\t\tNode position=head;\n\t\tOrder ItemPosition;\n\t\twhile (position!=null){\n\t\t\tItemPosition = position.ord;\n\t\t\tif(ItemPosition.equals(ord)) {\n\t\t\t\tposition=bestBid;\n\t\t\t\treturn position;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private KdTreeNode nearestInKDTree(KdTreeNode current, Point goal, KdTreeNode best, int idx) {\n if (current == null) {\n return best;\n }\n\n if (Point.distance(current.point, goal) < Point.distance(best.point, goal)) {\n best = current;\n }\n\n KdTreeNode goodSide = current.right;\n KdTreeNode badSide = current.left;\n if (KdTree.comparePoints(goal, current.point, idx) < 0) {\n goodSide = current.left;\n badSide = current.right;\n }\n int newIdx = idx ^ 1;\n best = this.nearestInKDTree(goodSide, goal, best, newIdx);\n\n double bestPossibleDis = 0;\n if (idx == 0) {\n bestPossibleDis = Math.pow(goal.getX() - current.point.getX(), 2);\n } else {\n bestPossibleDis = Math.pow(goal.getY() - current.point.getY(), 2);\n }\n if (bestPossibleDis < Point.distance(best.point, goal)) {\n best = this.nearestInKDTree(badSide, goal, best, newIdx);\n }\n\n return best;\n }", "public static Node getLowestDistanceNode(Set<Node> unsettledNodes) {\n Node lowestDistanceNode = null;\n int lowestDistance = Integer.MAX_VALUE;\n for (Node node: unsettledNodes) {\n int nodeDistance = node.distance;\n if (nodeDistance < lowestDistance) {\n lowestDistance = nodeDistance;\n lowestDistanceNode = node;\n }\n }\n return lowestDistanceNode;\n }", "private void searchForNearest(KdNode kdNode, Point2D p, RectHV rectangle) {\n int comparison;\n // 2 rectangles that will store the coordinates of the rectangles that are delimited by kdNode's children,\n // used in order to calculate the distance to them and see if it's worth looking down the path inside them as well\n // (i.e. if the distance from point p to the rectangle is less than the distance to an already established nearest)\n RectHV rectLeftBelow, rectRightAbove;\n\n if (kdNode.point.equals(p)) {\n // if the point we're looking at actually equals the query point, we return here,\n // as we can no longer find a distance lower than 0\n nearest = kdNode.point;\n return;\n }\n\n // if the point in the current node is closer to the searched node, we update nearest\n if (p.distanceSquaredTo(kdNode.point) < p.distanceSquaredTo(nearest))\n nearest = kdNode.point;\n\n if (kdNode.dimension) { // if this KdNode is vertical (root.dimension == true), then we have left/right rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n kdNode.point.x(), rectangle.ymax());\n rectRightAbove = new RectHV(kdNode.point.x(), rectangle.ymin(),\n rectangle.xmax(), rectangle.ymax());\n }\n else { // if this KdNode is horizontal (root.dimension == false), then we have below/above rectangles\n rectLeftBelow = new RectHV(rectangle.xmin(), rectangle.ymin(),\n rectangle.xmax(), kdNode.point.y());\n rectRightAbove = new RectHV(rectangle.xmin(), kdNode.point.y(),\n rectangle.xmax(), rectangle.ymax());\n }\n // we look at which rectangle is nearest to the query point, in order to go down that path first\n comparison = Double.compare(rectLeftBelow.distanceSquaredTo(p),\n rectRightAbove.distanceSquaredTo(p));\n\n if (comparison < 0) { // if distance to left/lower rectangle is lower than to right/upper\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n // if it's larger than to nearest, the distance to the other\n // rectangle will certainly be even larger, so we return here\n else return;\n }\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n // else return; // return statement not needed, if (comparison < 0) statement terminates here anyway\n }\n }\n else { // comparison < 0, the opposite situation holds: distance to right/upper rectangle is lower than to left/lower\n if (kdNode.right != null) {\n if (rectRightAbove.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.right, p, rectRightAbove);\n }\n else return;\n }\n if (kdNode.left != null) {\n if (rectLeftBelow.distanceSquaredTo(p) < p.distanceSquaredTo(nearest)) {\n searchForNearest(kdNode.left, p, rectLeftBelow);\n }\n }\n\n }\n }", "public int\ngetNodeIndexMin();", "public Point2D nearest(Point2D p) {\n\t\tif (p == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif (isEmpty()) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tPoint2D result = null;\n\t\t\tresult = nearest(root, p, result);\n\t\t\treturn result;\n\t\t}\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null)\n throw new IllegalArgumentException(\"Input point is null\");\n if (root == null)\n return null;\n findNearP = p;\n double dist = findNearP.distanceSquaredTo(root.point);\n RectHV rect = new RectHV(0, 0, 1, 1);\n PointDist res = findNearest(root, rect, new PointDist(root.point, dist), true);\n return res.point;\n }", "public ReferenceNode searchMatchNodeForDist(double[] data) {\n ReferenceNode node = nodeList.get(0);\n double distSqr = node.calculateDistanceSqrForLearning(data);\n ReferenceNode winningNode = node;\n double newDistSqr = 0.0d;\n for (int i = 1; i < nodeList.size(); i++) {\n node = nodeList.get(i);\n newDistSqr = node.calculateDistanceSqrForLearning(data);\n if (newDistSqr < distSqr) {\n winningNode = node;\n distSqr = newDistSqr;\n }\n }\n return winningNode;\n }", "public Point2D nearest(Point2D p) {\n\t\tRectHV rect = new RectHV(-Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);\n\t\treturn nearest(root, p, rect, true);\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"nearest: Point2D is null\");\n mindist = Double.POSITIVE_INFINITY;\n nearestSearch(p, root);\n return nearest;\n }", "public Point2D nearest(Point2D p) {\n if (root == null) return null;\n else if (p == null) throw new IllegalArgumentException(\"Point is null or invalid\");\n nearest = root.p;\n return searchNearest(root, p, false);\n }", "private List<BaseNode> findClosestNodes(BaseNode fromNode, List<BaseNode> toNodes,\n\t\t\tFloydWarshallShortestPaths<BaseNode, DefaultWeightedEdge> paths) {\n\t\t\n\t\tdouble shortestPath = 0;\n\t\tList<BaseNode> closestNodes = new ArrayList<>();\n\n\t\tfor (BaseNode toNode : toNodes) {\n\t\t\tGraphPath<BaseNode, DefaultWeightedEdge> path = paths.getPath(fromNode, toNode);\n\t\t\t// new closest found\n\t\t\tif ((shortestPath > path.getWeight() && path.getWeight() != 0) || shortestPath == 0) {\n\t\t\t\tshortestPath = path.getWeight();\n\t\t\t\tclosestNodes.clear();\n\t\t\t}\n\t\t\t// add closest to result list\n\t\t\tif (shortestPath != 0 && shortestPath == path.getWeight()) {\n\t\t\t\tclosestNodes.add(toNode);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn closestNodes;\n\t}", "private static Node mrvFindNode() {\n\t\tif (constrainedNodes.size() == 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// Was able to use this by 'implementing Comparable'\r\n\t\t// in the Node class\r\n\t\t// return max value node of constrained nodes\r\n\t\treturn Collections.max(constrainedNodes);\r\n\r\n\t}", "long closest(double lon, double lat) {\n double closet = Double.MAX_VALUE;\n long vertex = 0;\n\n for (Long v : vertices()) {\n double nodeLon = getNode(v).Lon;\n double nodeLat = getNode(v).Lat;\n double lonDist = nodeLon - lon;\n double latDist = nodeLat - lat;\n double dist = Math.sqrt(lonDist * lonDist + latDist * latDist);\n if (dist < closet) {\n vertex = v;\n closet = dist;\n }\n }\n return vertex;\n }", "public Node computePathToTraversePoint(Node source, Boolean sameElevation, int indexOfNextRegion) {\n\n Node backupTransferNode = null;\n boolean entered = false;\n source.minDistance = 0.;\n PriorityQueue<Node> nodeQueue = new PriorityQueue<Node>();\n nodeQueue.add(source);\n\n while (!nodeQueue.isEmpty()) {\n\n Node u = nodeQueue.poll();\n\n // Visit each edge exiting u\n for (Edge e : u._edges) {\n Node v = e.target;\n double weight = e.weight;\n double distanceThroughU = u.minDistance + weight;\n if (distanceThroughU < v.minDistance) {\n nodeQueue.remove(v);\n\n v.minDistance = distanceThroughU;\n v.previous = u;\n nodeQueue.add(v);\n }\n\n // if the elevation of the next region to travel is same as current region\n // find the nearest connect point and check if it is legal\n if(sameElevation == true && v._nodeType == CONNECTPOINT){\n\n // return v, only if the connect point is in the next region\n if(navigationGraph.get(indexOfNextRegion).nodesInSubgraph.get(v._waypointID) != null)\n return v;\n\n }\n\n // if the elevation of the next region to travel is different from current region\n // find the nearest elevator or stairwell based on user's preference\n else if(sameElevation == false && v._nodeType == getPreferenceValue()){\n tmpDestinationID.add(v._waypointID);\n return v;\n }\n else if(sameElevation == false && v._nodeType != getPreferenceValue() && v._nodeType!= NORMAL_WAYPOINT && entered == false){\n\n backupTransferNode = v;\n entered = true;\n }\n }\n }\n\n if(backupTransferNode != null)\n return backupTransferNode;\n else\n return source;\n }", "public Point getFurthermost(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint closest = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t\tclosest = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t}", "public MapLocation findNearestAction() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestHelp = findNearestHelp();\n MapLocation nearestArchon = findNearestArchon();\n\n if (nearestArchon == null && nearestHelp == null) {\n return rc.getInitialArchonLocations(rc.getTeam().opponent())[0]; // when no target is known, go to enemy archon initial position\n } else if (nearestArchon == null) { // when some of the targets is not present, just return the other one\n return nearestHelp; // is not null\n } else if (nearestHelp == null) {\n return nearestArchon; // is not null\n }\n\n if (origin.distanceSquaredTo(nearestHelp) < origin.distanceSquaredTo(nearestArchon)) {\n return nearestHelp;\n } else {\n return nearestArchon;\n }\n }", "Execution getClosestDistance();", "public Node<T> findNode(final Point point) {\n final Integer nodeId = this.nodesIdsByCoordinates.get(point);\n if (nodeId == null) {\n return null;\n } else {\n return getNode(nodeId);\n }\n }", "public int findNN(int position){\n int nearest = -1;\n double shortestDistance = 99999999; //super big so first find is always smaller\n\n for (int i = 0; i < locations.size(); i++){\n if(locations.get(i).isVisited() || i == position){\n //Do nothing, skip to next location\n continue;\n }\n else {\n double tempDistance = distances[position][i];\n\n if (tempDistance < shortestDistance) {\n shortestDistance = tempDistance;\n nearest = i;\n }\n }\n }\n\n return nearest;\n }", "public Point2D nearest(Point2D p2d) {\n if (size == 0) {\n return null;\n } \n return nearest(root, p2d, root.p2d, true);\n }", "private PointDist findNearest(Node curr, RectHV rect, PointDist minP, boolean Isx) {\n double currDist;\n PointDist p1;\n PointDist p2;\n // double currDist = findNearP.distanceSquaredTo(curr.point);\n /*\n if (currDist < pointDist.dist)\n minP = new PointDist(curr.point, currDist);\n else\n minP = pointDist;\n\n */\n if (Isx) {\n if (curr.left != null) {\n RectHV leftRect = new RectHV(rect.xmin(), rect.ymin(), curr.point.x(), rect.ymax());\n currDist = findNearP.distanceSquaredTo(curr.left.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.left.point, currDist);\n if (minP.dist > leftRect.distanceSquaredTo(findNearP)) {\n p1 = findNearest(curr.left, leftRect, minP, false);\n if (p1 != null)\n if (p1.dist < minP.dist)\n minP = p1;\n }\n }\n if (curr.right != null) {\n RectHV rightRect = new RectHV(curr.point.x(), rect.ymin(), rect.xmax(), rect.ymax());\n currDist = findNearP.distanceSquaredTo(curr.right.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.right.point, currDist);\n if (minP.dist > rightRect.distanceSquaredTo(findNearP)) {\n p2 = findNearest(curr.right, rightRect, minP, false);\n if (p2 != null)\n if (p2.dist < minP.dist)\n minP = p2;\n }\n }\n }\n else {\n if (curr.left != null) {\n RectHV leftRect = new RectHV(rect.xmin(), rect.ymin(), rect.xmax(), curr.point.y());\n currDist = findNearP.distanceSquaredTo(curr.left.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.left.point, currDist);\n if (minP.dist > leftRect.distanceSquaredTo(findNearP)) {\n p1 = findNearest(curr.left, leftRect, minP, true);\n if (p1 != null)\n if (p1.dist < minP.dist)\n minP = p1;\n }\n }\n if (curr.right != null) {\n RectHV rightRect = new RectHV(rect.xmin(), curr.point.y(), rect.xmax(), rect.ymax());\n currDist = findNearP.distanceSquaredTo(curr.right.point);\n if (currDist < minP.dist)\n minP = new PointDist(curr.right.point, currDist);\n if (minP.dist > rightRect.distanceSquaredTo(findNearP)) {\n p2 = findNearest(curr.right, rightRect, minP, true);\n if (p2 != null)\n if (p2.dist < minP.dist)\n minP = p2;\n }\n }\n }\n return minP;\n }", "public SegmentTreeNode<T> getNode (int target) {\n\t\t// have we narrowed down?\n\t\tif (left == target) {\n\t\t\tif (right == left+1) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// press onwards\n\t\tint mid = (left+right)/2;\n\n\t\tif (target < mid) { return lson.getNode (target); }\n\t\treturn rson.getNode (target);\n\t}", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "public Point getClosestPoint(Point p) {\n\t\t// If the node is not diveded and there are no points then we \n\t\t// cant return anything\n\t\tif (!divided && points.keySet().size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Loop through all the points and find the one that is the\n\t\t// closest to the point p\n\t\tdouble smallestDistance = Double.MAX_VALUE;\n\t\tPoint closest = null;\n\t\t\n\t\tfor (Point c : points.keySet()) {\n\t\t\tif (closest == null) {\n\t\t\t\tclosest = c;\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t} else if (p.distance(c) < smallestDistance) {\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t\tclosest = c;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn closest;\n\t}", "N getNode(int id);", "private Cluster getNearestCluster(BasicEvent event) {\n float minDistance = Float.MAX_VALUE;\n Cluster closest = null;\n float currentDistance = 0;\n for (Cluster c : clusters) {\n float rX = c.radiusX;\n float rY = c.radiusY; // this is surround region for purposes of dynamicSize scaling of cluster size or aspect ratio\n if (dynamicSizeEnabled) {\n rX *= surround;\n rY *= surround; // the event is captured even when it is in \"invisible surround\"\n }\n float dx, dy;\n if ((dx = c.distanceToX(event)) < rX && (dy = c.distanceToY(event)) < rY) { // needs instantaneousAngle metric\n currentDistance = dx + dy;\n if (currentDistance < minDistance) {\n closest = c;\n minDistance = currentDistance;\n c.distanceToLastEvent = minDistance;\n c.xDistanceToLastEvent = dx;\n c.yDistanceToLastEvent = dy;\n }\n }\n }\n return closest;\n }", "Node getNode();", "public BSTMapNode findMin() \n\t{\n\t\t\n\t\t\n\t\treturn null;\n\t}", "public Point2D nearest(Point2D p) {\n \n if (p == null)\n throw new IllegalArgumentException(\"Got null object in nearest()\");\n \n double rmin = 2.;\n Point2D pmin = null;\n \n for (Point2D q : point2DSET) {\n \n double r = q.distanceTo(p);\n if (r < rmin) {\n \n rmin = r;\n pmin = q;\n }\n }\n return pmin;\n }", "public Point2D nearest(Point2D p) {\n if (isEmpty()) {\n return null;\n }\n double minDistance = Double.POSITIVE_INFINITY;\n Point2D nearest = null;\n for (Point2D i : pointsSet) {\n if (i.distanceTo(p) < minDistance) {\n nearest = i;\n minDistance = i.distanceTo(p);\n }\n }\n return nearest;\n\n }", "private void findNewNearestPub() {\n \t\tevent.SetPubLocation(new PubLocation()/*new nearest found location*/);\n \t\tUpdateFromEvent();\n \t}", "public Resource findNearestResource(){\n\t\tResource nearestResource = null;\n\t\tfloat distanceToCurrentResource = 0f;\n\t\tfor (Resource resource : MapData.getInstance().getResources()) {\n\t\t\tif(resource.isResourceMaxed()) continue;\n\t\t\tif (resource.getCenter().dst2(getCenter()) < 4000000) {\n\t\t\t\tif (nearestResource == null) {\n\t\t\t\t\tnearestResource = resource;\n\t\t\t\t\tdistanceToCurrentResource = nearestResource\n\t\t\t\t\t\t\t.getCenter().dst2(this.getCenter());\n\t\t\t\t} else {\n\t\t\t\t\tfloat distanceToNewResource = resource.getCenter()\n\t\t\t\t\t\t\t.dst2(this.getCenter());\n\t\t\t\t\tnearestResource = (distanceToNewResource < distanceToCurrentResource) ? resource\n\t\t\t\t\t\t\t: nearestResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nearestResource;\n\t}", "public Node<E> findNode(int index){\t\r\n\t\tcheckIndex(index);\r\n\t\tint k = 0;\r\n\t\tNode<E> foundNode = headNode;\r\n\t\twhile(k < index - 1) {\r\n\t\t\tfoundNode = foundNode.link;\r\n\t\t}\r\n\t\t\r\n\t\treturn foundNode;\r\n\t}", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException();\n return nearestSub(p, root);\n }", "static public Element nearest(Color c)\n {\n int r = c.getRed();\n int g = c.getGreen();\n int b = c.getBlue();\n int minDelta = Integer.MAX_VALUE;\n Element nearest = null;\n\n for (Element e: Element.values())\n {\n Color ec = e.getColor();\n int delta = \n abs(r - ec.getRed()) +\n abs(g - ec.getGreen()) +\n abs(b - ec.getBlue());\n\n if (delta < minDelta)\n {\n minDelta = delta;\n nearest = e;\n }\n }\n return nearest;\n }", "@Override\n public Point nearest(double x, double y) {\n double distance = Double.POSITIVE_INFINITY;\n Point nearestPoint = new Point(0, 0);\n Point targetPoint = new Point(x, y);\n\n for (Point p : pointsList) {\n double tempdist = Point.distance(p, targetPoint);\n if (tempdist < distance) {\n distance = tempdist;\n nearestPoint = p;\n }\n }\n\n return nearestPoint;\n }", "@Override\r\n public Point nearest(double x, double y) {\r\n Point input = new Point(x, y);\r\n Point ans = points.get(0);\r\n double dist = Point.distance(ans, input);\r\n for (Point point : points) {\r\n if (Point.distance(point, input) < dist) {\r\n ans = point;\r\n dist = Point.distance(ans, input);\r\n }\r\n }\r\n return ans;\r\n }", "private Node getNodeAt(int index) {\n\t\tNode node = head;\n\t\t// follow the links between nodes until it counts off the right number\n\t\tfor (int i = 0; i < index; i++) {\n\t\t\tif (node == null) {\n\t\t\t\t// In case we run out of nodes before we get up to the desired index, return null\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tnode = node.getNext();\n\t\t}\n\t\treturn node;\n\t}", "private Node getLowestNode(Set<Node> openSet)\r\n {\r\n // find the node with the least f\r\n double minF = Double.MAX_VALUE;\r\n Node[] openArray = openSet.toArray(new Node[0]);\r\n\r\n Node q = null;\r\n for (int i = 0; i < openArray.length; ++i)\r\n {\r\n if (openArray[i].f < minF) \r\n {\r\n minF = openArray[i].f;\r\n q = openArray[i];\r\n }\r\n }\r\n return q;\r\n }", "public Location getNearest(Location src)\r\n {\r\n if(Main.ASSERT) Util.assertion(!src.inside(bl, tr));\r\n // cases: \r\n // 3 6 9 \r\n // 2 x 8\r\n // 1 4 7\r\n if(src.getX()<=bl.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return bl; // case 1\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tl; // case 3\r\n }\r\n else\r\n {\r\n return new Location.Location2D(bl.getX(), src.getY()); // case 2\r\n }\r\n }\r\n else if(src.getX()>=tr.getX())\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return br; // case 7\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return tr; // case 9\r\n }\r\n else\r\n {\r\n return new Location.Location2D(tr.getX(), src.getY()); // case 8\r\n }\r\n }\r\n else\r\n {\r\n if(src.getY()<=bl.getY())\r\n {\r\n return new Location.Location2D(src.getX(), bl.getY()); // case 4\r\n }\r\n else if(src.getY()>=tr.getY())\r\n {\r\n return new Location.Location2D(src.getX(), tr.getY()); // case 6\r\n }\r\n else\r\n {\r\n throw new RuntimeException(\"get nearest undefined for internal point\");\r\n }\r\n }\r\n }", "public void findNearestToMouse(Point2D position) throws NoninvertibleTransformException{\n //Take insets into account when using mouseCoordinates.\n Insets x = getInsets();\n position.setLocation(position.getX(), position.getY()-x.top + x.bottom);\n Point2D coordinates = transformPoint(position);\n Rectangle2D mouseBox = new Rectangle2D.Double(coordinates.getX()-0.005,\n coordinates.getY() -0.005,\n 0.01 , 0.01);\n Collection<MapData> streets = model.getVisibleStreets(mouseBox, false);\n streets.addAll(model.getVisibleBigRoads(mouseBox, false));\n filterRoads(streets); //remove all highways without names.\n\n\n nearestNeighbor = RouteFinder.findNearestHighway(coordinates, streets);\n repaint();\n }", "public GraphNode getMinDistanceNode(GraphNode pNode, double pWeight){\n GraphNode result = null;\n double max_double = Double.MAX_VALUE;\n \n ArrayList<ArcGraph> conections = pNode.getConections();\n \n for (int i = 0; i < conections.size(); i++){\n if (conections.get(i).getWeight() + pWeight < max_double ){\n max_double = conections.get(i).getWeight(); //updates the min weight\n result = conections.get(i).getDestiny(); //returns the destiny Node\n }\n }\n System.out.println(String.valueOf(result.getLatitude())+\" \"+String.valueOf(result.getLongitude())+\" \"+String.valueOf(result.getRating())+\" \"\n +result.getThumbnail()+\" \"+result.getType());\n return result;\n \n }", "public static Tile getClosestTo(Entity mover, Node node, Tile suggestion) {\r\n\t\tTile nl = node.getCurrentTile();\r\n\t\tint diffX = suggestion.getX() - nl.getX();\r\n\t\tint diffY = suggestion.getY() - nl.getY();\r\n\t\tDirection moveDir = Direction.NORTH;\r\n\t\tif (diffX < 0) {\r\n\t\t\tmoveDir = Direction.EAST;\r\n\t\t} else if (diffX >= node.getSize()) {\r\n\t\t\tmoveDir = Direction.WEST;\r\n\t\t} else if (diffY >= node.getSize()) {\r\n\t\t\tmoveDir = Direction.SOUTH;\r\n\t\t}\r\n\t\tdouble distance = 9999.9;\r\n\t\tTile destination = suggestion;\r\n\t\tfor (int c = 0; c < 4; c++) {\r\n\t\t\tfor (int i = 0; i < node.getSize() + 1; i++) {\r\n\t\t\t\tfor (int j = 0; j < (i == 0 ? 1 : 2); j++) {\r\n\t\t\t\t\tDirection current = Direction.get((moveDir.toInteger() + (j == 1 ? 3 : 1)) % 4);\r\n\t\t\t\t\tTile loc = suggestion.copyNew(current.getDeltaX() * i, current.getDeltaY() * i, 0);\r\n\t\t\t\t\tif (moveDir.toInteger() % 2 == 0) {\r\n\t\t\t\t\t\tif (loc.getX() < nl.getX() || loc.getX() > nl.getX() + node.getSize() - 1) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (loc.getY() < nl.getY() || loc.getY() > nl.getY() + node.getSize() - 1) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (checkTraversal(loc, moveDir)) {\r\n\t\t\t\t\t\tdouble dist = mover.getCurrentTile().getDistance(loc);\r\n\t\t\t\t\t\tif (dist < distance) {\r\n\t\t\t\t\t\t\tdistance = dist;\r\n\t\t\t\t\t\t\tdestination = loc;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmoveDir = Direction.get((moveDir.toInteger() + 1) % 4);\r\n\t\t\tint offsetX = Math.abs(moveDir.getDeltaY() * (node.getSize() >> 1)); // Not a mixup between x & y!\r\n\t\t\tint offsetY = Math.abs(moveDir.getDeltaX() * (node.getSize() >> 1));\r\n\t\t\tif (moveDir.toInteger() < 2) {\r\n\t\t\t\tsuggestion = node.getCurrentTile().copyNew(-moveDir.getDeltaX() + offsetX, -moveDir.getDeltaY() + offsetY, 0);\r\n\t\t\t} else {\r\n\t\t\t\tsuggestion = node.getCurrentTile().copyNew(-moveDir.getDeltaX() * node.getSize() + offsetX, -moveDir.getDeltaY() * node.getSize() + offsetY, 0);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn destination;\r\n\t}", "private Point backtrack(Point p){\n\t\t// coordinates of the point\n\t\tint x = (int)p.getX();\n\t\tint y = (int)p.getY();\n\t\t// neigh hold the return value\n\t\tPoint neigh= p;\n\t\t// the lowest score\n\t\tint score=10000;\n\t\t// look at all the neighbor and compare them\n\t\tif(x>0\t && topology[x-1][y]>=0){\n\t\t\tscore = topology[x-1][y];\n\t\t\tneigh = new Point(x-1,y);\n\t\t}\n\t\tif(x<row-1 && topology[x+1][y]>=0 && score > topology[x+1][y]) {\n\t\t\tscore = topology[x+1][y];\n\t\t\tneigh = new Point(x+1,y);\n\t\t}\n\t\tif(y<col-1 && topology[x][y+1]>=0 && score > topology[x][y+1]) {\n\t\t\tscore = topology[x][y+1];\n\t\t\tneigh = new Point(x,y+1);\n\t\t}\n\t\tif(y>0 && topology[x][y-1]>=0 && score > topology[x][y-1]) {\n\t\t\tscore = topology[x][y-1];\n\t\t\tneigh = new Point(x,y-1);\n\t\t}\n\t\treturn neigh;\n\t}", "private Node getMinimumOld() {\n Node tmp = null;\n\n // TODO: optimize by putting in 1 list and\n // provide 'starting offset' for remaining nodes to find mimimum\n // note: see new getMinimum method above\n\n if (null != nodeA) {\n tmp = nodeA;\n if (null != nodeB && tmp.data > nodeB.data) {\n tmp = nodeB;\n }\n if (null != nodeC && tmp.data > nodeC.data) {\n tmp = nodeC;\n }\n } else if (null != nodeB) {\n tmp = nodeB;\n if (null != nodeC && tmp.data > nodeC.data) {\n tmp = nodeC;\n }\n } else if (null != nodeC) {\n tmp = nodeC;\n }\n\n // System.out.println(tmp);\n\n if (null == tmp ) {\n // terminating condition\n return null;\n }\n\n if (tmp.equals(nodeA)) {\n nodeA = nodeA.next;\n }\n if (tmp.equals(nodeB)) {\n nodeB = nodeB.next;\n }\n if (tmp.equals(nodeC)) {\n nodeC = nodeC.next;\n }\n\n System.out.println(tmp.data);\n\n return tmp;\n }", "public Id GetNearestEdge(Coordinate coord) {\n\t\tfloat distsq = Float.MAX_VALUE;\n\t\tId nearest = null;\n\t\tfor (Edge e : listOfEdges) {\n\t\t\tif (e == null) continue;\n\t\t\tfloat mydistsq = e.getDistanceSq(coord, this);\n\t\t\tif (mydistsq < distsq && mydistsq >= 0.0f) {\n\t\t\t\tdistsq = mydistsq;\n\t\t\t\tnearest = e.getId();\n\t\t\t}\n\t\t}\n\t\treturn nearest;\n\t}", "public Set<? extends Position> findNearest(Position position, int k);", "public AVLNode findMin() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min;\n\t}", "public static int nextNode(directed_weighted_graph g, CL_Agent agent, int src, List<CL_Pokemon> c) {\n int ans = -1;\n dw_graph_algorithms ga = new DWGraph_Algo();\n ga.init(g);\n for (int a = 0; a < c.size(); a++) {\n Arena.updateEdge(c.get(a), g);\n }\n int fdest = -1;\n double mint = Double.MAX_VALUE;\n CL_Pokemon ca = null;\n for (CL_Pokemon pokemon : c) {\n if (arna.can_he_go(agent.getID(), pokemon)) {\n int dest = pokemon.get_edge().getDest();\n if (pokemon.getType() > 0) {\n dest = pokemon.get_edge().getSrc();\n }\n double t = ga.shortestPathDist(src, dest) / agent.getSpeed() / pokemon.getValue();\n if (t >= 0 && t < mint) {\n ca = pokemon;\n mint = t;\n fdest = dest;\n if (t == 0) {\n fdest = pokemon.get_edge().getSrc();\n if (pokemon.getType() > 0) {\n fdest = pokemon.get_edge().getDest();\n }\n }\n }\n\n }\n }\n\n if (fdest != -1) {\n agent.set_curr_fruit(ca);\n arna.i_am_going(agent.getID(), ca.get_edge());\n List<node_data> p = ga.shortestPath(src, fdest);\n ans = p.get(1).getKey();\n agent.setNextNode(p.get(1).getKey());\n } else {\n double min = Double.MAX_VALUE;\n Iterator<edge_data> edge = g.getE(agent.getSrcNode()).iterator();\n while (edge.hasNext()) {\n edge_data t = edge.next();\n if (min > g.getNode(agent.getSrcNode()).getLocation().distance(g.getNode(t.getDest()).getLocation())) {\n min = g.getNode(agent.getSrcNode()).getLocation().distance(g.getNode(t.getDest()).getLocation());\n ans = t.getDest();\n\n }\n\n }\n }\n return ans;\n }", "private <T extends Element> T getNearestElement(Element element, Class<T> klass) {\n List elements = element.nearestDescendants(klass);\n if (elements == null || elements.isEmpty()) {\n return null;\n }\n\n return (T) elements.get(0);\n }", "private @Nullable Person detectNode(final int cursorAbs, final int cursorOrd)\n {\n @Nullable Person resultPerson = null;\n for (Person person : model.getPeople())\n {\n final double distanceBetweenPoints = camera.d(\n camera.toRealX(cursorAbs),\n camera.toRealY(cursorOrd),\n person.getX() + DEFAULT_CIRCLE_RADIUS,\n person.getY() + DEFAULT_CIRCLE_RADIUS\n );\n if ( distanceBetweenPoints <= DEFAULT_CIRCLE_RADIUS )\n {\n resultPerson = person;\n break;\n }\n }\n return resultPerson;\n }", "public Point2D nearest(Point2D p) {\n Point2D nearest = null;\n double nearestDistance = Double.MAX_VALUE;\n for (Point2D cur: mPoints) {\n double distance = cur.distanceTo(p);\n if (nearestDistance > distance) {\n nearest = cur;\n nearestDistance = distance;\n }\n }\n return nearest;\n }", "public Point2D getRandomNodeLocation() {\n int validNum = 0;\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n validNum++;\n }\n }\n int randomIndex = RandomEnhanced.randInt(0,validNum-1);\n\n for (GraphNode graphNode : nodeVector) {\n if (graphNode.isValid()){\n if (randomIndex==0) return ((NavNode)graphNode).getPosition();\n randomIndex--;\n }\n }\n return null;\n }", "long closest(double lon, double lat) {\n return kdTreeForNearestNeighbor.nearest(lon, lat);\n }", "private Cell getShortestPath(List<Cell> surroundingBlocks, int DestinationX, int DestinationY) {\n \n int cellIdx = random.nextInt(surroundingBlocks.size());\n Cell min = surroundingBlocks.get(0);\n int distMin = euclideanDistance(surroundingBlocks.get(0).x, surroundingBlocks.get(0).y, DestinationX, DestinationY);\n \n for(int i = 0; i < surroundingBlocks.size(); i++) {\n if (i==1) {\n min = surroundingBlocks.get(i);\n }\n if(distMin > euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY)) {\n distMin = euclideanDistance(surroundingBlocks.get(i).x, surroundingBlocks.get(i).y, DestinationX, DestinationY);\n min = surroundingBlocks.get(i);\n }\n }\n return min;\n }", "public static Node findClosestLeaf(Node node, int search_key){\n\n if(search_key==node.key){ //เมื่อเจอ return ค่า\n return node;\n }\n else if(search_key>node.key){ //ถ้า search_key มากกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านขวา\n if(node.right!=null){ //ถ้า node ตอนนี้มี right-subtree เรียก recursive โดยส่ง right-subtree\n return findClosestLeaf(node.right, search_key);\n }\n else {return node;} //ถ้า node ตอนนี้มีไม่มี right-subtree แสดงว่า node ตอนนีใกล้ search_key ที่สุด\n }\n else { //ถ้า search_key น้อยกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านซ้าย\n if(node.left!=null){ //ถ้า node ตอนนี้มี left-subtree เรียก recursive โดยส่ง left-subtree\n return findClosestLeaf(node.left, search_key);\n }\n else{ return node;} ////ถ้า node ตอนนี้มีไม่มี left-subtree แสดงว่า node ตอนนีใกล้ search_key ที่สุด\n }\n\n }", "private int closest(double [] v){\n \t\tdouble mindist = dist(v, nCentroids[0]);\n \t\tint label =0;\n \t\tfor (int i=1; i<nClusters; i++){\n \t\t\tdouble t = dist(v, nCentroids[i]);\n \t\t\tif (mindist>t){\n \t\t\t\tmindist = t;\n \t\t\t\tlabel = i;\n \t\t\t}\n \t\t}\n \t\treturn label;\n \t}", "public MapLocation findNearestArchon() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestAction = null;\n float nearestDistance = 9999f;\n\n for (int i = 0; i < enemyArchonCount; ++i) {\n ArchonLocation loc = archonLocations[i];\n if (loc.isDead()) continue;\n float distance = loc.location.distanceSquaredTo(origin);\n if (nearestAction == null || distance < nearestDistance) {\n nearestAction = loc.location;\n nearestDistance = distance;\n }\n }\n\n return nearestAction;\n }", "public static Node findNodeById(ConcurrentHashMap<String, Node> idIndex, String id, Logger logger) {\n\t\tNode foundNode = idIndex.get(id);\n\n\t\tif (foundNode == null) {\n\t\t\tlogger.warning(\"WARNING: COULD NOT FIND NODE WITH ID = \" + id + \". HREF IGNORED...\");\n\t\t\treturn null;\n\t\t}\n\n\t\treturn foundNode;\n\n\t\t// ArrayList<Node> foundNodes = new ArrayList<Node>();\n\t\t//\n\t\t// Iterator<Entry<String, Node>> it = idIndex.entrySet().iterator();\n\t\t// while (it.hasNext()) {\n\t\t// Map.Entry<String, Node> pair = (Map.Entry<String, Node>) it.next();\n\t\t//\n\t\t// if (pair.getKey().equals(id)) {\n\t\t// foundNodes.add(pair.getValue());\n\t\t// it.remove();\n\t\t// break;\n\t\t// }\n\t\t// }\n\t\t//\n\t\t// // for (Node n : idIndex.query(\"id\", id)) {\n\t\t// // foundNodes.add(n);\n\t\t// // }\n\t\t//\n\t\t// switch (foundNodes.size()) {\n\t\t// case 0:\n\t\t// logger.warning(\"WARNING: COULD NOT FIND NODE WITH ID = \" + id);\n\t\t// return null;\n\t\t// case 1:\n\t\t// return foundNodes.get(0);\n\t\t// case 2:\n\t\t// if (foundNodes.get(0).getId() < foundNodes.get(1).getId()) {\n\t\t// if (isOld) {\n\t\t// return foundNodes.get(0);\n\t\t// }\n\t\t// return foundNodes.get(1);\n\t\t// } else {\n\t\t// if (isOld) {\n\t\t// return foundNodes.get(1);\n\t\t// }\n\t\t// return foundNodes.get(0);\n\t\t// }\n\t\t// default:\n\t\t// logger.warning(\"WARNING: MULTIPLE NODES HAVE THE SAME ID = \" + id);\n\t\t// return null;\n\t\t// }\n\t}", "public void addNode()\r\n\t{\r\n\t\tArrayList<PolygonD> objectsInScene = new ArrayList<PolygonD>();\r\n\t\tobjectsInScene.addAll(objects);\r\n\t\tobjectsInScene.add(currentShape);\r\n\t\t\r\n\t\tPointD mousePoint = new PointD(lastPointOnScreen); \r\n\t\tmousePoint.setX(mousePoint.getX() - worldCenter.getX());\r\n\t\tmousePoint.setY(mousePoint.getY() - worldCenter.getY());\r\n\t\t\r\n\t\tPolygonD nearestObject = null;\r\n\t\tDouble minDistance = 100.;//threshold for adding points\r\n\t\tint pointIndex = 0;\r\n\t\tfor(PolygonD obj : objectsInScene)\r\n\t\t\tif(obj.getVerts().size()>0){\r\n\t\t\t\tPointD p = obj.getVert(0);\r\n\t\t\t\tfor(int i = 1; i < obj.getVerts().size(); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"i = \"+i);\r\n\t\t\t\t\tDouble d = distanceToLine(new Vector(p, obj.getVert(i)), mousePoint);\r\n\t\t\t\t\tSystem.out.println(\"d = \"+d);\r\n\t\t\t\t\tif(d != null && d < minDistance)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(d + \"<\"+ minDistance);\r\n\t\t\t\t\t\tnearestObject = obj;\r\n\t\t\t\t\t\tminDistance = d;\r\n\t\t\t\t\t\tpointIndex = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tSystem.out.println(d + \">=\"+ minDistance);\r\n\t\t\t\t\tp = obj.getVert(i);\r\n\t\t\t\t}\r\n\t\t\t\t//handle last side\r\n\t\t\t\tDouble d = distanceToLine(new Vector(obj.getVert(0), obj.getVert(obj.getVerts().size()-1)), mousePoint);\r\n\t\t\t\tif(d != null && d < minDistance)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(d + \"<\"+ minDistance);\r\n\t\t\t\t\tnearestObject = obj;\r\n\t\t\t\t\tminDistance = d;\r\n\t\t\t\t\tpointIndex = obj.getVerts().size();\r\n\t\t\t\t\tSystem.out.println(\"i = \"+pointIndex);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\tSystem.out.println(d + \">=\"+ minDistance);\r\n\t\t\t}\r\n\t\tSystem.out.println(\"minDistance \"+minDistance +\" pointIndex = \"+pointIndex);\r\n\r\n\t\tif(nearestObject != null)\r\n\t\t{\r\n\t\t\tnearestObject.getVerts().add(pointIndex, mousePoint);\r\n\t\t\tSystem.out.println(nearestObject);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tcurrentShape.add(mousePoint);\r\n\t\t}\r\n\t}", "private Node findNode(Graph g, int id){\r\n for(Node n : g.getListNodes()){\r\n if (n.getId() == id){\r\n return n;\r\n }\r\n }\r\n return null;\r\n }", "Pair<Vertex, Double> closestVertexToPath(Loc pos);", "public void insertSmallest(Point p) {\n if (size() == 0) {\n first.next = first;\n first.p = p;\n return;\n }\n double leastDist;\n double minimumDistance = Double.POSITIVE_INFINITY;\n Node nearestN = null;\n Node n = first;\n do {\n leastDist = n.p.distanceTo(p) + n.next.p.distanceTo(p);\n leastDist = leastDist - n.p.distanceTo(n.next.p);\n if (leastDist < minimumDistance) {\n nearestN = n;\n minimumDistance = leastDist;\n }\n n = n.next;\n } while (!n.equals(first));\n Node newNode = new Node();\n newNode.p = p;\n newNode.next = nearestN.next;\n nearestN.next = newNode;\n }" ]
[ "0.7560405", "0.7371147", "0.73310953", "0.72773093", "0.69380015", "0.68920237", "0.6785837", "0.67503446", "0.6718994", "0.6666795", "0.66291976", "0.6622466", "0.6606551", "0.6578981", "0.6564126", "0.65562314", "0.65547013", "0.6538045", "0.6520536", "0.65193146", "0.6515948", "0.6508368", "0.65037924", "0.6495221", "0.6474865", "0.6463592", "0.64512664", "0.64389336", "0.6435888", "0.64357", "0.63867295", "0.6375466", "0.6374019", "0.6365704", "0.6364267", "0.6357465", "0.63572", "0.6343393", "0.63203", "0.6318181", "0.6312231", "0.6307946", "0.62982345", "0.6284896", "0.6267464", "0.62648284", "0.62607116", "0.62573415", "0.6257153", "0.6247004", "0.6227752", "0.6225373", "0.62236553", "0.6223038", "0.6222104", "0.6203482", "0.6179022", "0.6177247", "0.61744714", "0.61665684", "0.61608267", "0.6158134", "0.61352783", "0.61233157", "0.6117881", "0.61118627", "0.6090298", "0.6088189", "0.6087587", "0.6086529", "0.607602", "0.6069806", "0.60647374", "0.6044891", "0.6043156", "0.60330164", "0.60301846", "0.6002609", "0.59989274", "0.5995551", "0.5994773", "0.59764683", "0.59662807", "0.59370565", "0.5935779", "0.59154916", "0.5909221", "0.59010434", "0.5898738", "0.5896309", "0.5887766", "0.58775264", "0.587719", "0.58747387", "0.5874357", "0.5873754", "0.58712417", "0.58601683", "0.5859186", "0.58586836", "0.5854273" ]
0.0
-1
private Map alternativeVisibility = new HashMap(); private String titleField;
public DataViewer(T object) throws IllegalArgumentException { this.object = object; if (object == null) { throw new IllegalArgumentException(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "HashMap<String, String> getAdditionalDescriptions();", "private void setTitleMap(String title){\n if(title!=null && titleView.getVisibility() != View.GONE) {\n if (title.length() <= 50)\n titleView.setText(title);\n else\n titleView.setText(title.substring(0, 50));\n }\n }", "private final void m46528g(boolean z) {\n HashMap hashMap = new HashMap();\n hashMap.put(\"isVisible\", z ? \"1\" : \"0\");\n mo39809a(\"onAdVisibilityChanged\", (Map<String, ?>) hashMap);\n }", "public void setStaticOverlayVisible(boolean vis)\n/* 106: */ {\n/* 107:167 */ this.mapPanel.showStaticOverlay = vis;\n/* 108: */ }", "public void setDynamicOverlayVisible(boolean vis)\n/* 111: */ {\n/* 112:174 */ this.mapPanel.showDynamicOverlay = vis;\n/* 113: */ }", "public void setInfoVisible(boolean visible) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_info_propertyVisible\");\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_info_propertyVisible\", visible);\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setInfoVisible(\" + visible + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }", "private void refreshFieldsVisibility()\n {\n \n }", "@Override\n int getStateToVisible() {\n return 2;\n }", "public HashMap getMetaData() ;", "@Override\n public void setVisible (boolean f)\n { \n }", "@Override\n public boolean isVisible(Field field) {\n return true;\n }", "@Override\r\n\tpublic boolean hasHiddenMiniMap() {\n\t\treturn false;\r\n\t}", "public void setGuiHashMap() {\n\n gameMap.setGetGuiHashMapParameter(\"author\",\"Default authorName\");\n gameMap.setGetGuiHashMapParameter(\"warn\",\"Default warning\");\n gameMap.setGetGuiHashMapParameter(\"image\",\"Default image\");\n gameMap.setGetGuiHashMapParameter(\"wrap\",\"Default wrapping\");\n gameMap.setGetGuiHashMapParameter(\"scroll\",\"Default scrolling\");\n }", "public Map method_1884() {\r\n return this.field_1677;\r\n }", "static void m57757a(KMShareWrapper fVar, Parcel parcel) {\n boolean z = false;\n fVar.isAnonymous = parcel.readByte() == 1;\n fVar.isEnableAnonymous = parcel.readByte() == 1;\n fVar.isReadSetting = parcel.readByte() == 1;\n fVar.isEnableDownload = parcel.readByte() == 1;\n fVar.isEnableContact = parcel.readByte() == 1;\n if (parcel.readByte() == 1) {\n z = true;\n }\n if (z) {\n fVar.tooltipsKey = Integer.valueOf(parcel.readInt());\n } else {\n fVar.tooltipsKey = null;\n }\n fVar.extra = (HashMap) parcel.readSerializable();\n }", "@Override\n public void b(dz dz2, Map<String, String> map) {\n if (!map.containsKey(\"isVisible\")) {\n return;\n }\n boolean bl2 = \"1\".equals(map.get(\"isVisible\")) || \"true\".equals(map.get(\"isVisible\"));\n ab.this.c(bl2);\n }", "@Override\n public void setVisible(boolean arg0)\n {\n \n }", "public boolean isVisible() { return _visible; }", "public abstract void setVisible(boolean visible);", "public void setVisible(boolean val);", "@Override\r\n\tpublic List<GroupBoardDto> gbTitleSearch(Map<String, String> map) {\n\t\treturn null;\r\n\t}", "@Override\r\n public void mapshow() {\r\n showMap l_showmap = new showMap(d_playerList, d_country);\r\n l_showmap.check();\r\n }", "@Override\n\tpublic java.util.Map<java.util.Locale, java.lang.String> getTitleMap() {\n\t\treturn _scienceApp.getTitleMap();\n\t}", "public void setIsVisible(boolean isVisible);", "public void setVisible(Boolean isVisible);", "public Map method_6439() {\r\n return this.field_6226;\r\n }", "public void method_1882(Map var1) {\r\n super.method_1449();\r\n this.field_1677 = var1;\r\n }", "public boolean isVisible(){ return visible; }", "@Value.Default\n public Dict getTitle() {\n\treturn Dict.of();\n }", "public String getDisplayName(){return entryName;}", "@Override\n\tpublic void setVisible(boolean vis) {\n\t\t\n\t}", "@Override\n public void init(HashMap<String, Object> map) {\n this.title = (String) map.get(\"title\");\n this.url = (String) map.get(\"url\");\n }", "public M csolTitleNull(){if(this.get(\"csolTitleNot\")==null)this.put(\"csolTitleNot\", \"\");this.put(\"csolTitle\", null);return this;}", "void setVisualizationType(MapVisualizationType visType);", "public interface FilterView {\n\n void addHairColor(List<String> color);\n void addProfession(List<String> profession);\n\n List<String> getProfessions();\n List<String> getHairColor();\n String getName();\n String getMinAge();\n String getMaxAge();\n String getMinHeight();\n String getMaxHeight();\n String getMinWeight();\n String getMaxWeight();\n\n}", "public boolean hasTitle() {\n return fieldSetFlags()[0];\n }", "private void m15127a(C7218v vVar, Map<String, String> map) {\n String str = vVar.f13994b;\n if (C7269s.m15819a(str)) {\n map.put(\"idfa\", str);\n }\n map.put(\"dnt\", Boolean.toString(vVar.f13993a));\n }", "public boolean getShowMap()\r\n {\r\n return showMap;\r\n }", "public interface MapVisualizationInfo\r\n{\r\n /**\r\n * Gets the DataTypeInfo for this visualization info.\r\n *\r\n * @return The {@link DataTypeInfo}.\r\n */\r\n DataTypeInfo getDataTypeInfo();\r\n\r\n /**\r\n * Gets the tile level controller.\r\n *\r\n * @return the tile level controller\r\n */\r\n TileLevelController getTileLevelController();\r\n\r\n /**\r\n * Gets the tile render properties for this data type if the type is a\r\n * IMAGE_TILE type image, or null if this type does not support tiles.\r\n *\r\n * @return the tile render properties or null.\r\n */\r\n TileRenderProperties getTileRenderProperties();\r\n\r\n /**\r\n * Gets the default visualization type.\r\n *\r\n * @return the default visualization type\r\n */\r\n MapVisualizationType getVisualizationType();\r\n\r\n /**\r\n * Gets the Z-Order for this Type.\r\n *\r\n * @return the order.\r\n */\r\n int getZOrder();\r\n\r\n /**\r\n * Checks if is image tile type.\r\n *\r\n * @return true, if is image tile type\r\n */\r\n boolean isImageTileType();\r\n\r\n /**\r\n * Checks if is motion imagery type.\r\n *\r\n * @return true, if is motion imagery type\r\n */\r\n boolean isMotionImageryType();\r\n\r\n /**\r\n * Checks if is image type.\r\n *\r\n * @return true, if is image type\r\n */\r\n boolean isImageType();\r\n\r\n /**\r\n * Checks if is z-orderable.\r\n *\r\n * @return true, if is z-orderable\r\n */\r\n boolean isZOrderable();\r\n\r\n /**\r\n * Sets the DataTypeInfo for this visualization info.\r\n *\r\n * @param dti - the {@link DataTypeInfo}\r\n */\r\n void setDataTypeInfo(DataTypeInfo dti);\r\n\r\n /**\r\n * Sets the visualization type. Cannot be null.\r\n *\r\n * @param visType the new visualization type\r\n */\r\n void setVisualizationType(MapVisualizationType visType);\r\n\r\n /**\r\n * Sets the Z-Order for this Type.\r\n *\r\n * @param order - the order\r\n * @param source - the calling object\r\n */\r\n void setZOrder(int order, Object source);\r\n\r\n /**\r\n * True if this DataTypeInfo utilizes {@link MapDataElement}s.\r\n *\r\n * @return true if uses, false if not\r\n */\r\n boolean usesMapDataElements();\r\n\r\n /**\r\n * Returns true if this data type uses visualization styles, false if not.\r\n *\r\n * @return true, if uses visualization styles.\r\n */\r\n boolean usesVisualizationStyles();\r\n}", "Map<Integer, String> getMetaLocal();", "public void setSearchNameTextFieldVisible(boolean visible) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_searchNameTextField_propertyVisible\");\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_searchNameTextField_propertyVisible\", visible);\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setSearchNameTextFieldVisible(\" + visible + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }", "@Override\n\tprotected String getSearchableInformationTitle(int index) {\n\t\treturn ItemSearchableInformations.values()[index].toString();\n\t}", "@Test(timeout = 4000)\n public void test344() throws Throwable {\n Hidden hidden0 = new Hidden((Component) null, \"(vLoO6y2\\\"Vht&{{\", \"(vLoO6y2\\\"Vht&{{\");\n Map<String, String> map0 = hidden0.getAttributes();\n assertEquals(1, map0.size());\n }", "public void setActionItemInfoVisible(boolean visible) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_actionItemInfo_propertyVisible\");\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_actionItemInfo_propertyVisible\", visible);\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setActionItemInfoVisible(\" + visible + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }", "@Override\n protected void populateLocalisationMap() {\n localisationKeyConstantToKeyMap.put(ADDRESSES_TITLE, \"receiveBitcoinPanel.receivingAddressesTitle\"); \n localisationKeyConstantToKeyMap.put(CREATE_NEW_TOOLTIP, \"createOrEditAddressAction.createReceiving.tooltip\"); \n }", "protected void addPropNames()\n{\n addPropNames(\"Visible\", \"X\", \"Y\", \"Width\", \"Height\", \"Roll\", \"ScaleX\", \"ScaleY\",\n \"Font\", \"TextColor\", \"FillColor\", \"StrokeColor\", \"URL\");\n}", "public interface MapsView {\n void showMessageOnFailure(String message);\n\n void showProgressDialog();\n\n void hideProgressDialog();\n\n void showDetails(String[] detail);\n\n void showEmptyRouteMessage();\n\n void showEmptyParkingMessage();\n}", "public interface CountryView extends MvpView {\n /**\n * show loading status\n * @param loading loading status should be visible or not\n */\n void showLoading(boolean loading);\n\n /**\n * if there is an error,show the related message about the error\n * @param errorMessage\n */\n void showError(String errorMessage);\n\n /**\n * show the facts of country\n * @param facts\n */\n void showFacts(List<Fact> facts);\n\n /**\n * show the title of the country\n * @param title\n */\n void showTitle(String title);\n\n}", "public void setVisible(Boolean visible);", "void setVisible(boolean visible);", "void setVisible(boolean visible);", "public interface C27129e {\n void onVisibilityChanged(boolean z);\n }", "public void setItemActionBarVisible(boolean visible) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_itemActionBar_propertyVisible\");\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_itemActionBar_propertyVisible\", visible);\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setItemActionBarVisible(\" + visible + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }", "public void setVisible(boolean v) {\n }", "Map<String, List<List<Attribution>>> getAttributionMap();", "public GeneralDictionary() {\n map = new TreeMap<String, String>();\n map.put(\"book\", \"a set of written or printed pages, usually bound with \" + \"a protective cover\");\n map.put(\"editor\", \"a person who edits\");\n }", "public Map<String, Object> getTagMap();", "@Override\r\n \tpublic void setMap(Map m) {\n \t\t\r\n \t}", "@Override\n\tpublic void setVisible(boolean visibility) {\n\t\t//do nothing\n\t}", "public Map<String, Object> getInfo();", "void setCanSeeFriendlyInvisibles(boolean canSeeFriendlyInvisibles);", "public interface Keys {\n String VIEW_PAGER_INDEX = \"view_pager_index\";\n String LOCAL_MUSIC_POSITION = \"local_music_position\";\n String LOCAL_MUSIC_OFFSET = \"local_music_offset\";\n String PLAYLIST_POSITION = \"playlist_position\";\n String PLAYLIST_OFFSET = \"playlist_offset\";\n}", "public interface ILabel {\n\n String getLabelKey();\n\n void setLabel(String label);\n\n}", "public void setVisible(boolean visible);", "@Override\n\tpublic void setVisible(boolean b) {\n\t\t\n\t}", "public interface IsDisplayInfoBar\n {\n /**\n * not show\n */\n String UN_SHOW = \"0\";\n\n /**\n * show\n */\n String SHOW = \"1\";\n }", "public void setScannableInfoFromMap(Map<String, String> map) {\n\t\tscannableInfoList.clear();\n\t\tif (map != null) {\n\t\t\tmap.keySet().forEach(key -> scannableInfoList.add(new ScannableInfo(key, map.get(key))));\n\t\t}\n\t}", "public interface PageFields {\n String ATT_PAGE = \"page\";\n String ATT_PAGELIMIT = \"limit\";\n String ATT_PAGENUMBER = \"pageNb\";\n String ATT_SEARCH = \"search\";\n String ATT_DELETE = \"selection\";\n String ATT_COL = \"col\";\n String ATT_ORDER = \"order\";\n\n default String getAttPage() {\n return ATT_PAGE;\n }\n\n default String getAttPageLimit() {\n return ATT_PAGELIMIT;\n }\n\n default String getAttPageNumber() {\n return ATT_PAGENUMBER;\n }\n\n default String getAttSearch() {\n return ATT_SEARCH;\n }\n\n default String getAttDelete() {\n return ATT_DELETE;\n }\n\n default String getAttCol() {\n return ATT_COL;\n }\n\n default String getAttOrder() {\n return ATT_ORDER;\n }\n}", "protected Map<String,List<PageViewVO>> initializePageMap() {\n\t\tMap<String,List<PageViewVO>> pm = new HashMap<>();\n\t\tfor (Section sect : Section.values()) {\n\t\t\tpm.put(sect.name(), new ArrayList<>());\n\t\t}\n\t\treturn pm;\n\t}", "HashMap<Value, HashSet<Value>> getLayerDatasetDescriptions();", "protected Map<String, Object> assertMap() {\n if (type == Type.LIST) {\n throw new FlexDataWrongTypeRuntimeException(type, Type.OBJECT); \n }\n if (entryCollectionMap == null) {\n entryCollectionMap = new LinkedHashMap<String, Object>();\n type = Type.OBJECT;\n }\n return entryCollectionMap;\n }", "public interface CollectionInfo {\n void onItemDetailsClicks(RelativeLayout mRelativeLayout, TextView mTextView, List<Map<String,Object>> list);\n}", "public void setShowMap( boolean show )\r\n {\r\n showMap = show;\r\n }", "public interface InstanceFieldInitializationInfo {\n\n default boolean isArgumentInitializationInfo() {\n return false;\n }\n\n default InstanceFieldArgumentInitializationInfo asArgumentInitializationInfo() {\n return null;\n }\n\n default boolean isTypeInitializationInfo() {\n return false;\n }\n\n default InstanceFieldTypeInitializationInfo asTypeInitializationInfo() {\n return null;\n }\n\n default boolean isSingleValue() {\n return false;\n }\n\n default SingleValue asSingleValue() {\n return null;\n }\n\n default boolean isUnknown() {\n return false;\n }\n\n InstanceFieldInitializationInfo rewrittenWithLens(\n AppView<AppInfoWithLiveness> appView, GraphLens lens);\n}", "public interface SearchParams {\r\n\r\n\tpublic static final String LYRICS_FOR = \"lyrics for\";\r\n\tpublic static final String SITES = \"site:\";\r\n}", "public interface HasUiAttributes {\n}", "public interface BookInfo {\n String getTitle();\n String getAuthor();\n String getOriginalLanguage();\n String getOriginalTitle();\n String getYearOfFirsEdition();\n String getCategory();\n String getGenre();\n String getForm();\n String getPublisherNote();\n String getPicturePath();\n String getGrade();\n}", "private void applyVisibilityFlags() {\n if (rangeRings == null) {\n return;\n }\n try {\n boolean visibility = getDisplayVisibility();\n rangeRings.setRangeRingsVisible(rrVisible && visibility);\n rangeRings.setAzimuthLinesVisible(radVisible && visibility);\n rangeRings.setLabelsVisible(lblVisible && visibility);\n } catch (Exception exc) {}\n }", "public String getTitle(){\n return mTitle;\n }", "public interface PrefsKey {\n\n String Ssid = \"Ssid\";\n String HotKeys = \"HotKeys\";\n String HistoryKeys = \"HistoryKeys\";\n String HistoryCooking = \"HistoryCooking\";\n\n String Guided = \"Guided\";\n}", "java.util.Map<java.lang.String, java.lang.String>\n getDetailsMap();", "Map getAspectDatas();", "public HashMap<String, LttngEventField> getMapContent() {\n return fFieldsMap;\n }", "public void setDescription(String description){this.description=description;}", "@Override\n public void title_()\n {\n }", "@SuppressWarnings(\"unused\")\n void setVisible(boolean visible);", "public static String getTitleKey() {return titleKey;}", "private void setupOptionalFields() {\n // Optional fields <-> labels\n Map<AutoCompleteTextView, TextView> map = new HashMap<>();\n map.put(mBind.backgroundEdit, mBind.backgroundLabel);\n map.put(mBind.maxWidthEdit, mBind.maxWidthLabel);\n map.put(mBind.maxHeightEdit, mBind.maxHeightLabel);\n\n for (Map.Entry<AutoCompleteTextView, TextView> e : map.entrySet()) {\n // On every keystroke, check if field is empty, and if yes, strike through its label\n e.getKey().addTextChangedListener(new MyTextWatcher() {\n @Override\n public void afterTextChanged(Editable s) {\n int mode = e.getValue().getPaintFlags();\n if (e.getKey().getText().toString().equals(\"\"))\n mode = Util.setFlag(mode, Paint.STRIKE_THRU_TEXT_FLAG);\n else\n mode = Util.unsetFlag(mode, Paint.STRIKE_THRU_TEXT_FLAG);\n e.getValue().setPaintFlags(mode);\n }\n });\n }\n }", "public interface Mitab28ColumnKeys {\n\n String KEY_BIO_EFFECT_A = InteractionKeys.KEY_BIO_EFFECT_A;\n String KEY_BIO_EFFECT_B = InteractionKeys.KEY_BIO_EFFECT_B;\n String KEY_CAUSAL_REG_MECHANISM = InteractionKeys.KEY_CAUSAL_REG_MECHANISM;\n String KEY_CAUSAL_STAT = InteractionKeys.KEY_CAUSAL_STAT;\n}", "public interface Displayable {\n\n\tpublic String getDisplayName();\n\n\tpublic String getDisplayTooltip();\n\t\n}", "private void setDictionaryImplications() {\n if (usingDictionary) {\n usingDictionaryValue = \"Yes\";\n } else {\n usingDictionaryValue = \"No\";\n }\n textMergeScript.recordScriptAction\n (ScriptConstants.OUTPUT_MODULE,\n ScriptConstants.SET_ACTION,\n ScriptConstants.NO_MODIFIER,\n ScriptConstants.USING_DICTIONARY_OBJECT,\n String.valueOf(usingDictionary));\n }", "public Map<String,String> getMetadataElementMap() {\n\t\tMap<String,String> uiList = new LinkedHashMap<String,String>();\n\t\tfor (MetadataElement element: MetadataElement.values()){\n\t\t\tuiList.put(element.toString(), element.getDisplayName());\n\t\t}\n \n\t\treturn uiList;\n\t}", "public void setVisible(boolean b) {\n\t\t\n\t}", "@Override\r\n \tpublic void setVisible(boolean visible) {\r\n \t\tsessionBeanPkgNameditor\r\n \t\t\t\t.setValue(\"org.domain.\" //$NON-NLS-1$\r\n \t\t\t\t\t\t+ model\r\n \t\t\t\t\t\t\t\t.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)\r\n \t\t\t\t\t\t+ \".session\"); //$NON-NLS-1$\r\n \t\tentityBeanPkgNameditor\r\n \t\t\t\t.setValue(\"org.domain.\" //$NON-NLS-1$\r\n \t\t\t\t\t\t+ model\r\n \t\t\t\t\t\t\t\t.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)\r\n \t\t\t\t\t\t+ \".entity\"); //$NON-NLS-1$\r\n \t\ttestsPkgNameditor\r\n \t\t\t\t.setValue(\"org.domain.\" //$NON-NLS-1$\r\n \t\t\t\t\t\t+ model\r\n \t\t\t\t\t\t\t\t.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)\r\n \t\t\t\t\t\t+ \".test\"); //$NON-NLS-1$\r\n \t\tif (visible) {\r\n \t\t\tITaggedFieldEditor runtimesField = (ITaggedFieldEditor)((CompositeEditor)jBossSeamHomeEditor).getEditors().get(1);\r\n \t\t\tObject oldValue = runtimesField.getValue();\r\n \t\t\tObject newValue = \"\";\r\n \t\t\tList<String> runtimes = getRuntimeNames(model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString());\r\n \t\t\tif(oldValue==null || !runtimes.contains(oldValue)) {\r\n \t\t\t\tObject defaultRnt = getSeamRuntimeDefaultValue();\r\n \t\t\t\tif(defaultRnt!=null && runtimes.contains(defaultRnt)) {\r\n \t\t\t\t\tnewValue = defaultRnt;\r\n \t\t\t\t} else if(runtimes.size()>0) {\r\n \t\t\t\t\tnewValue = runtimes.get(0);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tnewValue = oldValue;\r\n \t\t\t}\r\n \t\t\truntimesField.setValue(newValue);\r\n \t\t\truntimesField.setTags(runtimes.toArray(new String[0]));\r\n \t\t\tvalidate();\r\n \t\t}\r\n \t\tsuper.setVisible(visible);\r\n \t}", "public void setMetaData(HashMap pMetaData) ;", "public void getApHideColumn(){\r\n\t\tString showHide = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(WsrdConstants.HIDESHOWCOLUMN);\r\n\t\tif(showHide.equalsIgnoreCase(WsrdConstants.SHOW_AUTHOR_INFO)) {\r\n\t\t\twsrdModel.setApShowHide(WsrdConstants.HIDE_AUTHOR_INFO);\r\n\t\t\twsrdModel.setShowHideFlag(true);\r\n\t\t}\r\n\t\tif(showHide.equalsIgnoreCase(WsrdConstants.HIDE_AUTHOR_INFO)) {\r\n\t\t\twsrdModel.setApShowHide(WsrdConstants.SHOW_AUTHOR_INFO);\r\n\t\t\twsrdModel.setShowHideFlag(false);\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void method_6436() {\r\n super();\r\n this.field_6225 = new ArrayList();\r\n this.field_6226 = new HashMap();\r\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "@Override\n\tpublic FarmActivity selectActivityByTitle(Map<String, String> map) {\n\t\treturn null;\n\t}", "public static void fill_map(){\n\t\tcategory_links_map.put(\"Categories\", \"Movies\");\n\t\tcategory_links_map.put(\"Actors\", \"Movies\");\n\t\tcategory_links_map.put(\"Movies\", \"Actors\");\n\t\tcategory_links_map.put(\"Artists\", \"Creations\");\n\t\tcategory_links_map.put(\"Creations\", \"Artists\");\n\t\tcategory_links_map.put(\"Countries\", \"Locations\");\n\t\tcategory_links_map.put(\"Locations\", \"Countries\");\n\t\tcategory_links_map.put(\"NBA players\", \"NBA teams\");\n\t\tcategory_links_map.put(\"NBA teams\", \"NBA players\");\n\t\tcategory_links_map.put(\"Israeli soccer players\", \"Israeli soccer teams\");\n\t\tcategory_links_map.put(\"Israeli soccer teams\", \"Israeli soccer players\");\n\t\tcategory_links_map.put(\"World soccer players\", \"World soccer teams\");\n\t\tcategory_links_map.put(\"World soccer teams\", \"World soccer players\");\n\t}", "protected void setMetdata(HashMap<PageMetadataEnum,String> m ){\r\n\t\tthis.metadata = m; \r\n\t}" ]
[ "0.57242084", "0.563098", "0.5606617", "0.5566161", "0.55425596", "0.5520941", "0.5471932", "0.5453974", "0.5342816", "0.5327026", "0.52925235", "0.52821594", "0.5242197", "0.51814806", "0.5173381", "0.51721716", "0.5171201", "0.5162525", "0.5157723", "0.5146014", "0.5144748", "0.5140455", "0.5139811", "0.5132752", "0.5120135", "0.5113724", "0.51125556", "0.50916654", "0.5072042", "0.50663203", "0.5065015", "0.5061413", "0.5057811", "0.50576895", "0.50537825", "0.50516886", "0.50498486", "0.50466573", "0.5032451", "0.50130165", "0.5006733", "0.5006072", "0.50028896", "0.49994713", "0.49957857", "0.4992992", "0.49842954", "0.49797633", "0.49737272", "0.49721164", "0.49721164", "0.49600333", "0.49582922", "0.49548033", "0.4952825", "0.49426362", "0.49410865", "0.4940571", "0.49356836", "0.49305326", "0.49194023", "0.4917012", "0.4916897", "0.49078497", "0.4907105", "0.49015543", "0.4899956", "0.4898065", "0.48937517", "0.48933554", "0.489181", "0.4887306", "0.48854223", "0.4884791", "0.48811302", "0.48800194", "0.48771325", "0.48744705", "0.48725384", "0.4872123", "0.48622957", "0.4859337", "0.48576468", "0.48571166", "0.4856193", "0.48418027", "0.48384464", "0.4836081", "0.48271716", "0.48268133", "0.48256108", "0.48253697", "0.48242536", "0.4820787", "0.48181924", "0.4814187", "0.48113433", "0.481117", "0.47994488", "0.47975498", "0.47965288" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_sign_up_details, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79041183", "0.7805934", "0.77659106", "0.7727251", "0.7631684", "0.7621701", "0.75839096", "0.75300384", "0.74873656", "0.7458051", "0.7458051", "0.7438486", "0.742157", "0.7403794", "0.7391802", "0.73870087", "0.7379108", "0.7370295", "0.7362194", "0.7355759", "0.73454577", "0.734109", "0.73295504", "0.7327726", "0.73259085", "0.73188347", "0.731648", "0.73134047", "0.7303978", "0.7303978", "0.7301588", "0.7298084", "0.72932935", "0.7286338", "0.7283324", "0.72808945", "0.72785115", "0.72597474", "0.72597474", "0.72597474", "0.725962", "0.7259136", "0.7249966", "0.7224023", "0.721937", "0.7216621", "0.72045326", "0.7200649", "0.71991026", "0.71923256", "0.71851367", "0.7176769", "0.7168457", "0.71675026", "0.7153402", "0.71533287", "0.71352696", "0.71350807", "0.71350807", "0.7129153", "0.7128639", "0.7124181", "0.7123387", "0.7122983", "0.71220255", "0.711715", "0.711715", "0.711715", "0.711715", "0.7117043", "0.71169263", "0.7116624", "0.71149373", "0.71123946", "0.7109806", "0.7108778", "0.710536", "0.7098968", "0.70981944", "0.7095771", "0.7093572", "0.7093572", "0.70862055", "0.7082207", "0.70808214", "0.7080366", "0.7073644", "0.7068183", "0.706161", "0.7060019", "0.70598614", "0.7051272", "0.70374316", "0.70374316", "0.7035865", "0.70352185", "0.70352185", "0.7031749", "0.703084", "0.7029517", "0.7018633" ]
0.0
-1
TODO Autogenerated method stub
@Override protected Double doInBackground(String... params) { postSignUpData(params[0], params[1], params[2]); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Create a new HttpClient and Post Header
public void postSignUpData(String userName, String email , String password) { HttpPost httppost = new HttpPost("http://192.168.1.224:3000/signup"); try { // Add your data JSONObject json = new JSONObject(); json.put("username" , userName); json.put("email" , email); json.put("password" , password); StringEntity se = new StringEntity( json.toString()); se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); httppost.setEntity(se); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); s = EntityUtils.toString(response.getEntity()); s = s.toString(); int a=response.getStatusLine().getStatusCode(); } catch (ClientProtocolException e) { // TODO Auto-generated catch block } catch (IOException e) { // TODO Auto-generated catch block } catch (JSONException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HttpClientHelper() {\n defaultHeaders.put(\"Content-Type\", \"application/json\");\n defaultHeaders.put(\"Accept-Encoding\", \"gzip\");\n\n //postDefaultHeaders.put(\"Content-Type\", \"application/json\");\n //postDefaultHeaders.put(\"Content-Encoding\", \"gzip\");\n\n String key = MessageFormat.format(\"{0}#{1}\", UserUtil.getUserUuid(), UserUtil.getUserId());\n\n //postDefaultHeaders.put(\"X-CLIENT-KEY\", key);\n defaultHeaders.put(\"X-CLIENT-KEY\", key);\n client.setTimeout(3000);\n }", "public static final DefaultHttpClient createHttpClient() {\n\t\treturn createHttpClient(3);\n\t}", "private static HttpClient getNewHttpClient(){\n HttpParams params = new BasicHttpParams();\n return new DefaultHttpClient(params);\n }", "private static HttpClient createClient() {\n return HttpClients.createMinimal();\n }", "private DefaultHttpClient createHttpClient()\n throws IOException\n {\n XCapCredentialsProvider credentialsProvider\n = new XCapCredentialsProvider();\n credentialsProvider.setCredentials(\n AuthScope.ANY,\n new UsernamePasswordCredentials(getUserName(), password));\n\n return HttpUtils.getHttpClient(\n null , null, uri.getHost(), credentialsProvider);\n }", "private HttpClient prepareHttpClient() {\n\t\tHttpClientParams htcParams = new HttpClientParams();\n\t\tmHttpClient = new HttpClient();\n\t\thtcParams.setConnectionManagerTimeout(300000);\n\t\thtcParams.setSoTimeout(300000);\n\t\tmHttpClient.setParams(htcParams);\n\t\treturn mHttpClient;\n\t}", "@Test\n public void createPost() throws IOException {\n PostData postData = new PostData()\n .withId(101)\n .withUserId(1)\n .withTitle(\"New Post\")\n .withBody(\"This is the body of the post.\");\n\n // Create an HTTP Post Request\n HttpPost post = new HttpPost(POSTS);\n\n // Set the \"Content-type\" header of the\n // HTTP Post Request to \"Application/json; charset=UTF-8\"\n post.setHeader(\n CONTENT_TYPE,\n \"Application/json; charset=UTF-8\"\n );\n\n // Create a String Entity out of the JSON data and add it\n // to the HTTP Post Request.\n //\n // This will serialize the JSON data into a String\n post.setEntity(\n new StringEntity(\n this.gson.toJson(postData)\n )\n );\n\n // Execute the HTTP Post with the client\n HttpResponse response = this.httpClient.execute(post);\n\n // Get a PostData class instance from the response\n PostData responsePostData = getPostData(response);\n\n // Make assertions about the response\n assertThat(response.getStatusLine().getStatusCode())\n .isEqualTo(201);\n\n // Make assertions about the data returned\n assertThat(responsePostData.getId()).isEqualTo(101);\n assertThat(responsePostData.getUserId()).isEqualTo(1);\n assertThat(responsePostData.getTitle())\n .isEqualTo(postData.getTitle());\n assertThat(responsePostData.getBody())\n .isEqualTo(postData.getBody());\n }", "private static HttpResponse sendPost() throws Exception {\n // Create the Call using the URL\n HttpPost http = new HttpPost(url);\n // Set the credentials set earlier into the headers\n Header header = new BasicScheme(StandardCharsets.UTF_8).authenticate(creds, http, null);\n // Set the header into the HTTP request\n http.addHeader(header);\n // Print the response\n return httpClient.execute(http);\n }", "public static HttpClient Factory() {\n\t\treturn httpclient;\n\t}", "HttpClientRequest addHeader(CharSequence name, CharSequence value);", "public interface HttpClientInterface {\n byte[] post(String url, byte[] body);\n}", "public interface HttpClientFactory {\n CloseableHttpClient newHttpClient();\n}", "public HttpEntity openHttpEntityViaPost(URL url, List<NameValuePair> nvps) throws IOException {\r\n Logger.getLogger(TargetAuthenticationStrategy.class).setLevel(Level.ERROR);\r\n Logger.getLogger(RequestTargetAuthentication.class).setLevel(Level.ERROR);\r\n DefaultHttpClient httpclient = new DefaultHttpClient();\r\n \r\n httpclient.setRedirectStrategy(new LaxRedirectStrategy());\r\n\r\n httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);\r\n CookieStore store = new BasicCookieStore();\r\n for (Cookie cookie : cookies) {\r\n store.addCookie(cookie);\r\n }\r\n httpclient.setCookieStore(store);\r\n\r\n httpclient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);\r\n\r\n if (socketTimeout > -1) {\r\n httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);\r\n }\r\n if (connectionTimeout > -1) {\r\n httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);\r\n }\r\n\r\n String domain = this.domain;\r\n String username = this.username;\r\n String password = this.password;\r\n if (serviceAccountPropertiesFileName != null) {\r\n Properties serviceAccountProperties = new Properties();\r\n if (new File(serviceAccountPropertiesFileName).exists()) {\r\n serviceAccountProperties.load(new FileReader(serviceAccountPropertiesFileName));\r\n } else {\r\n try {\r\n serviceAccountProperties.load(this.getClass().getResourceAsStream(serviceAccountPropertiesFileName));\r\n } catch (Exception e) {\r\n }\r\n }\r\n domain = serviceAccountProperties.getProperty(\"http.serviceaccount.domain\", domain);\r\n username = serviceAccountProperties.getProperty(\"http.serviceaccount.username\", username);\r\n password = serviceAccountProperties.getProperty(\"http.serviceaccount.password\", password);\r\n }\r\n\r\n if (username != null && password != null) {\r\n String decryptedPassword = password;\r\n try {\r\n decryptedPassword = new StringEncrypter().decrypt(password);\r\n } catch (Exception e) {\r\n }\r\n NTCredentials creds = new NTCredentials(username, decryptedPassword, getCanonicalHostName()[0], domain);\r\n httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, creds);\r\n httpclient.getAuthSchemes().unregister(AuthPolicy.SPNEGO);\r\n httpclient.getAuthSchemes().unregister(AuthPolicy.KERBEROS);\r\n }\r\n HttpHost target = new HttpHost(url.getHost(), url.getPort(), url.getProtocol());\r\n HttpContext localContext = new BasicHttpContext();\r\n HttpPost post = new HttpPost(url.getFile());\r\n \r\n post.setEntity(new UrlEncodedFormEntity(nvps, Charset.forName(\"UTF-8\")));\r\n\r\n HttpResponse httpResponse = httpclient.execute(target, post, localContext);\r\n this.lastStatusLine = httpResponse.getStatusLine();\r\n lastCookies = httpclient.getCookieStore().getCookies();\r\n\r\n return httpResponse.getEntity();\r\n }", "static Http1Client create() {\n return create(Http1ClientConfig.create());\n }", "@Before\n public void buildClient() {\n BasicCookieStore cookieStore = new BasicCookieStore();\n\n // Build Apache Http Client to execute requests\n this.httpClient = HttpClientBuilder.create()\n .setDefaultCookieStore(cookieStore)\n .setRedirectStrategy(new LaxRedirectStrategy())\n .build();\n }", "private OkHttpClient createClient(){\n HttpLoggingInterceptor logging = new HttpLoggingInterceptor();\n logging.setLevel(HttpLoggingInterceptor.Level.BODY);\n return new OkHttpClient.Builder()\n .addInterceptor(logging)\n .readTimeout(30, TimeUnit.SECONDS)\n .writeTimeout(30, TimeUnit.SECONDS)\n .build();\n }", "public PostBuilder() {\n httpClient = HttpClients.createDefault();\n httpPost = new HttpPost(localTesting ? \"http://localhost:8080\" : \"https://netflixstatistixserver.herokuapp.com\");\n attributes = new ArrayList<>();\n }", "public HttpPost() {\n super();\n parameters = new HashMap<>();\n }", "HttpClientRequest addCookie(Cookie cookie);", "private HttpClient() {\n\t}", "HttpClientRequest header(CharSequence name, CharSequence value);", "HttpResponse post(URL url, Map<String, String> headers, byte[] body, String mediaType)\n throws IOException;", "private static void sendPosts(HttpClient httpClient) {\n HttpTextResponse httpResponse = httpClient.post(\"/hello/mom\");\n puts(httpResponse);\n\n\n /* Send one param post. */\n httpResponse = httpClient.postWith1Param(\"/hello/singleParam\", \"hi\", \"mom\");\n puts(\"single param\", httpResponse);\n\n\n /* Send two param post. */\n httpResponse = httpClient.postWith2Params(\"/hello/twoParams\",\n \"hi\", \"mom\", \"hello\", \"dad\");\n puts(\"two params\", httpResponse);\n\n\n /* Send two param post. */\n httpResponse = httpClient.postWith3Params(\"/hello/3params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\");\n puts(\"three params\", httpResponse);\n\n\n /* Send four param post. */\n httpResponse = httpClient.postWith4Params(\"/hello/4params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\");\n puts(\"4 params\", httpResponse);\n\n /* Send five param post. */\n httpResponse = httpClient.postWith5Params(\"/hello/5params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\",\n \"hola\", \"neighbors\");\n puts(\"5 params\", httpResponse);\n\n\n /* Send six params with post. */\n\n final HttpRequest httpRequest = httpRequestBuilder()\n .setUri(\"/sixPost\")\n .setMethod(\"POST\")\n .addParam(\"hi\", \"mom\")\n .addParam(\"hello\", \"dad\")\n .addParam(\"greetings\", \"kids\")\n .addParam(\"yo\", \"pets\")\n .addParam(\"hola\", \"pets\")\n .addParam(\"salutations\", \"all\").build();\n\n\n httpResponse = httpClient.sendRequestAndWait(httpRequest);\n puts(\"6 params\", httpResponse);\n\n\n //////////////////\n //////////////////\n\n\n /* Using Async support with lambda. */\n httpClient.postAsync(\"/hi/async\", (code, contentType, body) -> puts(\"Async text with lambda\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.postFormAsyncWith1Param(\"/hi/async\", \"hi\", \"mom\", (code, contentType, body) -> puts(\"Async text with lambda 1 param\\n\", body));\n\n Sys.sleep(100);\n\n\n\n /* Using Async support with lambda. */\n httpClient.postFormAsyncWith2Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n (code, contentType, body) -> puts(\"Async text with lambda 2 params\\n\", body));\n\n Sys.sleep(100);\n\n\n\n\n /* Using Async support with lambda. */\n httpClient.postFormAsyncWith3Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n (code, contentType, body) -> puts(\"Async text with lambda 3 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.postFormAsyncWith4Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n (code, contentType, body) -> puts(\"Async text with lambda 4 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.postFormAsyncWith5Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n \"p5\", \"v5\",\n (code, contentType, body) -> puts(\"Async text with lambda 5 params\\n\", body));\n\n Sys.sleep(100);\n\n\n }", "public HttpClient build() {\n\t\tCloseableHttpClient httpClient = httpClientBuilder.build();\n\t\treturn new ApacheHttpClient(this.configuration, httpClient);\n\t}", "public static final DefaultHttpClient createHttpClient(int retryCount) {\n\t\tHttpParams params = new BasicHttpParams();\n\t\tHttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\n\t\tHttpProtocolParams.setContentCharset(params, HTTP.UTF_8);\n\t\t// HttpProtocolParams.setUseExpectContinue(params, true);\n\t\t// Turn off stale checking. Our connections break all the time anyway,\n\t\t// and it's not worth it to pay the penalty of checking every time.\n\t\tHttpConnectionParams.setStaleCheckingEnabled(params, false);\n\n\t\t// Default connection and socket timeout of 30 seconds. Tweak to taste.\n\t\tHttpConnectionParams.setConnectionTimeout(params, 15 * 1000);\n\t\tHttpConnectionParams.setSoTimeout(params, 20 * 1000);\n\t\tHttpConnectionParams.setSocketBufferSize(params, 8192);\n\n\t\tHttpClientParams.setRedirecting(params, true);\n\n\t\tConnManagerParams.setTimeout(params, 5 * 1000);\n\t\tConnManagerParams.setMaxConnectionsPerRoute(params,\n\t\t\t\tnew ConnPerRouteBean(50));\n\t\tConnManagerParams.setMaxTotalConnections(params, 200);\n\n\t\t// Sets up the http part of the service.\n\t\tfinal SchemeRegistry supportedSchemes = new SchemeRegistry();\n\n\t\t// Register the \"http\" protocol scheme, it is required\n\t\t// by the default operator to look up socket factories.\n\t\tfinal SocketFactory sf = PlainSocketFactory.getSocketFactory();\n\t\tsupportedSchemes.register(new Scheme(\"http\", sf, 80));\n\t\tsupportedSchemes.register(new Scheme(\"https\", SSLSocketFactory\n\t\t\t\t.getSocketFactory(), 443));\n\t\tfinal ThreadSafeClientConnManager ccm = new ThreadSafeClientConnManager(\n\t\t\t\tparams, supportedSchemes);\n\t\tDefaultHttpClient httpClient = new DefaultHttpClient(ccm, params);\n\t\thttpClient\n\t\t\t\t.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(\n\t\t\t\t\t\tretryCount, true));\n\t\t// Add gzip header to requests using an interceptor\n\t\thttpClient.addRequestInterceptor(new GzipHttpRequestInterceptor());\n\t\t// Add gzip compression to responses using an interceptor\n\t\thttpClient.addResponseInterceptor(new GzipHttpResponseInterceptor());\n\n\t\treturn httpClient;\n\t}", "public HttpComponentsClientHttpRequest(HttpClient httpClient, HttpUriRequest httpRequest)\r\n/* 25: */ {\r\n/* 26:54 */ this.httpClient = httpClient;\r\n/* 27:55 */ this.httpRequest = httpRequest;\r\n/* 28: */ }", "public HttpAction<HttpPost> post(HttpClient client, String path, HttpEntity entity, Header... headers)\n throws Exception\n {\n HttpPost request = new HttpPost(getBaseURL() + getContextPath() + path);\n if (headers != null && headers.length > 0)\n {\n request.setHeaders(headers);\n }\n if (entity != null)\n {\n request.setEntity(entity);\n }\n request.setEntity(null);\n HttpContext context = new BasicHttpContext();\n HttpResponse response = client.execute(request, context);\n\n return new HttpAction<HttpPost>(client, context, request, response, getBaseURL(), getContextPath());\n }", "public interface HttpPoster {\n\n /**\n * Post data to the provided URL.\n *\n * @param url http url to be reached\n * @param headers headers to be sent\n * @param body body to be sent\n * @param mediaType media type definition\n * @return http response from the POST request\n * @throws IOException in case of http request error\n */\n HttpResponse post(URL url, Map<String, String> headers, byte[] body, String mediaType)\n throws IOException;\n}", "@BeforeClass\n public static void createClient() {\n client = HttpClients.createDefault();\n }", "public TestState httpClient(HttpClient httpClient) {\n this.httpClient = httpClient;\n return this;\n }", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "Header createHeader();", "HttpResponse httpPost(URI uri);", "private DefaultHttpClient createHttpsClient() throws HttpException {\n DefaultHttpClient client = new DefaultHttpClient();\n SSLContext ctx = null;\n X509TrustManager tm = new TrustAnyTrustManager();\n try {\n ctx = SSLContext.getInstance(\"TLS\");\n ctx.init(null, new TrustManager[] { tm }, null);\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n throw new HttpException(\"Can't create a Trust Manager.\", e);\n }\n SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n client.getConnectionManager().getSchemeRegistry().register(new Scheme(\"https\", 443, ssf));\n return client;\n }", "public void setHttpClient( HttpClient req ) {\r\n\tclient=req;\r\n }", "public void postData(String autho, String iVector) {\n HttpClient httpclient = new DefaultHttpClient();\n HttpGet httppost = new HttpGet(url);\n\n try {\n // Add your data\n// List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();\n// nameValuePairs.add(new BasicNameValuePair(\"username\", uName));\n// nameValuePairs.add(new BasicNameValuePair(\"password\", pWord));\n// nameValuePairs.add(new BasicNameValuePair(\"ivector\", iVector));\n\n// httppost.addHeader(\"username\", uName);\n// httppost.addHeader(\"password\", pWord);\n httppost.addHeader(\"Authorization\", autho);\n httppost.addHeader(\"ivector\", iVector);\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n String responseStr = EntityUtils.toString(response.getEntity());\n\n httppost.releaseConnection();\n httpclient.getConnectionManager().shutdown();\n\n\n handleResponse(responseStr);\n\n\n\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n //doNotification();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n\n //doNotification();\n }\n catch (RuntimeException e)\n {\n //doNotification();\n// text = \"Incorrect Username and/or Password\";\n// toast = Toast.makeText(context,text, duration);\n// toast.show();\n }\n }", "@Bean\n public HttpClient httpClient() {\n return new HttpClient(multiThreadedHttpConnectionManager());\n }", "@Test\n public void postRequest() {\n str = METHOD_POST + URI_SAMPLE + \" \" + HTTP_VERSION + ENDL +\n HOST_HEADER + \": www.site.ru\" + ENDL +\n \"Referer: \"+ URI_SAMPLE + ENDL +\n \"Cookie: income=1\" + ENDL +\n \"Content-Type: application/x-www-form-urlencoded\" + ENDL +\n \"Content-Length: 35\" + ENDL +\n \"login=Petya%20Vasechkin&password=qq\";\n\n request = new HttpRequest(str, IP_ADDRESS, HOST);\n assertEquals(request.getMethod(), HttpMethod.POST);\n assertEquals(request.getUrn(), \"www.site.ru/news.html\");\n assertEquals(request.getHeader(HOST_HEADER), \"www.site.ru\");\n assertEquals(request.getHeader(\"Referer\"), URI_SAMPLE);\n assertEquals(request.getHeader(\"Cookie\"), \"income=1\");\n assertEquals(request.getHeader(\"Content-Type\"), \"application/x-www-form-urlencoded\");\n assertEquals(request.getHeader(\"Content-Length\"), \"35\");\n assertEquals(request.getHeader(NONEXISTENT_VAR), \"\");\n\n assertEquals(request.getParameter(\"login\"), \"Petya Vasechkin\");\n assertEquals(request.getParameter(\"password\"), \"qq\");\n assertEquals(request.getParameter(NONEXISTENT_VAR), \"\");\n }", "RequestHeaders headers();", "public Request<E, T> buildHttpPost ()\n\t{\n\t\treturn new HttpPostRequest<E, T>(this);\n\t}", "private static HttpClient getHttpClient() {\n if (mHttpClient == null) {\n mHttpClient = new DefaultHttpClient();\n final HttpParams params = mHttpClient.getParams();\n HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT);\n HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT);\n ConnManagerParams.setTimeout(params, HTTP_TIMEOUT);\n }\n return mHttpClient;\n }", "public static HttpClient getHttpClient() {\n HttpClient httpClient = new DefaultHttpClient();\n final HttpParams params = httpClient.getParams();\n HttpConnectionParams.setConnectionTimeout(params,\n HTTP_REQUEST_TIMEOUT_MS);\n HttpConnectionParams.setSoTimeout(params, HTTP_REQUEST_TIMEOUT_MS);\n ConnManagerParams.setTimeout(params, HTTP_REQUEST_TIMEOUT_MS);\n return httpClient;\n }", "ApacheHttpClientBuilder getApacheHttpClientBuilder();", "public interface HttpClient {\n\n\torg.apache.http.client.HttpClient getClient();\n\n\tString fetch(URI uri) throws IOException;\n\n\tvoid init() throws KeyManagementException, NoSuchAlgorithmException;\n}", "@Test\n public void getEndpoint() throws IOException {\n CloseableHttpClient httpclient = HttpClients.createDefault();\n\n //Creating a HttpGet object\n HttpPost httppost = new HttpPost(\"https://api.github.com/user/repos\");\n String auth=Credentials.getEmail()+\":\"+Credentials.getPassWard();\n byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(Charset.forName(\"ISO-8859-1\")));\n String authHeader=\"Basic \"+new String(encodedAuth);\n httppost.setHeader(HttpHeaders.AUTHORIZATION,authHeader);\n String json=\"{\\\"name\\\": \\\"ploiko\\\"}\";\n httppost.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON));\n HttpResponse httpresponse = httpclient.execute(httppost);\n System.out.println(httpresponse.getStatusLine());\n int actual=httpresponse.getStatusLine().getStatusCode();\n Assert.assertEquals(actual,201);\n //System.out.println(getHeaders(httpresponse,\"Access-Control-Allow-Methods\"));\n //System.out.println(httpresponse.getAllHeaders().toString());\n\n }", "public HttpClient(String host, int port)\n\t{\n\t\tsuper(host, port);\n\t\tclient = new org.apache.commons.httpclient.HttpClient();\n\t}", "public static Object httpClient() {\n return new Object();\n// return HttpClient.newBuilder()\n// .version(HttpClient.Version.HTTP_1_1)\n// .followRedirects(HttpClient.Redirect.NORMAL)\n// .connectTimeout(Duration.ofSeconds(300))\n// .build();\n }", "private static OkHttpClient getOkHttpClient() {\n OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder()\n .addInterceptor(new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request original = chain.request();\n\n Request.Builder requestBuilder = original.newBuilder()\n .method(original.method(), original.body());\n\n addAdditionalHttpHeaders(requestBuilder);\n addParleyHttpHeaders(requestBuilder);\n\n Request request = requestBuilder.build();\n return chain.proceed(request);\n }\n })\n .connectTimeout(30, TimeUnit.SECONDS)\n .readTimeout(30, TimeUnit.SECONDS)\n .writeTimeout(30, TimeUnit.SECONDS);\n\n applySslPinning(okHttpClientBuilder);\n\n return okHttpClientBuilder.build();\n }", "public CloseableHttpClient build() {\n\t\tCloseableHttpClient httpClient = httpClientBuilder.build();\n\t\treturn httpClient;\n\t}", "public WeChatPayHttpComponentsClient(final HttpClient httpClient) {\n checkNotNull(httpClient, \"httpClient\");\n\n this.basePath = WeChatPayClient.BASE_PATH;\n this.httpClient = httpClient;\n }", "public static final DefaultHttpClient createHttpClient(int retryCount,\n\t\t\tint timeout) {\n\t\tHttpParams params = new BasicHttpParams();\n\t\tHttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\n\t\tHttpProtocolParams.setContentCharset(params, HTTP.UTF_8);\n\t\t// HttpProtocolParams.setUseExpectContinue(params, true);\n\t\t// Turn off stale checking. Our connections break all the time anyway,\n\t\t// and it's not worth it to pay the penalty of checking every time.\n\t\tHttpConnectionParams.setStaleCheckingEnabled(params, false);\n\n\t\t// Default connection and socket timeout of 30 seconds. Tweak to taste.\n\t\tHttpConnectionParams.setConnectionTimeout(params, timeout);\n\t\tHttpConnectionParams.setSoTimeout(params, timeout);\n\t\tHttpConnectionParams.setSocketBufferSize(params, 8192);\n\n\t\tHttpClientParams.setRedirecting(params, true);\n\n\t\tConnManagerParams.setTimeout(params, timeout);\n\t\tConnManagerParams.setMaxConnectionsPerRoute(params,\n\t\t\t\tnew ConnPerRouteBean(50));\n\t\tConnManagerParams.setMaxTotalConnections(params, 200);\n\n\t\t// Sets up the http part of the service.\n\t\tfinal SchemeRegistry supportedSchemes = new SchemeRegistry();\n\n\t\t// Register the \"http\" protocol scheme, it is required\n\t\t// by the default operator to look up socket factories.\n\t\tfinal SocketFactory sf = PlainSocketFactory.getSocketFactory();\n\t\tsupportedSchemes.register(new Scheme(\"http\", sf, 80));\n\t\tsupportedSchemes.register(new Scheme(\"https\", SSLSocketFactory\n\t\t\t\t.getSocketFactory(), 443));\n\t\tfinal ThreadSafeClientConnManager ccm = new ThreadSafeClientConnManager(\n\t\t\t\tparams, supportedSchemes);\n\t\tDefaultHttpClient httpClient = new DefaultHttpClient(ccm, params);\n\t\thttpClient\n\t\t\t\t.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(\n\t\t\t\t\t\tretryCount, true));\n\t\t// Add gzip header to requests using an interceptor\n\t\t// httpClient.addRequestInterceptor(new GzipHttpRequestInterceptor());\n\t\t// Add gzip compression to responses using an interceptor\n\t\t// httpClient.addResponseInterceptor(new GzipHttpResponseInterceptor());\n\n\t\treturn httpClient;\n\t}", "private HttpResponse executeHttpPost(String apiUrl) throws OAuthMessageSignerException,\r\n\t\t\tOAuthExpectationFailedException, OAuthCommunicationException, IOException {\r\n\t\tHttpPost httprequest = new HttpPost(apiUrl);\r\n\t\tgetOAuthConsumer().sign(httprequest);\r\n\t\tHttpClient client = new DefaultHttpClient();\r\n\t\tHttpResponse httpresponse = client.execute(httprequest);\r\n\t\tint statusCode = httpresponse.getStatusLine().getStatusCode();\r\n\t\tSystem.out.println(statusCode + \":\" + httpresponse.getStatusLine().getReasonPhrase());\r\n\t\treturn httpresponse;\r\n\t}", "private HttpEntity<?> setTokenToHeaders() {\n HttpHeaders headers = new HttpHeaders();\n headers.set(\"Authorization\", this.token.getToken_type() + \" \" + this.token.getAccess_token());\n headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));\n return new HttpEntity<>(null, headers);\n }", "private CloseableHttpClient getHttpClient() {\n return HttpClients.custom()\n .setConnectionManager(httpClientConnectionManager)\n .setConnectionManagerShared(true)\n .build();\n }", "@Bean\n\tpublic HttpClient httpClient() {\n\t\treturn new HttpClient(this.multiThreadedHttpConnectionManager);\n\t}", "public void sendHttp() {\n String url = \"https://openwhisk.ng.bluemix.net/api/v1/namespaces/1tamir198_tamirSpace/actions/testing_trigger\";\n //api key that i got from blumix EndPoins\n String apiKey = \"530f095a-675e-4e1c-afe0-4b421201e894:0HriiSRoYWohJ4LGOjc5sGAhHvAka1gwASMlhRN8kA5eHgNu8ouogt8BbmXtX21N\";\n try {\n //JSONObject jsonObject = new JSONObject().put(\"openwhisk.ng.bluemix.net\" ,\"c1165fd1-f4cf-4a62-8c64-67bf20733413:hdVl64YRzbHBK0n2SkBB928cy2DUO5XB3yDbuXhQ1uHq8Ir0dOEwT0L0bqMeWTTX\");\n String res = (new HttpRequest(url)).prepare(HttpRequest.Method.POST).withData(apiKey).sendAndReadString();\n //String res = new HttpRequest(url).prepare(HttpRequest.Method.POST).withData(jsonObject.toString()).sendAndReadString();\n System.out.println( res + \"***********\");\n\n } catch ( IOException exception) {\n exception.printStackTrace();\n System.out.println(exception + \" some some some\");\n System.out.println(\"catched error from response ***********\");\n }\n }", "protected HttpClient getHttpClient( ) {\r\n\t\treturn httpClient;\r\n\t}", "public HttpEntity openHttpEntity(URL url) throws IOException {\r\n Logger.getLogger(TargetAuthenticationStrategy.class).setLevel(Level.ERROR);\r\n Logger.getLogger(RequestTargetAuthentication.class).setLevel(Level.ERROR);\r\n DefaultHttpClient httpclient = new DefaultHttpClient();\r\n\r\n for (Cookie cookie : cookies) {\r\n httpclient.getCookieStore().addCookie(cookie);\r\n }\r\n\r\n httpclient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);\r\n\r\n if (socketTimeout > -1) {\r\n httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);\r\n }\r\n if (connectionTimeout > -1) {\r\n httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);\r\n }\r\n\r\n String domain = this.domain;\r\n String username = this.username;\r\n String password = this.password;\r\n if (serviceAccountPropertiesFileName != null) {\r\n Properties serviceAccountProperties = new Properties();\r\n if (new File(serviceAccountPropertiesFileName).exists()) {\r\n serviceAccountProperties.load(new FileReader(serviceAccountPropertiesFileName));\r\n } else {\r\n try {\r\n serviceAccountProperties.load(this.getClass().getResourceAsStream(serviceAccountPropertiesFileName));\r\n } catch (Exception e) {\r\n }\r\n }\r\n domain = serviceAccountProperties.getProperty(\"http.serviceaccount.domain\", domain);\r\n username = serviceAccountProperties.getProperty(\"http.serviceaccount.username\", username);\r\n password = serviceAccountProperties.getProperty(\"http.serviceaccount.password\", password);\r\n }\r\n\r\n if (username != null && password != null) {\r\n String decryptedPassword = password;\r\n try {\r\n decryptedPassword = new StringEncrypter().decrypt(password);\r\n } catch (Exception e) {\r\n }\r\n NTCredentials creds = new NTCredentials(username, decryptedPassword, getCanonicalHostName()[0], domain);\r\n httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, creds);\r\n httpclient.getAuthSchemes().unregister(AuthPolicy.SPNEGO);\r\n httpclient.getAuthSchemes().unregister(AuthPolicy.KERBEROS);\r\n }\r\n HttpHost target = new HttpHost(url.getHost(), url.getPort(), url.getProtocol());\r\n HttpContext localContext = new BasicHttpContext();\r\n HttpGet httpGet = new HttpGet(url.getFile());\r\n HttpResponse httpResponse = httpclient.execute(target, httpGet, localContext);\r\n this.lastStatusLine = httpResponse.getStatusLine();\r\n lastCookies = httpclient.getCookieStore().getCookies();\r\n\r\n return httpResponse.getEntity();\r\n }", "private static HttpRequest buildRequest(final URI uri, final String host) {\n FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,\n getHttpMethod(), uri.getRawPath());\n request.headers().set(HttpHeaderNames.HOST, host);\n request.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE);\n request.headers().set(HttpHeaderNames.ACCEPT_ENCODING,\n HttpHeaderValues.GZIP);\n request.headers().set(HttpHeaderNames.CONTENT_TYPE,\n \"application/json; charset=UTF-8\");\n\n // Set some example cookies.\n request.headers().set(HttpHeaderNames.COOKIE,\n ClientCookieEncoder.STRICT.encode(\n new DefaultCookie(\"my-cookie\", \"foo\"),\n new DefaultCookie(\"another-cookie\", \"bar\")));\n\n // set content\n final ByteBuf buffer = request.content().clear();\n final String json = \"hello, json\";\n int p0 = buffer.writerIndex();\n buffer.writeBytes(json.getBytes(CharsetUtil.UTF_8));\n int p1 = buffer.writerIndex();\n request.headers().set(HttpHeaderNames.CONTENT_LENGTH,\n Integer.toString(p1 - p0));\n\n return request;\n }", "public static HttpURLConnection makePost(URL baseUrl, String path, String params)\n throws IOException {\n URL url = new URL(String.format(\"%s/%s\", baseUrl.toString(), path));\n Log.d(TAG, \"POST \" + url.toString() + \" \" + params);\n\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n connection.setRequestMethod(\"POST\");\n connection.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n connection.setRequestProperty(\"Content-Length\", Integer.toString(params.getBytes().length));\n\n // FIXME: Investigate proper usage of Content-Language\n connection.setRequestProperty(\"Content-Language\", \"en-US\");\n setAcceptLanguage(connection);\n\n connection.setUseCaches(false);\n connection.setDoInput(true);\n connection.setDoOutput(true);\n\n // Send the request\n DataOutputStream wr = new DataOutputStream(connection.getOutputStream());\n wr.writeBytes(params);\n wr.flush();\n wr.close();\n return connection;\n }", "public CurlRequest newRequest(final String action, final String body) {\n\t\tfinal var builder = AWS4SignatureQuery.builder().service(\"cognito-idp\").body(\"&Version=2016-04-18\");\n\t\tfinal var headers = new HashMap<String, String>();\n\t\theaders.put(\"x-amz-target\", \"AWSCognitoIdentityProviderService.\" + action);\n\t\theaders.put(\"Content-Type\", \"application/x-amz-json-1.1\");\n\t\tfinal var query = builder.accessKey(accessKey).secretKey(secretKey).region(region).path(\"/\").headers(headers)\n\t\t\t\t.body(body).host(URI.create(url).getHost()).build();\n\t\tfinal var authorization = signer.computeSignature(query);\n\t\tfinal var request = new CurlRequest(query.getMethod(), url, query.getBody());\n\t\trequest.getHeaders().putAll(query.getHeaders());\n\t\trequest.getHeaders().put(\"Authorization\", authorization);\n\t\trequest.setSaveResponse(true);\n\t\treturn request;\n\t}", "public static String post(String url, String s,Map<String, String> headers) {\n AsyncHttpClient.BoundRequestBuilder builder = asyncHttpClient.preparePost(url);\n builder.setBodyEncoding(DEFAULT_CHARSET);\n builder.setBody(s);\n useCookie(builder);\n builder.setHeader(\"Content-Type\", DEFAULT_CONTENT_TYPE);\n if (headers != null && !headers.isEmpty()) {\n Set<String> keys = headers.keySet();\n for (String key : keys) {\n builder.addHeader(key, headers.get(key));\n }\n }\n Future<Response> f = builder.execute();\n String body = null;\n try {\n body = f.get().getResponseBody(DEFAULT_CHARSET);\n addCookie(f.get().getCookies());\n } catch (Exception e) {\n logger.error(LogUtil.builder().method(\"Post Request(the result is String,the param is a string in request body)\").msg(\"error,url={}\").build(), url, e);\n }\n return body;\n }", "@Override\n\tprotected HttpRequest createHttpRequest() {\n HttpGet httpGet = new HttpGet(getHost() + \"/repos/\" + owner + \"/\" + repo + \"/pulls?state=\" + state);\n httpGet.setHeader(\"Accept\", GITHUB_ACCEPT_HEADER);\n if (username != null && password != null) {\n \thttpGet.setHeader(\"Authentication\", AuthenticationUtils.getBasicAuthentication(username, password));\n }\n return httpGet;\n }", "private void CreateConnection()\n throws IOException {\n URL url = new URL(requestURL);\n //creates connection\n httpConn = (HttpURLConnection) url.openConnection();\n //sets headers\n Set<Map.Entry<String, String>> set = headers.entrySet();\n for (Map.Entry<String, String> me : set) {\n httpConn.setRequestProperty(me.getKey(), me.getValue());\n }\n //sets method\n httpConn.setRequestMethod(method);\n httpConn.setUseCaches(false);\n if (method == \"POST\") {\n httpConn.setDoOutput(true);\n httpConn.setDoInput(true);\n }\n\n }", "public static void main(String[] args) {\n\t\tHttpClient client = new HttpClient();\n\t\tPostMethod myPost = new PostMethod(string );\n\t\ttry{\n\t\t\t//��������ͷ������ \n\t\t\tmyPost.setRequestHeader(\"Content-Type\", \"text/xml\");\n\t\t\tmyPost.setRequestHeader(\"charset\", \"utf-8\");\n\t\t\tmyPost.setRequestHeader(\"x-app-key\", \"c85d54f1\");\n\t\t\tmyPost.setRequestHeader(\"x-sdk-version\", \"3.1\");\n\n\t\t\tString date = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\").format(new Date());\n\t\t\tmyPost.setRequestHeader(\"x-request-date\", date);\n\t\t\tString x_task_config = \"capkey=hwr.cloud.letter\";\n\t\t\tmyPost.setRequestHeader(\"x-task-config\", x_task_config);\n//\t\t\tString b = new String(g_sShortData);\n\t\t\tString str = \"712ddd892cf9163e6383aa169e0454e3\" + date + x_task_config ;\n//\t\t\tSystem.out.println(str);\n\t\t\tmyPost.setRequestHeader(\"x-auth\", MD5.getMD5((str + g_sShortData.toString()).getBytes()));\n//\t\t\tmyPost.setRequestHeader(\"x-udid\", \"101:123456789\");\n\t\t\tSystem.out.println(g_sShortData.length);\n\t\t\tbyte[] b = new byte[g_sShortData.length];\n\t\t\tfor(int i=0; i<g_sShortData.length; i++){\n\t\t\t\tb[i] = (byte) g_sShortData[i];\n\t\t\t}\n\t\t\t\n\t\t\tRequestEntity entity = new StringRequestEntity(new String(b, \"iso-8859-1\"), \"application/octet-stream\", \"iso-8859-1\");\n\t\t\tmyPost.setRequestEntity(entity);\n\t\t\tint statusCode = client.executeMethod(myPost);\n\t\t\tString.format(\"%d\", statusCode);\n\t\t\tSystem.out.println(statusCode);\n\t\t\t\n\t\t\tif (statusCode == HttpStatus.SC_OK) {\n\t\t\t\tInputStream txtis = myPost.getResponseBodyAsStream(); \n\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(txtis, \"utf-8\"));\n\t\t\t\t\n\t\t\t\tString tempbf;\n\t\t\t\tStringBuffer html = new StringBuffer(256);\n\t\t\t\twhile((tempbf = br.readLine()) != null){\n\t\t\t\t\thtml.append(tempbf);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(html.toString());\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public HttpClient post(final Env env, StringValue uri, final Callback handler) {\n client.post(uri.toString(), createResponseHandler(env, handler));\n return this;\n }", "HttpHeaderType createHttpHeaderType();", "private CloseableHttpAsyncClient createHttpClient() {\n RequestConfig.Builder requestConfigBuilder = RequestConfig.custom()\n .setConnectTimeout(Timeout.ofMilliseconds(DEFAULT_CONNECT_TIMEOUT_MILLIS))\n .setResponseTimeout(Timeout.ofMilliseconds(DEFAULT_RESPONSE_TIMEOUT_MILLIS));\n if (requestConfigCallback != null) {\n requestConfigBuilder = requestConfigCallback.customizeRequestConfig(requestConfigBuilder);\n }\n\n try {\n final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create()\n .setSslContext(SSLContext.getDefault())\n // See https://issues.apache.org/jira/browse/HTTPCLIENT-2219\n .setTlsDetailsFactory(new Factory<SSLEngine, TlsDetails>() {\n @Override\n public TlsDetails create(final SSLEngine sslEngine) {\n return new TlsDetails(sslEngine.getSession(), sslEngine.getApplicationProtocol());\n }\n })\n .build();\n\n final PoolingAsyncClientConnectionManager connectionManager = PoolingAsyncClientConnectionManagerBuilder.create()\n .setMaxConnPerRoute(DEFAULT_MAX_CONN_PER_ROUTE)\n .setMaxConnTotal(DEFAULT_MAX_CONN_TOTAL)\n .setTlsStrategy(tlsStrategy)\n .build();\n\n HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClientBuilder.create()\n .setDefaultRequestConfig(requestConfigBuilder.build())\n .setConnectionManager(connectionManager)\n .setTargetAuthenticationStrategy(DefaultAuthenticationStrategy.INSTANCE)\n .disableAutomaticRetries();\n if (httpClientConfigCallback != null) {\n httpClientBuilder = httpClientConfigCallback.customizeHttpClient(httpClientBuilder);\n }\n\n final HttpAsyncClientBuilder finalBuilder = httpClientBuilder;\n return AccessController.doPrivileged((PrivilegedAction<CloseableHttpAsyncClient>) finalBuilder::build);\n } catch (NoSuchAlgorithmException e) {\n throw new IllegalStateException(\"could not create the default ssl context\", e);\n }\n }", "public static Client getHttpClient() {\r\n return c;\r\n }", "public DefaultHttpClientImpl() {\n SchemeRegistry schemeRegistry = new SchemeRegistry();\n schemeRegistry.register(new Scheme(\n \"http\", PlainSocketFactory.getSocketFactory(), 80));\n\n schemeRegistry.register(new Scheme(\n \"https\", SSLSocketFactory.getSocketFactory(), 443));\n conman = new ThreadSafeClientConnManager(params, schemeRegistry);\n }", "public DefaultHttpRequestBuilder (final DefaultHttpClient client) {\r\n\t\tif (client == null) {\r\n\t\t\tthrow new NullPointerException (\"client cannot be null\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.client = client;\r\n\t}", "public static HttpCarbonMessage createHttpCarbonMessage() {\n HttpCarbonMessage httpCarbonMessage;\n httpCarbonMessage = new HttpCarbonMessage(\n new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK));\n return httpCarbonMessage;\n }", "public void enablePOST() {\n\t\thttpPost = new HttpPost(\"http://23.21.229.136/message.php\");\n\t\thttpPostLog = new HttpPost(\n\t\t\t\t\"http://capstonecontrol.appspot.com/LogModuleEventServlet\");\n\t\thttpPostScheduledEvent = new HttpPost(\n\t\t\t\t\"http://capstonecontrol.appspot.com/ScheduleEvent\");\n\t\tHttpParams httpParameters = new BasicHttpParams();\n\t\t// Set the timeout in milliseconds until a connection is established.\n\t\tint timeoutConnection = 3000;\n\t\tHttpConnectionParams.setConnectionTimeout(httpParameters,\n\t\t\t\ttimeoutConnection);\n\t\t// Set the default socket timeout (SO_TIMEOUT)\n\t\t// in milliseconds which is the timeout for waiting for data.\n\t\tint timeoutSocket = 3000;\n\t\tHttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);\n\n\t\thttpClient = new DefaultHttpClient(httpParameters);\n\t}", "public void post(Controller controller) {\n ExecutorService executorService = Executors.newSingleThreadExecutor();\n executorService.execute(() -> {\n String responseString = null;\n try {\n httpPost.setEntity(new UrlEncodedFormEntity(attributes, \"UTF-8\"));\n HttpResponse response = httpClient.execute(httpPost);\n HttpEntity entity = response.getEntity();\n if (entity != null) {\n responseString = EntityUtils.toString(entity);\n }\n } catch (Exception exc) {\n exc.printStackTrace();\n }\n controller.handleResponse(responseString);\n });\n }", "public HTTPResponse( Transaction t, Content ct, Headers hd ){\n super();\n\n Pia.debug(this, \"Constructor-- [ transaction t, content ct, headers hd ] on duty...\");\n\n contentObj = ct;\n headersObj = hd; // maybe generate?\n\n if( contentObj != null )\n contentObj.setHeaders( headersObj );\n \n requestTran = t;\n fromMachine( t.toMachine() );\n toMachine( t.fromMachine() );\n\n startThread();\n }", "static Http1Client create(Http1ClientConfig clientConfig) {\n return new Http1ClientImpl(WebClient.create(it -> it.from(clientConfig)), clientConfig);\n }", "@SuppressWarnings(\"deprecation\")\n\tprotected static HttpUriRequest createHttpRequest(Request<?> request, Map<String, String> additionalHeaders) throws AuthFailureError {\n\t\tswitch (request.getMethod()) {\n\t\tcase Method.DEPRECATED_GET_OR_POST: {\n\t\t\t// This is the deprecated way that needs to be handled for backwards compatibility.\n\t\t\t// If the request's post body is null, then the assumption is that the request is\n\t\t\t// GET. Otherwise, it is assumed that the request is a POST.\n\t\t\tbyte[] postBody = request.getPostBody();\n\t\t\tif (postBody != null) {\n\t\t\t\tHttpPost postRequest = new HttpPost(request.getUrl());\n\t\t\t\tpostRequest.addHeader(HEADER_CONTENT_TYPE, request.getPostBodyContentType());\n\t\t\t\tHttpEntity entity;\n\t\t\t\tentity = new ByteArrayEntity(postBody);\n\t\t\t\tpostRequest.setEntity(entity);\n\t\t\t\treturn postRequest;\n\t\t\t} else {\n\t\t\t\treturn new HttpGet(request.getUrl());\n\t\t\t}\n\t\t}\n\t\tcase Method.GET:\n\t\t\treturn new HttpGet(request.getUrl());\n\t\tcase Method.DELETE:\n\t\t\treturn new HttpDelete(request.getUrl());\n\t\tcase Method.POST: {\n\t\t\tHttpPost postRequest = new HttpPost(request.getUrl());\n\t\t\tpostRequest.addHeader(HEADER_CONTENT_TYPE, request.getBodyContentType());\n\t\t\tsetEntityIfNonEmptyBody(postRequest, request);\n\t\t\treturn postRequest;\n\t\t}\n\t\tcase Method.PUT: {\n\t\t\tHttpPut putRequest = new HttpPut(request.getUrl());\n\t\t\tputRequest.addHeader(HEADER_CONTENT_TYPE, request.getBodyContentType());\n\t\t\tsetEntityIfNonEmptyBody(putRequest, request);\n\t\t\treturn putRequest;\n\t\t}\n\t\tdefault:\n\t\t\tthrow new IllegalStateException(\"Unknown request method.\");\n\t\t}\n\t}", "public PublishingClientImpl() {\n this.httpClientSupplier = () -> HttpClients.createDefault();\n this.requestBuilder = new PublishingRequestBuilderImpl();\n }", "public <T> T create(String baseUrl, Class<T> clz) {\n String service_url = \"\";\n try {\n Field field1 = clz.getField(\"BASE_URL\");\n service_url = (String) field1.get(clz);\n } catch (NoSuchFieldException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.getMessage();\n e.printStackTrace();\n }\n return createApiClient(\n TextUtils.isEmpty(service_url) ? baseUrl : service_url).create(clz);\n }", "public interface HttpClientable {\n\n void get(String url);\n\n void get(String url, ParamStore params);\n\n void get(String url, ParamStore params, String tag);\n\n void post(String url, SparseArray<String> params);\n\n void post(String url, SparseArray<String> params, String tag);\n\n void upload(String url, HashMap<String, Object> params);\n\n void upload(String url, HashMap<String, Object> params, String tag);\n\n void download(String url);\n\n void download(String url, String tag);\n\n void cancelAll();\n\n void cancel(String tag);\n\n}", "public ResponseFromHTTP makeRequest() throws CustomRuntimeException\n\t{\n\t\tResponseFromHTTP result=null;\n\t\tCloseableHttpClient httpclient=null;\n\t\tCloseableHttpResponse response=null;\n\t\tboolean needAuth=false;\n\t\tboolean viaProxy=httpTransportInfo.isUseProxy() && StringUtils.isNotBlank(httpTransportInfo.getProxyHost());\n\n\t\tHttpHost target = new HttpHost(httpTransportInfo.getHost(), httpTransportInfo.getPort(),httpTransportInfo.getProtocol());\n\t\t//basic auth for request\n\t\tCredentialsProvider credsProvider = new BasicCredentialsProvider();\n\t\tif(StringUtils.isNotBlank(httpTransportInfo.getLogin()) && \n\t\t\t\tStringUtils.isNotBlank(httpTransportInfo.getPassword()))\n\t\t{\n\t\t\tcredsProvider.setCredentials(\n\t\t\t\t\tnew AuthScope(target.getHostName(), target.getPort()),\n\t\t\t\t\tnew UsernamePasswordCredentials(httpTransportInfo.getLogin(), httpTransportInfo.getPassword()));\n\t\t\tneedAuth=true;\n\t\t}\n\n\t\t//proxy auth?\n\t\tif(viaProxy && StringUtils.isNotBlank(httpTransportInfo.getProxyLogin()) &&\n\t\t\t\tStringUtils.isNotBlank(httpTransportInfo.getProxyPassword()))\n\t\t{\n\t\t\t//proxy auth setting\n\t\t\tcredsProvider.setCredentials(\n\t\t\t\t\tnew AuthScope(httpTransportInfo.getProxyHost(), httpTransportInfo.getProxyPort()),\n\t\t\t\t\tnew UsernamePasswordCredentials(httpTransportInfo.getProxyLogin(), httpTransportInfo.getProxyPassword()));\n\t\t}\n\n\t\ttry\n\t\t{\n\n\t\t\tHttpClientBuilder httpclientBuilder = HttpClients.custom()\n\t\t\t\t\t.setDefaultCredentialsProvider(credsProvider);\n\t\t\t//https\n\t\t\tif(\"https\".equalsIgnoreCase(httpTransportInfo.getProtocol()))\n\t\t\t{\n\t\t\t\t//A.K. - Set stub for check certificate - deprecated from 4.4.1\n\t\t\t\tSSLContextBuilder sslContextBuilder=SSLContexts.custom();\n\t\t\t\tTrustStrategyLZ trustStrategyLZ=new TrustStrategyLZ();\n\t\t\t\tsslContextBuilder.loadTrustMaterial(null,trustStrategyLZ);\n\t\t\t\tSSLContext sslContext = sslContextBuilder.build();\n\t\t\t\tSSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext,SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);\n\t\t\t\thttpclientBuilder.setSSLSocketFactory(sslsf);\n\t\t\t}\n\n\t\t\thttpclient=httpclientBuilder.build();\n\n\t\t\t//timeouts\n\t\t\tBuilder builder = RequestConfig.custom()\n\t\t\t\t\t.setSocketTimeout(httpTransportInfo.getSocketTimeoutSec()*1000)\n\t\t\t\t\t.setConnectTimeout(httpTransportInfo.getConnectTimeoutSec()*1000);\n\n\t\t\t//via proxy?\n\t\t\tif(viaProxy)\n\t\t\t{\n\t\t\t\t//proxy setting\n\t\t\t\tHttpHost proxy = new HttpHost(httpTransportInfo.getProxyHost(),httpTransportInfo.getProxyPort(),httpTransportInfo.getProxyProtocol());\n\t\t\t\tbuilder.setProxy(proxy);\n\t\t\t}\n\n\t\t\tRequestConfig requestConfig=builder.build();\n\n\t\t\t// Create AuthCache instance\n\t\t\tAuthCache authCache = new BasicAuthCache();\n\t\t\t// Generate BASIC scheme object and add it to the local\n\t\t\t// auth cache\n\t\t\tBasicScheme basicAuth = new BasicScheme();\n\t\t\tauthCache.put(target, basicAuth);\n\n\t\t\t// Add AuthCache to the execution context\n\t\t\tHttpClientContext localContext = HttpClientContext.create();\n\t\t\tlocalContext.setAuthCache(authCache);\n\n\t\t\tPathParser parsedPath=new PathParser(getUri());\n\t\t\tif(restMethodDef.isUseOriginalURI())\n\t\t\t{\n\t\t\t\t//in this case params from URI will not add to all params\n\t\t\t\tparsedPath.getParams().clear();\n\t\t\t}\n\t\t\tparsedPath.getParams().addAll(getRequestDefinition().getParams());\n\t\t\t//prepare URI\n\t\t\tURIBuilder uriBuilder = new URIBuilder().setPath(parsedPath.getUri());\n\t\t\tif(!getRequestDefinition().isHttpMethodPost())\n\t\t\t{\n\t\t\t\t//form's parameters - GET/DELETE/OPTIONS/PUT\n\t\t\t\tfor(NameValuePair nameValuePair : parsedPath.getParams())\n\t\t\t\t{\n\t\t\t\t\turiBuilder.setParameter(nameValuePair.getName(),nameValuePair.getValue());\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tURI resultUri =(restMethodDef.isUseOriginalURI())?new URI(getUri()):uriBuilder.build();\n\n\t\t\t//\t\t\tHttpRequestBase httpPostOrGet=(getRequestDefinition().isHttpMethodPost())?\n\t\t\t//\t\t\t\t\tnew HttpPost(resultUri):\n\t\t\t//\t\t\t\t\tnew HttpGet(resultUri);\n\n\t\t\tHttpRequestBase httpPostOrGetEtc=null;\n\t\t\t//\n\t\t\tswitch(getRequestDefinition().getHttpMethod())\n\t\t\t{\n\t\t\t\tcase POST: httpPostOrGetEtc=new HttpPost(resultUri);break;\n\t\t\t\tcase DELETE: httpPostOrGetEtc=new HttpDelete(resultUri);break;\n\t\t\t\tcase OPTIONS: httpPostOrGetEtc=new HttpOptions(resultUri);break;\n\t\t\t\tcase PUT: httpPostOrGetEtc=new HttpPut(resultUri);break;\n\n\t\t\t\tdefault: httpPostOrGetEtc=new HttpGet(resultUri);break;\n\t\t\t}\n\n\t\t\t//Specifie protocol version\n\t\t\tif(httpTransportInfo.isVersionHttp10())\n\t\t\t\thttpPostOrGetEtc.setProtocolVersion(HttpVersion.HTTP_1_0);\n\n\t\t\t//user agent\n\t\t\thttpPostOrGetEtc.setHeader(HttpHeaders.USER_AGENT,httpTransportInfo.getUserAgent());\n\t\t\t//заголовки из запроса\n\t\t\tif(getRequestDefinition().getHeaders().size()>0)\n\t\t\t{\n\t\t\t\tfor(NameValuePair nameValuePair : getRequestDefinition().getHeaders())\n\t\t\t\t{\n\t\t\t\t\tif(org.apache.commons.lang.StringUtils.isNotBlank(nameValuePair.getName()) &&\n\t\t\t\t\t\t\torg.apache.commons.lang.StringUtils.isNotBlank(nameValuePair.getValue()))\n\t\t\t\t\t{\n\t\t\t\t\t\thttpPostOrGetEtc.setHeader(nameValuePair.getName(),nameValuePair.getValue());\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Additional HTTP headers from httpTransportInfo\n\t\t\tif(httpTransportInfo.getAddHeaders()!=null)\n\t\t\t{\n\t\t\t\tfor(Map.Entry<String, String> entry:httpTransportInfo.getAddHeaders().entrySet())\n\t\t\t\t{\n\t\t\t\t\tif(org.apache.commons.lang.StringUtils.isNotBlank(entry.getKey()) &&\n\t\t\t\t\t\t\torg.apache.commons.lang.StringUtils.isNotBlank(entry.getValue()))\n\t\t\t\t\t{\n\t\t\t\t\t\thttpPostOrGetEtc.setHeader(entry.getKey(),entry.getValue());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\thttpPostOrGetEtc.setConfig(requestConfig);\n\t\t\t//Form's parameters, request POST\n\t\t\tif(getRequestDefinition().isHttpMethodPost())\n\t\t\t{\n\t\t\t\tif(getPostBody()!=null)\n\t\t\t\t{\n\t\t\t\t\tStringEntity stringEntity=new StringEntity(getPostBody(),httpTransportInfo.getCharset());\n\t\t\t\t\t((HttpPost) (httpPostOrGetEtc)).setEntity(stringEntity);\n\t\t\t\t}\n\t\t\t\telse if(parsedPath.getParams().size()>0)\n\t\t\t\t{\n\t\t\t\t\tUrlEncodedFormEntity entityForm = new UrlEncodedFormEntity(parsedPath.getParams(), httpTransportInfo.getCharset());\n\t\t\t\t\t((HttpPost) (httpPostOrGetEtc)).setEntity(entityForm);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Body for PUT\n\t\t\tif(getRequestDefinition().getHttpMethod()==HttpMethod.PUT)\n\t\t\t{\n\t\t\t\tif(getPostBody()!=null)\n\t\t\t\t{\n\t\t\t\t\tStringEntity stringEntity=new StringEntity(getPostBody(),httpTransportInfo.getCharset());\n\t\t\t\t\t((HttpPut) (httpPostOrGetEtc)).setEntity(stringEntity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresponse = httpclient.execute(target, httpPostOrGetEtc, (needAuth)?localContext:null);\n\t\t\t//response.\n\t\t\tHttpEntity entity = response.getEntity();\n\t\t\tif(entity!=null)\n\t\t\t{\n\t\t\t\t//charset\n\t\t\t\tContentType contentType = ContentType.get(entity);\n\t\t\t\tString currentCharSet=httpTransportInfo.getCharset();\n\t\t\t\tif(contentType!=null)\n\t\t\t\t{\n\t\t\t\t\t//String mimeType = contentType.getMimeType();\n\t\t\t\t\tif(contentType.getCharset()!=null)\n\t\t\t\t\t\tcurrentCharSet=contentType.getCharset().name();\n\t\t\t\t}\n\t\t\t\tInputStream inputStream=entity.getContent();\n\t\t\t\tif(getRequestDefinition().isBinaryResponseBody())\n\t\t\t\t{\n\t\t\t\t\t//binary content\n\t\t\t\t\tbyte[] bodyBin = IOUtils.toByteArray(inputStream);\n\t\t\t\t\tresult=new ResponseFromHTTP(response.getAllHeaders(),bodyBin,response.getStatusLine().getStatusCode());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//copy content to string\n\t\t\t\t\tStringWriter writer = new StringWriter();\n\t\t\t\t\tIOUtils.copy(inputStream, writer, currentCharSet);\n\t\t\t\t\tresult=new ResponseFromHTTP(response.getAllHeaders(),writer.toString(),response.getStatusLine().getStatusCode());\n\t\t\t\t}\n\t\t\t\tinputStream.close();\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new CustomRuntimeException(\"fetchData over http uri: \"+getUri(),e);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif(response!=null)\n\t\t\t\t\tresponse.close();\n\t\t\t\tif(httpclient!=null)\n\t\t\t\t\thttpclient.close();\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t} \t\n\t\t}\t\t\n\t\treturn result;\n\n\t}", "void addHttpContent(HttpContent httpContent);", "public void postAny(String postUrl, StringEntity postingString) {\r\n try {\r\n HttpPost post = new HttpPost(postUrl);\r\n TrustStrategy acceptingTrustStrategy = new TrustSelfSignedStrategy();\r\n SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy)\r\n .build();\r\n SSLConnectionSocketFactory scsf = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE);\r\n HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(scsf).build();\r\n post.addHeader(\"accept\", \"application/json\");\r\n post.setHeader(\"Content-type\", \"application/json\");\r\n post.setEntity(postingString);\r\n HttpResponse response = httpClient.execute(post);\r\n\r\n System.out.println(\"Response is \" + response.toString());\r\n } catch (Exception e) {\r\n System.out.println(\"Exception \" + e);\r\n }\r\n }", "public static final DefaultHttpClient createHttpClient(String proxyUri,\n\t\t\tint port) {\n\t\t// Shamelessly cribbed from AndroidHttpClient\n\t\tHttpParams params = new BasicHttpParams();\n\t\tHttpHost host = new HttpHost(proxyUri, port);\n\t\tparams.setParameter(ConnRouteParams.DEFAULT_PROXY, host);\n\n\t\tHttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);\n\t\tHttpProtocolParams.setContentCharset(params, HTTP.UTF_8);\n\t\t// HttpProtocolParams.setUseExpectContinue(params, true);\n\t\t// Turn off stale checking. Our connections break all the time anyway,\n\t\t// and it's not worth it to pay the penalty of checking every time.\n\t\tHttpConnectionParams.setStaleCheckingEnabled(params, false);\n\n\t\t// Default connection and socket timeout of 30 seconds. Tweak to taste.\n\t\tHttpConnectionParams.setConnectionTimeout(params, 10 * 1000);\n\t\tHttpConnectionParams.setSoTimeout(params, 20 * 1000);\n\t\tHttpConnectionParams.setSocketBufferSize(params, 8192);\n\n\t\tHttpClientParams.setRedirecting(params, true);\n\n\t\tConnManagerParams.setTimeout(params, 5 * 1000);\n\t\tConnManagerParams.setMaxConnectionsPerRoute(params,\n\t\t\t\tnew ConnPerRouteBean(50));\n\t\tConnManagerParams.setMaxTotalConnections(params, 200);\n\n\t\t// Sets up the http part of the service.\n\t\tfinal SchemeRegistry supportedSchemes = new SchemeRegistry();\n\n\t\t// Register the \"http\" protocol scheme, it is required\n\t\t// by the default operator to look up socket factories.\n\t\tfinal SocketFactory sf = PlainSocketFactory.getSocketFactory();\n\t\tsupportedSchemes.register(new Scheme(\"http\", sf, 80));\n\t\tsupportedSchemes.register(new Scheme(\"https\", SSLSocketFactory\n\t\t\t\t.getSocketFactory(), 443));\n\t\tfinal ThreadSafeClientConnManager ccm = new ThreadSafeClientConnManager(\n\t\t\t\tparams, supportedSchemes);\n\t\tDefaultHttpClient httpClient = new DefaultHttpClient(ccm, params);\n\t\thttpClient\n\t\t\t\t.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(\n\t\t\t\t\t\t3, true));\n\t\t// Add gzip header to requests using an interceptor\n\t\thttpClient.addRequestInterceptor(new GzipHttpRequestInterceptor());\n\t\t// Add gzip compression to responses using an interceptor\n\t\thttpClient.addResponseInterceptor(new GzipHttpResponseInterceptor());\n\n\t\treturn httpClient;\n\t}", "public MercadoPagoAPI() {\n\t\tsuper();\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.set(HEADER_AUTHORIZATION, authorizationToken);\n\t\theaders.set(HEADER_CONTENT_TYPE, JSON_CONTENT_TYPE);\n\t\tHEADER = new HttpEntity<Object>(headers);\n\t}", "public MockHttpServletRequest newPost(String url) {\n return new MockHttpServletRequest(\"POST\", url);\n }", "private <T> HttpEntity createHttpEntityForJson(T body) {\r\n\t\tString dataForEntity;\r\n\t\tif (!(body instanceof String)) {\r\n\t\t\tdataForEntity = gson.toJson(body);\r\n\t\t} else {\r\n\t\t\tdataForEntity = (String) body;\r\n\t\t}\r\n\t\t// try {\r\n\t\treturn new StringEntity(dataForEntity, Charset.forName(\"utf-8\"));\r\n\t\t// } catch (UnsupportedEncodingException e) {\r\n\t\t// e.printStackTrace();\r\n\t\t// }\r\n\t\t// return null;\r\n\t}", "private OkHttpClient Create() {\n final OkHttpClient.Builder baseClient = new OkHttpClient().newBuilder()\n .connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS)\n .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)\n .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS);\n\n // If there's no proxy just create a normal client\n if (appProps.getProxyHost().isEmpty()) {\n return baseClient.build();\n }\n\n final OkHttpClient.Builder proxyClient = baseClient\n .proxy(new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(appProps.getProxyHost(), Integer.parseInt(appProps.getProxyPort()))));\n\n if (!appProps.getProxyUsername().isEmpty() && !appProps.getProxyPassword().isEmpty()) {\n\n Authenticator proxyAuthenticator;\n String credentials;\n\n credentials = Credentials.basic(appProps.getProxyUsername(), appProps.getProxyPassword());\n\n // authenticate the proxy\n proxyAuthenticator = (route, response) -> response.request().newBuilder()\n .header(\"Proxy-Authorization\", credentials)\n .build();\n proxyClient.proxyAuthenticator(proxyAuthenticator);\n }\n return proxyClient.build();\n\n }", "private final static HttpRequest createRequest() {\r\n\r\n HttpRequest req = new BasicHttpRequest\r\n (\"GET\", \"/\", HttpVersion.HTTP_1_1);\r\n //(\"OPTIONS\", \"*\", HttpVersion.HTTP_1_1);\r\n\r\n return req;\r\n }", "@Provides\n @Singleton\n Client provideHttpClient(Environment environment, PermissionsAppConfig config) {\n HttpClientConfiguration httpClientConfiguration = new HttpClientConfiguration();\n httpClientConfiguration.setTimeout(Duration.milliseconds(7000));\n\n HttpClientBuilder clientBuilder = new HttpClientBuilder(environment);\n clientBuilder.using(httpClientConfiguration);\n\n JerseyClientBuilder builder = new JerseyClientBuilder(environment);\n builder.setApacheHttpClientBuilder(clientBuilder);\n\n Client client = builder.build(\"jerseyClient\");\n client.register(ClientCorrelationIdFilter.class, 1);\n client.register(JerseyLoggingFilter.class, 2);\n return client;\n }", "public static void main(String[] args) throws Exception {\n\n CloseableHttpClient aDefault = HttpClients.createDefault();\n\n\n /* HttpPost httpPost = new HttpPost(\"http://172.16.18.88:8080/toLogin.do\");\n List<NameValuePair> paramList = new ArrayList<>();\n paramList.add(new BasicNameValuePair(\"email\", \"hf\"));\n paramList.add(new BasicNameValuePair(\"pwd\", \"1234\"));\n paramList.add(new BasicNameValuePair(\"url\", \"\"));\n UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(paramList, \"UTF-8\");\n httpPost.setEntity(postEntity);\n HttpEntity entity = aDefault.execute(httpPost).getEntity();\n System.out.println(EntityUtils.toString(entity,DEFAULT_CHARSET));*/\n\n\n HttpGet httpGet = new HttpGet(\"http://e-hentai.org\");\n httpGet.setHeader(\"User-Agent\", DEFAULT_USER_AGENT);\n CloseableHttpResponse execute = aDefault.execute(httpGet);\n System.out.println(EntityUtils.toString(execute.getEntity(), DEFAULT_CHARSET));\n\n\n String phone = \"13920266937\";\n String code = \"北京,邢台,上海。\";\n String tplId = \"39638\";\n String url = \"http://v.juhe.cn/sms/send?mobile=\" + phone + \"&tpl_id=\" + tplId + \"&tpl_value=%23code%23%3D\" + code + \"&key=e3d4c483e58d86102bce4e05dcf071c1\";\n String s = httpPost(url);\n System.out.println(s);\n }", "protected WebTestArtifact makeHttpRequest(String resource, String httpMethod)\r\n {\r\n return new WebTestArtifact(resource, httpMethod);\r\n }", "public BitbucketServiceFactory() {\n this.httpClient = HttpClient::create;\n }", "public AsyncHttpResponse(String url, HttpResponseHeaders headers, byte[] payload) {\n mUrl = url;\n mHeaders = headers;\n mPayload = payload;\n mException = null;\n }", "private HttpHeaders getHttpHeaders()\r\n\t{\n HttpHeaders lHttpHeaders = new HttpHeaders();\r\n lHttpHeaders.setContentType(MediaType.APPLICATION_JSON);\r\n lHttpHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));\r\n // set basic authorization with api key and its value\r\n lHttpHeaders.setBasicAuth( PaymentConstant.API_KEY_ID, PaymentConstant.API_KEY_PASSWORD );\r\n return lHttpHeaders;\r\n\t}", "@Provides\n @Singleton\n OkHttpClient provideOkHttpClient() {\n final HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();\n loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\n\n OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder()\n .addInterceptor(loggingInterceptor);\n\n return clientBuilder.build();\n }", "CompletableFuture<PostResponse> createNewPost(Post post);", "public HttpEntity openHttpEntityViaPost(URL url, Map<String, String> params) throws IOException {\r\n List<NameValuePair> nvps = new ArrayList<NameValuePair>();\r\n for (String pName : params.keySet()) {\r\n nvps.add(new BasicNameValuePair(pName, params.get(pName)));\r\n }\r\n return openHttpEntityViaPost(url, nvps);\r\n }", "public Builder httpClientInstance(okhttp3.OkHttpClient httpClientInstance) {\r\n configurationBuilder.httpClientInstance(httpClientInstance);\r\n return this;\r\n }", "String addclient(ContentValues client);", "ResponseHandler createResponseHandler();" ]
[ "0.6946483", "0.6791638", "0.6690835", "0.64410734", "0.62591386", "0.6240455", "0.6178956", "0.6175448", "0.61484545", "0.6023752", "0.5957844", "0.59496754", "0.5921056", "0.59040177", "0.59015733", "0.5873391", "0.5845826", "0.58342654", "0.58114904", "0.5791647", "0.5717884", "0.56985545", "0.569217", "0.5644128", "0.56242037", "0.56102854", "0.5597314", "0.55541474", "0.55323434", "0.5526996", "0.5520274", "0.55161846", "0.54995114", "0.5497852", "0.54958993", "0.5477244", "0.54433244", "0.5438142", "0.54338247", "0.54281527", "0.5414742", "0.54139376", "0.53647244", "0.53617865", "0.5339481", "0.53380865", "0.53364104", "0.5334233", "0.5329836", "0.53268313", "0.53247386", "0.5323812", "0.5317347", "0.5308425", "0.52751386", "0.5274291", "0.5265499", "0.52582216", "0.5252781", "0.5249137", "0.5244037", "0.5211955", "0.52056456", "0.5201673", "0.5200589", "0.5200061", "0.51961195", "0.51808876", "0.51779777", "0.5166962", "0.5153572", "0.51530576", "0.5147452", "0.513328", "0.51292074", "0.5104871", "0.51039267", "0.50986284", "0.5091155", "0.5090944", "0.50671417", "0.5056048", "0.5045958", "0.5044684", "0.50350004", "0.50224197", "0.5014609", "0.4993788", "0.4986222", "0.49804986", "0.49729627", "0.49706396", "0.49675897", "0.4950506", "0.4947168", "0.4942878", "0.49418905", "0.4939811", "0.4936247", "0.4921142", "0.4908117" ]
0.0
-1
Creates an Input object connected to PortAudio, with the given number of inputs.
public RealTimeInput(int numInputs, PApplet pa) { // this(numInputs, new AudioContext(new AudioServerIO.JavaSound(), 512, AudioContext.defaultAudioFormat(numInputs, numInputs))); this(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), pa); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "InputPort createInputPort();", "public abstract BasicInput createInput( boolean isSeq ) throws IOException;", "public RealTimeInput(int numInputs, AudioContext audioContext, boolean skip5thru8, PApplet pa)\n\t{\n\t\tif(numInputs < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): int parameter \" + numInputs + \" is less than 1; must be 1 or greater.\");\n\t\t} // if(numInputs < 1)\n\t\tif(audioContext == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): AudioContext parameter \" + audioContext + \" is null.\");\n\t\t} // if(numInputs < 1)\n\n\t\tthis.numInputs = numInputs;\n\t\tthis.ac \t\t= audioContext;\n\t\tthis.pa\t\t\t= pa;\n\t\tthis.skip5thru8\t= skip5thru8;\n\t\t\n\t\tif(this.skip5thru8)\n\t\t{\n\t\t\tthis.adjustedNumInputs\t= this.numInputs - 4;\n\t\t\tSystem.out.println(\"this.adjustedNumInputs = \" + this.adjustedNumInputs);\n\t\t} else {\n\t\t\tthis.adjustedNumInputs\t= this.numInputs;\n\t\t} // \n\t\t\n\t\tthis.disposeHandler\t= new DisposeHandler(this.pa, this);\n\t\tSystem.out.println(\"just registered DisposeHandler for \" + pa);\n\n\t\tthis.uGenArrayFromNumInputs(this.numInputs);\n\t}", "public void testMixer_getNumberOfInputPortMin() throws InterruptedException {\n Integer NbPortTested = 1;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", 2, mixer.getNumberOfInputPort(),0);\n }", "public RealTimeInput(int numInputs, boolean skip5thru8, PApplet pa)\n\t{\n\t\tthis(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), skip5thru8, pa);\n\n\t}", "public void testMixer_getNumberOfInputPort() throws InterruptedException {\n Integer NbPortTested = 3;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", NbPortTested, mixer.getNumberOfInputPort(),0);\n }", "public void testMixer_getNumberOfInputPortMax() throws InterruptedException {\n Integer NbPortTested = 11;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", 10, mixer.getNumberOfInputPort(),0);\n }", "public void setNumberOfInputs(int numberOfInputs)\n {\n this.numberOfInputs = numberOfInputs;\n }", "public static void setNumberOfInputs(int _n)\r\n {\r\n numberOfInputs = _n;\r\n }", "Input createInput();", "public RealTimeInput(int numInputs, AudioContext audioContext, PApplet pa)\n\t{\n\t\tthis(numInputs, audioContext, false, pa);\n\t}", "INPUT createINPUT();", "public void setInputCount(final int i) {\n this.inputCount = i;\n\n }", "public void completeInputPortSettings(int newPortCount) {\n changeInPortCount(newPortCount);\n\t\tfor (int i = 0; i < (newPortCount); i++) {\n\t\t\tPort inPort = new Port(Constants.INPUT_SOCKET_TYPE + (i), Constants.INPUT_SOCKET_TYPE\n\t\t\t\t\t+ (i), this, newPortCount, PortTypeEnum.IN, (i), isAllowMultipleLinksForPort(\"in0\"), \n\t\t\t\t\tisLinkMandatoryForPort(\"in0\"), PortAlignmentEnum.LEFT);\n\t\t\tports.put(Constants.INPUT_SOCKET_TYPE + (i), inPort);\n\t\t\tfirePropertyChange(\"Component:add\", null, inPort);\n\t\t}\n\t}", "public static BasicInput createSequentialInput( final DataInput in ) {\n return new BasicInput() {\n public byte readByte() throws IOException {\n return in.readByte();\n }\n public short readShort() throws IOException {\n return in.readShort();\n }\n public int readInt() throws IOException {\n return in.readInt();\n }\n public long readLong() throws IOException {\n return in.readLong();\n }\n public float readFloat() throws IOException {\n return in.readFloat();\n }\n public double readDouble() throws IOException {\n return in.readDouble();\n }\n public void skip( long nbyte ) throws IOException {\n IOUtils.skipBytes( in, nbyte );\n }\n public boolean isRandom() {\n return false;\n }\n public void seek( long offset ) {\n throw new UnsupportedOperationException();\n }\n public long getOffset() {\n throw new UnsupportedOperationException();\n }\n public void close() {\n }\n };\n }", "public InputConsumerFactory(int inputParameterIndex) {\r\n\t\tthis.inputParameterIndex = inputParameterIndex;\r\n\t}", "public Sample(int numberOfInputs, int numberOfOutputs)\n {\n inputs = new ArrayList<>();\n outputs = new ArrayList<>();\n this.numberOfInputs = numberOfInputs;\n this.numberOfOutputs = numberOfOutputs;\n }", "public Input(MOSEFSettings settings) {\n this.settings = settings;\n\n try {\n AudioFormat format =\n new AudioFormat(settings.getSampleRate(), settings.getBitRate(), 1, true, true);\n int byterate = settings.getBitRate() / 8;\n this.bufferSize = settings.getBufferSize() * byterate;\n targetLine = AudioSystem.getTargetDataLine(format);\n targetLine.open(format, bufferSize);\n this.buffers = new ArrayBlockingQueue<>(3);\n\n Runnable runner = new Runnable() {\n @Override\n public void run() {\n ByteBuffer byteBuffer = ByteBuffer.allocate(bufferSize);\n ShortBuffer shortBuffer = byteBuffer.asShortBuffer();\n double scale = FastMath.pow(2, -settings.getBitRate() - 1);\n byte[] bytes = new byte[bufferSize];\n double[] buffer = new double[settings.getBufferSize()];\n\n while (running) {\n targetLine.read(bytes, 0, bytes.length);\n byteBuffer.rewind();\n byteBuffer.put(bytes);\n shortBuffer.rewind();\n for (int i = 0; i < settings.getBufferSize(); i++) {\n buffer[i] = shortBuffer.get(i) * scale;\n }\n buffers.add(buffer);\n }\n targetLine.stop();\n }\n };\n this.inputThread = new Thread(runner);\n } catch (Exception e) {\n System.err.println(e);\n }\n }", "public Sock( /*int n , int ar[]*/)\n{\n\t//this.n=n;\n\t//this.ar=ar;\n}", "public GameViewController(int[] input) {\n\t\tinputs = input;\n\t}", "com.indosat.eai.catalist.standardInputOutput.DummyInputType addNewInput();", "public InputLayer(int size) {\n\t\tsuper(size);\n\t\tactivationFunc = null;\n\t}", "public interface ObjectInput extends DataInput {\n /**\n * Indicates the number of bytes of primitive data that can be read without\n * blocking.\n *\n * @return the number of bytes available.\n * @throws IOException\n * if an I/O error occurs.\n */\n public int available() throws IOException;\n\n /**\n * Closes this stream. Implementations of this method should free any\n * resources used by the stream.\n *\n * @throws IOException\n * if an I/O error occurs while closing the input stream.\n */\n public void close() throws IOException;\n\n /**\n * Reads a single byte from this stream and returns it as an integer in the\n * range from 0 to 255. Returns -1 if the end of this stream has been\n * reached. Blocks if no input is available.\n *\n * @return the byte read or -1 if the end of this stream has been reached.\n * @throws IOException\n * if this stream is closed or another I/O error occurs.\n */\n public int read() throws IOException;\n\n /**\n * Reads bytes from this stream into the byte array {@code buffer}. Blocks\n * while waiting for input.\n *\n * @param buffer\n * the array in which to store the bytes read.\n * @return the number of bytes read or -1 if the end of this stream has been\n * reached.\n * @throws IOException\n * if this stream is closed or another I/O error occurs.\n */\n public int read(byte[] buffer) throws IOException;\n\n /**\n * Reads at most {@code count} bytes from this stream and stores them in\n * byte array {@code buffer} starting at offset {@code count}. Blocks while\n * waiting for input.\n *\n * @param buffer\n * the array in which to store the bytes read.\n * @param offset\n * the initial position in {@code buffer} to store the bytes read\n * from this stream.\n * @param count\n * the maximum number of bytes to store in {@code buffer}.\n * @return the number of bytes read or -1 if the end of this stream has been\n * reached.\n * @throws IOException\n * if this stream is closed or another I/O error occurs.\n */\n public int read(byte[] buffer, int offset, int count) throws IOException;\n\n /**\n * Reads the next object from this stream.\n *\n * @return the object read.\n *\n * @throws ClassNotFoundException\n * if the object's class cannot be found.\n * @throws IOException\n * if this stream is closed or another I/O error occurs.\n */\n public Object readObject() throws ClassNotFoundException, IOException;\n\n /**\n * Skips {@code toSkip} bytes on this stream. Less than {@code toSkip} byte are\n * skipped if the end of this stream is reached before the operation\n * completes.\n *\n * @param toSkip\n * the number of bytes to skip.\n * @return the number of bytes actually skipped.\n *\n * @throws IOException\n * if this stream is closed or another I/O error occurs.\n */\n public long skip(long toSkip) throws IOException;\n}", "Input getInputs();", "public Layer(int numNeurons, int inputsPerNeuron) {\n\n this.numNeurons = numNeurons;\n\n neurons = new Neuron[numNeurons];\n for (int i = 0; i < numNeurons; i++) {\n neurons[i] = new Neuron(inputsPerNeuron);\n }\n }", "protected void setupInputs() {\n \tim=new GenericInputManager();\n \tArrayList<Controller> controllers=im.getControllers();\n \t\n \tfor(Controller controller:controllers) {\n \t\tplayer.setupInputs(im, controller);\n \t}\n \t\t\t\n \t\n }", "public void setInputCnt(Integer inputCnt) {\r\n this.inputCnt = inputCnt;\r\n }", "private static int[] getInputs(int n) {\n Scanner s = new Scanner(System.in);\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n System.out.print(i + \". element: \");\n arr[i] = s.nextInt();\n }\n // after inputing n elements, close the scanner\n s.close();\n return arr;\n }", "public int getNumberOfInputs()\n {\n return numberOfInputs;\n }", "InOut createInOut();", "com.indosat.eai.catalist.standardInputOutput.DummyInputType getInput();", "private void initAudioIn(){\n ArrayList<String> actived = new ArrayList<String>();\n ArrayList<String> mAudioInputChannels = mAudioManagerEx.getAudioDevices(AudioManagerEx.AUDIO_INPUT_TYPE);\n int i = 0;\n for(i = 0; i < mAudioInputChannels.size(); i++){\n String device = mAudioInputChannels.get(i);\n if(device.contains(\"USB\")){\n actived.add(device);\n break;\n }\n }\n //otherwise use codec by default\n if(i == mAudioInputChannels.size()){\n actived.add(AudioManagerEx.AUDIO_NAME_CODEC);\n }\n mAudioManagerEx.setAudioDeviceActive(actived, AudioManagerEx.AUDIO_INPUT_ACTIVE);\n }", "private void createInputLayer(Instances instances) throws Exception {\r\n\t\tinputs = new ArrayList<InputNode>();\r\n\t\tint now = 0;\r\n\t\tfor (int attrNum = 0; attrNum < numAttributes + 1; attrNum++) {\r\n\t\t\tif (instances.classIndex() != attrNum) {\r\n\t\t\t\tInputNode input = new InputNode(instances.attribute(attrNum).name(), attrNum);\r\n\t\t\t\tinputs.add(attrNum - now, input);\r\n\t\t\t} else {\r\n\t\t\t\tnow = 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public XboxController(int numberOfButtons, int port) {\n\t\tjoystick = new Joystick(port);\n\t\t\n\t\tfor(int i = 0; i < numberOfButtons; i++) {\n\t\t\tbutton = Arrays.copyOf(button, button.length+1);\n\t\t\tbutton[button.length-1] = new JoystickButton(joystick,i);\n\t\t}\n\t}", "public interface MyInputChannel {\n\n String INPUT = \"source\";\n @Input(INPUT)\n SubscribableChannel source();\n}", "public BitReader(byte[] input) {\n this.input = input;\n this.size = input.length << 3;\n }", "Publisher<INDArrayMessage> incomingPublisher();", "public Frame readNextFilterInputPort () {\n return readNextFilterInputPort(0);\n }", "public static AudioInputStream createAudioInputStream(InputStream in)\n\t\t\tthrows IOException {\n\t\tfinal PipedOutputStream pipedOut = new PipedOutputStream();\n\t\tPipedInputStream pipedIn = new PipedInputStream(pipedOut);\n\n\t\tfinal WavReader reader = new WavReader(in) {\n\t\t\t@Override\n\t\t\tprotected void processSamples(byte[] sample, int offset, int length,\n\t\t\t\t\tint numberOfSamples) throws IOException {\n\t\t\t\tpipedOut.write(sample, offset, length);\n\t\t\t}\n\t\t};\n\n\t\tThread thread = new Thread(\"WavReader: piping audio\") {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treader.read();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tpipedOut.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthread.start();\n\n\t\twhile (thread.isAlive() && (reader.getFormatChunk() == null\n\t\t\t\t|| reader.dataChunkSize == -1)) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(15);\n\t\t\t} catch (Exception e) {\n\t\t\t}\n\t\t}\n\n\t\tAudioFormat format = reader.getAudioFormat();\n\t\t/** the length in sample frames of the data in this stream; */\n\t\tlong sampleFrames = reader.dataChunkSize / format.getFrameSize();\n\t\treturn new AudioInputStream(pipedIn, format, sampleFrames);\n\t}", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "int getInputsCount();", "int getInputsCount();", "int getInputsCount();", "Inputs getInputs();", "public void read(ArrayDataInput in) throws FitsException, IOException;", "public LinearNeuron(int inputs)\n\t{\n\t\tsuper(inputs);\n\t}", "public void takeInput() {\n Scanner sc = new Scanner(System.in);\n int polynomial[];\n System.out.println(\"Enter no. of inputs:\");\n int n = sc.nextInt();\n System.out.println(\"Enter polynomial coefficients:\\n(0 if no coefficient is present)\");\n polynomial = new int[n];\n System.out.println(\"Enter data: \");\n \n for (int i = 0; i < n; i++) {\n polynomial[i] = sc.nextInt();\n }\n \n setPolynomialCoefficientArray(polynomial);\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput addNewDummyInput();", "public TrackdInputDevice() {\n }", "void registerInputConnector(String name, InputConnector in);", "public interface UserInputService {\n\n void initialize();\n\n int getNumberOfLarge();\n}", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public int getInputsCount() {\n return inputs_.size();\n }", "public int getInputsCount() {\n return inputs_.size();\n }", "public int getInputsCount() {\n return inputs_.size();\n }", "public TypedBytesInput(DataInput in) {\n this.in = in;\n }", "public interface AudioInputLine extends AbstractLine {\n\n /**\n * Fill given buffer with mic captured data\n *\n * @param buffer where to put data\n * @param offset start position\n * @param length amount of byte to put\n * @return actual amount of reade bytes\n */\n\n int readNonBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Short cut for read\n *\n * @param buffer to fill with data\n * @return actual amount of reade bytes\n */\n\n default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }\n\n /**\n * Blocking read\n *\n * @param buffer to fill\n * @param offset buffer start position\n * @param length amount of bytes to read\n * @return actual number of read bytes from underlying device buffer\n */\n\n int readBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Blocking read for full buffer\n *\n * @param buffer to fill\n * @return actual number of read bytes from underlying device buffer\n */\n\n default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }\n}", "InputObjectTypeDefinition createInputObjectTypeDefinition();", "InputsDeclRule createInputsDeclRule();", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(\n int index) {\n return getInputsFieldBuilder().getBuilder(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(\n int index) {\n return getInputsFieldBuilder().getBuilder(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(\n int index) {\n return getInputsFieldBuilder().getBuilder(index);\n }", "public void calculateInputs()\n {\n numberOfInputs = inputs.size();\n }", "TclInputStream(InputStream inInput) {\n input = inInput;\n }", "public static InputFactory createSequentialFactory( final DataSource datsrc,\n final long offset,\n final long leng ) {\n return new AbstractInputFactory( false ) {\n public BasicInput createInput( boolean isSeq )\n throws IOException {\n InputStream baseIn = datsrc.getInputStream();\n IOUtils.skip( baseIn, offset );\n DataInputStream dataIn =\n new DataInputStream(\n new BufferedInputStream( baseIn ) );\n return createSequentialInput( dataIn );\n }\n };\n }", "@Emitter\n public InputSource createWorker() {\n return new InputSource(configuration, jsonFactory, jsonb, service, members);\n \n }", "@Override\n\tpublic void connectInputWire(Wire connectingWire, String inputName) {\n\t\t\n\t}", "public void setInputQueueSize(int aInputQueueSize) {\n inputQueueSize = aInputQueueSize;\n }", "AudioGenerator() {\n minim = new Minim(this);\n // use the getLineOut method of the Minim object to get an AudioOutput object\n out = minim.getLineOut();\n }", "public interface InputPort extends Component, AbstractConnectionSource {\n}", "public interface SignalInput extends DspObject {\r\n\t/**\r\n\t * Set the signal strength on this signal input. Normally 0.0f means 'no\r\n\t * signal', and normally the range is -1.0 until 1.0 for audio signals.\r\n\t * However, nothing prevents a signal to be outside of this range; and they\r\n\t * will often be. For example mixing multiple signals together will\r\n\t * typically lead to signals getting out of that -1.0 to 1.0 range. And a\r\n\t * signal doesn't need to be audio, but can be any kind of signal (for\r\n\t * example a signal that controls a frequency).<br/>\r\n\t * A signal should be treated as being in the range -1.0f to 1.0f for audio,\r\n\t * but can otherwise be completely arbitrary.\r\n\t * \r\n\t * @param signal\r\n\t * The signal\r\n\t */\r\n\tpublic void set(float signal);\r\n}", "public <T> Input(int defaultPosition, T[] array) {\n this.defaultPosition = defaultPosition;\n this.list = new ArrayList<>(Arrays.asList(array));\n }", "public void setInput( float inputs[] ) {\n\t\t// Put input assignment code here\n }", "@Override\n public void onInputBufferAvailable(@NonNull MediaCodec codec, int index) {\n\n synchronized (mAvailableInputs) {\n mAvailableInputs.add(index);\n mAvailableInputs.notifyAll();\n }\n }", "public int getAudioPort();", "public AnalogInputSim(AnalogInput analogInput) {\n m_index = analogInput.getChannel();\n }", "OutputPort createOutputPort();", "IAudio read(InputStream inputStream) throws AudioReaderException, InvalidFormatException;", "public void setAudioPort(int port);", "public AudioReader(CompositeEntity container, String name)\n\t\t\tthrows NameDuplicationException, IllegalActionException {\n\t\tsuper(container, name);\n\n\t\tfileOrURL = new FileParameter(this, \"fileOrURL\");\n\n\t\t// We use voice.wav so that we can include the voice.wav file\n\t\t// in the jar file for use under Web Start.\n\t\tfileOrURL\n\t\t\t\t.setExpression(\"$CLASSPATH/ptolemy/actor/lib/javasound/voice.wav\");\n\n\t\t// Set the type of the output port.\n\t\toutput.setMultiport(true);\n\t\toutput.setTypeEquals(BaseType.DOUBLE);\n\t}", "public RawReader(final InputStream is, final int bufferSize) throws NullPointerException, IllegalArgumentException {\n\t\tif (is == null) {\n\t\t\tthrow new NullPointerException(\"Input stream can't be null\"); \n\t\t}\n\t\telse if (bufferSize <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"Buffer size [\"+bufferSize+\"] must be greater than 0\"); \n\t\t}\n\t\telse {\n\t\t\tthis.is = is;\n\t\t\tthis.buffer = new byte[bufferSize];\n\t\t}\n\t}", "void setInputs(List<ContractIOType> inputs) {\n this.inputs = inputs;\n }", "public static int[] takeInput() {\n System.out.println(\"Enter size of arrays : \");\n int size = scn.nextInt();\n\n // declaring arrays \n int[] arrays = new int[size];\n\n // taking input from user\n for (int i = 0; i < arrays.length; i++) {\n System.out.println(\"Enter elements at \" + i);\n arrays[i] = scn.nextInt();\n }\n\n return arrays;\n }", "public static int[] input() {\n System.out.println(\"Enter size of array: \");\r\n Scanner sc = new Scanner(System.in);\r\n int n = sc.nextInt();\r\n int a[] = new int[n];\r\n for (int i = 0; i < n; i++) { //This forloop will help to store array \r\n a[i] = sc.nextInt();\r\n }\r\n return a;\r\n\r\n }", "StreamConnectionIO(Mux mux, OutputStream out, InputStream in) {\n\tsuper(mux);\n\tthis.out = out;\n//\tthis.out = new BufferedOutputStream(out);\n\tthis.in = in;\n\n\toutChannel = newChannel(out);\n\tinChannel = newChannel(in);\n sendQueue = new LinkedList<Buffer>();\n }", "public ClientHandler(InputStream inputFromClient) {\n try {\n this.inputFromClient = new ObjectInputStream(inputFromClient);\n } catch (IOException e) {\n System.out.println(\"Could not create ObjectInputStream from ClientHandler\");\n }\n }", "private Input()\n {\n }", "public static Iterator<Quad> createIteratorNQuads(InputStream input) {\n return createIteratorNQuads(input, RiotLib.dftProfile());\n }", "void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);", "public static IInputFactory getInputFactory() {\n\n return m_InputFactory;\n\n }", "public void start(int batchSize);", "InputsType getInputs();", "public MultiWave(AudioFormat f, float a, int n) {\n super(f, a);\n frameRate = getFormat().getFrameRate();\n amplitudes = new float[numFrequencies = n];\n frequencies = new float[n];\n whichWaveForm = new int[n];\n phases = new double[n];\n deltaPhases = new double[n];\n isActive = new boolean[n];\n mixingCoefficients = new double[n][MultiWave.VARIABLE];\n\n for (int i = 0; i < n; i++) {\n isActive[i] = false;\n phases[i] = 0.0;\n deltaPhases[i] = 0.0;\n for (int j = MultiWave.SINE; j < MultiWave.VARIABLE; j++) {\n mixingCoefficients[i][j] = defaultMixingCoefficients[j];\n }\n } // end for i\n initializeSineTable();\n }", "public SeqItemset(int n){\n\t\tm_elems = new short[n];\n\t\t//m_itemset = new SeqItem[n];\n\t\tm_frequency = 0;\n\t\tm_size = (short) m_elems.length;\n\t}", "public abstract Object getInput ();", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder(\n int index) {\n return getInputsFieldBuilder().addBuilder(\n index, org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());\n }" ]
[ "0.6107116", "0.5908664", "0.5831255", "0.57436216", "0.5652173", "0.56171614", "0.55382884", "0.54841137", "0.5424907", "0.5344611", "0.5316003", "0.53045475", "0.5274012", "0.51841784", "0.5074408", "0.50456965", "0.5041056", "0.5010051", "0.49853683", "0.49793616", "0.4947672", "0.49426073", "0.4938574", "0.49343258", "0.48822042", "0.48746666", "0.48491067", "0.48113254", "0.48013604", "0.47766018", "0.47533855", "0.47344804", "0.47160473", "0.47137898", "0.47111836", "0.46968776", "0.4688965", "0.46734396", "0.46650577", "0.4662009", "0.4662009", "0.4662009", "0.46536043", "0.46536043", "0.46536043", "0.464731", "0.46413904", "0.46287546", "0.46146408", "0.46059692", "0.4601589", "0.4597519", "0.45864317", "0.45842907", "0.45842907", "0.45842907", "0.45742947", "0.45742947", "0.45742947", "0.4565847", "0.45544294", "0.45362565", "0.45195642", "0.4501141", "0.4501141", "0.4501141", "0.4496657", "0.44800174", "0.44759178", "0.44703245", "0.4459236", "0.44562322", "0.44277385", "0.44251066", "0.4418801", "0.44172513", "0.44089842", "0.43958825", "0.43949583", "0.43865308", "0.43748808", "0.43730363", "0.43712866", "0.43585497", "0.43502203", "0.43502003", "0.43429077", "0.43393955", "0.4330984", "0.4330688", "0.43240038", "0.43206763", "0.43165615", "0.43054476", "0.43025082", "0.4298494", "0.42980596", "0.42942065", "0.42941257", "0.4283779" ]
0.58177763
3
constructor int, AudioContext Creates an Input object connected to PortAudio, with the given number of inputs, as well as the option to skip inputs 58 (this assumes that you will have adjusted for the skip and passed in 4 more inputs than you plan to need; e.g., numInputs = 16 for 12 lines).
public RealTimeInput(int numInputs, boolean skip5thru8, PApplet pa) { this(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), skip5thru8, pa); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RealTimeInput(int numInputs, AudioContext audioContext, boolean skip5thru8, PApplet pa)\n\t{\n\t\tif(numInputs < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): int parameter \" + numInputs + \" is less than 1; must be 1 or greater.\");\n\t\t} // if(numInputs < 1)\n\t\tif(audioContext == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): AudioContext parameter \" + audioContext + \" is null.\");\n\t\t} // if(numInputs < 1)\n\n\t\tthis.numInputs = numInputs;\n\t\tthis.ac \t\t= audioContext;\n\t\tthis.pa\t\t\t= pa;\n\t\tthis.skip5thru8\t= skip5thru8;\n\t\t\n\t\tif(this.skip5thru8)\n\t\t{\n\t\t\tthis.adjustedNumInputs\t= this.numInputs - 4;\n\t\t\tSystem.out.println(\"this.adjustedNumInputs = \" + this.adjustedNumInputs);\n\t\t} else {\n\t\t\tthis.adjustedNumInputs\t= this.numInputs;\n\t\t} // \n\t\t\n\t\tthis.disposeHandler\t= new DisposeHandler(this.pa, this);\n\t\tSystem.out.println(\"just registered DisposeHandler for \" + pa);\n\n\t\tthis.uGenArrayFromNumInputs(this.numInputs);\n\t}", "public RealTimeInput(int numInputs, AudioContext audioContext, PApplet pa)\n\t{\n\t\tthis(numInputs, audioContext, false, pa);\n\t}", "public RealTimeInput(int numInputs, PApplet pa)\n\t{\n//\t\tthis(numInputs, new AudioContext(new AudioServerIO.JavaSound(), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)));\n\t\tthis(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), pa);\n\t\t\n\t}", "public abstract BasicInput createInput( boolean isSeq ) throws IOException;", "public void testMixer_getNumberOfInputPortMin() throws InterruptedException {\n Integer NbPortTested = 1;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", 2, mixer.getNumberOfInputPort(),0);\n }", "public Input(MOSEFSettings settings) {\n this.settings = settings;\n\n try {\n AudioFormat format =\n new AudioFormat(settings.getSampleRate(), settings.getBitRate(), 1, true, true);\n int byterate = settings.getBitRate() / 8;\n this.bufferSize = settings.getBufferSize() * byterate;\n targetLine = AudioSystem.getTargetDataLine(format);\n targetLine.open(format, bufferSize);\n this.buffers = new ArrayBlockingQueue<>(3);\n\n Runnable runner = new Runnable() {\n @Override\n public void run() {\n ByteBuffer byteBuffer = ByteBuffer.allocate(bufferSize);\n ShortBuffer shortBuffer = byteBuffer.asShortBuffer();\n double scale = FastMath.pow(2, -settings.getBitRate() - 1);\n byte[] bytes = new byte[bufferSize];\n double[] buffer = new double[settings.getBufferSize()];\n\n while (running) {\n targetLine.read(bytes, 0, bytes.length);\n byteBuffer.rewind();\n byteBuffer.put(bytes);\n shortBuffer.rewind();\n for (int i = 0; i < settings.getBufferSize(); i++) {\n buffer[i] = shortBuffer.get(i) * scale;\n }\n buffers.add(buffer);\n }\n targetLine.stop();\n }\n };\n this.inputThread = new Thread(runner);\n } catch (Exception e) {\n System.err.println(e);\n }\n }", "public interface AudioInputLine extends AbstractLine {\n\n /**\n * Fill given buffer with mic captured data\n *\n * @param buffer where to put data\n * @param offset start position\n * @param length amount of byte to put\n * @return actual amount of reade bytes\n */\n\n int readNonBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Short cut for read\n *\n * @param buffer to fill with data\n * @return actual amount of reade bytes\n */\n\n default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }\n\n /**\n * Blocking read\n *\n * @param buffer to fill\n * @param offset buffer start position\n * @param length amount of bytes to read\n * @return actual number of read bytes from underlying device buffer\n */\n\n int readBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Blocking read for full buffer\n *\n * @param buffer to fill\n * @return actual number of read bytes from underlying device buffer\n */\n\n default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }\n}", "public void testMixer_getNumberOfInputPort() throws InterruptedException {\n Integer NbPortTested = 3;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", NbPortTested, mixer.getNumberOfInputPort(),0);\n }", "public InputConsumerFactory(int inputParameterIndex) {\r\n\t\tthis.inputParameterIndex = inputParameterIndex;\r\n\t}", "public void createChain(){\r\n Oscillator wt = new Oscillator(this, Oscillator.SAWTOOTH_WAVE, this.sampleRate, this.channels);\r\n Filter filt = new Filter(wt, this.filterCutoff, Filter.LOW_PASS);\r\n Envelope env = new Envelope(filt, \r\n new double[] {0.0, 0.0, 0.05, 1.0, 0.3, 0.4, 1.0, 0.0});\r\n\t\tVolume vol = new Volume(env);\r\n//\t\tSampleOut sout = new SampleOut(vol);\r\n\t}", "PortMixer(PortMixerProvider.PortMixerInfo paramPortMixerInfo) {\n/* 70 */ super(paramPortMixerInfo, null, null, null);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 77 */ int i = 0;\n/* 78 */ int j = 0;\n/* 79 */ int k = 0;\n/* */ \n/* */ try {\n/* */ try {\n/* 83 */ this.id = nOpen(getMixerIndex());\n/* 84 */ if (this.id != 0L) {\n/* 85 */ i = nGetPortCount(this.id);\n/* 86 */ if (i < 0)\n/* */ {\n/* 88 */ i = 0;\n/* */ }\n/* */ } \n/* 91 */ } catch (Exception exception) {}\n/* */ \n/* 93 */ this.portInfos = new Port.Info[i];\n/* */ \n/* 95 */ for (byte b1 = 0; b1 < i; b1++) {\n/* 96 */ int m = nGetPortType(this.id, b1);\n/* 97 */ j += ((m & 0xFF) != 0) ? 1 : 0;\n/* 98 */ k += ((m & 0xFF00) != 0) ? 1 : 0;\n/* 99 */ this.portInfos[b1] = getPortInfo(b1, m);\n/* */ } \n/* */ } finally {\n/* 102 */ if (this.id != 0L) {\n/* 103 */ nClose(this.id);\n/* */ }\n/* 105 */ this.id = 0L;\n/* */ } \n/* */ \n/* */ \n/* 109 */ this.sourceLineInfo = (Line.Info[])new Port.Info[j];\n/* 110 */ this.targetLineInfo = (Line.Info[])new Port.Info[k];\n/* */ \n/* 112 */ j = 0; k = 0;\n/* 113 */ for (byte b = 0; b < i; b++) {\n/* 114 */ if (this.portInfos[b].isSource()) {\n/* 115 */ this.sourceLineInfo[j++] = this.portInfos[b];\n/* */ } else {\n/* 117 */ this.targetLineInfo[k++] = this.portInfos[b];\n/* */ } \n/* */ } \n/* */ }", "public void setInputCnt(Integer inputCnt) {\r\n this.inputCnt = inputCnt;\r\n }", "public void setInputCount(final int i) {\n this.inputCount = i;\n\n }", "public void setNumberOfInputs(int numberOfInputs)\n {\n this.numberOfInputs = numberOfInputs;\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputType getInput();", "public Sample(int numberOfInputs, int numberOfOutputs)\n {\n inputs = new ArrayList<>();\n outputs = new ArrayList<>();\n this.numberOfInputs = numberOfInputs;\n this.numberOfOutputs = numberOfOutputs;\n }", "public FileInputTools(SharedBuffer buffer, int bufferInputFileLength) throws Exception {\r\n\t\tsuper (buffer);\r\n\t\tthis.reset();\r\n\t\tthis.bufferInputFileLength = bufferInputFileLength;\r\n\t\tthis.initializeStream();\r\n\t}", "AudioGenerator() {\n minim = new Minim(this);\n // use the getLineOut method of the Minim object to get an AudioOutput object\n out = minim.getLineOut();\n }", "public SonicAudioProcessor() {\n speed = 1f;\n pitch = 1f;\n channelCount = Format.NO_VALUE;\n sampleRateHz = Format.NO_VALUE;\n buffer = EMPTY_BUFFER;\n shortBuffer = buffer.asShortBuffer();\n outputBuffer = EMPTY_BUFFER;\n }", "public TrackdInputDevice() {\n }", "InputPort createInputPort();", "public static void setNumberOfInputs(int _n)\r\n {\r\n numberOfInputs = _n;\r\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputType addNewInput();", "public GameViewController(int[] input) {\n\t\tinputs = input;\n\t}", "public void testMixer_getNumberOfInputPortMax() throws InterruptedException {\n Integer NbPortTested = 11;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", 10, mixer.getNumberOfInputPort(),0);\n }", "public int getNumberOfInputs()\n {\n return numberOfInputs;\n }", "public Sample()\n {\n inputs = new ArrayList<>();\n outputs = new ArrayList<>();\n numberOfInputs = 0;\n numberOfOutputs = 0;\n comment = \"\";\n }", "@Override\n public void onAudioSamples(IAudioSamplesEvent event) {\n\n /*\n * -----------------------------------------------------------------------------------\n * !!! LAB EXERCISE !!!\n * -----------------------------------------------------------------------------------\n * 1. Create a 'ShortBuffer' and point it to the incoming audio samples.\n * Hint: Use 'event.getAudioSamples().getByteBuffer().asShortBuffer()'\n *\n * 2. Loop over the buffer values from 0 to 'buffer.limit()' and access each buffer\n * value using 'buffer.get'\n * Hint: 'buffer.get' gets the sample values as a 'short'\n *\n * 3. Multiply each buffer value by the 'multiplier' (which is a double) then place the\n * resultant value back into the buffer using 'buffer.put'\n * Hint: You may need to cast the data to a 'short' value\n */\n\n // ===================================================================================\n // *** YOUR CODE HERE ***\n ShortBuffer buffer = event.getAudioSamples().getByteBuffer().asShortBuffer();\n\n for (int i = 0; i < buffer.limit(); ++i)\n {\n buffer.put((short)(buffer.get(i) * this.multiplier));\n }\n // ===================================================================================\n\n // Finally, pass the adjusted event to the next tool\n super.onAudioSamples(event);\n }", "public RawReader(final InputStream is, final int bufferSize) throws NullPointerException, IllegalArgumentException {\n\t\tif (is == null) {\n\t\t\tthrow new NullPointerException(\"Input stream can't be null\"); \n\t\t}\n\t\telse if (bufferSize <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"Buffer size [\"+bufferSize+\"] must be greater than 0\"); \n\t\t}\n\t\telse {\n\t\t\tthis.is = is;\n\t\t\tthis.buffer = new byte[bufferSize];\n\t\t}\n\t}", "public OscillatorCalculator() {\n this(1);\n }", "private void initAudioIn(){\n ArrayList<String> actived = new ArrayList<String>();\n ArrayList<String> mAudioInputChannels = mAudioManagerEx.getAudioDevices(AudioManagerEx.AUDIO_INPUT_TYPE);\n int i = 0;\n for(i = 0; i < mAudioInputChannels.size(); i++){\n String device = mAudioInputChannels.get(i);\n if(device.contains(\"USB\")){\n actived.add(device);\n break;\n }\n }\n //otherwise use codec by default\n if(i == mAudioInputChannels.size()){\n actived.add(AudioManagerEx.AUDIO_NAME_CODEC);\n }\n mAudioManagerEx.setAudioDeviceActive(actived, AudioManagerEx.AUDIO_INPUT_ACTIVE);\n }", "public AudioSource(boolean loop) {\n\t\tid = AL10.alGenSources();\n\t\tthis.loop = loop;\n\t}", "public LinearNeuron(int inputs)\n\t{\n\t\tsuper(inputs);\n\t}", "public Pdu (InputStream inputStream){\n\n }", "public Input(long begTime, long endTime, int keystrokeNum, int mouseClickNum) {\r\n this.begTime = begTime;\r\n this.endTime = endTime;\r\n this.keystrokeNum = keystrokeNum;\r\n this.mouseClickNum = mouseClickNum;\r\n }", "public CoinAdaptor(Context context) {\n this.inputContext = context;\n this.coinManager = CoinManager.getInstance();\n }", "public void mo25053a(int inputEncoding, int inputChannelCount, int inputSampleRate, int specifiedBufferSize, int[] outputChannels, int trimStartFrames, int trimEndFrames) throws ConfigurationException {\n int[] outputChannels2;\n int encoding;\n int i = inputEncoding;\n boolean flush = false;\n this.f16624r = inputSampleRate;\n int channelCount = inputChannelCount;\n int channelCount2 = inputSampleRate;\n this.f16622p = C8509F.m20478f(inputEncoding);\n int i2 = 0;\n boolean z = true;\n this.f16623q = this.f16611e && mo25057a(channelCount, 4) && C8509F.m20477e(inputEncoding);\n if (this.f16622p) {\n this.f16586F = C8509F.m20462b(i, channelCount);\n }\n int encoding2 = inputEncoding;\n boolean processingEnabled = this.f16622p && i != 4;\n if (!processingEnabled || this.f16623q) {\n z = false;\n }\n this.f16630x = z;\n if (C8509F.f18793a < 21 && channelCount == 8 && outputChannels == null) {\n outputChannels2 = new int[6];\n for (int i3 = 0; i3 < outputChannels2.length; i3++) {\n outputChannels2[i3] = i3;\n }\n } else {\n outputChannels2 = outputChannels;\n }\n if (processingEnabled) {\n this.f16613g.mo25034a(trimStartFrames, trimEndFrames);\n this.f16612f.mo25136a(outputChannels2);\n AudioProcessor[] k = m18348k();\n int length = k.length;\n encoding = encoding2;\n int sampleRate = channelCount2;\n int channelCount3 = channelCount;\n boolean flush2 = false;\n while (i2 < length) {\n AudioProcessor audioProcessor = k[i2];\n try {\n flush2 |= audioProcessor.mo25037a(sampleRate, channelCount3, encoding);\n if (audioProcessor.mo25036a()) {\n channelCount3 = audioProcessor.mo25040d();\n sampleRate = audioProcessor.mo25041e();\n encoding = audioProcessor.mo25042f();\n }\n i2++;\n } catch (UnhandledFormatException e) {\n throw new ConfigurationException((Throwable) e);\n }\n }\n flush = flush2;\n channelCount = channelCount3;\n channelCount2 = sampleRate;\n } else {\n int i4 = trimStartFrames;\n int i5 = trimEndFrames;\n encoding = encoding2;\n }\n int channelConfig = m18326a(channelCount, this.f16622p);\n if (channelConfig == 0) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"Unsupported channel count: \");\n sb.append(channelCount);\n throw new ConfigurationException(sb.toString());\n } else if (flush || !m18354q() || this.f16627u != encoding || this.f16625s != channelCount2 || this.f16626t != channelConfig) {\n reset();\n this.f16629w = processingEnabled;\n this.f16625s = channelCount2;\n this.f16626t = channelConfig;\n this.f16627u = encoding;\n this.f16589I = this.f16622p ? C8509F.m20462b(this.f16627u, channelCount) : -1;\n this.f16631y = specifiedBufferSize != 0 ? specifiedBufferSize : m18349l();\n }\n }", "public ThreadInputA3E2(int qtd, int indice) {\n this.qtdRodadas = qtd;\n this.indice = indice;\n }", "protected void setupInputs() {\n \tim=new GenericInputManager();\n \tArrayList<Controller> controllers=im.getControllers();\n \t\n \tfor(Controller controller:controllers) {\n \t\tplayer.setupInputs(im, controller);\n \t}\n \t\t\t\n \t\n }", "public int getAudioPort();", "INPUT createINPUT();", "public InputLayer(int size) {\n\t\tsuper(size);\n\t\tactivationFunc = null;\n\t}", "protected AESCrypto(Context context, int iterations) throws NoAlgorithmAvailableException {\n // Call superclass\n super(context);\n // Check availability of provoders\n providerCheckAESCrypto();\n // Apply Googles fix for the pseudo random number generator for API-Levels 16-18\n prng = new AtomicBoolean(false);\n fixPrng();\n // set the iteration count\n PBE_ITERATIONS = iterations;\n }", "@Override\n public void onInputBufferAvailable(@NonNull MediaCodec codec, int index) {\n\n synchronized (mAvailableInputs) {\n mAvailableInputs.add(index);\n mAvailableInputs.notifyAll();\n }\n }", "public InputFewStepsFactoryImpl() {\n\t\tsuper();\n\t}", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public TrimmingAudioProcessor() {\n endBuffer = Util.EMPTY_BYTE_ARRAY;\n }", "public BitReader(byte[] input) {\n this.input = input;\n this.size = input.length << 3;\n }", "private Input()\n {\n }", "InputsDeclRule createInputsDeclRule();", "@java.lang.Override\n public com.clarifai.grpc.api.InputIDs getInputIds() {\n if (inputSourceCase_ == 2) {\n return (com.clarifai.grpc.api.InputIDs) inputSource_;\n }\n return com.clarifai.grpc.api.InputIDs.getDefaultInstance();\n }", "protected abstract UtteranceProcessor getAudioOutput() throws IOException ;", "void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "@Override\n\tpublic void playerPCMFeedBuffer(boolean b, int i, int i2) {}", "PTB2TextLexer(java.io.Reader in) {\n this.zzReader = in;\n }", "public IntArraySpliterator(int[] param1ArrayOfint, int param1Int1, int param1Int2, int param1Int3) {\n/* 1011 */ this.array = param1ArrayOfint;\n/* 1012 */ this.index = param1Int1;\n/* 1013 */ this.fence = param1Int2;\n/* 1014 */ this.characteristics = param1Int3 | 0x40 | 0x4000;\n/* */ }", "com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput addNewDummyInput();", "P preProcessInputs(R rawInputs);", "public void initEncoderTxData()\n\t{\n\t\tfor(counter_i=0;counter_i<sampleBit;counter_i++)\n\t\t{\n\t\t\thighLevel[counter_i] = (short) (audioAM * (-Math.sin(Math.PI * counter_i /sampleBit * 2)));\n\t\t\tlowLevel[counter_i] = (short) (audioAM * (Math.sin(Math.PI * counter_i /sampleBit * 2)));\n\t\t}\n\t}", "public Mix() {\n\t\tlinkedList = new LinkedList();\n\t\tclipboards = new BinarySearchTree();\n\t\tscanner = new Scanner(System.in);\n\t\trunning = true;\n\t\ttesting = false;\n\t\tcurMessage = \"\";\n\t\tunMixCode = \"\";\n\t}", "@java.lang.Override\n public com.clarifai.grpc.api.InputIDsOrBuilder getInputIdsOrBuilder() {\n if (inputSourceCase_ == 2) {\n return (com.clarifai.grpc.api.InputIDs) inputSource_;\n }\n return com.clarifai.grpc.api.InputIDs.getDefaultInstance();\n }", "public void calculateInputs()\n {\n numberOfInputs = inputs.size();\n }", "public LengthCheckInputStream(InputStream in, long expectedLength,\n boolean includeSkipped) {\n super(in);\n if (expectedLength < 0)\n throw new IllegalArgumentException();\n this.expectedLength = expectedLength;\n this.includeSkipped = includeSkipped;\n }", "@Override\n public void init(int blockLength, SourceDataLine sourceDataLine)\n { this.fftWindowLength = blockLength; // fftWindowLength = 8192\n this.fftSampleRate = sourceDataLine.getFormat().getFrameRate(); // fftSampleRate = 44100\n this.maxFreq = fftSampleRate / 2.0f; // maxFreq = 22050 Hz\n this.audioChannels = new float[2][blockLength];\n this.channelSamples = new float[blockLength];\n\n this.fft = new FloatFFT_1D(fftWindowLength);\n calculateWindowCoefficients(fftWindowLength);\n setBinCount( fftWindowLength / 2 ); // 8192 / 2 = 4096\n setBandCount(octaveCount*notesPerOctave*bandsPerNote + bandsPerNote); // covers 8 octaves plus 1 note\n // 8*12*1 + 1 = 97 bands or 8*12*5 + 5 = 485 bands or 8*12*9 + 9 = 873\n computeBandTables(); \n }", "@Setup\n public void setup() {\n randomInput = new RandomComplexGenerator(inputLength).randomInputs();\n }", "public FastaReader(InputStream ins) throws IOException{\n\t\tsuper(ins);\n\t}", "public void StartPlayingSound(String _MixerName) {\n for (int cnt = 0; cnt < mixerInfo.length; cnt++) {\r\n\r\n // Mixer currentMixer = AudioSystem.getMixer(mixerInfo[cnt]);\r\n // Because this is for a recording application, we only care about audio INPUT so we just\r\n // care if TargetDataLine is supported.\r\n if (mixerInfo[cnt].getName().equals(_MixerName)) {\r\n System.out.println(\"SoundOutputDeviceControl - found target mixer: \" + _MixerName);\r\n\r\n // This may freeze the UI but oh well, we have to wait for the inner thread to stop from the\r\n // previous selection\r\n stopPlay = true;\r\n while (threadEnd == false) {\r\n try {\r\n sleep(100);\r\n } catch (InterruptedException ex) { \r\n }\r\n }\r\n\r\n Mixer currentMixer = AudioSystem.getMixer(mixerInfo[cnt]);\r\n try {\r\n \r\n //DataLine.Info dataLineInfo = new DataLine.Info(SourceDataLine.class, af);\r\n //sourceDataLine = (SourceDataLine) currentMixer.getLine(dataLineInfo);\r\n sourceDataLine = (SourceDataLine) currentMixer.getLine(sourceDLInfo);\r\n //sourceDataLine.open(af);\r\n sourceDataLine.open(af, Ns2 * 4);\r\n sourceDataLine.start();\r\n playerThread = new Thread(new PlayThread());\r\n playerThread.setPriority(Thread.MAX_PRIORITY); \r\n playerThread.start();\r\n } catch (LineUnavailableException e) {\r\n System.out.println(\"SoundOutputDeviceControl - StartPlayingSoundOnMixer -\" + e);\r\n }\r\n }\r\n }\r\n }", "public Alcu(String programPath, String inputTape, String outputTape, int debugMode) throws Exception{\n programMemory = new ProgramMemory(programPath);\n dataMemory = new DataMemory();\n this.inputTape = inputTape;\n this.outputTape = outputTape;\n this.debugMode = debugMode;\n readingHead = new ReadingHead(inputTape);\n writingHead = new WritingHead(outputTape);\n instrPointer = 0;\n inputTapeContent = readingHead.readFullTape(inputTape);\n outputTapeContent = new ArrayList<Integer>();\n executedIntructions = 0;\n }", "public Sample(ArrayList<Double> inputs, ArrayList<Double> outputs)\n {\n this.inputs = inputs;\n this.outputs = outputs;\n numberOfInputs = 0;\n numberOfOutputs = 0;\n comment = \"\";\n }", "public LexicalIterator(String pname,TraceLexicon lex, FileLocator loc, boolean rando, Expression[] e){\n super(e);\n parameterName=\"modelInput\";\n list=lex;\n isRandomized=rando;\n if(null == list)\n numIncrements=-1; \n else\n numIncrements=list.size();\n currentIncrement=0;\n expressions=e;\n locator=loc;\n if(null == list) hasNext=false; \n else if(currentIncrement<list.size()) hasNext=true;\n else hasNext=false;\n }", "public Mix() {\n scan = new Scanner(System.in);\n message = new DoubleLinkedList<Character>();\n clipBoards = new Hashtable<Integer, ClipBdLinkedList<Character>>();\n undoCommands = \"\";\n }", "public ConnectedComponentFromSeed()\r\n/* 25: */ {\r\n/* 26: 32 */ this.inputFields = \"input, seed\";\r\n/* 27: 33 */ this.outputFields = \"output\";\r\n/* 28: */ }", "public WrongInputDataInScanner() {\n\tsuper();\n\t\n}", "public Integer getInputCnt() {\r\n return inputCnt;\r\n }", "@Nonnull\r\n\tpublic static <T> Observable<List<T>> buffer(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\tfinal int bufferSize,\r\n\t\t\tint skip) {\r\n\t\treturn new Buffer.WithSizeSkip<T>(source, bufferSize, 0);\r\n\t}", "public LineProducer ( FileIterator input )\n {\n // Store the input on object creation in the global linesInput \n this.linesInput = input ;\n }", "public static AudioInputStream createAudioInputStream(InputStream in)\n\t\t\tthrows IOException {\n\t\tfinal PipedOutputStream pipedOut = new PipedOutputStream();\n\t\tPipedInputStream pipedIn = new PipedInputStream(pipedOut);\n\n\t\tfinal WavReader reader = new WavReader(in) {\n\t\t\t@Override\n\t\t\tprotected void processSamples(byte[] sample, int offset, int length,\n\t\t\t\t\tint numberOfSamples) throws IOException {\n\t\t\t\tpipedOut.write(sample, offset, length);\n\t\t\t}\n\t\t};\n\n\t\tThread thread = new Thread(\"WavReader: piping audio\") {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treader.read();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tpipedOut.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthread.start();\n\n\t\twhile (thread.isAlive() && (reader.getFormatChunk() == null\n\t\t\t\t|| reader.dataChunkSize == -1)) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(15);\n\t\t\t} catch (Exception e) {\n\t\t\t}\n\t\t}\n\n\t\tAudioFormat format = reader.getAudioFormat();\n\t\t/** the length in sample frames of the data in this stream; */\n\t\tlong sampleFrames = reader.dataChunkSize / format.getFrameSize();\n\t\treturn new AudioInputStream(pipedIn, format, sampleFrames);\n\t}", "public Sock( /*int n , int ar[]*/)\n{\n\t//this.n=n;\n\t//this.ar=ar;\n}", "@Override\n public void setup(OperatorContext context)\n {\n super.setup(context);\n if (mode == RECORD_READER_MODE.FIXED_WIDTH_RECORD) {\n readerContext = createFixedWidthReaderContext();\n } else {\n readerContext = createDelimitedReaderContext();\n }\n }", "public static BasicInput createSequentialInput( final DataInput in ) {\n return new BasicInput() {\n public byte readByte() throws IOException {\n return in.readByte();\n }\n public short readShort() throws IOException {\n return in.readShort();\n }\n public int readInt() throws IOException {\n return in.readInt();\n }\n public long readLong() throws IOException {\n return in.readLong();\n }\n public float readFloat() throws IOException {\n return in.readFloat();\n }\n public double readDouble() throws IOException {\n return in.readDouble();\n }\n public void skip( long nbyte ) throws IOException {\n IOUtils.skipBytes( in, nbyte );\n }\n public boolean isRandom() {\n return false;\n }\n public void seek( long offset ) {\n throw new UnsupportedOperationException();\n }\n public long getOffset() {\n throw new UnsupportedOperationException();\n }\n public void close() {\n }\n };\n }", "@Override\n protected long skip0(@Positive long count) throws IOException {\n int countI = (int) min(count, this.delegate.remaining());\n PNioBuffers.skipForRead(this.delegate, countI); //count is always at least 1L, so it'll always be valid\n return countI;\n }", "public ReadLengthReadFilter() {}", "public MQCoder(ByteOutputBuffer oStream, int nrOfContexts, int init[]){\n out = oStream;\n\n // --- INITENC\n\n // Default initialization of the statistics bins is MPS=0 and\n // I=0\n I=new int[nrOfContexts];\n mPS=new int[nrOfContexts];\n initStates = init;\n\n a=0x8000;\n c=0;\n if(b==0xFF)\n cT=13;\n else\n cT=12;\n\n resetCtxts();\n\n // End of INITENC ---\n\n b=0;\n }", "public RawReader(final InputStream is) throws NullPointerException {\n\t\tthis(is, DEFAULT_BUFFER_SIZE);\n\t}", "public IteratorSpliterator(Iterator<? extends T> param1Iterator, int param1Int) {\n/* 1747 */ this.collection = null;\n/* 1748 */ this.it = param1Iterator;\n/* 1749 */ this.est = Long.MAX_VALUE;\n/* 1750 */ this.characteristics = param1Int & 0xFFFFBFBF;\n/* */ }", "public MultiWave(AudioFormat f, float a, int n) {\n super(f, a);\n frameRate = getFormat().getFrameRate();\n amplitudes = new float[numFrequencies = n];\n frequencies = new float[n];\n whichWaveForm = new int[n];\n phases = new double[n];\n deltaPhases = new double[n];\n isActive = new boolean[n];\n mixingCoefficients = new double[n][MultiWave.VARIABLE];\n\n for (int i = 0; i < n; i++) {\n isActive[i] = false;\n phases[i] = 0.0;\n deltaPhases[i] = 0.0;\n for (int j = MultiWave.SINE; j < MultiWave.VARIABLE; j++) {\n mixingCoefficients[i][j] = defaultMixingCoefficients[j];\n }\n } // end for i\n initializeSineTable();\n }", "PTB2TextLexer(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "public int skipSamples(int skipAmount) throws IOException {\n long actualSkipped = dis.skip(skipAmount * format.getBytePerSample());\n return (int) actualSkipped / format.getBytePerSample();\n }", "int getInputsCount();", "int getInputsCount();", "int getInputsCount();", "public CardGameFramework()\n {\n this(1, 0, 0, null, 4, 13);\n }", "protected void aInput(Packet packet)\r\n {\r\n \t\tif(!isCorrupted(packet))\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"|aInput| : packet\"+ packet.getSeqnum()+\"is received without corruption.\");\r\n \t\t\t\tint offset = ((packet.getSeqnum()+1) % LimitSeqNo - window_base);\r\n \t\t\t\tif(offset>1)\r\n \t\t\t\t{\r\n \t\t\t\t\tSystem.out.println(\"|aInput| : window_base: \"+window_base);\r\n \t\t\t\t\tSystem.out.println(\"|aInput| : next sequence number: \"+ Integer.toString((packet.getSeqnum()+1) % LimitSeqNo));\r\n \t\t\t\t\tSystem.out.println(\"|aInput| : offset: \"+offset);\r\n \t\t\t\t}\r\n \t\t\t\twindow_base = (packet.getSeqnum()+1) % LimitSeqNo;;\r\n \t\t\t\t\r\n \t\t\t\tif(messageCongestionBuffer.size()>0)\r\n \t\t\t\t{\r\n \t\t\t\t\tString data = messageCongestionBuffer.get(0).getData();\r\n \t\t \t\t\tmessageCongestionBuffer.remove(0);\r\n \t\t \t\t\r\n \t\t \t\t//public Packet(int seq, int ack, int check, String newPayload)\r\n \t\t \t\t\r\n \t\t \t\t\tint seq = next_seq_num % LimitSeqNo;\r\n \t\t \t\t\tint ack = ACK_NOT_USED;\r\n \t\t \t\t\tint check = makeCheckSum(seq,ack,data);\r\n \t\t \t\t\tpacketBufferAry[next_seq_num % LimitSeqNo] = new Packet(seq,ack,check,data);\r\n \t\t \t\t\tSystem.out.println(\"|aInput| : packet with seq number:\"+Integer.toString(next_seq_num)+\" is made\");\r\n \t\t \t\t\ttoLayer3(0,packetBufferAry[next_seq_num % LimitSeqNo]); //udt_send\r\n \t\t \t\t\tSystem.out.println(\"|aInput| : packet with seq number:\"+Integer.toString(next_seq_num)+\" is sent\");\r\n \t\t \t\t\t\r\n \t\t \t\t\tnext_seq_num = (next_seq_num+1)% LimitSeqNo;\t\r\n \t\t \t\tSystem.out.println(\"|aInput| : next_seq_num now becomes: \"+next_seq_num+\".\");\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\tSystem.out.println(\"|aInput| : window_base becomes: \"+ window_base+\".\");\r\n \t\t\t\t\r\n \t\t\t\tif(window_base == next_seq_num)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\tSystem.out.println(\"|aInput| : timer is stopped\");\r\n \t\t\t\t\t\tstopTimer(0);\r\n \t\t\t\t\t}\r\n \t\t\t\telse\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tSystem.out.println(\"|aInput| : timer is restarted\");\r\n \t\t\t\t\t\tstopTimer(0);\r\n \t\t\t\t\t\tstartTimer(0,RxmtInterval);\r\n \t\t\t\t\t}\r\n \t\t\t}\r\n \t\r\n \t/*\r\n \t\tif(state_sender==STATE_WAIT_FOR_ACK_OR_NAK_0)\r\n \t\t{\r\n \t\t\t\r\n \t\t\tif(isCorrupted(packet)) //corrupted \r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"aInput: received packet 0 is corrupted\");\r\n \t\t\t\t//resendPacket(packetBuffer);\r\n \t\t\t}\r\n \t\t\telse if(packet.getAcknum()== ACK_ACKed_1) \r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"aInput: ACKed 1 is received\");\r\n \t\t\t\t//resendPacket(packetBuffer);\r\n \t\t\t}\r\n \t\t\telse //Ack = 1 or bigger mean ACK\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"aInput: ACKed 0 is received\");\r\n \t\t\t\t\r\n \t\t\t\tstate_sender = STATE_WAIT_FOR_CALL_1_FROM_ABOVE;\r\n \t\t\t\tSystem.out.println(\"aInput: sender timer is stopped\");\r\n \t\t\t\tstopTimer(0); \r\n \t\t\t}\r\n \t\t\t\r\n \t\t}\r\n \t\telse if(state_sender==STATE_WAIT_FOR_ACK_OR_NAK_1)\r\n \t\t{\r\n \t\t\tif(isCorrupted(packet)) //corrupted\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"aInput: received packet 1 is corrupted\");\r\n \t\t\t\t//esendPacket(packetBuffer);\r\n \t\t\t}\r\n \t\t\telse if(packet.getAcknum()==ACK_ACKed_0)//Ack = -1 means NAK\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"aInput: ACKed 0 is received\");\r\n \t\t\t\t//resendPacket(packetBuffer);\r\n \t\t\t}\r\n \t\t\telse //Ack = 1 or bigger mean ACK\r\n \t\t\t{\r\n \t\t\t\tSystem.out.println(\"aInput: ACKed 1 is received\");\r\n \t\t\t\tstate_sender = STATE_WAIT_FOR_CALL_0_FROM_ABOVE;\r\n \t\t\t\tSystem.out.println(\"aInput: sender timer is stopped\");\r\n \t\t\t\tstopTimer(0); \r\n \t\t\t}\r\n \t\t}\r\n \t\t*/\r\n \t\t\r\n\r\n }", "public AudioStream(AudioStream clone) {\n this.ID = clone.ID;\n this.to = clone.to;\n this.count = clone.count+1;\n }", "@Override\n public void prepareRun(BatchSourceContext context) throws IOException {\n Map<String, String> arguments = new HashMap<>();\n FileSetArguments.setInputPaths(arguments, config.files);\n context.setInput(Input.ofDataset(config.fileSetName, arguments));\n }" ]
[ "0.6800114", "0.5880652", "0.5831398", "0.53856146", "0.5223372", "0.5053859", "0.50499046", "0.5016823", "0.49161217", "0.4886168", "0.4881826", "0.4881356", "0.48734903", "0.48595622", "0.48091066", "0.47746977", "0.4738498", "0.47039145", "0.46830773", "0.4668298", "0.46593368", "0.46363395", "0.46315828", "0.46209496", "0.46123695", "0.4588695", "0.45721942", "0.45609978", "0.45448875", "0.45139253", "0.4501587", "0.44974148", "0.44482324", "0.44447362", "0.44157907", "0.440495", "0.44010276", "0.43819356", "0.43807948", "0.43764588", "0.4373796", "0.43736768", "0.43712255", "0.43705764", "0.43693835", "0.43677482", "0.43677482", "0.43677482", "0.4358166", "0.43392712", "0.43319458", "0.43282667", "0.43280855", "0.43006024", "0.43004352", "0.42982423", "0.42982423", "0.42982423", "0.42959684", "0.4295948", "0.42934617", "0.42898175", "0.42835304", "0.4277526", "0.4277376", "0.42704692", "0.42621124", "0.4261431", "0.42609048", "0.4257117", "0.42503127", "0.42489952", "0.42452952", "0.42451394", "0.42424896", "0.4240937", "0.42362714", "0.42306906", "0.42271656", "0.42268965", "0.42266315", "0.42240673", "0.42214566", "0.42173678", "0.42142448", "0.42082986", "0.41996855", "0.41977566", "0.41973802", "0.41967538", "0.41925222", "0.4191771", "0.41911936", "0.41838768", "0.41838768", "0.41838768", "0.41829202", "0.41809544", "0.4178372", "0.4177636" ]
0.608227
1
constructor int, AudioContext Creates an Input object with the given number of inputs and particular AudioContext.
public RealTimeInput(int numInputs, AudioContext audioContext, PApplet pa) { this(numInputs, audioContext, false, pa); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RealTimeInput(int numInputs, PApplet pa)\n\t{\n//\t\tthis(numInputs, new AudioContext(new AudioServerIO.JavaSound(), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)));\n\t\tthis(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), pa);\n\t\t\n\t}", "public RealTimeInput(int numInputs, AudioContext audioContext, boolean skip5thru8, PApplet pa)\n\t{\n\t\tif(numInputs < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): int parameter \" + numInputs + \" is less than 1; must be 1 or greater.\");\n\t\t} // if(numInputs < 1)\n\t\tif(audioContext == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): AudioContext parameter \" + audioContext + \" is null.\");\n\t\t} // if(numInputs < 1)\n\n\t\tthis.numInputs = numInputs;\n\t\tthis.ac \t\t= audioContext;\n\t\tthis.pa\t\t\t= pa;\n\t\tthis.skip5thru8\t= skip5thru8;\n\t\t\n\t\tif(this.skip5thru8)\n\t\t{\n\t\t\tthis.adjustedNumInputs\t= this.numInputs - 4;\n\t\t\tSystem.out.println(\"this.adjustedNumInputs = \" + this.adjustedNumInputs);\n\t\t} else {\n\t\t\tthis.adjustedNumInputs\t= this.numInputs;\n\t\t} // \n\t\t\n\t\tthis.disposeHandler\t= new DisposeHandler(this.pa, this);\n\t\tSystem.out.println(\"just registered DisposeHandler for \" + pa);\n\n\t\tthis.uGenArrayFromNumInputs(this.numInputs);\n\t}", "public abstract BasicInput createInput( boolean isSeq ) throws IOException;", "public RealTimeInput(int numInputs, boolean skip5thru8, PApplet pa)\n\t{\n\t\tthis(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), skip5thru8, pa);\n\n\t}", "public FileInputTools(SharedBuffer buffer, int bufferInputFileLength) throws Exception {\r\n\t\tsuper (buffer);\r\n\t\tthis.reset();\r\n\t\tthis.bufferInputFileLength = bufferInputFileLength;\r\n\t\tthis.initializeStream();\r\n\t}", "private void initAudioIn(){\n ArrayList<String> actived = new ArrayList<String>();\n ArrayList<String> mAudioInputChannels = mAudioManagerEx.getAudioDevices(AudioManagerEx.AUDIO_INPUT_TYPE);\n int i = 0;\n for(i = 0; i < mAudioInputChannels.size(); i++){\n String device = mAudioInputChannels.get(i);\n if(device.contains(\"USB\")){\n actived.add(device);\n break;\n }\n }\n //otherwise use codec by default\n if(i == mAudioInputChannels.size()){\n actived.add(AudioManagerEx.AUDIO_NAME_CODEC);\n }\n mAudioManagerEx.setAudioDeviceActive(actived, AudioManagerEx.AUDIO_INPUT_ACTIVE);\n }", "private Audio() {}", "public AudioList(){}", "public CoinAdaptor(Context context) {\n this.inputContext = context;\n this.coinManager = CoinManager.getInstance();\n }", "public AudioService(Context context) {\n this.sharedPreferences = context.getSharedPreferences(\"SPOTIFY\", 0);\n queue = Volley.newRequestQueue(context);\n }", "public synchronized InputContext getInputContext() {\n if (inputContext == null) {\n inputContext = InputContext.getInstance();\n }\n return inputContext;\n }", "public TrackdInputDevice() {\n }", "public Input(MOSEFSettings settings) {\n this.settings = settings;\n\n try {\n AudioFormat format =\n new AudioFormat(settings.getSampleRate(), settings.getBitRate(), 1, true, true);\n int byterate = settings.getBitRate() / 8;\n this.bufferSize = settings.getBufferSize() * byterate;\n targetLine = AudioSystem.getTargetDataLine(format);\n targetLine.open(format, bufferSize);\n this.buffers = new ArrayBlockingQueue<>(3);\n\n Runnable runner = new Runnable() {\n @Override\n public void run() {\n ByteBuffer byteBuffer = ByteBuffer.allocate(bufferSize);\n ShortBuffer shortBuffer = byteBuffer.asShortBuffer();\n double scale = FastMath.pow(2, -settings.getBitRate() - 1);\n byte[] bytes = new byte[bufferSize];\n double[] buffer = new double[settings.getBufferSize()];\n\n while (running) {\n targetLine.read(bytes, 0, bytes.length);\n byteBuffer.rewind();\n byteBuffer.put(bytes);\n shortBuffer.rewind();\n for (int i = 0; i < settings.getBufferSize(); i++) {\n buffer[i] = shortBuffer.get(i) * scale;\n }\n buffers.add(buffer);\n }\n targetLine.stop();\n }\n };\n this.inputThread = new Thread(runner);\n } catch (Exception e) {\n System.err.println(e);\n }\n }", "ActorContext<InputOutput> getContext();", "public InputConsumerFactory(int inputParameterIndex) {\r\n\t\tthis.inputParameterIndex = inputParameterIndex;\r\n\t}", "public AudioSource(boolean loop) {\n\t\tid = AL10.alGenSources();\n\t\tthis.loop = loop;\n\t}", "public SonicAudioProcessor() {\n speed = 1f;\n pitch = 1f;\n channelCount = Format.NO_VALUE;\n sampleRateHz = Format.NO_VALUE;\n buffer = EMPTY_BUFFER;\n shortBuffer = buffer.asShortBuffer();\n outputBuffer = EMPTY_BUFFER;\n }", "public Sample(int numberOfInputs, int numberOfOutputs)\n {\n inputs = new ArrayList<>();\n outputs = new ArrayList<>();\n this.numberOfInputs = numberOfInputs;\n this.numberOfOutputs = numberOfOutputs;\n }", "@Override\n public void onAudioSamples(IAudioSamplesEvent event) {\n\n /*\n * -----------------------------------------------------------------------------------\n * !!! LAB EXERCISE !!!\n * -----------------------------------------------------------------------------------\n * 1. Create a 'ShortBuffer' and point it to the incoming audio samples.\n * Hint: Use 'event.getAudioSamples().getByteBuffer().asShortBuffer()'\n *\n * 2. Loop over the buffer values from 0 to 'buffer.limit()' and access each buffer\n * value using 'buffer.get'\n * Hint: 'buffer.get' gets the sample values as a 'short'\n *\n * 3. Multiply each buffer value by the 'multiplier' (which is a double) then place the\n * resultant value back into the buffer using 'buffer.put'\n * Hint: You may need to cast the data to a 'short' value\n */\n\n // ===================================================================================\n // *** YOUR CODE HERE ***\n ShortBuffer buffer = event.getAudioSamples().getByteBuffer().asShortBuffer();\n\n for (int i = 0; i < buffer.limit(); ++i)\n {\n buffer.put((short)(buffer.get(i) * this.multiplier));\n }\n // ===================================================================================\n\n // Finally, pass the adjusted event to the next tool\n super.onAudioSamples(event);\n }", "public OscillatorCalculator() {\n this(1);\n }", "public RawReader(final InputStream is, final int bufferSize) throws NullPointerException, IllegalArgumentException {\n\t\tif (is == null) {\n\t\t\tthrow new NullPointerException(\"Input stream can't be null\"); \n\t\t}\n\t\telse if (bufferSize <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"Buffer size [\"+bufferSize+\"] must be greater than 0\"); \n\t\t}\n\t\telse {\n\t\t\tthis.is = is;\n\t\t\tthis.buffer = new byte[bufferSize];\n\t\t}\n\t}", "INPUT createINPUT();", "public void createChain(){\r\n Oscillator wt = new Oscillator(this, Oscillator.SAWTOOTH_WAVE, this.sampleRate, this.channels);\r\n Filter filt = new Filter(wt, this.filterCutoff, Filter.LOW_PASS);\r\n Envelope env = new Envelope(filt, \r\n new double[] {0.0, 0.0, 0.05, 1.0, 0.3, 0.4, 1.0, 0.0});\r\n\t\tVolume vol = new Volume(env);\r\n//\t\tSampleOut sout = new SampleOut(vol);\r\n\t}", "public AudioReader(CompositeEntity container, String name)\n\t\t\tthrows NameDuplicationException, IllegalActionException {\n\t\tsuper(container, name);\n\n\t\tfileOrURL = new FileParameter(this, \"fileOrURL\");\n\n\t\t// We use voice.wav so that we can include the voice.wav file\n\t\t// in the jar file for use under Web Start.\n\t\tfileOrURL\n\t\t\t\t.setExpression(\"$CLASSPATH/ptolemy/actor/lib/javasound/voice.wav\");\n\n\t\t// Set the type of the output port.\n\t\toutput.setMultiport(true);\n\t\toutput.setTypeEquals(BaseType.DOUBLE);\n\t}", "public GameViewController(int[] input) {\n\t\tinputs = input;\n\t}", "public Core() {\r\n inputs = new ArrayList<>();\r\n outputs = new ArrayList<>();\r\n converter = new Converter();\r\n\r\n }", "AudioGenerator() {\n minim = new Minim(this);\n // use the getLineOut method of the Minim object to get an AudioOutput object\n out = minim.getLineOut();\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputType addNewInput();", "private Input()\n {\n }", "Input createInput();", "com.indosat.eai.catalist.standardInputOutput.DummyInputType getInput();", "public AudioController(){\n\t sounds = new LinkedList<>();\n\t removables = new LinkedList<>();\n\t availableIds = new HashSet<>();\n\t populateIds();\n\t}", "public Sample()\n {\n inputs = new ArrayList<>();\n outputs = new ArrayList<>();\n numberOfInputs = 0;\n numberOfOutputs = 0;\n comment = \"\";\n }", "public Context(int width, int height)\n {\n this.width = width;\n this.height = height;\n this.data = new int[width * height];\n this.image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n data = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();\n }", "public GameInput() {\n keyboard = new Keyboard();\n mouse = new Mouse();\n mouseWheel = new MouseWheel();\n }", "public void setInputCount(final int i) {\n this.inputCount = i;\n\n }", "public MQCoder(ByteOutputBuffer oStream, int nrOfContexts, int init[]){\n out = oStream;\n\n // --- INITENC\n\n // Default initialization of the statistics bins is MPS=0 and\n // I=0\n I=new int[nrOfContexts];\n mPS=new int[nrOfContexts];\n initStates = init;\n\n a=0x8000;\n c=0;\n if(b==0xFF)\n cT=13;\n else\n cT=12;\n\n resetCtxts();\n\n // End of INITENC ---\n\n b=0;\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput addNewDummyInput();", "public WaveSystem()\n\t{\n\t\t\n\t}", "public AudioStream(int ID, long count) {\n this.ID = ID;\n this.count = count;\n }", "protected JoystickInput() {\n }", "public Sound(Context context) {\r\n\t\tthis.mp = MediaPlayer.create(context, R.raw.baby);\r\n\t\r\n\t}", "public Context() {\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "@Override\n public void onInputBufferAvailable(@NonNull MediaCodec codec, int index) {\n\n synchronized (mAvailableInputs) {\n mAvailableInputs.add(index);\n mAvailableInputs.notifyAll();\n }\n }", "public MultiWave(AudioFormat f, float a, int n) {\n super(f, a);\n frameRate = getFormat().getFrameRate();\n amplitudes = new float[numFrequencies = n];\n frequencies = new float[n];\n whichWaveForm = new int[n];\n phases = new double[n];\n deltaPhases = new double[n];\n isActive = new boolean[n];\n mixingCoefficients = new double[n][MultiWave.VARIABLE];\n\n for (int i = 0; i < n; i++) {\n isActive[i] = false;\n phases[i] = 0.0;\n deltaPhases[i] = 0.0;\n for (int j = MultiWave.SINE; j < MultiWave.VARIABLE; j++) {\n mixingCoefficients[i][j] = defaultMixingCoefficients[j];\n }\n } // end for i\n initializeSineTable();\n }", "public SystemSoundsUtil(Context cntx) {\n\t\tsuper();\n\n\t\tthis.cntx = cntx;\n\t}", "public FloatSampleBuffer() {\n\t\tthis(0, 0, 1);\n\t}", "Builder addAudio(AudioObject value);", "public Input(long begTime, long endTime, int keystrokeNum, int mouseClickNum) {\r\n this.begTime = begTime;\r\n this.endTime = endTime;\r\n this.keystrokeNum = keystrokeNum;\r\n this.mouseClickNum = mouseClickNum;\r\n }", "@Override\n protected void initializeSample(SamplingContext context) {\n for(int i = 0 ; i < this.EVars.length ; i++) {\n Variable EVar = this.EVars[i];\n int EVal = this.EVals[i];\n int EIndex = Toolkit.indexOf(this.sampledVars, EVar);\n context.sampledVarsAssignment[EIndex] = EVal;\n }\n // produce a few samples to get the network into a more \"normal\" state\n for(int i = 0 ; i < this.resamplingActions.size() * 2 ; i++)\n this.produceSample(context);\n context.sampleWeight = 1.0;\n\n /*WeightedSampleProducer weightedSampler = new WeightedSampleProducer(\n this.bn, this.XVars, this.YVars, this.EVars, this.EVals);\n // the variable values are preserved after the following call\n weightedSampler.produceSample(context); // evidence is correctly set\n context.sampleWeight = 1.0;*/\n }", "public interface PlayerStateContext<SourceInfo> {\n\n\tMediaPlayer getMediaPlayer();\n\n\tPlayerSource<SourceInfo> getPlayerSource();\n\n\tDeviceSleep getDeviceSleep();\n\n\tboolean isRepeat();\n\n\tContext context();\n\n\tvoid setPlayerState(PlayerState playerState);\n\n\tvoid onUpdate();\n\n\tvoid onError(Throwable throwable);\n\n\tvoid requestFocus(Action success, Action fail);\n\n\tvoid abandonAudioFocus();\n\n}", "public Input(final MatrixStore<Double> Q, final MatrixStore<Double> C, final MatrixStore<Double> A, final MatrixStore<Double> B) {\n\n super();\n\n myQ = Q;\n myC = C;\n myA = A;\n myB = B;\n }", "public abstract void newSpeechFeedback(long ms, int n);", "public RadioLFW (Context context) {\n super(context);\n }", "public Voice() {\n /* Make the utteranceProcessors a synchronized list to avoid\n * some threading issues.\n */\n utteranceProcessors = Collections.synchronizedList(new ArrayList());\n\tfeatures = new FeatureSetImpl();\n\tfeatureProcessors = new HashMap();\n\n\ttry {\n\t nominalRate = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"speakingRate\",\"150\"));\n\t pitch = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"pitch\",\"100\"));\n\t range = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"range\",\"10\"));\n\t volume = Float.parseFloat(\n\t\t Utilities.getProperty(PROP_PREFIX + \"volume\",\"1.0\"));\n\t} catch (SecurityException se) {\n\t // can't get properties, just use defaults\n\t}\n outputQueue = null;\n audioPlayer = null;\n defaultAudioPlayer = null;\n }", "public DataSource getAudioSource();", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public MediaWSDemoApplication(BundleContext context) {\n\t\ttheContext = context ;\n\t}", "public Music()\n {\n this(0, \"\", \"\", \"\", \"\", \"\");\n }", "public Context(Program program) {\n this.instructionList = program.iterator();\n }", "public void initEncoderTxData()\n\t{\n\t\tfor(counter_i=0;counter_i<sampleBit;counter_i++)\n\t\t{\n\t\t\thighLevel[counter_i] = (short) (audioAM * (-Math.sin(Math.PI * counter_i /sampleBit * 2)));\n\t\t\tlowLevel[counter_i] = (short) (audioAM * (Math.sin(Math.PI * counter_i /sampleBit * 2)));\n\t\t}\n\t}", "public CardGameFramework()\n {\n this(1, 0, 0, null, 4, 13);\n }", "public Map<String,Serializable> bindInputs(Map<String,Serializable> context,\n List<Input> inputs){\n Map<String,Serializable> resultContext = new HashMap<>();\n Map<String,Serializable> srcContext = new HashMap<>(context); //we do not want to change original context map\n for(Input input : inputs){\n bindInput(input,srcContext,resultContext);\n }\n return resultContext;\n }", "public ConstructedObjectInput(AppContext c,Class<T> target){\n \tthis(c,target,c.getClassMap(target));\n }", "protected IOContext _createContext(Object srcRef, boolean resourceManaged)\n/* */ {\n/* 1513 */ return new IOContext(_getBufferRecycler(), srcRef, resourceManaged);\n/* */ }", "@Override\n\tpublic ContextLabel recognize(KinectData input, String timeStamp) {\n\t\tdouble inputD[][] = new double[30][75];\n\t\tfor(int i = 0; i<input.getAry().size(); i++){\n\t\t\tinputD[i] = input.getAry().get(i);\n\t\t}\n\t\t\n\t\t/*\n\t\tfor(double[] ad1 : inputD){\n\t\t\tfor(double ad2 : ad1){\n\t\t\t\tSystem.out.print(ad2 + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}*/\n\t\tfeatureExtractor.setInputData(inputD);\n\t\tdouble[] inputFeatures = featureExtractor.extractFeatures();\n\t\t// siD and sjD are read from txt file. I do not know how to input this file. Help me!\n\t\t\n\t\tString rlt = ar.Classify(inputFeatures);\n\t\tif(verbose)logger.info(\"Output of Var Thien \" + userID + \"\\t\" + rlt + \"\\t\" + timeStamp);\n\t\treturn new ContextLabel(userID, rlt, timeStamp, ContextType.Activity);\n\t}", "protected abstract UtteranceProcessor getAudioOutput() throws IOException ;", "protected AudioController(SoundSource source) {\r\n\t\tthis.source = source;\r\n\t}", "public InputDataHandler() {}", "public PotionEffect(int paramInt1, int paramInt2, int paramInt3)\r\n/* 21: */ {\r\n/* 22: 32 */ this(paramInt1, paramInt2, paramInt3, false, true);\r\n/* 23: */ }", "@Override\n\tpublic void init () {\n\t\tframeBuffers = new FrameBuffer[getPassQuantity()];\n\t\tpassShaderProviders = new ShaderProvider[getPassQuantity()];\n\n\t\tfor (int i = 0; i < getPassQuantity(); i++) {\n\t\t\tinit(i);\n\t\t}\n\t}", "public TextInput() {\n // initialise instansvariables\n }", "public interface AudioInputLine extends AbstractLine {\n\n /**\n * Fill given buffer with mic captured data\n *\n * @param buffer where to put data\n * @param offset start position\n * @param length amount of byte to put\n * @return actual amount of reade bytes\n */\n\n int readNonBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Short cut for read\n *\n * @param buffer to fill with data\n * @return actual amount of reade bytes\n */\n\n default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }\n\n /**\n * Blocking read\n *\n * @param buffer to fill\n * @param offset buffer start position\n * @param length amount of bytes to read\n * @return actual number of read bytes from underlying device buffer\n */\n\n int readBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Blocking read for full buffer\n *\n * @param buffer to fill\n * @return actual number of read bytes from underlying device buffer\n */\n\n default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }\n}", "public void setInputCnt(Integer inputCnt) {\r\n this.inputCnt = inputCnt;\r\n }", "public IntArrays()\n\t{\n\t\tthis(10);\n\t}", "@SuppressWarnings(\"unused\")\n public static AudioFragment newInstance(int columnCount,Context context) {\n AudioFragment fragment = new AudioFragment();\n Bundle args = new Bundle();\n audioContext = context;\n args.putInt(ARG_COLUMN_COUNT, columnCount);\n fragment.setArguments(args);\n return fragment;\n }", "public interface Audio {\r\n\r\n\t//******************************GETS*****************************\r\n//\tpublic FileOutputStream getAudioByBitRate(String bitrate);\r\n\t/**\r\n\t * If the file was uploaded in a rate of 128 kbits/s then streaming at 320 kbits/s provides no benefits.\r\n\t * This method allows the client to check what bitrates exist and choose the adequate one.\t\r\n\t * @return String with all the BitRates accessible.\r\n\t */\r\n\tpublic ArrayList<Integer> getAccessibleBitRates();\r\n\t/**\r\n\t * Returns a Stream with the Audio in the default BitRate.\r\n\t * @return Audio stream.\r\n\t */\r\n//\tpublic FileOutputStream getAudio();\r\n\t/**\r\n\t * Evaluates if the Bitrate \"bitrate\" is allowed for audio and returns a Stream if it is.\r\n\t * @param bitrate \r\n\t * @return FileOutputStream\r\n\t */\r\n//\tpublic FileOutputStream getAudioByBitRate(int bitrate);\r\n\tpublic String getDir();\r\n\tpublic String getFileName();\r\n\t//******************************ACTIONS*****************************\r\n\t/**\r\n\t * Sets the bitRate for the value that comes as parameter.\r\n\t * @return\r\n\t */\r\n\tpublic boolean setDefaultBitRate(String bitrate);\r\n\t/**\r\n\t * Converts the Audio to the default system type, mp3. \r\n\t * @return The type of the file. If it failed returns a null String.\r\n\t */\r\n\tpublic boolean convertAudioTypeToDefault();\r\n\tboolean convertAudioTypeToDefault(String dir, long size,\r\n\t\t\tint defaultBitRate, String type);\r\n\tpublic boolean setAudioType(String type);\r\n\tpublic void setMaxBitRate(String bitRate);\r\n\tpublic Response download(String appId, String audioId, String dir);\r\n\tpublic void setDir(String dir);\r\n\tpublic void setSize(long size);\r\n\tpublic void setCreationDate(String creationDate);\r\n\tpublic void setFileName(String fileName);\r\n\tpublic void setLocation(String location);\r\n}", "public InputArray() \n\t{\n\t\tinputArray = null;\n\t}", "public Feedback(){\n\n\t\tleftVL = new DigitalInput(RobotPorts.leftVL);\n\t\trightVL = new DigitalInput(RobotPorts.rightVL);\n\n\t\ttoteDetectorLow = new DigitalInput(RobotPorts.toteDetectorLow);\n\t\ttoteDetectorHigh = new DigitalInput(RobotPorts.toteDetectorHigh);\n\n\t\taccel = new BuiltInAccelerometer();\n\t}", "Builder addAudio(AudioObject.Builder value);", "public AudioEntity createFromParcel(Parcel in) {\n AudioEntity audioEntity = new AudioEntity();\n audioEntity.readFromParcel(in);\n return audioEntity;\n }", "public CardGameFramework() {\n this(1, 0, 0, null, 4, 13);\n }", "IAudio read(InputStream inputStream) throws AudioReaderException, InvalidFormatException;", "public AudioStream(AudioStream clone) {\n this.ID = clone.ID;\n this.to = clone.to;\n this.count = clone.count+1;\n }", "public Sample(ArrayList<Double> inputs, ArrayList<Double> outputs)\n {\n this.inputs = inputs;\n this.outputs = outputs;\n numberOfInputs = 0;\n numberOfOutputs = 0;\n comment = \"\";\n }", "AudioProcessor[] mo25073a();", "protected AtomicFunction(int in_arity, int out_arity)\n\t{\n\t\tsuper(in_arity, out_arity);\n\t\tm_context = new HashMap<>();\n\t\tm_inputPins = new AtomicFunctionInputPin[in_arity];\n\t\tfor (int i = 0; i < in_arity; i++)\n\t\t{\n\t\t\tm_inputPins[i] = new AtomicFunctionInputPin(i);\n\t\t}\n\t\tm_outputPins = new AtomicFunctionOutputPin[out_arity];\n\t\tfor (int i = 0; i < out_arity; i++)\n\t\t{\n\t\t\tm_outputPins[i] = new AtomicFunctionOutputPin(i);\n\t\t}\n\t}", "public LinearNeuron(int inputs)\n\t{\n\t\tsuper(inputs);\n\t}", "public CustomTextInputLayout(Context context) {\n super(context);\n }", "protected void setupInputs() {\n \tim=new GenericInputManager();\n \tArrayList<Controller> controllers=im.getControllers();\n \t\n \tfor(Controller controller:controllers) {\n \t\tplayer.setupInputs(im, controller);\n \t}\n \t\t\t\n \t\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\t\t\n\t}", "TclInputStream(InputStream inInput) {\n input = inInput;\n }", "EventChannel create(Context context);", "public void setContext(GLContext context);", "WordCounter(String inputText){\r\n \r\n wordSource = inputText;\r\n }" ]
[ "0.6502128", "0.61515665", "0.5278119", "0.5203188", "0.51338714", "0.5130008", "0.5129943", "0.5067977", "0.50645274", "0.50639474", "0.5043544", "0.5032607", "0.49954987", "0.4944327", "0.49045533", "0.48876968", "0.48869485", "0.48516393", "0.48432443", "0.48212314", "0.48002046", "0.47918102", "0.47857663", "0.47821864", "0.4771631", "0.47469422", "0.47430876", "0.47069222", "0.47012353", "0.46972972", "0.4678355", "0.4670677", "0.4647458", "0.4637933", "0.4623118", "0.4613047", "0.46002963", "0.45892656", "0.45869207", "0.45866746", "0.45840862", "0.4550764", "0.4548043", "0.45333904", "0.45333904", "0.45333904", "0.45193964", "0.4513208", "0.45096648", "0.45072955", "0.44951195", "0.4488713", "0.44858116", "0.4471787", "0.44695586", "0.44634938", "0.44599444", "0.44580683", "0.44521466", "0.4447802", "0.4447802", "0.4447802", "0.44458193", "0.44438627", "0.44423532", "0.44412652", "0.4437845", "0.44340864", "0.4430977", "0.44299632", "0.4428706", "0.4427855", "0.4427039", "0.44169948", "0.4405142", "0.43994159", "0.43977287", "0.43871528", "0.43765214", "0.43748966", "0.43686843", "0.43673256", "0.43648642", "0.43600315", "0.4358284", "0.43521026", "0.43440214", "0.43330267", "0.4324325", "0.43179733", "0.4312013", "0.43048313", "0.43036848", "0.43031362", "0.4302593", "0.4301698", "0.42938814", "0.42909744", "0.42906582", "0.42889488" ]
0.65247315
0
int, AudioContext Creates an Input object with the given number of inputs and the particular AudioContext, as well as the option to skip inputs 58 (this assumes that you will have adjusted for the skip and passed in 4 more inputs than you plan to need; e.g., numInputs = 16 for 12 lines).
public RealTimeInput(int numInputs, AudioContext audioContext, boolean skip5thru8, PApplet pa) { if(numInputs < 1) { throw new IllegalArgumentException("Input.constructor(int, AudioContext): int parameter " + numInputs + " is less than 1; must be 1 or greater."); } // if(numInputs < 1) if(audioContext == null) { throw new IllegalArgumentException("Input.constructor(int, AudioContext): AudioContext parameter " + audioContext + " is null."); } // if(numInputs < 1) this.numInputs = numInputs; this.ac = audioContext; this.pa = pa; this.skip5thru8 = skip5thru8; if(this.skip5thru8) { this.adjustedNumInputs = this.numInputs - 4; System.out.println("this.adjustedNumInputs = " + this.adjustedNumInputs); } else { this.adjustedNumInputs = this.numInputs; } // this.disposeHandler = new DisposeHandler(this.pa, this); System.out.println("just registered DisposeHandler for " + pa); this.uGenArrayFromNumInputs(this.numInputs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RealTimeInput(int numInputs, boolean skip5thru8, PApplet pa)\n\t{\n\t\tthis(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), skip5thru8, pa);\n\n\t}", "public RealTimeInput(int numInputs, AudioContext audioContext, PApplet pa)\n\t{\n\t\tthis(numInputs, audioContext, false, pa);\n\t}", "public void setInputCount(final int i) {\n this.inputCount = i;\n\n }", "public abstract BasicInput createInput( boolean isSeq ) throws IOException;", "public void setInputCnt(Integer inputCnt) {\r\n this.inputCnt = inputCnt;\r\n }", "public void setNumberOfInputs(int numberOfInputs)\n {\n this.numberOfInputs = numberOfInputs;\n }", "public RealTimeInput(int numInputs, PApplet pa)\n\t{\n//\t\tthis(numInputs, new AudioContext(new AudioServerIO.JavaSound(), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)));\n\t\tthis(numInputs, new AudioContext(new PortAudioAudioIO(numInputs), 512, AudioContext.defaultAudioFormat(numInputs, numInputs)), pa);\n\t\t\n\t}", "org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index);", "org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index);", "public static void setNumberOfInputs(int _n)\r\n {\r\n numberOfInputs = _n;\r\n }", "public int getNumberOfInputs()\n {\n return numberOfInputs;\n }", "org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index);", "org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index);", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public Builder setInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.set(index, value);\n onChanged();\n } else {\n inputsBuilder_.setMessage(index, value);\n }\n return this;\n }", "public InputConsumerFactory(int inputParameterIndex) {\r\n\t\tthis.inputParameterIndex = inputParameterIndex;\r\n\t}", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "public Builder addInputs(\n int index, org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(index, value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(index, value);\n }\n return this;\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputType getInput();", "int getInputsCount();", "int getInputsCount();", "int getInputsCount();", "public void testMixer_getNumberOfInputPortMin() throws InterruptedException {\n Integer NbPortTested = 1;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", 2, mixer.getNumberOfInputPort(),0);\n }", "public void calculateInputs()\n {\n numberOfInputs = inputs.size();\n }", "public Integer getInputCnt() {\r\n return inputCnt;\r\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {\n return inputs_.get(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {\n return inputs_.get(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {\n return inputs_.get(index);\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputType addNewInput();", "public int skipSamples(int skipAmount) throws IOException {\n long actualSkipped = dis.skip(skipAmount * format.getBytePerSample());\n return (int) actualSkipped / format.getBytePerSample();\n }", "@java.lang.Override\n public com.clarifai.grpc.api.InputIDs getInputIds() {\n if (inputSourceCase_ == 2) {\n return (com.clarifai.grpc.api.InputIDs) inputSource_;\n }\n return com.clarifai.grpc.api.InputIDs.getDefaultInstance();\n }", "public int getInputsCount() {\n return inputs_.size();\n }", "public int getInputsCount() {\n return inputs_.size();\n }", "public int getInputsCount() {\n return inputs_.size();\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index) {\n return inputs_.get(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index) {\n return inputs_.get(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index) {\n return inputs_.get(index);\n }", "public int getInputPositionIncrement () { return 1; }", "public void testMixer_getNumberOfInputPort() throws InterruptedException {\n Integer NbPortTested = 3;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", NbPortTested, mixer.getNumberOfInputPort(),0);\n }", "@java.lang.Override\n public com.clarifai.grpc.api.InputIDsOrBuilder getInputIdsOrBuilder() {\n if (inputSourceCase_ == 2) {\n return (com.clarifai.grpc.api.InputIDs) inputSource_;\n }\n return com.clarifai.grpc.api.InputIDs.getDefaultInstance();\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder(\n int index) {\n return getInputsFieldBuilder().addBuilder(\n index, org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder(\n int index) {\n return getInputsFieldBuilder().addBuilder(\n index, org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder addInputsBuilder(\n int index) {\n return getInputsFieldBuilder().addBuilder(\n index, org.hyperledger.fabric.protos.token.Transaction.InputId.getDefaultInstance());\n }", "public interface AudioInputLine extends AbstractLine {\n\n /**\n * Fill given buffer with mic captured data\n *\n * @param buffer where to put data\n * @param offset start position\n * @param length amount of byte to put\n * @return actual amount of reade bytes\n */\n\n int readNonBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Short cut for read\n *\n * @param buffer to fill with data\n * @return actual amount of reade bytes\n */\n\n default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }\n\n /**\n * Blocking read\n *\n * @param buffer to fill\n * @param offset buffer start position\n * @param length amount of bytes to read\n * @return actual number of read bytes from underlying device buffer\n */\n\n int readBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Blocking read for full buffer\n *\n * @param buffer to fill\n * @return actual number of read bytes from underlying device buffer\n */\n\n default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }\n}", "P preProcessInputs(R rawInputs);", "@Override\n protected long skip0(@Positive long count) throws IOException {\n int countI = (int) min(count, this.delegate.remaining());\n PNioBuffers.skipForRead(this.delegate, countI); //count is always at least 1L, so it'll always be valid\n return countI;\n }", "private void createInputLayer(Instances instances) throws Exception {\r\n\t\tinputs = new ArrayList<InputNode>();\r\n\t\tint now = 0;\r\n\t\tfor (int attrNum = 0; attrNum < numAttributes + 1; attrNum++) {\r\n\t\t\tif (instances.classIndex() != attrNum) {\r\n\t\t\t\tInputNode input = new InputNode(instances.attribute(attrNum).name(), attrNum);\r\n\t\t\t\tinputs.add(attrNum - now, input);\r\n\t\t\t} else {\r\n\t\t\t\tnow = 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {\n if (inputsBuilder_ == null) {\n return inputs_.get(index);\n } else {\n return inputsBuilder_.getMessage(index);\n }\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {\n if (inputsBuilder_ == null) {\n return inputs_.get(index);\n } else {\n return inputsBuilder_.getMessage(index);\n }\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId getInputs(int index) {\n if (inputsBuilder_ == null) {\n return inputs_.get(index);\n } else {\n return inputsBuilder_.getMessage(index);\n }\n }", "protected void setupInputs() {\n \tim=new GenericInputManager();\n \tArrayList<Controller> controllers=im.getControllers();\n \t\n \tfor(Controller controller:controllers) {\n \t\tplayer.setupInputs(im, controller);\n \t}\n \t\t\t\n \t\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(\n int index) {\n return getInputsFieldBuilder().getBuilder(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(\n int index) {\n return getInputsFieldBuilder().getBuilder(index);\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputId.Builder getInputsBuilder(\n int index) {\n return getInputsFieldBuilder().getBuilder(index);\n }", "public int numInputs() {\r\n\t\treturn numInputs;\r\n\t}", "public GameViewController(int[] input) {\n\t\tinputs = input;\n\t}", "public Input(MOSEFSettings settings) {\n this.settings = settings;\n\n try {\n AudioFormat format =\n new AudioFormat(settings.getSampleRate(), settings.getBitRate(), 1, true, true);\n int byterate = settings.getBitRate() / 8;\n this.bufferSize = settings.getBufferSize() * byterate;\n targetLine = AudioSystem.getTargetDataLine(format);\n targetLine.open(format, bufferSize);\n this.buffers = new ArrayBlockingQueue<>(3);\n\n Runnable runner = new Runnable() {\n @Override\n public void run() {\n ByteBuffer byteBuffer = ByteBuffer.allocate(bufferSize);\n ShortBuffer shortBuffer = byteBuffer.asShortBuffer();\n double scale = FastMath.pow(2, -settings.getBitRate() - 1);\n byte[] bytes = new byte[bufferSize];\n double[] buffer = new double[settings.getBufferSize()];\n\n while (running) {\n targetLine.read(bytes, 0, bytes.length);\n byteBuffer.rewind();\n byteBuffer.put(bytes);\n shortBuffer.rewind();\n for (int i = 0; i < settings.getBufferSize(); i++) {\n buffer[i] = shortBuffer.get(i) * scale;\n }\n buffers.add(buffer);\n }\n targetLine.stop();\n }\n };\n this.inputThread = new Thread(runner);\n } catch (Exception e) {\n System.err.println(e);\n }\n }", "com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput addNewDummyInput();", "public void createChain(){\r\n Oscillator wt = new Oscillator(this, Oscillator.SAWTOOTH_WAVE, this.sampleRate, this.channels);\r\n Filter filt = new Filter(wt, this.filterCutoff, Filter.LOW_PASS);\r\n Envelope env = new Envelope(filt, \r\n new double[] {0.0, 0.0, 0.05, 1.0, 0.3, 0.4, 1.0, 0.0});\r\n\t\tVolume vol = new Volume(env);\r\n//\t\tSampleOut sout = new SampleOut(vol);\r\n\t}", "Input getInputs();", "public Sample(int numberOfInputs, int numberOfOutputs)\n {\n inputs = new ArrayList<>();\n outputs = new ArrayList<>();\n this.numberOfInputs = numberOfInputs;\n this.numberOfOutputs = numberOfOutputs;\n }", "INPUT createINPUT();", "public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index) {\n if (inputsBuilder_ == null) {\n return inputs_.get(index); } else {\n return inputsBuilder_.getMessageOrBuilder(index);\n }\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index) {\n if (inputsBuilder_ == null) {\n return inputs_.get(index); } else {\n return inputsBuilder_.getMessageOrBuilder(index);\n }\n }", "public org.hyperledger.fabric.protos.token.Transaction.InputIdOrBuilder getInputsOrBuilder(\n int index) {\n if (inputsBuilder_ == null) {\n return inputs_.get(index); } else {\n return inputsBuilder_.getMessageOrBuilder(index);\n }\n }", "public FileInputTools(SharedBuffer buffer, int bufferInputFileLength) throws Exception {\r\n\t\tsuper (buffer);\r\n\t\tthis.reset();\r\n\t\tthis.bufferInputFileLength = bufferInputFileLength;\r\n\t\tthis.initializeStream();\r\n\t}", "private int getNumberOfInputFeatures(final Collection<TrainingEntry<Login>> trainingDataSet) {\n return trainingDataSet.iterator().next().getEntity().getKeystrokeTimestamps().size();\n }", "@Override\n public void prepareRun(BatchSourceContext context) throws IOException {\n Map<String, String> arguments = new HashMap<>();\n FileSetArguments.setInputPaths(arguments, config.files);\n context.setInput(Input.ofDataset(config.fileSetName, arguments));\n }", "@Override\n public void onAudioSamples(IAudioSamplesEvent event) {\n\n /*\n * -----------------------------------------------------------------------------------\n * !!! LAB EXERCISE !!!\n * -----------------------------------------------------------------------------------\n * 1. Create a 'ShortBuffer' and point it to the incoming audio samples.\n * Hint: Use 'event.getAudioSamples().getByteBuffer().asShortBuffer()'\n *\n * 2. Loop over the buffer values from 0 to 'buffer.limit()' and access each buffer\n * value using 'buffer.get'\n * Hint: 'buffer.get' gets the sample values as a 'short'\n *\n * 3. Multiply each buffer value by the 'multiplier' (which is a double) then place the\n * resultant value back into the buffer using 'buffer.put'\n * Hint: You may need to cast the data to a 'short' value\n */\n\n // ===================================================================================\n // *** YOUR CODE HERE ***\n ShortBuffer buffer = event.getAudioSamples().getByteBuffer().asShortBuffer();\n\n for (int i = 0; i < buffer.limit(); ++i)\n {\n buffer.put((short)(buffer.get(i) * this.multiplier));\n }\n // ===================================================================================\n\n // Finally, pass the adjusted event to the next tool\n super.onAudioSamples(event);\n }", "public int getInputBlockSize();", "@java.lang.Override\n public boolean hasInputIds() {\n return inputSourceCase_ == 2;\n }", "@java.lang.Override\n public boolean hasInputIds() {\n return inputSourceCase_ == 2;\n }", "@Override\n public void onInputBufferAvailable(@NonNull MediaCodec codec, int index) {\n\n synchronized (mAvailableInputs) {\n mAvailableInputs.add(index);\n mAvailableInputs.notifyAll();\n }\n }", "R extractRawInputs(I input);", "@java.lang.Override\n public com.clarifai.grpc.api.InputIDs getInputIds() {\n if (inputIdsBuilder_ == null) {\n if (inputSourceCase_ == 2) {\n return (com.clarifai.grpc.api.InputIDs) inputSource_;\n }\n return com.clarifai.grpc.api.InputIDs.getDefaultInstance();\n } else {\n if (inputSourceCase_ == 2) {\n return inputIdsBuilder_.getMessage();\n }\n return com.clarifai.grpc.api.InputIDs.getDefaultInstance();\n }\n }", "private List<PredictionInput> prepareInputs(int noOfFeatures, int featureIndex, double[] featureXSvalues,\n double[][] trainingData, int i) {\n List<PredictionInput> predictionInputs = new ArrayList<>(seriesLength);\n double[] inputs = new double[noOfFeatures];\n inputs[featureIndex] = featureXSvalues[i];\n for (int j = 0; j < seriesLength; j++) {\n for (int f = 0; f < noOfFeatures; f++) {\n if (f != featureIndex) {\n inputs[f] = trainingData[f][j];\n }\n }\n PredictionInput input = new PredictionInput(DataUtils.doublesToFeatures(inputs));\n predictionInputs.add(input);\n }\n return predictionInputs;\n }", "public static void makeSampleInputIf(final JobConf job, String name, int lineCount) throws IOException {\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tInputFormat<?,?> inputFormat;\r\n\t\tif ((inputFormat = job.getInputFormat()) instanceof FileInputFormat) {\r\n\t\t\tPath []inputPaths = FileInputFormat.getInputPaths(job);\r\n\t\t\tif (inputPaths==null||inputPaths.length==0) {\r\n\t\t\t\tPath input = new Path( name );\r\n\t\t\t\tFileInputFormat.setInputPaths(job, input);\r\n\t\t\t\t/** Has the input format been set? */\r\n\t\t\t\tif (job.get(\"mapred.input.format.class\")==null) {\r\n\t\t\t\t\tjob.setInputFormat(KeyValueTextInputFormat.class);\r\n\t\t\t\t}\r\n\t\t\t\tFileSystem fs = input.getFileSystem(job);\r\n\t\t\t\tif (!fs.exists(input)) {\r\n\t\t\t\t\tFSDataOutputStream out = null;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tout = fs.create(input);\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tFormatter fmt = new Formatter(out);\r\n\t\t\t\t\t\tfor (int lineNo = 0; lineNo < lineCount; lineNo++) {\r\n\t\t\t\t\t\t\tfmt.format(\"Key%d\\tValue%d%n\", lineNo, lineNo);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfmt.flush();\r\n\t\t\t\t\t} finally {\r\n\t\t\t\t\t\tif (out!=null) {\r\n\t\t\t\t\t\t\tout.close();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void enableInputs();", "public static InputFactory createSequentialFactory( final DataSource datsrc,\n final long offset,\n final long leng ) {\n return new AbstractInputFactory( false ) {\n public BasicInput createInput( boolean isSeq )\n throws IOException {\n InputStream baseIn = datsrc.getInputStream();\n IOUtils.skip( baseIn, offset );\n DataInputStream dataIn =\n new DataInputStream(\n new BufferedInputStream( baseIn ) );\n return createSequentialInput( dataIn );\n }\n };\n }", "@SuppressWarnings(\"unchecked\")\n @Override\n public void setup(Context context) throws IOException, InterruptedException {\n super.setup(context);\n\n InputSplit is = context.getInputSplit();\n if (is instanceof FileSplit)\n split = (FileSplit) is;\n // push the current filename on to the NDC\n if (null != split) {\n NDC.push(split.getPath().toString());\n splitStart = Long.valueOf(split.getStart()).toString();\n } else\n splitStart = null;\n\n // Needed for side-effects\n markingFunctions = MarkingFunctions.Factory.createMarkingFunctions();\n\n // Initialize the Type Registry\n TypeRegistry.getInstance(context.getConfiguration());\n\n interval = context.getConfiguration().getLong(DISCARD_INTERVAL, 0l);\n\n // default to true, but it can be disabled\n createSequenceFileName = context.getConfiguration().getBoolean(LOAD_SEQUENCE_FILE_NAME, true);\n\n trimSequenceFileName = context.getConfiguration().getBoolean(TRIM_SEQUENCE_FILE_NAME, true);\n\n createRawFileName = context.getConfiguration().getBoolean(LOAD_RAW_FILE_NAME, true);\n\n Class<? extends KeyValueFilter<K2,V2>> firstFilter = null;\n\n // Use the filter class as the context writer if any\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n if (classLoader == null) {\n classLoader = EventMapper.class.getClassLoader();\n }\n Configuration filterConf = new Configuration(context.getConfiguration());\n Class<? extends KeyValueFilter<K2,V2>> lastFilter = null;\n for (String filterClassName : getDataTypeFilterClassNames()) {\n\n Class<? extends KeyValueFilter<K2,V2>> filterClass = null;\n try {\n filterClass = (Class<? extends KeyValueFilter<K2,V2>>) Class.forName(filterClassName, true, classLoader);\n if (firstFilter == null) {\n firstFilter = filterClass;\n }\n if (lastFilter != null) {\n KeyValueFilter<K2,V2> filter = lastFilter.getDeclaredConstructor().newInstance();\n filter.configureChainedContextWriter(filterConf, filterClass);\n }\n lastFilter = filterClass;\n } catch (Exception e) {\n throw new IOException(\"Unable to configure \" + filterClass + \" on \" + lastFilter, e);\n }\n }\n\n Class<? extends ContextWriter<K2,V2>> contextWriterClass;\n\n if (Mutation.class.equals(context.getMapOutputValueClass())) {\n contextWriterClass = (Class<ContextWriter<K2,V2>>) context.getConfiguration().getClass(CONTEXT_WRITER_CLASS, LiveContextWriter.class,\n ContextWriter.class);\n } else {\n contextWriterClass = (Class<ContextWriter<K2,V2>>) context.getConfiguration().getClass(CONTEXT_WRITER_CLASS, BulkContextWriter.class,\n ContextWriter.class);\n }\n\n if (lastFilter != null) {\n try {\n KeyValueFilter<K2,V2> filter = lastFilter.newInstance();\n filter.configureChainedContextWriter(filterConf, contextWriterClass);\n } catch (Exception e) {\n throw new IOException(\"Unable to configure \" + contextWriterClass + \" on \" + lastFilter, e);\n }\n contextWriterClass = firstFilter;\n }\n try {\n contextWriter = contextWriterClass.getDeclaredConstructor().newInstance();\n contextWriter.setup(filterConf, filterConf.getBoolean(CONTEXT_WRITER_OUTPUT_TABLE_COUNTERS, false));\n } catch (Exception e) {\n throw new IOException(\"Failed to initialized \" + contextWriterClass + \" from property \" + CONTEXT_WRITER_CLASS, e);\n }\n\n metricsEnabled = MetricsConfiguration.isEnabled(context.getConfiguration());\n\n if (metricsEnabled) {\n try {\n // important that MetricsService gets the unwrapped contextWriter\n // we don't want metrics on our metrics\n metricsService = new MetricsService<>(contextWriter, context);\n metricsLabels = new ReusableMetricsLabels();\n\n contextWriter = new KeyValueCountingContextWriter<>(contextWriter, metricsService);\n } catch (Exception e) {\n log.error(\"Could not configure metrics, disabling\", e);\n MetricsConfiguration.disable(context.getConfiguration());\n metricsEnabled = false;\n }\n }\n\n validators = ArrayListMultimap.create();\n\n if (null != split) {\n if (filterConf.getBoolean(FILE_NAME_COUNTERS, true)) {\n getCounter(context, IngestInput.FILE_NAME.name(), split.getPath().toString()).increment(1);\n }\n }\n\n getCounter(context, IngestInput.LINE_BYTES.toString(), \"MIN\").setValue(Long.MAX_VALUE);\n\n offset = 0;\n\n if (log.isInfoEnabled()) {\n log.info(\"EventMapper configured. Bulk Ingest = true\");\n log.info(\"EventMapper configured with the following filters: \" + getDataTypeFilterClassNames());\n }\n\n }", "public Builder setInputIds(com.clarifai.grpc.api.InputIDs value) {\n if (inputIdsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n inputSource_ = value;\n onChanged();\n } else {\n inputIdsBuilder_.setMessage(value);\n }\n inputSourceCase_ = 2;\n return this;\n }", "public static BasicInput createSequentialInput( final DataInput in ) {\n return new BasicInput() {\n public byte readByte() throws IOException {\n return in.readByte();\n }\n public short readShort() throws IOException {\n return in.readShort();\n }\n public int readInt() throws IOException {\n return in.readInt();\n }\n public long readLong() throws IOException {\n return in.readLong();\n }\n public float readFloat() throws IOException {\n return in.readFloat();\n }\n public double readDouble() throws IOException {\n return in.readDouble();\n }\n public void skip( long nbyte ) throws IOException {\n IOUtils.skipBytes( in, nbyte );\n }\n public boolean isRandom() {\n return false;\n }\n public void seek( long offset ) {\n throw new UnsupportedOperationException();\n }\n public long getOffset() {\n throw new UnsupportedOperationException();\n }\n public void close() {\n }\n };\n }", "public RawReader(final InputStream is, final int bufferSize) throws NullPointerException, IllegalArgumentException {\n\t\tif (is == null) {\n\t\t\tthrow new NullPointerException(\"Input stream can't be null\"); \n\t\t}\n\t\telse if (bufferSize <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"Buffer size [\"+bufferSize+\"] must be greater than 0\"); \n\t\t}\n\t\telse {\n\t\t\tthis.is = is;\n\t\t\tthis.buffer = new byte[bufferSize];\n\t\t}\n\t}", "public Builder setNoisySampleCount(int value) {\n\n noisySampleCount_ = value;\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "InputsDeclRule createInputsDeclRule();", "public InputFewStepsFactoryImpl() {\n\t\tsuper();\n\t}", "public void testMixer_getNumberOfInputPortMax() throws InterruptedException {\n Integer NbPortTested = 11;\n Mixer mixer = new Mixer(NbPortTested);\n \n assertEquals(\"Get the number of input port\", 10, mixer.getNumberOfInputPort(),0);\n }", "public Builder addInputs(org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(value);\n }\n return this;\n }", "public Builder addInputs(org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(value);\n }\n return this;\n }", "public Builder addInputs(org.hyperledger.fabric.protos.token.Transaction.InputId value) {\n if (inputsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureInputsIsMutable();\n inputs_.add(value);\n onChanged();\n } else {\n inputsBuilder_.addMessage(value);\n }\n return this;\n }", "public LinearNeuron(int inputs)\n\t{\n\t\tsuper(inputs);\n\t}", "public int getInputsCount() {\n if (inputsBuilder_ == null) {\n return inputs_.size();\n } else {\n return inputsBuilder_.getCount();\n }\n }", "public int getInputsCount() {\n if (inputsBuilder_ == null) {\n return inputs_.size();\n } else {\n return inputsBuilder_.getCount();\n }\n }", "public int getInputsCount() {\n if (inputsBuilder_ == null) {\n return inputs_.size();\n } else {\n return inputsBuilder_.getCount();\n }\n }", "Inputs getInputs();", "@Override\n\tpublic void playerPCMFeedBuffer(boolean b, int i, int i2) {}" ]
[ "0.5641092", "0.5420494", "0.5398145", "0.5351784", "0.53491086", "0.52818733", "0.52439195", "0.5095418", "0.5095418", "0.5095418", "0.5067545", "0.5035706", "0.5030589", "0.5030589", "0.5030589", "0.4936377", "0.4936377", "0.4936377", "0.49047077", "0.48809913", "0.48809913", "0.48809913", "0.4820707", "0.4818622", "0.4818622", "0.4818622", "0.481761", "0.4814858", "0.4808987", "0.4788418", "0.4788418", "0.4788418", "0.47688696", "0.4734925", "0.4720507", "0.467397", "0.467397", "0.467397", "0.46649274", "0.46649274", "0.46649274", "0.4646435", "0.46357828", "0.4628179", "0.46140736", "0.46140736", "0.46140736", "0.45968112", "0.4589276", "0.458659", "0.45788768", "0.45681736", "0.45681736", "0.45681736", "0.45619902", "0.45555857", "0.45555857", "0.45555857", "0.45481256", "0.45468515", "0.45269153", "0.44982907", "0.44968298", "0.44808367", "0.44630817", "0.44438425", "0.44366464", "0.44366464", "0.44366464", "0.4431561", "0.44300383", "0.44143674", "0.44024956", "0.43795055", "0.43788174", "0.4369987", "0.4342856", "0.4338152", "0.43360692", "0.4334539", "0.43288985", "0.4324249", "0.43238914", "0.4307974", "0.42995223", "0.42908475", "0.4270599", "0.4269943", "0.42667696", "0.42570764", "0.4255786", "0.42524847", "0.42524847", "0.42524847", "0.42518258", "0.42501357", "0.42501357", "0.42501357", "0.42455387", "0.42444944" ]
0.6399662
0
uGenArrayFromNumInputs Fills the fundamentalArray and adjustedFundArray with the current pitches of each input line:
public void setFund() { // catching a NullPointer because I'm not sure why it happens and fear a crash during a concert. try { // TODO: maybe this won't be necessary once the threads are implemented. if(!this.pause) { for (int i = 0; i < this.adjustedNumInputs; i++) { // println("setFund(); this.frequencyArray[i] = " + this.frequencyArray[i].getFeatures()); // want to assign the value of .getFeatures() to a variable and check for null, // but can't, b/c it returns a float. :/ (So that must not be exactly the problem.) if (this.frequencyArray[i].getFeatures() != null) { // println("i = " + i); // println("setFund(); this.fundamentalArray[i] = " + this.fundamentalArray[i] + "this.frequencyArray[i].getFeatures() = " + this.frequencyArray[i].getFeatures()); this.fundamentalArray[i] = this.frequencyArray[i].getFeatures(); this.amplitudeArray[i] = this.frequencyArray[i].getAmplitude(); // * 100; // ignores pitches with amplitude lower than "sensitivity": if (this.frequencyArray[i].getAmplitude() > this.sensitivity) { this.adjustedFundArray[i] = this.fundamentalArray[i]; } // if: amp > sensitivity } // if: features() != null } // if: > numInputs } } catch(NullPointerException npe) {} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createArray() {\n\t\tdata = new Integer[userInput];\n\t\tRandom rand = new Random();\n\n\t\t// load the array with random numbers\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\tdata[i] = rand.nextInt(maximumNumberInput);\n\t\t}\n\n\t\t// copy the array to the sorting method\n\t\tinsertionData = data.clone();\n\t\tquickData = data.clone();\n\n\t}", "private void fillArrays(){\n\t\tdouble tIncrement = (endT-startT) / (double)plotPoints;\n\t\t\n\t\t//burn in\n\t\tfor(int i=0; i<burnIn; i++){\n\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\tising.update();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k=0; k<plotPoints+1 && !simulationThread.isInterrupted(); k++){\n\t\t\tising.reset();\n\t\t\tising.setTemperature(startT + k*tIncrement);\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i<sweeps; i++){\n\t\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\t\tising.update();\n\t\t\t\t}\n\t\t\t\tising.updateSums();\n\t\t\t}\n\t\t\t\n\t\t\t//add values to arrays\n\t\t\ttemp[k] = ising.getTemperature();\n\t\t\t\n\t\t\t\n\t\t\tif(this.plotM){\n\t\t\t\tabsM[k] = ising.averageAbsM();\n\t\t\t\tsusceptibility[k][0] = ising.susceptibility();\n\t\t\t\tsusceptibility[k][1] = ising.errorSusceptibility();\n\t\t\t}\n\t\t\tif(this.plotE){\n\t\t\t\tE[k] = ising.averageE();\n\t\t\t\theatCapacity[k][0] = ising.heatCapacity();\n\t\t\t\theatCapacity[k][1] = ising.errorHearCapacity();\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t}", "private void populateFieldArray() \r\n\t{\r\n\t\tInteger fieldId;\r\n\t\t/** get input column names which is populated based on the input file\r\n\t\t * format specified in the command file */\r\n\t\tString [] inputColNames = getInputColNames();\r\n\t\tint arrLength; /** Number of columns in the input file*/\r\n\t\tif (null == inputColNames)\r\n\t\t{\r\n\t\t\t/** set array length 2 for two default columns (probeset and chip description)*/\r\n\t\t\tarrLength = 2; \r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/** Basic Probeset ID and description fields are present for all files \r\n\t\t\t * but the other supplementary information like accession number, unigene and\r\n\t\t\t * entrezgene ids may be present one or many based on the file format */\r\n\t\t\tarrLength = 2 + inputColNames.length; /** add other columns*/\r\n\t\t}\r\n\t\t/** Field array base elements are Probeset and Chip_Desc plus any of acc_no, ugid, & locusid/organism */\r\n\t\tfieldIndexArray = new int [arrLength];\r\n\t\t\r\n\t\t/** Now 0th field in input file is probeset*/\r\n\t\tfieldIndexArray[0] = ((Integer) fieldIdTable.get(\"CIN_PROBESET\")).intValue();\r\n\t\t\r\n\t\tif (inputColNames != null) \r\n\t\t{\r\n\t\t\t/** get the field ids for all column names*/\r\n\t\t\tfor (int i=0; i< inputColNames.length; i++)\r\n\t\t\t{\r\n\t\t\t\t/** Pick up the column from the list of inout columns as obtained based on\r\n\t\t\t\t * the input file format. Then fetch its ID from the FieldIdTable */\r\n\t\t\t\tfieldId = (Integer) fieldIdTable.get(inputColNames[i].toUpperCase());\r\n\t\t\t\tif (null == fieldId)\r\n\t\t\t\t{\r\n\t\t\t\t\t/** no such column name allowed*/\r\n\t\t\t\t\tLogger.log(\"Column name \" + inputColNames[i] + \" is not a valid name\",Logger.WARNING);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/** add the field id to the index array. Thus fieldIndexArray will have all the \r\n\t\t\t\t\t * column names depending on the file format*/\r\n\t\t\t\t\tfieldIndexArray[1+i] = fieldId.intValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t/** ChipDesc field is the last column in the input file. First we have added the default first field\r\n\t\t * as probeset id , then all the middle fields based on the file format and now the last default\r\n\t\t * field which is chipdescription */\r\n\t\tfieldIndexArray[fieldIndexArray.length-1] = ((Integer) fieldIdTable.get(\"CIN_CHIP_DESCRIPTION\")).intValue();\r\n\t\tLogger.log(\"populateFieldArray complete \",Logger.DEBUG);\r\n\t}", "public static void fillArray() {\r\n\t\tfor (int i = 0; i < myOriginalArray.length - 1; i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tmyOriginalArray[i] = rand.nextInt(250);\r\n\t\t}\r\n\t\t// Copies original array 4 times for algorithm arrays\r\n\t\tmyBubbleArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmySelectionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyInsertionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyQuickArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t}", "public abstract double[] generate(double[] inputs, Matrix metaData);", "void permutateArrays()\n {\n for (int i = 0; i < sampleArrays.length; i++)\n {\n for (int i1 = 0; i1 < (r.nextInt() % 7); i1++)\n {\n addToArray(sampleArrays[i], sampleStrings[r.nextInt(5)]);\n addToArray(sampleArrays[i], sampleNumbers[r.nextInt(5)]);\n addToArray(sampleArrays[i], sampleObjects[r.nextInt(5)]);\n addToArray(sampleArrays[i], specialValues[r.nextInt(2)]);\n }\n }\n }", "void setUp(Comparable[] input) {\n\n\t\t// Clone input array, to get data from\n\t\tarray = Arrays.copyOf(input, input.length);\n\t\t\n\t\t/*\n\t\t * Initialize arrays:\n\t\t * \"data\" is the array of lists\n\t\t * \"next\" is the array of list tails\n\t\t * \"queue\" is the array for the queue implementation\n\t\t */\n\t\tdata = new int[input.length];\n\t\tnext = new int[input.length];\n\t\tqueue = new int[input.length];\n\t\t\n\t\t// fill array of tail with NIL values\n\t\tArrays.fill(next, NIL);\n\t\t\n\t\t// fill array of lists and queue with indexes\n\t\tfor (int i = 0; i < input.length; i++)\n\t\t\tdata[i] = queue[i] = i;\n\t\t\n\t\t// set queue pointers to the first cell\n\t\tqPush = qPoll = 0;\n\n\t\t/*\n\t\t * At this point queue is full.\n\t\t * So set flags: can poll, but cannot push\n\t\t */\n\t\tcanPush = false;\n\t\tcanPoll = true;\n\t}", "public void calculateInputs()\n {\n numberOfInputs = inputs.size();\n }", "private Countable[] generateArray(int rank){\n var numbers = new Countable[rank];\n for (int i = 0; i < rank; i++) {\n numbers[i] = getRandomCountable();\n }\n return numbers;\n }", "public static int[] populateArray(int [] array) {\n int userInput;\n System.out.println(\"Enter 10 integers: \");\n for(int i = 0; i < array.length; i++){\n Scanner input = new Scanner(System.in);\n userInput = CheckInput.getInt();\n array[i] = userInput;\n }\n return array;\n }", "public void setInput( float inputs[] ) {\n\t\t// Put input assignment code here\n }", "public void takeInput() {\n Scanner sc = new Scanner(System.in);\n int polynomial[];\n System.out.println(\"Enter no. of inputs:\");\n int n = sc.nextInt();\n System.out.println(\"Enter polynomial coefficients:\\n(0 if no coefficient is present)\");\n polynomial = new int[n];\n System.out.println(\"Enter data: \");\n \n for (int i = 0; i < n; i++) {\n polynomial[i] = sc.nextInt();\n }\n \n setPolynomialCoefficientArray(polynomial);\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int budget = Integer.parseInt( sc.nextLine());\n int numberOfChannels =Integer.parseInt( sc.nextLine());\n String channels[] = new String[numberOfChannels];\n double ROI[] = new double[numberOfChannels];\n String lowers[] = new String[numberOfChannels];\n String uppers[] = new String[numberOfChannels];\n for (int i = 0; i <numberOfChannels ; i++) {\n String tmp = sc.nextLine();\n String ins[]= tmp.split(\" \");\n channels[i] = ins[0];\n ROI[i] = Double.parseDouble( ins[1]);\n System.out.println(channels[i]+ \" _ \"+ ROI[i]);\n }\n\n for (int i = 0; i < numberOfChannels; i++) {\n String ins[] = sc.nextLine().split(\" \");\n lowers[i] = ins[0];\n uppers[i] = ins[1];\n System.out.println(lowers[i] +\" -- \" + uppers[i]);\n }\n }", "public void setup(int size){\n runValues = new double[size];\n hardwareValues = new double[size][];\n }", "private static int[] getTimesTable(int requiredSize, int requiredNumber) \n\t{\n\t\t// local array for the loop to amend and then return\n\t\tint [] timesArray = new int [requiredSize];\n\t\n\t\tfor (int i = 1; i <= requiredSize; i++)\n\t\t{\n\t\t\t// amends the local timesArray array\n\t\t\ttimesArray[i -1] = requiredNumber * i; \n\t\t\t//System.out.println(timesArray[i -1] = requiredNumber * i); // testing purposes so you can see the value before ammending the array\n\t\t}\n\t\t\n\t\t// returns local array as result for the main method array\n\t\treturn timesArray;\n\t}", "@Override\n\tprotected void uGenerate(float[] channels) \n\t{\n\t\tif (!isTurnedOn)\n\t\t{\n\t\t\tfor(int i = 0; i < channelCount(); i++)\n\t\t\t{\n\t\t\t\tchannels[i] = beforeAmplitude*audio.getLastValues()[i];\n\t\t\t}\n\t\t}\n\t\t// after the envelope, just output the afterAmplitude*audio\n\t\telse if (timeFromOff > releaseTime)\n\t\t{\n\t\t\tfor(int i = 0; i < channelCount(); i++)\n\t\t\t{\n\t\t\t\tchannels[i] = afterAmplitude*audio.getLastValues()[i];\n\t\t\t}\t\n\t\t\tif ( unpatchAfterRelease )\n\t\t\t{\n\t\t\t if ( output != null )\n\t\t\t {\n\t\t\t unpatch( output );\n\t\t\t output = null;\n\t\t\t }\n\t\t\t if ( ugenOutput != null )\n\t\t\t {\n\t\t\t unpatch( ugenOutput );\n\t\t\t ugenOutput = null;\n\t\t\t }\n\t\t\t unpatchAfterRelease = false;\n\t\t\t}\n\t\t}\n\t\t// inside the envelope\n\t\telse\n\t\t{\n\t\t\tif ((isTurnedOn) && (!isTurnedOff))\n\t\t\t{\n\t\t\t\t// ATTACK\n\t\t\t\tif (timeFromOn <= attackTime)\n\t\t\t\t{\n\t\t\t\t\t// use time remaining until maxAmplitude to change amplitude\n\t\t\t\t\tfloat timeRemain = (attackTime - timeFromOn);\n\t\t\t\t\tamplitude += (maxAmplitude - amplitude)*timeStepSize/timeRemain;\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// DECAY\n\t\t\t\telse if ((timeFromOn > attackTime) && (timeFromOn <= (attackTime+decayTime)))\n\t\t\t\t{\n\t\t\t\t\t// use time remaining until sustain to change to sustain level\n\t\t\t\t\tfloat timeRemain = (attackTime + decayTime - timeFromOn);\n\t\t\t\t\tamplitude += (sustainLevel*maxAmplitude - amplitude)*timeStepSize/timeRemain;\t\t\t\n\t\t\t\t}\n\t\t\t\t// SUSTAIN\n\t\t\t\telse if (timeFromOn > (attackTime+decayTime))\n\t\t\t\t{\n\t\t\t\t\t// hold the sustain level\n\t\t\t\t\tamplitude = sustainLevel*maxAmplitude;\n\t\t\t\t}\n\t\t\t\ttimeFromOn += timeStepSize;\n\t\t\t}\n\t\t\t// RELEASE\n\t\t\telse //isTurnedOn and isTurnedOFF and timeFromOff < releaseTime\n\t\t\t{\n\t\t\t\t// use remaining time to get to afterAmplitude\n\t\t\t\tfloat timeRemain = (releaseTime - timeFromOff);\n\t\t\t\tamplitude += (afterAmplitude - amplitude)*timeStepSize/timeRemain;\n\t\t\t\ttimeFromOff += timeStepSize;\n\t\t\t}\n\t\t\t// finally multiply the input audio to generate the output\n\t\t\tfor(int i = 0; i < channelCount(); i++)\n\t\t\t{\n\t\t\t\tchannels[i] = amplitude*audio.getLastValues()[i];\n\t\t\t}\t\t\n\t\t}\n\t}", "public static int[] process(int[] prevHolder) { \r\n\t\t int[] holder = new int[prevHolder.length + 1];\r\n\t \r\n\t /**the first entry in holder will always be 1*/\t \r\n\t holder[0] = 1;\r\n\t \r\n\t /**this loop populates the numbers inbetween the first and last index values, the first and last values are already handled*/\r\n\t for (int i = 1; i < holder.length - 1; i++) {\r\n\t \t holder[i] = prevHolder[i-1] + prevHolder[i];\r\n\t }\r\n\t \r\n\t /**the last entry in holder is always 1*/\r\n\t holder[holder.length - 1] = 1;\r\n\t \r\n\t \r\n\t /**returns the result from this iteration of the for loop in the main method to be used in the next iteration*/\t \r\n\t return holder;\r\n\t }", "public void populateNoiseArray(double[] p_76308_1_, double p_76308_2_, double p_76308_4_, double p_76308_6_, int p_76308_8_, int p_76308_9_, int p_76308_10_, double p_76308_11_, double p_76308_13_, double p_76308_15_, double p_76308_17_) {\n/* 81 */ if (p_76308_9_ == 1) {\n/* */ \n/* 83 */ boolean var64 = false;\n/* 84 */ boolean var65 = false;\n/* 85 */ boolean var21 = false;\n/* 86 */ boolean var68 = false;\n/* 87 */ double var70 = 0.0D;\n/* 88 */ double var73 = 0.0D;\n/* 89 */ int var75 = 0;\n/* 90 */ double var77 = 1.0D / p_76308_17_;\n/* */ \n/* 92 */ for (int var30 = 0; var30 < p_76308_8_; var30++) {\n/* */ \n/* 94 */ double var31 = p_76308_2_ + var30 * p_76308_11_ + this.xCoord;\n/* 95 */ int var78 = (int)var31;\n/* */ \n/* 97 */ if (var31 < var78)\n/* */ {\n/* 99 */ var78--;\n/* */ }\n/* */ \n/* 102 */ int var34 = var78 & 0xFF;\n/* 103 */ var31 -= var78;\n/* 104 */ double var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 106 */ for (int var37 = 0; var37 < p_76308_10_; var37++)\n/* */ {\n/* 108 */ double var38 = p_76308_6_ + var37 * p_76308_15_ + this.zCoord;\n/* 109 */ int var40 = (int)var38;\n/* */ \n/* 111 */ if (var38 < var40)\n/* */ {\n/* 113 */ var40--;\n/* */ }\n/* */ \n/* 116 */ int var41 = var40 & 0xFF;\n/* 117 */ var38 -= var40;\n/* 118 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* 119 */ int var19 = this.permutations[var34] + 0;\n/* 120 */ int var66 = this.permutations[var19] + var41;\n/* 121 */ int var67 = this.permutations[var34 + 1] + 0;\n/* 122 */ int var22 = this.permutations[var67] + var41;\n/* 123 */ var70 = lerp(var35, func_76309_a(this.permutations[var66], var31, var38), grad(this.permutations[var22], var31 - 1.0D, 0.0D, var38));\n/* 124 */ var73 = lerp(var35, grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D));\n/* 125 */ double var79 = lerp(var42, var70, var73);\n/* 126 */ int var10001 = var75++;\n/* 127 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var79 * var77;\n/* */ }\n/* */ \n/* */ } \n/* */ } else {\n/* */ \n/* 133 */ int var19 = 0;\n/* 134 */ double var20 = 1.0D / p_76308_17_;\n/* 135 */ int var22 = -1;\n/* 136 */ boolean var23 = false;\n/* 137 */ boolean var24 = false;\n/* 138 */ boolean var25 = false;\n/* 139 */ boolean var26 = false;\n/* 140 */ boolean var27 = false;\n/* 141 */ boolean var28 = false;\n/* 142 */ double var29 = 0.0D;\n/* 143 */ double var31 = 0.0D;\n/* 144 */ double var33 = 0.0D;\n/* 145 */ double var35 = 0.0D;\n/* */ \n/* 147 */ for (int var37 = 0; var37 < p_76308_8_; var37++) {\n/* */ \n/* 149 */ double var38 = p_76308_2_ + var37 * p_76308_11_ + this.xCoord;\n/* 150 */ int var40 = (int)var38;\n/* */ \n/* 152 */ if (var38 < var40)\n/* */ {\n/* 154 */ var40--;\n/* */ }\n/* */ \n/* 157 */ int var41 = var40 & 0xFF;\n/* 158 */ var38 -= var40;\n/* 159 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 161 */ for (int var44 = 0; var44 < p_76308_10_; var44++) {\n/* */ \n/* 163 */ double var45 = p_76308_6_ + var44 * p_76308_15_ + this.zCoord;\n/* 164 */ int var47 = (int)var45;\n/* */ \n/* 166 */ if (var45 < var47)\n/* */ {\n/* 168 */ var47--;\n/* */ }\n/* */ \n/* 171 */ int var48 = var47 & 0xFF;\n/* 172 */ var45 -= var47;\n/* 173 */ double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 175 */ for (int var51 = 0; var51 < p_76308_9_; var51++) {\n/* */ \n/* 177 */ double var52 = p_76308_4_ + var51 * p_76308_13_ + this.yCoord;\n/* 178 */ int var54 = (int)var52;\n/* */ \n/* 180 */ if (var52 < var54)\n/* */ {\n/* 182 */ var54--;\n/* */ }\n/* */ \n/* 185 */ int var55 = var54 & 0xFF;\n/* 186 */ var52 -= var54;\n/* 187 */ double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 189 */ if (var51 == 0 || var55 != var22) {\n/* */ \n/* 191 */ var22 = var55;\n/* 192 */ int var69 = this.permutations[var41] + var55;\n/* 193 */ int var71 = this.permutations[var69] + var48;\n/* 194 */ int var72 = this.permutations[var69 + 1] + var48;\n/* 195 */ int var74 = this.permutations[var41 + 1] + var55;\n/* 196 */ int var75 = this.permutations[var74] + var48;\n/* 197 */ int var76 = this.permutations[var74 + 1] + var48;\n/* 198 */ var29 = lerp(var42, grad(this.permutations[var71], var38, var52, var45), grad(this.permutations[var75], var38 - 1.0D, var52, var45));\n/* 199 */ var31 = lerp(var42, grad(this.permutations[var72], var38, var52 - 1.0D, var45), grad(this.permutations[var76], var38 - 1.0D, var52 - 1.0D, var45));\n/* 200 */ var33 = lerp(var42, grad(this.permutations[var71 + 1], var38, var52, var45 - 1.0D), grad(this.permutations[var75 + 1], var38 - 1.0D, var52, var45 - 1.0D));\n/* 201 */ var35 = lerp(var42, grad(this.permutations[var72 + 1], var38, var52 - 1.0D, var45 - 1.0D), grad(this.permutations[var76 + 1], var38 - 1.0D, var52 - 1.0D, var45 - 1.0D));\n/* */ } \n/* */ \n/* 204 */ double var58 = lerp(var56, var29, var31);\n/* 205 */ double var60 = lerp(var56, var33, var35);\n/* 206 */ double var62 = lerp(var49, var58, var60);\n/* 207 */ int var10001 = var19++;\n/* 208 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var62 * var20;\n/* */ } \n/* */ } \n/* */ } \n/* */ } \n/* */ }", "public double[][] process(double[] input) throws IllegalArgumentException, IOException\n {\n //check for null\n if(input == null)\n throw new IllegalArgumentException(\"input data must not be a null value\");\n\n //check for correct array length\n if((input.length % hopSize) != 0)\n throw new IllegalArgumentException(\"Input data must be multiple of hop size (windowSize/2).\");\n\n //create return array with appropriate size\n double[][] sone = new double[(input.length/hopSize)-1][bark_upper.length];\n\n //process each window of this audio segment\n for(int i = 0, pos = 0; pos < input.length - hopSize; i++, pos+=hopSize)\n sone[i] = processWindow(input, pos);\n\n return sone;\n }", "@Override\n\tprotected void uGenerate(float[] channels) \n\t{\n\t\tif (!isActivated)\n\t\t{\n\t\t\tArrays.fill( channels, begAmp );\n\t\t} \n\t\telse if (lineNow >= lineTime)\n\t\t{\n\t\t\tArrays.fill( channels, endAmp );\n\t\t} \n\t\telse \n\t\t{\n\t\t\tamp += ( endAmp - amp )*timeStepSize/( lineTime - lineNow );\n\t\t\t//Minim.debug(\" dampTime = \" + dampTime + \" begAmp = \" + begAmp + \" amp = \" + amp + \" dampNow = \" + dampNow);\n\t\t\tArrays.fill( channels, amp );\n\t\t\tlineNow += timeStepSize;\n\t\t}\n\t}", "private static int[] processArray(int[] numberArray) {\n for (int i : numberArray) {\n for (int j = 0; j < numberArray.length; j++) {\n// some nonsense calculation to make the CPU tick a bit\n numberArray[j] *= i;\n }\n }\n return numberArray;\n }", "private Number[] arrayFinalFormation(Number[] array, int countOfElements) {\n Number[] completedArrayVersion = new Number[countOfElements];\n for (int index = 0; index < completedArrayVersion.length; index++) {\n completedArrayVersion[index] = array[index];\n }\n return completedArrayVersion;\n }", "private static int[] createArray() {\n\t\trnd = new Random();\r\n\t\trandomArray = new int[8];\r\n\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\trandomArray[i] = rnd.nextInt(45);\r\n\t\t}\r\n\t\treturn randomArray;\r\n\t}", "public short[] updateAudioTxBuf()\n\t{\n\t\taudioTxBufLength = sampleBit * (bitLength1+bitLength2+bitLength3)+352*2;\t\n\t\tshort[] audioTxBuf = new short[audioTxBufLength];\n\t\tcounter_k = 0;\n\n\t\tinitEncoderTxData();\n\n\t\tfor(counter_i=0;counter_i<bitLength1;counter_i++)\n\t\t{\n\t\t\t\tfor(counter_j=0;counter_j<sampleBit;counter_j++)\n\t\t\t\t{\n\t\t\t\t\taudioTxBuf[counter_k] = highLevel[counter_j];\t//Samsung, Xiaomi(MIUI)\n//\t\t\t\t\taudioTxBuf[counter_k] = lowLevel[counter_j];\t//else\n\t\t\t\t\tcounter_k++;\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\tfor (int i = 1; i < 352; i++) {\n\t\t\taudioTxBuf[counter_k+i]= (short)0;\t\n\t\t}\n\t\tcounter_k=counter_k+351;\n\t\tfor(counter_i=0;counter_i<bitLength2;counter_i++)\n\t\t{\n\t\t\t\tfor(counter_j=0;counter_j<sampleBit;counter_j++)\n\t\t\t\t{\n\t\t\t\t\taudioTxBuf[counter_k] = highLevel[counter_j];\t//Samsung, Xiaomi(MIUI)\n//\t\t\t\t\taudioTxBuf[counter_k] = lowLevel[counter_j];\t//else\n\t\t\t\t\tcounter_k++;\n\t\t\t\t}\t\t\t\n\t\t\t\n\t\t}\t\n\t\tfor (int i = 1; i < 352; i++) {\n\t\t\taudioTxBuf[counter_k+i]= (short) 0;\t\t\t\n\t\t}\n\t\tcounter_k=counter_k+351;\n\t\tfor(counter_i=0;counter_i<bitLength3;counter_i++)\n\t\t{\n\t\t\t\tfor(counter_j=0;counter_j<sampleBit;counter_j++)\n\t\t\t\t{\n\t\t\t\t\taudioTxBuf[counter_k] = highLevel[counter_j];\t//Samsung, Xiaomi(MIUI)\n//\t\t\t\t\taudioTxBuf[counter_k] = lowLevel[counter_j];\t//else\n\t\t\t\t\tcounter_k++;\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\tcounter_k=0;\n\t\treturn audioTxBuf;\n\t}", "private List<PredictionInput> prepareInputs(int noOfFeatures, int featureIndex, double[] featureXSvalues,\n double[][] trainingData, int i) {\n List<PredictionInput> predictionInputs = new ArrayList<>(seriesLength);\n double[] inputs = new double[noOfFeatures];\n inputs[featureIndex] = featureXSvalues[i];\n for (int j = 0; j < seriesLength; j++) {\n for (int f = 0; f < noOfFeatures; f++) {\n if (f != featureIndex) {\n inputs[f] = trainingData[f][j];\n }\n }\n PredictionInput input = new PredictionInput(DataUtils.doublesToFeatures(inputs));\n predictionInputs.add(input);\n }\n return predictionInputs;\n }", "private void declareArrays() {\n int iNumTimesteps = m_oLegend.getNumberOfTimesteps(),\n i, j, k;\n \n //Create arrays to hold raw data.\n mp_fLiveTreeVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fSnagVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses]; \n mp_iLiveTreeCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_iSnagCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fLiveTreeDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fSnagDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fTallestLiveTrees = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n mp_fTallestSnags = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n \n //Initialize all values with 0s\n for (i = 0; i < mp_fTallestLiveTrees.length; i++) {\n for (j = 0; j < mp_fTallestLiveTrees[i].length; j++) {\n for (k = 0; k < mp_fTallestLiveTrees[i][j].length; k++) {\n mp_fTallestLiveTrees[i][j][k] = 0;\n mp_fTallestSnags[i][j][k] = 0;\n }\n }\n }\n \n for (i = 0; i < m_iNumSpecies; i++) {\n for (j = 0; j <= iNumTimesteps; j++) {\n mp_fLiveTreeDBHTotal[i][j] = 0;\n mp_fSnagDBHTotal[i][j] = 0;\n for (k = 0; k < m_iNumSizeClasses; k++) {\n mp_iLiveTreeCounts[i][j][k] = 0;\n mp_iSnagCounts[i][j][k] = 0;\n mp_fLiveTreeVolumeTotals[i][j][k] = 0;\n mp_fSnagVolumeTotals[i][j][k] = 0;\n }\n }\n }\n }", "public ALU() {\n // PROGRAM 1: Student must complete this method\n //declare input(s) and output arrays\n inputA = new boolean[INT_LENGTH];\n inputB = new boolean[INT_LENGTH];\n output = new boolean[INT_LENGTH];\n //initializes zeroFlag and control\n zeroFlag = false;\n control = 15;\n //initialize each array with random boolean values\n for (int i = 0; i < INT_LENGTH; i++) {\n inputA[i] = random.nextBoolean();\n inputB[i] = random.nextBoolean();\n output[i] = random.nextBoolean();\n }\n }", "public void createBins(int arraySize)\n\t{\n\t\t//Check if any spectra from each polarity has been created\n\t\tif (librarySpectra.size()>0)\n\t\t{\n\t\t\tcountBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\t\t\taddedBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin\n\n\t\t\t//Fill all positive bins with zeroes\n\t\t\tfor (int i=0; i<countBin.length; i++)\n\t\t\t{\n\t\t\t\tcountBin[i] = 0;\n\t\t\t\taddedBin[i] = 0;\n\t\t\t}\n\n\t\t\t//Create the array to store the actual spectra objects\n\t\t\tmassBin = new LibrarySpectrum[arraySize][];\n\t\t}\n\t}", "public void get_InputValues(){\r\n\tA[1]=-0.185900;\r\n\tA[2]=-0.85900;\r\n\tA[3]=-0.059660;\r\n\tA[4]=-0.077373;\r\n\tB[1]=30.0;\r\n\tB[2]=19.2;\r\n\tB[3]=13.8;\r\n\tB[4]=22.5;\r\n\tC[1]=4.5;\r\n\tC[2]=12.5;\r\n\tC[3]=27.5;\r\n\tD[1]=16.0;\r\n\tD[2]=10.0;\r\n\tD[3]=7.0;\r\n\tD[4]=5.0;\r\n\tD[5]=4.0;\r\n\tD[6]=3.0;\r\n\t\r\n}", "private void newArrayInitialize(NewArrayIRTuple instr) throws IOException{\n\n String type = (String)instr.getArg0();\n ArgumentVariable arg1 = new ArgumentVariable(instr.getArg1());\n ArgumentVariable result = new ArgumentVariable(instr.getResult());\n\n //Store $ra on stack\n writer.write(\"addi $sp, $sp, -20\\n\");\n writer.write(\"sw $ra, 16($sp)\\n\");\n\n //Store $a0\n writer.write(\"sw $a0, 12($sp)\\n\");\n\n //Store $t0-$t1 on the stack\n for(int i = 0; i < 2; i++)\n {\n writer.write(\"sw $t\" + i + \", \" + (8 - (4*i)) + \"($sp)\\n\");\n }\n\n //Store $v0 on the stack\n writer.write(\"sw $v0, 0($sp)\\n\");\n\n if(arg1.type.equals(\"constant\"))\n writer.write(\"li $a0, \" + arg1.getValue(curAddTable) + \"\\n\");\n else\n writer.write(\"move $a0, \" + arg1.getValue(curAddTable) + \"\\n\");\n if(type.equals(\"int\"))\n writer.write(\"sll $a0, $a0, 2\\n\");\n\n //Call the function of \"_new_array\"\n writer.write(\"jal _new_array\\n\");\n writer.write(\"lw $t0, 8($sp)\\n\");\n writer.write(\"lw $t1, 4($sp)\\n\");\n\n writer.write(\"lw $a0, 12($sp)\\n\");\n writer.write(\"move \" + result.getValue(curAddTable) + \", $v0\\n\");\n\n writer.write(\"lw $v0, 0($sp)\\n\");\n writer.write(\"lw $ra, 16($sp)\\n\");\n writer.write(\"addi $sp, $sp, 20\\n\");\n\n }", "P preProcessInputs(R rawInputs);", "public static int[] initialPermutation(int[] inputText){\n\t\tint[] permutedText = new int[64];\n\t\t\n\t\tfor(int i = 0; i < 8; i++){\n\t\t\tif(i < 4){\n\t\t\t\tpermutedText[i*8 + 0] = inputText[57 + i*2];\n\t\t\t\tpermutedText[i*8 + 1] = inputText[49 + i*2];\n\t\t\t\tpermutedText[i*8 + 2] = inputText[41 + i*2];\n\t\t\t\tpermutedText[i*8 + 3] = inputText[33 + i*2];\n\t\t\t\tpermutedText[i*8 + 4] = inputText[25 + i*2];\n\t\t\t\tpermutedText[i*8 + 5] = inputText[17 + i*2];\n\t\t\t\tpermutedText[i*8 + 6] = inputText[ 9 + i*2];\n\t\t\t\tpermutedText[i*8 + 7] = inputText[ 1 + i*2];\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpermutedText[i*8 + 0] = inputText[56 + (i-4)*2];\n\t\t\t\tpermutedText[i*8 + 1] = inputText[48 + (i-4)*2];\n\t\t\t\tpermutedText[i*8 + 2] = inputText[40 + (i-4)*2];\n\t\t\t\tpermutedText[i*8 + 3] = inputText[32 + (i-4)*2];\n\t\t\t\tpermutedText[i*8 + 4] = inputText[24 + (i-4)*2];\n\t\t\t\tpermutedText[i*8 + 5] = inputText[16 + (i-4)*2];\n\t\t\t\tpermutedText[i*8 + 6] = inputText[ 8 + (i-4)*2];\n\t\t\t\tpermutedText[i*8 + 7] = inputText[ 0 + (i-4)*2];\n\t\t\t}\n\t\t}\n\t\treturn permutedText;\n\t}", "public InputArray() \n\t{\n\t\tinputArray = null;\n\t}", "public static int[] fillArray(int[] array, int size) {\r\n\t\tfor (int x = 0; x < size; x = x + 1) {\r\n\t\t\tarray[x] = ReadUserInput.readInt();\r\n\t\t}\r\n\t\treturn array;\r\n\t}", "private static int[] post4(int[] input) {\n int indexFor = 0;\n for (int i = input.length - 1; i >= 0; i--) {\n if (input[i] == 4) {\n indexFor = i;\n break;\n }\n }\n // 1. done\n int size = input.length - indexFor - 1;\n // 2. done\n int[] output = new int[size];\n // 2.5. done\n /* for (int i = size - 1; i >= 0; i--) {\n output[i] = input[input.length + i - size];\n }*/\n for (int i = 0; i < size; i++) {\n output[i] = input[i + indexFor + 1];\n }\n // 3. done\n return output;\n }", "private void resetArraysAndHeader()\r\n\t{\r\n\t\tmainHeader = \"\";\r\n\t\tenergyVals = \"\";\r\n\t\ttoBeOutputBranches.clear();\r\n\t\tassociatedR.clear();\r\n\t\tassociatedP.clear();\r\n\t\tassociatedQ.clear();\r\n\t\ttriangularP.clear();\r\n\t\ttriangularQ.clear();\r\n\t\ttriangularR.clear();\r\n\t\tinputBranchWithJ.clear();\r\n\t\tupperEnergyValuesWithJ.clear();\r\n\r\n\t\tif (energiesForCurrentKOppParity != null)\r\n\t\t\tenergiesForCurrentKOppParity.clear();\r\n\t}", "private void initializeFactorials() {\n //Lets fill up to 33!\n factorials = new double[33];\n factorials[0] = 1.0;\n factorials[1] = 1.0;\n factorials[2] = 2.0;\n factorials[3] = 6.0;\n factorials[4] = 24.0;\n factorials[5] = 120.0;\n factorials[6] = 720.0;\n factorials[7] = 5040.0;\n factorials[8] = 40320.0;\n factorials[9] = 362880.0;\n factorials[10] = 3628800.0;\n factorials[11] = 39916800.0;\n factorials[12] = 479001600.0;\n factorials[13] = 6227020800.0;\n factorials[14] = 87178291200.0;\n factorials[15] = 1307674368000.0;\n factorials[16] = 20922789888000.0;\n factorials[17] = 355687428096000.0;\n factorials[18] = 6402373705728000.0;\n factorials[19] = 121645100408832000.0;\n factorials[20] = 2432902008176640000.0;\n factorials[21] = 51090942171709440000.0;\n factorials[22] = 1124000727777607680000.0;\n factorials[23] = 25852016738884976640000.0;\n factorials[24] = 620448401733239439360000.0;\n factorials[25] = 15511210043330985984000000.0;\n factorials[26] = 403291461126605635584000000.0;\n factorials[27] = 10888869450418352160768000000.0;\n factorials[28] = 304888344611713860501504000000.0;\n factorials[29] = 8841761993739701954543616000000.0;\n factorials[30] = 265252859812191058636308480000000.0;\n factorials[31] = 8222838654177922817725562880000000.0;\n factorials[32] = 263130836933693530167218012160000000.0;\n\n }", "public RealTimeInput(int numInputs, AudioContext audioContext, boolean skip5thru8, PApplet pa)\n\t{\n\t\tif(numInputs < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): int parameter \" + numInputs + \" is less than 1; must be 1 or greater.\");\n\t\t} // if(numInputs < 1)\n\t\tif(audioContext == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input.constructor(int, AudioContext): AudioContext parameter \" + audioContext + \" is null.\");\n\t\t} // if(numInputs < 1)\n\n\t\tthis.numInputs = numInputs;\n\t\tthis.ac \t\t= audioContext;\n\t\tthis.pa\t\t\t= pa;\n\t\tthis.skip5thru8\t= skip5thru8;\n\t\t\n\t\tif(this.skip5thru8)\n\t\t{\n\t\t\tthis.adjustedNumInputs\t= this.numInputs - 4;\n\t\t\tSystem.out.println(\"this.adjustedNumInputs = \" + this.adjustedNumInputs);\n\t\t} else {\n\t\t\tthis.adjustedNumInputs\t= this.numInputs;\n\t\t} // \n\t\t\n\t\tthis.disposeHandler\t= new DisposeHandler(this.pa, this);\n\t\tSystem.out.println(\"just registered DisposeHandler for \" + pa);\n\n\t\tthis.uGenArrayFromNumInputs(this.numInputs);\n\t}", "public static float[] initializeWeights(int numWeights){\n\t\tfloat[] weights = new float[numWeights];\n\t\tfor (int i = 0; i < weights.length; i++) {\n\t\t\tweights[i] = (float)(randomGenerator.nextInt(100)/ 100.0 + 0.5);\n\t\t}\n\n\t\treturn weights;\n\t}", "private void setInputsAndCleanCalculationRegisters(double[] inputs) {\n System.arraycopy(inputs, 0, registers, 0, inputs.length);\n // copy clean registers to the rest of calculation registers\n System.arraycopy(cleanCalculationRegisters, inputs.length, registers, inputs.length,\n cleanCalculationRegisters.length - inputs.length);\n }", "private static void cleanArray() {\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tcolTemp[i] = 0;\r\n\t\t\trowTemp[i] = 0;\r\n\t\t}\r\n\t}", "public void getNextRawSamples( double[] rawBuffer );", "public int[][] LowerPincomboGenerator(int LowerPinnumCombos, int LowerPinnumBiting){\n\t\tint[][] LowerPincomboArr = new int[LowerPinnumCombos][LowerPinnumBiting];\n\t\tint[] tempArr = new int[LowerPinnumBiting];\n\t\tboolean isDup = false;\n\t\t\n\t\t//Create the LowerPin combinations\n\t\tfor(int i = 0; i < LowerPinnumCombos; i++) {\n\t\t\ttempArr = LowerPinrandomGen(LowerPinnumBiting);\n\t\t\t\n\t\t\t//Test for duplicates\n\t\t\tfor(int n = 0; n < LowerPinnumCombos; n++) {\n\t\t\t\tif(LowerPincomboArr[n] == tempArr) {\n\t\t\t\t\tisDup = true;\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Add LowerPin combination if unique\n\t\t\tif(isDup == false) {\n\t\t\t\tLowerPincomboArr[i] = tempArr;\n\t\t\t}\n\t\t\tisDup = false;\n\t\t}\n\t\t\n\t\t//Return LowerPin combinations\n\t\treturn LowerPincomboArr;\n\t}", "private void getArr()\r\n {\r\n // Create array of '0'\r\n Random rand = new Random();\r\n arr = new int[Integer.parseInt(SizeField.getText())];\r\n\r\n // InOrder creates a list in ascending order\r\n if (InOrderRadio.isSelected())\r\n {\r\n for (int i = 0; i < arr.length; i++)\r\n {\r\n arr[i] = i;\r\n }\r\n\r\n // AlmostOrder creates a list which is 50% sorted and 50% unsorted\r\n } else if (AlmostOrderRadio.isSelected())\r\n {\r\n for (int i = 0; i < arr.length / 2; i++)\r\n {\r\n arr[i] = i;\r\n }\r\n\r\n for (int i = arr.length / 2; i < arr.length; i++)\r\n {\r\n arr[i] = rand.nextInt(arr.length);\r\n }\r\n\r\n // ReverseOrder creates list in descending order\r\n } else if (ReverseOrderRadio.isSelected())\r\n {\r\n for (int i = arr.length, j = 0; i > 0; i--, j++)\r\n {\r\n arr[j] = i;\r\n }\r\n\r\n // RandomOrder creates 100% unsorted list\r\n } else\r\n {\r\n for (int i = 0; i < arr.length; i++)\r\n {\r\n arr[i] = rand.nextInt(arr.length);\r\n }\r\n }\r\n }", "public static int[] takeInput() {\n System.out.println(\"Enter size of arrays : \");\n int size = scn.nextInt();\n\n // declaring arrays \n int[] arrays = new int[size];\n\n // taking input from user\n for (int i = 0; i < arrays.length; i++) {\n System.out.println(\"Enter elements at \" + i);\n arrays[i] = scn.nextInt();\n }\n\n return arrays;\n }", "private double[][][] getPaddedInputs(double[][][] input, int padding) {\n int rows = input[0].length + 2 * padding;\n int cols = input[0][0].length + 2 * padding;\n double[][][] newInputs = new double[input.length][rows][cols];\n for (int depth = 0; depth < input.length; depth++) {\n for (int row = 0; row < input[0].length; row++) {\n for (int col = 0; col < input[0][0].length; col++) {\n newInputs[depth][row + padding][col + padding] =\n input[depth][row][col];\n }\n }\n }\n return newInputs;\n }", "public void externalSort(String inputFile, String outputFile, int n, int k) throws IOException {\n HybridSort hSort = new HybridSort();\n Path input = Paths.get(inputFile);\n\n int amtFiles = (int) Math.ceil((double) n / k); // calculates the amount of arrays in the function\n int fileNUM = 1; // counts the amount of tempFiles\n int tempSize = k;\n\n double[] mainArray = new double[k];\n double[] tempBigArray = new double[n];\n double[] temp = new double[k];\n\n boolean isOdd = amtFiles % 2 == 1;\n\n try (Scanner read = new Scanner(input).useDelimiter(\"(\\\\[ )|(, )|(\\\\])\");) {\n int index = 0;\n while (read.hasNext()) {\n double value = Double.parseDouble(read.next().strip());\n tempBigArray[index++] = value;\n } // end of while\n } // close the Scanner\n\n // Write to temp files\n for (int i = 0; i < n; i++) {\n // Check temp size\n if (i % k == 0) {\n if (n - i < k) {\n tempSize = n % k;\n } else {\n tempSize = k;\n }\n }\n\n temp[i % k] = tempBigArray[i];\n System.out.println(Arrays.toString(temp));\n\n if (i != 0 && ((i + 1) % k == 0) || (i == (n - 1))) {\n // Sort the array\n hSort.hybridsort(temp, 0, tempSize - 1);\n\n // get names for outputfileTemp\n Path outputTemp = Paths.get(outputFile + fileNUM++ + \".txt\");\n\n // Write to the temp file\n try (BufferedWriter writer = Files.newBufferedWriter(outputTemp, StandardCharsets.UTF_8);) {\n for (int j = 0; j < tempSize; j++) {\n writer.write(temp[j] + \" \");\n } // end of for\n } // close the BufferedWriter\n } // end of if\n } // end of for\n\n // Add all values in the first file to the main array\n try (Scanner scan = new Scanner(Paths.get(outputFile + 1 + \".txt\"));) {\n int index = 0;\n\n while (scan.hasNextDouble()) {\n double value = scan.nextDouble();\n mainArray[index++] = value;\n } // end of while\n } // close first file\n\n // Merge all the files\n mainMergeSort(amtFiles, outputFile, isOdd);\n }", "private static int[] reverseArray(int[] inputs) {\n for(int i =0; i < inputs.length/2; i++) {\n int tmp = inputs[i];\n int nextPosition = (inputs.length - i) -1;\n inputs[nextPosition] = tmp;\n }\n return inputs;\n }", "private void setupStuff() {\n\t\tm_seenNumbers = new double[featureArray.length][];\n\t\tm_Weights = new double[featureArray.length][];\n\t\tm_NumValues = new int[featureArray.length];\n\t\tm_SumOfWeights = new double[featureArray.length];\n\t\tfeatureTotals = new int[featureArray.length];\n\n\t\tfor (int i = 0; i < featureArray.length; i++) {\n\t\t\tm_NumValues[i] = 0;\n\t\t\tm_seenNumbers[i] = new double[100];\n\t\t\tm_Weights[i] = new double[100];\n\t\t}\n\n\t\t/*\n\t\t * initialize structures for probabilities of each class and of each\n\t\t * feature\n\t\t */\n\t\tclassCounts = new double[MLearner.NUMBER_CLASSES];\n\t\tprobs = new HashMap[MLearner.NUMBER_CLASSES][featureArray.length];\n\t\tRealprobs = new HashMap[MLearner.NUMBER_CLASSES][featureArray.length];\n\t\tfor (int i = 0; i < MLearner.NUMBER_CLASSES; i++) {\n\t\t\tfor (int j = 0; j < featureArray.length; j++) {\n\t\t\t\tif (featureArray[j]) {//only create if we are using that\n\t\t\t\t\t// feature\n\t\t\t\t\tprobs[i][j] = new HashMap();\n\t\t\t\t\tif (EmailInternalConfigurationWindow.isFeatureDiscrete(j)) {\n\t\t\t\t\t\tprobs[i][j].put(\"_default\", new Double(0));\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tclassCounts[i] = 0;\n\t\t}\n\n\t}", "public FloatArray(int initialCapacity) {\r\n this.elementData = new float[initialCapacity];\r\n }", "public void makeArray(int size) {\n\t\t\n\t}", "static int[] populateArray(int lenght) {\n\t\tint[] A = new int[lenght];\n\t\t\n\t\tfor(int i=0; i < A.length; i++) {\n\t\t\tA[i] = (int)(Integer.MAX_VALUE * Math.random());\n\t\t}\n\t\t\n\t\treturn A;\n\t}", "float[] feedForward(float... inputs);", "private void populate ()\n\t{\n\t\t//create a random object\n\t\tRandom rand = new Random(); \n\t\t//for loop for row\n\t\tfor (int row =0; row < currentVersion.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor(int column = 0; column < currentVersion[row].length; column++)\n\t\t\t{\n\t\t\t\t//assign byte values from [0 to state-1] into array\n\t\t\t\tcurrentVersion[row][column] = (byte) rand.nextInt((this.state-1));\n\t\t\t}\n\t\t}\n\t}", "private float[] randomFloatArray(float upperBound) {\n\t\tfloat[] randomFloat = { (RAND.nextFloat() * upperBound), Math.abs((RAND.nextFloat() * upperBound)),\n\t\t\t\t(RAND.nextFloat() * upperBound) };\n\t\tfor (int i = 0; i < randomFloat.length; i++) {\n\t\t\tif (RAND.nextBoolean()) {\n\t\t\t\trandomFloat[i] += RAND.nextFloat();\n\t\t\t} else {\n\t\t\t\trandomFloat[i] -= RAND.nextFloat();\n\t\t\t}\n\t\t}\n\t\treturn randomFloat;\n\t}", "public MHKEncryption_Array(){\n\t\t\tBigInteger wgenerator = new BigInteger(\"2\");\n\t\t\twsum = BigInteger.ZERO;\n\t\t\tfor(int i = 0;i < 640;i++){\n\t\t\t\twgenerator = wgenerator.multiply(new BigInteger(\"2\")).subtract(BigInteger.ONE); \n\t\t\t\tw[i] = wgenerator;\n\t\t\t\twsum = wsum.add(wgenerator);\n\t\t\t}\n\t}", "private void m18357t() {\n AudioProcessor[] k;\n ArrayList<AudioProcessor> newAudioProcessors = new ArrayList<>();\n for (AudioProcessor audioProcessor : m18348k()) {\n if (audioProcessor.mo25036a()) {\n newAudioProcessors.add(audioProcessor);\n } else {\n audioProcessor.flush();\n }\n }\n int count = newAudioProcessors.size();\n this.f16596P = (AudioProcessor[]) newAudioProcessors.toArray(new AudioProcessor[count]);\n this.f16597Q = new ByteBuffer[count];\n m18347j();\n }", "private void buildArray() throws VerificationException\n {\n \tindices = new int[length];\n \tcommonality = new int[length];\n \n \tcommonality[0] = -1;\n \tfor( int i=0; i<indices.length; i++ ){\n \t indices[i] = i;\n \t}\n \n sort();\n }", "private void generateRealizations() {\n\t\t// lastTime + 1 rows because the first hosts the initial value\n\t\trealizations = new double[lastTime + 1][numberOfSimulations];\n\t\tgenerateUpsAndDowns();// will be called only once\n\t\t// a first for loop the fill the first row\n\t\tfor (int simulationIndex = 0; simulationIndex < numberOfSimulations; simulationIndex++) {\n\t\t\trealizations[0][simulationIndex] = initialValue;\n\t\t}\n\t\t// double for loop for the realizations. We start from time 1\n\t\tfor (int timeIndex = 1; timeIndex <= lastTime; timeIndex++) {\n\t\t\tfor (int simulationIndex = 0; simulationIndex < numberOfSimulations; simulationIndex++) {\n\t\t\t\trealizations[timeIndex][simulationIndex] = realizations[timeIndex - 1][simulationIndex]\n\t\t\t\t\t\t* upsAndDowns[timeIndex - 1][simulationIndex];\n\t\t\t\t// S(i+1)=S(i)M(I)\n\t\t\t}\n\t\t}\n\t}", "private static int[] buildArray(int num) {\n\t\t// TODO build an array with num elements\n\t\tif(num ==0) return null;\n\t\t\n\t\tint[] array = new int[num];\n\t\tfor(int i=0; i<num; i++){\n\t\t\t\n\t\t\tarray[i] = (int)(Math.random()*15);\n\t\t}\n\t\t\n\t\treturn array;\n\t}", "public static int[][] generateUserInputMatrix(Scanner input) {\n int[][] puzzleInput = new int[3][3];\n for (int i = 0; i < puzzleInput.length; i++) {\n for (int j = 0; j < puzzleInput[i].length; j++) {\n puzzleInput[i][j] = input.nextInt();\n if (puzzleInput[i][j] < 0 || puzzleInput[i][j] / 9 > 0) {\n System.out.println(\"Invalid Entry. Please Try Again.\");\n System.exit(0);\n }\n }\n }\n return puzzleInput;\n }", "private boolean[][] makeSet(int[] sol, int n) {\n boolean[][] ret = new boolean[n][universalSetSize];\n int r = 0;\n for (int i = 0; i < n; i++) { // Row\n int row = sol[i];\n System.arraycopy(input[row], 0, ret[r], 0, input[i].length);\n r++;\n }\n return ret;\n }", "public static void createArrays() {\r\n\t\tRandom rand = new Random();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tint size = rand.nextInt(5) + 5;\r\n\t\t\tTOTAL += size;\r\n\t\t\tArrayList<Integer> numList = new ArrayList<>();\r\n\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\tint value = rand.nextInt(1000) + 1;\r\n\t\t\t\tnumList.add(value);\r\n\t\t\t}\r\n\t\t\tCollections.sort(numList);\r\n\t\t\tarrayMap.put(i + 1, numList);\r\n\t\t}\r\n\t}", "protected void framing(double inputSignal[]){\n double numFrames = (double)inputSignal.length / (double)(frameLength - shiftInterval);\n \n // unconditionally round up\n if ((numFrames / (int)numFrames) != 1){\n numFrames = (int)numFrames + 1;\n }\n \n // use zero padding to fill up frames with not enough samples\n double paddedSignal[] = new double[(int)numFrames * frameLength];\n for (int n = 0; n < inputSignal.length; n++){\n paddedSignal[n] = inputSignal[n];\n }\n\n frames = new double[(int)numFrames][frameLength];\n\n // break down speech signal into frames with specified shift interval to create overlap\n for (int m = 0; m < numFrames; m++){\n for (int n = 0; n < frameLength; n++){\n frames[m][n] = paddedSignal[m * (frameLength - shiftInterval) + n];\n }\n }\n }", "private void calculatefundamentalFreq() {\n\t\tint count;\n\t\tfloat f0 = 0;\n\t\tSystem.out.println(\"pitches\");\n\t\tSystem.out.println(pitches);\n\t\tfor(count = 0; count < pitches.size(); count++)\n\t\t{\n\t\t\tf0 += pitches.get(count);\n\t\t}\n\t\tif(count != 0)\n\t\t\tfundamentalFreq = f0 / count;\n\t\telse\n\t\t\tfundamentalFreq = 0;\n\t}", "public static void fillArray(TextFileInput input){\r\n String line = input.readLine();\r\n while(line!=null){\r\n StringTokenizer cTokens = new StringTokenizer(line, \":\");\r\n //only if the line has three arguments\r\n if(cTokens.countTokens()==3){\r\n int h = Integer.parseInt(cTokens.nextToken());\r\n int m = Integer.parseInt(cTokens.nextToken());\r\n int s = Integer.parseInt(cTokens.nextToken());\r\n Clock c = new Clock(h, m, s);\r\n //adds clocks to the array\r\n allClocks[clockCount++] = c;\r\n }\r\n else{\r\n System.out.println(line + \" does not have three tokens\");\r\n }\r\n line = input.readLine();\r\n }\r\n }", "@DataProvider(name = \"InputData\")\n\t \n\t public static Object[][] inputData() {\n\t \n\t return new Object[][] { { \"20\",\"20\" }, { \"10\",\"10\" }};\n\t \n\t }", "public static void linearToUlaw(int[] linearData, byte[] ulawData,\n int ulawOffset) {\n\n int outIx = ulawOffset;\n\n for (int inIx = 0; inIx < linearData.length; inIx++) {\n ulawData[outIx++] = linearToUlaw(linearData[inIx]);\n }\n }", "private static int[] genValues(int[] original) {\n Random rand = new Random();\n int max = original.length - 1;\n\n while (max > 0) {\n swap(original, max, rand.nextInt(max));\n max--;\n }\n return original;\n }", "private static int[] createArray(int n) {\n\t \tint[] array = new int[n];\n\t \tfor(int i=0; i<n; i++){\n\t \t\tarray[i] = (int)(Math.random()*10);\n\t \t}\n\t\t\treturn array;\n\t\t}", "public void resetFixedNumbers(){\n\t\tfor (int i = 0; i < size*size; i++)\n\t\t\tfor (int j = 0; j < size*size; j++)\n\t\t\t\tfixedNumbers[i][j] = false;\n\t}", "public void makeArray(int num)\n {\n \tmakeArray(num,0);\n }", "private void buildOneToNInputs(StateObservation stateObs) {\n viewWidth = 5;\n viewHeight = 10;\n // cell options = empty, boundary, alien, missile, left window, right window\n numberCategories = 6;\n //*****************************\n\n int blockSize;\n int avatarColNumber;\n int numCells;\n int numGridRows, numGridCols;\n\n ArrayList<Observation>[][] gameGrid = stateObs.getObservationGrid();\n\n numGridRows = gameGrid[0].length;\n numGridCols = gameGrid.length;\n\n blockSize = stateObs.getBlockSize();\n\n // get where the player is\n avatarColNumber = (int) (stateObs.getAvatarPosition().x / blockSize);\n\n int colStart = avatarColNumber - (viewWidth / 2);\n int colEnd = avatarColNumber + (viewWidth / 2);\n\n // cell options = empty, boundary, alien, missile\n numCells = (viewWidth * numberCategories) * viewHeight;\n\n MLPOnetoNInputs = new double[numCells];\n\n int index = 0;\n\n for (int i = numGridRows - (viewHeight + 1); i < viewHeight; i++) { // rows\n for (int j = colStart; j <= colEnd; j++) { // rows\n\n if (j < 0) {\n // left outside game window\n MLPOnetoNInputs[index] = 1;\n } else if (j >= numGridCols) {\n // right outside game window\n MLPOnetoNInputs[index + 1] = 1;\n } else if (gameGrid[j][i].isEmpty()) {\n MLPOnetoNInputs[index] = 0;\n } else {\n for (Observation o : gameGrid[j][i]) {\n\n switch (o.itype) {\n case 3: // obstacle sprite\n MLPOnetoNInputs[index + 2] = 1;\n break;\n\n case 1: // user ship\n MLPOnetoNInputs[index + 3] = 1;\n break;\n\n case 9: // alien sprite\n MLPOnetoNInputs[index + 4] = 1;\n break;\n\n case 6: // missile\n MLPOnetoNInputs[index + 5] = 1;\n break;\n }\n }\n }\n index += numberCategories;\n }\n }\n }", "private String createInput(int[] input){\n\t\tString inputString = \"\";\n\t\tfor(int index = 0; index < input.length; index++)\n\t\t\tinputString += input[index] + \"\\n\";\n\t\treturn inputString;\n\t}", "private void initialiseNumbers() {\r\n double choice = Math.random();\r\n sourceNumbers = new int[6];\r\n if(choice<0.8) {\r\n //one big number, 5 small.\r\n sourceNumbers[0] = (Integer) bigPool.remove(0);\r\n for( int i=1; i<6; i++) {\r\n sourceNumbers[i] = (Integer) smallPool.remove(0);\r\n }\r\n } else {\r\n //two big numbers, 5 small\r\n sourceNumbers[0] = (Integer) bigPool.remove(0);\r\n sourceNumbers[1] = (Integer) bigPool.remove(0);\r\n for( int i=2; i<6; i++) {\r\n sourceNumbers[i] = (Integer) smallPool.remove(0);\r\n }\r\n }\r\n\r\n //for target all numbers from 101 to 999 are equally likely\r\n targetNumber = 101 + (int) (899 * Math.random());\r\n }", "private void restartArray() {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n Start.shemaArray[i][j].baseModel.state = 0;\n }\n }\n }", "void createArray(int n) {\n numbers = new int[n];\n for ( int i = 0; i < n; i++){\n numbers[i] = random.nextInt(1000);\n }\n }", "public static int[] buildArray() throws IOException {\r\n\r\n //Variable initializations\r\n int[] intArray = {};\r\n int sumOfElements = 0;\r\n int index = 0;\r\n \r\n //Initialization of File and Scanner objects\r\n \r\n File sumOfIntegers = new File(fileInput);\r\n Scanner elementScanner = new Scanner(sumOfIntegers);\r\n\r\n //Loop that increases the num of array elements by 1 every time\r\n //it acknowledges an integer value within the file and subtracts\r\n //1 from the array elements when the sentinel value is reached.\r\n while (elementScanner.hasNextInt()) {\r\n sumOfElements++;\r\n \r\n \r\n //Assign next int scanner method to x variable\r\n //Used to process if boolean condition\r\n int x = elementScanner.nextInt();\r\n\r\n //When -999 sentinel value is reached reduce num of array elements\r\n //by 1 since we do not want it included\r\n if (x == -999) {\r\n sumOfElements = sumOfElements - 1;\r\n intArray = new int[sumOfElements];\r\n }\r\n //Assign sumOfElements as num of array elements\r\n intArray = new int[sumOfElements]; \r\n\r\n }\r\n\r\n //new scanner to reset abstract cursor of file\r\n elementScanner = new Scanner(sumOfIntegers);\r\n for (index = 0; index < sumOfElements; index++) {\r\n int x = elementScanner.nextInt();\r\n\r\n if (x != -999) {\r\n intArray[index] = x;\r\n }\r\n\r\n }\r\n\r\n //Closes the file/scanner\r\n elementScanner.close();\r\n\r\n return intArray;\r\n }", "static int[][] packU(int n, int[] from, int[] to) {\n int[][] g = new int[n][];\n int[] p = new int[n];\n for (int f : from) {\n p[f]++;\n }\n for (int t : to) {\n p[t]++;\n }\n for (int i = 0; i < n; i++) {\n g[i] = new int[p[i]];\n }\n for (int i = 0; i < from.length; i++) {\n g[from[i]][--p[from[i]]] = to[i];\n g[to[i]][--p[to[i]]] = from[i];\n }\n return g;\n }", "private void setupCallback(int bufferSize) {\n mCamera.setPreviewCallbackWithBuffer(this);\n for (int i = 0; i <= NUM_BUFFERS; ++i) {\n byte[] cameraBuffer = new byte[bufferSize];\n mCamera.addCallbackBuffer(cameraBuffer);\n }\n }", "public MutableArray(int paramInt, float[] paramArrayOfFloat, ORADataFactory paramORADataFactory)\n/* */ {\n/* 133 */ this.sqlType = paramInt;\n/* 134 */ this.factory = paramORADataFactory;\n/* 135 */ this.isNChar = false;\n/* */ \n/* 137 */ setArray(paramArrayOfFloat);\n/* */ }", "public static void main(String[] args) {\n Scanner inp = new Scanner(System.in);\n System.out.println(\"Enter size and number:\");\n int size = inp.nextInt(),\n n = inp.nextInt();\n\n int[] arr = new int[size];\n System.out.println(\"Enter numbers:\");\n for(int i=0 ; i <=size-1; i++){\n arr[i]=inp.nextInt();\n }\n\n add_to_r(arr, n);\n\n\n }", "public void initEncoderTxData()\n\t{\n\t\tfor(counter_i=0;counter_i<sampleBit;counter_i++)\n\t\t{\n\t\t\thighLevel[counter_i] = (short) (audioAM * (-Math.sin(Math.PI * counter_i /sampleBit * 2)));\n\t\t\tlowLevel[counter_i] = (short) (audioAM * (Math.sin(Math.PI * counter_i /sampleBit * 2)));\n\t\t}\n\t}", "public ulsinArray(int length) {\n intArr = new int[length];\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\t\t\n\t}", "private void generateCombination() {\r\n\r\n\t\tfor (byte x = 0; x < field.length; x++) {\r\n\t\t\tfor (byte y = 0; y < field[x].length; y++) {\r\n\t\t\t\tfield[x][y].setValue((byte) newFigure(Constants.getRandom()));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int[] randomize(int inputSize){\n int[] list = new int[inputSize];\n for(int i = 0; i < inputSize; i++){\n // generate numbers within absolute range of input size to increase the chance to get distinct elements\n list[i] = ThreadLocalRandom.current().nextInt(0, inputSize + 1);\n }\n// System.out.println(Arrays.toString(list));\n return list;\n }", "private static double[] getInputs() {\n\t\tdouble[] inputs = new double[SIZE];\n\t\tint counter = 0;\n\t\t\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Enter the \" + (counter + 1) + \" value: \");\n\t\t\t\tsc = new Scanner(System.in);\n\t\t\t\tdouble value = sc.nextDouble();\n\t\t\t\tinputs[counter] = value;\n\t\t\t\tcounter += 1;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Invalid datatype \" + e + \" please try again!\");\n\t\t\t}\n\t\t} while (counter != SIZE);\n\t\t\n\t\t//sc.close();\n\t\treturn inputs;\n\t}", "private void resizeArrays() {\r\n//\t\tThread.dumpStack();\r\n\t\t\r\n\t\t// coordinates, colors, 2 texunits\r\n\t\tint size = numElements * (3 + 3 + 2 + 2) * 4;\r\n\t\tSystem.out.println(\"resizeArrays \"+size+\" \"+numElements);\r\n\t\tARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, vboVertexId);\r\n\t\tARBVertexBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, size, ARBVertexBufferObject.GL_STATIC_DRAW_ARB);\r\n\t\t\r\n\t\tuploadBuffer.clear();\r\n\t\tfor (int i=0; i<uploadBuffer.capacity(); i++) {\r\n\t\t\tuploadBuffer.put(i, 1);\r\n\t\t}\r\n\t\t\r\n\t\t// clear the data\r\n\t\tint pos = 0;\r\n\t\twhile (pos < size) {\r\n\t\t\tif (size - pos < uploadBuffer.capacity() * 4) {\r\n\t\t\t\tuploadBuffer.limit((size - pos) / 4);\r\n\t\t\t}\r\n\t\t\tARBVertexBufferObject.glBufferSubDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, pos, uploadBuffer);\r\n\t\t\tUtil.checkGLError();\r\n\t\t\tpos += uploadBuffer.capacity() * 4;\r\n\t\t}\r\n\t\tARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 0);\r\n\t}", "public int[] LowerPinrandomGen(int LowerPinnumbers) {\n\t\tint[] LowerPincomboNums = new int[LowerPinnumbers];\n\t\tRandom randVal = new Random();\n\t\t\n\t\t//Create biting numbers\n\t\tfor(int i = 0; i < LowerPinnumbers; i++) {\n\t\t\tLowerPincomboNums[i] = randVal.nextInt(3)+1;\n\t\t}\n\t\t\n\t\t//Return combination\n\t\treturn LowerPincomboNums;\n\t}", "private void makeArrays()\n\t{\n\t\tfor (String key : sub.keySet())\n\t\t\tsub.put(key, ((List<String>) sub.get(key)).toArray(s0));\n\t\tfor (String key : attrs.keySet())\n\t\t\tattrs.put(key, ((List<String>) attrs.get(key)).toArray(s0));\n\t\tfor (String key : defs.keySet())\n\t\t\tdefs.put(key, ((List<String>) defs.get(key)).toArray(s0));\n\t\tfor (String key : smodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) smodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tsmodes.put(key, array);\n\t\t}\n\t\tfor (String key : amodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) amodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tamodes.put(key, array);\n\t\t}\n\t}", "private Flight[] growArray(Flight[] flights) {\r\n\t\tFlight[] newFlights = new Flight[flights.length * 2];\r\n\t\tfor(int i = 0; i < flights.length; i++) {\r\n\t\t\tnewFlights[i] = flights[i];\r\n\t\t}\r\n\t\tsize = size*2;\r\n\t\treturn newFlights;\r\n\t}", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\n\t}", "public void fillHeuristicData(){\n int[] temp;\n initHeuristic();\n for(int i = 0; i< variableLength; i++){\n temp=variables.clone();\n temp[i]=0;\n validateClauses(i,temp);\n temp[i]=1;\n validateClauses(i,temp);\n }\n }", "private void setMultipliersArraySize(int i) {\r\n\t\tp_multiplier_name = new String[i];\r\n\t\tp_multiplier_value = new Double[i];\r\n\t\tp_multiplier_description = new String[i];\r\n\t}", "public static int[] fillArray(int N) {\n\t\talgorithmThree = new int[N];\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\talgorithmThree[i] = i;\n\t\t\tswap(algorithmThree[i], algorithmThree[randInt(0,i)]);\n\t\t}\n\t\t\n\t\treturn algorithmThree;\n\t}", "public static double[][] doFraming(double[] samples){\n\t\tdouble[][] framedSignal;\n\t\tint noOfFrames = 2 * samples.length / samplePerFrame - 1;\n\t\t/*System.out.println(\"noOfFrames \" + noOfFrames + \" samplePerFrame \" + samplePerFrame + \" EPD length \"\n\t\t\t\t+ samples.length);*/\n\t\tframedSignal = new double[noOfFrames][samplePerFrame];\n\t\tfor (int i = 0; i < noOfFrames; i++) {\n\t\t\tint startIndex = (i * samplePerFrame / 2);\n\t\t\tfor (int j = 0; j < samplePerFrame; j++) {\n\t\t\t\tframedSignal[i][j] = samples[startIndex + j];\n\t\t\t}\n\t\t}\n\t\treturn framedSignal;\n\t}", "public double[] processSignal(double[] input){\r\n if(input.length == 784){\r\n neuralNetwork.setInput(input);\r\n neuralNetwork.calculate();\r\n double[] output = neuralNetwork.getOutput();\r\n String s = \"\";\r\n for(double d : output){\r\n s += String.valueOf(d) + \",\";\r\n }\r\n return output;\r\n } else {\r\n return null;\r\n }\r\n }", "static int[][] packU(int n, int[] from, int[] to) {\n// this part of code is taken from \"uwi\" submission of codechef problem KNODES \n int[][] g = new int[n][];\n int[] p = new int[n];\n for (int f : from) {\n p[f]++;\n }\n for (int t : to) {\n p[t]++;\n }\n for (int i = 0; i < n; i++) {\n g[i] = new int[p[i]];\n }\n for (int i = 0; i < from.length; i++) {\n g[from[i]][--p[from[i]]] = to[i];\n g[to[i]][--p[to[i]]] = from[i];\n }\n return g;\n }", "public void setUniverse(byte[][] input)\n\t{\n\t\tfor(int row =0; row<input.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor(int column =0; column<input[row].length; column++)\n\t\t\t{\n\t\t\t\t//assign value from input array to currentversion\n\t\t\t\tthis.currentVersion[row][column] = input[row][column];\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.5641899", "0.50799763", "0.5059016", "0.5046251", "0.5042085", "0.49925187", "0.49700385", "0.48898098", "0.48782653", "0.48565844", "0.48485136", "0.48376825", "0.47815123", "0.47790116", "0.47774953", "0.47654626", "0.47526988", "0.47486323", "0.474679", "0.4743639", "0.47174665", "0.4691107", "0.46700722", "0.46685", "0.46412453", "0.46393892", "0.46376726", "0.46291864", "0.46027792", "0.45724753", "0.45724282", "0.4566576", "0.4556044", "0.4536072", "0.4533257", "0.44945458", "0.44923827", "0.4483798", "0.448337", "0.44766518", "0.44685486", "0.44607475", "0.44562775", "0.44471768", "0.4446218", "0.44400015", "0.44278523", "0.44274312", "0.44266546", "0.4418986", "0.44179815", "0.44166458", "0.44136128", "0.44064125", "0.4397399", "0.4388962", "0.43825644", "0.4380261", "0.4373765", "0.4363286", "0.43590584", "0.43569222", "0.43487677", "0.43438396", "0.4338634", "0.43359655", "0.43311155", "0.43212277", "0.432097", "0.43099552", "0.43072593", "0.43030557", "0.43018562", "0.42986935", "0.42885697", "0.428709", "0.42787185", "0.42783096", "0.42733577", "0.42714155", "0.4268002", "0.42615786", "0.42571497", "0.42554832", "0.4255141", "0.42549744", "0.42535627", "0.4250075", "0.42385533", "0.4236987", "0.4236229", "0.42332911", "0.42299148", "0.42294157", "0.42239183", "0.4219887", "0.4219124", "0.42159602", "0.42156288", "0.42133877" ]
0.54289937
1
setFund Calculates the average frequency of multiple input lines.
public float getAverageFund(int[] inputsToAverage) { if (inputsToAverage == null) { throw new IllegalArgumentException("Input_Jack.getAverageFund: int[] parameter is null."); } // error checking if (inputsToAverage.length < 1) { throw new IllegalArgumentException("Input_Jack.getAverageFund: int[] parameter's length is " + inputsToAverage.length + "; must be at least 1."); } // error checking float result = 0; // adds the freqencies of the specified inputs: for (int i = 0; i < inputsToAverage.length; i++) { result += this.getAdjustedFund(inputsToAverage[i]); } // for // divides to find the average: return result/inputsToAverage.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setFund() {\n\t\t// catching a NullPointer because I'm not sure why it happens and fear a crash during a concert.\n\t\ttry\n\t\t{\n\t\t\t// TODO: maybe this won't be necessary once the threads are implemented.\n\t\t\tif(!this.pause)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < this.adjustedNumInputs; i++)\n\t\t\t\t{\n\t\t\t\t\t// println(\"setFund(); this.frequencyArray[i] = \" + this.frequencyArray[i].getFeatures());\n\t\n\t\t\t\t\t// want to assign the value of .getFeatures() to a variable and check for null,\n\t\t\t\t\t// but can't, b/c it returns a float. :/ (So that must not be exactly the problem.)\n\t\t\t\t\tif (this.frequencyArray[i].getFeatures() != null) {\n\t\t\t\t\t\t// println(\"i = \" + i);\n\t\t\t\t\t\t// println(\"setFund(); this.fundamentalArray[i] = \" + this.fundamentalArray[i] + \"this.frequencyArray[i].getFeatures() = \" + this.frequencyArray[i].getFeatures());\n\t\t\t\t\t\tthis.fundamentalArray[i] = this.frequencyArray[i].getFeatures();\n\t\t\t\t\t\tthis.amplitudeArray[i]\t= this.frequencyArray[i].getAmplitude(); // * 100;\n\t\n\t\t\t\t\t\t// ignores pitches with amplitude lower than \"sensitivity\":\n\t\t\t\t\t\tif (this.frequencyArray[i].getAmplitude() > this.sensitivity) {\n\t\t\t\t\t\t\tthis.adjustedFundArray[i] = this.fundamentalArray[i];\n\t\t\t\t\t\t} // if: amp > sensitivity\n\t\t\t\t\t} // if: features() != null\n\t\t\t\t} // if: > numInputs\n\t\t\t}\n\t\t} catch(NullPointerException npe) {}\n\t}", "private void calculatefundamentalFreq() {\n\t\tint count;\n\t\tfloat f0 = 0;\n\t\tSystem.out.println(\"pitches\");\n\t\tSystem.out.println(pitches);\n\t\tfor(count = 0; count < pitches.size(); count++)\n\t\t{\n\t\t\tf0 += pitches.get(count);\n\t\t}\n\t\tif(count != 0)\n\t\t\tfundamentalFreq = f0 / count;\n\t\telse\n\t\t\tfundamentalFreq = 0;\n\t}", "public float getAverageFund(int firstInput, int lastInput)\n\t{\n\t\tinputNumErrorCheck(firstInput, \"getAverageFund(int, int) - first int\");\n\t\tinputNumErrorCheck(lastInput, \"getAverageFund(int, int) - second int\");\n\t\tif (!(lastInput > firstInput)) { \n\t\t\tthrow new IllegalArgumentException(\"InputClassJack.getAverageFund(): lastInput param \" + lastInput + \" is not greater than firstInput param \" + firstInput);\n\t\t} // error checking\n\n\t\tint curInput = firstInput;\n\n\t\t// creates an array and fills it with the ints denoting the inputs from firstInput to lastInput:\n\t\tint[] inputsToAverage = new int[lastInput - firstInput + 1];\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tinputsToAverage[i] = curInput;\n\t\t\tcurInput++;\n\t\t} // for\n\n\t\t// calculates the average by calling the other getAverageFund on the inputsToAverage array:\n\t\treturn getAverageFund(inputsToAverage);\n\t}", "public void sumAte()\r\n {\r\n meanArk = 0;\r\n varArk = 0;\r\n double sumA = 0;\r\n double sumA2 = 0;\r\n float nArk = 0;\r\n for (SignatureSample s:keys) {\r\n nArk++;\r\n sumA += s.arklen;\r\n sumA2 += s.arklen * s.arklen;\r\n }\r\n meanArk = sumA / nArk;\r\n varArk = Math.sqrt((sumA2/nArk) - (meanArk*meanArk));\r\n }", "public void calcFund(FundamentalDomain fd)\n {\n \tfd.fund[0].setLC(1, frameO, 1, frameV);\n \tfd.fund[1].set(frameO);\n \tfd.fund[2].setLC(1, frameO, 1, frameU);\n \tif(fd.det>0)\n \t\tfd.fund[3].setLC(1, frameO, 1,frameU, 2, frameV);\n \telse\n \t\tfd.fund[3].setLC(1, frameO, 2,frameU, 1, frameV);\n \tfd.numFund = 4;\n }", "public float getAverageAmp(int firstInput, int lastInput)\n\t{\n\t\tinputNumErrorCheck(firstInput, \"getAverageFund(int, int) - first int\");\n\t\tinputNumErrorCheck(lastInput, \"getAverageFund(int, int) - second int\");\n\t\tif (!(lastInput > firstInput)) { \n\t\t\tthrow new IllegalArgumentException(\"InputClassJack.getAverageFund(): lastInput param \" + lastInput + \" is not greater than firstInput param \" + firstInput);\n\t\t} // error checking\n\n\t\tint curInput = firstInput;\n\n\t\tint[] inputsToAverage = new int[lastInput - firstInput + 1];\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tinputsToAverage[i] = curInput;\n\t\t\tcurInput++;\n\t\t} // for\n\n\t\treturn getAverageAmp(inputsToAverage);\n\t}", "public static void main(String[] args) {\n\n float d = (float)sum(3.0f, (float)2.0);\n System.out.println(d);\n\n double d2=avg(3.0,2.0);\n System.out.println(d2);\n//\n// int[] list={1,2};\n// list={2,3};\n\n\n\n }", "public void setFrequency(int f){\n this.frequency = f;\n }", "public void CalculateCharges( Funds funds ) {\r\n\r\n\t\tdouble Charge = 0;\r\n\r\n\t\tfor ( Charge c : _Charges ) {\r\n\r\n\t\t\tSystem.out.println(\"\\t\\t\\t \" + _Name + \" Before Charge : \" + c.getName() + \" : \" + _FundValue );\r\n\r\n\t\t\tCharge = c.Apply( this, funds );\r\n\r\n\t\t\t_ChargeAmounts.put( c.getName(), Charge );\r\n\r\n\t\t\tSystem.out.println( \"\\t\\t\\t\\t\" + _Name + \" Charge : \" + c.getName() + \", Amount: \" + Charge );\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n int a[] = { 1, 6, 8, 9, 3, 4 };\n int count = 0;\n float Average;\n int size1 = a.length;\n for (int i = 0; i < size1; i++) {\n count = count + a[i];\n\n }\n Average = count / size1;\n System.out.println(\"Average of number is: \" + Average);\n\n }", "public void setFrequencies(Set<Frequency> arg0) {\n \n }", "public static void computeAvg(functionRuntimes fRT)\r\n {\r\n\r\n }", "public void mutualFund(){\n\t\tSystem.out.println(\"HSBC BANK :: MUTUAL FUND\");\n\t}", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "private void computeAverageFrequencyDelayValue() {\n\tthis.averageFrequencyDelayValue = value * this.averageDelay;\n }", "static void solutionDay1Part1() {\n List<Integer> integerList = new ArrayList<Integer>(); // Defining an integer Array List\n Scanner myFile = null;\n int sum = 0;\n\n try {\n myFile = new Scanner(new FileReader(\"src/main/java/weekone/input01.txt\"));\n while (myFile.hasNext()) {\n integerList.add(myFile.nextInt());\n }\n for (int integer : integerList) {\n sum += integer;\n //System.out.println(sum);\n }\n System.out.println(\"Day 1 Part1 - The resulting frequency is: \" + sum);\n //Might be also possible using: System.out.println(IntStream.of(integerList).sum());\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (myFile != null) {\n myFile.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void calcAvg(){\n\t\taverage = hits/atbat;\n\t\t\n\t}", "public void updateStudentFees(double fees){\n feesPaid+=fees;\n school.updateMoneyEarned(feesPaid);\n }", "public void calculations(){\n\n int temp_size1 = fight_list.get(0).t1.members.size();\n int[] t1_counter = new int[temp_size1 + 1]; //counter for deaths: 0, 1, 2..., party size.\n float t1_avg = 0; //Average number of deaths.\n\n //We don't need to calculate for t2 right now, because t2 is just monsters.\n //temp_size = fight_list.get(0).t2.members.size();\n //int[] t2_counter = new int[temp_size + 1];\n\n for(FightResult fig : this.fight_list){\n int i = 0;\n while(i != fig.t1_deaths){\n i++;\n }\n t1_counter[i]++;\n t1_avg += fig.t1_deaths;\n }//end for\n\n System.out.println(t1_avg);\n System.out.println(Float.toString(t1_avg/fight_list.size()) + \" / \" + Integer.toString(temp_size1));\n\n String axis = \"# of deaths: \\t\";\n int axis_int = 0;\n String t1_results = \"Happened: \\t\";\n for(int i : t1_counter){\n axis += Integer.toString(axis_int++) + \"\\t\";\n t1_results += Integer.toString(i) + \"\\t\";\n }//end for\n System.out.println(axis);\n System.out.println(t1_results);\n\n float tpk_amount = t1_counter[temp_size1]; //by taking the size, we take the item at the end of the array. In this case, the number where everyone dies.\n tpk_amount = (tpk_amount/fight_list.size())*100;\n System.out.println(\"Probability of TPK: \" + Float.toString(tpk_amount) + \" %.\");\n\n System.out.println(\"\\n--------\\n\");\n }", "public void mutualFund() {\n\t\tSystem.out.println(\"HSbC--Mutual Fund\");\n\t\t\n\t}", "public void mutualFund() {\n\t\tSystem.out.println(\"HSBC-- mutual --- fund\");\n\t}", "public static double calculateAverage (Scanner read){\n int sum = 0;\n int num;\n while(read.hasNextInt()){\n num = read.nextInt();\n sum += num;\n }\n \n return sum/5.0;\n }", "private void calculateIdf(){\r\n\t\tIdf = new HashMap<>();\r\n\t\tOcc = new HashMap<>();\r\n\t\t\r\n\t\tfor (Entry<String, Document> doc : Docs.entrySet()){\r\n\t\t\tdoc.getValue().wordSet.forEach(word -> {\r\n\t\t\t\tdouble count = Idf.containsKey(word) ? Idf.get(word) : 0;\r\n \tIdf.put(word, count+1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tdoc.getValue().words.forEach((w, o) -> words.add(w));\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tfor (Entry<String, Double> e : new HashMap<>(Idf).entrySet()){\r\n\t\t\tIdf.put(e.getKey(),\r\n\t\t\t\t\tMath.log(Idf.keySet().size() / e.getValue()));\r\n\t\t}\r\n\t}", "private void getFrequency(){\r\n try {\r\n BufferedReader reader = new BufferedReader(new FileReader(IConfig.FREQUENCY_PATH));\r\n String line;\r\n while((line = reader.readLine()) != null){\r\n frequency.put(line.split(\" \")[0], (Double.parseDouble(line.split(\" \")[1])/ IConfig.TOTAL_NEWS));\r\n }\r\n reader.close();\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "void documentFrequncy(Set<String> features,\n int index,\n int troush\n ) {\n for (String str : features) {\n switch (index) {\n case 1:\n for (int i = 0; i < count1; i++) {\n if (economydocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyeco.put(str, e);\n }\n e = 0;\n break;\n case 2:\n for (int i = 0; i < count2; i++) {\n if (educationdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyedu.put(str, e);\n }\n e = 0;\n break;\n case 3:\n for (int i = 0; i < count3; i++) {\n if (sportdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyspo.put(str, e);\n }\n e = 0;\n break;\n case 4:\n for (int i = 0; i < count4; i++) {\n if (culturedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencycul.put(str, e);\n }\n e = 0;\n break;\n case 5:\n for (int i = 0; i < count5; i++) {\n if (accedentdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyaccid.put(str, e);\n }\n e = 0;\n break;\n case 6:\n for (int i = 0; i < count6; i++) {\n if (environmntaldocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyenv.put(str, e);\n }\n e = 0;\n break;\n case 7:\n for (int i = 0; i < count7; i++) {\n if (foreign_affairdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencydep.put(str, e);\n }\n e = 0;\n break;\n case 8:\n for (int i = 0; i < count8; i++) {\n if (law_justicedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencylaw.put(str, e);\n }\n e = 0;\n break;\n case 9:\n for (int i = 0; i < count9; i++) {\n if (agriculture[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyagri.put(str, e);\n }\n e = 0;\n break;\n case 10:\n for (int i = 0; i < count10; i++) {\n if (politicsdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencypoltics.put(str, e);\n }\n e = 0;\n break;\n// case 11:\n//\n// for (int i = 0; i < count11; i++) {\n// if (social_affairsdocument[i].contains(str)) {\n// e++;\n// }\n// }\n// if (e > troush) {\n// documntfrequencysocial.put(str, e);\n// }\n// e = 0;\n// break;\n case 11:\n for (int i = 0; i < count12; i++) {\n if (science_technologydocument[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencysci.put(str, e);\n }\n e = 0;\n break;\n case 12:\n for (int i = 0; i < count13; i++) {\n if (healthdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyhel.put(str, e);\n }\n e = 0;\n break;\n case 13:\n for (int i = 0; i < count14; i++) {\n if (army[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencyarmy.put(str, e);\n }\n e = 0;\n break;\n default:\n break;\n }\n\n }\n }", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public void average(){\n\t\tfor(PlayerWealthDataAccumulator w : _wealthData.values()){\n\t\t\tw.average();\n\t\t}\n\t}", "private void importForex(String line) {\n\t\t//Divides line into its individual cells by splitting on commas that are not within quotes\n\t\t//And trims all leading and trailing whitespace from each value.\n\t\tString[] lineDivided = line.split(\",(?=([^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\", -1);\n\t\tint counter = 0;\n\t\tfor (String s : lineDivided) {\n\t\t\tlineDivided[counter] = s.trim();\n\t\t\tcounter++;\n\t\t}\n\n\t\t//Uses the value in parenthesis in the first cell as the currency\n\t\tString currency = \"\";\n\t\tString[] temp = lineDivided[0].split(\"\\\\(\");\n\t\tcurrency = temp[1].replaceAll(\"[()]\", \"\");\n\n\t\t//Sets the exchange rate as the division of amount paid to PLP in US dollars and the amount owed to PLP in the foreign currency,\n\t\t//thus obtaining a more exact measure than their listed FX rate.\n\t\tdouble exchangeRate = 0;\n\t\tBigDecimal amountPaid = new BigDecimal(lineDivided[9]);\n\t\tBigDecimal amountOwed = new BigDecimal(lineDivided[7]);\n\t\tBigDecimal rate = amountPaid.divide(amountOwed, 5, RoundingMode.HALF_UP);\n\t\texchangeRate = rate.doubleValue();\n\n\t\tthis.listForex.put(currency, exchangeRate);\n\t}", "private void calcFinanceTotals() {\n System.out.println(\"calcFinanceTotals\");\n financeWindow.clear();\n for (int i = 0; i < clubEventList.totalSize(); i++) {\n financeWindow.calcPlus(clubEventList.getUnfiltered(i));\n }\n financeWindow.display();\n }", "private void calculateAvg() {\n\t\tDescriptiveStatistics stats = new DescriptiveStatistics();\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\tstats.addValue(oneQ.getGapCount() * oneQ.getFrequency());\n\t\t}\n\t\tthis.avgGain = stats.getMean();\n\t\tthis.medianGain = stats.getPercentile(50);\n\t\tthis.quartiles = stats.getPercentile(75);\n\t}", "public void payFees(int fees) {\n feesPaid += fees;\n School.updateTotalMoneyEarned(feesPaid);\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n n = in.nextInt();\n m = in.nextLong();\n initFactorSets();\n long total = 0;\n\n boolean add = true;\n for (ArrayList<Integer> factorSet : factorSets) {\n for (int factor : factorSet) {\n if (add) {\n total += m / factor;\n } else {\n total -= m / factor;\n }\n }\n add = !add;\n }\n System.out.println(total);\n }", "public static void main(String[] args) {\n\n System.out.print(\"Input an annual interest rate: \");\n float annualInterestRate = getNumber();\n \n System.out.print(\"Input a starting principal: \");\n float principal = getNumber();\n \n System.out.print(\"Input total years in fund: \");\n float yearsInFund = getNumber();\n \n System.out.print(\"Quarterly, monthly or daily? \");\n String answer = getInput();\n \n System.out.println(\"\");\n \n \n \n float currentBalance = principal;\n int year = 2017;\n float quarterlyInterestMultiplier = (1 + (annualInterestRate/4) /100);\n System.out.println(\"q\" + quarterlyInterestMultiplier);\n float monthlyInterestMultiplier = (1 + (annualInterestRate/12) /100);\n System.out.println(\"q\" + monthlyInterestMultiplier);\n float dailyInterestMultiplier = (1 + (annualInterestRate/365) /100);\n System.out.println(\"q\" + dailyInterestMultiplier);\n // System.out.println(monthlyInterestMultiplier);\n \n \n for (int i = 0; i < yearsInFund; i++) {\n \n if (answer.equals(\"quarterly\")) {\n float pastBalance = currentBalance;\n System.out.println(\"The current year is: \" + year);\n System.out.println(\"Current principal is: \" + currentBalance);\n for (int j = 0; j < 4; j++) {\n currentBalance *= quarterlyInterestMultiplier;\n }\n System.out.println(\"Total anticipated interest is: \" + (currentBalance - pastBalance));\n System.out.println(\"Expected principal at the end of \" + year + \" is: \" + currentBalance);\n System.out.println(\"\");\n year++;\n } else if (answer.equals(\"monthly\")) {\n for (int k = 0; k < 12; k++) {\n switch (k) {\n case 0:\n System.out.println(\"The current month is January \" + year);\n break;\n case 1:\n System.out.println(\"The current month is February \" + year);\n break;\n case 2:\n System.out.println(\"The current month is March \" + year);\n break;\n case 3:\n System.out.println(\"The current month is April \" + year);\n break;\n case 4:\n System.out.println(\"The current month is May \" + year);\n break;\n case 5:\n System.out.println(\"The current month is June \" + year);\n break;\n case 6:\n System.out.println(\"The current month is July \" + year);\n break;\n case 7:\n System.out.println(\"The current month is August \" + year);\n break;\n case 8:\n System.out.println(\"The current month is September \" + year);\n break;\n case 9:\n System.out.println(\"The current month is October \" + year);\n break;\n case 10:\n System.out.println(\"The current month is November \" + year);\n break;\n case 11:\n System.out.println(\"The current month is December \" + year);\n break;\n default:\n }\n float pastBalance = currentBalance;\n System.out.println(\"The current principal is: \" + currentBalance);\n currentBalance *= monthlyInterestMultiplier;\n System.out.println(\"Total anticipated interest is: \" + (currentBalance - pastBalance));\n System.out.println(\"Expected principal at the end of this month is: \" + currentBalance);\n System.out.println(\"\");\n }\n year++;\n } else if (answer.equals(\"daily\")) {\n for (int l = 0; l < 365; l++) {\n System.out.println(\"Today is day \" + (l+1) + \", \" + year);\n float pastBalance = currentBalance;\n System.out.println(\"The current principal is: \" + currentBalance);\n currentBalance *= dailyInterestMultiplier;\n System.out.println(\"Total anticipated interest by the end of day is: \" + (currentBalance - pastBalance));\n System.out.println(\"Expected principal at the end of the day is: \" + currentBalance);\n System.out.println(\"\");\n }\n year++;\n }\n \n }\n \n System.out.println(currentBalance);\n \n }", "private void run() throws IOException{\n \tsplitBudget();\n \t\n \t// step 2.\n \t// Get top-k frequent itemsets, and exact support\n \tApriori Apriori = new Apriori(database, k, FIM, exact_support);\n \tApriori.run();\n \tfor(int i = 0; i < FIM.size(); i++) {\n \t\tSystem.out.println(FIM.get(i));\n \t\tSystem.out.println(exact_support.get(i));\n \t}\n\n \t// step3. step4.\n \t// Choose value for l\n \ttruncateTransaction();\n \t\n for(List<Integer> e : db)\n System.out.println(e);\n \t\n // step5.\n getResultLength();\n \t\n // step6.\n getLambda();\n \n // step7.\n // Compute the set F of frequent items\n computeF();\n \t\n \t\n }", "public abstract double calculateQuarterlyFees();", "public static void main(String[] args) {\n\r\n\t\t\t\tScanner Student_data = new Scanner(System.in);\r\n\t\t\t\tScanner Semester_Average = new Scanner(System.in);\r\n\r\n\t\t\t\tString name;\r\n\t\t\t\tString num;\r\n\t\t\t\tint age;\r\n\r\n\t\t\t\tfloat[] Material = new float[5];\r\n\t\t\t\tfloat SeAvg;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.print(\"أسمك أدخل : \");\r\n\t\t\t\t\tname = Student_data.nextLine();\r\n\r\n\t\t\t\t\tSystem.out.print(\"الأكاديمي رقمك أدخل : \");\r\n\t\t\t\t\tnum = Student_data.nextLine();\r\n\t\t\t\t\tSystem.out.print(\"عمرك أدخل : \");\r\n\t\t\t\t\tage = Student_data.nextInt();\r\n\r\n\t\t\t\t\tSystem.out.println(\"\\n الطالب معلومات \");\r\n\t\t\t\t\tSystem.out.println(\"الإسم : \" + name);\r\n\t\t\t\t\tSystem.out.println(\"الرقم : \" + num);\r\n\t\t\t\t\tSystem.out.println(\"العمر : \" + age);\r\n\t\t\t\t\tSystem.out.println(\"\");\r\n\r\n\t\t\t\t\tSystem.out.println(\"الفصلي معدلك لحساب التالية المواد في درجاتك أدخل : \");\r\n\t\t\t\t\tSystem.out.print(\"1 البرمجة أساسيات : \");\r\n\t\t\t\t\tMaterial[0] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"1 الإنترنت صفحات برمجة : \");\r\n\t\t\t\t\tMaterial[1] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"التعلم مهارات : \");\r\n\t\t\t\t\tMaterial[2] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"1 البيانات قواعد مبادئ : \");\r\n\t\t\t\t\tMaterial[3] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"1 الحاسب تتطبيقات في مقدمة : \");\r\n\t\t\t\t\tMaterial[4] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSeAvg = (Material[0] + Material[1] + Material[2] + Material[3] + Material[4]) / 100;\r\n\r\n\t\t\t\t\tif (SeAvg >= 2.95) {\r\n\t\t\t\t\t\tfor (double i = 0; i <= 10; i++) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"هو معدلك ناجح أنت مبروك ألف : \" + SeAvg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.println(\"هو معدلك !راسب أنت عذرا: \" + SeAvg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tDate currentDate = new Date();\r\n\t\t\t\t\tString D = currentDate.toString();\r\n\t\t\t\t\tSystem.out.println(\"اليوم تاريخ : \" + D);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.out.print(e.toString());\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tStudent_data.close();\r\n\t\t\t\t\tSemester_Average.close();\r\n\r\n\t\t\t\t\tdoSomething();\r\n\t\t\t\t}\r\n\t\t\t}", "private void calculateAverages(){\n for (int i=0; i<40; i=i+4){\n totalGoalsScored1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored1 = totalGoalsScored1/numberItems;\n //Total and average scored goals of team 2\n for (int i=2; i<40; i=i+4){\n totalGoalsScored2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored2 = totalGoalsScored2/numberItems;\n //Total and average received goals of team 1\n for (int i=1; i<40; i=i+4){\n totalGoalsReceived1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived1 = totalGoalsReceived1/numberItems;\n //Total and average received goals of team 2\n for (int i=3; i<40; i=i+4){\n totalGoalsReceived2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived2 = totalGoalsReceived2/numberItems;\n }", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "void calculate() {\n\t\tint i;\n\t\tdouble avgVolume = 0.0;\n\t\t\n\t\tfor( i = 0; i < end; i++ ) {\n\t\t\t\n\t\t\tavgVolume += s[i].showVolume();\n\t\t\tSystem.out.println(s[i].toString());\n\t\t}\n\t\tif( end == 0 )\n\t\t\tSystem.out.println(\"Queue is empty\");\n\t\telse\n\t\t\tSystem.out.println(\"Average Volume is :- \" + avgVolume/end);\n\t}", "public static void main(String[] args) throws FileNotFoundException {\nint zbir=0;\n\n\t\tFileReader file=new FileReader(\"maraton.txt\");\n\nArrayList<Integer> lista = new ArrayList<>();\nScanner input=new Scanner(file);\n\nwhile (input.hasNext()) {\n\t\nString ime = input.next();\n\nlista.add(input.nextInt());\n}\nfor(int i=0; i<lista.size();i++) {\n\n\t zbir += lista.get(i);\n\t \n\t\n}\nSystem.out.println(\"Zbir je :\" +zbir);\n\t System.out.println(\"Prosjek je :\" + (zbir/lista.size()));\n\n}", "public void calculateAverage() {\n\n if (turn == 1) {\n p1.setTotalScore(p1.getTotalScore() + turnScore);\n\n p1.setTotalDarts(p1.getTotalDarts() + 1);\n\n float p1Average = p1.getTotalScore() / p1.getTotalDarts();\n p1.setAverage(p1Average);\n\n } else if (turn == 2) {\n p2.setTotalDarts(p2.getTotalDarts() + 1);\n p2.setTotalScore(p2.getTotalScore() + turnScore);\n\n float p2Average = p2.getTotalScore() / p2.getTotalDarts();\n p2.setAverage(p2Average);\n }\n\n\n }", "public void mutualFund() {\n\t\tSystem.out.println(\"HSBC---mutualFund\");\n\t}", "public double setAvg(Review reviewp) {\n\t\tint number=0;\n\t\tint mark=0;\n\t\tdouble br=0;\n\t\tfor(Review review: reviews) {\n\t\t\tif(review.getRestaurant().getName().equals(reviewp.getRestaurant().getName()) &&\n\t\t\t\t\treview.getStatus().equals(ReviewStatus.ACCEPTED)) {\n\t\t\t\t\t\tnumber++;\n\t\t\t\t\t\tmark+=review.getRating();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(mark==0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn mark/number;\n\t}", "public void totalBirths (FileResource fr) {\n int totalBirths = 0;\n int totalBoys = 0;\n int totalGirls = 0;\n \n //iterating over the CSV file\n for (CSVRecord rec : fr.getCSVParser(false)) {\n //getting the births number\n int numBorn = Integer.parseInt(rec.get(2));\n \n //updating total births number\n totalBirths += numBorn;\n \n //checking the sex, if M then increase boys count, else increase boys count\n if (rec.get(1).equals(\"M\")) {\n totalBoys += numBorn;\n }\n else {\n totalGirls += numBorn;\n }\n }\n System.out.println(\"total births = \" + totalBirths);\n System.out.println(\"female girls = \" + totalGirls);\n System.out.println(\"male boys = \" + totalBoys);\n }", "public static void main(String args[] ) throws Exception {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n \n for (int i=0; i<n; i++) {\n add(in.nextInt());\n \n if (lower.size() == upper.size()) {\n System.out.println((double)(lower.peek()+upper.peek())/2);\n } else if (lower.size() > upper.size()) {\n System.out.println((double)lower.peek());\n } else {\n System.out.println((double)upper.peek());\n }\n }\n \n in.close();\n }", "private void updateFMeasure(){\n double precisionValue = precision.get(precision.size()-1);\n double recallValue = recall.get(recall.size()-1);\n if(precisionValue==0.0 || recallValue==0.0){\n fMeasures.add(0.0);\n }else{\n fMeasures.add((2*precisionValue*recallValue)/(precisionValue+recallValue));\n }\n \n }", "public static void main(String[] args) {\nScanner input=new Scanner(System.in);\nSystem.out.println(\"Please input the number of datus\");\nint n=input.nextInt();\nString[] name=new String[n];\nint[] data1=new int[n];\nint[] data2=new int[n];\nfor(int i=0;i<n;i++){\n\tname[i]=input.next();\n\tdata1[i]=input.nextInt();\n\tdata2[i]=input.nextInt();\n}\nfor(int i=0;i<n;i++)\nSystem.out.printf(\"|%4s|%4d|%4d|%6.3f|\\n\",name[i],data1[i],data2[i],(float)(data1[i]/data2[i]));\n\t}", "public static void main(String[] args) {\n double arr[] = new double[5];\r\n Scanner sc = new Scanner(System.in);\r\n for(int i=0;i<5;i++)\r\n {\r\n System.out.println(\"Enter a number\");\r\n arr[i]= sc.nextInt();\r\n \r\n }\r\n double sum =0;\r\n for(int i=0;i<5;i++) \r\n {\r\n \t sum = sum + arr[i];\r\n }\r\n System.out.println(\"The sum of the numbers are : \"+ sum);\r\n double avg = (sum/5.0);\r\n System.out.println(\"The average of the numbers are : \"+ avg);\r\n\t}", "float average(int[] input) {\n\t\tfloat average = 0;\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < input.length; index++) {\t\t//loop to get sum of numbers\n\t\t\tsum = sum + input[index];\n\t\t}\n\t\taverage = (float) sum / (input.length);\t\t//average calculation\n\t\treturn average;\n\t}", "public void parseAverages(){\r\n\t\tfor(int i = 1; i < x.size(); i++){\r\n\t\t\tdouble avg = (x.get(i) + x.get(i-1)) / 2;\r\n\t\t\tx.set(i, avg);\r\n\t\t}\r\n\t}", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "@Override\n public int accion() {\n return this.alcance*2/3*3;\n }", "public void average() {\n\t\tif (averaged)\n\t\t\tthrow new AssertionError(\"can't average twice!!\");\n\t\t\n\t\tscale = 1.0/(double)t;\n\t\t\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i] = (t+1.0)*w[i] - wupdates[i];\n\t\t\n\t\taveraged = true;\n\t\n\t}", "public double taxCalc(int income1, int income2, int income3, int income4, int income5) {\n int[] arr = {income1, income2, income3, income4, income5};\n double taxTotal = 0.0;\n for (int i = 0; i < arr.length; i++) {\n taxTotal += (double) (arr[i] * 7 / 100);\n }\n return taxTotal;\n }", "public void readSet() throws IOException {\n temps = new HashSet<String>();\n readDescription();\n // adds the words in the temporary set to the temp array\n for (String w : temps) {\n if (w.equals(\"dana\")) {\n System.out.println(w + \" was called +1\");\n }\n int v = d.getValue(w);\n arr[v]++;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called +1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n temps = new HashSet<String>();\n readDescription();\n // does the same thing above, except since this is the second\n // description, subtract 1 from array\n for (String w : temps) {\n int v = d.getValue(w);\n arr[v]--;\n if (w.equals(\"subj\")) {\n System.out.println(w + \" was called -1\");\n System.out.println(arr[v] + \" is the number of the array of \" + w);\n }\n }\n // get the prices\n int p1 = getPrice();\n int p2 = getPrice();\n // get the answer value\n // a should be the correct answer\n // b should be the answer they choose\n int a = getAnswer();\n int b = getAnswer();\n // System.out.println(\"The correct answer is: \" + a +\n // \" The chosen answer is: \" + b);\n int y_real;\n DecimalFormat numberFormat = new DecimalFormat(\"#.####\");\n double real_ratio;\n double mturk_ratio;\n if (p1 > p2) {\n y_real = p1 - p2;\n real_ratio = (double) p1 / p2;\n } else {\n y_real = p2 - p1;\n real_ratio = (double) p2 / p1;\n }\n int pdiff;\n if (a == b) {\n pdiff = y_real;\n mturk_ratio = real_ratio;\n } else {\n pdiff = -y_real;\n mturk_ratio = 1 / real_ratio;\n }\n if (p2 > p1) {\n for (int i = 0; i < arr.length; i++) {\n arr[i] = -arr[i];\n }\n }\n w.write(pdiff + \" \");\n w.write(numberFormat.format(real_ratio) + \" \");\n w.write(numberFormat.format(mturk_ratio) + \" \");\n for (int i = 0; i < size; i++) {\n if (i != arr.length - 1) {\n w.write(arr[i] + \" \");\n } else {\n w.write(arr[i]);\n }\n }\n w.write(\"\\n\");\n arr = new int[size];\n }", "public double calculateAverage(List<Integer> list) {\n double sum = 0;\n double avg = 0.0;\n try {\n if (list.isEmpty()) {\n throw new Exception(\"Empty List\");\n }\n\n //loop for values to calculate average\n for (Integer mark : list) {\n sum = sum + mark;\n }\n avg = sum / list.size();\n\n } catch (Exception e) {\n avg = 0.0;\n }\n return avg;\n }", "public void setFrequency(Double frequency) {\n this.frequency = frequency;\n }", "double average();", "public static void main(String[] args) {\n\n ArrayList<Double> number = new ArrayList<>();\n Scanner in = new Scanner(System.in);\n System.out.println(\"Enter a number to calculate average\");\n\n String[] token = in.nextLine().split(\"\\\\s\");\n\n for (int i = 0; i < token.length; i++) {\n number.add(Double.parseDouble(token[i]));\n if (number.size() == 0) {\n System.out.println(\"No Average\");\n } else {\n double total = 0;\n for (double element :\n number) {\n\n\n total = total + element;\n }\n double average = total / number.size();\n System.out.println(\"the average is: \" + average);\n }\n }\n }", "public static void main(String[] args) throws IOException {\n\t\tFileInputStream fi = new FileInputStream(\"C:\\\\Users\\\\jyuna\\\\OneDrive\\\\Desktop\\\\2019airpollution.csv\");\n FileOutputStream fo = new FileOutputStream(\"C:\\\\Users\\\\jyuna\\\\OneDrive\\\\Desktop\\\\output.txt\");\n BufferedReader br = new BufferedReader(new InputStreamReader(fi));\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fo));\n\n String strLine;\n while ((strLine = br.readLine()) != null) {\n\n String[] arr = strLine.split(\" \");\n String[] nos = arr[1].split(\",\");\n\n Set<Integer> set = new HashSet<Integer>(); \n for(int i = 0; i<nos.length; i++){\n int no = Integer.parseInt(nos[i]);\n set.add(no); \n }\n TreeSet<Integer> sortedSet = new TreeSet<Integer>(set); \n\n switch(arr[0]) {\n\n case \"Min:\":\n String msg1=\"The Min of [\" +arr[1]+ \"] is \" +(Integer)sortedSet.first();\n bw.write(msg1);\n bw.newLine();\n\n break;\n\n case \"Max:\":\n String msg2=\"The Max of [\" +arr[1]+ \"] is \" +(Integer)sortedSet.last();\n bw.write(msg2);\n bw.newLine();\n break;\n\n case \"Avg:\":\n Object[] noarray = sortedSet.toArray();\n int noarraysize = noarray.length-1;\n int sum=0;\n for(int i=0;i<=noarraysize;i++) {\n\n int no=Integer.valueOf(noarray[i].toString());\n sum = sum + no;\n if(i==noarraysize) {\n String msg3=\"The Avg of [\" +arr[1]+ \"] is \" +(double)sum/noarray.length;\n bw.write(msg3);\n bw.newLine();\n }\n }\n break;\n\n case \"Sum:\":\n Object[] noarray1 = sortedSet.toArray();\n int noarraysize1 = noarray1.length-1;\n int sum1=0;\n for(int i=0;i<=noarraysize1;i++) {\n int no=Integer.valueOf(noarray1[i].toString());\n sum1 = sum1 + no;\n if(i==noarraysize1) {\n String msg4=\"The Sum of [\" +arr[1]+ \"] is \" +sum1;\n bw.write(msg4);\n bw.newLine();\n }\n }\n break;\n\n }\n\n }\n br.close();\n bw.close();\n\n }", "public void mutualFund() {\n\t\tSystem.out.println(\"HSBC--Mutual Fund--from Brazil Bank\");\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int sum = 0;\n System.out.print(\"Enter the first score: \");\n sum += input.nextInt();\n System.out.print(\"Enter the second score: \");\n sum += input.nextInt();\n System.out.print(\"Enter the third score: \");\n sum += input.nextInt();\n double average = sum/3;\n System.out.println(average);\n //print statement to test that things are working!\n //System.out.println(sum);\n //calculate the Average\n //output the data on the screen\n }", "public Apriori(String dataPath, int supportThreshold){\n mThreshold = supportThreshold;\n mItemSet = new LinkedList<>();\n mDataList = new ArrayList<>();\n skipLines = new HashSet<>();\n\n // Construct a list of one item sets\n Map<Integer, Integer> atomicFIS = new HashMap<>();\n Map<Integer, Integer> sizeFrequency = new HashMap<>();\n\n try {\n BufferedReader dataBase\n = new BufferedReader(new InputStreamReader(new FileInputStream(new File(dataPath))));\n int lineCount = 0;\n int wordCount = 0;\n while (dataBase.ready()){\n String transaction = dataBase.readLine();\n StringTokenizer tokenizer = new StringTokenizer(transaction, \" \");\n List<Integer> line = new ArrayList<>();\n\n // Count of the number of items in this transaction\n int count = 0;\n\n while(tokenizer.hasMoreElements()){\n int item = Integer.parseInt(tokenizer.nextToken());\n line.add(item);\n //lineSet.add(item);\n if (atomicFIS.containsKey(item)){\n atomicFIS.put(item, atomicFIS.get(item) + 1);\n } else{\n atomicFIS.put(item, 1);\n }\n\n count ++;\n }\n\n if (sizeFrequency.containsKey(count)){\n sizeFrequency.put(count, sizeFrequency.get(count) + 1);\n } else{\n sizeFrequency.put(count, 1);\n }\n mDataList.add(line);\n //mDataSet.add(lineSet);\n wordCount += count;\n lineCount++;\n }\n averageCount = wordCount / lineCount;\n dataBase.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n oneDimensionFIS = new ArrayList<>();\n\n for (Map.Entry<Integer, Integer> entry : atomicFIS.entrySet()){\n if (entry.getValue() >= mThreshold){\n int[] temp = new int[1];\n temp[0] = entry.getKey();\n oneDimensionFIS.add(temp);\n // Put the Set - frequency entry in result\n mItemSet.add(entry.getKey() + \"(\" + entry.getValue() + \")\\n\");\n }\n }\n }", "public static void main(String[] args) {\n\n\t\tString input[] = {\"hello\",\"hello\",\"hello\",\"hdldp\",\"hdldp\",\"hdldp\",\"hdldp\",\"hdldp\",\"d\",\"d\",\"d\",\"d\",\"d\",\"d\",\"d\"};\n\t\tcalcFrquent(input, 2);\n\n\t}", "private void fnMeanSale() {\n }", "bool setFrequency(double newFrequency);", "public static void calculateAvg(double[] avgPArr, int itemNum) {\n\n for (int i = 0; i < avgPArr.length; i++)\n avgPArr[i] /= itemNum;\n\n }", "public double calculateAverage(List<Double> list, String s) {\n double sum = 0;\n double avg = 0.0;\n try {\n if (list.isEmpty()) {\n throw new Exception(\"Empty List\");\n }\n\n //loop for values to calculate average\n for (Double mark : list) {\n sum = sum + mark;\n }\n avg = sum / list.size();\n\n } catch (Exception e) {\n avg = 0.0;\n }\n return avg;\n }", "public void calculateAverageFmax(){\n ArrayList<Double> fmaxList = new ArrayList<Double>();//Used to determine the SD\n double fmaxSum = 0;\n int profileCount = 0;\n if (averageProfileList == null){\n return;\n }\n for (AverageProfile avProfile: averageProfileList){\n for(Profile profile: avProfile.getReplicateProfileList()){\n if(profile.hasAnLreWindowBeenFound() && !profile.isExcluded()){\n fmaxSum += profile.getFmax();\n profileCount++;\n fmaxList.add(profile.getFmax());\n }\n }\n }\n if (profileCount >= 1 && fmaxSum > 0){\n averageFmax = fmaxSum/profileCount;\n if(fmaxList.size()>1){\n avFmaxCV = MathFunctions.calcStDev(fmaxList)/averageFmax;\n }else{\n avFmaxCV = 0;\n }\n } else {\n averageFmax = 0;\n }\n }", "private void calculateMode(){\r\n float[][] tally = new float[2][2];\r\n //The \"best\" so far\r\n tally[0][0] = 0; //AER\r\n tally[0][1] = 0; //amount\r\n //Works out the total\r\n tally[1][0] = 0; //AER\r\n tally[1][1] = 0; //amount\r\n\r\n for(Account aAccount: theAccounts){\r\n if(aAccount.getAer() == tally[1][0]){\r\n tally[1][1]++;\r\n }\r\n else{\r\n if(tally[1][1]>tally[0][1]){\r\n tally[0][0] = tally[1][0];\r\n tally[0][1] = tally[1][1];\r\n\r\n }\r\n tally[1][0] = aAccount.getAer();\r\n tally[1][1] = 0;\r\n }\r\n }\r\n float averageAER = tally[0][0];\r\n float averageBond = startingBonds + (startingBonds*averageAER/100);\r\n\r\n Account averageAccount = new Account(startingBonds,averageBond,averageAER);\r\n System.out.println(averageAccount.toString());\r\n\r\n }", "public void setGaussFK() {\n for (int i = 0; i < 10; i++) {\n setGaussian(devFK[i], nilai[i], meanFK[i]);\n gaussFK[i] = getGaussian();\n }\n }", "float getFrequency();", "public static void main(String[] args) throws IOException//ADD A THROWS CLAUSE HERE\n {\n double sum = 0; //the sum of the numbers\n int count = 0; //the number of numbers added\n double mean = 0; //the average of the numbers\n double stdDev = 0; //the standard deviation of the numbers\n String line = null; //a line from the file\n double difference; //difference between the value and the mean\n //create an object of type Decimal Format\n DecimalFormat threeDecimals = new DecimalFormat(\"0.000\");\n //create an object of type Scanner\n Scanner keyboard = new Scanner(System.in);\n String filename; // the user input file name\n //Prompt the user and read in the file name\n System.out.println(\"This program calculates statistics\"\n + \"on a file containing a series of numbers\");\n System.out.print(\"Enter the file name: \");\n filename = \"D:/Program Files/JetBrains/test1/Lab/src/xyz/Lab4/\" + keyboard.nextLine();\n //ADD LINES FOR TASK #4 HERE\n //Create a FileReader object passing it the filename\n FileReader fileReader = new FileReader(filename);\n //Create a BufferedReader object passing it the FileReader object.\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n //priming(启动) read to read the first line of the file\n //create a loop that continues until you are at the end of the file\n while (bufferedReader.readLine() != null) {\n //convert the line to double value, add the value to the sum\n sum += Double.valueOf(bufferedReader.readLine());\n System.out.println(bufferedReader.readLine());\n //increment the counter\n count++;\n }\n //read a new line from the file\n //close the input file\n bufferedReader.close();\n //store the calculated mean\n mean = sum / count;\n\n System.out.println(mean);\n //ADD LINES FOR TASK #5 HERE\n //create a FileReader object passing it the filename\n FileReader fileReader1 = new FileReader(filename);\n //create a BufferedReader object passing it the FileReader object.\n BufferedReader bufferedReader1 = new BufferedReader(fileReader1);\n //reinitialize the sum of the numbers\n sum = 0;\n //reinitialize the number of numbers added\n count = 0;\n double variance;\n while ((line = bufferedReader1.readLine()) != null) {\n\n\n //priming read to read the first line of the file\n //loop that continues until you are at the end of the file\n //convert the line into a double value and subtract the mean\n difference = Double.valueOf(line) - mean;\n //add the square of the difference to the sum\n sum += difference * difference;\n //increment the counter\n count++;\n //read a new line from the file\n }\n //close the input file\n bufferedReader1.close();\n //store the calculated standard deviation\n stdDev = sum / count;\n System.out.println(stdDev);\n //ADD LINES FOR TASK #3 HERE\n\n //create an object of type FileWriter using “Results.txt”\n FileWriter fileWriter = new FileWriter(\"D:/Program Files\" +\n \"/JetBrains/test1/Lab/src/xyz/Lab4/Results.txt\");\n\n //create an object of PrintWriter passing it the FileWriter object.\n PrintWriter printWriter = new PrintWriter(fileWriter);\n //print the results to the output file\n //print the mean and the standard deviation(标准偏差) to the output file using the three\n //decimal format.\n printWriter.println(\"mean:\" + threeDecimals.format(mean));\n printWriter.println(\"standard deviation:\" + threeDecimals.format(stdDev));\n printWriter.flush();\n //close the output file\n printWriter.close();\n }", "public void add(double newValue) {\n this.count++;\n this.average = this.average * (this.count - 1) / this.count + newValue/this.count;\n }", "public void makeStochastic() {\n \n double sum = 0.0;\n \n for(T row : getFirstDimension()) {\n \n // sum all values\n for(T col : getMatches(row)) {\n \n if(get(row, col)!=null) {\n sum += get(row, col);\n }\n \n }\n }\n \n \n for(T row : getFirstDimension()) {\n \n // sum all values\n for(T col : getMatches(row)) {\n \n if(get(row, col)!=null) {\n set(row, col, get(row, col)/sum);\n }\n \n }\n }\n }", "public static void main(String[] args) \n\t{\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tint anzahl;\n\t\tdouble preis;\n\t\tdouble mwSt;\n\t\tdouble zwischenpreis;\n\t\t\n\t\tSystem.out.print(\"Anzahl der gekauften Artikel eingeben: \");\n\t\tanzahl = s.nextInt();\n\t\t\n\t\tdouble[] gesamtpreisliste=new double[anzahl];\n\t\t\n\t\tfor (int i = 0; i < anzahl; i++) {\n\t\t\tSystem.out.print(\"Artikelpreis von Artikel \"+(i+1)+\" eingeben: \");\n\t\t\tpreis = s.nextDouble();\n\t\t\tSystem.out.print(\"MwSt % von Artikel \"+(i+1)+\" eingeben: \");\n\t\t\tmwSt = s.nextDouble();\n\t\t\t\n\t\t\tzwischenpreis = preis(preis, anzahl, mwSt);\n\t\t\tgesamtpreisliste[i]=zwischenpreis;\n\t\t}\n\t\t\n\t\tdouble summe=berechnungSumme(gesamtpreisliste, anzahl);\n\t\t\n\t\tSystem.out.println(\"Gesamtpreis: \" + summe);\n\t\t\n\t\ts.close();\n\t}", "public double sum() {\n/* 196 */ return this.mean * this.count;\n/* */ }", "public void addFormulas() {\n countFormulas++;\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int[] dueDate = new int[3];\n int[] returned = new int[3];\n \n for(int ii = 0; ii < 3; ii++)\n returned[ii] = in.nextInt();\n \n for(int ii = 0; ii < 3; ii++)\n dueDate[ii] = in.nextInt();\n \n System.out.println(calculateFine(dueDate, returned));\n }", "public void testF() {\n\t\tfor (int k = 0; k < usedSS; k++) {\n\t\t\tList<Integer> subStr = vals.subList(k*compSize, (k+1)*compSize);\n\t\t\tint sum = (int) subStr.stream().filter(i -> i != BipartiteMatching.FREE).count();\n\t\t\tfData.add(sum);\t\t\t\n\t\t}\n\t}", "public void setF(){\n\t\tf=calculateF();\n\t}", "public void StandardDeviation(){\r\n\t\tAverage();\r\n\t\tif (count<=1){\r\n\t\t\tSystem.out.println(\"The Standard Deviation is \"+0.0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tStandardDeviation=(float)Math.sqrt((Total2-Total*Total/count)/(count-1));\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint ratarata[]= {10,7,6,5,3,4,5};\r\n\t\tint hasil = 0;\r\n\t\tfor (int x = 0;x<ratarata.length;x++) {\r\n\t\t\thasil = hasil+ratarata[x];\r\n\t\t}\r\n\t\tSystem.out.println(\"Jumlah total nilai : \" +hasil);\r\n\t\tSystem.out.println(\"Jumlah Murid : \" + ratarata.length);\r\n\t\tint avg = hasil/ratarata.length;{\r\n\t\t\tSystem.out.println(\"Hasil rata-rata : \"+avg);\r\n\t\t}\r\n\t}", "public void addFM(final FMTafTrend change) {\n fMs.add(change);\n }", "public static double average (double ... s4){\n double suma = 0.0;\n for (double value : s4) {\n suma += value;\n }\n return suma / s4.length;\n }", "private void processCalculation(String line) {\n\t\t//TODO: fill\n\t}", "public void updateSMA(){\n audioInput.read(audioBuffer, 0, bufferSize);\n Complex [] FFTarr = doFFT(shortToDouble(audioBuffer));\n FFTarr = bandPassFilter(FFTarr);\n double sum = 0;\n for(int i = 0; i<FFTarr.length;i++){\n sum+=Math.abs(FFTarr[i].re()); // take the absolute value of the FFT raw value\n }\n double bandPassAverage = sum/FFTarr.length;\n Log.d(LOGTAG, \"bandPassAverage: \" + bandPassAverage);\n\n //Cut out loud samples, otherwise compute rolling average as usual\n if(bandPassAverage>THROW_OUT_THRESHOLD){\n mySMA.compute(mySMA.currentAverage());\n }else {\n mySMA.compute(bandPassAverage);\n }\n }", "private void get_values(File f1){\n String line;\n Scanner read_file=null;\n try{\n read_file= new Scanner(f1);\n }catch(FileNotFoundException e){\n System.out.println(\"The specified file of the Student cannot be found.\");\n return;\n }\n line=read_file.nextLine();\n while(!(line.contains(\"OOP\"))){\n line=read_file.nextLine();\n }\n line=read_file.nextLine();\n while(!(line.contains(\"Chap_1\"))){\n line=read_file.nextLine();\n }\n //System.out.println(line.substring(8));\n OOP[0]=Float.parseFloat(line.substring(8));\n line=read_file.nextLine();\n OOP[1]=Float.parseFloat(line.substring(8));\n line=read_file.nextLine();\n OOP[2]=Float.parseFloat(line.substring(8));\n line=read_file.nextLine();\n OOP[3]=Float.parseFloat(line.substring(8));\n\n line=read_file.nextLine();\n while(!(line.contains(\"DE\"))){\n line=read_file.nextLine();\n }\n line=read_file.nextLine();\n while(!(line.contains(\"Chap_1\"))){\n line=read_file.nextLine();\n }\n DE[0]=Float.parseFloat(line.substring(8));\n line=read_file.nextLine();\n DE[1]=Float.parseFloat(line.substring(8));\n line=read_file.nextLine();\n DE[2]=Float.parseFloat(line.substring(8));\n\n line=read_file.nextLine();\n while(!(line.contains(\"DSA\"))){\n line=read_file.nextLine();\n }\n line=read_file.nextLine();\n while(!(line.contains(\"Chap_1\"))){\n line=read_file.nextLine();\n }\n DSA[0]=Float.parseFloat(line.substring(8));\n line=read_file.nextLine();\n DSA[1]=Float.parseFloat(line.substring(8));\n line=read_file.nextLine();\n DSA[2]=Float.parseFloat(line.substring(8));\n\n line=read_file.nextLine();\n line=read_file.nextLine();\n total_marks=Float.parseFloat(line.substring(13));\n average=total_marks/10;\n\n read_file.close();\n }", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }", "public float findFrequency(ArrayList<Float> wave){\n\r\n ArrayList<Float> newWave = new ArrayList<>();\r\n\r\n for(int i=0;i<wave.size()-4;i++){\r\n newWave.add((wave.get(i)+wave.get(i+1)+wave.get(i+2)+wave.get(i+4))/4f);\r\n }\r\n\r\n\r\n boolean isBelow = wave1.get(0)<triggerVoltage;\r\n\r\n ArrayList<Integer> triggerSamples = new ArrayList<>();\r\n\r\n\r\n System.out.println(\"starting f calc\");\r\n\r\n for(int i=1;i<newWave.size();i++){\r\n if(isBelow){\r\n if(newWave.get(i)>triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=false;\r\n }\r\n }else{\r\n if(newWave.get(i)<triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=true;\r\n }\r\n }\r\n }\r\n System.out.println(\"F len in \"+triggerSamples.size());\r\n\r\n ArrayList<Float> freqValues = new ArrayList<>();\r\n\r\n\r\n for(int i=0;i<triggerSamples.size()-2;i++){\r\n freqValues.add(1/(Math.abs(SecondsPerSample*(triggerSamples.get(i)-triggerSamples.get(i+2)))));\r\n }\r\n\r\n float finalAVG =0;\r\n for (Float f : freqValues) {\r\n finalAVG+=f;\r\n }\r\n finalAVG/=freqValues.size();\r\n\r\n\r\n return finalAVG;\r\n //System.out.println(finalAVG);\r\n }", "private static void computeIDF()throws Exception{\r\n\t\tidfArray = new double[nounList.size()];\r\n\t\tBufferedReader br = new BufferedReader(new FileReader(NOUN_DF));\r\n\t\tString line = null;\r\n\t\tline = br.readLine();\r\n\t\tint cnt = 0;\r\n\t\tdocumentSize = Integer.parseInt(line);\r\n\t\twhile((line = br.readLine())!=null){\r\n\t\t\tdouble df = Double.parseDouble(line.split(\":\")[1]);\r\n\t\t\tif(df == 0.0){\r\n\t\t\t\tidfArray[cnt++] = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdouble idf = Math.log10(documentSize / df);\r\n\t\t\t\tidfArray[ cnt++ ] = idf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tbr.close();\r\n\t}", "private double computeMean(List<Integer> intList) {\n double count = 0;\n for (Integer i : intList) {\n count += i;\n }\n return count / intList.size();\n }", "public void findFrequency(int size) {\r\n\t\tfor(i=0;i<size;i++) {\r\n\t\t\tfor (Entry en : dataEntries) {\t\t\r\n\t\t\t\ttemperature.add(en.getTemperature());\r\n\t\t\t\taches.add(en.getAches());\r\n\t\t\t\tcough.add(en.getCough());\r\n\t\t\t\tsoreThroat.add(en.getSoreThroat());\r\n\t\t\t\tdangerZone.add(en.getDangerZone());\r\n\t\t\t\thasCOVID19.add(en.getHasCOVID19());\r\n\t\t\t\t\r\n\t\t\t\tif (en.getHasCOVID19().equals(\"yes\")) {\r\n\t\t\t\t\ttemperatureIfCOVID19.add(en.getTemperature());\r\n\t\t\t\t\tachesIfCOVID19.add(en.getAches());\r\n\t\t\t\t\tcoughIfCOVID19.add(en.getCough());\r\n\t\t\t\t\tsoreThroatIfCOVID19.add(en.getSoreThroat());\r\n\t\t\t\t\tdangerZoneIfCOVID19.add(en.getDangerZone());\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void averageTicketPayable() {\n\t\tnodes.stream().filter(sc->sc instanceof Payable).mapToDouble(sc->((Payable) sc).getEntryFee()).average().stream().forEach(System.out::println);\n\t}", "private double calculateAverage(Candle[] cd) {\n double sum = 0; \r\n for(Candle c : cd) {\r\n sum += c.getClose();\r\n }\r\n return sum/cd.length;\r\n \r\n }", "public static double average(Scanner s){\n\t\t\n\t\tint count = 0;\n\t\tint sum = 0;\n\t\t\n\t\twhile(s.hasNextInt()){\n\t\t\t\n\t\t\tsum += s.nextInt();\n\t\t\tcount++;\n\t\t} \n\t\t\n\t\treturn sum/(double)count; //type cast count to double to avoid integer division\n\n\t}", "public void finalCompute(int dataCnt)\n\t{\n\t\tIterator<Integer> numericKeySetIter = m_numericValueList.keySet().iterator();\n\t\twhile(numericKeySetIter.hasNext())\n\t\t{\n\t\t\tint key = numericKeySetIter.next();\n\t\t\t\n\t\t\tPDF_Features value = m_numericValueList.get(key);\n\t\t\tvalue.average = value.sum / (double)dataCnt;\n\t\t\tvalue.variance = (value.squareSum/(double)dataCnt) - Math.pow(value.average,2);\n\t\t\t\n//\t\t\tif(value.variance == 0) value.variance = value.average / baseVarianceParameter;\n//\t\t\tif(value.variance == 0) value.variance = 1;\n\t\t\t\n\t\t\tm_numericValueList.put(key, value);\n\n\t\t}\n\t\t\n\t\tIterator<Integer> nominalKeySetIter = m_nominalValueList.keySet().iterator();\n\t\twhile(nominalKeySetIter.hasNext())\n\t\t{\n\t\t\tint key = nominalKeySetIter.next();\t\t\t\n\t\t\tHashMap<String, Double> valueMap = m_nominalValueList.get(key);\n\t\t\t\n\t\t\tIterator<String> valueKeyIter = valueMap.keySet().iterator();\n\t\t\twhile(valueKeyIter.hasNext())\n\t\t\t{\n\t\t\t\tString valueKey = valueKeyIter.next();\n\t\t\t\tvalueMap.put(valueKey, valueMap.get(valueKey) / (double)dataCnt);\n\t\t\t}\n\t\t\t\n\t\t\tm_nominalValueList.put(key, valueMap);\n\t\t}\n\t}", "public static void main(String[] args) {\n\n final byte mounthsInYyears = 12; // mounts in years\n final byte ofPresentage = 100; // total presentage\n\n String input=null, inputs=null, inputsi=null;\n int myPrincipal = 0;\n float annualInterstRate=0, actuallRate=0, periodInMounths=0, period=0;\n boolean err=true;\n\n // running the program \n\n do{\n try{\n input = JOptionPane.showInputDialog(\"principal (1K shekels - 1M shekels): \");\n myPrincipal = Integer.parseInt(input);\n err=false;\n\n while (myPrincipal<1_000 || myPrincipal>1_000_000) { // create while loop becuse we check our condition until it works\n JOptionPane.showMessageDialog(null,\"Error, your principal should be a number between 1K to 1M! \"); // printing error line\n myPrincipal = Integer.parseInt(JOptionPane.showInputDialog(\"principal (1K shekels - 1M shekels): \")); // adding again the input line\n if (myPrincipal>1000 && myPrincipal<1000000) // declare our condition\n break; // if the condition will work we will break out of the loop\n }\n\n }catch(NumberFormatException e){\n e.printStackTrace();\n }\n }while(err);\n \n do{\n try{\n err = true;\n inputs = JOptionPane.showInputDialog(\"Annual Interst Rate: \");\n annualInterstRate = Float.parseFloat(inputs);\n err=false;\n while (annualInterstRate<0 || annualInterstRate>30) { // create while loop becuse we check our condition until it works\n JOptionPane.showMessageDialog(null,\"Error,enter a number between 0 to 30!\"); // printing error line\n annualInterstRate = Float.parseFloat(JOptionPane.showInputDialog(\"Annual Interst Rate: \"));\n if (myPrincipal>0 && myPrincipal<=30) // declare our condition\n break; // if the condition will work we will break out of the loop\n } \n actuallRate = annualInterstRate/(ofPresentage*mounthsInYyears); // creting new calculated variable \n\n }catch(NumberFormatException e){\n e.printStackTrace();\n }\n }while(err);\n\n do{\n try{\n err = true;\n inputsi = JOptionPane.showInputDialog(\"Period (Years):\");\n period = Float.parseFloat(inputsi);\n err=false;\n while (period<0 || period>30) { // create while loop becuse we check our condition until it works\n JOptionPane.showMessageDialog(null,\"Error,enter a number between 0 to 30!\"); // printing error line\n period = Float.parseFloat(JOptionPane.showInputDialog(\"Period (Years):\"));\n if (period>0 && period<=30) // declare our condition\n break; // if the condition will work we will break out of the loop\n }\n periodInMounths = period*mounthsInYyears; // creting new calculated variable\n\n }catch(NumberFormatException e){\n e.printStackTrace();\n }\n }while(err);\n \n // calculations\n float parenthesisValue = 1 + actuallRate;\n double parenthesisValuePower = Math.pow(parenthesisValue, periodInMounths);\n double Mortgage = myPrincipal * ((actuallRate * parenthesisValuePower)/(parenthesisValuePower -1 ));\n \n // formating statements\n NumberFormat currency = NumberFormat.getCurrencyInstance();\n String result = currency.format(Mortgage);\n \n JOptionPane.showMessageDialog(null, \"The Mortgage is \" + result); \n\n }", "public void withdraw(double ammount) throws insufficientFunds{\n if(ammount > abal)\n throw new insufficientFunds();\n else{\n ammount = abal - ammount;\n UpdateDB();\n }\n }", "public static void main( String[] args )\n {\n \tScanner sc=new Scanner(System.in);\n\t\taverage a=()->{\n\t\t\tSystem.out.println(\"Enter no of elements\");\n\t\t\tint n=sc.nextInt();\n\t\t\tArrayList<Integer> a1=new ArrayList<Integer>();\n\t\t\tSystem.out.println(\"Enter\"+n+\" elements\");\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tint z=sc.nextInt();\n\t\t\t\ta1.add(z);\n\t\t\t}\n\t\t\tint s=0;\n\t\t\tfor(Integer i:a1)\n\t\t\t{\n\t\t\t\ts=s+i;\n\t\t\t}\n\t\t\tfloat AvgOfList=(float)(s)/a1.size();\n\t\t\treturn AvgOfList;\n\t\t};\n\t\tSystem.out.println(\"Average of the list of given integers are:\"+a.avg());\n\t\tsc.close();\n }" ]
[ "0.63009787", "0.5612238", "0.5549315", "0.5419538", "0.5373642", "0.53581023", "0.52135694", "0.52077717", "0.51955456", "0.5175881", "0.5168965", "0.51355237", "0.5132147", "0.5078337", "0.5012203", "0.5005725", "0.5000258", "0.49781832", "0.4957174", "0.49488807", "0.4947396", "0.49424404", "0.4937087", "0.49337676", "0.493329", "0.49093768", "0.48948017", "0.48927814", "0.4889371", "0.48787996", "0.48457438", "0.4831416", "0.4830642", "0.48207584", "0.48149973", "0.48107395", "0.4801979", "0.4794184", "0.47827432", "0.4779777", "0.47691727", "0.47664702", "0.47464135", "0.47378278", "0.47297606", "0.47069854", "0.4694214", "0.46938196", "0.4692715", "0.46903172", "0.46818492", "0.46781692", "0.4674781", "0.46719906", "0.4671981", "0.4667247", "0.46656755", "0.46618667", "0.46605253", "0.46591666", "0.46582055", "0.46540326", "0.4652081", "0.46493477", "0.4646724", "0.4643566", "0.46435535", "0.46396813", "0.46361062", "0.46336815", "0.4633042", "0.46293172", "0.46247402", "0.46100262", "0.46074507", "0.4605148", "0.4601478", "0.45949316", "0.45902118", "0.45880944", "0.45875415", "0.45823067", "0.45793697", "0.4576849", "0.4574811", "0.45707208", "0.4570591", "0.45643428", "0.4562807", "0.45624527", "0.45624363", "0.45579612", "0.45573014", "0.45538732", "0.45535484", "0.4551283", "0.45469183", "0.4546097", "0.45451385", "0.45408112" ]
0.56994826
1
getAverageFund(int[]) Calculates the average frequency of multiple consecutive input lines, numbered from "firstInput" to "lastInput".
public float getAverageFund(int firstInput, int lastInput) { inputNumErrorCheck(firstInput, "getAverageFund(int, int) - first int"); inputNumErrorCheck(lastInput, "getAverageFund(int, int) - second int"); if (!(lastInput > firstInput)) { throw new IllegalArgumentException("InputClassJack.getAverageFund(): lastInput param " + lastInput + " is not greater than firstInput param " + firstInput); } // error checking int curInput = firstInput; // creates an array and fills it with the ints denoting the inputs from firstInput to lastInput: int[] inputsToAverage = new int[lastInput - firstInput + 1]; for (int i = 0; i < inputsToAverage.length; i++) { inputsToAverage[i] = curInput; curInput++; } // for // calculates the average by calling the other getAverageFund on the inputsToAverage array: return getAverageFund(inputsToAverage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getAverageAmp(int firstInput, int lastInput)\n\t{\n\t\tinputNumErrorCheck(firstInput, \"getAverageFund(int, int) - first int\");\n\t\tinputNumErrorCheck(lastInput, \"getAverageFund(int, int) - second int\");\n\t\tif (!(lastInput > firstInput)) { \n\t\t\tthrow new IllegalArgumentException(\"InputClassJack.getAverageFund(): lastInput param \" + lastInput + \" is not greater than firstInput param \" + firstInput);\n\t\t} // error checking\n\n\t\tint curInput = firstInput;\n\n\t\tint[] inputsToAverage = new int[lastInput - firstInput + 1];\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tinputsToAverage[i] = curInput;\n\t\t\tcurInput++;\n\t\t} // for\n\n\t\treturn getAverageAmp(inputsToAverage);\n\t}", "public float getAverageFund(int[] inputsToAverage)\n\t{\n\t\tif (inputsToAverage == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageFund: int[] parameter is null.\");\n\t\t} // error checking\n\t\tif (inputsToAverage.length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageFund: int[] parameter's length is \" + inputsToAverage.length + \"; must be at least 1.\");\n\t\t} // error checking\n\n\t\tfloat result = 0;\n\n\t\t// adds the freqencies of the specified inputs:\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tresult += this.getAdjustedFund(inputsToAverage[i]);\n\t\t} // for\n\n\t\t// divides to find the average:\n\t\treturn result/inputsToAverage.length;\n\t}", "float average(int[] input) {\n\t\tfloat average = 0;\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < input.length; index++) {\t\t//loop to get sum of numbers\n\t\t\tsum = sum + input[index];\n\t\t}\n\t\taverage = (float) sum / (input.length);\t\t//average calculation\n\t\treturn average;\n\t}", "static double averageDoubleArray(double[] inputArray) {\n\t\tdouble doubleSum = 00.00;\n\t\tfor (double element : inputArray) { \n\t\t\tdoubleSum += element;\n\t\t}\n\t\tdouble average = doubleSum / inputArray.length; \n\t\treturn average;\n\t}", "public double average(int first, int last){\n double final = 0;\n for(int i = first; i < last; i++){\n final += scores[i];\n }\n return final/(last-first+1);\n}", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "public static int average(int[]data){\n \n int sum = 0;\n int n = 0;\n for(int i = 0; i < data.length-1; i++) {\n \n n++;\n sum += data[i];\n }\n\n return sum/n;\n }", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }", "public static void main(String[] args) {\n int a[] = { 1, 6, 8, 9, 3, 4 };\n int count = 0;\n float Average;\n int size1 = a.length;\n for (int i = 0; i < size1; i++) {\n count = count + a[i];\n\n }\n Average = count / size1;\n System.out.println(\"Average of number is: \" + Average);\n\n }", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public float getAverageAmp(int[] inputsToAverage)\n\t{\n\t\tif (inputsToAverage == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageAmp: int[] parameter is null.\");\n\t\t} // error checking\n\t\tif (inputsToAverage.length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageAmp: int[] parameter's length is \" + inputsToAverage.length + \"; must be at least 1.\");\n\t\t} // error checking\n\n\t\tfloat result = 0;\n\n\t\tfor (int i : inputsToAverage) {\n\t\t\tresult += this.getAmplitude(i);\n\t\t} // for\n\n\t\treturn result/inputsToAverage.length;\n\t}", "public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }", "static double calculateAverage(int[] array) {\n\n double sum = 0;\n\n for (int i = 0; i < array.length; i++) {\n\n sum = sum + (double) array[i];\n\n\n }\n\n return sum / array.length;//returning average\n\n }", "public static double getAverage(int start, double[] d) {\n double average = 0;\n for (int i = 0; i < 110; i++) {\n average = average + d[i];\n }\n return average / 110;\n }", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "public static double calculateAverage (Scanner read){\n int sum = 0;\n int num;\n while(read.hasNextInt()){\n num = read.nextInt();\n sum += num;\n }\n \n return sum/5.0;\n }", "static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }", "public Integer average(int[] arr3){\n\t\tSystem.out.println(\"Get Average\");\n\t\tint sum = 0;\n\t\tfor(int d = 0; d < arr3.length; d++){\n\t\t\tsum += arr3[d];\n\t\t}\n\t\tSystem.out.println(sum/arr3.length);\n\t\treturn 0;\n\t}", "public int average(int[] array_of_notes){\r\n int avg=0;\r\n for (int array_of_note : array_of_notes) {\r\n avg += array_of_note;\r\n }\r\n avg /= array_of_notes.length;\r\n return avg;\r\n }", "public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}", "public void findAverage(int[] arr){\n int sum = 0;\n for(int val : arr){\n sum += val;\n }\n System.out.println( \"Average: \" + sum / arr.length);\n }", "public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }", "public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }", "public static double getAverage(int[] array) throws IOException {\r\n double arrayAverage = 0;\r\n arrayAverage = arrayTotal(array) / array.length;\r\n\r\n return arrayAverage;\r\n\r\n }", "public static double average(int[] theArray) {\n\n double answer;\n double sum = IntegerArrays.sum(theArray);\n answer = sum / theArray.length;\n\n return answer;\n\n }", "private static int getAverage(ArrayList<Integer> inList) \n\t{\n\t\tint add = 0; \n\t\tint mean = 0; \n\t\tfor(int pos = 0; pos < inList.size(); ++pos)\n\t\t{\n\t\t\tadd = add + inList.get(pos);\n\t\t\t\n\t\t}\n\t\t\n\t\tmean = add/inList.size(); \n\t\t\n\t\treturn mean; \n\t\t\n\t}", "public static double average(int[] arr)\n {\n // your code goes here\n\t\tdouble sum =0;\n int i;\n for(i=0;i< arr.length;i++)\n {\n sum+=arr[i];\n }\n\t\t\n\t\treturn sum/arr.length; \n\t}", "public static double average(Scanner s){\n\t\t\n\t\tint count = 0;\n\t\tint sum = 0;\n\t\t\n\t\twhile(s.hasNextInt()){\n\t\t\t\n\t\t\tsum += s.nextInt();\n\t\t\tcount++;\n\t\t} \n\t\t\n\t\treturn sum/(double)count; //type cast count to double to avoid integer division\n\n\t}", "public static double average (double ... numbers)\r\n\t{", "public static void calculateAverage(int[] inputArray, int limit)\r\n\t{\r\n\t\tIMovingAverage<Integer> movingAvg = new MovingAverageImpl<Integer>(limit);\r\n\t\tfor(int element : inputArray)\r\n\t\t{\r\n\t\t\tmovingAvg.add(element);\r\n\t\t\tSystem.out.println(\"Moving average is = \" +movingAvg.getAverage());\r\n\t\t}\r\n\t\tSystem.out.println(\"*********************************************************\");\r\n\t}", "public static void calculateAverage(double[] inputArray, int limit)\r\n\t{\r\n\t\tIMovingAverage<Double> movingAvg = new MovingAverageImpl<Double>(limit);\r\n\t\tfor(double element : inputArray)\r\n\t\t{\r\n\t\t\tmovingAvg.add(element);\r\n\t\t\tSystem.out.println(\"Moving average is = \" +movingAvg.getAverage());\r\n\t\t}\r\n\t\tSystem.out.println(\"*********************************************************\");\r\n\t}", "public static int average(int[] array){\n int sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "public double[] getAverages() {\n\t\t\n\t\t// initialize array\n\t\taverages = new double[5];\n\t\t\n\t\t// used with calcAverage for the startIndex\n\t\tint curIndex = 0;\n\t\taverages[ASSIGNMENTS] = calcAverage(curIndex, curIndex += NUM_ASSIGNMENTS);\n\t\taverages[QUIZZES] = calcAverage(curIndex, curIndex += NUM_QUIZZES);\n\t\taverages[TESTS] = calcAverage(curIndex, curIndex += NUM_TESTS);\n\t\taverages[FINAL] = calcAverage(curIndex, curIndex + 1);\n\t\t\n\t\t// get the overall average\n\t\tdouble quizTestAverage = (averages[QUIZZES] + averages[TESTS]) * PERCENT_QUIZ_AND_TESTS / 2;\n\t\tdouble assignmentAverage = averages[ASSIGNMENTS] * PERCENT_ASSIGNMENTS;\n\t\tdouble finalAverage = averages[FINAL] * PERCENT_FINAL;\n\t\taverages[OVERALL] = quizTestAverage + assignmentAverage + finalAverage;\n\t\t\n\t\t// return the array\n\t\treturn averages;\n\t}", "public static double average(double[] array){\n double sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tint[] numbers = new int[10];\r\n\t\tint difference, sum = 0;\r\n\t\tdouble mean;\r\n\r\n\t\tfor (int i = 0; i < numbers.length; i++) {\r\n\t\t\tnumbers[i] = scan.nextInt();\r\n\t\t}\r\n\t\tscan.close();\r\n\r\n\t\tfor (int i = 0; i < numbers.length - 1; i++) {\r\n\t\t\tdifference = Math.abs(numbers[i] - numbers[i + 1]);\r\n\t\t\tsum += difference;\r\n\t\t\tSystem.out.printf(\"%d \", difference);\r\n\t\t}\r\n\r\n\t\tmean = (double) sum / (numbers.length - 1);\r\n\t\tSystem.out.printf(\"\\nAverage of difference: %g\\n\", mean);\r\n\t}", "public static double avg(int[] arr) {\n double sum = 0.0;\n for (int a : arr) sum += a;\n return sum / arr.length;\n }", "public double getAverage(){\n return getTotal()/array.length;\n }", "private double calculateAverage(Candle[] cd) {\n double sum = 0; \r\n for(Candle c : cd) {\r\n sum += c.getClose();\r\n }\r\n return sum/cd.length;\r\n \r\n }", "double average();", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "public static void average(){\r\n\t\t//create a sccanner for input\r\n\t\tScanner scanner = new Scanner(System.in);\r\n\t\tdouble numInput,numTotal=0;\r\n\t\tint numNums=0;\r\n\t\t//ask the user for a number until they enter 0\r\n\t\twhile (true){\r\n\t\t\t//create ask the user for the amount\r\n\t\t\tSystem.out.println(\"Enter a number (0 to stop): \");\r\n\t\t\tnumInput = scanner.nextDouble();\r\n\t\t\tif (!(numInput==0)){\r\n\t\t\t\tnumNums+=1;\r\n\t\t\t\t//add together all inputed numbers\r\n\t\t\t\tnumTotal+=numInput;\r\n\t\t\t}else{\r\n\t\t\t\t//stop the while loop\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//find the average of the numbers\r\n\t\tdouble numAverage= numTotal/numNums;\r\n\t\tSystem.out.println(\"you entered \" + numNums + \" numbers and the average is \" + numAverage);\r\n\t\t\r\n\t}", "private double computeMean(List<Integer> intList) {\n double count = 0;\n for (Integer i : intList) {\n count += i;\n }\n return count / intList.size();\n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\t\n\t\t\n\t\tSystem.out.println(\"This program will find the average of any numbers \");\n\t\tSystem.out.println(\"Please enter the max number:\");\n\t\tint max = input.nextInt();\n\t\t\n\n\t\tint[]arr1 = new int[max+1];\n\t\t\n\t\tint i = 0;\n\t\tint counter = 0;\n\t\tint total = arr1[i]; \n\t\t//assign each array their number\n\t\twhile (i<max) {\n\t\t\t\n\t\tSystem.out.println(\"Please enter in \" + counter + \" number\" );\n\t\tarr1[i]=input.nextInt();\n\t\tcounter++;\n\t\ti++;\n\t\t//repeat statement and makes sure that the total is counted up.\n\t\t}\n\t\tSystem.out.println(\"The numbers being averaged: \");\n\t\tfor (i = 0; i < max; i++) {\n\t\t\t//makes sure that the displayed array is in rows of five\n\t\t\tif (i % 5 == 4)\n\t\t\t\tSystem.out.println(arr1[i] + \" \");\n\t\t\telse\n\t\t\t\tSystem.out.print(arr1[i] + \" \");\n\t\t\ttotal += arr1[i];\n\t\t\t\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\tSystem.out.println(\"Average is: \" + total/max);\n\t\t\n\t\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n double arr[] = new double[5];\r\n Scanner sc = new Scanner(System.in);\r\n for(int i=0;i<5;i++)\r\n {\r\n System.out.println(\"Enter a number\");\r\n arr[i]= sc.nextInt();\r\n \r\n }\r\n double sum =0;\r\n for(int i=0;i<5;i++) \r\n {\r\n \t sum = sum + arr[i];\r\n }\r\n System.out.println(\"The sum of the numbers are : \"+ sum);\r\n double avg = (sum/5.0);\r\n System.out.println(\"The average of the numbers are : \"+ avg);\r\n\t}", "public static double avgDoublesArray(double array[])\n\t{\n\t\tdouble avg = 0;\n\t\tfor (int i = 0; i < array.length; i++)\n\t\t\tavg += array[i];\n\t\t\n\t\tavg = avg / array.length;\n\t\treturn avg;\n\t}", "public static void main(String[] args) {\n\n ArrayList<Double> number = new ArrayList<>();\n Scanner in = new Scanner(System.in);\n System.out.println(\"Enter a number to calculate average\");\n\n String[] token = in.nextLine().split(\"\\\\s\");\n\n for (int i = 0; i < token.length; i++) {\n number.add(Double.parseDouble(token[i]));\n if (number.size() == 0) {\n System.out.println(\"No Average\");\n } else {\n double total = 0;\n for (double element :\n number) {\n\n\n total = total + element;\n }\n double average = total / number.size();\n System.out.println(\"the average is: \" + average);\n }\n }\n }", "public static double average(int[] mainArray) {\r\n\t\tdouble average = 0;\r\n\t\tfor (int counter = 0; counter < mainArray.length; counter ++) {\r\n\t\t\taverage += mainArray[counter];\r\n\t\t}\r\n\t\treturn (average / mainArray.length);\r\n\t}", "public static double averageOfNumbers(int n) {\n Scanner keyedInput = new Scanner(System.in);\n\n double total = 0;\n double[] values = new double[n];\n\n System.out.println(\"Please enter your values:\");\n for (int i = 0; i < n; i = i + 1) {\n values[i] = keyedInput.nextDouble();\n total = total + values[i];\n }\n double a = (double) Math.round((total / n) * 100) / 100;\n return a;\n }", "private double getAbsoluteAverage(double [] inputs){\n double result = 0;\n for (int i = 0; i < inputs.length; i++) {\n result+= Math.abs(inputs[i]);\n }\n result = result/inputs.length;\n return result;\n }", "public static void main(String[] args) {\r\n\t\tint ArraySize=0,sum=0;\r\n\t\tdouble average=0.0;\r\n\t\t\t\r\n\tScanner console=new Scanner(System.in);\r\n\tSystem.out.println(\"Please Enter size of an Array:\");\r\n\t\t\t\r\n\tArraySize=console.nextInt();\r\n\t\t\r\n\tint[] myArray=new int[ArraySize];\r\n\tSystem.out.println(\"Enter \" + ArraySize+ \" elements:\");\r\n\t\t for(int i=0;i<ArraySize;i++)\r\n\t\t {\r\n\t\t myArray[i]=console.nextInt();\r\n\t\t sum=sum+myArray[i];\r\n\t\t \t\r\n\t\t }\r\n\t\t \t\r\n\taverage=sum/ArraySize;\r\n\tSystem.out.println(\"Average is: \"+ average);\r\n\t\t\t\r\n\tconsole.close();\r\n\t\t\r\n\t}", "public double average()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tdouble sum = this.sum();\n\t\t\treturn sum / arraySize;\n\t\t}\n\t\tSystem.out.println(\"Syntax error, array is empty.\");\n\t\treturn -1;\n\t}", "public static void main(String[] args) {\n\n int[] array = new int[] {67,90,51,23,0,51};\n float sum= (float) 0;\n float arithmeticMean;\n\n for(int i = 0; i < array.length; ++i){\n if (array[i]!=0) sum=sum+array[i];\n else break;\n }\n\n arithmeticMean=sum/array.length;\n System.out.println(\"Sum of the array until it hits 0: \" +sum);\n System.out.println(\"Arithmetic mean until it hits 0: \" +arithmeticMean);\n }", "public void parseAverages(){\r\n\t\tfor(int i = 1; i < x.size(); i++){\r\n\t\t\tdouble avg = (x.get(i) + x.get(i-1)) / 2;\r\n\t\t\tx.set(i, avg);\r\n\t\t}\r\n\t}", "public static double average(int[] array) {\n\t\tif (array.length == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tdouble avg = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tavg += array[i];\n\t\t}\n\t\treturn avg / array.length;\n\t}", "public static double mean(double[] x){\n\n //Declares and intializes mean and total to 0;\n double mean = 0;\n double total = 0;\n\n //Takes the total of all the numbers in every index\n for(int i = 0; i < x.length; i++){\n total += x[i];\n }\n //Divides total by 10\n mean = total / 10;\n\n //returns mean\n return mean;\n\n }", "private static double meanVal(double[] arrayOfSamples){\n\t\tdouble total = 0;\n\t\t for (double i :arrayOfSamples){\n\t\t \ttotal += i;\n\t\t }\n\t return total/arrayOfSamples.length;\n\t}", "public static double avg(double[] array) {\r\n\t\tdouble ret = sum(array);\r\n\t\treturn ret / array.length;\r\n\t}", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "public static double getAverage(double[][] array)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tList<Double> lineSumList = new ArrayList<Double>();\r\n\t\tfor( int i = 0; i < array.length; i++ ) {\r\n\t\t\tdouble lineSum = Σ(array[i]);\r\n\t\t\tlineSumList.add(lineSum);\r\n\t\t\tcount += array[i].length;\r\n\t\t}\r\n\t\tdouble sum = Σ(lineSumList);\r\n\t\t\r\n\t\tif (sum == 0 || array.length == 0)\r\n\t\t\treturn 0;\r\n\t\treturn sum / count;\r\n\t}", "public static double method1(double[] numbers, Scanner input) {\r\n double sum = 0;\r\n System.out.print(\"enter the numbers: \");\r\n for (int i = 0; i < numbers.length; i++) {\r\n numbers[i] = input.nextDouble();\r\n sum += numbers[i];\r\n }\r\n\r\n return (sum / numbers.length);\r\n }", "public double calculateAverage(List<Integer> list) {\n double sum = 0;\n double avg = 0.0;\n try {\n if (list.isEmpty()) {\n throw new Exception(\"Empty List\");\n }\n\n //loop for values to calculate average\n for (Integer mark : list) {\n sum = sum + mark;\n }\n avg = sum / list.size();\n\n } catch (Exception e) {\n avg = 0.0;\n }\n return avg;\n }", "public static double getAverage(double[] dataArray) {\n\t\t\n\t\tdouble average = 0.0;\n\t\t\n\t\tfor (int i = 0; i <dataArray.length; i++) {\n\t\t\taverage += dataArray[i];\n\t\t}\n\t\t\n\t\taverage = average/dataArray.length;\n\t\t\n\t\treturn average;\n\t}", "public static double meanVal(int[] sample){\n double total = 0;\n for (int i = 0; i < sample.length; i++){\n total = total + sample[i];\n }\n double mean = total/sample.length;\n return mean;\n }", "private void calculateAverages(){\n for (int i=0; i<40; i=i+4){\n totalGoalsScored1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored1 = totalGoalsScored1/numberItems;\n //Total and average scored goals of team 2\n for (int i=2; i<40; i=i+4){\n totalGoalsScored2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored2 = totalGoalsScored2/numberItems;\n //Total and average received goals of team 1\n for (int i=1; i<40; i=i+4){\n totalGoalsReceived1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived1 = totalGoalsReceived1/numberItems;\n //Total and average received goals of team 2\n for (int i=3; i<40; i=i+4){\n totalGoalsReceived2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived2 = totalGoalsReceived2/numberItems;\n }", "public static void calculateAvg(double[] avgPArr, int itemNum) {\n\n for (int i = 0; i < avgPArr.length; i++)\n avgPArr[i] /= itemNum;\n\n }", "public static void main( String[] args )\n {\n \tScanner sc=new Scanner(System.in);\n\t\taverage a=()->{\n\t\t\tSystem.out.println(\"Enter no of elements\");\n\t\t\tint n=sc.nextInt();\n\t\t\tArrayList<Integer> a1=new ArrayList<Integer>();\n\t\t\tSystem.out.println(\"Enter\"+n+\" elements\");\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t{\n\t\t\t\tint z=sc.nextInt();\n\t\t\t\ta1.add(z);\n\t\t\t}\n\t\t\tint s=0;\n\t\t\tfor(Integer i:a1)\n\t\t\t{\n\t\t\t\ts=s+i;\n\t\t\t}\n\t\t\tfloat AvgOfList=(float)(s)/a1.size();\n\t\t\treturn AvgOfList;\n\t\t};\n\t\tSystem.out.println(\"Average of the list of given integers are:\"+a.avg());\n\t\tsc.close();\n }", "public static void main(String[] args) {\n\n float d = (float)sum(3.0f, (float)2.0);\n System.out.println(d);\n\n double d2=avg(3.0,2.0);\n System.out.println(d2);\n//\n// int[] list={1,2};\n// list={2,3};\n\n\n\n }", "public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }", "public double arithmeticalMean(double[] arr) {\n return 0;\n }", "public double getAverage(){\n int total = 0; //inicializa o total\n \n //soma notas de um aluno\n for(int grade: grades){\n total += grade;\n }\n \n return (double) total/grades.length;\n }", "public float calculateAverageHigh() {\n\t\t\n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tsum += temps[i][0];\n\t\treturn sum /= temps.length;\n\t\t\n\t}", "public static double average (double ... s4){\n double suma = 0.0;\n for (double value : s4) {\n suma += value;\n }\n return suma / s4.length;\n }", "private Tuple avgGradeReduce(List<Tuple> input) {\n int sum = 0;\n String className = input.get(0).fst();\n \n for(Tuple classAndGrade : input) {\n sum += Integer.parseInt(classAndGrade.snd());\n }\n \n Integer average = Math.round((float) sum / input.size());\n \n lolligag();\n \n // output <same class, average grade from all kids>\n return new Tuple(className, average.toString());\n }", "public double mean(double data[]) {\r\n\t\tdouble mean = 0;\r\n\t\ttry {\r\n\t\t\tfor(int i=0;i<data.length;i++) {\r\n\t\t\t\tmean =mean+data[i];\r\n\t\t\t}\r\n\t\t\tmean = mean / data.length;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tDataMaster.logger.warning(e.toString());\r\n\t\t\t//e.printStackTrace();\r\n\t\t}\r\n\t\treturn mean;\r\n\t}", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "static void solutionDay1Part1() {\n List<Integer> integerList = new ArrayList<Integer>(); // Defining an integer Array List\n Scanner myFile = null;\n int sum = 0;\n\n try {\n myFile = new Scanner(new FileReader(\"src/main/java/weekone/input01.txt\"));\n while (myFile.hasNext()) {\n integerList.add(myFile.nextInt());\n }\n for (int integer : integerList) {\n sum += integer;\n //System.out.println(sum);\n }\n System.out.println(\"Day 1 Part1 - The resulting frequency is: \" + sum);\n //Might be also possible using: System.out.println(IntStream.of(integerList).sum());\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (myFile != null) {\n myFile.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "private double calcAverage(int startIndex, int endIndex) {\n\t\t\n\t\t// total for the scores\n\t\tdouble total = 0;\n\t\t\n\t\t// loop between indexes and add the scores\n\t\tfor (int i = startIndex; i < endIndex; i++) \n\t\t\ttotal += scores.get(i);\n\t\t\n\t\t// return the average\n\t\treturn total / (endIndex - startIndex);\n\t}", "public static double findMean(ArrayList<Integer> arr) {\n\t\tint length = arr.size();\n\t\tint sum = 0;\n\t\tfor(int i : arr) { sum += i; }\n\t\treturn (double)sum/length;\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Give me five numbers:\");\n\n int number1 = sc.nextInt();\n System.out.println(number1);\n\n int number2 = sc.nextInt();\n System.out.println(number2);\n\n int number3 = sc.nextInt();\n System.out.println(number3);\n\n int number4 = sc.nextInt();\n System.out.println(number4);\n\n int number5 = sc.nextInt();\n System.out.println(number5);\n\n int[] myNumbers = {number1, number2, number3, number4, number5};\n System.out.println(\"Sum: \" + summing(myNumbers) + \", Average: \" + average(summing(myNumbers), myNumbers));\n }", "public static double getAverage(Number[] array)\r\n\t{\r\n\t\tdouble sum = Σ(array);\r\n\r\n\t\tif (sum == 0 || array.length == 0)\r\n\t\t\treturn 0;\r\n\t\treturn sum / array.length;\r\n\t}", "public static double getAverage(int[][] numbers) {\n int totalNumberOfElements = 10; // (2 rows * 5 column)\n return getTotal(numbers) / totalNumberOfElements;\n }", "public static double average(ArrayList<Double> nums){\n double sum = 0.0;\n for(Double num : nums){\n sum += num;\n }\n return sum / nums.size();\n }", "public static double getAverage(double[] array)\r\n\t{\r\n\t\tdouble sum = Σ(array);\r\n\r\n\t\tif (sum == 0 || array.length == 0)\r\n\t\t\treturn 0;\r\n\t\treturn sum / array.length;\r\n\t}", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public float calculateAverageLow() {\n\t\t\n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tsum += temps[i][1];\n\t\treturn sum /= temps.length;\n\t\t\n\t}", "private float calculateMean()\n { \n int numberEmployees = employees.size();\n float total = 0, meanGrossPay = 0;\n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n \n // Call method to return an array of float containing all gross pays\n allGrossPay = calculateAllGrossPay();\n // Find total gross pay\n for (int i = 0; i < numberEmployees; i++)\n {\n total += allGrossPay[i];\n }\n // Find mean and return it\n if (numberEmployees > 0)\n {\n meanGrossPay = total/numberEmployees;\n \n }\n return meanGrossPay;\n }", "public fuseAverage1(int[] sortedSnapshot) {\n\t\tthis.sortedSnapshot = sortedSnapshot;\n\t}", "public static long average(long[] arr) {\n if (arr.length == 0) return 0;\n long divideSum = 0;\n long modSum = 0;\n final long size = arr.length;\n \n for (int i = 0; i < arr.length; i++) {\n divideSum += arr[i] / size;\n modSum += arr[i] % size;\n }\n\n return divideSum - (size - 1) + (modSum + size * (size - 1)) / size;\n }", "public float[] accumulateSimpleSilentPeriodFiles(ArrayList<File> files){\r\n\t\t\tfloat[] values = new float[10];\r\n\t\t\tfloat[] returnValue = new float[10];\r\n\t\t\t\r\n\t\t for(File file:files){\t\t\t\t\t\r\n\t\t BufferedReader reader;\r\n\t\t try{\r\n\t\t reader = new BufferedReader(new FileReader(file));\r\n\t\t String line = reader.readLine(); \r\n\t\t while(line != null){\t\r\n\t\t \tif(!line.substring(0,1).equals(\"#\")){\r\n\t\t \t\tString[] values2 = line.split(\" \");\r\n\t\t \t\tSystem.out.println(file.getAbsolutePath());\r\n\t\t \t\tfor(int i = 1; i < values2.length; i++) {\r\n\t\t \t\t\tSystem.out.println(\"+ \" + values2[i]);\r\n\t\t \t\t\tvalues[i-1] += Float.valueOf(values2[i]);\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t \tline = reader.readLine();\r\n\t\t }\r\n\t\t \r\n\t\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\t System.err.println(\"FileNotFoundException: \" + e.getMessage());\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t System.err.println(\"Caught IOException: \" + e.getMessage());\r\n\t\t\t\t}\r\n\t\t }\r\n\r\n\t\t for(int j = 0; j < values.length; j++) if(values[j] != 0) returnValue[j] = (float)values[j]/files.size();\r\n\t\t \r\n\t\t return returnValue;\r\n\t\t}", "protected static double seqArraySum(final double[] input) {\n double sum = 0;\n\n // Compute sum of reciprocals of array elements\n for (int i = 0; i < input.length; i++) {\n sum += 1 / input[i];\n }\n\n return sum;\n }", "private float calculateAverage(List<Float> tempVoltages) {\r\n\t\t\r\n\t\tfloat runningTotal = 0;\r\n\t\tfor(float i : tempVoltages){\r\n\t\t\trunningTotal += i;\r\n\t\t}\r\n\t\trunningTotal /= tempVoltages.size();\r\n\t\treturn runningTotal;\r\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int sum = 0;\n System.out.print(\"Enter the first score: \");\n sum += input.nextInt();\n System.out.print(\"Enter the second score: \");\n sum += input.nextInt();\n System.out.print(\"Enter the third score: \");\n sum += input.nextInt();\n double average = sum/3;\n System.out.println(average);\n //print statement to test that things are working!\n //System.out.println(sum);\n //calculate the Average\n //output the data on the screen\n }", "private void calculateAvg() {\n\t\tDescriptiveStatistics stats = new DescriptiveStatistics();\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\tstats.addValue(oneQ.getGapCount() * oneQ.getFrequency());\n\t\t}\n\t\tthis.avgGain = stats.getMean();\n\t\tthis.medianGain = stats.getPercentile(50);\n\t\tthis.quartiles = stats.getPercentile(75);\n\t}", "public void run()throws IOException\n {\n /*\n * Data is read from the file using the Scanner class\n * As data is read, the average of the grades is calculated\n * \n */\n\n // Declare the arrays and variables\n\n int count; // count of students\n double sum; // sum of the grades\n double ave; \n String [] IDs = new String [20];\n Double [] grades = new Double [20];\n\n Scanner inputFile = new Scanner (new File (\"marks.txt\"));\n // reading the data from the file and calculating the average\n int i = 0; \n count = 0;\n sum = 0;\n while(inputFile.hasNext()) {\n IDs [i] = inputFile.next();\n grades [i] = inputFile.nextDouble();\n\n \n i++;\n\n }\n\n while (count < i) {\n sum+= grades[count];\n count++;\n }\n ave = sum / count;\n int i2 = 0;\n while (i2 < i) {\n System.out.println (IDs[i2] + \"\\t\" + grades[i2]);\n if (grades[i2] < ave) {\n System.out.println(\"Below average\");\n }else{\n if (grades[i2] == ave) {\n System.out.println(\"average\");\n } else {\n System.out.println(\"Above average\");\n }\n }\n i2++;\n }\n System.out.println (\"The average grade of \" + count + \" students is \" + ave);\n inputFile.close(); // closes the file\n\n \n }", "private double average(LinkedList<Double> lastSums2) {\n\t\tOptionalDouble average = lastSums2.stream().mapToDouble(a -> a).average();\n\t\treturn average.getAsDouble();\n\t}", "public static double meanOf(int... values) {\n/* 457 */ Preconditions.checkArgument((values.length > 0));\n/* 458 */ double mean = values[0];\n/* 459 */ for (int index = 1; index < values.length; index++) {\n/* 460 */ double value = values[index];\n/* 461 */ if (Doubles.isFinite(value) && Doubles.isFinite(mean)) {\n/* */ \n/* 463 */ mean += (value - mean) / (index + 1);\n/* */ } else {\n/* 465 */ mean = StatsAccumulator.calculateNewMeanNonFinite(mean, value);\n/* */ } \n/* */ } \n/* 468 */ return mean;\n/* */ }", "public static void main(String[] args) {\nScanner input=new Scanner(System.in);\nSystem.out.println(\"Please input the number of datus\");\nint n=input.nextInt();\nString[] name=new String[n];\nint[] data1=new int[n];\nint[] data2=new int[n];\nfor(int i=0;i<n;i++){\n\tname[i]=input.next();\n\tdata1[i]=input.nextInt();\n\tdata2[i]=input.nextInt();\n}\nfor(int i=0;i<n;i++)\nSystem.out.printf(\"|%4s|%4d|%4d|%6.3f|\\n\",name[i],data1[i],data2[i],(float)(data1[i]/data2[i]));\n\t}", "public double findAverage(int number1, int number2, int number3) {\n\t\tdouble avg = (double) ((number1 + number2 + number3) / 3.0);\t\t\n\t\tlong factor = (long) Math.pow(10, 2);\n\t\tavg = avg * factor;\n\t long tmp = Math.round(avg);\n\t return (double) tmp/factor;\n\t\t\n//\t\tString str = String.format(\"%.02f\", avg);\n\t}", "private int getMean(int[] times) {\n\n\t\t//Initialise mean and sum to 0\n\t\tint mean = 0;\n\t\tint sum = 0;\n\n\t\t//Loop through all the times\n\t\tfor (int i = 0; i < times.length; i++) {\n\n\t\t\t//Add to the sum\n\t\t\tsum += times[i];\n\t\t}\n\n\t\t//Calculate and return the mean\n\t\tmean = sum/times.length;\n\t\treturn mean;\n\t}", "public static double average(double number1, double number2, double number3) {\n\t\treturn (number1 + number2 + number3) / 2;\r\n\t\t\r\n\t}" ]
[ "0.74641323", "0.731869", "0.71004623", "0.6381667", "0.6301228", "0.6046715", "0.59225935", "0.59130466", "0.5886756", "0.58498716", "0.58349067", "0.5815215", "0.5813322", "0.58083934", "0.5803808", "0.5786409", "0.5776284", "0.57486093", "0.57190245", "0.5716025", "0.5698443", "0.56879306", "0.56842256", "0.56359196", "0.5599827", "0.5599008", "0.55761737", "0.5575891", "0.55723685", "0.5570814", "0.55352885", "0.5519004", "0.55180484", "0.55116034", "0.54858667", "0.5475355", "0.54716986", "0.5467396", "0.5453978", "0.54532164", "0.54475886", "0.5443829", "0.5439973", "0.5435862", "0.5434313", "0.54340583", "0.542762", "0.5408968", "0.54056036", "0.5388625", "0.5387129", "0.53744155", "0.53724724", "0.53568006", "0.53477484", "0.53278303", "0.5326616", "0.53088814", "0.5308017", "0.52985674", "0.52978575", "0.5291535", "0.5286347", "0.5264517", "0.5261882", "0.5253497", "0.5252413", "0.5247798", "0.524342", "0.52342707", "0.5230856", "0.5228322", "0.5218656", "0.5216041", "0.52072483", "0.520491", "0.51942533", "0.5187729", "0.5179568", "0.5165818", "0.51609075", "0.51465017", "0.5127692", "0.5123389", "0.51207125", "0.5116171", "0.5100853", "0.50941473", "0.50937796", "0.5085652", "0.50761276", "0.50736517", "0.5059994", "0.50563014", "0.5052833", "0.5051087", "0.5050491", "0.50501925", "0.50472325", "0.5047231" ]
0.77034783
0
getAverageFund Calculates the average frequency of multiple input lines.
public float getAverageAmp(int[] inputsToAverage) { if (inputsToAverage == null) { throw new IllegalArgumentException("Input_Jack.getAverageAmp: int[] parameter is null."); } // error checking if (inputsToAverage.length < 1) { throw new IllegalArgumentException("Input_Jack.getAverageAmp: int[] parameter's length is " + inputsToAverage.length + "; must be at least 1."); } // error checking float result = 0; for (int i : inputsToAverage) { result += this.getAmplitude(i); } // for return result/inputsToAverage.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getAverageFund(int[] inputsToAverage)\n\t{\n\t\tif (inputsToAverage == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageFund: int[] parameter is null.\");\n\t\t} // error checking\n\t\tif (inputsToAverage.length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageFund: int[] parameter's length is \" + inputsToAverage.length + \"; must be at least 1.\");\n\t\t} // error checking\n\n\t\tfloat result = 0;\n\n\t\t// adds the freqencies of the specified inputs:\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tresult += this.getAdjustedFund(inputsToAverage[i]);\n\t\t} // for\n\n\t\t// divides to find the average:\n\t\treturn result/inputsToAverage.length;\n\t}", "public float getAverageFund(int firstInput, int lastInput)\n\t{\n\t\tinputNumErrorCheck(firstInput, \"getAverageFund(int, int) - first int\");\n\t\tinputNumErrorCheck(lastInput, \"getAverageFund(int, int) - second int\");\n\t\tif (!(lastInput > firstInput)) { \n\t\t\tthrow new IllegalArgumentException(\"InputClassJack.getAverageFund(): lastInput param \" + lastInput + \" is not greater than firstInput param \" + firstInput);\n\t\t} // error checking\n\n\t\tint curInput = firstInput;\n\n\t\t// creates an array and fills it with the ints denoting the inputs from firstInput to lastInput:\n\t\tint[] inputsToAverage = new int[lastInput - firstInput + 1];\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tinputsToAverage[i] = curInput;\n\t\t\tcurInput++;\n\t\t} // for\n\n\t\t// calculates the average by calling the other getAverageFund on the inputsToAverage array:\n\t\treturn getAverageFund(inputsToAverage);\n\t}", "public float getAverageAmp(int firstInput, int lastInput)\n\t{\n\t\tinputNumErrorCheck(firstInput, \"getAverageFund(int, int) - first int\");\n\t\tinputNumErrorCheck(lastInput, \"getAverageFund(int, int) - second int\");\n\t\tif (!(lastInput > firstInput)) { \n\t\t\tthrow new IllegalArgumentException(\"InputClassJack.getAverageFund(): lastInput param \" + lastInput + \" is not greater than firstInput param \" + firstInput);\n\t\t} // error checking\n\n\t\tint curInput = firstInput;\n\n\t\tint[] inputsToAverage = new int[lastInput - firstInput + 1];\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tinputsToAverage[i] = curInput;\n\t\t\tcurInput++;\n\t\t} // for\n\n\t\treturn getAverageAmp(inputsToAverage);\n\t}", "double average();", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public static double calculateAverage (Scanner read){\n int sum = 0;\n int num;\n while(read.hasNextInt()){\n num = read.nextInt();\n sum += num;\n }\n \n return sum/5.0;\n }", "public double getAverage(){\n int total = 0; //inicializa o total\n \n //soma notas de um aluno\n for(int grade: grades){\n total += grade;\n }\n \n return (double) total/grades.length;\n }", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "public static void main(String[] args) {\n\n float d = (float)sum(3.0f, (float)2.0);\n System.out.println(d);\n\n double d2=avg(3.0,2.0);\n System.out.println(d2);\n//\n// int[] list={1,2};\n// list={2,3};\n\n\n\n }", "float average(int[] input) {\n\t\tfloat average = 0;\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < input.length; index++) {\t\t//loop to get sum of numbers\n\t\t\tsum = sum + input[index];\n\t\t}\n\t\taverage = (float) sum / (input.length);\t\t//average calculation\n\t\treturn average;\n\t}", "private double calculateAverage(Candle[] cd) {\n double sum = 0; \r\n for(Candle c : cd) {\r\n sum += c.getClose();\r\n }\r\n return sum/cd.length;\r\n \r\n }", "public void calcAvg(){\n\t\taverage = hits/atbat;\n\t\t\n\t}", "public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}", "public double getAverage(){\n return getTotal()/array.length;\n }", "public static double getAvg(String line){\n\t\tString[] parts = line.split(\"\\t\");\n\t\tdouble gamesPlayed = (Integer.parseInt(parts[1])) + (Integer.parseInt(parts[2]));\n\t\tdouble avg = (Integer.parseInt(parts[1])) / gamesPlayed;\n\t\treturn avg;\n\t}", "public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }", "public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }", "static double averageDoubleArray(double[] inputArray) {\n\t\tdouble doubleSum = 00.00;\n\t\tfor (double element : inputArray) { \n\t\t\tdoubleSum += element;\n\t\t}\n\t\tdouble average = doubleSum / inputArray.length; \n\t\treturn average;\n\t}", "double getAvgTreatment();", "static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }", "public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }", "private double getAvg() {\n\n double sum = 0;\n\n for (Map.Entry<Integer, Double> entry : values.entrySet()) {\n sum += entry.getValue();\n }\n\n if (values.size() > 0) {\n return sum / values.size();\n } else {\n throw new IllegalStateException(\"no values\");\n }\n }", "public double getAverage()\n {\n return getSum() / 2.0;\n }", "public double getAvgDraws() {\n\t\tdouble result = -1.0, sum = 0.0;\n\t\tint count = 0;\n\t\ttry {\n\t\t\tthis.rs = smt.executeQuery(\"SELECT SUM(drawCnt) FROM tp.gamerecord\");\n\t\t\tif(this.rs.next()) {\n\t\t\t\tsum = this.rs.getDouble(1) ;\n\t\t\t}\n\t\t\tthis.rs = smt.executeQuery(\"SELECT COUNT(id) FROM tp.gamerecord\");\n\t\t\tif(this.rs.next()) {\n\t\t\t\tcount = this.rs.getInt(1);\n\t\t\t\tresult = sum / count;\n\t\t\t}\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Query is Failed!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "private void calculateAvg() {\n\t\tDescriptiveStatistics stats = new DescriptiveStatistics();\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\tstats.addValue(oneQ.getGapCount() * oneQ.getFrequency());\n\t\t}\n\t\tthis.avgGain = stats.getMean();\n\t\tthis.medianGain = stats.getPercentile(50);\n\t\tthis.quartiles = stats.getPercentile(75);\n\t}", "public static void main(String[] args) {\n int a[] = { 1, 6, 8, 9, 3, 4 };\n int count = 0;\n float Average;\n int size1 = a.length;\n for (int i = 0; i < size1; i++) {\n count = count + a[i];\n\n }\n Average = count / size1;\n System.out.println(\"Average of number is: \" + Average);\n\n }", "public double getAverage(){\r\n\t\tdouble sum=0;\r\n\t\tfor(Iterator<T> it=this.iterator();it.hasNext();){\r\n\t\t\tsum+=it.next().doubleValue();\r\n\t\t}\r\n\t\treturn sum/this.size();\r\n\t}", "public double calculateAverage(List<Integer> list) {\n double sum = 0;\n double avg = 0.0;\n try {\n if (list.isEmpty()) {\n throw new Exception(\"Empty List\");\n }\n\n //loop for values to calculate average\n for (Integer mark : list) {\n sum = sum + mark;\n }\n avg = sum / list.size();\n\n } catch (Exception e) {\n avg = 0.0;\n }\n return avg;\n }", "@Override\n\tpublic double avg() {\n\t\treturn total()/4.0;\n\t}", "private void calculateAverages(){\n for (int i=0; i<40; i=i+4){\n totalGoalsScored1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored1 = totalGoalsScored1/numberItems;\n //Total and average scored goals of team 2\n for (int i=2; i<40; i=i+4){\n totalGoalsScored2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored2 = totalGoalsScored2/numberItems;\n //Total and average received goals of team 1\n for (int i=1; i<40; i=i+4){\n totalGoalsReceived1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived1 = totalGoalsReceived1/numberItems;\n //Total and average received goals of team 2\n for (int i=3; i<40; i=i+4){\n totalGoalsReceived2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived2 = totalGoalsReceived2/numberItems;\n }", "public float calculateAverageLow() {\n\t\t\n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tsum += temps[i][1];\n\t\treturn sum /= temps.length;\n\t\t\n\t}", "public float getAverage(){\r\n\t\treturn Average;\r\n\t}", "public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }", "public static double average (double ... s4){\n double suma = 0.0;\n for (double value : s4) {\n suma += value;\n }\n return suma / s4.length;\n }", "public double average() {\n double average = 0;\n for (int i = 0; i < studentList.size(); i++) {\n Student student = studentList.get(i);\n average += student.average();\n }\n average /= studentList.size();\n return average;\n }", "public static void main(String[] args) {\n\n ArrayList<Double> number = new ArrayList<>();\n Scanner in = new Scanner(System.in);\n System.out.println(\"Enter a number to calculate average\");\n\n String[] token = in.nextLine().split(\"\\\\s\");\n\n for (int i = 0; i < token.length; i++) {\n number.add(Double.parseDouble(token[i]));\n if (number.size() == 0) {\n System.out.println(\"No Average\");\n } else {\n double total = 0;\n for (double element :\n number) {\n\n\n total = total + element;\n }\n double average = total / number.size();\n System.out.println(\"the average is: \" + average);\n }\n }\n }", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "private float getAvg(Map<String, Float> m) {\n float avg = 0;\n ArrayList<Float> list = new ArrayList<>(m.values());\n for (float v : list) {\n avg += v;\n }\n return avg / list.size();\n }", "public double calculateAverage(List<Double> list, String s) {\n double sum = 0;\n double avg = 0.0;\n try {\n if (list.isEmpty()) {\n throw new Exception(\"Empty List\");\n }\n\n //loop for values to calculate average\n for (Double mark : list) {\n sum = sum + mark;\n }\n avg = sum / list.size();\n\n } catch (Exception e) {\n avg = 0.0;\n }\n return avg;\n }", "public double getAverageMarkPerModule(){\n return achievedMarks\n .stream()\n .mapToDouble(AchievedMark::getMark)\n .average()\n .getAsDouble();\n }", "public void parseAverages(){\r\n\t\tfor(int i = 1; i < x.size(); i++){\r\n\t\t\tdouble avg = (x.get(i) + x.get(i-1)) / 2;\r\n\t\t\tx.set(i, avg);\r\n\t\t}\r\n\t}", "public float calculateAverageHigh() {\n\t\t\n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tsum += temps[i][0];\n\t\treturn sum /= temps.length;\n\t\t\n\t}", "public static void computeAvg(functionRuntimes fRT)\r\n {\r\n\r\n }", "public synchronized double getAverage() {\n return average;\n }", "private float calculateMean()\n { \n int numberEmployees = employees.size();\n float total = 0, meanGrossPay = 0;\n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n \n // Call method to return an array of float containing all gross pays\n allGrossPay = calculateAllGrossPay();\n // Find total gross pay\n for (int i = 0; i < numberEmployees; i++)\n {\n total += allGrossPay[i];\n }\n // Find mean and return it\n if (numberEmployees > 0)\n {\n meanGrossPay = total/numberEmployees;\n \n }\n return meanGrossPay;\n }", "public void calculateAverageFmax(){\n ArrayList<Double> fmaxList = new ArrayList<Double>();//Used to determine the SD\n double fmaxSum = 0;\n int profileCount = 0;\n if (averageProfileList == null){\n return;\n }\n for (AverageProfile avProfile: averageProfileList){\n for(Profile profile: avProfile.getReplicateProfileList()){\n if(profile.hasAnLreWindowBeenFound() && !profile.isExcluded()){\n fmaxSum += profile.getFmax();\n profileCount++;\n fmaxList.add(profile.getFmax());\n }\n }\n }\n if (profileCount >= 1 && fmaxSum > 0){\n averageFmax = fmaxSum/profileCount;\n if(fmaxList.size()>1){\n avFmaxCV = MathFunctions.calcStDev(fmaxList)/averageFmax;\n }else{\n avFmaxCV = 0;\n }\n } else {\n averageFmax = 0;\n }\n }", "private static int getAverage(ArrayList<Integer> inList) \n\t{\n\t\tint add = 0; \n\t\tint mean = 0; \n\t\tfor(int pos = 0; pos < inList.size(); ++pos)\n\t\t{\n\t\t\tadd = add + inList.get(pos);\n\t\t\t\n\t\t}\n\t\t\n\t\tmean = add/inList.size(); \n\t\t\n\t\treturn mean; \n\t\t\n\t}", "public double getAverage(){\r\n\r\n\t\tdouble sum = 0.0;\r\n\t\tdouble average = 0.0;\r\n\r\n\t\tfor (int i = 0; i < grades.length; ++i)\r\n\t\t\tsum += grades[i];\r\n\t\taverage = sum /grades.length;\r\n\t\t\r\n\t\tString num = String.format(\"%.2f\", average);\r\n\t\tdouble formattedNumber = Double.parseDouble(num);\r\n\t\treturn formattedNumber;\r\n\r\n\t}", "private void calculateMean(float total){\r\n float averageBonds = total/accountInTotal;\r\n float averageAER = (averageBonds-startingBonds)/(startingBonds/100);\r\n\r\n Account averageAccount = new Account(startingBonds,averageBonds,averageAER);\r\n System.out.println(averageAccount.toString());\r\n\r\n }", "public double getAverageGrade(){\n double totalGrade = 0;\n double averageGrade = 0;\n // for loop to iterate over the array\n for(int i = 0; i<students.size(); i++){\n totalGrade += students.get(i).getGrades();\n } // end for\n \n averageGrade = totalGrade / students.size();\n return averageGrade;\n }", "public double getAverage(User user) throws Exception;", "public double getAverage() {\n int total = 0;\n\n // sum grades of the student\n for (int grade : grades)\n total += grade;\n\n // return average of the grade\n return (double) total / grades.length;\n }", "@Override\n public double findAverage() {\n double average = 0;\n for (Student key : map.keySet()) {\n average += map.get(key).getValue();\n }\n average /= map.keySet().size();\n return average;\n }", "private Tuple avgGradeReduce(List<Tuple> input) {\n int sum = 0;\n String className = input.get(0).fst();\n \n for(Tuple classAndGrade : input) {\n sum += Integer.parseInt(classAndGrade.snd());\n }\n \n Integer average = Math.round((float) sum / input.size());\n \n lolligag();\n \n // output <same class, average grade from all kids>\n return new Tuple(className, average.toString());\n }", "public List<KeyValue<Integer>> getAvg() {\n\t\tList<KeyValue<Integer>> result = new ArrayList<KeyValue<Integer>>();\n\t\tJavaRDD<Document> rdd = dal.getRDD();\n\t\tList<Tuple2<String, Iterable<Document>>> list = rdd.groupBy(new Function<Document, String>() {\n\t\t\t// 分组\n\t\t\t/**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic String call(Document v1) throws Exception {\n\t\t\t\tString province = v1.getString(\"province\");\n\t\t\t\tDouble price = v1.getDouble(\"unitPrice\");\n\t\t\t\tif (v1.getString(\"province\") != null && price > 0) {\n\t\t\t\t\treturn province;\n\t\t\t\t}\n\t\t\t\treturn \"other\";\n\t\t\t}\n\t\t}).collect();\n\t\tfor (Tuple2<String, Iterable<Document>> tuple2 : list) {\n\t\t\t// 循环遍历,统计平均数\n\t\t\tif (tuple2._1.equals(\"other\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tIterator<Document> iterator = tuple2._2.iterator();\n\t\t\tList<Double> prices = new ArrayList<Double>();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tprices.add(iterator.next().getDouble(\"unitPrice\"));\n\t\t\t}\n\t\t\tdouble sum = dal.getSparkContext().parallelize(prices).reduce(new Function2<Double, Double, Double>() {\n\n\t\t\t\t/**\n\t\t\t\t * \n\t\t\t\t */\n\t\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t\tpublic Double call(Double v1, Double v2) throws Exception {\n\t\t\t\t\treturn v1 + v2;\n\t\t\t\t}\n\t\t\t});\n\t\t\tresult.add(new KeyValue<Integer>(tuple2._1, (int) sum / prices.size()));\n\t\t}\n\t\t// dal.destroy();\n\t\treturn result;\n\t}", "private void computeAverageFrequencyDelayValue() {\n\tthis.averageFrequencyDelayValue = value * this.averageDelay;\n }", "public static double average(Scanner s){\n\t\t\n\t\tint count = 0;\n\t\tint sum = 0;\n\t\t\n\t\twhile(s.hasNextInt()){\n\t\t\t\n\t\t\tsum += s.nextInt();\n\t\t\tcount++;\n\t\t} \n\t\t\n\t\treturn sum/(double)count; //type cast count to double to avoid integer division\n\n\t}", "public double[] getAverages() {\n\t\t\n\t\t// initialize array\n\t\taverages = new double[5];\n\t\t\n\t\t// used with calcAverage for the startIndex\n\t\tint curIndex = 0;\n\t\taverages[ASSIGNMENTS] = calcAverage(curIndex, curIndex += NUM_ASSIGNMENTS);\n\t\taverages[QUIZZES] = calcAverage(curIndex, curIndex += NUM_QUIZZES);\n\t\taverages[TESTS] = calcAverage(curIndex, curIndex += NUM_TESTS);\n\t\taverages[FINAL] = calcAverage(curIndex, curIndex + 1);\n\t\t\n\t\t// get the overall average\n\t\tdouble quizTestAverage = (averages[QUIZZES] + averages[TESTS]) * PERCENT_QUIZ_AND_TESTS / 2;\n\t\tdouble assignmentAverage = averages[ASSIGNMENTS] * PERCENT_ASSIGNMENTS;\n\t\tdouble finalAverage = averages[FINAL] * PERCENT_FINAL;\n\t\taverages[OVERALL] = quizTestAverage + assignmentAverage + finalAverage;\n\t\t\n\t\t// return the array\n\t\treturn averages;\n\t}", "public void average(){\n\t\tfor(PlayerWealthDataAccumulator w : _wealthData.values()){\n\t\t\tw.average();\n\t\t}\n\t}", "public static double getAverage(int start, double[] d) {\n double average = 0;\n for (int i = 0; i < 110; i++) {\n average = average + d[i];\n }\n return average / 110;\n }", "private float averageBeat(){\n float avgBeat = 0f;\n List<Float> beatRed = DataManager.getInstance().getBeatRed();\n List<Float> beatIR = DataManager.getInstance().getBeatIR();\n\n for(int i = 0; i < beatRed.size() && i < beatIR.size(); i ++ ){\n chartFragment.addRedData(beatRed.get(i));\n chartFragment.addIRData(beatIR.get(i));\n avgBeat += beatRed.get(i);\n avgBeat += beatIR.get(i);\n }\n avgBeat = avgBeat / (beatRed.size() + beatIR.size());\n\n if (tcpTask != null )\n this.tcpTask.addData(\"\" + avgBeat);\n beatLabel.setText(\"Beat : \" + avgBeat);\n return avgBeat;\n }", "@Override\n\tpublic int avg() {\n\t\treturn (this.sum()/3);\n\t}", "public static void main(String[] args) {\n\r\n\t\t\t\tScanner Student_data = new Scanner(System.in);\r\n\t\t\t\tScanner Semester_Average = new Scanner(System.in);\r\n\r\n\t\t\t\tString name;\r\n\t\t\t\tString num;\r\n\t\t\t\tint age;\r\n\r\n\t\t\t\tfloat[] Material = new float[5];\r\n\t\t\t\tfloat SeAvg;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.print(\"أسمك أدخل : \");\r\n\t\t\t\t\tname = Student_data.nextLine();\r\n\r\n\t\t\t\t\tSystem.out.print(\"الأكاديمي رقمك أدخل : \");\r\n\t\t\t\t\tnum = Student_data.nextLine();\r\n\t\t\t\t\tSystem.out.print(\"عمرك أدخل : \");\r\n\t\t\t\t\tage = Student_data.nextInt();\r\n\r\n\t\t\t\t\tSystem.out.println(\"\\n الطالب معلومات \");\r\n\t\t\t\t\tSystem.out.println(\"الإسم : \" + name);\r\n\t\t\t\t\tSystem.out.println(\"الرقم : \" + num);\r\n\t\t\t\t\tSystem.out.println(\"العمر : \" + age);\r\n\t\t\t\t\tSystem.out.println(\"\");\r\n\r\n\t\t\t\t\tSystem.out.println(\"الفصلي معدلك لحساب التالية المواد في درجاتك أدخل : \");\r\n\t\t\t\t\tSystem.out.print(\"1 البرمجة أساسيات : \");\r\n\t\t\t\t\tMaterial[0] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"1 الإنترنت صفحات برمجة : \");\r\n\t\t\t\t\tMaterial[1] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"التعلم مهارات : \");\r\n\t\t\t\t\tMaterial[2] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"1 البيانات قواعد مبادئ : \");\r\n\t\t\t\t\tMaterial[3] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSystem.out.print(\"1 الحاسب تتطبيقات في مقدمة : \");\r\n\t\t\t\t\tMaterial[4] = Semester_Average.nextFloat();\r\n\t\t\t\t\tSeAvg = (Material[0] + Material[1] + Material[2] + Material[3] + Material[4]) / 100;\r\n\r\n\t\t\t\t\tif (SeAvg >= 2.95) {\r\n\t\t\t\t\t\tfor (double i = 0; i <= 10; i++) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"هو معدلك ناجح أنت مبروك ألف : \" + SeAvg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.println(\"هو معدلك !راسب أنت عذرا: \" + SeAvg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tDate currentDate = new Date();\r\n\t\t\t\t\tString D = currentDate.toString();\r\n\t\t\t\t\tSystem.out.println(\"اليوم تاريخ : \" + D);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tSystem.out.print(e.toString());\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tStudent_data.close();\r\n\t\t\t\t\tSemester_Average.close();\r\n\r\n\t\t\t\t\tdoSomething();\r\n\t\t\t\t}\r\n\t\t\t}", "public float calcAverage(){\n if(totalReviews > 0)\n return (float) (totalScore*1.0/totalReviews);\n else return 0;\n }", "public double findAverage(int number1, int number2, int number3) {\n\t\tdouble avg = (double) ((number1 + number2 + number3) / 3.0);\t\t\n\t\tlong factor = (long) Math.pow(10, 2);\n\t\tavg = avg * factor;\n\t long tmp = Math.round(avg);\n\t return (double) tmp/factor;\n\t\t\n//\t\tString str = String.format(\"%.02f\", avg);\n\t}", "public int getAverage() { return (int)Math.ceil(getSumOfMarks()/ numberOfCourses); }", "private double average(LinkedList<Double> lastSums2) {\n\t\tOptionalDouble average = lastSums2.stream().mapToDouble(a -> a).average();\n\t\treturn average.getAsDouble();\n\t}", "public static double average(double number1, double number2, double number3) {\n\t\treturn (number1 + number2 + number3) / 2;\r\n\t\t\r\n\t}", "public double average() {\n return average(0.0);\n }", "public static double getAvg(List<Integer> list) {\n int sum = 0;\n for (int i = 0; i != list.size(); ++i) {\n sum += list.get(i);\n }\n return (double)sum / list.size();\n }", "double getMeanProfit() {\n ArrayList<Double> allProfits = new ArrayList<>();\n\n for (Firm firm : firms) {\n List<Double> profitsOfFirm = firm.getProfits();\n allProfits.addAll(profitsOfFirm.subList(profitsOfFirm.size() - SimulationManager.sizeOfExaminationInterval, profitsOfFirm.size()));\n }\n\n return Calculation.round(Calculation.getMean(allProfits), 2);\n }", "public void sumAte()\r\n {\r\n meanArk = 0;\r\n varArk = 0;\r\n double sumA = 0;\r\n double sumA2 = 0;\r\n float nArk = 0;\r\n for (SignatureSample s:keys) {\r\n nArk++;\r\n sumA += s.arklen;\r\n sumA2 += s.arklen * s.arklen;\r\n }\r\n meanArk = sumA / nArk;\r\n varArk = Math.sqrt((sumA2/nArk) - (meanArk*meanArk));\r\n }", "public double average()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tdouble sum = this.sum();\n\t\t\treturn sum / arraySize;\n\t\t}\n\t\tSystem.out.println(\"Syntax error, array is empty.\");\n\t\treturn -1;\n\t}", "public static double getGenderAvgWage(String g) throws Exception\r\n\t{\r\n\t\tFile file=new File(\"Data/Peopledetails.txt\");\r\n\t\tfs=new Scanner(file);\r\n\t\tfs.useDelimiter(\",|\\\\r\\n\");\r\n\t\t\t\r\n\t\ttotalWage=0;\r\n\t\tcount=0;\r\n\t\t\r\n\t\t\t\t\t\t\r\n\t\twhile (fs.hasNext())\r\n\t\t{\r\n\t\t\tid=fs.nextInt();\r\n\t\t\tfname=fs.next();\r\n\t\t\tsname=fs.next();\r\n\t\t\tgen=fs.next();\r\n\t\t\thrate=fs.nextDouble();\r\n\t\t\thrs=fs.nextDouble();\r\n\t\t\t\r\n\t\t\tgross=hrs*hrate;\r\n\t\t\t\r\n\t\t\t//Calculates the overtime\r\n\t\t\tif(hrs>40)\r\n\t\t\t{\r\n\t\t\t\totime=hrs-40;\r\n\t\t\t\tstandard=40;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\totime=0;\r\n\t\t\t\tstandard=hrs;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgross=(standard*hrate+otime*hrate*1.5);\r\n\t\t\t\r\n\t\t\t/*if the gender is male, it takes the gross pay of that person, adds it to the total for male wages\r\n\t\t\tand also adds 1 to the male counter.*/\r\n\t\t\t//otherwise, adds it to the total for female wages and 1 to female counter.\r\n\t\t\tif(gen.equals(g))\r\n\t\t\t{\r\n\t\t\t\ttotalWage=gross+totalWage;\r\n\t\t\t\tcount+=1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfs.close();\r\n\t\treturn totalWage/count;\r\n\t}", "public float getAverageBetweenPoint(){\n return getMetric()/list.size();\n }", "public double getAverage()\n {\n if (test1 < 0 || test2 < 0)\n {\n System.out.println(\"Warning: one or more grades have not been entered.\");\n return -1;\n }\n return (test1 + test2) / 2;\n }", "private double calcAverage(int startIndex, int endIndex) {\n\t\t\n\t\t// total for the scores\n\t\tdouble total = 0;\n\t\t\n\t\t// loop between indexes and add the scores\n\t\tfor (int i = startIndex; i < endIndex; i++) \n\t\t\ttotal += scores.get(i);\n\t\t\n\t\t// return the average\n\t\treturn total / (endIndex - startIndex);\n\t}", "public static void calculateAvg(double[] avgPArr, int itemNum) {\n\n for (int i = 0; i < avgPArr.length; i++)\n avgPArr[i] /= itemNum;\n\n }", "private List<Double> sumMeanX(List<Business> business, double avg) {\n\t\tList<Double> sumMean = new ArrayList<Double>();\n\n\t\tfor (Business biz : business) {\n\t\t\tint price = biz.getPrice();\n\t\t\tsumMean.add(price - avg);\n\t\t}\n\t\treturn sumMean;\n\t}", "public double averagePrice() {\r\n\t\tdouble sum = 0;\r\n\t\tfor(Integer price : ticketPrice) {\r\n\t\t\tsum+=price;\r\n\t\t}\r\n\t\treturn sum/ticketPrice.size();\r\n\t}", "public double average(ArrayList<Double> x) {\n double sum = 0;\n double round;\n for (int i = 0; i < x.size(); i++) {\n sum += x.get(i);\n }\n round = sum / x.size() * 100;\n round = Math.round(round);\n round /= 100;\n return round;\n }", "public double getMean() {\n double timeWeightedSum = 0;\n\n for (int i = 0; i < accumulate.size() - 1; i++) {\n timeWeightedSum += accumulate.get(i).value\n * (accumulate.get(i + 1).timeOfChange\n - accumulate.get(i).timeOfChange);\n\n }\n LOG_HANDLER.logger.finer(\"timeWeightedSum Value: \" + timeWeightedSum\n + \"totalOfQuueueEntries: \" + totalOfQueueEntries);\n return timeWeightedSum / totalOfQueueEntries;\n }", "double getMeanPrice() {\n List<Double> allPrices = new ArrayList<>();\n\n for (Firm firm : firms) {\n List<Double> pricesOfFirm = firm.getPrices();\n allPrices.addAll(pricesOfFirm.subList(pricesOfFirm.size() - SimulationManager.sizeOfExaminationInterval, pricesOfFirm.size()));\n }\n\n return Calculation.round(Calculation.getMean(allPrices), 2);\n }", "public static double average(ArrayList<Double> nums){\n double sum = 0.0;\n for(Double num : nums){\n sum += num;\n }\n return sum / nums.size();\n }", "double getAvgControl();", "private float calculateAverage(List<Float> tempVoltages) {\r\n\t\t\r\n\t\tfloat runningTotal = 0;\r\n\t\tfor(float i : tempVoltages){\r\n\t\t\trunningTotal += i;\r\n\t\t}\r\n\t\trunningTotal /= tempVoltages.size();\r\n\t\treturn runningTotal;\r\n\t}", "public static double average(double[] array){\n double sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "public double average(int first, int last){\n double final = 0;\n for(int i = first; i < last; i++){\n final += scores[i];\n }\n return final/(last-first+1);\n}", "public static double getAverage(double[][] array)\r\n\t{\r\n\t\tint count = 0;\r\n\t\tList<Double> lineSumList = new ArrayList<Double>();\r\n\t\tfor( int i = 0; i < array.length; i++ ) {\r\n\t\t\tdouble lineSum = Σ(array[i]);\r\n\t\t\tlineSumList.add(lineSum);\r\n\t\t\tcount += array[i].length;\r\n\t\t}\r\n\t\tdouble sum = Σ(lineSumList);\r\n\t\t\r\n\t\tif (sum == 0 || array.length == 0)\r\n\t\t\treturn 0;\r\n\t\treturn sum / count;\r\n\t}", "static double calculateAverage(int[] array) {\n\n double sum = 0;\n\n for (int i = 0; i < array.length; i++) {\n\n sum = sum + (double) array[i];\n\n\n }\n\n return sum / array.length;//returning average\n\n }", "public double mean() {\n\t\tint n = this.getAttCount();\n\t\tif (n == 0) return Constants.UNUSED;\n\t\t\n\t\tdouble sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tdouble v = this.getValueAsReal(i);\n\t\t\tsum += v;\n\t\t}\n\t\t\n\t\treturn sum / (double)n;\n\t}", "public double getQuizAverage() {\r\n \r\n double[] quizScores = getLargestQuizGrades();\r\n double quizSum = 0;\r\n int quizzes = 0;\r\n \r\n for(double score : quizScores) {\r\n quizzes++;\r\n quizSum += score;\r\n }\r\n \r\n quizAverage = quizSum / quizzes; \r\n \r\n return quizAverage;\r\n }", "public ArrayList<Double> averageSalaries(){\n\t\tArrayList<Double> averageSalaries = new ArrayList<Double>();\n for(int i=0;i<allSalaries.size();i++) {\n \ttry {\n \t\tdouble averageEmployee=average(allSalaries.get(i));\n \t\taverageSalaries.add(averageEmployee);\n \t}catch(IllegalArgumentException e) {\n \t\tSystem.out.println(\"There is something wrong with input\");\n \t} \t\n\t\t}\n return averageSalaries;\n\t}", "private double computeMean(List<Integer> intList) {\n double count = 0;\n for (Integer i : intList) {\n count += i;\n }\n return count / intList.size();\n }", "public static double average (double ... numbers)\r\n\t{" ]
[ "0.7027379", "0.67035913", "0.63921094", "0.60790575", "0.59822947", "0.5978111", "0.5957249", "0.59510005", "0.59101045", "0.5873774", "0.58599967", "0.5837038", "0.5804571", "0.57671547", "0.5760113", "0.57499045", "0.5743125", "0.57397264", "0.5733449", "0.5733369", "0.57090384", "0.5686606", "0.56851864", "0.56473374", "0.5647026", "0.5636224", "0.56259793", "0.56184405", "0.561366", "0.5611317", "0.55998087", "0.555796", "0.555779", "0.55524004", "0.5551849", "0.55510503", "0.5545679", "0.554542", "0.5536243", "0.5527281", "0.55255014", "0.5511124", "0.5500935", "0.55002743", "0.54998213", "0.5490477", "0.5484092", "0.5483285", "0.54780793", "0.54756707", "0.54690486", "0.5464024", "0.54632634", "0.54414153", "0.5441111", "0.54369086", "0.54334795", "0.54301375", "0.54093504", "0.53945905", "0.53814363", "0.5379012", "0.5369863", "0.5363756", "0.5362848", "0.5361788", "0.53590447", "0.53523785", "0.53455055", "0.53436524", "0.53432614", "0.5329693", "0.5320104", "0.5314258", "0.5313185", "0.52933526", "0.5273072", "0.52645844", "0.52626836", "0.52600074", "0.5259981", "0.5259323", "0.52533245", "0.5252064", "0.5243009", "0.52391875", "0.5238377", "0.5230743", "0.5230315", "0.52263075", "0.5225886", "0.52243954", "0.52192694", "0.5204642", "0.5202504", "0.52012306", "0.5191254", "0.5183572", "0.51801", "0.51777023" ]
0.51916564
96
getAverageAmp Calculates the average amplitude of multiple consecutive input lines, numbered from "firstInput" to "lastInput".
public float getAverageAmp(int firstInput, int lastInput) { inputNumErrorCheck(firstInput, "getAverageFund(int, int) - first int"); inputNumErrorCheck(lastInput, "getAverageFund(int, int) - second int"); if (!(lastInput > firstInput)) { throw new IllegalArgumentException("InputClassJack.getAverageFund(): lastInput param " + lastInput + " is not greater than firstInput param " + firstInput); } // error checking int curInput = firstInput; int[] inputsToAverage = new int[lastInput - firstInput + 1]; for (int i = 0; i < inputsToAverage.length; i++) { inputsToAverage[i] = curInput; curInput++; } // for return getAverageAmp(inputsToAverage); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getAverageAmp(int[] inputsToAverage)\n\t{\n\t\tif (inputsToAverage == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageAmp: int[] parameter is null.\");\n\t\t} // error checking\n\t\tif (inputsToAverage.length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageAmp: int[] parameter's length is \" + inputsToAverage.length + \"; must be at least 1.\");\n\t\t} // error checking\n\n\t\tfloat result = 0;\n\n\t\tfor (int i : inputsToAverage) {\n\t\t\tresult += this.getAmplitude(i);\n\t\t} // for\n\n\t\treturn result/inputsToAverage.length;\n\t}", "public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "private double getAbsoluteAverage(double [] inputs){\n double result = 0;\n for (int i = 0; i < inputs.length; i++) {\n result+= Math.abs(inputs[i]);\n }\n result = result/inputs.length;\n return result;\n }", "public double getCurrentAmplitudeAvg() {\n return publicAvg;\n }", "public double average(int first, int last){\n double final = 0;\n for(int i = first; i < last; i++){\n final += scores[i];\n }\n return final/(last-first+1);\n}", "public float getAverageFund(int firstInput, int lastInput)\n\t{\n\t\tinputNumErrorCheck(firstInput, \"getAverageFund(int, int) - first int\");\n\t\tinputNumErrorCheck(lastInput, \"getAverageFund(int, int) - second int\");\n\t\tif (!(lastInput > firstInput)) { \n\t\t\tthrow new IllegalArgumentException(\"InputClassJack.getAverageFund(): lastInput param \" + lastInput + \" is not greater than firstInput param \" + firstInput);\n\t\t} // error checking\n\n\t\tint curInput = firstInput;\n\n\t\t// creates an array and fills it with the ints denoting the inputs from firstInput to lastInput:\n\t\tint[] inputsToAverage = new int[lastInput - firstInput + 1];\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tinputsToAverage[i] = curInput;\n\t\t\tcurInput++;\n\t\t} // for\n\n\t\t// calculates the average by calling the other getAverageFund on the inputsToAverage array:\n\t\treturn getAverageFund(inputsToAverage);\n\t}", "float average(int[] input) {\n\t\tfloat average = 0;\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < input.length; index++) {\t\t//loop to get sum of numbers\n\t\t\tsum = sum + input[index];\n\t\t}\n\t\taverage = (float) sum / (input.length);\t\t//average calculation\n\t\treturn average;\n\t}", "public void updateSMA(){\n audioInput.read(audioBuffer, 0, bufferSize);\n Complex [] FFTarr = doFFT(shortToDouble(audioBuffer));\n FFTarr = bandPassFilter(FFTarr);\n double sum = 0;\n for(int i = 0; i<FFTarr.length;i++){\n sum+=Math.abs(FFTarr[i].re()); // take the absolute value of the FFT raw value\n }\n double bandPassAverage = sum/FFTarr.length;\n Log.d(LOGTAG, \"bandPassAverage: \" + bandPassAverage);\n\n //Cut out loud samples, otherwise compute rolling average as usual\n if(bandPassAverage>THROW_OUT_THRESHOLD){\n mySMA.compute(mySMA.currentAverage());\n }else {\n mySMA.compute(bandPassAverage);\n }\n }", "public void parseAverages(){\r\n\t\tfor(int i = 1; i < x.size(); i++){\r\n\t\t\tdouble avg = (x.get(i) + x.get(i-1)) / 2;\r\n\t\t\tx.set(i, avg);\r\n\t\t}\r\n\t}", "static double averageDoubleArray(double[] inputArray) {\n\t\tdouble doubleSum = 00.00;\n\t\tfor (double element : inputArray) { \n\t\t\tdoubleSum += element;\n\t\t}\n\t\tdouble average = doubleSum / inputArray.length; \n\t\treturn average;\n\t}", "public static void calculateAverage(double[] inputArray, int limit)\r\n\t{\r\n\t\tIMovingAverage<Double> movingAvg = new MovingAverageImpl<Double>(limit);\r\n\t\tfor(double element : inputArray)\r\n\t\t{\r\n\t\t\tmovingAvg.add(element);\r\n\t\t\tSystem.out.println(\"Moving average is = \" +movingAvg.getAverage());\r\n\t\t}\r\n\t\tSystem.out.println(\"*********************************************************\");\r\n\t}", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public static double getAverage(int start, double[] d) {\n double average = 0;\n for (int i = 0; i < 110; i++) {\n average = average + d[i];\n }\n return average / 110;\n }", "public double getAverage(){\n return getTotal()/array.length;\n }", "@NonNull\n public static int[] averageAmplitude(@NonNull File file, int chunks)\n {\n byte[] bytes = Simple.readFileBytes(file);\n\n if (bytes == null)\n {\n return new int[]{};\n }\n\n //\n // In wav files the first 44 bytes are header information like file length, etc.\n // These 44 bytes need to be removed!\n //\n\n int[] data = new int[ (bytes.length - 44) / 2 ];\n\n for (int inx = 44; inx < bytes.length; inx += 2)\n {\n int index = inx - 44;\n\n //\n // wav format is pcm_s16le meaning that it is singed 16bit little endian.\n // two bytes need to be seen as an entity!\n //\n\n// ByteBuffer bb = ByteBuffer.allocate(2);\n// bb.order(ByteOrder.LITTLE_ENDIAN);\n// bb.put(bytes[inx]);\n// bb.put(bytes[inx + 1]);\n// short value = bb.getShort(0);\n short value = (short) ((bytes[inx + 1] & 0xFF) << 8 | (bytes[inx] & 0xFF));\n\n data[ index / 2 ] = (value < 0) ? value * -1 : value;\n }\n\n //\n // Calculate average\n //\n\n int[] averageAmpl = new int[chunks];\n int chunkSize = data.length / chunks;\n\n for (int inx = 0; inx < chunks; inx++)\n {\n int start = inx * chunkSize;\n\n int average = Simple.average(data, start, chunkSize);\n averageAmpl[ inx ] = average;\n }\n\n return averageAmpl;\n }", "private static int getAverage(ArrayList<Integer> inList) \n\t{\n\t\tint add = 0; \n\t\tint mean = 0; \n\t\tfor(int pos = 0; pos < inList.size(); ++pos)\n\t\t{\n\t\t\tadd = add + inList.get(pos);\n\t\t\t\n\t\t}\n\t\t\n\t\tmean = add/inList.size(); \n\t\t\n\t\treturn mean; \n\t\t\n\t}", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "public static double average (double ... s4){\n double suma = 0.0;\n for (double value : s4) {\n suma += value;\n }\n return suma / s4.length;\n }", "public float getAverageFund(int[] inputsToAverage)\n\t{\n\t\tif (inputsToAverage == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageFund: int[] parameter is null.\");\n\t\t} // error checking\n\t\tif (inputsToAverage.length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageFund: int[] parameter's length is \" + inputsToAverage.length + \"; must be at least 1.\");\n\t\t} // error checking\n\n\t\tfloat result = 0;\n\n\t\t// adds the freqencies of the specified inputs:\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tresult += this.getAdjustedFund(inputsToAverage[i]);\n\t\t} // for\n\n\t\t// divides to find the average:\n\t\treturn result/inputsToAverage.length;\n\t}", "double average();", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "public static double calculateAverage (Scanner read){\n int sum = 0;\n int num;\n while(read.hasNextInt()){\n num = read.nextInt();\n sum += num;\n }\n \n return sum/5.0;\n }", "public double getMean() \r\n\t{\r\n\t\tlong tmp = lastSampleTime - firstSampleTime;\r\n\t\treturn ( tmp > 0 ? sumPowerOne / (double) tmp : 0);\r\n\t}", "public void average() {\n\t\tif (averaged)\n\t\t\tthrow new AssertionError(\"can't average twice!!\");\n\t\t\n\t\tscale = 1.0/(double)t;\n\t\t\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i] = (t+1.0)*w[i] - wupdates[i];\n\t\t\n\t\taveraged = true;\n\t\n\t}", "public double getAverage(){\n int total = 0; //inicializa o total\n \n //soma notas de um aluno\n for(int grade: grades){\n total += grade;\n }\n \n return (double) total/grades.length;\n }", "public static void calculateAverage(int[] inputArray, int limit)\r\n\t{\r\n\t\tIMovingAverage<Integer> movingAvg = new MovingAverageImpl<Integer>(limit);\r\n\t\tfor(int element : inputArray)\r\n\t\t{\r\n\t\t\tmovingAvg.add(element);\r\n\t\t\tSystem.out.println(\"Moving average is = \" +movingAvg.getAverage());\r\n\t\t}\r\n\t\tSystem.out.println(\"*********************************************************\");\r\n\t}", "private int getMean(int[] times) {\n\n\t\t//Initialise mean and sum to 0\n\t\tint mean = 0;\n\t\tint sum = 0;\n\n\t\t//Loop through all the times\n\t\tfor (int i = 0; i < times.length; i++) {\n\n\t\t\t//Add to the sum\n\t\t\tsum += times[i];\n\t\t}\n\n\t\t//Calculate and return the mean\n\t\tmean = sum/times.length;\n\t\treturn mean;\n\t}", "public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }", "public double getWaveAvg() {\n\t\t\treturn avgWaveDist;\n\t\t}", "public double average()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tdouble sum = this.sum();\n\t\t\treturn sum / arraySize;\n\t\t}\n\t\tSystem.out.println(\"Syntax error, array is empty.\");\n\t\treturn -1;\n\t}", "public double getAverageAcceleration() {\n return (leftEnc.getAcceleration() + rightEnc.getAcceleration()) / 2;\n }", "private void calculateAvg() {\n\t\tDescriptiveStatistics stats = new DescriptiveStatistics();\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\tstats.addValue(oneQ.getGapCount() * oneQ.getFrequency());\n\t\t}\n\t\tthis.avgGain = stats.getMean();\n\t\tthis.medianGain = stats.getPercentile(50);\n\t\tthis.quartiles = stats.getPercentile(75);\n\t}", "public synchronized double getAverage() {\n return average;\n }", "public double average() {\n double average = 0;\n for (int i = 0; i < studentList.size(); i++) {\n Student student = studentList.get(i);\n average += student.average();\n }\n average /= studentList.size();\n return average;\n }", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }", "public double[] getAverages() {\n\t\t\n\t\t// initialize array\n\t\taverages = new double[5];\n\t\t\n\t\t// used with calcAverage for the startIndex\n\t\tint curIndex = 0;\n\t\taverages[ASSIGNMENTS] = calcAverage(curIndex, curIndex += NUM_ASSIGNMENTS);\n\t\taverages[QUIZZES] = calcAverage(curIndex, curIndex += NUM_QUIZZES);\n\t\taverages[TESTS] = calcAverage(curIndex, curIndex += NUM_TESTS);\n\t\taverages[FINAL] = calcAverage(curIndex, curIndex + 1);\n\t\t\n\t\t// get the overall average\n\t\tdouble quizTestAverage = (averages[QUIZZES] + averages[TESTS]) * PERCENT_QUIZ_AND_TESTS / 2;\n\t\tdouble assignmentAverage = averages[ASSIGNMENTS] * PERCENT_ASSIGNMENTS;\n\t\tdouble finalAverage = averages[FINAL] * PERCENT_FINAL;\n\t\taverages[OVERALL] = quizTestAverage + assignmentAverage + finalAverage;\n\t\t\n\t\t// return the array\n\t\treturn averages;\n\t}", "@Override\n\tpublic double avg() {\n\t\treturn total()/4.0;\n\t}", "public float calculateAverageLow() {\n\t\t\n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tsum += temps[i][1];\n\t\treturn sum /= temps.length;\n\t\t\n\t}", "private float calculateAverage(List<Float> tempVoltages) {\r\n\t\t\r\n\t\tfloat runningTotal = 0;\r\n\t\tfor(float i : tempVoltages){\r\n\t\t\trunningTotal += i;\r\n\t\t}\r\n\t\trunningTotal /= tempVoltages.size();\r\n\t\treturn runningTotal;\r\n\t}", "public double average() {\n return average(0.0);\n }", "static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }", "private double calcAverage(int startIndex, int endIndex) {\n\t\t\n\t\t// total for the scores\n\t\tdouble total = 0;\n\t\t\n\t\t// loop between indexes and add the scores\n\t\tfor (int i = startIndex; i < endIndex; i++) \n\t\t\ttotal += scores.get(i);\n\t\t\n\t\t// return the average\n\t\treturn total / (endIndex - startIndex);\n\t}", "public void calcAcceleration() {\n double firstSpeed = get(0).distanceTo(get(1)) / ((get(1).getTime() - get(0).getTime()) * INTER_FRAME_TIME);\n double lastSpeed = get(length() - 2).distanceTo(get(length() - 1))\n / ((get(length() - 1).getTime() - get(length() - 2).getTime()) * INTER_FRAME_TIME);\n avgAcceleration = (firstSpeed + lastSpeed) / ((get(length() - 1).getTime() - get(0).getTime()) * INTER_FRAME_TIME);\n }", "public double getAverage() {\n int total = 0;\n\n // sum grades of the student\n for (int grade : grades)\n total += grade;\n\n // return average of the grade\n return (double) total / grades.length;\n }", "public static double average(Scanner s){\n\t\t\n\t\tint count = 0;\n\t\tint sum = 0;\n\t\t\n\t\twhile(s.hasNextInt()){\n\t\t\t\n\t\t\tsum += s.nextInt();\n\t\t\tcount++;\n\t\t} \n\t\t\n\t\treturn sum/(double)count; //type cast count to double to avoid integer division\n\n\t}", "@Override\n\tpublic int avg() {\n\t\treturn (this.sum()/3);\n\t}", "public void calcAvg(){\n\t\taverage = hits/atbat;\n\t\t\n\t}", "void printAverageMeasurement(Station station, Sensor sensor, LocalDateTime since, LocalDateTime until, double average);", "public double updatePeriodic()\n {\n double Angle = getRawAngle();\n\n if (FirstCall)\n {\n AngleAverage = Angle;\n }\n\n AngleAverage -= AngleAverage / NumAvgSamples;\n AngleAverage += Angle / NumAvgSamples;\n\n return (AngleAverage);\n }", "private void PeriodMeanEvaluation () {\n\n float x = 0;\n for(int i = 0; i < 3; i++)\n {\n for(int j = 0; j < numberOfSample; j++)\n {\n x = x + singleFrame[j][i];\n }\n meanOfPeriodCoord[i] = (x/numberOfSample);\n x = 0;\n }\n }", "public float getAverage(){\r\n\t\treturn Average;\r\n\t}", "public double getAverage()\n {\n return getSum() / 2.0;\n }", "public double getAverage()\n {\n if (test1 < 0 || test2 < 0)\n {\n System.out.println(\"Warning: one or more grades have not been entered.\");\n return -1;\n }\n return (test1 + test2) / 2;\n }", "private void computeAverageFrequencyDelayValue() {\n\tthis.averageFrequencyDelayValue = value * this.averageDelay;\n }", "private double getAmpFactor(String imt) {\n\n\t\tString S = \".getAmpFactor()\";\n\n\t\t// get the PGA for B category\n\t\tcoeffBJF = (BJF_1997_AttenRelCoefficients) coefficientsBJF.get(PGA_Param.NAME);\n\t\tcoeffSM = (BJF_1997_AttenRelCoefficients) coefficientsSM.get(PGA_Param.NAME);\n\t\treturn getAmpFactor(imt, getRockMean());\n\t}", "public int average(int[] array_of_notes){\r\n int avg=0;\r\n for (int array_of_note : array_of_notes) {\r\n avg += array_of_note;\r\n }\r\n avg /= array_of_notes.length;\r\n return avg;\r\n }", "public double getAverage(){\r\n\r\n\t\tdouble sum = 0.0;\r\n\t\tdouble average = 0.0;\r\n\r\n\t\tfor (int i = 0; i < grades.length; ++i)\r\n\t\t\tsum += grades[i];\r\n\t\taverage = sum /grades.length;\r\n\t\t\r\n\t\tString num = String.format(\"%.2f\", average);\r\n\t\tdouble formattedNumber = Double.parseDouble(num);\r\n\t\treturn formattedNumber;\r\n\r\n\t}", "public double getMean() {\n double timeWeightedSum = 0;\n\n for (int i = 0; i < accumulate.size() - 1; i++) {\n timeWeightedSum += accumulate.get(i).value\n * (accumulate.get(i + 1).timeOfChange\n - accumulate.get(i).timeOfChange);\n\n }\n LOG_HANDLER.logger.finer(\"timeWeightedSum Value: \" + timeWeightedSum\n + \"totalOfQuueueEntries: \" + totalOfQueueEntries);\n return timeWeightedSum / totalOfQueueEntries;\n }", "public static void calculateAvg(double[] avgPArr, int itemNum) {\n\n for (int i = 0; i < avgPArr.length; i++)\n avgPArr[i] /= itemNum;\n\n }", "public double movingAverage(int periods, int t)\n {\n if(periods>t + 1 || periods<1)\n throw new IndexOutOfBoundsException(\"MA(\" + periods + \") is undefined at time \" + t);\n double sum = 0.0;\n for(int i = t - periods + 1; i<=t; i++)\n sum += x[i];\n return sum/periods;\n }", "public float calculateAverageHigh() {\n\t\t\n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tsum += temps[i][0];\n\t\treturn sum /= temps.length;\n\t\t\n\t}", "private double getAverage(Queue<Integer> q) {\r\n double average = 0;\r\n\r\n Iterator<Integer> it = q.iterator();\r\n while(it.hasNext()) {\r\n int current = it.next();\r\n average += current;\r\n if(!it.hasNext()) // last element\r\n average += current * LAST_MOVE_WEIGHT;\r\n }\r\n\r\n average /= MEMORY_SIZE + LAST_MOVE_WEIGHT;\r\n\r\n return average;\r\n }", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "public static double getAverage(double[] dataArray) {\n\t\t\n\t\tdouble average = 0.0;\n\t\t\n\t\tfor (int i = 0; i <dataArray.length; i++) {\n\t\t\taverage += dataArray[i];\n\t\t}\n\t\t\n\t\taverage = average/dataArray.length;\n\t\t\n\t\treturn average;\n\t}", "public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }", "public double getMean() throws IMRException {\n\n\t\tString imt = im.getName();\n\t\tif (!imt.equals(MMI_Param.NAME)) {\n\t\t\tupdateCoefficients();\n\t\t\tdouble b_mean = getRockMean();\n\t\t\tif (imt.equals(PGA_Param.NAME)) {\n\t\t\t\treturn b_mean + Math.log(getAmpFactor(im.getName(), b_mean));\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn b_mean + Math.log(getAmpFactor(im.getName()));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn Math.log(getMMI()); // return the log for now (until I figure a better way)\n\t\t}\n\n\t}", "double getAvgControl();", "public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}", "public double getAverageChainLength(){\r\n if (totalInsertionsLookups < 1){\r\n return 0;\r\n }\r\n return (double) totalChainLengths / (double) totalInsertionsLookups;\r\n }", "public double getAverage() {\n return this.average;\n }", "public static double average(double number1, double number2, double number3) {\n\t\treturn (number1 + number2 + number3) / 2;\r\n\t\t\r\n\t}", "public static double getAverage(int[] array) throws IOException {\r\n double arrayAverage = 0;\r\n arrayAverage = arrayTotal(array) / array.length;\r\n\r\n return arrayAverage;\r\n\r\n }", "public double mean() {\n\t\tint n = this.getAttCount();\n\t\tif (n == 0) return Constants.UNUSED;\n\t\t\n\t\tdouble sum = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tdouble v = this.getValueAsReal(i);\n\t\t\tsum += v;\n\t\t}\n\t\t\n\t\treturn sum / (double)n;\n\t}", "public static double getAvg(String line){\n\t\tString[] parts = line.split(\"\\t\");\n\t\tdouble gamesPlayed = (Integer.parseInt(parts[1])) + (Integer.parseInt(parts[2]));\n\t\tdouble avg = (Integer.parseInt(parts[1])) / gamesPlayed;\n\t\treturn avg;\n\t}", "public static double average (double ... numbers)\r\n\t{", "private double calculateAverage(Candle[] cd) {\n double sum = 0; \r\n for(Candle c : cd) {\r\n sum += c.getClose();\r\n }\r\n return sum/cd.length;\r\n \r\n }", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public String getAverage() {\n\t\treturn average;\n\t}", "public float getAmplitude() {\n/* 70 */ return this.amplitude;\n/* */ }", "public double mean() {\n double total = 0;\n for (int i = 0; i < sites.length; i++) {\n total += sites[i];\n }\n sampleMean = total / size / times;\n return sampleMean;\n }", "public double calcExamAverage(int examNum)\n\t{\n\t\tdouble average = 0.0;\n\t\tif (examNum != 1 && examNum != 2 && examNum != 3 && examNum != 4)\n\t\t\taverage = -1.0;\n\t\telse {\n\t\t\tdouble sum = 0.0;\n\t\t\tfor (int i = 0; i < numStudents; i++)\n\t\t\t\tsum += students[i].getExams()[examNum - 1];\n\t\t\taverage = (sum / numStudents);\n\t\t}\n\t\treturn average;\n\t}", "public double getAmperage() {\n\t\treturn this.amperage;\n\t}", "private static double meanVal(double[] arrayOfSamples){\n\t\tdouble total = 0;\n\t\t for (double i :arrayOfSamples){\n\t\t \ttotal += i;\n\t\t }\n\t return total/arrayOfSamples.length;\n\t}", "public double getAverage(){\r\n\t\tdouble sum=0;\r\n\t\tfor(Iterator<T> it=this.iterator();it.hasNext();){\r\n\t\t\tsum+=it.next().doubleValue();\r\n\t\t}\r\n\t\treturn sum/this.size();\r\n\t}", "private static double calculateMovingAverage(JsArrayNumber history) {\n double[] vals = new double[history.length()];\n long size = history.length();\n double sum = 0.0;\n double mSum = 0.0;\n long mCount = 0;\n\n // Check for sufficient data\n if (size >= 8) {\n // Clone the array and Calculate sum of the values\n for (int i = 0; i < size; i++) {\n vals[i] = history.get(i);\n sum += vals[i];\n }\n double mean = sum / size;\n\n // Calculate variance for the set\n double varianceTemp = 0.0;\n for (int i = 0; i < size; i++) {\n varianceTemp += Math.pow(vals[i] - mean, 2);\n }\n double variance = varianceTemp / size;\n double standardDev = Math.sqrt(variance);\n\n // Standardize the Data\n for (int i = 0; i < size; i++) {\n vals[i] = (vals[i] - mean) / standardDev;\n }\n\n // Calculate the average excluding outliers\n double deviationRange = 2.0;\n\n for (int i = 0; i < size; i++) {\n if (vals[i] <= deviationRange && vals[i] >= -deviationRange) {\n mCount++;\n mSum += history.get(i);\n }\n }\n\n } else {\n // Calculate the average (not enough data points to remove outliers)\n mCount = size;\n for (int i = 0; i < size; i++) {\n mSum += history.get(i);\n }\n }\n\n return mSum / mCount;\n }", "public float findFrequency(ArrayList<Float> wave){\n\r\n ArrayList<Float> newWave = new ArrayList<>();\r\n\r\n for(int i=0;i<wave.size()-4;i++){\r\n newWave.add((wave.get(i)+wave.get(i+1)+wave.get(i+2)+wave.get(i+4))/4f);\r\n }\r\n\r\n\r\n boolean isBelow = wave1.get(0)<triggerVoltage;\r\n\r\n ArrayList<Integer> triggerSamples = new ArrayList<>();\r\n\r\n\r\n System.out.println(\"starting f calc\");\r\n\r\n for(int i=1;i<newWave.size();i++){\r\n if(isBelow){\r\n if(newWave.get(i)>triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=false;\r\n }\r\n }else{\r\n if(newWave.get(i)<triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=true;\r\n }\r\n }\r\n }\r\n System.out.println(\"F len in \"+triggerSamples.size());\r\n\r\n ArrayList<Float> freqValues = new ArrayList<>();\r\n\r\n\r\n for(int i=0;i<triggerSamples.size()-2;i++){\r\n freqValues.add(1/(Math.abs(SecondsPerSample*(triggerSamples.get(i)-triggerSamples.get(i+2)))));\r\n }\r\n\r\n float finalAVG =0;\r\n for (Float f : freqValues) {\r\n finalAVG+=f;\r\n }\r\n finalAVG/=freqValues.size();\r\n\r\n\r\n return finalAVG;\r\n //System.out.println(finalAVG);\r\n }", "protected int getNumberAmps() {\n return nbrAMP;\n }", "public double findAverage(int number1, int number2, int number3) {\n\t\tdouble avg = (double) ((number1 + number2 + number3) / 3.0);\t\t\n\t\tlong factor = (long) Math.pow(10, 2);\n\t\tavg = avg * factor;\n\t long tmp = Math.round(avg);\n\t return (double) tmp/factor;\n\t\t\n//\t\tString str = String.format(\"%.02f\", avg);\n\t}", "public double getAverageMarkPerModule(){\n return achievedMarks\n .stream()\n .mapToDouble(AchievedMark::getMark)\n .average()\n .getAsDouble();\n }", "private double average(LinkedList<Double> lastSums2) {\n\t\tOptionalDouble average = lastSums2.stream().mapToDouble(a -> a).average();\n\t\treturn average.getAsDouble();\n\t}", "public double getAverageEncoderPosition()\n {\n \treturn ( Math.abs(leftBackTalon.getSelectedSensorPosition(0)) + Math.abs(rightBackTalon.getSelectedSensorPosition(0))) / 2;\n }", "public static int average(int[]data){\n \n int sum = 0;\n int n = 0;\n for(int i = 0; i < data.length-1; i++) {\n \n n++;\n sum += data[i];\n }\n\n return sum/n;\n }", "public double getAveDelta(double[] curr, double[] prev) {\n\t\tdouble aveDelta = 0;\n\t\tassert (curr.length == prev.length);\n\t\tfor (int j = 0; j < curr.length; j++) {\n\t\t\taveDelta += Math.abs(curr[j] - prev[j]);\n\t\t}\n\t\taveDelta /= curr.length;\n\t\treturn aveDelta;\n\t}", "public float getAverageBetweenPoint(){\n return getMetric()/list.size();\n }", "public Quantity<Q> getAverage() {\n return average;\n }", "public static double average(int[] theArray) {\n\n double answer;\n double sum = IntegerArrays.sum(theArray);\n answer = sum / theArray.length;\n\n return answer;\n\n }", "public double averageSteps() {\n if (day==0) return 0;\n return (double) totalSteps / day;}" ]
[ "0.73215204", "0.6119808", "0.6016132", "0.60141027", "0.6002055", "0.5913151", "0.5854882", "0.5748775", "0.57307106", "0.5666478", "0.56127906", "0.56057435", "0.5587365", "0.5540396", "0.5517262", "0.5514846", "0.55027217", "0.545824", "0.5452731", "0.5451797", "0.54492116", "0.54124135", "0.54099524", "0.53956026", "0.5389985", "0.5371015", "0.53696615", "0.5355566", "0.5355112", "0.5354189", "0.5341904", "0.53359646", "0.53242916", "0.53179926", "0.53050786", "0.53018713", "0.5301582", "0.52788097", "0.5261005", "0.5256103", "0.5254583", "0.5249495", "0.5247636", "0.5230493", "0.52278566", "0.5211267", "0.52082014", "0.51938313", "0.5188513", "0.5186989", "0.5174209", "0.5171454", "0.51709723", "0.5164582", "0.5157463", "0.5144829", "0.5120469", "0.5118942", "0.51172286", "0.5111148", "0.510559", "0.51047266", "0.51042426", "0.51015425", "0.5100107", "0.5090833", "0.50860846", "0.50810456", "0.50762504", "0.50675386", "0.50521266", "0.5051383", "0.50498724", "0.5045689", "0.50384545", "0.5033282", "0.503215", "0.5031448", "0.5026106", "0.5020519", "0.50198436", "0.5002046", "0.5001465", "0.50014293", "0.49922442", "0.49783373", "0.49780524", "0.49581987", "0.49522626", "0.49519035", "0.49117413", "0.4910643", "0.48945764", "0.48858163", "0.48754817", "0.487435", "0.48741332", "0.4872418", "0.48697093", "0.4867457" ]
0.79015476
0
getAverageAmp Setter for sensitivity float instance var.
public void setSensitivity(float newSensitivity) { this.sensitivity = newSensitivity; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getAmperage() {\r\n return amperage;\r\n }", "public double getCurrentAmplitudeAvg() {\n return publicAvg;\n }", "public double getAmperage() {\n\t\treturn this.amperage;\n\t}", "public double getWaveAvg() {\n\t\t\treturn avgWaveDist;\n\t\t}", "public float getAmplitude() {\n/* 70 */ return this.amplitude;\n/* */ }", "public float getAverage(){\r\n\t\treturn Average;\r\n\t}", "public float getAverageAmp(int[] inputsToAverage)\n\t{\n\t\tif (inputsToAverage == null) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageAmp: int[] parameter is null.\");\n\t\t} // error checking\n\t\tif (inputsToAverage.length < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Input_Jack.getAverageAmp: int[] parameter's length is \" + inputsToAverage.length + \"; must be at least 1.\");\n\t\t} // error checking\n\n\t\tfloat result = 0;\n\n\t\tfor (int i : inputsToAverage) {\n\t\t\tresult += this.getAmplitude(i);\n\t\t} // for\n\n\t\treturn result/inputsToAverage.length;\n\t}", "public void setAmperage(float amperage) {\r\n this.amperage = amperage;\r\n }", "public void setAmplitude(float amplitude) {\n/* 79 */ this.amplitude = amplitude;\n/* */ }", "double getAvgControl();", "public double getAvgGain() {\n\t\tif (avgGain == -1)\n\t\t\tthis.calculateAvg();\n\t\treturn avgGain;\n\t}", "public float getAvgSim() {\n return avgSim;\n }", "public void updateSMA(){\n audioInput.read(audioBuffer, 0, bufferSize);\n Complex [] FFTarr = doFFT(shortToDouble(audioBuffer));\n FFTarr = bandPassFilter(FFTarr);\n double sum = 0;\n for(int i = 0; i<FFTarr.length;i++){\n sum+=Math.abs(FFTarr[i].re()); // take the absolute value of the FFT raw value\n }\n double bandPassAverage = sum/FFTarr.length;\n Log.d(LOGTAG, \"bandPassAverage: \" + bandPassAverage);\n\n //Cut out loud samples, otherwise compute rolling average as usual\n if(bandPassAverage>THROW_OUT_THRESHOLD){\n mySMA.compute(mySMA.currentAverage());\n }else {\n mySMA.compute(bandPassAverage);\n }\n }", "public synchronized double getAverage() {\n return average;\n }", "public void setAvgSim(float avg) {\n avgSim = avg;\n }", "public int getMaxAmplitude() {\r\n\treturn MAX_AMPLITUDE;\r\n}", "public double getAverage() {\n return this.average;\n }", "@java.lang.Override\n public double getAvgControl() {\n return avgControl_;\n }", "public void setAmperage(double amperage) {\n\t\tthis.amperage = amperage;\n\t}", "@java.lang.Override\n public double getAvgControl() {\n return avgControl_;\n }", "public double getAvgAltValue() {\n return avgAltValue;\n }", "public double getAvgSpeedValue() {\n return avgSpeedValue;\n }", "private double getAmpFactor(String imt) {\n\n\t\tString S = \".getAmpFactor()\";\n\n\t\t// get the PGA for B category\n\t\tcoeffBJF = (BJF_1997_AttenRelCoefficients) coefficientsBJF.get(PGA_Param.NAME);\n\t\tcoeffSM = (BJF_1997_AttenRelCoefficients) coefficientsSM.get(PGA_Param.NAME);\n\t\treturn getAmpFactor(imt, getRockMean());\n\t}", "public double getMean() \r\n\t{\r\n\t\tlong tmp = lastSampleTime - firstSampleTime;\r\n\t\treturn ( tmp > 0 ? sumPowerOne / (double) tmp : 0);\r\n\t}", "public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }", "public IntegerProperty getControlAmplitude() {\n return this.inputAdjuster.getCurrentAmplitude();\n }", "public void average() {\n\t\tif (averaged)\n\t\t\tthrow new AssertionError(\"can't average twice!!\");\n\t\t\n\t\tscale = 1.0/(double)t;\n\t\t\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i] = (t+1.0)*w[i] - wupdates[i];\n\t\t\n\t\taveraged = true;\n\t\n\t}", "private void computeAverageFrequencyDelayValue() {\n\tthis.averageFrequencyDelayValue = value * this.averageDelay;\n }", "float getPreGain();", "public double getAverage(){\n return getTotal()/array.length;\n }", "public Float getAnswr() {\r\n return answr;\r\n }", "public double getAverage()\n {\n return getSum() / 2.0;\n }", "public double getAverageAcceleration() {\n return (leftEnc.getAcceleration() + rightEnc.getAcceleration()) / 2;\n }", "public double sampleVarianceOfMean() {\n\t\treturn sampleVariance() * getWeight();\n\t}", "@Override\n\tpublic double avg() {\n\t\treturn total()/4.0;\n\t}", "public double getMean(){\n\t\treturn Math.exp(location + scale * scale / 2);\n\t}", "float getPostGain();", "double getAvgTreatment();", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "public double average() {\n return average(0.0);\n }", "public double getAverageRate() {\n return (leftEnc.getRate() + rightEnc.getRate()) / 2;\n }", "public java.lang.String getAmpm() {\r\n return ampm;\r\n }", "public Float getAverageRating() {\n\t return this.averageRating;\n\t}", "public double mean() {\r\n\t\treturn mean;\r\n\t}", "public double mean() {\n\t\treturn mean;\n\t}", "public double mean() {\n\t\treturn mean;\n\t}", "public double getMean() {\n return mean;\n }", "public double mean() {\n return StdStats.mean(perThreshold);\n }", "public Quantity<Q> getAverage() {\n return average;\n }", "public double getAverageSpeed(int index) {\r\n return macroSpeed[index];\r\n }", "@Override\n\tpublic int avg() {\n\t\treturn (this.sum()/3);\n\t}", "public Double getMean() {\n return mean;\n }", "public double mean() {\n return mean;\n }", "public float getMicGainDb();", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "public float calculateAverageLow() {\n\t\t\n\t\tfloat sum = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tsum += temps[i][1];\n\t\treturn sum /= temps.length;\n\t\t\n\t}", "public Double getPressureAvg() {\r\n\t\treturn pressureAvg;\r\n\t}", "public ADSR(float maxAmp)\n\t{\n\t\tthis(maxAmp, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f);\n\t}", "public float getAverageAmp(int firstInput, int lastInput)\n\t{\n\t\tinputNumErrorCheck(firstInput, \"getAverageFund(int, int) - first int\");\n\t\tinputNumErrorCheck(lastInput, \"getAverageFund(int, int) - second int\");\n\t\tif (!(lastInput > firstInput)) { \n\t\t\tthrow new IllegalArgumentException(\"InputClassJack.getAverageFund(): lastInput param \" + lastInput + \" is not greater than firstInput param \" + firstInput);\n\t\t} // error checking\n\n\t\tint curInput = firstInput;\n\n\t\tint[] inputsToAverage = new int[lastInput - firstInput + 1];\n\t\tfor (int i = 0; i < inputsToAverage.length; i++)\n\t\t{\n\t\t\tinputsToAverage[i] = curInput;\n\t\t\tcurInput++;\n\t\t} // for\n\n\t\treturn getAverageAmp(inputsToAverage);\n\t}", "public double mean() {\n\t\treturn StdStats.mean(threshold);\n\t}", "public double getAverageEncoderPosition()\n {\n \treturn ( Math.abs(leftBackTalon.getSelectedSensorPosition(0)) + Math.abs(rightBackTalon.getSelectedSensorPosition(0))) / 2;\n }", "@Override\n\tpublic double getMean() {\n\t\treturn 1/this.lambda;\n\t}", "public final double getMean()\r\n\t{\r\n\t\treturn mean;\r\n\t}", "public double getRatingAverage() {\n return average;\n }", "public Vector3f getAttenuation() {\r\n\t\treturn this.attenuation;\r\n \t}", "public double mean() {\n return StdStats.mean(fraction);\n }", "public void setMaxAmplitudeZero(){ maxAmplitude=0; }", "public String getAverage() {\n\t\treturn average;\n\t}", "public void calcAvg(){\n\t\taverage = hits/atbat;\n\t\t\n\t}", "public double getAverageRating() {\n return averageRating;\n }", "public double getAverageRating() {\n return averageRating;\n }", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "public double getMean() throws IMRException {\n\n\t\tString imt = im.getName();\n\t\tif (!imt.equals(MMI_Param.NAME)) {\n\t\t\tupdateCoefficients();\n\t\t\tdouble b_mean = getRockMean();\n\t\t\tif (imt.equals(PGA_Param.NAME)) {\n\t\t\t\treturn b_mean + Math.log(getAmpFactor(im.getName(), b_mean));\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn b_mean + Math.log(getAmpFactor(im.getName()));\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn Math.log(getMMI()); // return the log for now (until I figure a better way)\n\t\t}\n\n\t}", "public double updatePeriodic()\n {\n double Angle = getRawAngle();\n\n if (FirstCall)\n {\n AngleAverage = Angle;\n }\n\n AngleAverage -= AngleAverage / NumAvgSamples;\n AngleAverage += Angle / NumAvgSamples;\n\n return (AngleAverage);\n }", "protected int getNumberAmps() {\n return nbrAMP;\n }", "public double getLightAbsorptionCoefficient(){\n return gamma;\n }", "public double mean() {\n return mu;\n }", "public float getAverageY(){\r\n\t\treturn AverageY;\r\n\t}", "public Builder setAvgControl(double value) {\n \n avgControl_ = value;\n onChanged();\n return this;\n }", "public double varianceOfMean() {\n\t\treturn variance() * getWeight();\n\t}", "public String getAverageSpeed() {\n return averageSpeed;\n }", "double average();", "public void setAnswr(Float answr) {\r\n this.answr = answr;\r\n }", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "@java.lang.Override\n public double getAvgTreatment() {\n return avgTreatment_;\n }", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public String getAmplitud() {\r\n return amplitud;\r\n }", "public Double getAveragePosition() {\r\n return averagePosition;\r\n }", "public double mean() {\n return StdStats.mean(stats);\r\n }", "public void setWavelength(float wavelength) {\n/* 61 */ this.wavelength = wavelength;\n/* */ }", "public double average() {\n double average = 0;\n for (int i = 0; i < studentList.size(); i++) {\n Student student = studentList.get(i);\n average += student.average();\n }\n average /= studentList.size();\n return average;\n }", "public float getWavelength() {\n/* 52 */ return this.wavelength;\n/* */ }", "public float getAverageBetweenPoint(){\n return getMetric()/list.size();\n }", "public void setEndAmp( float newEndAmp )\n\t{\n\t\tendAmp = newEndAmp;\n\t}", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public double getAverageScore() {\n\t return this.totalScore / this.count; \n\t }", "@java.lang.Override\n public double getAvgTreatment() {\n return avgTreatment_;\n }", "@Override\n\tpublic double mean() {\n\t\treturn 0;\n\t}", "public float getAverageLoad15() {\r\n return convert(averageLoad15);\r\n }", "public void amplitudeUpdate(AudioHandler handler, float amplitude) {\r\n slrAmplitude.setValue((int) (amplitude * slrAmplitude.getMaximum()));\r\n }", "private double getRockMean() {\n\n\t\tdouble mag, distanceJB;\n\t\tString fltTypeValue, willsSite;\n\t\tdouble rockVs30_SM = 620; // these values are from their code\n\t\tdouble rockVs30_BJF = 724;\n\n\t\ttry {\n\t\t\tmag = ( (Double) magParam.getValue()).doubleValue();\n\t\t\tdistanceJB = ( (Double) distanceJBParam.getValue()).doubleValue();\n\t\t\tfltTypeValue = fltTypeParam.getValue().toString();\n\t\t}\n\t\tcatch (NullPointerException e) {\n\t\t\tthrow new IMRException(C + \": getMean(): \" + ERR);\n\t\t}\n\n\t\t// check if distance is beyond the user specified max\n\t\tif (distanceJB > USER_MAX_DISTANCE) {\n\t\t\treturn VERY_SMALL_MEAN;\n\t\t}\n\n\t\t// Get b1 based on fault type\n\t\tdouble b1_BJF, b1_SM;\n\t\tif (fltTypeValue.equals(FLT_TYPE_STRIKE_SLIP)) {\n\t\t\tb1_BJF = coeffBJF.b1ss;\n\t\t\tb1_SM = coeffSM.b1ss;\n\t\t}\n\t\telse if (fltTypeValue.equals(FLT_TYPE_REVERSE)) {\n\t\t\tb1_BJF = coeffBJF.b1rv;\n\t\t\tb1_SM = coeffSM.b1rv;\n\t\t}\n\t\telse if (fltTypeValue.equals(FLT_TYPE_UNKNOWN)) {\n\t\t\tb1_BJF = coeffBJF.b1all;\n\t\t\tb1_SM = coeffSM.b1all;\n\t\t}\n\t\telse {\n\t\t\tthrow new ParameterException(C +\n\t\t\t\": getMean(): Invalid EqkRupture Parameter value for : FaultType\");\n\t\t}\n\n\t\t// Calculate the log rock-site mean for BJF\n\t\tdouble meanBJF = b1_BJF +\n\t\tcoeffBJF.b2 * (mag - 6) +\n\t\tcoeffBJF.b3 * (Math.pow( (mag - 6), 2)) +\n\t\tcoeffBJF.b5 *\n\t\t(Math.log(Math.pow( (distanceJB * distanceJB + coeffBJF.h * coeffBJF.h),\n\t\t\t\t0.5))) +\n\t\t\t\tcoeffBJF.bv * (Math.log(rockVs30_BJF / coeffBJF.va));\n\n\t\t// Calculate the log rock-site mean for SM\n\t\tdouble meanSM = b1_SM +\n\t\tcoeffSM.b2 * (mag - 6) +\n\t\tcoeffSM.b3 * (Math.pow( (mag - 6), 2)) +\n\t\tcoeffSM.b5 *\n\t\t(Math.log(Math.pow( (distanceJB * distanceJB + coeffSM.h * coeffSM.h),\n\t\t\t\t0.5))) +\n\t\t\t\tcoeffSM.bv * (Math.log(rockVs30_SM / coeffSM.va));\n\n\t\t//correct it max horizontal is desired\n\t\tComponent component = componentParam.getValue();\n\t\tif (component == Component.GREATER_OF_TWO_HORZ) {\n\t\t\tmeanSM += 0.139762; // add ln(1.15)\n\t\t\tmeanBJF += 0.139762;\n\t\t}\n\n\t\t// now return the appropriate mean\n\t\tif (mag <= 5) {\n\t\t\treturn meanSM;\n\t\t}\n\t\telse if (mag <= 5.5) {\n\t\t\treturn meanBJF + (mag - 5.5) * (meanBJF - meanSM) / 0.5;\n\t\t}\n\t\telse {\n\t\t\treturn meanBJF;\n\t\t}\n\t}" ]
[ "0.71875155", "0.7152373", "0.7108597", "0.6967648", "0.6818748", "0.6704281", "0.66838115", "0.6667907", "0.6626754", "0.6486324", "0.6406648", "0.6362146", "0.6342226", "0.6310732", "0.6276126", "0.6221241", "0.62095207", "0.6187064", "0.6166775", "0.61353946", "0.61215043", "0.61188227", "0.6116567", "0.6094447", "0.6092041", "0.60557353", "0.6045682", "0.60426295", "0.6032031", "0.6027998", "0.60273075", "0.6011619", "0.5996177", "0.5995748", "0.59585446", "0.59491795", "0.59459746", "0.59354204", "0.592242", "0.5911082", "0.5886685", "0.5853174", "0.5832444", "0.5818499", "0.5816774", "0.5816774", "0.5798639", "0.57905644", "0.578253", "0.57804924", "0.57791054", "0.5774866", "0.5773211", "0.57428795", "0.5738637", "0.5738014", "0.5729171", "0.5727982", "0.572037", "0.5719736", "0.57178265", "0.5717462", "0.5717284", "0.56970984", "0.56964666", "0.56769997", "0.56662047", "0.5662949", "0.5656778", "0.56529176", "0.56529176", "0.5652391", "0.5645616", "0.56261754", "0.56214577", "0.5620965", "0.55993885", "0.55848944", "0.5581783", "0.5578606", "0.5570259", "0.556859", "0.55537605", "0.5544057", "0.5532786", "0.55276006", "0.5521399", "0.55198866", "0.55195236", "0.5513037", "0.5508423", "0.5507672", "0.5498949", "0.54961777", "0.549034", "0.54861414", "0.5482601", "0.5481485", "0.5475592", "0.54639125", "0.5459654" ]
0.0
-1
/ This file is part of Beads. See for all information. CREDIT: This class uses portions of code taken from MEAP. See readme/CREDITS.txt. 07/02/2016 Emily Meuer Edited to allow access to amplitude, so classes using these Frequencies can cut out some background noise. package net.beadsproject.beads.analysis.featureextractors; / import beads.FeatureExtractor; import beads.TimeStamp;
public UGen[] getuGenArray() { return uGenArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FrequencyAnalysis()\n {\n }", "private FrequencyConverter() {\n }", "@Test\n public void test() {\n int packLength = 156;\n DFTMainFreqEncoder encoder = new DFTMainFreqEncoder(packLength);\n encoder.setMainFreqNum(2);\n List<float[]> packs;\n\n for (int i = 0; i < 1000; i++) {\n // encoder.encode(2*i+3*Math.cos(2*Math.PI*0.4*i));\n// encoder.encode(3 * Math.cos(2 * Math.PI * 0.4 * i));\n encoder.encode(12.5);\n }\n for (int i = 2001; i < 3000; i++) {\n encoder.encode(37.5 + 10 * Math.cos(2 * Math.PI * 0.4 * i));\n // encoder.encode(i);\n }\n for (int i = 3001; i < 4000; i++) {\n // encoder.encode(2*i+3*Math.cos(2*Math.PI*0.4*i));\n// encoder.encode(3 * Math.cos(2 * Math.PI * 0.4 * i));\n encoder.encode(12.5);\n }\n\n System.out.println(\"data: line\");\n packs = encoder.getPackFrequency();\n for (int i = 0; i < packs.size(); i++) {\n System.out.println(i * packLength + \"\\t~\\t\" + ((i + 1) * packLength - 1) + \"\\t\"\n + Arrays.toString(packs.get(i)));\n }\n GtEq<Float> gtEq = FilterFactory.gtEq(FilterFactory.floatFilterSeries(\"a\", \"b\", FilterSeriesType.FREQUENCY_FILTER),0.2f,true);\n assertTrue(encoder.satisfy(gtEq));\n encoder.resetPack();\n\n }", "public void trainFeatureList(){\n File trainFolder = new File(SoundEffectDemo.s_basePath);\n File[] trainList = trainFolder.listFiles();\n\n try {\n\n FileWriter fwMs = new FileWriter(s_msFeaturePath);\n FileWriter fwEnergy = new FileWriter(s_energyFeaturePath);\n FileWriter fwZc = new FileWriter(s_zcFeaturePath);\n FileWriter fwMfcc = new FileWriter(s_mfccFeaturePath);\n\n for (int i = 0; i < trainList.length; i++) {\n WaveIO waveIO = new WaveIO();\n short[] signal = waveIO.readWave(trainList[i].getAbsolutePath());\n\n // Extract Magnitude Spectrum\n MagnitudeSpectrum ms = new MagnitudeSpectrum();\n double[] msFeature = ms.getFeature(signal);\n \n String line = trainList[i].getName() + \"\\t\";\n for (double f: msFeature){\n line += f + \"\\t\";\n }\n fwMs.append(line+\"\\n\");\n \n // Extract Energy\n Energy energy = new Energy();\n double[] energyFeature = energy.getFeature(signal);\n \n String line2 = trainList[i].getName() + \"\\t\";\n for (double f: energyFeature){\n line2 += f + \"\\t\";\n }\n fwEnergy.append(line2+\"\\n\");\n \n // Extract Zero Crossing\n ZeroCrossing zc = new ZeroCrossing();\n double[] zcFeature = zc.getFeature(signal);\n \n String line3 = trainList[i].getName() + \"\\t\";\n for (double f: zcFeature){\n line3 += f + \"\\t\";\n }\n fwZc.append(line3+\"\\n\");\n \n // Extract mfcc\n MFCC mfcc = new MFCC(Frames.frameLength);\n mfcc.process(signal);\n double[] mfccFeature = mfcc.getMeanFeature();\n \n String line4 = trainList[i].getName() + \"\\t\";\n for (double f: mfccFeature){\n line4 += f + \"\\t\";\n }\n fwMfcc.append(line4+\"\\n\");\n \n System.out.println(\"@=========@\" + i);\n }\n fwMs.close();\n fwEnergy.close();\n fwZc.close();\n fwMfcc.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "float getFrequency();", "public abstract double samplingFrequency();", "public BasicFrequencyAnalysis(int NumberSamplesPerFrame, int OverlapSamplesNumber, double _samplingRate)\n {\n \tframeLength = NumberSamplesPerFrame;\n \tshiftInterval = OverlapSamplesNumber;\n \tsamplingRate = _samplingRate;\n }", "public int getFreq(){ return frequency;}", "public FeatureExtraction() {\n\t}", "public Frequency() {\n\n }", "public String getTapOccurrenceFeatures() {\n double[] linAccMeans = getMean(linAccSample);\n double[] linAccStdDevs = getStdDev(linAccSample);\n double[] linAccSkewness = getSkewness(linAccSample);\n double[] linAccKurtosis = getKurtosis(linAccSample);\n\n double linAcc1Norm = getL1Norm(linAccMatrix);\n double linAccInfNorm = getInfNorm(linAccMatrix);\n double linAccFroNorm = getFroNorm(linAccMatrix);\n double[] linAccNorms = new double[]{linAcc1Norm, linAccInfNorm, linAccFroNorm};\n\n // 15 gyroscope features\n double[] gyroMeans = getMean(gyroSample);\n double[] gyroStdDevs = getStdDev(gyroSample);\n double[] gyroSkewness = getSkewness(gyroSample);\n double[] gyroKurtosis = getKurtosis(gyroSample);\n\n double gyro1Norm = getL1Norm(gyroMatrix);\n double gyroInfNorm = getInfNorm(gyroMatrix);\n double gyroFroNorm = getFroNorm(gyroMatrix);\n double[] gyroNorms = new double[] {gyro1Norm, gyroInfNorm, gyroFroNorm};\n\n // 9 pearson features\n double[] pearsonCoeffs = getPearsonCoeff(linAccSample, gyroSample);\n\n double[] featureArray = merge(\n linAccMeans, linAccStdDevs, linAccSkewness, linAccKurtosis, linAccNorms,\n gyroMeans, gyroStdDevs, gyroSkewness, gyroKurtosis, gyroNorms,\n pearsonCoeffs);\n\n StringBuilder featureString = new StringBuilder();\n for (int i = 0; i < featureArray.length; i++) {\n featureString.append(i+1);\n featureString.append(':');\n featureString.append(featureArray[i]);\n featureString.append(' ');\n }\n return featureString.toString();\n }", "public static void calcuTFIDF() throws IOException {\n\n\t\tHashtable<String, Double> idf = new Hashtable<String, Double>();\n\t\tArrayList<String> terms = new ArrayList<String>();\n\t\tdouble fileCount = 0.0;\n\t\tString featurePath = \"./corpus/features\";\n\t\tString featureWeight = \"./corpus/featureWeight\";\n\t\tString trainPath = \"./corpus/trainData\";\n\t\tString testPath = \"./corpus/testData\";\n\t\tString stopPath = \"./corpus/english.stop\";\n\t\tString trainOutPath = \"./corpus/trainVectors\";\n\t\tString testOutPath = \"./corpus/testVectors\";\n\t\tBufferedReader br = new BufferedReader(new FileReader(featurePath));\n\t\tBufferedWriter featureWriter = new BufferedWriter(new FileWriter(\n\t\t\t\tfeatureWeight));\n\t\tBufferedReader trainReader = new BufferedReader(new FileReader(\n\t\t\t\ttrainPath));\n\t\tBufferedReader testReader = new BufferedReader(new FileReader(testPath));\n\t\tBufferedReader br2 = new BufferedReader(new FileReader(stopPath));\n\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(trainOutPath));\n\t\tBufferedWriter testWriter = new BufferedWriter(new FileWriter(\n\t\t\t\ttestOutPath));\n\t\tString oneline;\n\t\tArrayList<String> as = new ArrayList<String>();\n\t\twhile ((oneline = br2.readLine()) != null) {\n\t\t\tas.add(oneline);\n\t\t}\n\t\tString[] stopWords = new String[as.size()];\n\t\tas.toArray(stopWords);\n\t\tAnalyzer analyzer = new SnowballAnalyzer(\"English\", stopWords);\n\n\t\twhile ((oneline = br.readLine()) != null) {\n\t\t\tidf.put(oneline, 0.0);\n\t\t\tterms.add(oneline);\n\t\t}\n\n\t\twhile ((oneline = trainReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tfileCount++;\n\t\t\tHashtable<String, Integer> termList = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termList.containsKey(tmp))\n\t\t\t\t\ttermList.put(tmp, new Integer(1));\n\t\t\t}\n\t\t\tSet<String> keys = termList.keySet();\n\t\t\tfor (String tmp : keys) {\n\t\t\t\tif (idf.containsKey(tmp)) {\n\t\t\t\t\tDouble num = idf.get(tmp);\n\t\t\t\t\tidf.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (String term : terms) {\n\n\t\t\tdouble weightOfTerm = Math.log((double) fileCount / idf.get(term)\n\t\t\t\t\t+ 0.01);\n\t\t\tfeatureWriter.write(term + \" \" + weightOfTerm);\n\t\t\tfeatureWriter.newLine();\n\t\t\tidf.put(term, weightOfTerm);\n\n\t\t}\n\t\tfeatureWriter.flush();\n\t\tfeatureWriter.close();\n\n\t\ttrainReader = new BufferedReader(new FileReader(trainPath));\n\t\twhile ((oneline = trainReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tHashtable<String, Integer> termFrequent = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termFrequent.containsKey(tmp))\n\t\t\t\t\ttermFrequent.put(tmp, new Integer(1));\n\t\t\t\telse {\n\t\t\t\t\tInteger num = termFrequent.get(tmp);\n\t\t\t\t\ttermFrequent.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdouble weights[] = new double[terms.size()];\n\t\t\tdouble denominator = 0.0;\n\t\t\tint i = 0;\n\t\t\tfor (String term : terms) {\n\t\t\t\tdouble count;\n\t\t\t\tif (termFrequent.containsKey(term)) {\n\t\t\t\t\tcount = termFrequent.get(term);\n\t\t\t\t} else {\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\n\n\t\t\t\tdouble tmp = count * idf.get(term);\n\t\t\t\tdenominator += tmp;\n\t\t\t\tweights[i++] = tmp;\n\t\t\t}\n\t\t\tdenominator = Math.sqrt(denominator);\n\t\t\twriter.write(topic);\n\t\t\tfor (int j = 1; j <= weights.length; j++) {\n\t\t\t\tdouble tmp = weights[j - 1];\n\t\t\t\tif (tmp > 0.0) {\n\t\t\t\t\ttmp = Math.sqrt(tmp) / denominator;\n\t\t\t\t\twriter.write(\" \" + j + \":\" + tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.newLine();\n\t\t}\n\n\t\twhile ((oneline = testReader.readLine()) != null) {\n\n\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\tString topic = oneline.substring(0, pos);\n\t\t\tString content = oneline.substring(pos + 1);\n\t\t\tHashtable<String, Integer> termFrequent = new Hashtable<String, Integer>();\n\t\t\tTokenStream stream = analyzer.tokenStream(\"\", new StringReader(\n\t\t\t\t\tcontent));\n\t\t\twhile (true) {\n\t\t\t\tToken token = stream.next();\n\t\t\t\tif (token == null)\n\t\t\t\t\tbreak;\n\t\t\t\tString tmp = token.termText();\n\t\t\t\tif (!termFrequent.containsKey(tmp))\n\t\t\t\t\ttermFrequent.put(tmp, new Integer(1));\n\t\t\t\telse {\n\t\t\t\t\tInteger num = termFrequent.get(tmp);\n\t\t\t\t\ttermFrequent.put(tmp, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdouble weights[] = new double[terms.size()];\n\t\t\tdouble denominator = 0.0;\n\t\t\tint i = 0;\n\t\t\tfor (String term : terms) {\n\t\t\t\tdouble count;\n\t\t\t\tif (termFrequent.containsKey(term)) {\n\t\t\t\t\tcount = termFrequent.get(term);\n\t\t\t\t} else {\n\t\t\t\t\tcount = 0;\n\t\t\t\t}\n\t\t\t\tdouble tmp = count * idf.get(term);\n\t\t\t\tdenominator += tmp;\n\t\t\t\tweights[i++] = tmp;\n\t\t\t}\n\t\t\tdenominator = Math.sqrt(denominator);\n\t\t\ttestWriter.write(topic);\n\t\t\tfor (int j = 1; j <= weights.length; j++) {\n\t\t\t\tdouble tmp = weights[j - 1];\n\t\t\t\tif (tmp > 0.0) {\n\t\t\t\t\ttmp = Math.sqrt(tmp) / denominator;\n\t\t\t\t\ttestWriter.write(\" \" + j + \":\" + tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestWriter.newLine();\n\t\t}\n\t\twriter.close();\n\t\ttestWriter.close();\n\t}", "public static void main(String[] args) throws Exception {\n\t\tgetFragmentFreq();\n\t}", "int getFreq();", "private void getFrequency(){\r\n try {\r\n BufferedReader reader = new BufferedReader(new FileReader(IConfig.FREQUENCY_PATH));\r\n String line;\r\n while((line = reader.readLine()) != null){\r\n frequency.put(line.split(\" \")[0], (Double.parseDouble(line.split(\" \")[1])/ IConfig.TOTAL_NEWS));\r\n }\r\n reader.close();\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "public int getFrequency(){\n return this.frequency;\n }", "public float findFrequency(ArrayList<Float> wave){\n\r\n ArrayList<Float> newWave = new ArrayList<>();\r\n\r\n for(int i=0;i<wave.size()-4;i++){\r\n newWave.add((wave.get(i)+wave.get(i+1)+wave.get(i+2)+wave.get(i+4))/4f);\r\n }\r\n\r\n\r\n boolean isBelow = wave1.get(0)<triggerVoltage;\r\n\r\n ArrayList<Integer> triggerSamples = new ArrayList<>();\r\n\r\n\r\n System.out.println(\"starting f calc\");\r\n\r\n for(int i=1;i<newWave.size();i++){\r\n if(isBelow){\r\n if(newWave.get(i)>triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=false;\r\n }\r\n }else{\r\n if(newWave.get(i)<triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=true;\r\n }\r\n }\r\n }\r\n System.out.println(\"F len in \"+triggerSamples.size());\r\n\r\n ArrayList<Float> freqValues = new ArrayList<>();\r\n\r\n\r\n for(int i=0;i<triggerSamples.size()-2;i++){\r\n freqValues.add(1/(Math.abs(SecondsPerSample*(triggerSamples.get(i)-triggerSamples.get(i+2)))));\r\n }\r\n\r\n float finalAVG =0;\r\n for (Float f : freqValues) {\r\n finalAVG+=f;\r\n }\r\n finalAVG/=freqValues.size();\r\n\r\n\r\n return finalAVG;\r\n //System.out.println(finalAVG);\r\n }", "void hit(int frequency, double duration, double amplitude){\r\n \tSystem.out.println(\"Frequency: \"+frequency+\", Duration: \"+duration+\", Amplitude: \"+amplitude);\r\n \t\r\n\r\n\t\tadder.inputA.set(frequency); //fc !!!\r\n\t\tvibrato.frequency.set( frequency+80 ); // fm!!!\r\n\t\tvibrato.amplitude.set( (frequency+80)*2 ); // fm*2!!!\r\n \t\r\n\t\tint i=0;\r\n\t\tdata[i++] = 0.01;\t\t\t// Duration of first segment. \r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.13; \t// duration\r\n\t\t\tamplitude/=2;\r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata[i++] = amplitude; \t\t// value \r\n\t\tdata[i++] = duration*0.4; \t// duration \r\n\t\tdata[i++] = 0.0; \t\t\t// value \r\n\r\n\t\ti = 0;\r\n\t\tamplitude = 280*2;\r\n\t\tdata2[i++] = 0.01;\t\t\t// Duration of first segment. \r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.13; \t// duration\r\n\t\t\tamplitude/=2;\r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.23; \t// duration \r\n\t\t\tamplitude/=2;\r\n\t\tdata2[i++] = amplitude; \t\t// value \r\n\t\tdata2[i++] = duration*0.4; \t// duration \r\n\t\tdata2[i++] = 0.0; \t\t\t// value \r\n\r\n\t\tenvData.write( 0, data, 0, i/2 );\r\n\t\tenvData2.write( 0, data2, 0, i/2 );\r\n \tenvPlayer.envelopePort.clear();\r\n \tenvPlayer2.envelopePort.clear();\r\n \tenvPlayer.envelopePort.queue( envData, 0, i/2 );\r\n \tenvPlayer2.envelopePort.queue( envData2, 0, i/2 );\r\n }", "public static void main(String[] args) throws Exception {\n\t\ttrainingInstances = StanceDetectionDataReader\r\n\t\t\t\t.readInstancesFromArff(ProjectPaths.ARFF_DATA_PATH + \"Ferr_doc2vec_train09-19_11-55.arff\");\r\n\t\tunlabtestInstances = StanceDetectionDataReader\r\n\t\t\t\t.readInstancesFromArff(ProjectPaths.ARFF_DATA_PATH + \"Ferr_doc2vec_unlabeled_test09-19_11-55.arff\");\r\n\t\r\n\t\ttrainingInstances.addAll(unlabtestInstances);\r\n\t\t\r\n\t\tClassifierTools ct = new ClassifierTools(trainingInstances, unlabtestInstances, null);\r\n\t\tStringToWordVector bow = ct.applyBoWFilter(2000, 1, 2);\r\n\t\tString time = FNCConstants.getCurrentTimeStamp();\r\n\t\tct.saveInstancesToArff(\"ferr_BoW2000_allf_\" + time);\r\n\t\t\r\n\t\t weka.core.SerializationHelper.write(ProjectPaths.MODEL_PATH + \"BoW_2000_train_test\", bow);\r\n\t\r\n\t}", "public static double[] rawFreqCreator(){\n\t\tfinal int EXTERNAL_BUFFER_SIZE = 2097152;\n\t\t//128000\n\n\t\t//Get the location of the sound file\n\t\tFile soundFile = new File(\"MoodyLoop.wav\");\n\n\t\t//Load the Audio Input Stream from the file \n\t\tAudioInputStream audioInputStream = null;\n\t\ttry {\n\t\t\taudioInputStream = AudioSystem.getAudioInputStream(soundFile);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\t//Get Audio Format information\n\t\tAudioFormat audioFormat = audioInputStream.getFormat();\n\n\t\t//Handle opening the line\n\t\tSourceDataLine\tline = null;\n\t\tDataLine.Info\tinfo = new DataLine.Info(SourceDataLine.class, audioFormat);\n\t\ttry {\n\t\t\tline = (SourceDataLine) AudioSystem.getLine(info);\n\t\t\tline.open(audioFormat);\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\t//Start playing the sound\n\t\t//line.start();\n\n\t\t//Write the sound to an array of bytes\n\t\tint nBytesRead = 0;\n\t\tbyte[]\tabData = new byte[EXTERNAL_BUFFER_SIZE];\n\t\twhile (nBytesRead != -1) {\n\t\t\ttry {\n\t\t \t\tnBytesRead = audioInputStream.read(abData, 0, abData.length);\n\n\t\t\t} catch (IOException e) {\n\t\t \t\te.printStackTrace();\n\t\t\t}\n\t\t\tif (nBytesRead >= 0) {\n\t\t \t\tint nBytesWritten = line.write(abData, 0, nBytesRead);\n\t\t\t}\n\n\t\t}\n\n\t\t//close the line \n\t\tline.drain();\n\t\tline.close();\n\t\t\n\t\t//Calculate the sample rate\n\t\tfloat sample_rate = audioFormat.getSampleRate();\n\t\tSystem.out.println(\"sample rate = \"+sample_rate);\n\n\t\t//Calculate the length in seconds of the sample\n\t\tfloat T = audioInputStream.getFrameLength() / audioFormat.getFrameRate();\n\t\tSystem.out.println(\"T = \"+T+ \" (length of sampled sound in seconds)\");\n\n\t\t//Calculate the number of equidistant points in time\n\t\tint n = (int) (T * sample_rate) / 2;\n\t\tSystem.out.println(\"n = \"+n+\" (number of equidistant points)\");\n\n\t\t//Calculate the time interval at each equidistant point\n\t\tfloat h = (T / n);\n\t\tSystem.out.println(\"h = \"+h+\" (length of each time interval in second)\");\n\t\t\n\t\t//Determine the original Endian encoding format\n\t\tboolean isBigEndian = audioFormat.isBigEndian();\n\n\t\t//this array is the value of the signal at time i*h\n\t\tint x[] = new int[n];\n\n\t\t//convert each pair of byte values from the byte array to an Endian value\n\t\tfor (int i = 0; i < n*2; i+=2) {\n\t\t\tint b1 = abData[i];\n\t\t\tint b2 = abData[i + 1];\n\t\t\tif (b1 < 0) b1 += 0x100;\n\t\t\tif (b2 < 0) b2 += 0x100;\n\t\t\tint value;\n\n\t\t\t//Store the data based on the original Endian encoding format\n\t\t\tif (!isBigEndian) value = (b1 << 8) + b2;\n\t\t\telse value = b1 + (b2 << 8);\n\t\t\tx[i/2] = value;\n\t\t\t\n\t\t}\n\t\t\n\t\t//do the DFT for each value of x sub j and store as f sub j\n\t\tdouble f[] = new double[n/2];\n\t\tfor (int j = 0; j < n/2; j++) {\n\n\t\t\tdouble firstSummation = 0;\n\t\t\tdouble secondSummation = 0;\n\n\t\t\tfor (int k = 0; k < n; k++) {\n\t\t \t\tdouble twoPInjk = ((2 * Math.PI) / n) * (j * k);\n\t\t \t\tfirstSummation += x[k] * Math.cos(twoPInjk);\n\t\t \t\tsecondSummation += x[k] * Math.sin(twoPInjk);\n\t\t\t}\n\n\t\t f[j] = Math.abs( Math.sqrt(Math.pow(firstSummation,2) + \n\t\t Math.pow(secondSummation,2)) );\n\n\t\t\tdouble amplitude = 2 * f[j]/n;\n\t\t\tdouble frequency = j * h / T * sample_rate;\n\t\t\tSystem.out.println(\"frequency = \"+frequency+\", amp = \"+amplitude);\n\t\t}\n\t\tSystem.out.println(\"DONE\");\n\t\treturn f;\n\t\t\n\t}", "@Override\n\tpublic Float getFrequency() {\n\t\treturn 3.8f;\n\t}", "public float getFrequency() { \n \treturn mouseJointDef.frequencyHz; \n }", "@Test\n public void testDFTOneFreq() {\n for (int freq = 0; freq < 1000; freq += 200) {\n SoundWave wave = new SoundWave(freq, 5, 0.5, 0.1);\n double maxFreq = wave.highAmplitudeFreqComponent();\n assertEquals(freq, maxFreq, 0.00001);\n }\n }", "public void setFrequencyBand(List<Double> frequencyBand) {\n this.frequencyBand = frequencyBand;\n }", "public Double getFrequency() {\n return frequency;\n }", "public ComputeTermFrequencies() { super(); }", "void documentFrequncy(Set<String> features,\n int index,\n int troush\n ) {\n for (String str : features) {\n switch (index) {\n case 1:\n for (int i = 0; i < count1; i++) {\n if (economydocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyeco.put(str, e);\n }\n e = 0;\n break;\n case 2:\n for (int i = 0; i < count2; i++) {\n if (educationdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyedu.put(str, e);\n }\n e = 0;\n break;\n case 3:\n for (int i = 0; i < count3; i++) {\n if (sportdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyspo.put(str, e);\n }\n e = 0;\n break;\n case 4:\n for (int i = 0; i < count4; i++) {\n if (culturedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencycul.put(str, e);\n }\n e = 0;\n break;\n case 5:\n for (int i = 0; i < count5; i++) {\n if (accedentdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyaccid.put(str, e);\n }\n e = 0;\n break;\n case 6:\n for (int i = 0; i < count6; i++) {\n if (environmntaldocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyenv.put(str, e);\n }\n e = 0;\n break;\n case 7:\n for (int i = 0; i < count7; i++) {\n if (foreign_affairdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencydep.put(str, e);\n }\n e = 0;\n break;\n case 8:\n for (int i = 0; i < count8; i++) {\n if (law_justicedocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencylaw.put(str, e);\n }\n e = 0;\n break;\n case 9:\n for (int i = 0; i < count9; i++) {\n if (agriculture[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyagri.put(str, e);\n }\n e = 0;\n break;\n case 10:\n for (int i = 0; i < count10; i++) {\n if (politicsdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencypoltics.put(str, e);\n }\n e = 0;\n break;\n// case 11:\n//\n// for (int i = 0; i < count11; i++) {\n// if (social_affairsdocument[i].contains(str)) {\n// e++;\n// }\n// }\n// if (e > troush) {\n// documntfrequencysocial.put(str, e);\n// }\n// e = 0;\n// break;\n case 11:\n for (int i = 0; i < count12; i++) {\n if (science_technologydocument[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencysci.put(str, e);\n }\n e = 0;\n break;\n case 12:\n for (int i = 0; i < count13; i++) {\n if (healthdocument[i].contains(str)) {\n e++;\n }\n }\n if (e > troush) {\n documntfrequencyhel.put(str, e);\n }\n e = 0;\n break;\n case 13:\n for (int i = 0; i < count14; i++) {\n if (army[i].contains(str)) {\n e++;\n }\n }\n\n if (e > troush) {\n documntfrequencyarmy.put(str, e);\n }\n e = 0;\n break;\n default:\n break;\n }\n\n }\n }", "@Override\n public void onFftDataCapture(Visualizer visualizer, byte[] fft,\n int samplingRate) {\n\n }", "public static void main(String[] a){\n\n try {\n log.info(\"loading..\");\n\n //ExonQuantSource qs = new ExonQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n //ExonEQTLSource es = new ExonEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n TransQuantSource qs = new TransQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n TransEQTLSource es = new TransEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n\n AggregatedDataSource aggregatedSource = new AggregatedDataSource(qs, es);\n\n log.info(\"loaded\");\n\n log.info(\" \" + ((GenericQuantDataSource)aggregatedSource.quantSource).getStats());\n log.info(\" \" + ((GenericEQTLDataSource)aggregatedSource.eQTLSource).getStats());\n\n String chr = \"1\";\n int start = 1628906;\n int stop = 1629906;\n\n log.info(\"selecting \" + chr + \":\" + start + \"-\" + stop);\n\n ArrayList<DataFeature> quantResult = null;\n ArrayList<DataFeature> eQTLResult = null;\n\n long startTime = System.currentTimeMillis();\n\n quantResult = aggregatedSource.locateQuantFeatures(chr, start, stop);\n eQTLResult = aggregatedSource.locateEQTLFeatures(chr, start, stop);\n\n //for(int i=9;i<1000;i++) {\n //}\n\n long estimatedTime = System.currentTimeMillis() - startTime;\n\n log.info(\"Estimated run time:\" + estimatedTime + \" Millis\");\n\n log.info(\"quantResult.size() = \" + quantResult.size());\n log.info(\"eQTLResult.size() = \" + eQTLResult.size());\n\n for (DataFeature f : quantResult) {\n log.info(\"1 f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore() );\n }\n\n for (DataFeature f : eQTLResult) {\n log.info(\"f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore());\n\n log.info(\"linked to :\");\n\n for (LinkedFeature l0 : f.getLinked()) {\n log.info(\" linked = \" + l0.getFeature().getId() + \" start:\" + l0.getFeature().getStart() +\n \" end:\" + l0.getFeature().getEnd() + \" link score:\" + l0.getLinkScore());\n }\n }\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// Auto-generated catch block\n\t\t\tlog.error(\"Error!\", e);\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n log.error(\"Error!\", e);\n\t\t}\n\t}", "public Features() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "private void calculatefundamentalFreq() {\n\t\tint count;\n\t\tfloat f0 = 0;\n\t\tSystem.out.println(\"pitches\");\n\t\tSystem.out.println(pitches);\n\t\tfor(count = 0; count < pitches.size(); count++)\n\t\t{\n\t\t\tf0 += pitches.get(count);\n\t\t}\n\t\tif(count != 0)\n\t\t\tfundamentalFreq = f0 / count;\n\t\telse\n\t\t\tfundamentalFreq = 0;\n\t}", "private void generalFeatureExtraction () {\n Logger.log(\"Counting how many calls each method does\");\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n try {\n for (SootClass sclass : classes) {\n if (!isLibraryClass(sclass)) {\n System.out.println(ConsoleColors.RED_UNDERLINED + \"\\n\\n 🔍🔍 Checking invocations in \" +\n sclass.getName() + \" 🔍🔍 \" + ConsoleColors.RESET);\n List<SootMethod> methods = sclass.getMethods();\n for (SootMethod method : methods) {\n featuresMap.put(method, new Features(method));\n }\n }\n }\n } catch (Exception e) { \n }\n System.out.println(\"\\n\");\n }", "java.lang.String getFrequency();", "public static void main(String[] args)throws Exception {\n\t\tInstances\t dataset = new Instances(new BufferedReader(new FileReader(\"C:/autos.arff\"))); //pristupanje podacima\n\t\tNonSparseToSparse sp = new NonSparseToSparse();\n\t\tsp.setInputFormat(dataset);\n\t\t\n\t\tInstances newData = Filter.useFilter(dataset, sp);\n\t\t\n\t\tArffSaver saver = new ArffSaver();\n\t\tsaver.setInstances(newData);\n\t\tsaver.setFile(new File(\"..\"));\n\t\tsaver.writeBatch();\n\t}", "@Test\n public void testHighPassFilter() {\n int freq1;\n int freq2;\n for (int i = 1; i < 10; i += 2) {\n freq1 = i * 100;\n freq2 = i * 200;\n SoundWave wave1 = new SoundWave(freq1, 0, 0.4, 0.1);\n SoundWave wave2 = new SoundWave(freq2, 2, 0.3, 0.1);\n SoundWave wave = wave1.add(wave2);\n\n double maxFreq = wave.highAmplitudeFreqComponent();\n assertEquals(freq1, maxFreq, 0.00001);\n\n wave = wave.highPassFilter(5, 6);\n\n maxFreq = wave.highAmplitudeFreqComponent();\n assertEquals(freq2, maxFreq, 0.00001);\n }\n }", "private FastVector getAccInstanceAttributes() {\n Attribute x_mean = new Attribute(\"x-axis mean\");\n Attribute x_var = new Attribute(\"x-axis var\");\n Attribute y_mean = new Attribute(\"y-axis mean\");\n Attribute y_var = new Attribute(\"y-axis var\");\n Attribute z_mean = new Attribute(\"z-axis mean\");\n Attribute z_var = new Attribute(\"z-axis var\");\n\n // Declare the class attribute along with its values\n FastVector fvClassVal = new FastVector(2);\n fvClassVal.addElement(\"none\");\n fvClassVal.addElement(\"tap\");\n Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n // Declare the feature vector\n FastVector fvWekaAttributes = new FastVector(7);\n\n fvWekaAttributes.addElement(x_mean);\n fvWekaAttributes.addElement(x_var);\n fvWekaAttributes.addElement(y_mean);\n fvWekaAttributes.addElement(y_var);\n fvWekaAttributes.addElement(z_mean);\n fvWekaAttributes.addElement(z_var);\n fvWekaAttributes.addElement(classAttribute);\n\n// // Declare the numeric attributes\n// Attribute x_var = new Attribute(\"var_x\");\n// Attribute x_var_delta = new Attribute(\"delta_var_x\");\n// Attribute y_var = new Attribute(\"var_y\");\n// Attribute y_var_delta = new Attribute(\"delta_var_y\");\n// Attribute z_var = new Attribute(\"var_z\");\n// Attribute z_var_delta = new Attribute(\"delta_var_z\");\n//\n// // Declare the class attribute along with its values\n// FastVector fvClassVal = new FastVector(3);\n// fvClassVal.addElement(\"none\");\n// fvClassVal.addElement(\"motion\");\n// fvClassVal.addElement(\"tap\");\n// Attribute classAttribute = new Attribute(\"theClass\", fvClassVal);\n\n// // Declare the feature vector\n// FastVector fvWekaAttributes = new FastVector(7);\n//\n// fvWekaAttributes.addElement(x_var);\n// fvWekaAttributes.addElement(x_var_delta);\n// fvWekaAttributes.addElement(y_var);\n// fvWekaAttributes.addElement(y_var_delta);\n// fvWekaAttributes.addElement(z_var);\n// fvWekaAttributes.addElement(z_var_delta);\n// fvWekaAttributes.addElement(classAttribute);\n\n return fvWekaAttributes;\n }", "public static void main(String...args) {\n\n\t\ttry {\n\n\t\t\tList<String> wordList = getWordList(FEED_FILE);\n\n\t\t\tfinal File frequencyFile = new File(WORD_FREQUENCY);\n\t\t\tfrequencyFile.createNewFile(); // If the file already exists, this will not overwrite it\n\n\t\t\tfinal HashMap<String, Long> dataMap = new HashMap<>(); // HashMap that will have each word as a key and its frequency as a value\n\n\t\t\tfillDataMapFromFrequencyFile(frequencyFile, dataMap);\n\t\t\tfeedMapWithWordList(wordList, dataMap);\n\n\t\t\tupdateFrequencyFile(frequencyFile, dataMap);\n\n\t\t} catch (IOException e) {\n\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public long getFreq() {\n return freq;\n }", "public FrequencyMonitor(ADEGuiCallHelper helper, int smoothingWindow) {\n super(helper, 500);\n initComponents();\n outputLbl.setText(\"0 Hz\");\n lastTime = System.currentTimeMillis();\n stats = new DescriptiveStatistics(smoothingWindow);\n\n this.setTitle(call(\"getDataName\", String.class));\n}", "public float getAmplitude() {\n/* 70 */ return this.amplitude;\n/* */ }", "public int getFrequency()\n {\n return this.frequency;\n }", "private ToneDetection() { }", "@SuppressWarnings(\"unchecked\")\r\n public static void main(String[] args)\r\n {\r\n //final String INPUT_FILE=\"contact-lenses.arff\";\r\n final String INPUT_FILE=\"adult.merged.arff\";\r\n Instances data;\r\n try {\r\n Reader reader = new FileReader(INPUT_FILE);\r\n data = new Instances(reader);\r\n } catch (Exception e) {\r\n System.out.println(\"Failed to read input file \" + INPUT_FILE + \", exiting\");\r\n return;\r\n }\r\n data.setClassIndex(data.numAttributes()-1);\r\n\r\n System.out.println(\"Acquired data from file \" + INPUT_FILE);\r\n System.out.println(\"Got \" + data.numInstances() + \" instances with \" + data.numAttributes() + \" attributes, class attribute is \" + data.classAttribute().name());\r\n AttributeScoreAlgorithm scorer = new MaxScorer ();\r\n Enumeration<Attribute> atts=(Enumeration<Attribute>)data.enumerateAttributes();\r\n while (atts.hasMoreElements())\r\n {\r\n C45Attribute att=new C45Attribute(atts.nextElement());\r\n System.out.println(\"Score for attribute \" + att.WekaAttribute().name() + \" is \" + scorer.Score(data,att));\r\n }\r\n\r\n List<C45Attribute> candidateAttributes = new LinkedList<C45Attribute>();\r\n Enumeration attEnum = data.enumerateAttributes();\r\n while (attEnum.hasMoreElements())\r\n candidateAttributes.add(new C45Attribute((Attribute)attEnum.nextElement()));\r\n BigDecimal epsilon=new BigDecimal(0.1, DiffPrivacyClassifier.MATH_CONTEXT);\r\n PrivacyAgent agent = new PrivacyAgentBudget(epsilon);\r\n\r\n PrivateInstances privData = new PrivateInstances(agent,data);\r\n privData.setDebugMode(true);\r\n\r\n try {\r\n C45Attribute res=privData.privateChooseAttribute(new MaxScorer(), candidateAttributes,epsilon);\r\n System.out.println(\"Picked attribute \" + res.WekaAttribute().name());\r\n } catch(Exception e) { System.out.println(e.getMessage());}\r\n }", "private HashMap<String, Double> getHashMapScore(String query){\n WaveIO waveIO = new WaveIO();\n\n short[] inputSignal = waveIO.readWave(query);\n MagnitudeSpectrum ms = new MagnitudeSpectrum();\n double[] msFeatureQuery = ms.getFeature(inputSignal);\n Energy energy = new Energy();\n double[] energyFeatureQuery = energy.getFeature(inputSignal);\n ZeroCrossing zc = new ZeroCrossing();\n double[] zcFeatureQuery = zc.getFeature(inputSignal);\n MFCC mfcc = new MFCC(Frames.frameLength);\n mfcc.process(inputSignal);\n double[] mfccFeatureQuery = mfcc.getMeanFeature();\n \n \n // Get cosine SimList\n HashMap<String, Double> cosineSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> cosineMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcosineMsSimList.put(f.getKey(), (Cosine.getDistance(msFeatureQuery, (double[]) f.getValue())));\n \t// System.out.println(cosineMsSimList.get(f.getKey()));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \tcosineEnergySimList.put(f.getKey(), (Cosine.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \tcosineZcSimList.put(f.getKey(), (Cosine.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \tcosineMfccSimList.put(f.getKey(), (Cosine.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(cosineMsSimList);\n normalizeValue(cosineEnergySimList);\n normalizeValue(cosineZcSimList);\n normalizeValue(cosineMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcosineSimList.put(f.getKey(), (m_msFeatureWeight * cosineMsSimList.get(f.getKey())) + (m_energyFeatureWeight * cosineEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * cosineZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * cosineMfccSimList.get(f.getKey())));\n }\n \n // Get Euclidean SimList\n HashMap<String, Double> euclideanSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> euclideanMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \teuclideanMsSimList.put(f.getKey(), (Euclidean.getDistance(msFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \teuclideanEnergySimList.put(f.getKey(), (Euclidean.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \teuclideanZcSimList.put(f.getKey(), (Euclidean.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \teuclideanMfccSimList.put(f.getKey(), (Euclidean.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(euclideanMsSimList);\n normalizeValue(euclideanEnergySimList);\n normalizeValue(euclideanZcSimList);\n normalizeValue(euclideanMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \teuclideanSimList.put(f.getKey(), (m_msFeatureWeight * euclideanMsSimList.get(f.getKey())) + (m_energyFeatureWeight * euclideanEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * euclideanZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * euclideanMfccSimList.get(f.getKey())));\n }\n \n // Get CityBlock SimList\n HashMap<String, Double> cityblockSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockMsSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockEnergySimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockZcSimList = new HashMap<String, Double>();\n HashMap<String, Double> cityblockMfccSimList = new HashMap<String, Double>();\n \n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcityblockMsSimList.put(f.getKey(), (Euclidean.getDistance(msFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_energyFeature.entrySet()){\n \tcityblockEnergySimList.put(f.getKey(), (Euclidean.getDistance(energyFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_zcFeature.entrySet()){\n \tcityblockZcSimList.put(f.getKey(), (Euclidean.getDistance(zcFeatureQuery, (double[]) f.getValue())));\n }\n for (Map.Entry<String,double[]> f: m_mfccFeature.entrySet()){\n \tcityblockMfccSimList.put(f.getKey(), (Euclidean.getDistance(mfccFeatureQuery, (double[]) f.getValue())));\n }\n normalizeValue(cityblockMsSimList);\n normalizeValue(cityblockEnergySimList);\n normalizeValue(cityblockZcSimList);\n normalizeValue(cityblockMfccSimList);\n // Combine 4 features\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tcityblockSimList.put(f.getKey(), (m_msFeatureWeight * cityblockMsSimList.get(f.getKey())) + (m_energyFeatureWeight * cityblockEnergySimList.get(f.getKey())) + (m_zcFeatureWeight * cityblockZcSimList.get(f.getKey())) + (m_mfccFeatureWeight * cityblockMfccSimList.get(f.getKey())));\n }\n \n // Overall\n HashMap<String, Double> simList = new HashMap<String, Double>();\n for (Map.Entry<String,double[]> f: m_msFeature.entrySet()){\n \tsimList.put(f.getKey(), (m_cosineWeight * cosineSimList.get(f.getKey())) + (m_euclideanWeight * euclideanSimList.get(f.getKey())) + (m_cityblockWeight * cityblockSimList.get(f.getKey())));\n }\n \n return simList;\n }", "public int getFrequency_(){\r\n\t\treturn frequency_;\r\n\t}", "public List<Double> getFrequencyBand() {\n return frequencyBand;\n }", "private float calculateSensorFrequency() {\n if (startTime == 0) {\n startTime = System.nanoTime();\n }\n\n long timestamp = System.nanoTime();\n\n // Find the sample period (between updates) and convert from\n // nanoseconds to seconds. Note that the sensor delivery rates can\n // individually vary by a relatively large time frame, so we use an\n // averaging technique with the number of sensor updates to\n // determine the delivery rate.\n float hz = (count++ / ((timestamp - startTime) / 1000000000.0f));\n\n return hz;\n }", "@Override\n public void init(SearchHits hits) { \n\n \tint numFbDocs = 50;\n \tint numFbTerms = 20;\n \tdouble lambda = 1.0;\n \tdouble alpha = 5.0;\n \t\n if (paramTable.get(FB_DOCS) != null ) \n \tnumFbDocs = paramTable.get(FB_DOCS).intValue();\n if (paramTable.get(FB_TERMS) != null ) \n \tnumFbTerms = paramTable.get(FB_TERMS).intValue();\n if (paramTable.get(LAMBDA) != null ) \n \tlambda = paramTable.get(LAMBDA).doubleValue();\n if (paramTable.get(ALPHA) != null ) \n \talpha = paramTable.get(ALPHA).doubleValue(); \n \n if (hits.size() < numFbDocs) \n \tnumFbDocs = hits.size();\n \n SearchHits fbDocs = new SearchHits(hits.hits().subList(0, numFbDocs));\n FeedbackRelevanceModel rm = new FeedbackRelevanceModel();\n rm.setDocCount(numFbDocs);\n rm.setTermCount(numFbTerms);\n rm.setIndex(index);\n rm.setStopper(null);\n rm.setRes(fbDocs);\n rm.build(); \n \n FeatureVector rmVector = rm.asFeatureVector();\n rmVector.clip(numFbTerms);\n rmVector.normalize();\n \n TermTimeSeries ts = new TermTimeSeries(startTime, endTime, interval, \n \t\trm.asFeatureVector().getFeatures());\n \n for (SearchHit hit: hits.hits()) {\n \t\tlong docTime = TemporalScorer.getTime(hit);\n \t\tdouble score = hit.getScore();\n \t\tts.addDocument(docTime, score, hit.getFeatureVector());\n }\n \n RUtil rutil = new RUtil();\n \n double sdps =0;\n for (String term: rmVector.getFeatures()) {\n \tdouble[] tsw = ts.getTermFrequencies(term);\n \tif (sum(tsw) > 0) {\n \t\ttry {\n \t\t\tsdps += rutil.dps(tsw);\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n } \n \n FeatureVector tsfv = new FeatureVector(null);\n for (String term: rmVector.getFeatures()) {\n \tdouble[] termts = ts.getTermFrequencies(term);\n \ttry {\n \t\tdouble dps = rutil.dps(termts)/sdps;\n \t\t\n \tdouble weight = Math.pow(dps, alpha) * Math.pow(rmVector.getFeatureWeight(term), (1-alpha));\n tsfv.addTerm(term, weight);\n \n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n }\n tsfv.normalize();\n\n gQuery.getFeatureVector().normalize();\n FeatureVector fv =\n \t\tFeatureVector.interpolate(gQuery.getFeatureVector(), tsfv, lambda);\n gQuery.setFeatureVector(fv);\n \n System.out.println(rmVector.toString(10));\n System.out.println(tsfv.toString(10));\n System.out.println(fv.toString(10));\n rutil.close();\n \n }", "public static void main(String[] args)\r\n\t{\n\t\tHammingDistFrame HDF = new HammingDistFrame();\r\n\t}", "public static void main(String[] args) {\n\t\tUtility.dirPath = \"C:\\\\Users\\\\imSlappy\\\\workspace\\\\FeelingAnalysis\\\\Documents\\\\2_group_eng\";\n\t\tString sub[] = {\"dup\",\"bug\"};\n\t\tUtility.classLabel = sub;\n\t\tUtility.numdoc = 350;\n\t\tSetClassPath.read_path(Utility.dirPath);\n\t\tUtility.language = \"en\";\n\t\t\n\t\tUtility.stopWordHSEN = Fileprocess.FileHashSet(\"data/stopwordAndSpc_eng.txt\");\n\t\tUtility.dicen = new _dictionary();\n\t\tUtility.dicen.getDictionary(\"data/dicEngScore.txt\");\n\t\t\n\t\tUtility.vocabHM = new HashMap();\n\t\t// ================= completed initial main Program ==========================\n\n\t\tMainExampleNaive ob = new MainExampleNaive();\n\t\t\n\t\t// --------------------- Pre-process -----------------------\n\t\tob.word_arr = new HashSet [Utility.listFile.length][];\n\t\tob.wordSet = new ArrayList<String>();\n\t\tfor (int i = 0; i < Utility.listFile.length; i++) {\n\t\t\tob.word_arr[i]=new HashSet[Utility.listFile[i].length];\n\t\t\tfor (int j = 0; j < Utility.listFile[i].length; j++) {\n\t\t\t\tStringBuffer strDoc = Fileprocess.readFile(Utility.listFile[i][j]);\n\t\t\t\tob.word_arr[i][j]=ob.docTokenization(new String(strDoc));\n\t\t\t}\n\t\t\tob.checkBound(3, 10000);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"++ Total : \"+Utility.vocabHM.size()+\" words\");\n\t\tSystem.out.println(\"++ \"+Utility.vocabHM);\n\t\t\n\t\t// ---------------------- Selection ------------------------\n//\t\tInformationGain ig = new InformationGain(ob.word_arr.length*ob.word_arr[0].length , ob.wordSet,ob.word_arr);\n//\t\tArrayList<String> ban_word = ig.featureSelection(0.0); // selected out with IG = 0\n//\t\t//ob.banFeature(ban_word);\n//\t\tSystem.out.println(\"ban list[\"+ban_word.size()+\"] : \"+ban_word);\n//\t\t\n//\t\tSystem.out.println(\"-- After \"+Utility.vocabHM.size());\n//\t\tSystem.out.println(\"-- \"+Utility.vocabHM);\n\t\t\n\t\tob.setWordPosition();\n\t\t// ---------------------- Processing -----------------------\n\t\tNaiveBayes naive = new NaiveBayes();\n\t\tnaive.naiveTrain(true);\n\t\t\n\t\tint result = naive.naiveUsage(\"after cold reset of my pc (crash of xp) the favorites of firefox are destroyed and all settings are standard again! Where are firefox-favorites stored and the settings ? how to backup them rgularely? All other software on my pc still works properly ! even INternetExplorer\");\n\t\tSystem.out.println(\"\\nResult : \"+Utility.classLabel[result]);\n\t}", "public void setFrequency(Double frequency) {\n this.frequency = frequency;\n }", "private void initializeAlleleFrequencies(int numSamples) {\n frequencyEstimationPoints = Math.max(MIN_ESTIMATION_POINTS, 2 * numSamples) + 1;\n \n // set up the allele frequency priors\n log10AlleleFrequencyPriors = getNullAlleleFrequencyPriors(frequencyEstimationPoints);\n }", "AudioProcessor[] mo25073a();", "public double getFeature(int i) {\n\t return _features[i];\r\n\t//return 0;\r\n}", "@Test\n public void testDFTMultipleFreq() {\n int freq1;\n int freq2;\n int freq3;\n for (int i = 1; i < 10; i += 2) {\n freq1 = i * 100;\n freq2 = i * 200;\n freq3 = i * 300;\n SoundWave wave1 = new SoundWave(freq1, 0, 0.3, 0.1);\n SoundWave wave2 = new SoundWave(freq2, 2, 0.3, 0.1);\n SoundWave wave3 = new SoundWave(freq3, 3, 0.3, 0.1);\n SoundWave wave = wave1.add(wave2.add(wave3));\n\n double maxFreq = wave.highAmplitudeFreqComponent();\n assertEquals(freq3, maxFreq, 0.00001);\n }\n }", "public void setFrequency(int f){\n this.frequency = f;\n }", "void doRun() {\n\n\t Object line;\n\t Method wrmeth = null;\n\t try {\n\t\tClass afclass = Class.forName(\"javax.sound.sampled.AudioFormat\");\n\t\tConstructor cstr = afclass.getConstructor(\n\t\t new Class[] { float.class, int.class, int.class,\n\t\t\t\t boolean.class, boolean.class });\n\t\tObject format = cstr.newInstance(new Object[]\n\t\t { new Float(rate), new Integer(16), new Integer(1),\n\t\t new Boolean(true), new Boolean(true) });\n\t\tClass ifclass = Class.forName(\"javax.sound.sampled.DataLine$Info\");\n\t\tClass sdlclass =\n\t\t Class.forName(\"javax.sound.sampled.SourceDataLine\");\n\t\tcstr = ifclass.getConstructor(\n\t\t new Class[] { Class.class, afclass });\n\t\tObject info = cstr.newInstance(new Object[]\n\t\t { sdlclass, format });\n\t\tClass asclass = Class.forName(\"javax.sound.sampled.AudioSystem\");\n\t\tClass liclass = Class.forName(\"javax.sound.sampled.Line$Info\");\n\t\tMethod glmeth = asclass.getMethod(\"getLine\",\n\t\t\t\t\t\t new Class[] { liclass });\n\t\tline = glmeth.invoke(null, new Object[] {info} );\n\t\tMethod opmeth = sdlclass.getMethod(\"open\",\n\t\t\t new Class[] { afclass, int.class });\n\t\topmeth.invoke(line, new Object[] { format,\n\t\t\t new Integer(4096) });\n\t\tMethod stmeth = sdlclass.getMethod(\"start\", null);\n\t\tstmeth.invoke(line, null);\n\t\tbyte b[] = new byte[1];\n\t\twrmeth = sdlclass.getMethod(\"write\",\n\t\t\t new Class[] { b.getClass(), int.class, int.class });\n\t } catch (Exception e) {\n\t\te.printStackTrace();\n\t\treturn;\n\t }\n\n\t int playSampleCount = 16384;\n\t FFT playFFT = new FFT(playSampleCount);\n\t double playfunc[] = null;\n\t byte b[] = new byte[4096];\n\t int offset = 0;\n\t int dampCount = 0;\n\t double mx = .2;\n\t\t \n\t while (soundCheck.getState() && applet.ogf != null) {\n\t\tdouble damper = dampcoef*1e-2;\n\t\t\n\t\tif (playfunc == null || changed) {\n\t\t playfunc = new double[playSampleCount*2];\n\t\t int i;\n\t\t //double bstep = 2*pi*440./rate;\n\t\t //int dfreq0 = 440; // XXX\n\t\t double n = 2*pi*20.0*\n\t\t\tjava.lang.Math.sqrt((double)tensionBarValue);\n\t\t n /= omega[1];\n\t\t changed = false;\n\t\t mx = .2;\n\t\t for (i = 1; i != maxTerms; i++) {\n\t\t\tint dfreq = (int) (n*omega[i]);\n\t\t\tif (dfreq >= playSampleCount)\n\t\t\t break;\n\t\t\tplayfunc[dfreq] = magcoef[i];\n\t\t }\n\t\t playFFT.transform(playfunc, true);\n\t\t for (i = 0; i != playSampleCount; i++) {\n\t\t\tdouble dy = playfunc[i*2]*Math.exp(damper*i);\n\t\t\tif (dy > mx) mx = dy;\n\t\t\tif (dy < -mx) mx = -dy;\n\t\t }\n\t\t dampCount = offset = 0;\n\t\t}\n\t\t\n\t\tdouble mult = 32767/mx;\n\t\tint bl = b.length/2;\n\t\tint i;\n\t\tfor (i = 0; i != bl; i++) {\n\t\t short x = (short) (playfunc[(i+offset)*2]*mult*\n\t\t\t\t Math.exp(damper*dampCount++));\n\t\t b[i*2] = (byte) (x/256);\n\t\t b[i*2+1] = (byte) (x & 255);\n\t\t}\n\t\toffset += bl;\n\t\tif (offset == playfunc.length/2)\n\t\t offset = 0;\n\n\t\ttry {\n\t\t wrmeth.invoke(line, new Object[] { b, new Integer(0),\n\t\t\t\t\t\t new Integer(b.length) });\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t break;\n\t\t}\n\t }\n\t}", "public int readSamples(float[] samples);", "public String getHoldingHandFeatures() {\n double[] angle = new double[] {getAngle(linAccSample)};\n\n // 15 linear accelerometer features (means etc across 3 axes)\n double[] linAccMeans = getMean(linAccSample);\n double[] linAccStdDevs = getStdDev(linAccSample);\n double[] linAccSkewness = getSkewness(linAccSample);\n double[] linAccKurtosis = getKurtosis(linAccSample);\n\n double linAcc1Norm = getL1Norm(linAccMatrix);\n double linAccInfNorm = getInfNorm(linAccMatrix);\n double linAccFroNorm = getFroNorm(linAccMatrix);\n double[] linAccNorms = new double[]{linAcc1Norm, linAccInfNorm, linAccFroNorm};\n\n // 15 gyroscope features\n double[] gyroMeans = getMean(gyroSample);\n double[] gyroStdDevs = getStdDev(gyroSample);\n double[] gyroSkewness = getSkewness(gyroSample);\n double[] gyroKurtosis = getKurtosis(gyroSample);\n\n double gyro1Norm = getL1Norm(gyroMatrix);\n double gyroInfNorm = getInfNorm(gyroMatrix);\n double gyroFroNorm = getFroNorm(gyroMatrix);\n double[] gyroNorms = new double[] {gyro1Norm, gyroInfNorm, gyroFroNorm};\n\n // 9 pearson features\n double[] pearsonCoeffs = getPearsonCoeff(linAccSample, gyroSample);\n\n double[] featureArray = merge(\n angle,\n linAccMeans, linAccStdDevs, linAccSkewness, linAccKurtosis, linAccNorms,\n gyroMeans, gyroStdDevs, gyroSkewness, gyroKurtosis, gyroNorms,\n pearsonCoeffs);\n\n StringBuilder featureString = new StringBuilder();\n for (int i = 0; i < featureArray.length; i++) {\n featureString.append(i+1);\n featureString.append(':');\n featureString.append(featureArray[i]);\n featureString.append(' ');\n }\n return featureString.toString();\n }", "public ClassFrequency getInstance(){\n\t\treturn instance;\n\t}", "public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {}", "public void startRecording(){\n String samplerateString = null, buffersizeString = null;\n if (Build.VERSION.SDK_INT >= 17) {\n AudioManager audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);\n samplerateString = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);\n buffersizeString = audioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);\n }\n samplerateString= \"48000\";\n buffersizeString = \"256\";\n\n System.loadLibrary(\"FrequencyDomain\");\n FrequencyDomain(Integer.parseInt(samplerateString), Integer.parseInt(buffersizeString));\n }", "public static void main(String[] args) \n\t{\n\t\t// Konfiguration\n\t\tTraining training = new Training();\n\t\tint numberOfAttributes = 18;\n\t\tStatisticOutput statisticWriter = new StatisticOutput(\"data/statistics.txt\");\n\t\t\n\t\ttraining.printMessage(\"*** TCR-Predictor: Training ***\");\n\t\t\n\t\ttraining.printMessage(\"Datenbank von Aminosäure-Codierungen wird eingelesen\");\n\t\t// Lies die EncodingDB ein\n\t\tAAEncodingFileReader aa = new AAEncodingFileReader();\n\t\tAAEncodingDatabase db = aa.readAAEncodings(\"data/AAEncodings.txt\");\n\t\ttraining.printMessage(\"Es wurden \" + db.getEncodingDatabase().size() + \" Codierungen einglesen\");\n\t\t\n\t\ttraining.printMessage(\"Trainingsdatensatz wird eingelesen und prozessiert\");\n\t\t// Lies zunächst die gesamten Trainingsdaten ein\n\t\tExampleReader exampleReader = new ExampleReader();\n\t\t\n\t\t// Spalte das Datenset\n\t\tDataSplit dataSplit_positives = new DataSplit(exampleReader.getSequnces(\"data/positive.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_positiv = dataSplit_positives.getDataSet();\n\t\t\n\t\tDataSplit dataSplit_negatives = new DataSplit(exampleReader.getSequnces(\"data/negative.txt\"), 5);\n\t\tArrayList<ArrayList<String>> complete_list_negativ = dataSplit_negatives.getDataSet();\n\t\t\n\t\t// Lege Listen für die besten Klassifizierer und deren Evaluation an\n\t\tModelCollection modelCollection = new ModelCollection();\n\t\t\n\t\t/*\n\t\t * \n\t\t * Beginne Feature Selection\n\t\t * \n\t\t */\n\t\tArrayList<String> positivesForFeatureSelection = training.concatenateLists(complete_list_positiv);\n\t\tArrayList<String> negativesForFeatureSelection = training.concatenateLists(complete_list_negativ);\n\t\t\n\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t// Convertiere Daten in Wekas File Format\n\t\tARFFFileGenerator arff = new ARFFFileGenerator();\n\t\tInstances dataSet = arff.createARFFFile(positivesForFeatureSelection, negativesForFeatureSelection, db.getEncodingDatabase());\n\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\n\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) aus\");\n\t\t// Beginne Feature Selection\n\t\tFeatureFilter featureFilter = new FeatureFilter();\n\t\tfeatureFilter.rankFeatures(dataSet, numberOfAttributes);\t\t\t\t\t// Wähle die x wichtigsten Features aus\n\t\tdataSet = featureFilter.getProcessedInstances();\n\t\ttraining.printMessage(\"Ausgewählte Features: \" + featureFilter.getTopResults());\n\n\t\t/*\n\t\t * Führe die äußere Evaluierung fünfmal durch und wähle das beste Modell\n\t\t */\n\t\tfor (int outer_run = 0; outer_run < 5; outer_run++)\n\t\t{\n\t\t\tstatisticWriter.writeString(\"===== Äußere Evaluation \" + (outer_run + 1) + \"/5 =====\\n\\n\");\n\t\t\t\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_positives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_positives.addAll(complete_list_positiv);\n\t\t\t\n\t\t\tArrayList<ArrayList<String>> list_negatives = new ArrayList<ArrayList<String>>();\n\t\t\tlist_negatives.addAll(complete_list_negativ);\n\t\t\t\n\t\t\t// Lege das erste Fragment beider Listen für nasted-Crossvalidation beiseite\n\t\t\tArrayList<String> outer_List_pos = new ArrayList<String>();\n\t\t\touter_List_pos.addAll(list_positives.get(outer_run));\n\t\t\tlist_positives.remove(outer_run);\n\t\t\t\n\t\t\tArrayList<String> outer_List_neg = new ArrayList<String>();\n\t\t\touter_List_neg.addAll(list_negatives.get(outer_run));\n\t\t\tlist_negatives.remove(outer_run);\n\t\t\t\n\t\t\t// Füge die verbleibende Liste zu einer Zusammen\n\t\t\tArrayList<String> inner_List_pos = training.concatenateLists(list_positives);\n\t\t\tArrayList<String> inner_List_neg = training.concatenateLists(list_negatives);\n\t\t\t\t\n\n\t\t\t/*\n\t\t\t * \n\t\t\t * Ab hier nur noch Arbeiten mit innerer Liste, die Daten zum Evaluieren bekommt Weka vorerst \n\t\t\t * nicht zu sehen!\n\t\t\t * \n\t\t\t */\n\t\t\ttraining.printMessage(\"Convertiere Daten ins Weka ARFF Format\");\t\t\n\t\t\t// Convertiere Daten in Wekas File Format\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(inner_List_pos, inner_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes); // Filtere das innere Datenset nach Vorgabe\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\ttraining.printMessage(\"Beginne Gridsearch\");\n\t\t\t// Gridsearch starten\n\t\n\t\t\t\n\t\t\t\n\t\t\tParameterOptimization optimizer = new ParameterOptimization();\n\t\t\tString logFileName = outer_run + \"_\" + numberOfAttributes;\n\t\t\tGridSearch gridSearch = optimizer.performGridSearch(dataSet, logFileName);\n\t\t\ttraining.printMessage(\"Gefundene Parameter [C, gamma]: \" + gridSearch.getValues()); // liefert unter diesen Settings 1.0 und 0.0\n\n\t\t\tSMO sMO = (SMO)gridSearch.getBestClassifier();\n\t\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t * \n\t\t\t * Evaluationsbeginn \n\t\t\t *\n\t\t\t */\n\t\t\ttraining.printMessage(\"Evaluiere die Performance gegen das äußere Datenset\");\n\t\t\ttraining.printMessage(\"Transcodierung des Evaluationsdatensatzes\");\n\t\t\tarff = new ARFFFileGenerator();\n\t\t\tdataSet = arff.createARFFFile(outer_List_pos, outer_List_neg, db.getEncodingDatabase());\n\t\t\tdataSet.setClass(dataSet.attribute(\"activator\"));\t\t\t// Lege das nominale Attribut fest, wonach klassifiziert wird\n\t\t\tdataSet.deleteStringAttributes(); \t\t\t\t\t\t\t// Entferne String-Attribute\n\t\t\t\n\t\t\t// Führe Feature-Filtering mit den Einstellungen der GridSearch aus\n\t\t\ttraining.printMessage(\"Führe Feature Selection (Filtering) auf GridSearch-Basis aus\");\n\t\t\t// Beginne Feature Selection\n\t\t\tfeatureFilter.processInstances(featureFilter.getRanking(), dataSet, numberOfAttributes);\t // Wähle die x wichtigsten Features aus\n\t\t\tdataSet = featureFilter.getProcessedInstances();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\ttraining.printMessage(\"Ermittle Performance\");\n\t\t\tEvaluator eval = new Evaluator();\n\t\t\teval.classifyDataSet(sMO, dataSet);\n\t\t\ttraining.printMessage(eval.printRawData());\n\t\t\t\n\t\t\t/*\n\t\t\t * Füge das Modell und die externe Evaulation zur Sammlung hinzu\n\t\t\t */\t\t\t\n\t\t\tmodelCollection.bestClassifiers.add(sMO);\n\t\t\tmodelCollection.evalsOfBestClassifiers.add(eval);\n\t\t\tmodelCollection.listOfNumberOfAttributes.add(numberOfAttributes);\n\t\t\tmodelCollection.listOfFeatureFilters.add(featureFilter);\n\t\t\t\n\t\t\tstatisticWriter.writeString(\"Verwendete Attribute: \" + featureFilter.getTopResults());\n\t\t\tstatisticWriter.writeString(eval.printRawData());\n\t\t\t\n\t\t}\n\t\tstatisticWriter.close();\n\t\t\n\t\t// Wähle das beste aller Modelle aus\n\t\ttraining.printMessage(\"Ermittle die allgemein besten Einstellungen\");\n\t\tModelSelection modelSelection = new ModelSelection();\n\t\tmodelSelection.calculateBestModel(modelCollection);\n\t\t\n\t\ttraining.printMessage(\"Das beste Model: \");\n\t\ttraining.printMessage(modelSelection.getBestEvaluator().printRawData());\n\t\tSystem.out.println(\"------ SMO ------\");\n\t\tfor (int i = 0; i < modelSelection.getBestClassifier().getOptions().length; i++)\n\t\t{\n\t\t\tSystem.out.print(modelSelection.getBestClassifier().getOptions()[i] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n--- Features ---\");\n\t\tSystem.out.println(modelSelection.getBestListOfFeatures().getTopResults());\n\t\t\n\t\t// Schreibe das Modell in eine Datei\n\t\ttraining.printMessage(\"Das beste Modell wird auf Festplatte geschrieben\");\n\t\ttry\n\t\t{\n\t\t\tSerializationHelper.write(\"data/bestPredictor.model\", modelSelection.getBestClassifier());\n\t\t\tSerializationHelper.write(\"data/ranking.filter\", modelSelection.getBestListOfFeatures().getRanking());\n\t\t\tSerializationHelper.write(\"data/components.i\", (modelSelection.getBestListOfFeatures().getProcessedInstances().numAttributes()-1));\n\t\t}\n\t\tcatch (Exception ex)\n\t\t{\n\t\t\tSystem.err.println(\"Fehler beim Schreiben des Modells auf Festplatte: \" + ex);\n\t\t}\n\t}", "@Override\n\tpublic ContextLabel recognize(KinectData input, String timeStamp) {\n\t\tdouble inputD[][] = new double[30][75];\n\t\tfor(int i = 0; i<input.getAry().size(); i++){\n\t\t\tinputD[i] = input.getAry().get(i);\n\t\t}\n\t\t\n\t\t/*\n\t\tfor(double[] ad1 : inputD){\n\t\t\tfor(double ad2 : ad1){\n\t\t\t\tSystem.out.print(ad2 + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}*/\n\t\tfeatureExtractor.setInputData(inputD);\n\t\tdouble[] inputFeatures = featureExtractor.extractFeatures();\n\t\t// siD and sjD are read from txt file. I do not know how to input this file. Help me!\n\t\t\n\t\tString rlt = ar.Classify(inputFeatures);\n\t\tif(verbose)logger.info(\"Output of Var Thien \" + userID + \"\\t\" + rlt + \"\\t\" + timeStamp);\n\t\treturn new ContextLabel(userID, rlt, timeStamp, ContextType.Activity);\n\t}", "public FeatureSynthesisMain() {\n super();\n }", "private List<Float> nucleotideFrequencies() {\n\t\tList<Float> freqs = new ArrayList<Float>();\n\t\tfreqs.add((float) 0.3);\n\t\tfreqs.add((float) 0.5);\n\t\tfreqs.add((float) 0.8);\n\t\tfreqs.add((float) 1.0);\n\t\treturn freqs;\n\t}", "public static void main(String[] args){\n if (args.length < 3){\n System.out.println(\"Please specify data path, support frequency and output path\");\n return;\n }\n int supportThreshold = Integer.parseInt(args[1]);\n long startTime = System.nanoTime();\n\n Apriori apriori = new Apriori(args[0], supportThreshold);\n\n apriori.generateFIS();\n writeToOutput(args[2], apriori);\n long endTime = System.nanoTime();\n long duration = (endTime - startTime);\n\n System.out.println(\"Run Time: \" + duration / 1000000000.0);\n }", "public void run() {\r\n /*try {\r\n AudioSystem.write(m_audioInputStream, m_targetType, outFile);\r\n } catch(IOException e) {\r\n e.printStackTrace();\r\n }*/\r\n //diagram.display();\r\n \r\n final java.util.List<Double> samples=new ArrayList<Double>();\r\n int nBytesRead=0;\r\n final int EXTERNAL_BUFFER_SIZE=(int)Math.pow(2, 13); //128000;\r\n byte[] abData=new byte[EXTERNAL_BUFFER_SIZE];\r\n //boolean isOn=false;\r\n while(nBytesRead != -1 && !stopped) {\r\n try {\r\n nBytesRead=m_audioInputStream.read(abData, 0, abData.length);\r\n } catch(IOException e) {\r\n e.printStackTrace();\r\n }\r\n if(nBytesRead > 0) {\r\n //System.err.println(\"data captured: \"+nBytesRead);\r\n final double[] in=new double[nBytesRead / 2+1]; // >>> 16 bit\r\n int j=0;\r\n for(int i=0; i < nBytesRead - 1; i+=2) {\r\n byte left=abData[i];\r\n int right=abData[i + 1];\r\n right<<=8;\r\n right|=(left & 0xFF);\r\n in[j+1]=right / 65536.0; // >>>65535=2^16\r\n j++;\r\n }\r\n\r\n double averageIntensity=0;\r\n try {\r\n final Sound intensitySound=Sound.Sound_createSimple(1, (in.length-1) / (double)SAMPLE_RATE, SAMPLE_RATE);\r\n intensitySound.z[1]=in;\r\n final SoundEditor edit=SoundEditor.SoundEditor_create(\"\", intensitySound);\r\n edit.computeIntensity();\r\n averageIntensity=edit.computeAverageIntensity();\r\n } catch(Exception e) {\r\n e.printStackTrace();\r\n continue; //>>>?\r\n }\r\n final double ai=averageIntensity;\r\n SwingUtilities.invokeLater(new Runnable() { //>>> not good\r\n public void run() {\r\n for(IntensityListener lis: itenListener) {\r\n lis.gotIntensity(ai); //notify listeners\r\n }\r\n }\r\n });\r\n\r\n /*if(INTENSITY_THRESHOLD<0) {\r\n INTENSITY_THRESHOLD=(int)ai+20;\r\n System.err.println(\"t:\"+ai);\r\n } else {*/\r\n//System.err.println(ai);\r\n if(ai>=settings.noiseLevel) { //filter weak noises\r\n //>>> too long? \r\n for(int i=1; i<in.length; i++) {\r\n samples.add(in[i]);\r\n }\r\n } else {\r\n analyzePitch(samples);\r\n samples.clear();\r\n }\r\n //}\r\n }\r\n }\r\n //System.err.println(\"got sample\");\r\n \r\n \r\n//System.err.println(\"done\");\r\n }", "private HashMap<String, double[]> readFeature(String featurePath, int currCount){\n HashMap<String, double[]> fList = new HashMap<>();\n try{\n FileReader fr = new FileReader(featurePath);\n BufferedReader br = new BufferedReader(fr);\n\n String line = br.readLine();\n while(line != null){\n\n String[] split = line.trim().split(\"\\t\");\n if (split.length < 2)\n continue;\n double[] fs = new double[split.length - 1];\n for (int i = 1; i < split.length; i ++){\n fs[i-1] = Double.valueOf(split[i]);\n }\n\n fList.put(split[0], fs);\n \n // Update ProgressBar\n SoundEffectDemo.s_progressBar.setValue(currCount);\n \t\tdouble currPercentage = ((double) currCount / ((double) s_numTrainingData * 4.0)) * 100.0;\n \t\tSoundEffectDemo.s_progressBar.setString(String.format(\"%.2f\", currPercentage) + \"%\");\n \t\tcurrCount++;\n \t\t\n line = br.readLine();\n }\n br.close();\n\n }catch (Exception e){\n e.printStackTrace();\n }\n\n return fList;\n }", "@Override\n\tpublic void process(TimeStamp startTime, TimeStamp endTime, float[] spectrum) {\n\t\tint numBins = maxBin - minBin;\n\t\t// 1. check to see if we need to create a new previousSpectrum cache\n\t\tif (lastBlockSize != spectrum.length) {\n\t\t\t// 2. calculate min and maxBin\n\t\t\tcalcMaxAndMinBin(spectrum.length);\n\n\t\t\t// 3. create a new spectrum cache of the appropriate size\n\t\t\tnumBins = maxBin - minBin;\n\t\t\tif (numBins > 0)\n\t\t\t\tpreviousSpectrum = new float[numBins];\n\n\t\t\tlastBlockSize = spectrum.length;\n\t\t}\n\n\t\tif (numBins > 0) {\n\t\t\tswitch (differenceType) {\n\t\t\tcase POSITIVERMS:\n\t\t\t\tfeatures = positiveRms(spectrum, minBin, previousSpectrum, 0,\n\t\t\t\t\t\tnumBins);\n\t\t\t\tbreak;\n\t\t\tcase RMS:\n\t\t\t\tfeatures = rms(spectrum, minBin, previousSpectrum, 0, numBins);\n\t\t\t\tbreak;\n\t\t\tcase POSITIVEMEANDIFFERENCE:\n\t\t\t\tfeatures = positiveMeanDifference(spectrum, minBin,\n\t\t\t\t\t\tpreviousSpectrum, 0, numBins);\n\t\t\t\tbreak;\n\t\t\tcase MEANDIFFERENCE:\n\t\t\t\tfeatures = meanDifference(spectrum, minBin, previousSpectrum,\n\t\t\t\t\t\t0, numBins);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// finally copy the current spectrum\n\t\t\tSystem.arraycopy(spectrum, minBin, previousSpectrum, 0, numBins);\n\t\t}\n\t\tforward(startTime, endTime);\n\t}", "public void setFrequency(String frequency)\n {\n this.frequency = frequency;\n }", "@Override\n public long getFrequencyCount() {\n return count;\n }", "private void parseAvailableFrequencies(){\n\t\tString str = parser.readFile(FREQ_AVAILABLE, 256);\n\t\tif(str == null)\n\t\t\treturn;\n\t\t\n\t\tString[] frestrs = str.split(\" \");\n\t\tint[] freqs = new int[frestrs.length - 1];\n\t\tfor(int i = 0; i < freqs.length; i++)\n\t\t\tfreqs[i] = Integer.valueOf(frestrs[i]);\n\t\t\n\t\tcpuFrequencies = freqs;\n\t}", "public FrequencyMonitor(ADEGuiCallHelper helper) {\n super(helper, 500);\n initComponents();\n outputLbl.setText(\"0 Hz\");\n lastTime = System.currentTimeMillis();\n stats = new DescriptiveStatistics(1);\n\n this.setTitle(call(\"getDataName\", String.class));\n }", "public int getFreq() {\n return freq_;\n }", "public static void main(String[] args) {\n //launch(FFTApp.class, args);\n Complex c[] = new Complex[8];\n c[0] = new Complex(1);\n c[1] = new Complex(2);\n c[2] = new Complex(3);\n c[3] = new Complex(4);\n\n FFT a = new FFT(2);\n a.hacerFFT(c, true);\n for( Complex x : c )\n System.out.println(x);\n }", "public static void main(String[] args) {\n try {\n ModuleExtractionExamples.usingModuleExtractors();\n } catch (ExtractorException e) {\n e.printStackTrace();\n }\n //ModuleExtractionExamples.generatingSignatures();\n //ModuleExtractionExamples.writeSignaturesToFile();\n //etc...\n\n }", "public double[] getFFTBinFrequencies()\n {\n \tdouble[] FFTBins = new double[frameLength];\n \tdouble interval = samplingRate / frameLength;\n \tfor(int i = 0; i < frameLength; i++)\n \t{\n \t\tFFTBins[i] = interval * i;\n \t}\n \t\n \treturn FFTBins;\n }", "public static void main(String[] args) {\n Fakultet faks = new Fakultet();\n\n }", "public void extractAnnotationsFromWav(){\n try{\n int framesReturned;\n /* Reading in file as frames */\n if((framesReturned = wavFile.readFrames(fileAsFrames, 0, numberOfFramesInFile)) != numberOfFramesInFile){\n System.out.println(\"Failed to read in all of file, got \" + framesReturned + \" / \" + numberOfFramesInFile + \" frames\");\n return;\n }\n wavFile.close();\n //clearClipsDirectory(); //where we will store the new WAV files\n for(int i = 0; i < timeRanges.length; i++){ //for each annotation\n double extraTime;\n boolean annotationIsValid = true;\n if((extraTime = 1.1 - timeRanges[i][2]) > 0){ // Checking if annotation is less than 1.1s long\n annotationIsValid = addBufferToTimeRange(extraTime, i);\n }\n if(annotationIsValid){\n /* Extracting annotation */\n double[] annotationData = extractAnnotation(timeRanges[i][0], timeRanges[i][1], wavFile.getSampleRate());\n /* Storing annotation */\n if(!storeAnnotationAsWavFile(annotationData, DEFAULT_ANNOTATION_FILENAME + i + \".wav\", annotationData.length)){\n System.out.println(\"Failed to make a new annotation clip\");\n return;\n }\n }\n }\n } catch (Exception e) {\n Main.handleErrorMessage(\"Failed to read in file as frames\", e);\n }\n }", "public static void main(String[] args) throws Exception {\n\t\t// load data\n\n\t\tSystem.out.println(\"Use wrapper NaiveBayes. 2-phase feature selection\");\n\t\tif (args == null || args.length != 2) {\n\t\t\tSystem.out.println(\"args is wrong!\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tfile = args[0];\n\t\t\tSystem.out.println(file + \" is being processed.\");\n//\t\t\tnbFeatureLimit = Integer.parseInt(args[1]);\n\t\t\tratioNbFeatures = Double.parseDouble(args[1]);\n\t\t\tSystem.out.println(\"ratioNbFeatures \" + ratioNbFeatures + \" is used.\");\n\t\t}\n\n//\t\tpath = \"E:\\\\HisDoc project\\\\FeatureSelectionForJournal\\\\datasets\\\\_arff\\\\WDBC\\\\\";\n\t\tpath = System.getProperty(\"user.dir\") + File.separator;\n\t\tSystem.out.println(path);\n\n\t\tDataSource source = new DataSource(path + file);\n\t\tInstances data = source.getDataSet();\n\t\tif (data.classIndex() == -1)\n\t\t\tdata.setClassIndex(data.numAttributes() - 1);\n\t\t// phase 1\n\t\tSystem.out.println(\"Phase 1: greedy forward selection\");\n\t\tfinal long startTime1 = System.nanoTime();\n\t\tint[] indices = filterWrapper(data, FS.WRAPPER, Selection.GREEDYSTEPWISE);\n\t\tfinal long duration1 = System.nanoTime() - startTime1;\t\n\t\t\n\t\t\n\t\t// phase 2\n\t\tSystem.out.println(\"Phase 2: greedy forward selection\");\n\t\tInstances dataAfterPhase1 = getSelectedData(path, file, indices);\t\t\n\t\tfinal long startTime2 = System.nanoTime();\n\t\tindices = filterWrapper(dataAfterPhase1, FS.WRAPPER, Selection.GENETIC);\n\t\tfinal long duration2 = System.nanoTime() - startTime2;\n\t\tfinal long duration = duration1 + duration2;\n\t\tcrossValidation(dataAfterPhase1, indices, true);\n\t\t\n\t\tSystem.out.println(\"Result of \" + file + \": \");\n\t\tSystem.out.println(\"Dimensionality of selected features: \"\n\t\t\t\t+ indices.length);\n\t\tSystem.out.println(\"Running time for feature selection: \" + duration\n\t\t\t\t/ 1000000000 + \" seconds\");\n\t\tSystem.out.println(\"====================================\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t/*\n\t\tint[] indices = filterWrapper(data, FS.FILTER, Selection.GREEDYSTEPWISE);\n\n\t\tfinal long duration1 = System.nanoTime() - startTime1;\n\t\tInstances trainingSelectedRanData = getSelectedData(path, file, indices);\n\t\tInstances trainingSelectedData = getSelectedData(path, \"parz_training.arff\", indices);\n\t\tInstances testingSelectedData = getSelectedData(path, \"parz_testing.arff\", indices);\n\t\tfinal long startTime2 = System.nanoTime();\n\t\tindices = filterWrapper(trainingSelectedRanData, FS.FILTER, Selection.GENETIC);\n\t\tfinal long duration2 = System.nanoTime() - startTime2;\n\t\tfinal long duration = duration1 + duration2;\n\t\t// read the training and testing datasets, filter them and do training\n\t\t// and testing.\n\t\tdouble errorRate = traintest_Hao(trainingSelectedData,\n\t\t\t\ttestingSelectedData, indices);\n\t\tSystem.out.println(\"Result of \" + file + \": \");\n\t\tSystem.out.println(\"Dimensionality of selected features: \"\n\t\t\t\t+ indices.length);\n\t\tSystem.out.println(\"Running time for feature selection: \" + duration\n\t\t\t\t/ 1000000000 + \" seconds\");\n\t\tSystem.out.println(\"Error rate: \" + errorRate);\n\t\tSystem.out.println(\"====================================\");*/\n\t}", "public static void main(String[] args) throws Exception\n\t{\n\t\tList<Artifact> docs = Artifact.listByType(Type.Document,false);\n\t\tint counter = 0;\n\t\tfor(Artifact doc : docs)\n\t\t{\n\t\t\t\tMLExample.hibernateSession = HibernateUtil.clearSession(MLExample.hibernateSession);\n\t\t\t\tString doc_path = doc.getAssociatedFilePath();\n//\t\t\t\tList<MLExample> trainExamples = \n//\t\t\t\t\tMLExample.getExamplesInDocument(LinkExampleBuilder.ExperimentGroupTimexEvent, doc_path);\n//\t\t\t\tList<MLExample> trainExamples2 = \n//\t\t\t\t\tMLExample.getExamplesInDocument(LinkExampleBuilder.ExperimentGroupEventEvent, doc_path);\n\n\t\t\t\tList<MLExample> trainExamples3 = \n\t\t\t\t\tMLExample.getExamplesInDocument(SecTimeEventExampleBuilder.ExperimentGroupSecTimeEvent,\n\t\t\t\t\t\t\tdoc_path);\n\t\t\t\t\n\t\t\t\tList<MLExample> all_train_examples = new ArrayList<MLExample>();\n//\t\t\t\tall_train_examples.addAll(trainExamples);\n//\t\t\t\tall_train_examples.addAll(trainExamples2);\n\t\t\t\tall_train_examples.addAll(trainExamples3);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(MLExample example_to_process: all_train_examples)\n\t\t\t\t{\n\t\t\t\t\tNormalizedDependencyFeatures ndf = new NormalizedDependencyFeatures();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tndf.calculateFeatures(example_to_process);\n\n\t\t\t\t\tHibernateUtil.clearLoaderSession();\n\t\t\t\t}\n\t\t\t\tcounter++;\n\t\t\t\tFileUtil.logLine(null, \"Doc processed:\"+counter);\n\t\t//\t\tMLExample example_to_process = MLExample.getInstanceForLink\n\t\t//\t\t(PhraseLink.getInstance(4117), experimentgroup);\n\t\t}\n\t\t\n\t}", "@Test\n public void test19() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.KBInformation();\n assertEquals(0.0, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void main(String[] args) {\n\t\t\n\t\tPCM p = null;\n\t\tAbstractFeature a = null;\n\t\ta.setName(\"titre\"); \n\t\tp.addFeature(a);\n\t\tCell c = null;\n\t\t\n\t\tc.setContent(\"de\");\n\t\t\n\t\t\n\t\t// serializer in CSV or pcm format\n\t}", "public void start() {\n enable = true;\n audioRecord.startRecording();\n Thread monitorThread = new Thread(new Runnable() {\n public void run() {\n char lastDtmf = ' ';\n do {\n audioRecord.read(recordBuffer, 0, BUFFER_SIZE, AudioRecord.READ_BLOCKING);\n im = zero.clone(); //memset, I hope?\n System.arraycopy(recordBuffer, 0, re, 0, BUFFER_SIZE); //memset, I presume\n fft.fft(re, im);\n int f1 = 0, f2 = 0;\n char dtmf = ' ';\n for (int i = 0; i < BUFFER_SIZE/2; i++) {\n if ((Math.abs(im[i]) > 10)) {\n if ((i > 258) && (i < 261))\n f1 = 697;\n if ((i > 285) && (i < 289))\n f1 = 770;\n if ((i > 315) && (i < 318))\n f1 = 852;\n if ((i > 349) && (i < 352))\n f1 = 941;\n if ((i > 446) && (i < 451))\n f2 = 1209;\n if ((i > 493) && (i < 505))\n f2 = 1336;\n if ((i > 544) && (i < 553))\n f2 = 1477;\n if ((i > 605) && (i < 608))\n f2 = 1633;\n }\n }\n if ((f1 == 697) && (f2 == 1209))\n dtmf = '1';\n if ((f1 == 697) && (f2 == 1336))\n dtmf = '2';\n if ((f1 == 697) && (f2 == 1477))\n dtmf = '3';\n if ((f1 == 697) && (f2 == 1633))\n dtmf = 'A';\n if ((f1 == 770) && (f2 == 1209))\n dtmf = '4';\n if ((f1 == 770) && (f2 == 1336))\n dtmf = '5';\n if ((f1 == 770) && (f2 == 1477))\n dtmf = '6';\n if ((f1 == 770) && (f2 == 1633))\n dtmf = 'B';\n if ((f1 == 852) && (f2 == 1209))\n dtmf = '7';\n if ((f1 == 852) && (f2 == 1336))\n dtmf = '8';\n if ((f1 == 852) && (f2 == 1477))\n dtmf = '9';\n if ((f1 == 852) && (f2 == 1633))\n dtmf = 'C';\n if ((f1 == 941) && (f2 == 1209))\n dtmf = '*';\n if ((f1 == 941) && (f2 == 1336))\n dtmf = '0';\n if ((f1 == 941) && (f2 == 1477))\n dtmf = '#';\n if ((f1 == 941) && (f2 == 1633))\n dtmf = 'D';\n\n if (dtmf == ' ') {\n lastDtmf = ' ';\n } else {\n if (listener != null)\n if (dtmf != lastDtmf) {\n lastDtmf = dtmf;\n listener.receivedDTMF(dtmf);\n }\n }\n } while (enable);\n audioRecord.stop();\n }\n });\n monitorThread.start();\n }", "@Test\n public void testApplication() {\n assertEquals(440.0, GuitarHeroLite.frequency(24), 0.05);\n }", "@Override\n public List<Map<Frequency, DataForDetection>> getStuffReference() {\n return super.getStuffReference();\n }", "public static void getOriginalFrequencies(double[] f)\n {\n f[0] = 0.0866;\n f[1] = 0.0440;\n f[2] = 0.0391;\n f[3] = 0.0570;\n f[4] = 0.0193;\n f[5] = 0.0367;\n f[6] = 0.0581;\n f[7] = 0.0833;\n f[8] = 0.0244;\n f[9] = 0.0485;\n f[10] = 0.0862;\n f[11] = 0.0620;\n f[12] = 0.0195;\n f[13] = 0.0384;\n f[14] = 0.0458;\n f[15] = 0.0695;\n f[16] = 0.0610;\n f[17] = 0.0144;\n f[18] = 0.0353;\n f[19] = 0.0709;\n }", "public static void main(String[] args) {\n\r\n\t\ttry{\r\n\t\t\tString tac2008Path = \"C:/Users/jipeng/Desktop/Qiang/updateSum/TAC2008_Update_Summarization_Documents/UpdateSumm08_test_docs_files\";\r\n\t\t\tExtractPrag ep = new ExtractPrag();\r\n\t\t\t\r\n\t\t\t//String wordPath = \"\";\r\n\t\t\t//ep.extractWords(wordPath)\r\n\t\t\tep.allDataset(tac2008Path);\r\n\t\t\t\r\n\t\t}catch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public int getFrequency()\n\t{\n\t\treturn frequency;\n\t}", "com.google.protobuf.ByteString\n getFrequencyBytes();", "public static void main(String[] args) {\r\n\t\tList<String> tracklist = TracklistCreator.readTrackList(\"work\\\\all_wav.txt\");\r\n\t\tint filesProcessed = 0;\r\n\t\tfor (String wavFilePath : tracklist) {\r\n\t\t\ttry {\r\n\t\t\t\tString track = StringUtils.substringAfterLast(wavFilePath, File.separator);\r\n\t\t\t\tString beatFilePath = TARGET_DIR + track + PathConstants.EXT_BEAT;\r\n\t\t\t\tnew VampBeatTimesProvider(wavFilePath, beatFilePath, new Configuration().pre);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t if (++filesProcessed % 10 == 0) {\r\n\t \tLOG.info(filesProcessed + \" files were processed\");\r\n\t }\r\n\t\t}\r\n\t\tLOG.info(\"Done. \" + filesProcessed + \" files were saved to '\" + TARGET_DIR + \"'\");\r\n\t}", "public java.lang.Integer getFrequency() {\n return frequency;\n }", "public interface AudioHeader\n{\n /**\n * @return the audio file type\n */\n public abstract String getEncodingType();\n\n /**\n * @return the ByteRate of the Audio, this is the total average amount of bytes of data sampled per second\n */\n public Integer getByteRate();\n\n\n\n /**\n * @return the BitRate of the Audio, this is the amount of kilobits of data sampled per second\n */\n public String getBitRate();\n\n /**\n * @return bitRate as a number, this is the amount of kilobits of data sampled per second\n */\n public long getBitRateAsNumber();\n\n\n /**\n *\n * @return length of the audio data in bytes, exactly what this means depends on the audio format\n *\n * TODO currently only used by Wav/Aiff/Flac/Mp4\n */\n public Long getAudioDataLength();\n\n\n /**\n *\n * @return the location in the file where the audio samples start\n *\n * TODO currently only used by Wav/Aiff/Flac/Mp4\n */\n public Long getAudioDataStartPosition();\n\n\n /**\n *\n * @return the location in the file where the audio samples end\n *\n * TODO currently only used by Wav/Aiff/Flac/Mp4\n */\n public Long getAudioDataEndPosition();\n\n\n /**\n * @return the Sampling rate, the number of samples taken per second\n */\n public String getSampleRate();\n\n /**\n * @return he Sampling rate, the number of samples taken per second\n */\n public int getSampleRateAsNumber();\n\n /**\n * @return the format\n */\n public String getFormat();\n\n /**\n * @return the number of channels (i.e 1 = Mono, 2 = Stereo)\n */\n public String getChannels();\n\n /**\n * @return if the sampling bitRate is variable or constant\n */\n public boolean isVariableBitRate();\n\n /**\n * @return track length in seconds\n */\n public int getTrackLength();\n\n /**\n *\n * @return track length as float\n */\n public double getPreciseTrackLength();\n\n /**\n * @return the number of bits in each sample\n */\n public int getBitsPerSample();\n\n /**\n *\n * @return if the audio codec is lossless or lossy\n */\n public boolean isLossless();\n\n /**\n *\n * @return the total number of samples, this can usually be used in conjunction with the\n * sample rate to determine the track duration\n */\n public Long getNoOfSamples();\n}", "private static void computeIDF()throws Exception{\r\n\t\tidfArray = new double[nounList.size()];\r\n\t\tBufferedReader br = new BufferedReader(new FileReader(NOUN_DF));\r\n\t\tString line = null;\r\n\t\tline = br.readLine();\r\n\t\tint cnt = 0;\r\n\t\tdocumentSize = Integer.parseInt(line);\r\n\t\twhile((line = br.readLine())!=null){\r\n\t\t\tdouble df = Double.parseDouble(line.split(\":\")[1]);\r\n\t\t\tif(df == 0.0){\r\n\t\t\t\tidfArray[cnt++] = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdouble idf = Math.log10(documentSize / df);\r\n\t\t\t\tidfArray[ cnt++ ] = idf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tbr.close();\r\n\t}", "public int getSamples(){ \n return this.samples; \n }", "@Test\n public void test22() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n FastVector fastVector0 = evaluation0.predictions();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "public void setAmplitude(float amplitude) {\n/* 79 */ this.amplitude = amplitude;\n/* */ }", "protected static double[] getFrequencies(List<Sequence> sequences) {\n return getFrequenciesMaybeSafe(sequences, false);\n }", "public static void selectFeature() throws IOException {\n\t\tString trainPath = \"./corpus/trainData\";\n\t\tString stopPath = \"./corpus/english.stop\";\n\t\tString outPath = \"./corpus/features\";\n\t\tFileWriter fw = new FileWriter(outPath);\n\t\tFileReader fr = new FileReader(trainPath);\n\t\tFileReader fr2 = new FileReader(stopPath);\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\tBufferedReader br = new BufferedReader(fr);\n\t\tBufferedReader br2 = new BufferedReader(fr2);\n\t\tString oneline;\n\n\t\tArrayList<String> as = new ArrayList<String>();\n\t\twhile ((oneline = br2.readLine()) != null) {\n\t\t\tas.add(oneline);\n\t\t}\n\t\tString[] stopWords = new String[as.size()];\n\t\tas.toArray(stopWords);\n\n\t\tHashtable<String, Integer> hs = new Hashtable<String, Integer>();\n\n\t\tAnalyzer analyzer = new SnowballAnalyzer(\"English\", stopWords);\n\n\t\ttry {\n\t\t\twhile ((oneline = br.readLine()) != null) {\n\t\t\t\tint pos = oneline.indexOf(\"\\t\");\n\t\t\t\tString topic = oneline.substring(0, pos);\n\t\t\t\tString content = oneline.substring(pos + 1);\n\t\t\t\t// StringTokenizer st=new StringTokenizer(content,\" \");\n\n\t\t\t\tTokenStream stream = analyzer.tokenStream(\"contents\",\n\t\t\t\t\t\tnew StringReader(content));\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tToken token = stream.next();\n\t\t\t\t\tif (token == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tString tmp = token.termText();\n\t\t\t\t\tif (!hs.containsKey(tmp)) {\n\t\t\t\t\t\ths.put(tmp, new Integer(1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tInteger num = hs.get(tmp);\n\t\t\t\t\t\ths.put(tmp, num + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tList<Map.Entry> list = new ArrayList<Map.Entry>(hs.entrySet());\n\t\tCollections.sort(list, new Comparator<Map.Entry>() {\n\t\t\tpublic int compare(Map.Entry e1, Map.Entry e2) {\n\t\t\t\tInteger i1 = (Integer) e1.getValue();\n\t\t\t\tInteger i2 = (Integer) e2.getValue();\n\t\t\t\treturn i2.compareTo(i1);\n\t\t\t}\n\t\t});\n\t\tint count = 0;\n\t\tSystem.out.println(\"word - freq\");\n\t\tSystem.out.println(\"-------------\");\n\t\tfor (Map.Entry e : list) {\n\t\t\tInteger num = (Integer) e.getValue();\n\t\t\tString term = (String) e.getKey();\n\t\t\tif (count++ < 2000) {\n\t\t\t\tbw.write(term);\n\t\t\t\tbw.newLine();\n\t\t\t}\n\n\t\t}\n\n\t\tbw.close();\n\n\t\tSystem.out.println(hs.keySet().size());\n\t\tSystem.out.println(count);\n\n\t}", "public MdnFeatures()\n {\n }" ]
[ "0.6037287", "0.60102075", "0.5998475", "0.5863536", "0.58354074", "0.57006204", "0.5642107", "0.5631789", "0.5590085", "0.55431974", "0.5479248", "0.5443522", "0.5424887", "0.5411906", "0.5397214", "0.5387644", "0.53714854", "0.53288513", "0.53158456", "0.53137577", "0.5310386", "0.5288886", "0.5276031", "0.52720463", "0.52630174", "0.52551347", "0.5237332", "0.52162504", "0.52132714", "0.5207487", "0.5207159", "0.52036536", "0.5200417", "0.5194599", "0.519144", "0.51678795", "0.5162906", "0.5150688", "0.514764", "0.5146883", "0.51259595", "0.51251733", "0.5119935", "0.5103993", "0.51039463", "0.5081125", "0.507615", "0.50596976", "0.5036005", "0.5030328", "0.50285757", "0.50284684", "0.5023353", "0.50186795", "0.5017097", "0.5012544", "0.5011208", "0.50021684", "0.50006354", "0.49905503", "0.49893814", "0.4980257", "0.49730924", "0.49707738", "0.4969173", "0.49613246", "0.49592096", "0.49588424", "0.49586663", "0.49564034", "0.4951201", "0.4949947", "0.4943622", "0.49403122", "0.49320975", "0.49195862", "0.49149704", "0.4912188", "0.49101368", "0.49084294", "0.48971736", "0.48947382", "0.4890257", "0.48889613", "0.48832443", "0.48831493", "0.48829886", "0.48821068", "0.48817378", "0.48778644", "0.4876093", "0.48741975", "0.4863805", "0.4858313", "0.48581418", "0.48531455", "0.48471737", "0.48419014", "0.48361504", "0.48350903", "0.4834837" ]
0.0
-1
Process the request and return an ActionForward instance describing where and how control should be forwarded, or nullif the response has already been completed.
public ActionForward execute ( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Verify login if(!verifyLogin(request, response, true)) { return mapping.findForward("login"); } // Get parameters int pageNum = 0; try { if(request.getParameter("pageNum") != null) pageNum = Integer.parseInt(request.getParameter("pageNum")); }catch(Exception e) { Log.log(e, Log.FATAL_ERROR); } // Add list of solutions liked by user ArrayList<CommentBean> comments = new ArrayList<CommentBean>(); ReturnList<Comment> results = DBQueries.getFriendComments(curUser.getUid(), pageNum); List<Comment> cList = results.list; for(int i = 0; i < cList.size(); i++) { comments.add(new CommentBean(cList.get(i), curUser)); } request.setAttribute("comments", comments); // Set next prev setNextPrev(request, pageNum, results); request.setAttribute("actionURL", "/viewfriendcomments"); // Forward to success return mapping.findForward("success"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void sendForward(HttpServletRequest request, HttpServletResponse response, String location) throws AccessControlException, ServletException, IOException;", "ForwardAction createForwardAction();", "private void forward(ServletRequest request, ServletResponse response, AuthTokenState state){\n\t\tRequestDispatcher dispatcher = null;\n\t\t\n\t\t/**\n\t\t * Following codes not work in case of couple with Spring Security !!!\n\t\t * FilterConfig filterConfig = this.getFilterConfig();\n\t\t * filterConfig.getServletContext().getRequestDispatcher(FILTER_PREFIX + ACT_REISSUE_TOKEN);\n\t\t **/\n\t\ttry {\n\t\t\tif(AuthTokenState.NEED_AUTHC == state){\n\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_AUTH_TOKEN);\n\t\t\t\n\t\t\t}else if(AuthTokenState.BAD_TOKEN == state ||\n\t\t\t\t\tAuthTokenState.GHOST_TOKEN == state ||\n\t\t\t\t\tAuthTokenState.INVALID_TOKEN == state){\n\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_BAD_TOKEN);\n\t\t\t\n\t\t\t}else if(AuthTokenState.EXPIRE_TOKEN == state){\n\t\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_EXPIRE_TOKEN);\n\t\t\t}else if(AuthTokenState.REISSUE_TOKEN == state){\n\t\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_REISSUE_TOKEN);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tdispatcher = request.getRequestDispatcher(FILTER_PREFIX + ACT_TRAP_ALL);\n\t\t\t}\n\t\t\t\n\t\t\tdispatcher.forward(request, response);\n\t\t} catch (ServletException | IOException e) {\n\t\t\t\n\t\t\tLOGGER.error(\"fail to forward the request\", e);\n\t\t\t// ignore\n\t\t}\n\t}", "public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n Logger l = LogUtils.enterLog(getClass(), \"execute\");\r\n\r\n ActionForward af = null;\r\n Record inputRecord = getInputRecord(request);\r\n\r\n if (l.isLoggable(Level.FINE)) {\r\n l.logp(Level.FINE, getClass().getName(), \"execute\", \"Request URI:\" + request.getRequestURI() + \"', process: '\" + request.getParameter(\"process\") + \"', parameters as Input Record: \" + inputRecord);\r\n String txtXML = request.getParameter(\"txtXML\");\r\n if (!StringUtils.isBlank(txtXML)) {\r\n l.logp(Level.FINE, getClass().getName(), \"execute\", \"txtXML as Input RecordSet: \" + getInputRecordSet(request));\r\n }\r\n }\r\n\r\n boolean isAjaxRequest = isAjaxRequest(request);\r\n try {\r\n String policyNo = \"\";\r\n\r\n if (!StringUtils.isBlank(request.getParameter(RequestIds.POLICY_NO))) {\r\n policyNo = request.getParameter(RequestIds.POLICY_NO);\r\n }\r\n else {\r\n if (RequestStorageManager.getInstance().has(RequestStorageIds.POLICY_NO)) {\r\n policyNo = (String) RequestStorageManager.getInstance().get(RequestStorageIds.POLICY_NO);\r\n }\r\n }\r\n\r\n boolean requestDueToFailure = false;\r\n if (MessageManager.getInstance().hasErrorMessages()) {\r\n requestDueToFailure = true;\r\n }\r\n\r\n // Load the Policy Header even if the policyNo is blank so that if the previous policy was locked, it will be unlocked.\r\n PolicyHeader policyHeader = null;\r\n try {\r\n\r\n //Initialize the save token. Don't do this for Ajax requests because the save token is already set for the page.\r\n if (!isAjaxRequest) {\r\n initializeLoadRequestForSave(request, getTokenConstant());\r\n if (inputRecord.hasField(\"noLoadingDiv\")\r\n && YesNoFlag.getInstance(inputRecord.getStringValue(\"noLoadingDiv\")).booleanValue()) {\r\n request.setAttribute(\"noLoadingDiv\", true);\r\n }\r\n }\r\n\r\n RequestStorageManager.getInstance().set(RequestIds.IS_PREVIEW_REQUEST,\r\n (YesNoFlag.getInstance((String) inputRecord.getFieldValue(RequestIds.IS_PREVIEW_REQUEST, \"N\")).booleanValue()));\r\n\r\n policyHeader = loadPolicyHeader(request);\r\n\r\n handlePreviewRequest(request, policyHeader);\r\n\r\n if (inputRecord.getBooleanValue(\"processRatingB\", false).booleanValue()) {\r\n UserSessionManager.getInstance().getUserSession().set(\"PreviousPolicyHeader\", policyHeader);\r\n }\r\n\r\n // Load the PolicyHeader Oasis Fields for the included policyHeader.jsp.\r\n if (policyHeader != null) {\r\n //For access trail\r\n request.setAttribute(AccessTrailRequestIds.ACCESS_TRAIL_SOURCE_TABLE_NAME, \"POLICY_TERM_HISTORY\");\r\n request.setAttribute(AccessTrailRequestIds.ACCESS_TRAIL_SOURCE_RECORD_NO, policyHeader.getPolicyNo());\r\n request.setAttribute(AccessTrailRequestIds.ACCESS_TRAIL_SOURCE_RECORD_FK, policyHeader.getPolicyTermHistoryId());\r\n\r\n // If the Policy Header is loaded:\r\n // 1. Load the Policy Header specific OasisFields and create field/value beans\r\n securePage(request, form, true, true);\r\n\r\n // record for header fields\r\n Record record = (Record) request.getAttribute(RequestIds.NON_GRID_FIELDS_RECORD);\r\n request.setAttribute(RequestIds.HEADER_FIELDS_RECORD, record);\r\n request.removeAttribute(RequestIds.NON_GRID_FIELDS_RECORD);\r\n\r\n OasisFields fieldsMap = (OasisFields) request.getAttribute(IOasisAction.KEY_FIELDS);\r\n Term currentTerm = policyHeader.getPolicyTerm(policyHeader.getPolicyTermHistoryId());\r\n boolean isWipAvailable = currentTerm.isWipExists();\r\n boolean isOfficialAailable = currentTerm.isOfficialExists();\r\n boolean isEndorsementQuoteAailable = currentTerm.isEndorsementQuoteExists();\r\n boolean isRenewalQuoteAailable = currentTerm.isRenewalQuoteExists();\r\n\r\n OasisFormField field = (OasisFormField) fieldsMap.get(\"policyViewMode\");\r\n String lovSql = \"[NO_ADD_SELECT_OPTION]LIST:\";\r\n if (isOfficialAailable) {\r\n lovSql = lovSql + \"OFFICIAL,Official,\";\r\n }\r\n if (isWipAvailable) {\r\n lovSql = lovSql + \"WIP,WIP,\";\r\n }\r\n if (isEndorsementQuoteAailable) {\r\n //get Endorsment Quote list\r\n RecordSet rs = getPolicyManager().loadAllEndorsementQuote(policyHeader);\r\n Iterator itor = rs.getRecords();\r\n while (itor.hasNext()) {\r\n Record endQuoteRecord = (Record) itor.next();\r\n String endQuoteId = endQuoteRecord.getStringValue(\"endorsementQuoteId\");\r\n lovSql = lovSql + \"ENDQUOTE,Endorsement Quote: \" + endQuoteId + \",\";\r\n }\r\n\r\n }\r\n else if (isRenewalQuoteAailable) {\r\n //get renewal quote list\r\n RecordSet rs = getPolicyManager().loadAllEndorsementQuote(policyHeader);\r\n Iterator itor = rs.getRecords();\r\n while (itor.hasNext()) {\r\n Record endQuoteRecord = (Record) itor.next();\r\n String endQuoteId = endQuoteRecord.getStringValue(\"endorsementQuoteId\");\r\n lovSql = lovSql + \"ENDQUOTE,Renewal Quote: \" + endQuoteId + \",\";\r\n }\r\n }\r\n\r\n if (PolicyAttributesFactory.getInstance().isDisplayQuoteInViewModeEnable(\r\n policyHeader.getLastTransactionInfo().getTransEffectiveFromDate(),\r\n policyHeader.getPolicyCycleCode(),\r\n policyHeader.getQuoteCycleCode(),\r\n policyHeader.getLastTransactionInfo().getTransactionTypeCode(),\r\n policyHeader.getRecordMode(),\r\n policyHeader.getPolicyStatus())) {\r\n Record r = policyHeader.toRecord();\r\n r.setFieldValue(QuoteFields.SELECT_MODE,\r\n QuoteFields.joinSelectMode(QuoteFields.EXCL_SELF, QuoteFields.TERM_SENS, QuoteFields.EXCL_NB,\r\n QuoteFields.EXCL_INVALID, QuoteFields.EXCL_ACCEPTED));\r\n RecordSet rs = getQuoteManager().loadQuoteVersions(r);\r\n\r\n for (int i = 0; i < rs.getRecordList().size(); i ++ ) {\r\n r = rs.getRecordList().get(i);\r\n String text = PolicyAttributesFactory.getInstance().getDisplayQuoteInViewModeText(\r\n policyHeader.getLastTransactionInfo().getTransEffectiveFromDate(),\r\n PolicyFields.getPolicyCycleCode(r),\r\n PolicyFields.getQuoteCycleCode(r),\r\n r);\r\n if (text != null) {\r\n lovSql = lovSql + \"QUOTE:\"+PolicyHeaderFields.getPolicyNo(r) +\r\n \",\" + text + \",\";\r\n }\r\n }\r\n }\r\n field.setLovSql(lovSql);\r\n // 2. Load any list of values for the Policy Header\r\n loadListOfValues(request, form);\r\n // 3. Reset the map attribute to a specific policyHeaderFieldsMap name\r\n request.setAttribute(KEY_PH_FIELDS, fieldsMap);\r\n request.setAttribute(IOasisAction.KEY_HEADER_PAGE_FIELDS, fieldsMap);\r\n //set selected endquote\r\n\r\n //TODO: see workaround below\r\n// request.removeAttribute(IOasisAction.KEY_FIELDS);\r\n// if(policyHeader.getPolicyIdentifier().getPolicyViewMode().isEndquote()){\r\n// request.setAttribute(\"policyViewMode\",\"ENDQUOTE:\"+policyHeader.getLastTransactionId());\r\n// }\r\n }\r\n }\r\n catch (Exception e) {\r\n l.logp(Level.WARNING, getClass().getName(), \"execute\", \"Failed to load the policy information for policyNo '\" + policyNo + \"'\", e);\r\n }\r\n final StringBuffer requestInformation = new StringBuffer();\r\n requestInformation.append(\"URI:'\").append(request.getRequestURI()).append(\"', \");\r\n requestInformation.append(\"process:'\").append(request.getParameter(RequestIds.PROCESS)).append(\"', \");\r\n requestInformation.append(\"UserId:'\").append(UserSessionManager.getInstance().getUserSession().getUserId()).append(\"', \");\r\n if (!StringUtils.isBlank(policyNo)) {\r\n if (policyHeader != null) {\r\n\r\n if (l.isLoggable(Level.INFO)) {\r\n if (!mapping.getPath().endsWith(\"maintainLock\") || l.isLoggable(Level.FINE)) {\r\n requestInformation.append(\"Policy No:'\").append(policyHeader.getPolicyNo()).append(\"', \");\r\n requestInformation.append(\"Policy Id:'\").append(policyHeader.getPolicyId()).append(\"', \");\r\n requestInformation.append(\"Policy Type:'\").append(policyHeader.getPolicyTypeCode()).append(\"', \");\r\n requestInformation.append(\"View Mode:'\").append(policyHeader.getPolicyIdentifier().getPolicyViewMode()).append(\"', \");\r\n requestInformation.append(\"Lock Id:'\").append(policyHeader.getPolicyIdentifier().getPolicyLockId()).append(\"', \");\r\n requestInformation.append(\"IsSelectedTermInWIP:'\").append(policyHeader.isWipB()).append(\"', \");\r\n requestInformation.append(\"Own Lock?\").append(policyHeader.getPolicyIdentifier().ownLock()).append(\"', \");\r\n requestInformation.append(\"Policy History Term Id:'\").append(policyHeader.getPolicyTermHistoryId()).append(\"', \");\r\n requestInformation.append(\"Term Base Id:'\").append(policyHeader.getTermBaseRecordId()).append(\"', \");\r\n requestInformation.append(\"Effective From Date:'\").append(policyHeader.getTermEffectiveFromDate()).append(\"', \");\r\n requestInformation.append(\"Effective To Date:'\").append(policyHeader.getTermEffectiveToDate()).append(\"', \");\r\n requestInformation.append(\"Risk Id:'\").append(inputRecord.getStringValue(\"riskId\", \"\")).append(\"', \");\r\n requestInformation.append(\"Coverage Id:'\").append(inputRecord.getStringValue(\"coverageId\", \"\")).append(\"', \");\r\n requestInformation.append(\"Latest Transaction Id:'\").append(policyHeader.getLastTransactionInfo().getTransactionLogId()).append(\"' \");\r\n\r\n l.logp(Level.INFO, getClass().getName(), \"execute\", \"Request Information: \" + requestInformation.toString());\r\n }\r\n\r\n if (l.isLoggable(Level.FINE)) {\r\n l.logp(Level.FINE, getClass().getName(), \"execute\", \"policyHeader = \" + policyHeader);\r\n }\r\n\r\n }\r\n af = super.execute(mapping, form, request, response);\r\n }\r\n else {\r\n if (requestDueToFailure) {\r\n l.logp(Level.INFO, getClass().getName(), \"execute\", \"Request Information: \" + requestInformation.toString());\r\n // Don't forward to failure page if this request is already the result of a failure.\r\n af = super.execute(mapping, form, request, response);\r\n }\r\n else {\r\n l.logp(Level.INFO, getClass().getName(), \"execute\", \"Request Information: \" + requestInformation.toString());\r\n // Failed to load the PolicyHeader for the requested PolicyNo.\r\n l.logp(Level.WARNING, getClass().getName(), \"execute\", \"Unable to load the policy information for policyNo '\" + policyNo + \"'\");\r\n MessageManager.getInstance().addErrorMessage(\"pm.findpolicy.noData.msg\", new Object[]{policyNo});\r\n if (isAjaxRequest) {\r\n // If this is an Ajax request, write the error\r\n writeAjaxResponse(response, new Record(), true);\r\n }\r\n else {\r\n // Otherwise, return the global forward to the find policy page\r\n af = mapping.findForward(\"loadPolicyFailure\");\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n requestInformation.append(\"Policy No Is Not Provided\");\r\n l.logp(Level.INFO, getClass().getName(), \"execute\", \"Request Information: \" + requestInformation.toString());\r\n af = super.execute(mapping, form, request, response);\r\n }\r\n // Reset notification transaction time\r\n OasisUser oasisUser = UserSessionManager.getInstance().getUserSession().getOasisUser();\r\n if (oasisUser.hasRequestedTransactionTime()) {\r\n oasisUser.setRequestedTransactionTime(null);\r\n }\r\n }\r\n catch (Exception e) {\r\n AppException ae = ExceptionHelper.getInstance().handleException(\"Error loading policy header information.\", e);\r\n l.throwing(getClass().getName(), \"execute\", ae);\r\n String forwardString = handleError(AppException.UNEXPECTED_ERROR, \"Error loading policy header information.\", e, request, mapping);\r\n af = mapping.findForward(forwardString);\r\n }\r\n\r\n // Set all fields in fieldsMap to readonly if there's \"readOnly\" attribute is set to \"Y\" in request.\r\n // The fieldId of this indicator field is defined in EntitlementFields class.\r\n // For some unkown reason, sometime the readOnly attribute is set as String\r\n // Below codes are from safe perspective\r\n Object oReadonly = request.getAttribute(EntitlementFields.READ_ONLY);\r\n boolean isReadonly = false;\r\n if (oReadonly != null) {\r\n if (oReadonly instanceof String) {\r\n isReadonly = YesNoFlag.getInstance((String) oReadonly).booleanValue();\r\n }\r\n else if (oReadonly instanceof YesNoFlag) {\r\n isReadonly = ((YesNoFlag) oReadonly).booleanValue();\r\n }\r\n }\r\n\r\n Object oHanldeLayer = request.getAttribute(EntitlementFields.HANDLE_LAYER);\r\n boolean isHanldeLayer = true;\r\n if (oHanldeLayer != null) {\r\n if (oHanldeLayer instanceof String) {\r\n isHanldeLayer = YesNoFlag.getInstance((String) oHanldeLayer).booleanValue();\r\n }\r\n else if (oHanldeLayer instanceof YesNoFlag) {\r\n isHanldeLayer = ((YesNoFlag) oHanldeLayer).booleanValue();\r\n }\r\n }\r\n\r\n if (isReadonly) {\r\n String [] excludedFieldsList = null;\r\n if (hasAlwaysEnabledFieldIds())\r\n excludedFieldsList = getAlwaysEnabledFieldIds().split(\",\");\r\n setFieldsToReadOnly(request, excludedFieldsList, isHanldeLayer, true);\r\n }\r\n\r\n if (isSaveInProgress()) {\r\n if (isAjaxRequest && MessageManager.getInstance().hasConfirmationPrompts()) {\r\n // The Ajax request was a save request, and did not complete because it requires confirmations.\r\n // Remove the save in-progress session attribute to indicate that the save process has been exited.\r\n updateSessionToken(request,getTokenConstant());\r\n removeSaveInProgressIndicator();\r\n }\r\n else if (request.getAttribute(IOasisAction.KEY_ERROR) == null &&\r\n request.getAttribute(IOasisAction.KEY_VALIDATION_ERROR) == null &&\r\n MessageManager.getInstance().hasErrorMessages() == false\r\n ) {\r\n\r\n saveProcessSucceeded(request, getTokenConstant());\r\n }\r\n else {\r\n updateSessionToken(request, getTokenConstant());\r\n saveProcessFailed(request);\r\n }\r\n } else {\r\n //make sure a new token gets generated when loading a page. this will avoid calling the saveToken() on all the action classes initial load.\r\n //the IS_STRUTS_LOAD_ACTION is to make sure that it is loading for the first time.\r\n if (!isAjaxRequest(request) && request.getAttribute(RequestStorageIds.IS_STRUTS_LOAD_ACTION) == null) {\r\n //saveToken(request, getTokenConstant());\r\n updateCSRFTokenInForwardParameter(request);\r\n }\r\n }\r\n\r\n request.getSession().removeAttribute(RequestStorageIds.IS_STRUTS_LOAD_ACTION);\r\n\r\n request.removeAttribute(RequestStorageIds.IS_STRUTS_LOAD_ACTION);\r\n l.exiting(getClass().getName(), \"execute\", af);\r\n return af;\r\n }", "@Override\n\tpublic Object forward(Object input) {\n\t\treturn null;\n\t}", "public ActionForward execTaskForward( ActionMapping mapping, ActionForm form, HttpServletRequest request,\r\n HttpServletResponse response, WatchedTask task )\r\n throws IOException, ServletException\r\n {\r\n\r\n request.getRequestDispatcher( ( (StrutsWatchedTask) task ).getActionURL() ).forward( request, response );\r\n\r\n return null;\r\n }", "public ActionForward execute(ActionMapping actionMapping,\r\n ActionForm actionForm,\r\n HttpServletRequest request,\r\n HttpServletResponse response) {\r\n return process(actionMapping, actionForm, request, response, null);\r\n }", "protected ActionForward customProcess(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response, String name) throws Throwable {\r\n \treturn performAction(actionMapping, actionForm, request, response);\r\n }", "public ActionForward handleRequest( UserRequest request )\n throws IOException, ServletException\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 1 );\n ActionErrors errors = new ActionErrors();\n /*\n java.util.Enumeration enum = request.getParameterNames();\n while(enum.hasMoreElements()){\n String key = (String)enum.nextElement();\n String[] paramValues = request.getParameterValues(key);\n log.debug(\"request params\");\n for(int i=0;i < paramValues.length;i++){\n log.debug(key + \" : \" + paramValues[i]);\n }\n } \n */ \n if( buttonPressed( request, BUTTON_NEXT ) )\n {\n log.debug(\"Processing next button\");\n if (validatePage( request, pageNumber, BUTTON_NEXT ) )\n {\n log.debug(\"Showing next page\");\n onBeforeDisplayEvent( request, pageNumber, BUTTON_NEXT );\n return nextPage( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n }\n else if (buttonPressed( request, BUTTON_BACK ) )\n {\n log.debug(\"Processing back button\");\n if( validatePage( request, pageNumber, BUTTON_BACK ) )\n {\n log.debug(\"Showing previous page\");\n onBeforeDisplayEvent( request, pageNumber, BUTTON_BACK );\n return previousPage( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n \n }\n else if (buttonPressed( request, BUTTON_CREATE ) )\n {\n log.debug(\"Processing create button\");\n if( validatePage( request, pageNumber, BUTTON_CREATE ) )\n {\n log.debug(\"Processing create button\");\n return processCreate( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n }\n else if (buttonPressed( request, BUTTON_CANCEL ) )\n {\n log.debug(\"Processing cancel button\");\n return processCancel( request );\n }\n else\n {\n log.debug(\"Processing unknown button\");\n return processUnknownButton( request );\n }\n }", "@Override\n\t\tpublic ActionTestFacade getForward() {\n\t\t\treturn null;\n\t\t}", "protected void doProcess(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\trequest.setCharacterEncoding(\"utf-8\");\r\n\t\tString requestURI = request.getRequestURI();\r\n\t\tString contextPath = request.getContextPath();\r\n\t\tString command = requestURI.substring(contextPath.length());\r\n\t\tAction action = null;\r\n\t\tActionForward forward = null;\r\n\t\t\r\n\t\tif (command.equals(\"/managerLogin.ma\")) {\r\n\t\t\taction = new ManagerLogInAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (command.equals(\"/managerLogOut.ma\")) {\r\n\t\t\taction = new ManagerLogOutAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (command.equals(\"/memberList.ma\")) {\r\n\t\t\taction = new MemberListAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (command.equals(\"/managerDelete.ma\")) {\r\n\t\t\taction = new ManagerDeleteFromMemberAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\tif (forward != null) {\r\n\t\t\tif (forward.isRedirect()) {\r\n\t\t\t\tresponse.sendRedirect(forward.getPath());\r\n\t\t\t} else {\r\n\t\t\t\tRequestDispatcher dispatcher = request.getRequestDispatcher(forward.getPath());\r\n\t\t\t\tdispatcher.forward(request, response);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public ActionForward execute(ActionMapping mapping,\n ActionForm form,\n HttpServletRequest request,\n HttpServletResponse response)\n throws Exception {\n\n // default target to success\n String strTarget = \"success\";\n \n\n String strUrl = request.getParameter(\"url\");\n\n // set the target to failure if we could not retrieve the organ list\n if (StringUtils.hasValue(strUrl)) {\n // put all the servers in the request\n request.setAttribute(\"url\", strUrl);\n } else {\n strTarget = \"error\";\n }\n\n // forward to the appropriate View\n return mapping.findForward(strTarget);\n }", "public ActionForward processResponse(ActionMapping mapping, ActionForm form, HttpServletRequest request,\r\n HttpServletResponse response) throws Exception {\r\n Logger l = LogUtils.enterLog(getClass(), \"processResponse\", new Object[]{mapping, form, request, response});\r\n String forwardString = \"viewAssociatedRisk\";\r\n\r\n try {\r\n // Get PolicyHeader\r\n PolicyHeader policyHeader = getPolicyHeader(request);\r\n String policyNo = policyHeader.getPolicyNo();\r\n\r\n // Check if workflow exists, otherwise throw application exception\r\n WorkflowAgent wa = WorkflowAgentImpl.getInstance();\r\n if (wa.hasWorkflow(policyNo)) {\r\n Record inputRecord = getInputRecord(request);\r\n boolean ibnrNotifyConfirmed = InactiveRiskFields.getIbnrNotifyConfirmed(inputRecord).booleanValue();\r\n if (!ibnrNotifyConfirmed) {\r\n wa.setWorkflowTransitionParameter(policyNo, \"INVALID\");\r\n }\r\n else {\r\n // If there is only one associated risk\r\n if (inputRecord.hasStringValue(InactiveRiskFields.ASSOCIOATED_RISK_COUNT)\r\n && InactiveRiskFields.getAssociatedRiskCount(inputRecord).equals(\"1\")) {\r\n // perform cancel IBNR active risk directly and forward to invokeViewIbnrInactiveRisk step\r\n getIbnrRiskManager().performCancellation(policyHeader, inputRecord);\r\n wa.setWorkflowTransitionParameter(policyNo, \"SINGLEASSO\");\r\n }\r\n else if (inputRecord.hasStringValue(InactiveRiskFields.ASSOCIOATED_RISK_COUNT)\r\n && InactiveRiskFields.getAssociatedRiskCount(inputRecord).equals(\"0\")) { // should not enter this part\r\n wa.setWorkflowTransitionParameter(policyNo, \"INVALID\");\r\n }\r\n\r\n // Set attributes\r\n String transactionLogId = policyHeader.getLastTransactionInfo().getTransactionLogId();\r\n String transEffDate = policyHeader.getLastTransactionInfo().getTransEffectiveFromDate();\r\n String issueCompanyId = policyHeader.getIssueCompanyEntityId();\r\n wa.setWorkflowAttribute(policyNo, TransactionFields.TRANSACTION_LOG_ID, transactionLogId);\r\n wa.setWorkflowAttribute(policyNo, PremiumAccountingFields.TRANS_EFF_DATE, transEffDate);\r\n wa.setWorkflowAttribute(policyNo, PolicyFields.ISSUE_COMPANY_ID, issueCompanyId);\r\n wa.setWorkflowAttribute(policyNo, PolicyFields.POLICY_ID, policyHeader.getPolicyId());\r\n }\r\n\r\n // Get the next state\r\n forwardString = wa.getNextState(policyNo);\r\n setForwardParametersForWorkflow(request, forwardString, policyNo, wa.getWorkflowInstanceIdName());\r\n }\r\n else {\r\n throw new AppException(AppException.UNEXPECTED_ERROR,\r\n \"Failed to determine workflow for IBNR Notify.\");\r\n }\r\n }\r\n catch (Exception e) {\r\n forwardString = handleErrorPopup(AppException.UNEXPECTED_ERROR, \"Failed to process response.\", e, request, mapping);\r\n }\r\n\r\n ActionForward af = mapping.findForward(forwardString);\r\n l.exiting(getClass().getName(), \"processResponse\", af);\r\n return af;\r\n }", "protected ActionForm processActionForm(HttpServletRequest request,\n HttpServletResponse response,\n ActionMapping mapping)\n {\n String scope = mapping.getScope();\n if(scope != null)\n {\n try\n {\n if(scope.equals(\"session\"))\n {\n OperationContext opCon = OperationContext.getOperationContext(request);\n if(opCon != null)\n {\n if(_log.isInfoEnabled())\n {\n _log.info(\"Looking for ActionForm in OperationContext[id=\" + opCon.getOperationContextId() + \"]\"); //20030124AH\n }\n ActionForm form = opCon.getActionForm();\n if(form != null)\n {\n if(_log.isInfoEnabled())\n {\n _log.info(\"Found ActionForm in OperationContext\"); //20030124AH\n }\n return form;\n }\n else\n {\n if(_log.isWarnEnabled())\n {\n _log.warn(\"No ActionForm found in OperationContext\"); //20030124AH\n }\n return null; //20030124AH\n }\n }\n }\n }\n catch(OperationException e)\n {\n // OperationExceptions here are normal when we forward from a completed operation\n // to the next action, so we ignore them.\n }\n catch(Throwable t)\n {\n if(_log.isErrorEnabled())\n {\n _log.error(\"Error caught in processActionForm() performing customised ActionForm handling\", t); //20030124AH\n }\n }\n }\n\n if(mapping instanceof GTActionMapping)\n { //20030124AH - Check the mapping to see if we should defer form creation or do it as normal\n if( ((GTActionMapping)mapping).isDeferFormCreation() )\n {\n if(_log.isInfoEnabled())\n {\n _log.info(\"Deferring ActionForm creation\");\n }\n return null;\n }\n }\n //...\n if(_log.isInfoEnabled())\n {\n _log.info(\"Delegating to superclass to obtain ActionForm\"); //20030124AH\n }\n ActionForm form = super.processActionForm(request, response, mapping);\n return form;\n }", "@Override\r\n public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(String.format(\"ENTRY %s%n%s\", form.getClass().getSimpleName(), request.getRequestURI()));\r\n }\r\n \r\n ActionForward forward = null;\r\n\r\n Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_KEY);\r\n\r\n if (t == null) {\r\n forward = mapping.findForward(KRADConstants.MAPPING_CLOSE);\r\n } else {\r\n forward = processException(mapping, form, request, t);\r\n }\r\n \r\n if (LOG.isDebugEnabled()) {\r\n LOG.debug(String.format(\"EXIT %s\", (forward == null) ? \"null\" : forward.getPath()));\r\n }\r\n\r\n return forward;\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n request.setCharacterEncoding(\"UTF-8\");\n response.setCharacterEncoding(\"UTF-8\");\n String action = this.readParameter(request, \"do\");\n String nextAction;\n\n switch (action) {\n case \"home\":\n nextAction = \"/WEB-INF/Views/index.jsp\";\n break;\n case \"lstusers\":\n nextAction = listarUsers(request, response);\n break;\n case \"lstfornecedor\":\n nextAction = listarFornecedor(request, response);\n break;\n case \"lstclient\":\n nextAction = listarClient(request, response);\n break;\n case \"lstprodutos\":\n nextAction = listarProduto(request, response);\n break;\n default:\n request.setAttribute(\"msg\", \"Erro na controller: \" + action);\n nextAction = \"login.jsp\";\n }\n request.getRequestDispatcher(nextAction).forward(request, response);\n }", "protected ActionForward processActionPerform(HttpServletRequest request,\n HttpServletResponse response,\n Action action,\n ActionForm form,\n ActionMapping mapping)\n throws IOException, ServletException\n { //20030502AH - Copied from struts src, with extra code added \n try\n {\n if(mapping instanceof GTActionMapping)\n {\n //20050317AH - mod to also check for asdmin rights where spec'd in mapping\n GTActionMapping gtMapping = (GTActionMapping)mapping;\n boolean needsSession = gtMapping.isRequiresGtSession() ||gtMapping.isRequiresAdmin() \n \t\t\t\t\t\t\t\t\t\t\t\t|| gtMapping.isRequiresP2P() || gtMapping.isRequiresUDDI();\n if( needsSession )\n {\n //We will try to obtain a reference to the IGTSession using the method provided\n //in StaticWebUtils. This will throw a NoSessionException if we have no IGTSession.\n //By putting this check here it will be captured as though it was thrown by the action.\n IGTSession gtasSession = StaticWebUtils.getGridTalkSession(request);\n //NSL20060424 Check for P2P and UDDI requirement\n if (gtMapping.isRequiresP2P() && gtasSession.isNoP2P())\n {\n \tthrow new IllegalStateException(\"P2P functionality access required for mapped path \"+gtMapping.getPath());\n }\n if (gtMapping.isRequiresUDDI() && gtasSession.isNoUDDI())\n {\n \tthrow new IllegalStateException(\"UDDI functionality access required for mapped path \"+gtMapping.getPath());\n }\n if(gtMapping.isRequiresAdmin() && !gtasSession.isAdmin())\n {\n throw new IllegalStateException(\"Admin access required for mapped path \" + gtMapping.getPath());\n }\n }\n }\n return (action.execute(mapping, form, request, response));\n }\n catch (Exception e)\n {\n return (processException(request, response,e, form, mapping));\n }\n \n }", "protected ActionMapping processMapping( HttpServletRequest request,\n HttpServletResponse response,\n String path)\n throws IOException\n { //20030425AH\n ActionMapping mapping = super.processMapping(request, response, path);\n if(mapping instanceof GTActionMapping)\n {\n if( ((GTActionMapping)mapping).isLogParameters() )\n {\n StaticWebUtils.logRequestDetails(request, _log);\n }\n }\n return mapping;\n }", "@Override\n public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException {\n if (response.getStatus() == HttpServletResponse.SC_NOT_FOUND) {\n forward(redirectRoute, baseRequest, response);\n } else {\n super.handle(target, baseRequest, request, response);\n }\n }", "public ActionForward execute(ActionMapping mapping, ActionForm form,\n\t\t\tHttpServletRequest req, HttpServletResponse res)\n\t\t\tthrows IOException, ServletException {\n\n\t\tTargetForm aForm = null;\n\t\tActionMessages errors = new ActionMessages();\n\t\tActionForward destination = null;\n\n\t\tif (!this.checkLogon(req)) {\n\t\t\treturn mapping.findForward(\"logon\");\n\t\t}\n\n\t\tif (form != null) {\n\t\t\taForm = (TargetForm) form;\n\t\t} else {\n\t\t\taForm = new TargetForm();\n\t\t}\n\n\t\tif (req.getParameter(\"delete.x\") != null) {\n\t\t\taForm.setAction(TargetAction.ACTION_CONFIRM_DELETE);\n\t\t}\n\n\t\tAgnUtils.logger().info(\"Action: \" + aForm.getAction());\n\n\t\tif (!allowed(\"targets.show\", req)) {\n\t\t\terrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(\n\t\t\t\t\t\"error.permissionDenied\"));\n\t\t\tsaveErrors(req, errors);\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tswitch (aForm.getAction()) {\n\t\t\tcase ACTION_LIST:\n\t\t\t\tdestination = mapping.findForward(\"list\");\n\t\t\t\tbreak;\n\n\t\t\tcase ACTION_VIEW:\n\t\t\t\tif (aForm.getTargetID() != 0) {\n\t\t\t\t\taForm.setAction(TargetAction.ACTION_SAVE);\n\t\t\t\t\tloadTarget(aForm, req);\n\t\t\t\t} else {\n\t\t\t\t\taForm.setAction(TargetAction.ACTION_NEW);\n\t\t\t\t}\n\t\t\t\tdestination = mapping.findForward(\"success\");\n\t\t\t\tbreak;\n\n\t\t\tcase ACTION_SAVE:\n\t\t\t\t// if(req.getParameter(\"save.x\")!=null) {\n\t\t\t\tsaveTarget(aForm, req);\n\t\t\t\t// }\n\t\t\t\tdestination = mapping.findForward(\"success\");\n\t\t\t\tbreak;\n\n\t\t\tcase ACTION_NEW:\n\t\t\t\t// if(req.getParameter(\"save.x\")!=null) {\n\t\t\t\tsaveTarget(aForm, req);\n\t\t\t\taForm.setAction(TargetAction.ACTION_SAVE);\n\t\t\t\t// }\n\t\t\t\tdestination = mapping.findForward(\"success\");\n\t\t\t\tbreak;\n\n\t\t\tcase ACTION_CONFIRM_DELETE:\n\t\t\t\tloadTarget(aForm, req);\n\t\t\t\tdestination = mapping.findForward(\"delete\");\n\t\t\t\taForm.setAction(TargetAction.ACTION_DELETE);\n\t\t\t\tbreak;\n\n\t\t\tcase ACTION_DELETE:\n\t\t\t\tthis.deleteTarget(aForm, req);\n\t\t\t\taForm.setAction(TargetAction.ACTION_LIST);\n\t\t\t\tdestination = mapping.findForward(\"list\");\n\t\t\t\tbreak;\n\n\t\t\tcase ACTION_CREATE_ML:\n\t\t\t\tdestination = mapping.findForward(\"create_ml\");\n\t\t\t\tbreak;\n\n\t\t\tcase ACTION_CLONE:\n\t\t\t\tif (aForm.getTargetID() != 0) {\n\t\t\t\t\tloadTarget(aForm, req);\n\t\t\t\t\tcloneTarget(aForm, req);\n\t\t\t\t\taForm.setAction(TargetAction.ACTION_SAVE);\n\t\t\t\t}\n\t\t\t\tdestination = mapping.findForward(\"success\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase ACTION_DELETE_RECIPIENTS_CONFIRM:\n\t\t\t\tloadTarget(aForm, req);\n\t\t\t\tthis.getRecipientNumber(aForm, req);\n\t\t\t\tdestination = mapping.findForward(\"delete_recipients\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase ACTION_DELETE_RECIPIENTS:\n\t\t\t\tloadTarget(aForm, req);\n\t\t\t\tthis.deleteRecipients(aForm, req);\t\t\t\t\n\t\t\t\taForm.setAction(TargetAction.ACTION_LIST);\n\t\t\t\tdestination = mapping.findForward(\"list\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase ACTION_BACK_TO_MAILINGWIZARD:\n\t\t\t\tdestination = mapping.findForward(\"back_mailingwizard\");\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tdestination = mapping.findForward(\"list\");\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\tAgnUtils.logger().error(\n\t\t\t\t\t\"execute: \" + e + \"\\n\" + AgnUtils.getStackTrace(e));\n\t\t\terrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(\n\t\t\t\t\t\"error.exception\"));\n\t\t}\n\t\t\n\t\tif( \"list\".equals(destination.getName())) {\n\t\t\treq.setAttribute(\"targetlist\", loadTargetList(req) );\n\t\t\tsetNumberOfRows(req, aForm);\n\t\t}\n\t\t\n\n\t\t// Report any errors we have discovered back to the original form\n\t\tif (!errors.isEmpty()) {\n\t\t\tsaveErrors(req, errors);\n\t\t\treturn (new ActionForward(mapping.getInput()));\n\t\t}\n\n\t\treturn destination;\n\n\t}", "@Override\r\n\t\t\tprotected Vector prepareRequests(ACLMessage request) {\n\t\t\t\tString incomingRequestKey = (String) ((AchieveREResponder) parent).REQUEST_KEY;\r\n\t\t\t\tACLMessage incomingRequest = (ACLMessage) getDataStore().get(incomingRequestKey);\r\n\t\t\t\t// Prepare the request to forward to the responder\r\n\t\t\t\tSystem.out.println(\"Agent \"+getLocalName()+\": Forward the request to \"+bestOffer.getName());\r\n\t\t\t\tACLMessage outgoingRequest = new ACLMessage(ACLMessage.REQUEST);\r\n\t\t\t\toutgoingRequest.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);\r\n\t\t\t\toutgoingRequest.addReceiver(bestOffer);\r\n\t\t\t\toutgoingRequest.setContent(incomingRequest.getContent());\r\n\t\t\t\toutgoingRequest.setReplyByDate(incomingRequest.getReplyByDate());\r\n\t\t\t\tVector v = new Vector(1);\r\n\t\t\t\tv.addElement(outgoingRequest);\r\n\t\t\t\treturn v;\r\n\t\t\t}", "protected ActionForward performAction(ActionMapping mapping,\n ActionForm form, HttpServletRequest request,\n HttpServletResponse response) throws Exception {\n\n String forward = FWD_SUCCESS;\n request.setAttribute(ALLOW_EDITS_KEY, \"true\");\n request.setAttribute(PREVIOUS_DISABLED, \"false\");\n request.setAttribute(NEXT_DISABLED, \"false\");\n\n String id = request.getParameter(ID);\n \n if (StringUtil.isNullorNill(id) || \"0\".equals(id)) {\n isNew = true;\n } else {\n isNew = false;\n }\n \n BaseActionForm dynaForm = (BaseActionForm) form;\n \n ActionMessages errors = dynaForm.validate(mapping, request); \n if (errors != null && errors.size() > 0) {\n // System.out.println(\"Server side validation errors \"\n // + errors.toString());\n saveErrors(request, errors);\n // since we forward to jsp - not Action we don't need to repopulate\n // the lists here\n return mapping.findForward(FWD_FAIL);\n }\n \n String start = (String) request.getParameter(\"startingRecNo\");\n String direction = (String) request.getParameter(\"direction\");\n \n District district = new District();\n //get sysUserId from currentUserId\n district.setSysUserId(currentUserId); \n org.hibernate.Transaction tx = HibernateUtil.getSession().beginTransaction();\n \n // populate value holder from form\n PropertyUtils.copyProperties(district, dynaForm);\n // Get cityId from property \"selectedCityId\"\n String selectedCityId = PropertyUtils\n .getProperty(dynaForm, \"selectedCityId\").toString();\n // Get City object from cityId\n DictionaryDAO dictionaryDAO = new DictionaryDAOImpl();\n Dictionary city = new Dictionary();\n city = dictionaryDAO.getDataForId(selectedCityId);\n \n // Get DictrictEntry from districtName property from form\n String districtName = PropertyUtils\n .getProperty(dynaForm, \"districtName\").toString();\n \n DistrictDAO distDAO = new DistrictDAOImpl();\n \n List<Dictionary> districtEntry = distDAO.getDistrictsEntyByName(districtName);\n \n // Set some property for district\n district.setCity(city);\n district.setDescription(\"\");\n \n try {\n // Check DistrictEntry is already exists or not.\n if (districtEntry.size() == 0) {\n Dictionary newDistrictEntry = new Dictionary();\n newDistrictEntry.setDictEntry(districtName);\n DictionaryCategory dicCategory = new DictionaryCategory();\n DictionaryCategoryDAO dicCategoryDAO = \n new DictionaryCategoryDAOImpl();\n dicCategory = dicCategoryDAO\n .getDictionaryCategoryByName(\"districts\");\n newDistrictEntry.setDictionaryCategory(dicCategory);\n newDistrictEntry.setSysUserId(currentUserId);\n newDistrictEntry.setIsActive(\"Y\");\n dictionaryDAO.insertData(newDistrictEntry);\n district.setDistrictEntry(dictionaryDAO\n .getDictionaryByDictEntry(districtName));\n } else {\n district.setDistrictEntry(districtEntry.get(0));\n }\n if (!isNew) {\n // UPDATE\n distDAO.updateData(district);\n } else {\n // INSERT\n distDAO.insertData(district);\n }\n tx.commit();\n \n } catch (LIMSRuntimeException lre) {\n //bugzilla 2154\n LogEvent.logError(\"DistrictUpdateAction\", \"performAction()\",\n lre.toString());\n tx.rollback();\n errors = new ActionMessages();\n java.util.Locale locale = (java.util.Locale) request.getSession()\n .getAttribute(\"org.apache.struts.action.LOCALE\");\n ActionError error = null;\n if (lre.getException()\n instanceof org.hibernate.StaleObjectStateException) {\n // how can I get popup instead of struts error at the top of\n // page?\n // ActionMessages errors = dynaForm.validate(mapping, request);\n error = new ActionError(\"errors.OptimisticLockException\", null,\n null);\n } else {\n // bugzilla 1482\n if (lre.getException()\n instanceof LIMSDuplicateRecordException) {\n String messageKey = \"district.browse.title\";\n String msg = ResourceLocator.getInstance()\n .getMessageResources().getMessage(locale,\n messageKey);\n error = new ActionError(\"errors.DuplicateRecord\",\n msg, null);\n\n } else {\n error = new ActionError(\"errors.UpdateException\", null,\n null);\n }\n }\n errors.add(ActionMessages.GLOBAL_MESSAGE, error);\n saveErrors(request, errors);\n request.setAttribute(Globals.ERROR_KEY, errors);\n //bugzilla 1485: allow change and try updating again \n //enable save button & disable previous and next\n request.setAttribute(PREVIOUS_DISABLED, \"true\");\n request.setAttribute(NEXT_DISABLED, \"true\");\n forward = FWD_FAIL;\n\n } finally {\n HibernateUtil.closeSession();\n }\n \n if (forward.equals(FWD_FAIL)) {\n return mapping.findForward(forward);\n }\n // initialize the form\n dynaForm.initialize(mapping);\n // repopulate the form from valueholder\n PropertyUtils.copyProperties(dynaForm, district);\n if (\"true\".equalsIgnoreCase(request.getParameter(\"close\"))) {\n forward = FWD_CLOSE;\n }\n\n if (district.getId() != null && !district.getId().equals(\"0\")) {\n request.setAttribute(ID, district.getId());\n\n }\n\n //bugzilla 1400\n if (isNew) {\n forward = FWD_SUCCESS_INSERT;\n }\n //bugzilla 1467 added direction for redirect to NextPreviousAction\n return getForward(mapping.findForward(forward), id, start, direction);\n \n }", "protected boolean processRule(HttpServletRequest request, HttpServletResponse response, \r\n\t\t\tRedirectRule rule, String targetURL) \r\n\t\t\tthrows ServletException, IOException {\r\n\t\t\r\n\t\tString finalURL = getFinalURL(request, response, rule, targetURL);\r\n\t\t\r\n\t\tif (rule instanceof RedirectAction) {\r\n\t\t\tRedirectAction redirectRule = (RedirectAction)rule;\r\n\t\t\tif (redirectRule.cache != null) {\r\n\t\t\t\tresponse.addHeader(\"Cache-Control\", redirectRule.cache);\r\n\t\t\t}\r\n\t\t\tif (redirectRule.permanent == true) {\r\n\t\t\t\tresponse.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);\r\n\t\t\t\tresponse.addHeader(\"Location\", finalURL);\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tresponse.sendRedirect(finalURL);\r\n\t\t\t}\r\n\r\n\t\t\tif (logRedirects == true) {\r\n\t\t\t\tfilterConfig.getServletContext().log(filterName + \": \" +\r\n\t\t\t\t\t\t\"Redirected '\" + getRequestURI(request) + \"' to '\" + finalURL + \"'\");\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t} else if (rule instanceof ForwardAction) {\r\n\t\t\tRequestDispatcher reqDisp = request.getRequestDispatcher(targetURL);\r\n\t\t\treqDisp.forward(request, response);\r\n\t\t\t\r\n\t\t\tif (logRedirects == true) {\r\n\t\t\t\tfilterConfig.getServletContext().log(filterName + \": \" +\r\n\t\t\t\t\t\t\"Forwarded '\" + getRequestURI(request) + \"' to '\" + targetURL + \"'\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "abstract protected ActionForward processCancel( UserRequest request )\n throws IOException, ServletException;", "protected ActionForward nextPage( UserRequest request )\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 0 );\n HttpServletRequest req = request.getRequest();\n req.setAttribute( PAGE_KEY, \"\"+ ++pageNumber );\n return request.getMapping().findForward( PAGE_KEY + pageNumber );\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n request.setCharacterEncoding(\"UTF-8\");\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.setContentType(\"text;charset=UTF-8\");\n Locale locale = request.getLocale();\n String action = request.getParameter(\"action\");\n User user = Server.getSession(request);\n\n if (User.isValid(user)) {\n if (action == null) {\n //redirect to somewhere\n } else if (action.equals(\"friend\")) {\n String requestedUserId = request.getParameter(\"id\");\n String groupNames = request.getParameter(\"groups\");\n String requestMessage = request.getParameter(\"message\");\n String[] requiredFields = {requestedUserId, groupNames};\n if (!Util.areEmpty(requiredFields)) {\n if (friendAlreadyAdded(user, requestedUserId)) {\n String message = I18n.getString(locale, \"request.AlreadyCompleted\");\n response.getWriter().write(\"fail;\".concat(message));\n } else {\n Group.process(\n user,\n groupNames, new Query());\n Request friendRequest = new Request(\n Request.FRIENDSHIP,\n user.getId(),\n requestedUserId, requestMessage, groupNames);\n if (friendRequest.isDuplicate(new Query())) {\n String message = I18n.getString(locale, \"request.isDuplicate\");\n response.getWriter().write(\"fail;\".concat(message));\n } else {\n DAO dao = new Query();\n dao.open();\n try {\n dao.set(friendRequest);\n dao.commit();\n String message = I18n.getString(locale, \"request.success\");\n response.getWriter().write(\"success;\".concat(message));\n } catch (Exception e) {\n dao.rollBack();\n } finally {\n dao.closeSession();\n }\n }\n }\n } else {\n response.getWriter().write(HttpServletResponse.SC_NO_CONTENT);\n }\n } else if (action.equals(\"acceptFriend\")) {\n String requestId = request.getParameter(\"requestId\");\n String groupCSV = request.getParameter(\"groups\");\n String[] requiredFields = {requestId, groupCSV};\n\n if (!Util.areEmpty(requiredFields)) {\n DAO dao = new Query();\n dao.open();\n try {\n Request friendRequest = (Request) dao.get(\n Request.class,\n requestId);\n if (friendRequest != null) {\n if (user.getId() == friendRequest.getToId()) {\n if (friendRequest.getType().equals(Request.FRIENDSHIP)) {\n if (friendAlreadyAdded(user, friendRequest)) {\n String message = I18n.getString(locale, \"request.AlreadyCompleted\");\n response.getWriter().write(\"fail;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n dao.commit();\n } else {\n User sender = (User) friendRequest.getFrom();\n for (String groupNameFrom : friendRequest.getGroupNamesArray()) {\n if (isValid(groupNameFrom)) {\n GroupMembership membershipFrom = new GroupMembership(\n user,\n Group.get(sender, groupNameFrom, new Query()));\n dao.set(membershipFrom);\n }\n }\n String[] groupNamesTo = groupCSV.split(\";\");\n for (String groupNameTo : groupNamesTo) {\n if (isValid(groupNameTo)) {\n GroupMembership membershipTo = new GroupMembership(\n sender,\n Group.get(user, groupNameTo, new Query()));\n dao.set(membershipTo);\n }\n }\n String message = I18n.getString(locale, \"request.accepted\");\n response.getWriter().write(\"success;\".concat(message).concat(\" \".concat(sender.getName())) + \";\".concat(friendRequest.getIdString()));\n dao.delete(friendRequest);\n dao.commit();\n }\n } else {\n Server.failed(response, locale);\n }\n }\n } else {\n Server.failed(response, locale);\n }\n } catch (Exception e) {\n //e.printStackTrace();\n dao.rollBack();\n } finally {\n dao.closeSession();\n }\n } else {\n response.getWriter().write(HttpServletResponse.SC_NO_CONTENT);\n }\n } else if (action.equals(\"rejectFriend\")) {\n String requestId = request.getParameter(\"requestId\");\n if (requestId != null) {\n DAO dao = new Query();\n dao.open();\n try {\n Request friendRequest = (Request) dao.get(Request.class, requestId);\n if (friendRequest != null) {\n if (friendRequest.getToId() == user.getId()) {\n if (friendRequest.getType().equals(Request.FRIENDSHIP)) {\n String message = I18n.getString(locale, \"request.Rejected\");\n response.getWriter().write(\"success;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n dao.delete(friendRequest);\n return;\n }\n }\n }\n String message = I18n.getString(locale, \"request.fail\");\n response.getWriter().write(\"fail;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n } catch (Exception e) {\n //e.printStackTrace();\n } finally {\n dao.close();\n }\n }\n } else if (action.equals(\"unfriend\")) {\n String friendName = request.getParameter(\"id\");\n if (user.unfriend(friendName, new Query())) {\n String message = I18n.getString(locale, \"request.Unfriend\");\n response.getWriter().write(\"success;\".concat(message));\n } else {\n Server.failed(response, locale);\n }\n } else {\n Server.failed(response, locale);\n }\n } else {\n Util.redirectToLogin(request, response);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n RequestHandler rh = (RequestHandler) controladores.get(request.getServletPath());\n \n \n // Comprobamos si se obtuvo correctamente el manejador\n if (rh == null) {\n // Mostramos el error en caso de no cargarse correctamente\n response.sendError(HttpServletResponse.SC_NOT_FOUND);\n } else {\n \n // Obtenemos la URL resultante de ejecutar el manejador\n String viewUrl = rh.handleRequest(request, response);\n if (viewUrl == null) {\n // Nada\n } else {\n // El RequestHandler correspondiente nos dira que vista utilizar\n request.getRequestDispatcher(viewUrl).forward(request, response);\n }\n }\n }", "public void processAction(ActionRequest request, ActionResponse response) throws PortletException, java.io.IOException {\r\n\r\n }", "public ActionForward execute(ActionMapping actionMapping,\r\n\t\t\tActionForm actionForm, HttpServletRequest httpServletRequest,\r\n\t\t\tHttpServletResponse httpServletResponse) {\n\t\tActionForward retorno = actionMapping\r\n\t\t\t\t.findForward(\"exibirInformarImovelSituacaoCobranca\");\r\n\r\n\t\tFachada fachada = Fachada.getInstancia();\r\n\t\t\t\t\r\n\t\t// Mudar isso quando tiver esquema de segurança\r\n\t\t// HttpSession sessao = httpServletRequest.getSession(false);\r\n\t\t\r\n\t\tInformarImovelSituacaoCobrancaActionForm informarImovelSituacaoCobrancaActionForm = (InformarImovelSituacaoCobrancaActionForm) actionForm;\r\n\t\t\r\n\t\t\r\n\t\tif (httpServletRequest.getParameter(\"objetoConsulta\") != null ){\r\n\t\t\tInteger idImovel = new Integer(informarImovelSituacaoCobrancaActionForm.getIdImovel()); \r\n\t\t\tif (idImovel != null){\r\n\t\t\t\tString matriculaImovel = fachada.pesquisarInscricaoImovel(idImovel);\r\n\t\t\t\tImovel imovel = fachada.pesquisarImovelComSituacaoAguaEsgoto(idImovel);\r\n\t\t\t\thttpServletRequest.setAttribute(\"imovel\", imovel);\r\n\t\t\t\tif (matriculaImovel != null && !matriculaImovel.equalsIgnoreCase(\"\")){\r\n\t\t\t\t\tString enderecoImovel = fachada.pesquisarEndereco(idImovel);\r\n\t\t\t\t\thttpServletRequest.setAttribute(\"endereco\", enderecoImovel);\r\n\t\t\t\t\thttpServletRequest.setAttribute(\"matriculaImovel\", matriculaImovel);\r\n\t\t\t\t\t\r\n\t\t\t\t\tFiltroImovelCobrancaSituacao filtroImovelCobrancaSituacao = new FiltroImovelCobrancaSituacao();\r\n\t\t\t\t\tfiltroImovelCobrancaSituacao.adicionarParametro(new ParametroSimples(\r\n\t\t\t\t\t\t\tFiltroImovelCobrancaSituacao.IMOVEL_ID, idImovel.toString()));\r\n\t\t\t\t\tfiltroImovelCobrancaSituacao.adicionarCaminhoParaCarregamentoEntidade(\"cobrancaSituacao\");\r\n\t\t\t\t\tfiltroImovelCobrancaSituacao.adicionarCaminhoParaCarregamentoEntidade(\"cliente\");\r\n\t\t\t\t\tfiltroImovelCobrancaSituacao.adicionarCaminhoParaCarregamentoEntidade(\"imovel.ligacaoAguaSituacao\");\r\n\t\t\t\t\tfiltroImovelCobrancaSituacao.adicionarCaminhoParaCarregamentoEntidade(\"imovel.ligacaoEsgotoSituacao\");\r\n\t\t\t\t\tCollection colecaoImovelCobrancaSituacao = fachada.pesquisar(\r\n\t\t\t\t\t\t\tfiltroImovelCobrancaSituacao, ImovelCobrancaSituacao.class.getName());\r\n\t\t\t\t\t\r\n\t\t\t\t\tboolean escondeRetirar = true;\r\n\t\t\t\t\tboolean existeNaoRealizado = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (colecaoImovelCobrancaSituacao != null && !colecaoImovelCobrancaSituacao.isEmpty()){\r\n\t\t\t\t\t\thttpServletRequest.setAttribute(\"situacoes\", colecaoImovelCobrancaSituacao);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (Iterator iter = colecaoImovelCobrancaSituacao.iterator(); iter.hasNext();) {\r\n\t\t\t\t\t\t\tImovelCobrancaSituacao imovelCobrancaSituacao = (ImovelCobrancaSituacao) iter.next();\r\n\t\t\t\t\t\t\tif (imovelCobrancaSituacao.getDataRetiradaCobranca() == null) {\r\n\t\t\t\t\t\t\t\texisteNaoRealizado = true;\r\n//\t\t\t\t\t\t\t\tescondeInserir = true;\r\n\t\t\t\t\t\t\t\tShort indicadorRetirada = imovelCobrancaSituacao.getCobrancaSituacao().getIndicadorBloqueioRetirada();\r\n\t\t\t\t\t\t\t\tif (indicadorRetirada == null || indicadorRetirada.equals(new Short(\"2\"))) {\r\n\t\t\t\t\t\t\t\t\tescondeRetirar = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (existeNaoRealizado == false) { \r\n\t\t\t\t\t\t\tescondeRetirar = true; \r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tescondeRetirar = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n//\t\t\t\t\tif (escondeInserir) httpServletRequest.setAttribute(\"escondeInserir\", \"sim\");\r\n\t\t\t\t\tif (escondeRetirar) httpServletRequest.setAttribute(\"escondeRetirar\", \"sim\");\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\thttpServletRequest.setAttribute(\"inexistente\", 1);\r\n\t\t\t\t\thttpServletRequest.setAttribute(\"escondeInserir\", \"sim\");\r\n\t\t\t\t\thttpServletRequest.setAttribute(\"escondeRetirar\", \"sim\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//o sistema desabilita a primeira vez q entra na tela\r\n\t\t\thttpServletRequest.setAttribute(\"escondeInserir\", \"sim\");\r\n\t\t\thttpServletRequest.setAttribute(\"escondeRetirar\", \"sim\");\r\n\t\t}\r\n\r\n\t\t\r\n\t\treturn retorno;\r\n\r\n\t}", "@java.lang.Override\n public com.google.cloud.networkmanagement.v1beta1.ForwardInfoOrBuilder getForwardOrBuilder() {\n if ((stepInfoCase_ == 13) && (forwardBuilder_ != null)) {\n return forwardBuilder_.getMessageOrBuilder();\n } else {\n if (stepInfoCase_ == 13) {\n return (com.google.cloud.networkmanagement.v1beta1.ForwardInfo) stepInfo_;\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n }\n }", "@Override\n protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException,\n IOException\n {\n // Log\n log.info(\"Request: \" + request);\n\n // Get the target page\n final String to = request.getParameter(REQ_PARAM_TO);\n\n // Handle unspecified\n if (to == null)\n {\n // HTTP 400 and return\n response.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n return;\n }\n\n // Set the content-type to text\n response.setContentType(CONTENT_TYPE_TEXT_PLAIN);\n\n // Forward\n final String resolvedLocation = ROOT + to;\n log.info(\"Forwarding to: \" + resolvedLocation);\n final RequestDispatcher dispatcher = request.getRequestDispatcher(resolvedLocation);\n dispatcher.forward(request, response);\n }", "@Override\n\tpublic ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tString action = request.getParameter(\"action1\");\n\t\tif (action == null) action = LIST;\n\t\tif (log.isDebugEnabled()) log.debug(\"action:\" + action);\n\t\tActionForward forward = null;\n\t\tUserDefinedQueryForm theForm = (UserDefinedQueryForm) form;\n\t\ttry {\n\t\t\tif (LIST.equalsIgnoreCase(action)) forward = listAdvanceBacth(mapping, theForm, request, response); // 打开复杂查询列表页面\n\t\t\telse if (\"LISTSIMPLE\".equalsIgnoreCase(action)) forward = listSimpleBacth(mapping, theForm, request, response); // 打开简单查询列表页面\n\t\t\telse if (\"SHOWQUERY\".equalsIgnoreCase(action)) forward = queryAdvance(mapping, theForm, request, response);\n\t\t\telse if (\"SHOWSIMPLE\".equalsIgnoreCase(action)) forward = querySimple(mapping, theForm, request, response);\n\t\t\telse if (\"VALID\".equalsIgnoreCase(action)) forward = validate(mapping, theForm, request, response);\n\t\t\telse if (\"PREVIEWSQL\".equalsIgnoreCase(action)) forward = getSQLForPreview(mapping, theForm, request, response);\n\t\t\telse if (\"VALIDSIMPLE\".equalsIgnoreCase(action)) forward = validateSimple(mapping, theForm, request, response);\n\t\t\telse if (\"ADVANCEOVERVIEW\".equalsIgnoreCase(action)) forward = queryAdvanceOverview(mapping, theForm, request, response);\n\t\t\telse if (\"SIMPLEOVERVIEW\".equalsIgnoreCase(action)) forward = querySimpleOverview(mapping, theForm, request, response);\n\t\t\telse if (\"SAVERESULT\".equalsIgnoreCase(action)) forward = saveResult(mapping, theForm, request, response);\n\t\t\telse if (\"SHOWEXPORTEXCEL\".equalsIgnoreCase(action)) forward = showExportExcel(mapping, theForm, request, response);\n\t\t\telse if (\"EXPORTEXCEL\".equalsIgnoreCase(action)) forward = exportExcel(mapping, theForm, request, response);\n\t\t\telse {\n\t\t\t\trequest.setAttribute(\"err\", new WebException(\"找不到该action方法:\" + action));\n\t\t\t\tforward = mapping.findForward(ERROR);// 找不到合适的action\n\t\t\t}\n\n\t\t\t// else if(\"SAVEPARAM\".equalsIgnoreCase(action))\n\t\t\t// forward=saveQueryParam(mapping, theForm, request, response);\n\t\t\t// //保存查询条件到个人空间\n\t\t}\n\t\tcatch (Exception e) {// 其他系统出错\n\t\t\trequest.setAttribute(\"err\", e);\n\t\t\tforward = mapping.findForward(ERROR);\n\t\t}\n\t\treturn forward;\n\t}", "public ActionForward unspecified(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n this.setup(mapping,form,request,response);\n \n return mapping.findForward(\"backToGeneExp\");\n }", "public ActionForward execute(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n // Use the overridden getMethodName.\n return super.execute(mapping, form, request, response);\n }", "@java.lang.Override\n public com.google.cloud.networkmanagement.v1beta1.ForwardInfo getForward() {\n if (forwardBuilder_ == null) {\n if (stepInfoCase_ == 13) {\n return (com.google.cloud.networkmanagement.v1beta1.ForwardInfo) stepInfo_;\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n } else {\n if (stepInfoCase_ == 13) {\n return forwardBuilder_.getMessage();\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n }\n }", "protected ActionForward currentPage( UserRequest request )\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 1 );\n HttpServletRequest req = request.getRequest();\n req.setAttribute( PAGE_KEY, \"\" + pageNumber );\n return request.getMapping().findForward( PAGE_KEY + pageNumber );\n }", "@Override\n public play.libs.streams.Accumulator<ByteString, F.Either<Result, Http.MultipartFormData<A>>> apply(Http.RequestHeader request) {\n return delegate.apply(request._underlyingHeader())\n .asJava()\n .map(result -> {\n if (result.isLeft()) {\n return F.Either.Left(result.left().get().asJava());\n } else {\n final play.api.mvc.MultipartFormData<A> scalaData = result.right().get();\n return F.Either.Right(new DelegatingMultipartFormData(scalaData));\n }\n },\n JavaParsers.trampoline()\n );\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n getServletContext().getRequestDispatcher(\"/ClassInfo.jsp\").forward(request, response);\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n String forward=\"\";\r\n String action = request.getParameter(\"action\");\r\n\r\n forward = \"/createLocacao.jsp\";\r\n\r\n RequestDispatcher view = request.getRequestDispatcher(forward);\r\n view.forward(request, response);\r\n }", "public ActionForward execute(ActionMapping mapping, ActionForm form,\n\t\t\tHttpServletRequest request, HttpServletResponse response) {\n\t\tAllSearchWorkForm allSearchWorkForm = (AllSearchWorkForm) form;// TODO Auto-generated method stub\n\t\t\n\t\t// 得到搜索的条件\n\t\tString name = allSearchWorkForm.getName();\n\t\tString beginTime = allSearchWorkForm.getBeginTime();\n\t\tString endTime = allSearchWorkForm.getEndTime();\n\t\tString complete = allSearchWorkForm.getComplete();\n\t\t// 中文转码\n\t\ttry {\n\t\t\tname = URLEncoder.encode(name, \"UTF-8\");\n\t\t\tbeginTime = URLEncoder.encode(beginTime, \"UTF-8\");\n\t\t\tendTime = URLEncoder.encode(endTime,\"UTF-8\");\n\t\t\tSystem.out.println(\"name:\"+name);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn mapping.findForward(\"SearchWork.succeed\");\n\t\t}\n\t\t\n\t\t// 带参数的页面跳转\n\t\tActionRedirect redirect = new ActionRedirect(mapping.findForward(\"SearchWork.succeed\"));\n\t\tredirect.addParameter(\"name\",name);\n\t\tredirect.addParameter(\"begin\", beginTime);\n\t\tredirect.addParameter(\"end\", endTime);\n\t\tredirect.addParameter(\"complete\", complete);\n\t\tredirect.addParameter(\"page\", 1);\n\t\treturn redirect;\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n if(request.getParameter(\"action\")!=null){\n String action=request.getParameter(\"action\");\n switch(action){\n case \"Traducir\":\n validateNucleotid(request,response);\n break;\n }\n }else{\n response.sendRedirect(\"index.jsp\");\n }\n }", "@Override\n\tpublic Forward execute(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t\t\n\t\trequest.setCharacterEncoding(\"utf-8\");\n\t\t\n\t\tint notice_no = Integer.parseInt(request.getParameter(\"notice_no\"));\n\t\tNoticeService service =NoticeService.getinstace();\n\t\tNoticeDTO dto = service.detail(notice_no);\n\n\t\trequest.setAttribute(\"dto\", dto);\n\t\tForward forward = new Forward();\n\t\tforward.setForward(true);\n//\t\tforward.setPath(\"/WEB-INF/user/insertform.jsp\"); \n\t\tforward.setPath(\"/WEB-INF/main.jsp?page=user/noticemodifyform.jsp\"); \n \n\t\treturn forward;\n\t}", "@java.lang.Override\n public com.google.cloud.networkmanagement.v1beta1.ForwardInfo getForward() {\n if (stepInfoCase_ == 13) {\n return (com.google.cloud.networkmanagement.v1beta1.ForwardInfo) stepInfo_;\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n String jsp = null;\n\n if (request.getRequestURI().endsWith(\"/inicio\")) {\n jsp = \"home.jsp\";\n } else if (request.getRequestURI().endsWith(\"/destinos\")) {\n jsp = \"destination.jsp\";\n } else if (request.getRequestURI().endsWith(\"/conta\")) {\n jsp = \"account.jsp\";\n } else if (request.getRequestURI().endsWith(\"/registrar\")) {\n jsp = \"register.jsp\";\n } else if (request.getRequestURI().endsWith(\"/mensagem\")) {\n jsp = \"message.jsp\";\n } else if (request.getRequestURI().endsWith(\"/resumo\")) {\n jsp = \"resume.jsp\";\n } else if (request.getRequestURI().endsWith(\"/pagamento\")) {\n jsp = \"payment.jsp\";\n } else if (request.getRequestURI().endsWith(\"/lugares\")) {\n jsp = \"seating.jsp\";\n } else if (request.getRequestURI().endsWith(\"/cadastrar\")) {\n cadastrar(request);\n jsp = \"account.jsp\";\n } else if (request.getRequestURI().endsWith(\"/entrar\")) {\n jsp = entrar(request);\n } else if (request.getRequestURI().endsWith(\"/entrar2\")) {\n jsp = entrar2(request);\n } else if (request.getRequestURI().endsWith(\"final\")) {\n if (logado) {\n jsp = \"resumopassagem.jsp\";\n } else {\n jsp = \"resume.jsp\";\n }\n }\n request.getRequestDispatcher(jsp).forward(request, response);\n }", "@java.lang.Override\n public com.google.cloud.networkmanagement.v1beta1.ForwardInfoOrBuilder getForwardOrBuilder() {\n if (stepInfoCase_ == 13) {\n return (com.google.cloud.networkmanagement.v1beta1.ForwardInfo) stepInfo_;\n }\n return com.google.cloud.networkmanagement.v1beta1.ForwardInfo.getDefaultInstance();\n }", "private void dispatch(HttpServletRequest request, HttpServletResponse response, String redirectTo) throws IOException, ServletException {\n\t\tif (redirectTo.startsWith(PREFIX_REDIRECT)) {\n\t\t\tredirectTo = redirectTo.substring(PREFIX_REDIRECT.length(), redirectTo.length());\n\t\t\t\n\t\t\tif (redirectTo.startsWith(\"/\")) {\n\t\t\t\tredirectTo = request.getContextPath() + redirectTo;\n\t\t\t}\n\t\t\t\n\t\t\tresponse.sendRedirect(redirectTo);\n\t\t} else {\n\t\t\tRequestDispatcher dispatcher = request.getRequestDispatcher(redirectTo);\n\t\t\tdispatcher.forward(request, response);\n\t\t}\n\t}", "private ActionForward displayAction(ActionMapping mapping, ActionForm form,\r\n\t\t\tHttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t\tExceptionDisplayDTO expDTO = new ExceptionDisplayDTO(\"displayPage\",\"\");\r\n\t\texpDisplayDetails.set(expDTO);\r\n\t\t\r\n\t\t//condition to not display search results by default\r\n\t\t/*if(isNavigationDone(request)){\r\n\t\t\tgetPaginatedSearchResults(request,bean,null);\r\n\t\t}*/\r\n\t\t\r\n\t\treturn mapping.findForward(\"displayPage\");\t\t\r\n\t}", "@Override\n\tpublic ActionForWard execute(HttpServletRequest request) {\n\t\trequest.setAttribute(\"member\",MemberDao.selectMember());\n\t\treturn new ActionForWard(path,redirect);\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n String url = \"feedBackForm.jsp\";\r\n boolean isError = false;\r\n boolean isExist = false;\r\n int carID = Integer.valueOf(request.getParameter(\"txtCarID\"));\r\n int rentalDetailID = Integer.valueOf(request.getParameter(\"txtRentalDetailID\"));\r\n String txtCarName = request.getParameter(\"txtCarName\");\r\n HttpSession session = request.getSession(false);\r\n AccountDTO account = (AccountDTO) session.getAttribute(\"ACCOUNT\");\r\n FeedBackDAO feedBackDAO = FeedBackDAO.getInstance();\r\n try {\r\n FeedBackDTO feedBack = feedBackDAO.getFeedBack(account.getEmail(), carID, rentalDetailID);\r\n if ( feedBack != null) {\r\n isExist = true;\r\n url = \"feedBackExisted\";\r\n url +=\"?\" + \"txtFeedBackContent=\" + feedBack.getContent() + \"&txtFeedBackRate=\"+ feedBack.getRate() + \"&txtFeedBackID=\" + feedBack.getId()\r\n +\"&txtCarName=\" + txtCarName;\r\n response.sendRedirect(url);\r\n } \r\n } catch (SQLException ex) {\r\n isError = true;\r\n log(ex.getMessage());\r\n response.sendError(500);\r\n } catch (NamingException ex) {\r\n isError = true;\r\n log(ex.getMessage());\r\n response.sendError(500);\r\n }\r\n if (!isError && !isExist) {\r\n request.getRequestDispatcher(url).forward(request, response);\r\n }\r\n }", "public void forward() {\n callFunction(\"forward\");\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acao = request.getParameter(\"acao\");\n if (acao.equals(\"preparar\")) {\n preparar(request, response);\n } else {\n if (acao.equals(\"confirmar\")) {\n confirmar(request, response);\n }\n }\n }", "public ActionForward execute(ActionMapping mapping, ActionForm form,\r\n\t\t\tHttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows Exception {\r\n\t\tif (isCancelled(request)) {\r\n\t\t\tActionForward af = cancelled(mapping, form, request, response);\r\n\r\n\t\t\tif (af != null) {\r\n\t\t\t\treturn af;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tMessageResources resources = getResources(request);\r\n\r\n\t\t// Identify the localized message for the cancel button\r\n\t\tString edit = resources.getMessage(Locale.ENGLISH, \"button.edit\")\r\n\t\t\t\t.toLowerCase();\r\n\t\tString save = resources.getMessage(Locale.ENGLISH, \"button.save\")\r\n\t\t\t\t.toLowerCase();\r\n\t\tString search = resources.getMessage(Locale.ENGLISH, \"button.search\")\r\n\t\t\t\t.toLowerCase();\r\n\t\tString view = resources.getMessage(Locale.ENGLISH, \"button.view\")\r\n\t\t\t\t.toLowerCase();\r\n\t\tString[] rules = { edit, save, search, view };\r\n\r\n\t\t// Identify the request parameter containing the method name\r\n\t\t// 得到字符串method,制定变量method中存放的是方法名称\r\n\t\tString parameter = mapping.getParameter();\r\n\r\n\t\t// don't set keyName unless it's defined on the action-mapping\r\n\t\t// no keyName -> unspecified will be called\r\n\t\tString keyName = null;\r\n\r\n\t\tif (parameter != null) {\r\n\t\t\t// 从变量method中取出方法名\r\n\t\t\tkeyName = request.getParameter(parameter);\r\n\t\t}\r\n\r\n\t\tif ((keyName == null) || (keyName.length() == 0)) {\r\n\t\t\tfor (int i = 0; i < rules.length; i++) {\r\n\t\t\t\t// apply the rules for automatically appending the method name\r\n\t\t\t\t// 根据请求路径中的信息,来选择处理方法。\r\n\t\t\t\tif (request.getServletPath().indexOf(rules[i]) > -1) {\r\n\t\t\t\t\treturn dispatchMethod(mapping, form, request, response,\r\n\t\t\t\t\t\t\trules[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn this.unspecified(mapping, form, request, response);\r\n\t\t}\r\n\r\n\t\t// Identify the string to lookup\r\n\t\tString methodName = getMethodName(mapping, form, request, response,\r\n\t\t\t\tparameter);\r\n\r\n\t\treturn dispatchMethod(mapping, form, request, response, methodName);\r\n\t}", "protected void sequence_FORWARD(ISerializationContext context, FORWARD semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, DrnPackage.Literals.DEP_YIMPL__NAME) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DrnPackage.Literals.DEP_YIMPL__NAME));\n\t\t\tif (transientValues.isValueTransient(semanticObject, DrnPackage.Literals.DEP_YIMPL__DISTANCE_CST) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DrnPackage.Literals.DEP_YIMPL__DISTANCE_CST));\n\t\t\tif (transientValues.isValueTransient(semanticObject, DrnPackage.Literals.DEP_YIMPL__TEMPS_CST) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DrnPackage.Literals.DEP_YIMPL__TEMPS_CST));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getFORWARDAccess().getNameForwardKeyword_0_0(), semanticObject.getName());\n\t\tfeeder.accept(grammarAccess.getFORWARDAccess().getDistanceCSTINTTerminalRuleCall_4_0(), semanticObject.getDistanceCST());\n\t\tfeeder.accept(grammarAccess.getFORWARDAccess().getTempsCSTINTTerminalRuleCall_7_0(), semanticObject.getTempsCST());\n\t\tfeeder.finish();\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic ActionForward queryTest(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\treturn mapping.findForward(\"succ\");\r\n\t}", "private void processRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {\n Cookie[] cookies = req.getCookies();\n for (Cookie cookie : cookies) {\n if (\"locale\".equals(cookie.getValue())) {\n req.setAttribute(\"lang\", cookie.getValue());\n if (LOCALE_RU.equals(cookie.getValue())) {\n MainController.messageManager.changeResource(new Locale(LOCALE_RU_VALUE, LOCALE_RU_VALUE.toUpperCase()));\n MainController.resourceManager.changeResource(new Locale(LOCALE_RU_VALUE, LOCALE_RU_VALUE.toUpperCase()));\n } else {\n MainController.messageManager.changeResource(Locale.US);\n MainController.resourceManager.changeResource(Locale.US);\n }\n }\n }\n\n String page = \"\";\n ActionFactory actionFactory = new ActionFactory();\n ActionCommand command = actionFactory.defineCommand(req, resp);\n try {\n page = command.execute(req, resp);\n } catch (CommandException e) {\n LOG.error(e);\n }\n if (page != null) {\n RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(page);\n dispatcher.forward(req, resp);\n } else {\n page = ConfigurationManager.getProperty(\"path.page.main\");\n req.getSession().setAttribute(\"emptyPage\",\n messageManager.getProperty(\"message.emptypage\"));\n resp.sendRedirect(req.getContextPath() + page);\n }\n }", "public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {\n\n\t\t// Extract attributes we will need\n\t\tAgent agent = null;\n\t\t\n\t\tHttpSession session = request.getSession();\n\t\tActionMessages errors = new ActionMessages();\n\t\trequest.setAttribute(\"maintask\", \"1\");\n\t\t\n\t\t\n\t\tif (request.getParameter(\"loadBarcode\") != null) {\n\t\t\tLFFound found = new LFServiceBean().getFoundItemByBarcode(request.getParameter(\"loadBarcode\"));\n\t\t\tif (found == null) {\n\t\t\t\tActionMessage error = new ActionMessage(\"error.unable.add.item\");\n\t\t\t\terrors.add(ActionMessages.GLOBAL_MESSAGE, error);\n\t\t\t\tsaveMessages(request, errors);\n\t\t\t\treturn (mapping.findForward(\"success\"));\n\t\t\t} else {\n\t\t\t\tresponse.sendRedirect(\"create_found_item.do?barcode=\" + found.getBarcode());\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (request.getParameter(\"taskmanager\") != null) {\n\t\t\tif (session.getAttribute(\"user\") == null) {\n\t\t\t\tresponse.sendRedirect(\"logoff.do\");\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\ttaskManagerSetup(session, request);\n\t\t\t//Forward control to the specified success URI\n\t\t\treturn (mapping.findForward(\"success\"));\n\t\t}\n\n\t\t// Validate the request parameters specified by the user\n\t\tString username = (String) PropertyUtils.getSimpleProperty(form, \"username\");\n\t\tString password = (String) PropertyUtils.getSimpleProperty(form, \"password\");\n\t\tString instance = (String) System.getProperty(\"instance.ref\");\n\t\tString companyCode = request.getParameter(\"companyCode\");\n\t\t\n\t\tSsoUtils ssoUtils = new SamlUtils();//TODO consider spring injection\n\t\tSsoNode ssoNode = ssoUtils.getSsoNode(request);\n\t\t\n\t\t\n\t\tboolean hasSSO=ssoNode.isValidAssertion();\n\t\t\n\t\tif (!hasSSO && username.length() == 0 && password.length() == 0) {\n\t\t\tsession.invalidate();\n\t\t\tresponse.addHeader(\"Pragma\", \"No-cache\");\n\t\t\tresponse.addHeader(\"Cache-Control\", \"no-cache\");\n\t\t\tresponse.addDateHeader(\"Expires\", -1);\n\n\t\t\tString ldapRedirect=PropertyBMO.getValue(PropertyBMO.LDAP_REDIRECT);\n\t\t\tif(request.getParameter(\"bypass\") == null && ldapRedirect!=null && !ldapRedirect.isEmpty()){\n\t\t\t\tresponse.sendRedirect(ldapRedirect);\n\t\t\t}\n\t\t\treturn mapping.findForward(TracingConstants.LOGON);\n\t\t}\n\t\tauthenlog.info(\"Authenticating User: \"+username+\". Company Code: \"+companyCode+\". Instance: \"+instance);\n\t\tif(hasSSO){\n\t\t\tboolean autoProvision = PropertyBMO.isTrue(PropertyBMO.SSO_AUTO_PROVISION);\n\t\t\tagent = SecurityUtils.authUserNoPassword(ssoNode.getUsername(), ssoNode.getCompanycode(), 0, errors, autoProvision, ssoNode);\n\t\t} else {\n\t\t\tagent = SecurityUtils.authUser(username, password, companyCode, 0, errors);\n\t\t}\n\t\t// Report any errors we have discovered back to the original form\n\t\tif (!errors.isEmpty()) {\n\t\t\tsaveMessages(request, errors);\n\t\t\tauthenlog.info(\"User: \"+username+\", Company Code: \"+companyCode+\", Instance: \"+instance+\" Authentication Failed\");\n\t\t\tPropertyUtils.setSimpleProperty(form, \"username\", foobar);\n\t\t\tresponse.addHeader(\"Pragma\", \"No-cache\");\n\t\t\tresponse.addHeader(\"Cache-Control\", \"no-cache\");\n\t\t\tresponse.addDateHeader(\"Expires\", -1);\n\t\t\treturn mapping.findForward(TracingConstants.LOGON);\n\t\t}\n\n\t\tauthenlog.info(\"User: \"+username+\", Company Code: \"+companyCode+\", Instance: \"+instance+\" Authentication Success\");\n\t\t// check to see if password needs to be reset\n\t\t/** SF: If user logged in through LDAP, it should bypass password validation requirements **/\n\t\tif (!hasSSO && (agent.isReset_password() || !SecurityUtils.isPolicyAcceptablePassword(companyCode, password, username, request, true))) {\n\t\t\tsession.setAttribute(\"usertemp\", agent);\n\t\t\tresponse.addHeader(\"Pragma\", \"No-cache\");\n\t\t\tresponse.addHeader(\"Cache-Control\", \"no-cache\");\n\t\t\tresponse.addDateHeader(\"Expires\", -1);\n\t\t\treturn mapping.findForward(TracingConstants.PASS_RESET);\n\t\t}\n\n\t\tint expiredays = agent.getStation().getCompany().getVariable().getPass_expire_days();\n\t\t/** SF: If user logged in through LDAP, it should bypass password expiration requirements **/\n\t\tif (!hasSSO && expiredays > 0) {\n\t\t\tDate lastreset = agent.getLast_pass_reset_date();\n\t\t\tif (lastreset == null || DateUtils.formatDate(lastreset, TracingConstants.DB_DATEFORMAT, null, null).equals(\"0000-00-00\")) {\n\t\t\t\t// first time logon, set it\n\t\t\t\tagent.setLast_pass_reset_date(new Date());\n\t\t\t} else {\n\t\t\t\tlong nowtime = ((new Date()).getTime() / (3600000 * 24));\n\t\t\t\tlong lastresettime = (lastreset.getTime() / (3600000 * 24));\n\t\t\t\tif ((nowtime - lastresettime) > expiredays) {\n\t\t\t\t\t// forward to reset page\n\t\t\t\t\tsession.setAttribute(\"usertemp\", agent);\n\t\t\t\t\tresponse.addHeader(\"Pragma\", \"No-cache\");\n\t\t\t\t\tresponse.addHeader(\"Cache-Control\", \"no-cache\");\n\t\t\t\t\tresponse.addDateHeader(\"Expires\", -1);\n\t\t\t\t\treturn mapping.findForward(TracingConstants.PASS_RESET);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Create the history container object\n\t\tsession.setAttribute(\"historyContainer\", new HistoryContainer());\n\n\t\t// Save our logged-in user in the session\n\t\tsession.setAttribute(\"lastupdate\", new Date());\n\t\t//session.setMaxInactiveInterval(agent.getTimeout() * 60);\n\t\tsession.setAttribute(\"user\", agent);\n\n\t\t// write to database\n\t\tagent.setLast_logged_on(TracerDateTime.getGMTDate());\n\t\tagent.setIs_online(1);\n\t\tSecurityUtils.updateAgentLogin(agent, null, 1, true);\n\n\t\t// load drop down ui properties into session\n\t\tProperties properties = new Properties();\n\t\ttry {\n\t\t\tServletContext sc = getServlet().getServletContext();\n\t\t\tString configfilepath = sc.getRealPath(\"/\") + \"/WEB-INF/classes/\";\n\t\t\tproperties.load(new FileInputStream(configfilepath + \"custom_ui.properties\"));\n\t\t\tsession.setAttribute(\"first_row_menu_text\", properties.getProperty(\"first_row_menu_text\"));\n\t\t\tsession.setAttribute(\"first_row_bg\", properties.getProperty(\"first_row_bg\"));\n\t\t\tsession.setAttribute(\"drop_down_text\", properties.getProperty(\"drop_down_text\"));\n\t\t\tsession.setAttribute(\"drop_down_text_hilite\", properties.getProperty(\"drop_down_text_hilite\"));\n\t\t\tsession.setAttribute(\"drop_down_bg\", properties.getProperty(\"drop_down_bg\"));\n\t\t\tsession.setAttribute(\"drop_down_bg_hilite\", properties.getProperty(\"drop_down_bg_hilite\"));\n\n\t\t} catch (IOException e) {\n\t\t\t// unable to get config\n\t\t\tresponse.addHeader(\"Pragma\", \"No-cache\");\n\t\t\tresponse.addHeader(\"Cache-Control\", \"no-cache\");\n\t\t\tresponse.addDateHeader(\"Expires\", -1);\n\t\t\treturn mapping.findForward(TracingConstants.LOGON);\n\t\t}\n\n\t\t// Remove the obsolete form bean\n\t\tif (mapping.getAttribute() != null) {\n\t\t\tif (\"request\".equals(mapping.getScope()))\n\t\t\t\trequest.removeAttribute(mapping.getAttribute());\n\t\t\telse\n\t\t\t\tsession.removeAttribute(mapping.getAttribute());\n\t\t}\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tLinkedHashMap<String, LinkedHashMap<String, String>> map = UserPermissions.renderApplicationLinks(agent);\n\t\tsession.setAttribute(\"menu_links\", map);\n\t\t//Setup the activity list\n\t\tif (map != null && map.get(\"Task Manager\") != null) {\n\t\t\ttaskManagerSetup(session, request);\n\t\t}\n\t\t// prepopulate list\n\t\tTracerUtils.populateLists(session);\n\n\t\tif (UserPermissions.hasPermission(TracingConstants.SYSTEM_COMPONENT_NAME_CBRO_VIEW, agent)) {\n\t\t\t//Setup cbroStationid for the first time\n\t\t\tsession.setAttribute(\"cbroStationID\", \"\" + agent.getStation().getStation_ID());\n\t\t}\n\n\t\t// Forward control to the specified success URI\n\t\tString redirectUrl = (String) session.getAttribute(TracingConstants.SESSION_REDIRECT_URL);\n\t\tif (redirectUrl != null) {\n\t\t\tsession.removeAttribute(TracingConstants.SESSION_REDIRECT_URL);\n\t\t\tresponse.sendRedirect(redirectUrl);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t\treturn (mapping.findForward(\"success\"));\n\t}", "@Override\n\tpublic ActionForward update(HttpServletRequest request, HttpServletResponse response) {\n\t\treturn null;\n\t}", "@Override\n\tpublic ActionForward update(HttpServletRequest request, HttpServletResponse response) {\n\t\treturn null;\n\t}", "@Override\n\tpublic ActionForward select(HttpServletRequest request, HttpServletResponse response) {\n\t\treturn null;\n\t}", "public ActionForward perform(ActionMapping mapping,\r\n ActionForm form,\r\n HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws IOException, ServletException {\n Locale locale = getLocale(request);\r\n MessageResources messages = getResources();\r\n\r\n // ActionErrors needed for error passing\r\n ActionErrors errors = new ActionErrors();\r\n\r\n HttpSession session = request.getSession();\r\n\r\n ActionForward forward = null;\r\n\r\n Connection conn = JdbcDAOUtils.getConnection(this, \"PqlDS\");\r\n Date start = new Date();\r\n try {\r\n IndexWriter writer = new IndexWriter(\"index\", new StandardAnalyzer(), true);\r\n String[] columnNames = new String[3];\r\n columnNames[0] = \"ID_FICHE\";\r\n columnNames[1] = \"LIB_FICHE\";\r\n columnNames[2] = \"INFOS_FICHE\";\r\n\r\n IndexDbms.indexDocs(writer, \"FICHE_CONNAISSANCE\", columnNames, conn);\r\n\r\n writer.optimize();\r\n writer.close();\r\n\r\n Date end = new Date();\r\n\r\n System.out.print(end.getTime() - start.getTime());\r\n System.out.println(\" total milliseconds\");\r\n\r\n } catch (IOException e) {\r\n System.out.println(\" caught a \" + e.getClass() +\r\n \"\\n with message: \" + e.getMessage());\r\n }\r\n finally {\r\n JdbcDAOUtils.closeConnection(conn);\r\n }\r\n\r\n if (forward != null)\r\n return forward;\r\n\r\n return (mapping.findForward(\"success\"));\r\n\r\n }", "public void process(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException\n {\n if(_log.isInfoEnabled())\n {\n _log.info(\"Started processing action request: \" + request.getServletPath());\n }\n long startTime = System.currentTimeMillis();\n \n processInlineException(request);\n super.process(request, response);\n \n long endTime = System.currentTimeMillis();\n if(_log.isInfoEnabled())\n {\n _log.info(\"Completed processing action request (in approx \" + (endTime - startTime) + \" ms)\");\n OperationContext.logActiveContexts(request, _log);\n }\n }", "public void handleRequest(ExtractionRequest request);", "speech.multilang.Params.ForwardingControllerParamsOrBuilder getForwardingParamsOrBuilder();", "@Override\n\tpublic ActionForward list(HttpServletRequest request, HttpServletResponse response) {\n\t\treturn null;\n\t}", "@Override\n\tpublic ActionForward list(HttpServletRequest request, HttpServletResponse response) {\n\t\treturn null;\n\t}", "public interface ActionRequest {\r\n\r\n public String getDestinationResource();\r\n\r\n public boolean isRedirect();\r\n\r\n public String getErrorMessage();\r\n\r\n public String getSuccessMessage();\r\n}", "public void processAction (ActionRequest request, ActionResponse response) \n throws PortletException, java.io.IOException {\n throw new PortletException(\"processAction method not implemented\");\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n if (request.getParameter(\"action\") != null) {\n switch (request.getParameter(\"action\")) {\n case \"newFeedback\": {\n newFeedback(request, response);\n break;\n }\n case \"deleteFeedback\": {\n deleteFeedback(request, response);\n break;\n }\n case \"seenFeedback\": {\n seenFeedback(request, response);\n break;\n }\n }\n }\n\n } catch (Exception ex) {\n Logger.getLogger(FeedbackController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException \n {\n final String THIS_METHOD_NAME = \"processRequest() - \";\n \n logger.enter(THIS_METHOD_NAME);\n \n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n \n /* Global initializations for the rest of the modules */\n doGlobaInit(request,response);\n \n log(THIS_METHOD_NAME + \"Global initializations are done..\");\n \n try {\n \n String controlAction = request.getParameter(\"controlAction\");\n \n log(THIS_METHOD_NAME + \"requestParam controlAction : \"+controlAction);\n \n /* \n * Used for the determining whether or not to display the fields \n * at the first time \n */\n request.setAttribute(\"controlAction\", controlAction);\n \n if(controlAction==null || controlAction.trim().length()<=0)\n {\n //putInSession(request, \"selectedModule\", null);\n actOnNullAction(request, response);\n }\n else if(controlAction.equalsIgnoreCase(\"getFields\"))\n {\n actOnGetFields(request, response);\n }\n else if (controlAction.equalsIgnoreCase(\"getConstraints\"))\n {\n actOnGetConstraints(request, response);\n }\n else if (controlAction.equalsIgnoreCase(\"getConstraintInfo\"))\n {\n actOnGetConstraintInfo(request, response);\n }\n else if(controlAction.equalsIgnoreCase(\"addModule\"))\n {\n //putInSession(request, \"selectedModule\", null);\n actOnAddModule(request, response); \n }\n else if(controlAction.equalsIgnoreCase(\"addField\"))\n {\n actOnAddField(request, response);\n } \n else if(controlAction.equalsIgnoreCase(\"addConstraint\"))\n {\n actOnAddConstraint(request,response);\n }\n else if (controlAction.equalsIgnoreCase(\"export\"))\n {\n actOnExport(request,response);\n }\n \n getServletContext().getRequestDispatcher(\"/admin.jsp\").forward(request, response); \n \n } finally { \n out.close();\n } \n \n logger.exit(THIS_METHOD_NAME);\n }", "protected ActionForward annuler(ActionMapping mapping,ActionForm form , HttpServletRequest request, HttpServletResponse response, ActionErrors errors,Hashtable hParamProc ) throws ServletException{\r\n\t\tString sMode = request.getParameter(\"mode\") ;\r\n\t\t\r\n\t\t//page bCompocfAd.jsp\r\n\t\tif (sMode .equals(\"avant\")) \r\n\t\t\t return mapping.findForward(\"avant\") ;\r\n\t\t\r\n\t\telse if (sMode .equals(\"ecran\")) \r\n\t\t\t return mapping.findForward(\"ecran\") ;\r\n\t\t\r\n\t\telse if (sMode .equals(\"initial\")) \r\n\t\t\t return mapping.findForward(\"initial\") ;\r\n\t\t\r\n\t\telse\r\n\t\t return mapping.findForward(\"avant\") ;\r\n\t}", "OutboundQueueEntry pairRequest(@Nonnull final OfHeader response) {\n final Long xid = response.getXid();\n if (!xidInRange(xid)) {\n LOG.debug(\"Queue {} {}/{} ignoring XID {}\", this, baseXid, queue.length, xid);\n return null;\n }\n\n final int offset = (int)(xid - baseXid);\n final OutboundQueueEntry entry = queue[offset];\n if (entry.isCompleted()) {\n LOG.debug(\"Entry {} already is completed, not accepting response {}\", entry, response);\n return null;\n }\n\n if (entry.isBarrier()) {\n // This has been a barrier -- make sure we complete all preceding requests.\n // XXX: Barriers are expected to complete in one message.\n // If this assumption is changed, this logic will need to be expanded\n // to ensure that the requests implied by the barrier are reported as\n // completed *after* the barrier.\n LOG.trace(\"Barrier XID {} completed, cascading completion to XIDs {} to {}\", xid, baseXid + lastBarrierOffset + 1, xid - 1);\n completeRequests(offset);\n lastBarrierOffset = offset;\n\n final boolean success = completeEntry(entry, response);\n Verify.verify(success, \"Barrier request failed to complete\");\n completeCount++;\n } else if (completeEntry(entry, response)) {\n completeCount++;\n }\n\n return entry;\n }", "public ReturnValue dispatch(IThreadable request)\n {\n if (!running_)\n throw new IllegalStateException();\n\n return strategy_.dispatch(request);\n }", "@Override\n\t\t\t\t\tpublic HttpUriRequest getRedirect(HttpRequest request, HttpResponse response, HttpContext context)\n\t\t\t\t\t\t\tthrows ProtocolException {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}", "@Override\n public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {\n\n HttpServletRequest request = (HttpServletRequest) servletRequest;\n HttpServletResponse response = (HttpServletResponse) servletResponse;\n\n response.resetBuffer();\n\n if (request.getDispatcherType().equals(DispatcherType.ASYNC)) {\n try (DefaultWebApplicationRequest asyncRequest = new DefaultWebApplicationRequest()) {\n asyncRequest.setWebApplication(servletEnvironment.getWebApplication());\n asyncRequest.setContextPath(request.getContextPath());\n asyncRequest.setDispatcherType(DispatcherType.ASYNC);\n asyncRequest.setAsyncSupported(servletEnvironment.asyncSupported);\n\n if (path != null) {\n setForwardAttribute(request, asyncRequest, AsyncContext.ASYNC_CONTEXT_PATH);\n setForwardAttribute(request, asyncRequest, AsyncContext.ASYNC_PATH_INFO);\n setForwardAttribute(request, asyncRequest, AsyncContext.ASYNC_QUERY_STRING);\n setForwardAttribute(request, asyncRequest, AsyncContext.ASYNC_REQUEST_URI);\n setForwardAttribute(request, asyncRequest, AsyncContext.ASYNC_SERVLET_PATH);\n\n String servletPath = !path.contains(\"?\") ? path : path.substring(0, path.indexOf(\"?\"));\n asyncRequest.setServletPath(servletPath);\n\n String queryString = !path.contains(\"?\") ? null : path.substring(path.indexOf(\"?\") + 1);\n asyncRequest.setQueryString(queryString);\n\n } else {\n asyncRequest.setServletPath(\"/\" + servletEnvironment.getServletName());\n }\n\n CurrentRequestHolder currentRequestHolder = (CurrentRequestHolder) request.getAttribute(CURRENT_REQUEST_ATTRIBUTE);\n if (currentRequestHolder != null) {\n currentRequestHolder.setRequest(asyncRequest);\n asyncRequest.setAttribute(CURRENT_REQUEST_ATTRIBUTE, currentRequestHolder);\n }\n\n try {\n servletEnvironment.getWebApplication().linkRequestAndResponse(asyncRequest, servletResponse);\n servletEnvironment.getServlet().service(asyncRequest, servletResponse);\n servletEnvironment.getWebApplication().unlinkRequestAndResponse(asyncRequest, servletResponse);\n } catch (IOException | ServletException exception) {\n throw exception;\n } finally {\n if (currentRequestHolder != null) {\n currentRequestHolder.setRequest(request);\n }\n }\n response.flushBuffer();\n }\n } else {\n try (DefaultWebApplicationRequest forwardedRequest = new DefaultWebApplicationRequest()) {\n forwardedRequest.setWebApplication(servletEnvironment.getWebApplication());\n forwardedRequest.setContextPath(request.getContextPath());\n\n if (path != null) {\n setForwardAttribute(request, forwardedRequest, RequestDispatcher.FORWARD_CONTEXT_PATH);\n setForwardAttribute(request, forwardedRequest, RequestDispatcher.FORWARD_PATH_INFO);\n setForwardAttribute(request, forwardedRequest, RequestDispatcher.FORWARD_QUERY_STRING);\n setForwardAttribute(request, forwardedRequest, RequestDispatcher.FORWARD_REQUEST_URI);\n setForwardAttribute(request, forwardedRequest, RequestDispatcher.FORWARD_SERVLET_PATH);\n\n String servletPath = !path.contains(\"?\") ? path : path.substring(0, path.indexOf(\"?\"));\n forwardedRequest.setServletPath(servletPath);\n\n String queryString = !path.contains(\"?\") ? null : path.substring(path.indexOf(\"?\") + 1);\n forwardedRequest.setQueryString(queryString);\n\n } else {\n forwardedRequest.setServletPath(\"/\" + servletEnvironment.getServletName());\n }\n\n CurrentRequestHolder currentRequestHolder = (CurrentRequestHolder) request.getAttribute(CURRENT_REQUEST_ATTRIBUTE);\n if (currentRequestHolder != null) {\n currentRequestHolder.setRequest(forwardedRequest);\n forwardedRequest.setAttribute(CURRENT_REQUEST_ATTRIBUTE, currentRequestHolder);\n }\n\n try {\n servletEnvironment.getWebApplication().linkRequestAndResponse(forwardedRequest, servletResponse);\n servletEnvironment.getServlet().service(forwardedRequest, servletResponse);\n servletEnvironment.getWebApplication().unlinkRequestAndResponse(forwardedRequest, servletResponse);\n } catch (IOException | ServletException exception) {\n throw exception;\n } finally {\n if (currentRequestHolder != null) {\n currentRequestHolder.setRequest(request);\n }\n }\n response.flushBuffer();\n }\n }\n }", "@Override\r\n\tpublic void processAction(ActionRequest actionRequest,\r\n\t\t\tActionResponse actionResponse) throws IOException, PortletException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.processAction(actionRequest, actionResponse);\r\n\t}", "public ActionForward execute(ActionMapping mapping,\n ActionForm form,\n HttpServletRequest request,\n HttpServletResponse res)\n throws IOException, ServletException {\n\n // Validate the request parameters specified by the user\n ImportBaseFileForm aForm;\n ActionMessages errors = new ActionMessages();\n\n fileUploadPerformed = false;\n fileRemovePerformed = false;\n\n if (!AgnUtils.isUserLoggedIn(request)) {\n return mapping.findForward(\"logon\");\n }\n if (form != null) {\n aForm = (ImportBaseFileForm) form;\n } else {\n aForm = new ImportBaseFileForm();\n }\n\n try {\n if (AgnUtils.parameterNotEmpty(request, \"remove_file\")) {\n removeStoredCsvFile(request);\n fileRemovePerformed = true;\n } else if (AgnUtils.parameterNotEmpty(request, \"upload_file\") &&\n StringUtils.isEmpty(getCurrentFileName(request)) && (aForm.getCsvFile() != null)) {\n errors.add(storeCsvFile(request, aForm.getCsvFile()));\n }\n aForm.setCurrentFileName(getCurrentFileName(request));\n }\n catch (Exception e) {\n logger.error(\"execute: \" + e, e);\n errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(\"error.exception\", configService.getValue(ConfigService.Value.SupportEmergencyUrl)));\n }\n\n // Report any errors we have discovered back to the original form\n if (!errors.isEmpty()) {\n saveErrors(request, errors);\n }\n\n return null;\n }", "public ActionForward execute(\n\t\tRequest request,\n\t\tResponse response,\n\t\tEIPSession eipsession,\n\t\tActionCfg conf)\n\t\tthrows Exception {\n\t\tEnumeration attnames;\n\t\tMap reqparameters;\n\t\tString nametmp;\n\t\tObject oo;\n\n\t\tif ((attnames = eipsession.getAttributeNames()) != null) {\n\t\t\twhile (attnames.hasMoreElements()) {\n\t\t\t\tnametmp = attnames.nextElement().toString();\n\t\t\t\too = eipsession.getAttribute(nametmp);\n\t\t\t\tif (oo != null)\n\t\t\t\t\trequest.setSAttribute(nametmp, oo);\n\t\t\t}\n\t\t}\n\n\t\tActionForward af = execute(request, response, conf);\n\n\t\tif ((attnames = response.getSResultNames()) != null) {\n\t\t\twhile (attnames.hasMoreElements()) {\n\t\t\t\tnametmp = attnames.nextElement().toString();\n\t\t\t\too = response.getSResult(nametmp);\n\t\t\t\tif (oo != null)\n\t\t\t\t\teipsession.setAttribute(nametmp, oo);\n\t\t\t}\n\t\t}\n\t\treturn af;\n\t}", "public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n return notify(mapping, form, request, response);\r\n }", "public lnrpc.Rpc.ForwardingHistoryResponse forwardingHistory(lnrpc.Rpc.ForwardingHistoryRequest request) {\n return blockingUnaryCall(\n getChannel(), getForwardingHistoryMethod(), getCallOptions(), request);\n }", "protected void service(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException {\n\tif (aRequest.getAttribute(\"EXTRANET_METHOD\") == null) {\n\t\tsuper.service(aRequest, aResponse);\n\t} else {\n\t\t// If comming from a forward, determine if GET method should be invoked\n\t\tString lMethod = (String) aRequest.getAttribute(\"EXTRANET_METHOD\");\n\t\tif (lMethod != null && lMethod.equals(\"GET\")) {\n\t\t\tdoGet(aRequest, aResponse);\n\t\t} else {\n\t\t\tsuper.service(aRequest, aResponse);\n\t\t}\n\t}\n}", "public ActionForward execSchedTask( ActionMapping mapping, ActionForm form, HttpServletRequest request,\r\n HttpServletResponse response )\r\n throws IOException, ServletException\r\n {\r\n\r\n String wAction = request.getParameter( \"wWatchedAction\" );\r\n String forwardExecMode = request.getParameter( \"wModeForward\" );\r\n\r\n try\r\n {\r\n ActionConfig cfg = mapping.getModuleConfig().findActionConfig( wAction );\r\n String taskClass = cfg.getType();\r\n\r\n Class classDesc = Class.forName( taskClass );\r\n WatchedTask batch = (WatchedTask) classDesc.newInstance();\r\n batch.init( form, request );\r\n\r\n Object taskId = WatchedTaskManager.getInstance( request ).regTask( batch );\r\n\r\n // Writes the response\r\n sendAjaxResponse( taskId.toString(), batch, response );\r\n\r\n WatchedTaskManager.getInstance( request ).getWorkQueue().execute( batch );\r\n\r\n }\r\n catch ( Exception e )\r\n {\r\n throw new ServletException( e );\r\n }\r\n\r\n return null;\r\n }", "public ActionForward execute(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n\n // Create the object that holds the fields from the login page.\n LoginForm validateLogin = (LoginForm) form;\n // Used to define the page to be forwarded to.\n ActionForward findForward = mapping.findForward(\"welcome\");\n User user = new User();\n user.loadFile();\n access = user.compare(validateLogin);\n // If login credentials are valid continue otherwise return to the login page.\n if (access) {\n findForward = mapping.findForward(\"loggedIn\");\n } else {\n findForward = mapping.findForward(\"login\");\n } \n return findForward;\n }", "@RequestMapping(value = \"/forward.do\", method = RequestMethod.GET)\n public String forwardOnRole(HttpServletRequest request, Model model) {\n logger.debug(\"Forward Controller Start 11111111.\");\n Boolean isLoggedInSuccess = false;\n if (Utils.isInRole(Role.ROLE_SUPER_ADMIN.getLabel())) {\n logger.debug(\"Forward Controller Redirect AS \" + Role.ROLE_SUPER_ADMIN.getLabel());\n isLoggedInSuccess = true;\n if (isLoggedInSuccess)\n this.setLoggedUserInfoInSession(request, adminService);\n return \"redirect:./superAdmin/superAdmin.do\";\n } else if (Utils.isInRole(Role.ROLE_ADMIN.getLabel())) {\n logger.debug(\"Forward Controller Redirect AS \" + Role.ROLE_ADMIN.getLabel());\n isLoggedInSuccess = true;\n if (isLoggedInSuccess)\n this.setLoggedUserInfoInSession(request, adminService);\n return \"redirect:./admin/personList.do\";\n } else if (Utils.isInRole(Role.ROLE_EMPLOYEE.getLabel())) {\n logger.debug(\"Forward Controller Redirect AS \" + Role.ROLE_EMPLOYEE.getLabel());\n isLoggedInSuccess = true;\n if (isLoggedInSuccess)\n this.setLoggedUserInfoInSession(request, adminService);\n return \"redirect:./employee/landingPage.do\";\n }\n\n return \"redirect:./login.do\";\n }", "private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }", "@Override\n\t\tpublic Response proceed(Request request) throws IOException {\n\t\t\tif (index < client.interceptors().size()) {\n\t\t\t\tInterceptor.Chain chain = new ApplicationInterceptorChain(\n\t\t\t\t\t\tindex + 1, request, forWebSocket);\n\t\t\t\tInterceptor interceptor = client.interceptors().get(index);\n\t\t\t\tResponse interceptedResponse = interceptor.intercept(chain);\n\n\t\t\t\tif (interceptedResponse == null) {\n\t\t\t\t\tthrow new NullPointerException(\"application interceptor \"\n\t\t\t\t\t\t\t+ interceptor + \" returned null\");\n\t\t\t\t}\n\n\t\t\t\treturn interceptedResponse;\n\t\t\t}\n\n\t\t\t// No more interceptors. Do HTTP.\n\t\t\treturn getResponse(request, forWebSocket);\n\t\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n try {\r\n response.setContentType(CONTENT_TYPE);\r\n String[] menuChoices = request.getParameterValues(MENU_CHOICES);\r\n // OrderCalculator o = new OrderCalculator(menuChoices); \r\n OrderService o = new OrderService(menuChoices);\r\n ArrayList<MenuItem> itemsOrdered = o.getItemsOrdered();\r\n double subTotal = o.getSubTotal();\r\n double total = o.getTotal();\r\n\r\n\r\n request.setAttribute(ITEMS_ORDERED, itemsOrdered);\r\n request.setAttribute(SUB_TOTAL, subTotal);\r\n request.setAttribute(TOTAL, total);\r\n\r\n\r\n } catch (DataAccessException ex) {\r\n \r\n }\r\n\r\n RequestDispatcher view =\r\n request.getRequestDispatcher(DESTINATION_URL);\r\n view.forward(request, response);\r\n }", "public ActionForward unspecified(ActionMapping mapping, ActionForm form,\r\n HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n return displayProcessErp(mapping, form, request, response);\r\n }", "public com.p035e.p036a.C2298v followUpRequest() throws java.io.IOException {\n /*\n r4 = this;\n r1 = 0;\n r0 = r4.f5694n;\n if (r0 != 0) goto L_0x000b;\n L_0x0005:\n r0 = new java.lang.IllegalStateException;\n r0.<init>();\n throw r0;\n L_0x000b:\n r0 = r4.getRoute();\n if (r0 == 0) goto L_0x0024;\n L_0x0011:\n r0 = r4.getRoute();\n r0 = r0.getProxy();\n L_0x0019:\n r2 = r4.f5694n;\n r2 = r2.code();\n switch(r2) {\n case 300: goto L_0x0066;\n case 301: goto L_0x0066;\n case 302: goto L_0x0066;\n case 303: goto L_0x0066;\n case 307: goto L_0x0048;\n case 308: goto L_0x0048;\n case 401: goto L_0x003b;\n case 407: goto L_0x002b;\n default: goto L_0x0022;\n };\n L_0x0022:\n r0 = r1;\n L_0x0023:\n return r0;\n L_0x0024:\n r0 = r4.f5682a;\n r0 = r0.getProxy();\n goto L_0x0019;\n L_0x002b:\n r1 = r0.type();\n r2 = java.net.Proxy.Type.HTTP;\n if (r1 == r2) goto L_0x003b;\n L_0x0033:\n r0 = new java.net.ProtocolException;\n r1 = \"Received HTTP_PROXY_AUTH (407) code while not using proxy\";\n r0.<init>(r1);\n throw r0;\n L_0x003b:\n r1 = r4.f5682a;\n r1 = r1.getAuthenticator();\n r2 = r4.f5694n;\n r0 = com.p035e.p036a.p054a.p055a.C2182j.processAuthHeader(r1, r2, r0);\n goto L_0x0023;\n L_0x0048:\n r0 = r4.f5691k;\n r0 = r0.method();\n r2 = \"GET\";\n r0 = r0.equals(r2);\n if (r0 != 0) goto L_0x0066;\n L_0x0056:\n r0 = r4.f5691k;\n r0 = r0.method();\n r2 = \"HEAD\";\n r0 = r0.equals(r2);\n if (r0 != 0) goto L_0x0066;\n L_0x0064:\n r0 = r1;\n goto L_0x0023;\n L_0x0066:\n r0 = r4.f5682a;\n r0 = r0.getFollowRedirects();\n if (r0 != 0) goto L_0x0070;\n L_0x006e:\n r0 = r1;\n goto L_0x0023;\n L_0x0070:\n r0 = r4.f5694n;\n r2 = \"Location\";\n r0 = r0.header(r2);\n if (r0 != 0) goto L_0x007c;\n L_0x007a:\n r0 = r1;\n goto L_0x0023;\n L_0x007c:\n r2 = new java.net.URL;\n r3 = r4.f5691k;\n r3 = r3.url();\n r2.<init>(r3, r0);\n r0 = r2.getProtocol();\n r3 = \"https\";\n r0 = r0.equals(r3);\n if (r0 != 0) goto L_0x00a1;\n L_0x0093:\n r0 = r2.getProtocol();\n r3 = \"http\";\n r0 = r0.equals(r3);\n if (r0 != 0) goto L_0x00a1;\n L_0x009f:\n r0 = r1;\n goto L_0x0023;\n L_0x00a1:\n r0 = r2.getProtocol();\n r3 = r4.f5691k;\n r3 = r3.url();\n r3 = r3.getProtocol();\n r0 = r0.equals(r3);\n if (r0 != 0) goto L_0x00c0;\n L_0x00b5:\n r0 = r4.f5682a;\n r0 = r0.getFollowSslRedirects();\n if (r0 != 0) goto L_0x00c0;\n L_0x00bd:\n r0 = r1;\n goto L_0x0023;\n L_0x00c0:\n r0 = r4.f5691k;\n r0 = r0.newBuilder();\n r3 = r4.f5691k;\n r3 = r3.method();\n r3 = com.p035e.p036a.p054a.p055a.C2178h.permitsRequestBody(r3);\n if (r3 == 0) goto L_0x00e6;\n L_0x00d2:\n r3 = \"GET\";\n r0.method(r3, r1);\n r1 = \"Transfer-Encoding\";\n r0.removeHeader(r1);\n r1 = \"Content-Length\";\n r0.removeHeader(r1);\n r1 = \"Content-Type\";\n r0.removeHeader(r1);\n L_0x00e6:\n r1 = r4.sameConnection(r2);\n if (r1 != 0) goto L_0x00f1;\n L_0x00ec:\n r1 = \"Authorization\";\n r0.removeHeader(r1);\n L_0x00f1:\n r0 = r0.url(r2);\n r0 = r0.build();\n goto L_0x0023;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.e.a.a.a.g.followUpRequest():com.e.a.v\");\n }", "public static void handleNavigation(ActionResponse aActionResponse, MVCContext aMVCContext)\n\t\tthrows HandleNavigationException\n\t{\n\t\tString actionPath = ActionResolver.getActionFromRequest(aMVCContext);\n\t\tif (actionPath == null)\n\t\t{\n\t\t\tthrow new HandleNavigationException(\"could not resolve action name from request\", MVCExceptionCodes.MVC_CANT_RESOLVE_ACTION_NAME_FROM_REQUEST);\n\t\t}\n\t\t\n\t\tMVCConfigActionDescriptor actionDescriptor = MVCConfigurationManager.getInstance().getMVCAction(actionPath);\n\t\tif (actionDescriptor == null)\n\t\t{\n\t\t\tthrow new HandleNavigationException(\"could not find action path: \" + actionPath, MVCExceptionCodes.MVC_CANT_FIND_ACTION_PATH);\n\t\t}\n\t\t\n\t\tMVCConfigForwardDescriptor forwardDescriptor = actionDescriptor.getForward(aActionResponse.getResponse());\n\t\tif (forwardDescriptor == null)\n\t\t{\n\t\t\t//if this forward wasn't found in the actions forwards, it might be a global forward\n\t\t\tforwardDescriptor = MVCConfigurationManager.getInstance().getGlobalForward(aActionResponse.getResponse());\n\t\t\tif (forwardDescriptor == null)\n\t\t\t{\n\t\t\t\tthrow new HandleNavigationException(\"could not resolve action response to a defined forward name:\" + aActionResponse.getResponse(), MVCExceptionCodes.MVC_CANT_RESOLVE_ACTION_RESPONSE_TO_DEFINED_FORWARD_NAME);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//String pathToNavigateTo = aMVCContext.getBasePath() + \"/\" + forwardDescriptor.getPath();\n\t\tString pathToNavigateTo = null;\n\t\tString customURLToGoTo = null;\n\t\tboolean redirect = Boolean.parseBoolean(forwardDescriptor.getRedirect());\n\t\t\n\t\t//first check if this action descriptor was defined as custom URL\n\t\t//if so, we need to extract the path to navigate to from the getCustomURL() method of the CustomURLActionResponse\n\t\t//in the action itself the user is responsible to fill in this value for the navigation to take place\n\t\tif (forwardDescriptor.isCustomURL())\n\t\t{\n\t\t\tif (aActionResponse instanceof CustomURLActionResponse)\n\t\t\t{\n\t\t\t\t//navigate to the next page defined in the forward descriptor\n\t\t\t\tpathToNavigateTo = ((CustomURLActionResponse)aActionResponse).getCustomURL();\n\t\t\t\tif (pathToNavigateTo == null || \"\".equals(pathToNavigateTo))\n\t\t\t\t{\n\t\t\t\t\tthrow new HandleNavigationException(\"CustomURLActionResponse does not contain a custom URL property (it is null or empty) for action:\" + actionPath, MVCExceptionCodes.MVC_FORWARD_PATH_FOR_ACTION_CANT_BE_NULL_OR_EMPTY);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcustomURLToGoTo = pathToNavigateTo;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new HandleNavigationException(\"customurl property defined in action descriptor, but class is not of type CustomURLActionResponse for action:\" + actionPath, MVCExceptionCodes.MVC_ACTION_IS_NOT_INSTANCE_OF_MVC_ACTION_CLASS);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (forwardDescriptor.isBackToCaller())\n\t\t\t{\n\t\t\t\t//according to the forward descriptor, it is needed to return to the caller page.\n\t\t\t\t//this is actually the page that was last inserted to the page history stack\n\t\t\t\tPageHistoryElement pageHistoryElem = aMVCContext.popPageFromHistoryStack();\n\t\t\t\tpathToNavigateTo = pageHistoryElem.getPageURI();\n\t\t\t\tredirect = pageHistoryElem.isRedirect();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//navigate to the next page defined in the forward descriptor\n\t\t\t\tpathToNavigateTo = forwardDescriptor.getPath();\n\t\t\t\tif (pathToNavigateTo == null || \"\".equals(pathToNavigateTo))\n\t\t\t\t{\n\t\t\t\t\tthrow new HandleNavigationException(\"forward path cannot be null or empty for action:\" + actionPath, MVCExceptionCodes.MVC_FORWARD_PATH_FOR_ACTION_CANT_BE_NULL_OR_EMPTY);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\ttry\n\t\t{\n//\t\t\t//save the pathToNavigateTo, in the history stack, unless defined specifically not to save\n//\t\t\tif (forwardDescriptor.isAvoidHistorySave() == false)\n//\t\t\t{\n//\t\t\t\taMVCContext.pushPageToHistoryStack(pathToNavigateTo, redirect);\n//\t\t\t}\n//\t\t\t\n//\t\t\tif ( redirect )\n//\t\t\t{\n//\t\t\t\t//redirect value is \"true\", so redirect the browser to the next page\n//\t\t\t\tString path = aMVCContext.getOriginalRequest().getContextPath();\n//\t\t\t\tString basePath = aMVCContext.getOriginalRequest().getScheme()+\"://\"+aMVCContext.getOriginalRequest().getServerName()+\":\"+aMVCContext.getOriginalRequest().getServerPort()+path;\n//\t\t\t\t\n//\t\t\t\taMVCContext.getOriginalResposne().sendRedirect(basePath + pathToNavigateTo);\n//\t\t\t}\n//\t\t\telse\n//\t\t\t{\n//\t\t\t\t//redirect value IS NOT \"true\", therefore do a request forward\n//\t\t\t\tRequestDispatcher requestDispatcher = aMVCContext.getOriginalRequest().getRequestDispatcher(pathToNavigateTo);\n//\t\t\t\t\t\n//\t\t\t\trequestDispatcher.forward(aMVCContext.getOriginalRequest(), aMVCContext.getOriginalResposne());\n//\t\t\t}\n\t\t\t\n\t\t\tnavigate(aMVCContext, forwardDescriptor, customURLToGoTo);\n\t\t}\n\t\tcatch(IOException ioe)\n\t\t{\n\t\t\tthrow new HandleNavigationException(\"could not forward request: \" + ioe.toString(), MVCExceptionCodes.MVC_COULD_NOT_FORWARD_REQUEST_DUE_TO_IO_ERROR);\n\t\t}\n\t\tcatch (ServletException se)\n\t\t{\n\t\t\tthrow new HandleNavigationException(\"could not forward request: \" + se.toString(), MVCExceptionCodes.MVC_COULD_NOT_FORWARD_REQUEST_DUE_TO_IO_ERROR);\n\t\t}\n\t}", "@Override\n protected void handleRequest (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,\n @Nonnull final UnifiedResponse aUnifiedResponse) throws Exception\n {\n String sKey = aRequestScope.getPathWithinServlet ();\n if (sKey.length () > 0)\n sKey = sKey.substring (1);\n\n SimpleURL aTargetURL = null;\n final GoMappingItem aGoItem = getResolvedGoMappingItem (sKey);\n if (aGoItem == null)\n {\n s_aLogger.warn (\"No such go-mapping item '\" + sKey + \"'\");\n // Goto start page\n aTargetURL = getURLForNonExistingItem (aRequestScope, sKey);\n s_aStatsError.increment (sKey);\n }\n else\n {\n // Base URL\n if (aGoItem.isInternal ())\n {\n final IMenuTree aMenuTree = getMenuTree ();\n if (aMenuTree != null)\n {\n // If it is an internal menu item, check if this internal item is an\n // \"external menu item\" and if so, directly use the URL of the\n // external menu item\n final IRequestManager aARM = ApplicationRequestManager.getRequestMgr ();\n final String sTargetMenuItemID = aARM.getMenuItemFromURL (aGoItem.getTargetURL ());\n\n final IMenuObject aMenuObj = aMenuTree.getItemDataWithID (sTargetMenuItemID);\n if (aMenuObj instanceof IMenuItemExternal)\n {\n aTargetURL = new SimpleURL (((IMenuItemExternal) aMenuObj).getURL ());\n }\n }\n }\n if (aTargetURL == null)\n {\n // Default case - use target link from go-mapping\n aTargetURL = aGoItem.getTargetURL ();\n }\n\n // Callback\n modifyResultURL (aRequestScope, sKey, aTargetURL);\n\n s_aStatsOK.increment (sKey);\n }\n\n // Append all request parameters of this request\n // Don't use the request attributes, as there might be more of them\n final Enumeration <?> aEnum = aRequestScope.getRequest ().getParameterNames ();\n while (aEnum.hasMoreElements ())\n {\n final String sParamName = (String) aEnum.nextElement ();\n final String [] aParamValues = aRequestScope.getRequest ().getParameterValues (sParamName);\n if (aParamValues != null)\n for (final String sParamValue : aParamValues)\n aTargetURL.add (sParamName, sParamValue);\n }\n\n if (s_aLogger.isDebugEnabled ())\n s_aLogger.debug (\"Following go-mapping item '\" + sKey + \"' to \" + aTargetURL.getAsString ());\n else\n if (GlobalDebug.isDebugMode ())\n s_aLogger.info (\"Following go-mapping item '\" + sKey + \"' to \" + aTargetURL.getAsString ());\n\n // Main redirect :)\n aUnifiedResponse.setRedirect (aTargetURL);\n }", "@NotNull\n/* */ public NextAction processRequest(@NotNull Packet request) {\n/* 66 */ T param = this.argsBuilder.getParameter(request);\n/* 67 */ NoSuspendResumer resumer = new NoSuspendResumer();\n/* */ \n/* 69 */ AsyncProviderCallbackImpl callback = new AsyncProviderCallbackImpl(request, resumer);\n/* 70 */ AsyncWebServiceContext ctxt = new AsyncWebServiceContext(getEndpoint(), request);\n/* */ \n/* 72 */ LOGGER.fine(\"Invoking AsyncProvider Endpoint\");\n/* */ try {\n/* 74 */ getInvoker(request).invokeAsyncProvider(request, param, callback, (WebServiceContext)ctxt);\n/* 75 */ } catch (Throwable e) {\n/* 76 */ LOGGER.log(Level.SEVERE, e.getMessage(), e);\n/* 77 */ return doThrow(e);\n/* */ } \n/* */ \n/* 80 */ synchronized (callback) {\n/* 81 */ if (resumer.response != null) {\n/* */ \n/* */ \n/* 84 */ ThrowableContainerPropertySet tc = (ThrowableContainerPropertySet)resumer.response.getSatellite(ThrowableContainerPropertySet.class);\n/* 85 */ Throwable t = (tc != null) ? tc.getThrowable() : null;\n/* */ \n/* 87 */ return (t != null) ? doThrow(resumer.response, t) : doReturnWith(resumer.response);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 92 */ callback.resumer = new FiberResumer();\n/* 93 */ return doSuspend();\n/* */ } \n/* */ }", "abstract protected ActionForward processCreate( UserRequest request )\n throws IOException, ServletException;", "private ActionForward performAction(ActionMapping mapping, ActionForm form,\r\n\t\t\tHttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t\tTSchool schoolParam = new TSchool();\r\n\t\tFindSchool bean = (FindSchool)form;\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tApplicationContext ctx = SpringContextAware.getApplicationContext();\r\n\t\t\tBeanUtils.copyProperties(schoolParam, bean);\r\n\t\t\t\r\n\t\t\tSchoolContentUploadService service = (SchoolContentUploadService)ctx.getBean(\"schoolContentSerivce\");\r\n\t\t\tList<TSchool> schoolList = service.findAllSchools(schoolParam);\r\n\t\t\t\r\n\t\t\tif (schoolList == null || schoolList.size() == 0)\r\n\t\t\t{\r\n\t\t\t\tActionMessages errors = getErrors(request);\r\n\t\t\t\terrors.add(\"ERROR_NO_RECORDS\", new ActionMessage(\"error.no.content\",\"No Records Found for your search\"));\r\n\t\t\t\treturn mapping.findForward(\"displayPage\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIExtendedPaginatedList pageList = new PaginatedListImpl();\r\n\t\t\tint pageSize = SEARCH_RESULT_PAGE_SIZE; // Rows per page\r\n\t\t\tpageList.setPageSize(5);\r\n\t\t\t\r\n\t\t\tpageList.setList(schoolList);\r\n\t\t\tbean.setPgSearchResults(pageList);\r\n\t\t\t\t\t\t\r\n\t\t\trequest.setAttribute(\"SCHOOLRESULT\", schoolList);\r\n\t\t\trequest.setAttribute(\"SIZE\", schoolList.size());\r\n\t\t\treturn mapping.findForward(\"success\");\r\n\t\t}\r\n\t\tcatch(Exception ex)\r\n\t\t{\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n Usuario u = new Usuario();\r\n \r\n int error = 0;\r\n String email = request.getParameter(\"email\");\r\n String pass = request.getParameter(\"pass\");\r\n \r\n if (email != null && !email.isEmpty()) {\r\n u.setEmail(email);\r\n } else {\r\n u.setEmail(\"\");\r\n error = 1;\r\n }\r\n \r\n if (pass != null && !pass.isEmpty()) {\r\n u.setPass(pass);\r\n } else {\r\n u.setPass(\"\");\r\n error += 2;\r\n }\r\n \r\n if (error == 0) {\r\n u = usuarioFacade.findByEmail(email);\r\n if (u == null || !pass.equals(u.getPass())) {\r\n error = 4;\r\n }\r\n }\r\n \r\n String next;\r\n if (error == 0) {\r\n HttpSession session = request.getSession();\r\n session.setAttribute(\"usuarioId\", u.getId());\r\n next = \"/Principal\";\r\n } else {\r\n request.setAttribute(\"email\", email);\r\n request.setAttribute(\"pass\", pass);\r\n next = \"/login.jsp\";\r\n }\r\n request.setAttribute(\"error\", new Integer(error));\r\n \r\n RequestDispatcher rd = getServletContext().getRequestDispatcher(next);\r\n rd.forward(request, response);\r\n }", "private ActionForward autorizar(ActionMapping mapping, ActionForm form, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\treturn new LoginProxy().loginHome(mapping, form, request, response);\n\t}", "@Override\n\tpublic ActionForward doDefault(ActionMapping mapping, ActionForm form,\n\t\t\tHttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows Exception {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\n\t}", "public Route() {\n responseType = ResponseType.FORWARD;\n responsePath = FORWARD_TO_ERROR_PAGE;\n }", "public com.google.common.util.concurrent.ListenableFuture<lnrpc.Rpc.ForwardingHistoryResponse> forwardingHistory(\n lnrpc.Rpc.ForwardingHistoryRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getForwardingHistoryMethod(), getCallOptions()), request);\n }", "@Override\r\n\tpublic ActionForward execute(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\trequest.setCharacterEncoding(\"utf-8\");\r\n\t\t\r\n\t\tString id=request.getParameter(\"id\");\r\n\t\tString pwd=request.getParameter(\"pwd\");\r\n\t\tString name=request.getParameter(\"name\");\r\n\t\tString birth=request.getParameter(\"birth\");\r\n\t\tString phone=request.getParameter(\"phone\");\r\n\t\tint addrselect=Integer.parseInt(request.getParameter(\"addrselect\"));\r\n\t\t\r\n\t\tString addr;\r\n\t\t\r\n\t\tif(addrselect==0)\r\n\t\taddr=request.getParameter(\"roadaddr\");\r\n\t\telse\r\n\t\taddr=request.getParameter(\"jibunaddr\");\r\n\t\t\r\n\t\tString detailaddr=request.getParameter(\"detailaddr\");\r\n\t\tString fulladdr=addr+\" \"+detailaddr;\r\n\t\t\r\n\t\tint zipcode=Integer.parseInt(request.getParameter(\"zipcode\"));\r\n\t\t\r\n\t\t\r\n\t\tYIMemberDTO dto=new YIMemberDTO();\r\n\t\tdto.setId(id);\r\n\t\tdto.setPwd(pwd);\r\n\t\tdto.setName(name);\r\n\t\tdto.setBirth(birth);\r\n\t\tdto.setPhone(phone);\r\n\t\tdto.setAddr(fulladdr);\r\n\t\tdto.setZipcode(zipcode);\r\n\t\t\r\n\t\t\r\n\t\tYIMemberService service=YIMemberService.getService();\r\n\t\tservice.join(dto);\r\n\t\t\r\n\t\tActionForward f=new ActionForward();\r\n\t\tf.setForward(false);\r\n\t\tf.setUrl(\"homedream.do\");\r\n\t\treturn f;\r\n\t}", "public ActionForward unspecified(ActionMapping mapping, ActionForm form,\r\n HttpServletRequest request, HttpServletResponse response) throws Exception {\r\n return loadAllResponseError(mapping, form, request, response);\r\n }" ]
[ "0.60341024", "0.60292983", "0.57879746", "0.5767781", "0.5664627", "0.5562924", "0.55490804", "0.5481817", "0.5471465", "0.5467806", "0.54300094", "0.53656924", "0.53421754", "0.5326687", "0.5302766", "0.5293168", "0.52814585", "0.52630526", "0.52283686", "0.5199569", "0.5177163", "0.5171183", "0.5147584", "0.51394343", "0.51351684", "0.5117159", "0.5091705", "0.50908613", "0.50754845", "0.50752956", "0.5066898", "0.50644904", "0.50584984", "0.50467026", "0.50464475", "0.50327533", "0.50252527", "0.5004107", "0.5003891", "0.5003815", "0.49964857", "0.49850997", "0.49686822", "0.4953974", "0.49486792", "0.4938573", "0.49293977", "0.49114996", "0.48983753", "0.48640144", "0.48549783", "0.48517898", "0.48434427", "0.48398566", "0.4825731", "0.48239905", "0.48196447", "0.48196447", "0.4805664", "0.48008436", "0.4797282", "0.47962734", "0.47952098", "0.4789594", "0.4789594", "0.4785618", "0.4779931", "0.47709498", "0.47690138", "0.4754337", "0.47541142", "0.47422722", "0.47368866", "0.47336775", "0.47258538", "0.47240114", "0.47225484", "0.47214752", "0.47195035", "0.4710256", "0.47092643", "0.47066993", "0.46980095", "0.46896374", "0.46869543", "0.4683958", "0.46835506", "0.46692023", "0.46658882", "0.4660204", "0.46597588", "0.46596444", "0.46584082", "0.4640958", "0.46394792", "0.46377933", "0.46352732", "0.46336567", "0.46331656", "0.46326092" ]
0.48038155
59
Allocate an ADisk that stores its data using a Disk. If format is true, wipe the current disk and initialize data structures for an empty disk. Otherwise, initialize internal state, read the log, and redo any committed transactions.
public ADisk(boolean format) { // build lock this.setFailureProb(0); ADisk_lock = new SimpleLock(); waitLock = new SimpleLock(); atranslist = new ActiveTransactionList(); //initialize lists and logs wblist = new WriteBackList(this); commitDone = waitLock.newCondition(); writebackDone = waitLock.newCondition(); readDone = waitLock.newCondition(); logReadDone = waitLock.newCondition(); wbbarrier = waitLock.newCondition(); commitBarrierSector = -1; commitBarrierTid = -1; writebackBarrierSector = -1; writebackBarrierTid = -1; readSector = -1; readTid = -1; logReadSector = -1; logReadTid = -1; wbbarrierSec = -1; wbbarrierTag = -1; d = null; try{ d = new Disk(this); } catch(FileNotFoundException fnf){ System.out.println("Unable to open disk file"); System.exit(-1); } //create writeback thread writebackthread = new WriteBackThread(); try { if (format == true){ lstatus = new LogStatus(this, false); ///wipe the disk /*byte[] blank = new byte[Disk.SECTOR_SIZE]; for(int i = 0; i < Disk.SECTOR_SIZE; i++) blank[i] = 0x00; for(int i = 0; i < this.getNSectors(); i++){ if(i == this.getNSectors() - 1){ this.commitBarrierSector = i; this.commitBarrierTid = Disk.SECTOR_SIZE + 10; d.addBarrier(); // must wait for the entire wipe write to be on disk } d.startRequest(Disk.WRITE, Disk.SECTOR_SIZE+10, i, blank); } commitWait();*/ // We decided not to wipe the disk because the instructions were vague and it seems insanely inefficient to wipe the disk and there doesnt seem to be reason to wipe it. It also makes our tests run very slow. } else { //RECOVERY lstatus = new LogStatus(this, true); byte[] next = lstatus.recoverNext(); while(next != null){ Transaction temp = Transaction.parseLogBytesDebug(next, this); wblist.addCommitted(temp); next = lstatus.recoverNext(); } } } catch(IOException e){ System.out.println("IO exception"); e.printStackTrace(); System.exit(-1); } catch(IllegalArgumentException e){ System.out.println("Illegal Argument exception"); e.printStackTrace(); System.exit(-1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void format( RawDisk disk) {\n \tthis.tempDisk.format();\n }", "@Before\n public void init(){\n spaceCapacity = 20;\n fileSystem = new FileSystem(spaceCapacity);\n }", "public void startup( RawDisk disk) {\n\t\tthis.tempDisk = disk;\t\n }", "private void init(int diskSize) {\n this.readSuperblock();\n\n // if the configuration that was read from disk is not valid then go\n // ahead and use a default configuration\n if (configNotValid(diskSize)) {\n this.totalBlocks = diskSize;\n this.freeListTail = diskSize - 1;\n this.format(DEFAULT_TOTAL_INODE_BLOCKS);\n }\n }", "public static void create(Disks disk){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tHibernateUtilMastere.getSession().save(disk);\r\n\t\t\tHibernateUtilMastere.getSession().getTransaction().commit();\r\n\t\t} catch(HibernateException e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public ServiceRecordDisk(final ServiceRecordDisk o)\r\n { \r\n this.records = o.records;\r\n this.recordsByMemberNum = o.recordsByMemberNum;\r\n this.recordsByProviderNum = o.recordsByProviderNum;\r\n }", "public HWDiskStore() {\n this.diskStore = new oshi.hardware.HWDiskStore();\n }", "private void createFiOrDi(Directory root, String type, int freeBlock) {\n\t\tif(Constants.DIRECTORY_FILE.equals(type)) {\n\t\t\tsector.put(freeBlock, new Directory());\n\t\t} else {\n\t\t\tsector.put(freeBlock, new Data());\n\t\t}\n\t}", "private void initializeKeysAndData(final IndexedDiskCacheAttributes cattr) throws IOException\r\n {\r\n this.dataFile = new IndexedDisk(new File(rafDir, fileName + \".data\"), getElementSerializer());\r\n this.keyFile = new IndexedDisk(new File(rafDir, fileName + \".key\"), getElementSerializer());\r\n\r\n if (cattr.isClearDiskOnStartup())\r\n {\r\n log.info(\"{0}: ClearDiskOnStartup is set to true. Ignoring any persisted data.\",\r\n logCacheName);\r\n initializeEmptyStore();\r\n }\r\n else if (!keyFile.isEmpty())\r\n {\r\n // If the key file has contents, try to initialize the keys\r\n // from it. In no keys are loaded reset the data file.\r\n initializeStoreFromPersistedData();\r\n }\r\n else\r\n {\r\n // Otherwise start with a new empty map for the keys, and reset\r\n // the data file if it has contents.\r\n initializeEmptyStore();\r\n }\r\n }", "protected void initStorageDevices() throws OBStorageException, OBException {\r\n OBStorageConfig conf = new OBStorageConfig();\r\n conf.setTemp(false);\r\n conf.setDuplicates(false);\r\n conf.setBulkMode(! isFrozen());\r\n conf.setIndexType(IndexType.HASH);\r\n this.A = fact.createOBStoreLong(\"A\", conf );\r\n if (!this.isFrozen()) {\r\n conf = new OBStorageConfig();\r\n conf.setTemp(false);\r\n conf.setDuplicates(false);\r\n conf.setBulkMode(false);\r\n conf.setRecordSize(fixedRecordSize);\r\n if(fixedRecord){\r\n conf.setIndexType(IndexType.FIXED_RECORD);\r\n }\r\n this.preFreeze = fact.createOBStore(\"pre\", conf);\r\n }\r\n }", "private KidDatabaseDisk(){\n //for use with loadFromFileUnsafe() builder\n super();\n sequenceLength.add(0);\n exceptionsArr = new ArrayList<HashMap<Integer,Character>>();\n exceptionsArr.add(new HashMap<Integer,Character>());\n }", "public DiskEncryptionInfo() {\n }", "public export.serializers.avro.DeviceInfo.Builder clearSector() {\n sector = null;\n fieldSetFlags()[2] = false;\n return this;\n }", "public void setIsBootDisk(Boolean isBootDisk) {\n this.isBootDisk = isBootDisk;\n }", "WithCreate withDiskSizeGB(Integer diskSizeGB);", "public void changeDisk(){\n if(isFull==true) {\n if (this.type == TYPE.WHITE) {\n this.type = TYPE.BLACK;\n } else {\n type = TYPE.WHITE;\n }\n }\n return;\n }", "protected DiskData getDiskData(String sessionIdentifier, boolean create)\n\t{\n\t\tif (!create)\n\t\t{\n\t\t\treturn diskDatas.get(sessionIdentifier);\n\t\t}\n\n\t\tDiskData data = new DiskData(this, sessionIdentifier);\n\t\tDiskData existing = diskDatas.putIfAbsent(sessionIdentifier, data);\n\t\treturn existing != null ? existing : data;\n\t}", "public Disk(int size){\n this.size = size;\n }", "public IndexedFile(Disk disk, int recordSize, int keySize,\n\t\t\tint firstAllocated, int indexStart, int indexSectors,\n\t\t\tint indexRoot, int indexLevels) {\n\t\tthis.disk = disk;\n\t\tthis.indexRoot = indexRoot;\n\t\tthis.indexStart = indexStart;\n\t\tthis.overflowStart = indexRoot + 1;\n\t\tthis.overflowSectors = 0;\n\t}", "private final void onDisk(TransactionInternal txn, LogEntry entry) throws BabuDBException {\n \n // append the entry to the DiskLogger if available, wait otherwise\n try {\n \n synchronized (diskLogger) {\n \n while (diskLogger.get() == null) {\n diskLogger.wait();\n }\n \n diskLogger.get().append(entry);\n }\n } catch (InterruptedException ie) {\n \n if (entry != null) entry.free();\n throw new BabuDBException(ErrorCode.INTERRUPTED, \"Operation \" +\n \"could not have been stored persistent to disk and \" +\n \"will therefore be discarded.\", ie.getCause());\n } \n }", "public HWDiskStore(oshi.hardware.HWDiskStore diskStore) {\n this.diskStore = new oshi.hardware.HWDiskStore(diskStore);\n }", "public RLDiskDrive() {\n }", "com.google.protobuf.ByteString getDiskBytes();", "interface WithCreationData {\n /**\n * Specifies the creationData property: Disk source information. CreationData information cannot be changed\n * after the disk has been created..\n *\n * @param creationData Disk source information. CreationData information cannot be changed after the disk\n * has been created.\n * @return the next definition stage.\n */\n WithCreate withCreationData(CreationData creationData);\n }", "private void initializeFileSystem(final IndexedDiskCacheAttributes cattr)\r\n {\r\n this.rafDir = cattr.getDiskPath();\r\n log.info(\"{0}: Cache file root directory: {1}\", logCacheName, rafDir);\r\n }", "@Override\n\tpublic void startUp() {\n\t\tSystem.out.println(\"disk startup!\");\n\n\t}", "public Directory() {\n files = new ArrayList<VipeFile>();\n sectors = new int[600];\n }", "public SuperBlock(int diskSize) {\n\n //Byte array to read the first disk block\n byte[] superBlock = new byte[Disk.blockSize];\n SysLib.rawread(0, superBlock);\n\n //Set our three variables from the block\n totalBlocks = SysLib.bytes2int(superBlock, 0);\n totalInodes = SysLib.bytes2int(superBlock, 4);\n freeList = SysLib.bytes2int(superBlock,8);\n\n //Check to see if we need to format the disk\n if(totalBlocks != diskSize && totalInodes < 1 && freeList < 2){\n totalBlocks = diskSize;\n format(64);\n }\n \n \n }", "private boolean prepareNewFile(Descriptor d) {\r\n\t\tBitMask b = d.getEmptyBitmask();\r\n\r\n\t\tthis.file = new File(d, b, path, name);\r\n\r\n\t\tif (this.file.reallocate()) {\r\n\t\t\tcurrentState = State.CHASING_CHUNKS;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthis.file = null;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public Boolean isBootDisk() {\n return this.isBootDisk;\n }", "public void setDisk(String disk) {\n this.disk = disk == null ? null : disk.trim();\n }", "public AzureDataLakeStoreDataset withFormat(DatasetStorageFormat format) {\n if (this.innerTypeProperties() == null) {\n this.innerTypeProperties = new AzureDataLakeStoreDatasetTypeProperties();\n }\n this.innerTypeProperties().withFormat(format);\n return this;\n }", "public Superblock(int diskSize) {\n this.init(diskSize);\n }", "public DiskPoolVolume() {\n }", "public Superblock(int diskSize)\n {\n //read the superblock from disk\n byte[] superBlock = new byte[Disk.blockSize];\n SysLib.rawread(0, superBlock);\n totalBlocks = SysLib.bytes2int(superBlock, 0);\n inodeBlocks = SysLib.bytes2int(superBlock, 4);\n freeList = SysLib.bytes2int(superBlock, 8);\n\n if(totalBlocks == diskSize && inodeBlocks > 0 && freeList >= 2)\n {\n //disk contents are valid\n return;\n } else {\n //need to format disk\n totalBlocks = diskSize;\n format(defaultInodeBlocks);\n }\n }", "public Boolean getIsBootDisk() {\n return this.isBootDisk;\n }", "java.lang.String getDisk();", "public Storage() {\n\t\tstorageReader = new StorageReader();\n\t\tstorageWriter = new StorageWriter();\n\t\tdirectoryManager = new DirectoryManager();\n\n\t\tFile loadedDirectory = storageReader.loadDirectoryConfigFile(FILENAME_DIRCONFIG);\n\t\tif (loadedDirectory != null) {\n\t\t\tif (directoryManager.createDirectory(loadedDirectory) == true) {\n\t\t\t\tdirectory = loadedDirectory;\n\t\t\t\tSystem.out.println(\"{Storage} Directory loaded | \" + directory.getAbsolutePath());\n\t\t\t} else { //loaded directory was invalid or could not be created\n\t\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t\t}\n\t\t} else { //directory config file was not found\n\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t}\n\t}", "public DFS()\n {\n\n\n writeLock = lock.writeLock();\n readLock = lock.readLock();\n\n recoverINodes();\n\n createDir(\"/\"); // add a root if it does not exist .\n\n }", "@Test\n public void testAddVolumeWithSameDiskTiering() throws IOException {\n datanode = mock(DataNode.class);\n storage = mock(DataStorage.class);\n this.conf = new Configuration();\n this.conf.setLong(DFS_DATANODE_SCAN_PERIOD_HOURS_KEY, 0);\n this.conf.set(DFSConfigKeys.DFS_DATANODE_REPLICA_CACHE_ROOT_DIR_KEY,\n replicaCacheRootDir);\n conf.setBoolean(DFSConfigKeys.DFS_DATANODE_ALLOW_SAME_DISK_TIERING,\n true);\n conf.setDouble(DFSConfigKeys\n .DFS_DATANODE_RESERVE_FOR_ARCHIVE_DEFAULT_PERCENTAGE,\n 0.4);\n\n when(datanode.getConf()).thenReturn(conf);\n final DNConf dnConf = new DNConf(datanode);\n when(datanode.getDnConf()).thenReturn(dnConf);\n final BlockScanner disabledBlockScanner = new BlockScanner(datanode);\n when(datanode.getBlockScanner()).thenReturn(disabledBlockScanner);\n final ShortCircuitRegistry shortCircuitRegistry =\n new ShortCircuitRegistry(conf);\n when(datanode.getShortCircuitRegistry()).thenReturn(shortCircuitRegistry);\n when(datanode.getDataSetLockManager()).thenReturn(manager);\n\n createStorageDirs(storage, conf, 1);\n dataset = new FsDatasetImpl(datanode, storage, conf);\n\n List<NamespaceInfo> nsInfos = Lists.newArrayList();\n for (String bpid : BLOCK_POOL_IDS) {\n nsInfos.add(new NamespaceInfo(0, CLUSTER_ID, bpid, 1));\n }\n StorageLocation archive = createStorageWithStorageType(\"archive1\",\n StorageType.ARCHIVE, conf, storage, datanode);\n dataset.addVolume(archive, nsInfos);\n assertEquals(2, dataset.getVolumeCount());\n\n String mount = new DF(new File(archive.getUri()), conf).getMount();\n double archiveRatio = dataset.getMountVolumeMap()\n .getCapacityRatioByMountAndStorageType(mount, StorageType.ARCHIVE);\n double diskRatio = dataset.getMountVolumeMap()\n .getCapacityRatioByMountAndStorageType(mount, StorageType.DISK);\n assertEquals(0.4, archiveRatio, 0);\n assertEquals(0.6, diskRatio, 0);\n\n // Add second ARCHIVAL volume should fail fsDataSetImpl.\n try {\n dataset.addVolume(\n createStorageWithStorageType(\"archive2\",\n StorageType.ARCHIVE, conf, storage, datanode), nsInfos);\n fail(\"Should throw exception for\" +\n \" same storage type already exists on same mount.\");\n } catch (IOException e) {\n assertTrue(e.getMessage()\n .startsWith(\"Storage type ARCHIVE already exists on same mount:\"));\n }\n }", "private void initializeStoreFromPersistedData() throws IOException\r\n {\r\n loadKeys();\r\n\r\n if (keyHash.isEmpty())\r\n {\r\n dataFile.reset();\r\n }\r\n else\r\n {\r\n final boolean isOk = checkKeyDataConsistency(false);\r\n if (!isOk)\r\n {\r\n keyHash.clear();\r\n keyFile.reset();\r\n dataFile.reset();\r\n log.warn(\"{0}: Corruption detected. Resetting data and keys files.\", logCacheName);\r\n }\r\n else\r\n {\r\n synchronized (this)\r\n {\r\n startupSize = keyHash.size();\r\n }\r\n }\r\n }\r\n }", "@Override\n protected CheckpointStorageAccess createCheckpointStorage(Path checkpointDir) throws Exception {\n return new MemoryBackendCheckpointStorageAccess(\n new JobID(), checkpointDir, null, DEFAULT_MAX_STATE_SIZE);\n }", "public AssetDiskPartitionInfo(AssetDiskPartitionInfo source) {\n if (source.Name != null) {\n this.Name = new String(source.Name);\n }\n if (source.Size != null) {\n this.Size = new Long(source.Size);\n }\n if (source.Percent != null) {\n this.Percent = new Float(source.Percent);\n }\n if (source.Type != null) {\n this.Type = new String(source.Type);\n }\n if (source.Path != null) {\n this.Path = new String(source.Path);\n }\n if (source.Used != null) {\n this.Used = new Long(source.Used);\n }\n }", "public SimpleDirectory() {\n this.container = new Entry[SimpleDirectory.DEFAULT_SIZE];\n this.loadFactor = SimpleDirectory.DEFAULT_LOAD_FACTOR;\n }", "private void initializeBuffers(){\n if(isDiskBufferEnabled){\n this.persistenceService = PersistenceService.getService();\n this.synonymyBuffer = persistenceService.getMapDatabase(WIKIDATA_SYNONYMY_BUFFER);\n this.hypernymyBuffer = persistenceService.getMapDatabase(WIKIDATA_HYPERNYMY_BUFFER);\n this.askBuffer = persistenceService.getMapDatabase(WIKIDATA_ASK_BUFFER);\n } else {\n this.synonymyBuffer = new ConcurrentHashMap<>();\n this.hypernymyBuffer = new ConcurrentHashMap<>();\n this.askBuffer = new ConcurrentHashMap<>();\n }\n }", "public static Storage create(String fileName) throws DukeException {\n try {\n if (!Files.exists(Storage.DATA_DIR)) {\n Files.createDirectory(Storage.DATA_DIR);\n }\n Path filePath = Paths.get(Storage.DATA_DIR.toString(), fileName);\n BufferedWriter writer = Files.newBufferedWriter(filePath);\n return new Storage(writer);\n } catch (IOException e) {\n throw Ui.ioException(e);\n }\n }", "public StorageManager() {\n makeDirectory();\n }", "private void initDevice() {\n device = new Device();\n device.setManufacture(new Manufacture());\n device.setInput(new Input());\n device.setPrice(new Price());\n device.getPrice().setCurrency(\"usd\");\n device.setCritical(DeviceCritical.FALSE);\n }", "public void testCtorSuccess() {\r\n new FileSystemPersistence(10);\r\n }", "private void initializeEmptyStore() throws IOException\r\n {\r\n this.keyHash.clear();\r\n\r\n if (!dataFile.isEmpty())\r\n {\r\n dataFile.reset();\r\n }\r\n }", "public DataBlock() {\n headerPointer = 0;\n datasPointer = size - 1;\n serialize = new byte[size];\n }", "public abstract DataType<T> newInstance(String format);", "public void createStorageFile() throws IoDukeException {\n PrintWriter writer = null;\n try {\n writer = getStorageFile();\n } catch (IOException e) {\n throw new IoDukeException(\"Error opening task file for reading\");\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n }", "@Test(timeout = 10000)\n public void testShouldConsiderSameMountVolume() throws IOException {\n FsVolumeImpl volume = new FsVolumeImplBuilder()\n .setConf(conf)\n .setDataset(dataset)\n .setStorageID(\"storage-id\")\n .setStorageDirectory(\n new StorageDirectory(StorageLocation.parse(BASE_DIR)))\n .build();\n assertFalse(dataset.shouldConsiderSameMountVolume(volume,\n StorageType.ARCHIVE, null));\n\n conf.setBoolean(DFSConfigKeys\n .DFS_DATANODE_ALLOW_SAME_DISK_TIERING, true);\n conf.setDouble(DFSConfigKeys\n .DFS_DATANODE_RESERVE_FOR_ARCHIVE_DEFAULT_PERCENTAGE,\n 0.5);\n volume = new FsVolumeImplBuilder()\n .setConf(conf)\n .setDataset(dataset)\n .setStorageID(\"storage-id\")\n .setStorageDirectory(\n new StorageDirectory(StorageLocation.parse(BASE_DIR)))\n .build();\n assertTrue(dataset.shouldConsiderSameMountVolume(volume,\n StorageType.ARCHIVE, null));\n assertTrue(dataset.shouldConsiderSameMountVolume(volume,\n StorageType.ARCHIVE, \"\"));\n assertFalse(dataset.shouldConsiderSameMountVolume(volume,\n StorageType.DISK, null));\n assertFalse(dataset.shouldConsiderSameMountVolume(volume,\n StorageType.ARCHIVE, \"target\"));\n }", "public IndexedDiskCache(final IndexedDiskCacheAttributes cattr, final IElementSerializer elementSerializer)\r\n {\r\n super(cattr);\r\n\r\n setElementSerializer(elementSerializer);\r\n\r\n this.cattr = cattr;\r\n this.maxKeySize = cattr.getMaxKeySize();\r\n this.isRealTimeOptimizationEnabled = cattr.getOptimizeAtRemoveCount() > 0;\r\n this.isShutdownOptimizationEnabled = cattr.isOptimizeOnShutdown();\r\n this.logCacheName = \"Region [\" + getCacheName() + \"] \";\r\n this.diskLimitType = cattr.getDiskLimitType();\r\n // Make a clean file name\r\n this.fileName = getCacheName().replaceAll(\"[^a-zA-Z0-9-_\\\\.]\", \"_\");\r\n this.keyHash = createInitialKeyMap();\r\n this.queuedPutList = new ConcurrentSkipListSet<>(Comparator.comparing(ded1 -> ded1.pos));\r\n this.recycle = new ConcurrentSkipListSet<>();\r\n\r\n try\r\n {\r\n initializeFileSystem(cattr);\r\n initializeKeysAndData(cattr);\r\n\r\n // Initialization finished successfully, so set alive to true.\r\n setAlive(true);\r\n log.info(\"{0}: Indexed Disk Cache is alive.\", logCacheName);\r\n\r\n // TODO: Should we improve detection of whether or not the file should be optimized.\r\n if (isRealTimeOptimizationEnabled && !keyHash.isEmpty())\r\n {\r\n // Kick off a real time optimization, in case we didn't do a final optimization.\r\n doOptimizeRealTime();\r\n }\r\n }\r\n catch (final IOException e)\r\n {\r\n log.error(\"{0}: Failure initializing for fileName: {1} and directory: {2}\",\r\n logCacheName, fileName, this.rafDir.getAbsolutePath(), e);\r\n }\r\n }", "public DefaultStorage() {\n }", "public Storage(String path) throws IOException {\n assert path != null : \"Path for file storage cannot be null.\";\n file = new File(path);\n if (!file.getParentFile().exists()) {\n file.getParentFile().mkdir();\n file.createNewFile();\n }\n }", "public DeviceModel(Context ctx) {\n\n if (Constants.BETA)\n Log.i(\"DeviceModel\", \"SDK Version = \"+android.os.Build.VERSION.SDK);\n\n emulated = (isHoneyComb) && Environment.isExternalStorageEmulated();\n int count = (isKitKat) ? ctx.getExternalFilesDirs(null).length+1 : 2;\n\n free = new long[count];\n used = new long[count];\n total = new long[count];\n path = new String[count];\n store = new String[count];\n freeKb = new String[count];\n usedKb = new String[count];\n totalKb = new String[count];\n isAvail = new boolean[count];\n\n /**\n * Internal Storage\n */\n path[0] = Environment.getRootDirectory().getAbsolutePath();\n store[0] = path[0];\n total[0] = getTotal(path[0]);\n free[0] = getFree(path[0]);\n used[0] = total[0] - free[0];\n freeKb[0] = humanize(used[0]);\n usedKb[0] = humanize(free[0]);\n totalKb[0] = humanize(total[0]);\n isAvail[0] = !emulated;\n if (Constants.BETA) dump(0);\n\n /**\n * External Storage\n */\n// path[1] = Environment.getDataDirectory().getAbsolutePath();\n// store[1] = path[1];\n// total[1] = getTotal(path[1]);\n// free[1] = getFree(path[1]);\n// used[1] = total[1] - free[1];\n// freeKb[1] = humanize(used[1]);\n// usedKb[1] = humanize(free[1]);\n// totalKb[1] = humanize(total[1]);\n// isAvail[1] = true;\n// if (Constants.BETA) dump(0);\n\n if (isKitKat) {\n\n File ext[] = ctx.getExternalFilesDirs(null);\n for (int i=1; i<=ext.length; i++) {\n\n path[i] = ext[i-1].getAbsolutePath();\n store[i] = path[i].replace(TAIL, \"\");\n total[i] = getTotal(path[i]);\n free[i] = getFree(path[i]);\n used[i] = total[i] - free[i];\n usedKb[i] = humanize(free[i]);\n freeKb[i] = humanize(used[i]);\n totalKb[i] = humanize(total[i]);\n\n String state = Environment.getStorageState(ext[i-1]);\n isAvail[i] = Environment.MEDIA_MOUNTED.equals(state)\n && !(Environment.MEDIA_MOUNTED_READ_ONLY.equals(state));\n if (Constants.BETA) dump(i);\n\n }\n\n } else {\n\n path[1] = Environment.getExternalStorageDirectory().getAbsolutePath();\n store[1] = path[1].replace(TAIL, \"\");\n total[1] = getTotal(path[1]);\n free[1] = getFree(path[1]);\n used[1] = total[1] - free[1];\n freeKb[1] = humanize(used[1]);\n usedKb[1] = humanize(free[1]);\n totalKb[1] = humanize(total[1]);\n\n String state = Environment.getExternalStorageState();\n isAvail[1] = Environment.MEDIA_MOUNTED.equals(state)\n && !(Environment.MEDIA_MOUNTED_READ_ONLY.equals(state));\n if (Constants.BETA) dump(1);\n\n }\n\n\n }", "public void init() {\n File file = new File(FILE);\n if (!file.exists()) {\n File file2 = new File(file.getParent());\n if (!file2.exists()) {\n file2.mkdirs();\n }\n }\n if (this.accessFile == null) {\n try {\n this.accessFile = new RandomAccessFile(FILE, \"rw\");\n } catch (FileNotFoundException unused) {\n }\n }\n }", "public void testCtor() {\r\n new FileSystemPersistence();\r\n }", "public static final DataType<Double> createDecimal(final String format) {\r\n return new ARXDecimal(format);\r\n }", "@Test\n public void constructorTest() throws IOException {\n LogSegment segment = getSegment(\"log_current\", LogSegmentTest.STANDARD_SEGMENT_SIZE, false);\n Assert.assertEquals(\"Start offset should be 0 when no headers are written\", 0, segment.getStartOffset());\n }", "public Storage(int capacity) {\n this.foods = new Food[capacity];\n buffer = new StringBuffer();\n }", "private void initSystemPartition() throws Exception {\n // change the working directory to something that is unique\n // on the system and somewhere either under target directory\n // or somewhere in a temp area of the machine.\n\n // Inject the System Partition\n Partition systemPartition = factory.createPartition(service.getSchemaManager(),\n service.getDnFactory(),\n \"system\", ServerDNConstants.SYSTEM_DN, 500,\n new File(service.getInstanceLayout().getPartitionsDirectory(), \"system\"));\n systemPartition.setSchemaManager(service.getSchemaManager());\n\n factory.addIndex(systemPartition, SchemaConstants.OBJECT_CLASS_AT, 100);\n\n service.setSystemPartition(systemPartition);\n }", "Data() throws IOException {\n // Initialise new default path from scratch\n path = Path.of(\"src/main/data/duke.txt\");\n new File(\"src/main/data\").mkdirs();\n new File(path.toString()).createNewFile();\n }", "protected FileSystem() {\n\t}", "private void startFresh() throws JournalException {\n try {\n this.log = this.node.getWriter(this.filename, false);\n } catch (IOException e) {\n throw new JournalException(\"Failed to create initial log file.\");\n }\n }", "public FileSystem(int diskBlocks)\n\t{\n\t\t\n\n\t\t// create superblock, and format disk with 64 inodes in default\n\t\tsuperblock = new SuperBlock(diskBlocks);\n\n\t\t\n\n\t\t// create directory and register / in directory entry 0\n\t\tdirectory = new Directory(superblock.totalInodes);\n\n\t\t\n\n\t\t//file table is created and store directory in the file table\n\t\tfiletable = new FileTable(directory);\n\n\t\t\n\n\t\t//directory reconstruction\n\t\tFileTableEntry dirEnt = open( \"/\", \"r\");\n\t\tint dirSize = fsize( dirEnt );\n\t\tif( dirSize > 0) \n\t\t{\n\t\t\tbyte[] dirData = new byte[dirSize];\n\t\t\tread(dirEnt, dirData);\n\t\t\tdirectory.bytes2directory( dirData );\n\t\t}\n\t\tmarkedForDeletion = new HashSet<Short>();\n\t\tclose(dirEnt);\n\t}", "void prepareSortedLedgerStorageCheckpoint(long numBytesFlushed) throws IOException;", "public void preRun() throws IOException {\n if (manageFileSystem && fs == null) {\n fs = getFileSystem();\n }\n // only to maintain the status of recordFile and recordOutput when manageRecordFile=true\n if (manageRecordFile) {\n File recordFile = new File(recordFileName);\n if (! recordFile.exists()) {\n recordFile.createNewFile();\n }\n if (recordOutput == null) {\n recordOutput = new FileOutputStream(recordFile);\n }\n recordOutput.write((TestRecord.formatCsvHeader()+\"\\n\").getBytes(StandardCharsets.UTF_8));\n }\n }", "public ReplicationConfigurationReplicatedDisk withIsBootDisk(Boolean isBootDisk) {\n setIsBootDisk(isBootDisk);\n return this;\n }", "public FlatRecord newFlatRecord(Catalog catalog)\r\n {\r\n FlatRecord newObj = (FlatRecord)SAP_FlatRecord.newObj((com.informatica.adapter.sdkadapter.patternblocks.catalog.semantic.auto.SAP_Catalog)catalog);\r\n SEMTableRecordExtensions newExtnObj = newSEMTableRecordExtensions(catalog);\r\n newObj.setExtensions(newExtnObj);\r\n return newObj;\r\n }", "public static void initializeMemory(){\n\t\tif(memory == null){\n\t\t\tmemory = new TreeMap<String,String>();\n\t\t\tfor(int i=0;i<2048;i++){\n\t\t\t\tmemory.put(Utility.decimalToHex(i, 3), null);\n\t\t\t}\n\t\t\tmemory_fmbv = new int[256];\n\t\t\tfor(int i:memory_fmbv){\n\t\t\t\tmemory_fmbv[i] = 0;\n\t\t\t}\n\t\t}\n\t\tif(diskJobStorage == null){\n\t\t\tdiskJobStorage = new TreeMap<String,DiskSMT>();\n\t\t}\n\t}", "public void createPositiveDisk(int diskID, float posX, float posY, float speedX, float speedY){\n Material posDiskMat = new Material(sapp.getAssetManager(),\n \"Common/MatDefs/Misc/Unshaded.j3md\");\n posDiskMat.setColor(\"Color\", ColorRGBA.Green);\n \n Vector3f tempVector = new Vector3f(speedX, speedY, 0);\n PositiveDisk pDisk = new PositiveDisk(diskID, tempVector, posX, posY, POSDISK_R, posDiskMat, sapp);\n diskList.add(pDisk);\n \n }", "protected FileSystem createFileSystem()\n throws SmartFrogException, RemoteException {\n ManagedConfiguration conf = createConfiguration();\n FileSystem fileSystem = DfsUtils.createFileSystem(conf);\n return fileSystem;\n }", "void read(IDevTree tree, Map options, boolean readOnly, boolean createNew) throws IOException;", "private void loadFromSdCard() throws IOException {\n\t\tif (!Environment.getExternalStorageState().equals(\n\t\t\t\tEnvironment.MEDIA_MOUNTED)) {\n\t\t\tthrow new IOException(getResources().getString(\n\t\t\t\t\tR.string.error_noExternalStorage));\n\t\t}\n\n\t\tStringBuffer whiteBoardFilePath = new StringBuffer(\n\t\t\t\tWHITEBOARD_DATA_FOLDER_PATH);\n\t\twhiteBoardFilePath.append(whiteBoard.id).append(\".dat\");\n\n\t\ttry {\n\t\t\tmDataStore.deserializeDataStore(new FileInputStream(new File(\n\t\t\t\t\twhiteBoardFilePath.toString())));\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Could not load save file\");\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"I/O error loading save file\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private NoOpCompactor(SegmentStorageSystem storage) {\n super(storage);\n }", "public String getDisk() {\n return disk;\n }", "interface SegmentIoFactory {\n /**\n * @param segmentId Segment for IO action.\n * @return {@link FileIO}.\n * @throws IOException if creation would be fail.\n */\n FileIO build(long segmentId) throws IOException;\n }", "public static Block empty(int blockSize, int recordSize) {\n Record[] records = new Record[blockSize/recordSize];\n for (int i = 0; i < records.length; ++i) {\n records[i] = Record.empty();\n }\n return new Block(records, blockSize);\n }", "public void create(String indexerName,\n String workingDir,\n String namingPrefix,\n int recordPerFile,\n int recordByteSize)\n throws DataOrderingException;", "@JsonCreator\n public static DiskMode fromString(String name) {\n return fromString(name, DiskMode.class);\n }", "MemoryPartition createMemoryPartition();", "private static void initializeVM() throws Exception {\n Properties props = new Properties();\n props.setProperty(MCAST_PORT, \"0\");\n props.setProperty(LOCATORS, \"\");\n props.setProperty(LOG_LEVEL, \"info\"); // to keep diskPerf logs smaller\n distributedSystem = DistributedSystem.connect(props);\n cache = CacheFactory.create(distributedSystem);\n assertNotNull(cache);\n DiskStoreFactory dsf = cache.createDiskStoreFactory();\n AttributesFactory factory = new AttributesFactory();\n factory.setScope(Scope.LOCAL);\n\n File dir = new File(\"testingDirectoryDefault\");\n dir.mkdir();\n dir.deleteOnExit();\n File[] dirs = {dir};\n dsf.setDiskDirsAndSizes(dirs, new int[] {Integer.MAX_VALUE});\n\n dsf.setAutoCompact(false);\n DiskStore ds = dsf.create(regionName);\n factory.setDiskStoreName(ds.getName());\n factory.setDiskSynchronous(true);\n factory.setDataPolicy(DataPolicy.NORMAL);\n\n /* setting LIFO related eviction attributes */\n\n factory.setEvictionAttributes(EvictionAttributesImpl.createLIFOEntryAttributes(capacity,\n EvictionAction.OVERFLOW_TO_DISK));\n RegionAttributes attr = factory.create();\n\n ((GemFireCacheImpl) cache).createRegion(regionName, attr);\n lifoClockHand =\n ((VMLRURegionMap) ((LocalRegion) cache.getRegion(SEPARATOR + regionName)).entries)\n .getEvictionList();\n\n /* storing stats reference */\n lifoStats = lifoClockHand.getStatistics();\n\n }", "public void initDataSource(String path) throws IOException {\n File file = new File(path);\n if (!file.exists()) {\n Path dirPath = Paths.get(PATH);\n Files.createDirectories(dirPath);\n file.createNewFile();\n }\n }", "private <T extends BaseRecord> T createRecord(\n String data, Stat stat, Class<T> clazz) throws IOException {\n T record = newRecord(data, clazz, false);\n record.setDateCreated(stat.getCtime());\n record.setDateModified(stat.getMtime());\n return record;\n }", "public void factoryResetWithEraseSD() {\n Intent intent = new Intent(\n com.android.internal.os.storage.ExternalStorageFormatter.FORMAT_AND_FACTORY_RESET);\n intent.setComponent(com.android.internal.os.storage.ExternalStorageFormatter.COMPONENT_NAME);\n mContext.startService(intent);\n }", "public void startDia() {\r\n this.setStatus(false);\r\n this.isDiagStarted = true;\r\n if (!this.is_alg_started || (this.is_alg_started && ((this.is_already_read_from_DB && this.UseFile.isSelected())\r\n || (!this.is_already_read_from_DB && this.UseDB.isSelected())))) {\r\n this.dBInError = false;\r\n this.startALG(true);\r\n } else {\r\n try {\r\n Thread t2 = new Thread(new Diagram((ChineseWhispers) this.cw.clone()));\r\n t2.start();\r\n } catch (CloneNotSupportedException e) {\r\n e.printStackTrace();\r\n }\r\n this.setStatus(true);\r\n this.isDiagStarted = false;\r\n }\r\n }", "public Persistence() {}", "public static void setDiskCacheEnable(boolean enable) {\n sDiskCacheEnable = enable;\n }", "@SuppressWarnings(\"unused\")\n\tprivate FileChannel openDiskChannel() throws FileNotFoundException {\n\t\tRandomAccessFile f = new RandomAccessFile(this.underlined_device, \"rw\");\n\t\treturn f.getChannel();\n\t}", "public export.serializers.avro.DeviceInfo.Builder setSector(java.lang.CharSequence value) {\n validate(fields()[2], value);\n this.sector = value;\n fieldSetFlags()[2] = true;\n return this;\n }", "public ArcadeDrivetrain build() {\n verify();\n return new ArcadeDrivetrain(this);\n }", "public boolean is_empty() \n\t{\n\t\tif (this.nb_disk == 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public Builder clearFormat() {\n \n format_ = getDefaultInstance().getFormat();\n onChanged();\n return this;\n }", "public ChassisStashStorage() {\n super();\n }", "public DiskFileItem(final String fieldName, final String contentType,\n\t\tfinal boolean isFormField, final String fileName, final int sizeThreshold,\n\t\tfinal File repository, final IFileCleaner fileUploadCleaner)\n\t{\n\t\tthis.fieldName = fieldName;\n\t\tthis.contentType = contentType;\n\t\tthis.isFormField = isFormField;\n\t\tthis.fileName = fileName;\n\t\tthis.sizeThreshold = sizeThreshold;\n\t\tthis.repository = repository;\n\t\tthis.fileUploadCleaner = fileUploadCleaner;\n\t}", "public Storage() {\n this(null, DEFAULT_MAX, DEFAULT_MAX_SIZE);\n }", "private FSDataOutputStream createNewFile() throws Exception {\n\t\tlogger.traceEntry();\n\t\tPath newFile = new Path(rootDirectory, \"dim_\" + System.currentTimeMillis() + \".json\");\n\t\tlogger.debug(\"Creating file \" + newFile.getName());\n\t\tFSDataOutputStream dataOutputStream = null;\n\n\t\tif (!hadoopFileSystem.exists(newFile)) {\n\t\t\tdataOutputStream = hadoopFileSystem.create(newFile);\n\t\t} else {\n\t\t\tdataOutputStream = hadoopFileSystem.append(newFile);\n\t\t}\n\n\t\tdataOutputStreams.clear();\n\t\tdataOutputStreams.add(dataOutputStream);\n\t\tlogger.traceExit();\n\t\treturn dataOutputStream;\n\t}" ]
[ "0.53261006", "0.519236", "0.5164527", "0.51258904", "0.50909936", "0.4992179", "0.49495205", "0.494419", "0.4828924", "0.48282373", "0.4827019", "0.4772072", "0.47413167", "0.47395718", "0.4739173", "0.47343847", "0.4720808", "0.46975717", "0.46916917", "0.4645876", "0.4586049", "0.4572651", "0.45419", "0.45288002", "0.44903222", "0.4486291", "0.44391724", "0.43790102", "0.43783867", "0.436535", "0.43602332", "0.43372658", "0.43293703", "0.4310197", "0.4290891", "0.42671326", "0.42615205", "0.4253678", "0.42510718", "0.42059612", "0.41984412", "0.41835657", "0.41642973", "0.41530013", "0.41271657", "0.41271436", "0.41185558", "0.41106942", "0.4103605", "0.40998408", "0.40980557", "0.4083872", "0.40801919", "0.40640438", "0.4063133", "0.405615", "0.4054439", "0.40524724", "0.40508452", "0.4047242", "0.40458485", "0.4040925", "0.403596", "0.40231833", "0.40134802", "0.40095636", "0.3994087", "0.39920208", "0.3984741", "0.39838603", "0.39804634", "0.39790213", "0.39757288", "0.3975433", "0.39731565", "0.39617005", "0.39586717", "0.39541453", "0.394504", "0.39432502", "0.39364165", "0.39264023", "0.39031407", "0.39001188", "0.3889728", "0.3883192", "0.3882377", "0.38823003", "0.38821512", "0.3871039", "0.38678682", "0.38606203", "0.38566044", "0.3856378", "0.38560167", "0.38539162", "0.38532424", "0.384866", "0.38405886", "0.38396603" ]
0.73336333
0
Return the total number of data sectors that can be used not including space reseved for the log or other data sructures. This number will be smaller than Disk.NUM_OF_SECTORS.
public static int getNSectors() { return Disk.NUM_OF_SECTORS - ADisk.REDO_LOG_SECTORS - 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static long getNumSector(String requestSize, String sectorSize) {\n Double memSize = Double.parseDouble(requestSize);\n Double sectorBytes = Double.parseDouble(sectorSize);\n Double nSectors = memSize / sectorBytes;\n Double memSizeKB = memSize / 1024;\n Double memSizeGB = memSize / (1024 * 1024 * 1024);\n Double memSize100GB = memSizeGB / 100;\n\n // allocation bitmap file: one bit per sector\n Double allocBitmapSize = nSectors / 8;\n\n // extend overflow file: 4MB, plus 4MB per 100GB\n Double extOverflowFileSize = memSize100GB * 1024 * 1024 * 4;\n\n // journal file: 8MB, plus 8MB per 100GB\n Double journalFileSize = memSize100GB * 1024 * 1024 * 8;\n\n // catalog file: 10bytes per KB\n Double catalogFileSize = memSizeKB * 10;\n\n // hot files: 5bytes per KB\n Double hotFileSize = memSizeKB * 5;\n\n // quota users file and quota groups file\n Double quotaUsersFileSize = (memSizeGB * 256 + 1) * 64;\n Double quotaGroupsFileSize = (memSizeGB * 32 + 1) * 64;\n Double metadataSize = allocBitmapSize + extOverflowFileSize + journalFileSize\n + catalogFileSize + hotFileSize + quotaUsersFileSize + quotaGroupsFileSize;\n\n Double allocSize = memSize + metadataSize;\n Double numSectors = allocSize / sectorBytes;\n\n System.out.println(numSectors.longValue() + 1); // round up\n return numSectors.longValue() + 1;\n }", "public int getSize() {\n\n\treturn getSectors().size() * getUnitSize(); // 254 byte sectors\n }", "public long getFreeDiskSpace() {\n\n\t// Get the data of the BAM.\n\tbyte [] bamData = getSector( 18, 0).getDataBytes();\n\n\tlong result = 0L; // Buffer for the result.\n\n\t// Just count the set bits from 0x04 to 0x8f.\n\tfor( int currentByteIndex = 0x04; currentByteIndex <= 0x8f; ++currentByteIndex) {\n\t \n\t // Get the current byte from the BAM.\n\t byte currentBamByte = bamData[ currentByteIndex];\n\n\t // Count the set bits in the current byte.\n\t for( int currentBit = 1; currentBit <= 0x80; currentBit <<= 1) {\n\n\t\tif( ( currentBamByte & currentBit) != 0) { // Is this block available?\n\n\t\t // Yes => add this free sector to the result;\n\t\t result += getUnitSize();\n\t\t}\n\t }\n\t}\n\n\treturn result; // Return the result.\n }", "public int GetDiskUsed (final StreamVersion rkVersion)\r\n {\r\n return super.GetDiskUsed(rkVersion) +\r\n Stream.SIZEOF_BOOLEAN + //sizeof(char) + // Enabled\r\n Stream.SIZEOF_INT + //sizeof(int) + // FrontFace\r\n Stream.SIZEOF_INT; //sizeof(int); // CullFace\r\n }", "int getDisksCount();", "public void calculateDiskUsage() {\n\t\tdiskUsage = 0;\n\t\t// FIXME the speed of this can be improved by using a static map of content/ncc doc sizes \n\t\tfor (FilesetFile fsf : allFiles) {\n\t\t\tdiskUsage += fsf.getFile().length();\n\t\t}\t\t\n\t}", "public int[] getSectors() {\n return sectors;\n }", "public int sizeOfSegmentArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(SEGMENT$2);\n }\n }", "public static int size_count() {\n return (16 / 8);\n }", "Long diskSizeBytes();", "public static long getAvailableDiskSpace() {\r\n\t\treturn availableDiskSpace;\r\n\t}", "Integer diskSizeGB();", "public int sizeOfDataChckArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DATACHCK$14);\n }\n }", "public int get_sectors_per_track(int drive, int physical_side);", "public long memoriaDisponível() {\n int numeroDeParticoes = numeroDeParticoesDeDisco();\n long memoriaDisponivel = 0;\n for (int i = 0; i < numeroDeParticoes; i++) {\n memoriaDisponivel += operatingSystem.getFileSystem().getFileStores()[i].getUsableSpace();\n }\n return memoriaDisponivel;\n }", "public long size() {\n return segment.size();\n }", "public long getDiskUsage() {\n\t\treturn diskUsage;\n\t}", "public int sizeOfVolumeArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(VOLUME$4);\r\n }\r\n }", "public int getUnitSize() {\n\t\n\treturn 254; // A d64 block is 254 bytes (256 - pointer to the next sector).\n }", "public int getLogDiskSpaceLimit() {\n return agentConfig.getLogDiskSpaceLimit();\n }", "public int getTotalSegments() {\n return totalSegments;\n }", "int getChunksCount();", "int getChunksCount();", "public boolean hasSector() {\n return fieldSetFlags()[2];\n }", "public int numberOfSegments() {\n return nOfSegs;\n }", "public static int count() {\n return segmentList.size();\n }", "public int getNumPartitions() {\n\t\treturn (new HashSet<PartitionType>(partitionMap.values())).size(); \n\t}", "public long picoSize() throws IOException {\n return _backing.length();\n }", "public int getLogicalDiskSizeInGB() {\n return this.logicalDiskSizeInGB;\n }", "public int getLogicalDiskSizeInGB() {\n return this.logicalDiskSizeInGB;\n }", "public int sizeOfDosageArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DOSAGE$14);\n }\n }", "private long computeNumChunks() {\n Long storedLastSCId = lobProps.getLastSuperChunkId();\n\n if (storedLastSCId == null) {\n /* Failed between write of first chunk and metadata. */\n storedLastSCId = 1l;\n }\n\n /* Determine the last recorded saved super chunk. */\n long lastSCId = storedLastSCId + 1;\n long lastCId = findLastChunkInSuperChunk(lastSCId);\n if (lastCId == -1) {\n /* Look in the previous super chunk. */\n lastSCId--;\n lastCId = findLastChunkInSuperChunk(lastSCId);\n if (lastCId == -1) {\n if (lastSCId == 1) {\n /* At start, no chunks were written. */\n return 0;\n }\n final String msg = \"Expected at least one chunk for \" +\n lastSCId + \" Delete the LOB and retry.\";\n throw new IllegalStateException(msg);\n\n }\n }\n\n /* Have the last chunk. */\n return ((lastSCId - 1) * chunksPerPartition) + lastCId;\n }", "long getUsedSpace() throws IOException;", "public int getDriveCount() {\n return driveEncoder.getCount();\n }", "public int partitions() throws IOException {\n return TFS.getNumberOfFiles(RAW_TABLE.getPath() + Constants.PATH_SEPARATOR +\n MasterInfo.COL + COLUMN_INDEX);\n }", "public int numberOfSegments() {\n\t\treturn count;\n\t}", "public int sizeOfCharacteristicArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(CHARACTERISTIC$12);\n }\n }", "long getTotalFreeSpaceInBytes();", "long getTotalFreeSpaceInBytes();", "public int getTotalSize();", "public int size() throws IOException {\n return (int) (index.size() / INDEX_BLOCK_LEN);\n }", "public static int totalSize_entries_id() {\n return (176 / 8);\n }", "public double getOccupiedCpus () { return getCpuBaseResource().getOccupiedCapacity(); }", "public int numberOfSegments() { \n\t\treturn numOfSeg;\n\t}", "public static long diskUsage(File root) {\n\t\tlong total = root.length();\t\t\t\t\t\t\t//start with direct disk usage\n\t\tif(root.isDirectory()) {\t\t\t\t\t\t\t//and if this is a directory,\n\t\t\tfor(String childName : root.list()) {\t\t\t//then for each child\n\t\t\t\tFile child = new File(root, childName);\t\t//compose a full path to child\n\t\t\t\ttotal += diskUsage(child);\t\t\t\t\t//add child's usage to total\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(total + \"\\t\" + root); \t\t\t//descriptive output\n\t\treturn total;\t\t\t\t\t\t\t\t\t\t//return grand total\n\t}", "public int calcKernelSize() {\n\t\treturn 1+(int)Math.round(getStd()*3)*2;\n\t}", "int getBytesPerLine() {\n\t\treturn bytesInLine.intValue();\n\t}", "public short getNumberOfSlices() {\n\t\treturn getShort(ADACDictionary.RECONSTRUCTED_SLICES);\n\t}", "public static int totalSize_data() {\n return (480 / 8);\n }", "public int getSegmentCount() {\n\t\treturn this.segments.size();\n\t}", "public int discCount() {\n\t\tint countBLACK = discBlackCount();\n\t\tint countWHITE = discWhiteCount();\n\n\t\treturn countBLACK + countWHITE;\n\t\t\n\t}", "public int numberOfSegments() {\n return segments.size();\n }", "public long getTotalSpace(){\n return totalSpace;\n }", "public int numBlocks() throws IOException {\r\n int len = (int)((file.length()) / (blockSizeBytes));\r\n return len;\r\n }", "@Override\n\tpublic long getUsedSpace()\n\t{\n\t\treturn 0;\n\t}", "public int get_nr_of_segments() {\n return nr_of_segments;\n }", "public int size() {\n return logicalSize;\n }", "public long getBytesPerSec() {\n\t\tlong elapsed = (System.nanoTime() - startTime) / 1000000000;\n\t\tif (elapsed == 0) {\n\t\t\treturn bytesWrite;\n\t\t} else {\n\t\t\treturn bytesWrite / elapsed;\n\t\t}\n\t}", "public static long getTotalInternalMemorySize() {\r\n File path = Environment.getDataDirectory();\r\n StatFs stat = new StatFs(path.getPath());\r\n long blockSize = stat.getBlockSize();\r\n long totalBlocks = stat.getBlockCount();\r\n return totalBlocks * blockSize;\r\n }", "public int count() {\n\t\treturn sizeC;\n\t}", "public int numberOfSegments() {\n return numOfSegments;\n }", "int getTotalLength() {\n synchronized (lock) {\n return cache.getTotalLength();\n }\n }", "public static int size_infos_size_data() {\n return (8 / 8);\n }", "public static int size_counter() {\n return (32 / 8);\n }", "long getOccupiedSize();", "public int size() {\n return root.getNumberOfTerminalsInSubTree();\n }", "public static int totalSize_entries_receiveEst() {\n return (176 / 8);\n }", "@Override\n\tpublic Integer countBySector(List<Object[]> listEmision, String sector) {\n\t\tint indexSector = 1;\n\t\treturn emisionService.countSector(listEmision, sector, indexSector);\n\t}", "int getTotalSize();", "public static int size_reading() {\n return (16 / 8);\n }", "public static long getAllSize(){\n\t\tFile path = Environment.getExternalStorageDirectory(); \n\t\t\n\t\tlong size = 0;\n\t\tif (path.getPath().startsWith(\"/mnt\"))\n\t\t{\n \tFile dir = new File(\"/mnt\");\n \tif(dir.isDirectory())\n \t{\n \t\tFile[] files = dir.listFiles();\n \t\tif(files!=null)\n \t\t{\n \t\tfor(File file : files)\n \t\t{\n \t\t\tif((file.getPath().contains(\"sdcard\") || file.getPath().contains(\"SdCard\")) || file.getPath().equals(path.getPath()))\n \t\t\t{\n \t\t\t\tif(file.canRead())\n \t\t\t\t{\n\t\t \t\t\tStatFs stat = new StatFs(file.getPath()); \n\t\t \t\t\tlong blockSize = stat.getBlockSize(); \n\t\t \t\t\tlong availableBlocks = stat.getBlockCount();\n\t\t \t\t\tsize += availableBlocks * blockSize; \n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t}\n \t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tStatFs stat = new StatFs(path.getPath()); \n\t\t\tlong blockSize = stat.getBlockSize(); \n\t\t\tlong availableBlocks = stat.getBlockCount();\n\t\t\tsize = availableBlocks * blockSize; \n\t\t}\n\t\treturn size;\n\t}", "public int getTotalCapacity() {\n return totalCapacity;\n }", "int getNumOfChunks();", "public int getNumberOfOccupiedFields() {\n this.numberOfOccupiedFields = numberOfFieldsOccupiedByStoneColor(Color.WHITE) + numberOfFieldsOccupiedByStoneColor(Color.BLACK);\n return numberOfOccupiedFields;\n }", "public long getTotalCompactedSize() {\n return totalCompactedSize;\n }", "public int numPartitions() {\n\t\treturn vertex_sets.size();\n\t}", "public int numberOfBytes() {\n return this.data.size();\n }", "public int numPages() {\n // some code goes here\n //System.out.println(\"File length :\" + f.length());\n\n return (int) Math.ceil(f.length() * 1.0 / BufferPool.PAGE_SIZE * 1.0);\n }", "public int blockSize () {\n\t\treturn blockSize;\n\t}", "public static long getCacheSize() {\n return sDiskLruCache.size();\n }", "@Override\n public int blockSize() {\n return ciper.blockSize();\n }", "public int numPartitions() {\n return (11);\n }", "public int getIdentifiedUserDataSize() {\n return super.getCdSector().getCdUserDataSize() - 20;\n }", "public long getBlockCount ( ) {\r\n\t\treturn 436;\r\n\t}", "public synchronized int getSectionCount() {\n if (sections != null) {\n return sections.length;\n } else if (PropertyArray.get(props, SECTIONS) != null) {\n return parseSectionCount(PropertyArray.get(props, SECTIONS));\n } else {\n // hum, test props are never discarded, so we have no sections\n return 0;\n }\n }", "public int numberOfSegments() {\r\n return numberOfSegments;\r\n }", "protected long getDataFileSize() throws IOException\r\n {\r\n long size = 0;\r\n\r\n storageLock.readLock().lock();\r\n\r\n try\r\n {\r\n if (dataFile != null)\r\n {\r\n size = dataFile.length();\r\n }\r\n }\r\n finally\r\n {\r\n storageLock.readLock().unlock();\r\n }\r\n\r\n return size;\r\n }", "public int sizeOfDeviceArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DEVICE$12);\n }\n }", "public double getOccupiedRamGB () { return getRamBaseResource().getOccupiedCapacity(); }", "public int getTotalSize() {\n return totalSize_;\n }", "public static long getTotalInternalStorageSize() {\n StatFs stat = new StatFs(getInternalStoragePath());\n return stat.getBlockSize() * stat.getBlockCount();\n }", "public int kernelSize();", "public static long getAllSize1(){\n\t\tFile path = Environment.getExternalStorageDirectory(); \n\t\t\n\t\tlong size = 0;\n\t\tStatFs stat = new StatFs(path.getPath()); \n\t\tlong blockSize = stat.getBlockSize(); \n\t\tlong availableBlocks = stat.getBlockCount();\n\t\tsize = availableBlocks * blockSize; \n\t\treturn size;\n\t}", "private int computeCount() {\n \n int count;\n try{\n count = this.clippingFeatures.size() * this.featuresToClip.size();\n }catch(ArithmeticException e ){\n \n count = Integer.MAX_VALUE;\n }\n return count;\n }", "public int numPages() {\n // some code goes here\n return (int) Math.ceil(m_f.length() / BufferPool.PAGE_SIZE);\n }", "public int numberOfIcosahedrons() {\n return icosList.size();\n }", "public static int size_length() {\n return (8 / 8);\n }", "public int getSpace(){\n // iterate through nodes\n int totalSpace = 0;\n Collection<SupplyNode> nodeCol = t.values();\n Iterator<SupplyNode> it = nodeCol.iterator();\n \n // multiply resource count by resource space\n while (it.hasNext()){\n SupplyNode s = it.next();\n totalSpace += (s.getCurrent()*s.getResource().getCost());\n }\n \n // return\n return totalSpace;\n }", "public int getLectureTotalSize() {\n return tutLabGroups.get(\"_LEC\")[1];\n }", "public int sizeInBytes() {\n\t\treturn this.actualsizeinwords * 8;\n\t}" ]
[ "0.66862404", "0.65660065", "0.62361467", "0.62140286", "0.61370176", "0.6068049", "0.6056859", "0.5977229", "0.591146", "0.5906271", "0.5900453", "0.5887138", "0.58834773", "0.5881057", "0.5844807", "0.58434695", "0.57552975", "0.5750899", "0.5749812", "0.5723725", "0.57052183", "0.56786025", "0.56786025", "0.56753826", "0.56590647", "0.5611135", "0.5599854", "0.5587165", "0.557532", "0.557532", "0.5573138", "0.55657214", "0.55557704", "0.5555288", "0.5551778", "0.55468494", "0.55449367", "0.55434895", "0.55434895", "0.5537742", "0.5508761", "0.54934937", "0.5489764", "0.548869", "0.54825824", "0.5476986", "0.5470092", "0.54673314", "0.54545486", "0.54532945", "0.54457", "0.54389197", "0.5436586", "0.5418647", "0.54185134", "0.54142654", "0.5413719", "0.54121053", "0.5411453", "0.5409613", "0.53937864", "0.53893745", "0.5386909", "0.53859204", "0.5382506", "0.53804135", "0.5376725", "0.5372924", "0.5357316", "0.53480965", "0.5345874", "0.53444403", "0.53375953", "0.53372586", "0.53322953", "0.53315943", "0.53302443", "0.5327571", "0.53187567", "0.53167385", "0.5312594", "0.5309601", "0.5307043", "0.53059083", "0.5303549", "0.5299085", "0.528289", "0.5273343", "0.5271947", "0.5268533", "0.5266511", "0.52664506", "0.52538013", "0.52500486", "0.524837", "0.52477604", "0.5246212", "0.5245253", "0.5244038", "0.5240318" ]
0.7669268
0
Begin a new transaction and return a transaction ID
public TransID beginTransaction() { //TransID tid = new TransID(); Transaction collect_trans = new Transaction(this); atranslist.put(collect_trans); return collect_trans.getTid(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int startTransaction();", "public Transaction startTransaction(){\n\t\ttr = new Transaction(db);\n\t\treturn tr;\n\t}", "Transaction beginTx();", "void beginTransaction();", "void startTransaction();", "public void createTransaction(Transaction trans);", "public Transaction startTransaction() {\r\n return getManager().startTransaction();\r\n }", "Transaction createTransaction();", "public TitanTransaction start();", "public static void beginTransaction(int trans_id, String trans_type) {\n\n // System.out.println(\"beginTransaction\");\n long currTime = time;\n time++;\n Transaction txn = new Transaction(trans_id, currTime, trans_type);\n transactions.put(trans_id, txn);\n\n if (trans_type == \"RO\") {\n setVariableListForReadOnlyTxn(txn);\n System.out.println(\"T\" + trans_id + \" begins and is Read Only\");\n } else {\n System.out.println(\"T\" + trans_id + \" begins\");\n }\n\n\n }", "IDbTransaction beginTransaction();", "public void beginTransaction() {\n\r\n\t}", "long getTxid();", "public void beginTransaction() throws Exception;", "public long createTransaction(Credentials c, TransactionType tt) throws RelationException;", "IDbTransaction beginTransaction(IsolationLevel il);", "protected abstract Transaction createAndAdd();", "public void transactionStarted() {\n transactionStart = true;\n }", "private synchronized int getNewTransactionId() throws IOException {\n File file = new File(TA_ID_FILE_NAME);\n int transactionId = 0;\n\n if (file.exists()) {\n FileReader freader = new FileReader(file);\n BufferedReader breader = new BufferedReader(freader);\n\n String stringtaid = breader.readLine();\n transactionId = Integer.parseInt(stringtaid);\n\n breader.close();\n } else {\n file.createNewFile();\n }\n\n FileWriter writer = new FileWriter(TA_ID_FILE_NAME);\n writer.write(Integer.toString(transactionId + 1));\n writer.close();\n\n return transactionId;\n }", "Transaction getCurrentTransaction();", "java.lang.String getTxId();", "UUID getTransactionId();", "public synchronized long getNextTransactionID(){\n\t\treturn this.id++;\n\t}", "public String doInTransaction(final TransactionStatus status) {\n final ServiceTicket st = newST((TicketGrantingTicket) jpaTicketRegistry.getTicket(parentTgtId));\n jpaTicketRegistry.addTicket(st);\n return st.getId();\n }", "String getTransactionID();", "public void beginTransaction() throws TransactionException {\n\t\t\r\n\t}", "@Override\n\tpublic int newTransaction(String username, long amount, String type, String message) {\n\t\ttry {\n\t\t\tdb.getTransaction().begin();\n\t\t\tTransaction trans = new Transaction(username, amount, type, message);\n\t\t\tdb.persist(trans);\n\t\t\tdb.getTransaction().commit();\n\t\t\treturn trans.getId();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Upps, Something happened in the database\");\n\t\t\treturn -1;\n\t\t}\n\t}", "Transaction createTransaction(Settings settings);", "private void GenerateTxId() {\n Random random = new Random();\n final String txId = String.valueOf(10000000 + random.nextInt(90000000));\n transactionModel.txId = txId;\n }", "@Override\r\n\tpublic String createID() {\r\n\t\t \r\n\t\t\t\treturn transCode.toString();\r\n\t\t\t\t}", "void beginTransaction(ConnectionContext context) throws IOException;", "public Transaction createTransaction(Credentials user, TransactionType tt) throws RelationException;", "protected abstract Txn createTxn(Txn parent, IsolationLevel level) throws Exception;", "public boolean transactionStarted();", "public Transaction startTransaction() {\n Transaction transaction = THREADED_TRANSACTION.get();\n if (transaction == null) {\n transaction = openOrRetrieveSessionForThread().beginTransaction();\n THREADED_TRANSACTION.set(transaction);\n }\n return transaction;\n }", "void begin() throws org.omg.CosTransactions.SubtransactionsUnavailable;", "int insert(Transaction record);", "public long getTransactionId();", "public int getTransactionId() {\n return transactionId;\n }", "public TransactionID(){\r\nthis.id = transCount++;\r\n\r\n}", "@Override\n public void startTx() {\n \n }", "private void createTx() throws Exception {\n PublicKey recipient = Seed.getRandomAddress();\n Transaction tx = new Transaction(wallet.pb, recipient, wallet.pr);\n//\t\tSystem.out.println(\"Created a tx\");\n txPool.add(tx);\n//\t\tcache.put(tx.txId, null);\n sendTx(tx);\n }", "public int getTransactionId() {\n\t\treturn transactionId;\n\t}", "public long getBaseTransId() {\n return commitList.getBaseTransId();\n }", "public long getTransactionId() {\n return _sTransaction.getTransactionId();\n }", "public long getTransactionID() {\r\n return transactionID;\r\n }", "public int getTransactionID() {\r\n return transactionID;\r\n }", "public Object create() {\n executeCallbacks(CallbackType.BEFORE_CREATE);\n\n executeCallbacks(CallbackType.BEFORE_VALIDATION);\n executeValidations();\n executeValidationsOnCreate();\n executeCallbacks(CallbackType.AFTER_VALIDATION);\n\n if (errors.size() > 0) return this;\n\n Adapter adapter = getAdapter();\n if (getId() == null && adapter.shouldPrefetchPrimaryKey(getTableName())) {\n this.id = adapter.getNextSequenceValue(getSequenceName());\n }\n\n StringBuilder sql = new StringBuilder();\n sql.append(\"INSERT INTO \").append(getTableName()).append(\" (\");\n sql.append(quotedColumnNames(includePrimaryKey));\n sql.append(\") VALUES (\").append(quotedAttributeValues(includePrimaryKey)).append(\")\");\n\n id = adapter.insert(sql.toString(), getClass().getName() + \" Create\");\n\n readAssociations();\n readAggregations();\n\n newRecord = false;\n\n executeCallbacks(CallbackType.AFTER_CREATE);\n\n return id;\n }", "public void begin()\n {\n checkTransactionJoin();\n if (joinStatus != JoinStatus.NO_TXN)\n {\n throw new NucleusTransactionException(\"JTA Transaction is already active\");\n }\n\n UserTransaction utx;\n try\n {\n utx = getUserTransaction();\n }\n catch (NamingException e)\n {\n throw ec.getApiAdapter().getUserExceptionForException(\"Failed to obtain UserTransaction\", e);\n }\n\n try\n {\n utx.begin();\n }\n catch (NotSupportedException e)\n {\n throw ec.getApiAdapter().getUserExceptionForException(\"Failed to begin UserTransaction\", e);\n }\n catch (SystemException e)\n {\n throw ec.getApiAdapter().getUserExceptionForException(\"Failed to begin UserTransaction\", e);\n }\n\n checkTransactionJoin();\n if (joinStatus != JoinStatus.JOINED)\n {\n throw new NucleusTransactionException(\"Cannot join an auto started UserTransaction\");\n }\n userTransaction = utx;\n }", "protected abstract Object newTransaction(int isolationLevel) throws TransactionInfrastructureException;", "public void transaction() throws DBException {\n\t\tUsersTransaction transaction = new UsersTransaction();\n\t\tScanner scan = new Scanner(System.in);\n\t\tLogger.info(\"================TRANSACTION DETAILS TO DONATE======================\");\n\t\tLogger.info(\"Enter the transaction ID\");\n\t\ttransactionId = scan.nextInt();\n\t\tLogger.info(\"Enter the donor ID\");\n\t\tdonorId = scan.nextInt();\n\t\tLogger.info(\"Enter the fund Id\");\n\t\tfundRequestId = scan.nextInt();\n\t\tLogger.info(\"Enter the amount to be funded\");\n\t\ttargetAmount = scan.nextInt();\n\t\ttransaction.setTransactionId(transactionId);\n\t\ttransaction.setDonorId(donorId);\n\t\ttransaction.setFundRequestId(fundRequestId);\n\t\ttransaction.setTargetAmount(targetAmount);\n\t\tinsert(transaction);\n\t\tdonorFundRequest(reqType);\n\t}", "public void openTheTransaction() {\n openTransaction();\n }", "void setTransactionId( long txId )\n {\n this.transactionId = txId;\n }", "public TransactionContext startTransaction() {\n MyConnection connection;\n try {\n connection = supplyConnection();\n } catch (SQLException e) {\n throw new UncheckedSQLException(e);\n }\n return new TransactionContext(connection);\n }", "String getStartTransactionSql();", "public int getId() {\n return txId;\n }", "public Long getTransactionId() {\n\t\treturn transactionId;\n\t}", "public long getTransactionid() {\n return transactionid;\n }", "public String getTransactionId()\n\t{\n\t\treturn transactionId;\n\t}", "String getTransactionId();", "String getTransactionId();", "@Override\n public SimpleTransaction getTransaction() throws SystemException {\n SimpleTransaction txn = txns.get();\n if (txn == null) {\n txn = new SimpleTransaction();\n txn.setStatus(Status.STATUS_ACTIVE);\n txns.set(txn);\n }\n return txn;\n }", "public String getTransactionId() {\n return transactionId;\n }", "public String getTransactionId() {\n return transactionId;\n }", "@Override\n\tpublic void beginTransaction() {\n\t\tSystem.out.println(\"Transaction 1 begins\");\n\t\t\n\t\t/*String queryLock = \"LOCK TABLES hpq_mem READ;\";\n\t\t\n\t\tPreparedStatement ps;\n\t\ttry {\n\t\t\tconn.setAutoCommit(false);\n\t\t\tps = conn.prepareStatement(queryLock);\n\t\t\tps.execute();\n\t\t\tps = conn.prepareStatement(\"START TRANSACTION;\");\n\t\t\tps.execute();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t\n\t\tSystem.out.println(\"After obtaining readLock\");\n\t\t\n\t}", "@Test\n public void existingTransaction() {\n Transaction t1 = startTransaction();\n IntRef intValue = new IntRef(10);\n t1.commit();\n\n Transaction t2 = startTransaction();\n assertEquals(10, intValue.get());\n\n intValue.inc();\n assertEquals(11, intValue.get());\n t2.commit();\n }", "void addTransaction(Transaction transaction, long timestamp) throws TransactionNotInRangeException;", "protected void startTopLevelTrx() {\n startTransaction();\n }", "public void setTransactionId(int value) {\n this.transactionId = value;\n }", "public String getTransactionId() {\n\t\treturn transactionId;\n\t}", "public String getTransactionId() {\n\t\treturn transactionId;\n\t}", "@Override\r\n\tpublic int addTran(Transaction transaction) throws Exception {\n\t\t\t\t\r\n\t\treturn tranDao.insertTran(transaction);\r\n\t}", "public long openTransaction() {\n try (var conn = openConnection()) {\n // Notify the user of a new connection\\\n var oos = new ObjectOutputStream(conn.getOutputStream());\n var ois = new ObjectInputStream(conn.getInputStream());\n oos.writeObject(new OpenMessage());\n return ois.readLong();\n } catch (Exception e) {\n System.err.println(\"Couldn't open transaction!\");\n e.printStackTrace();\n return -1l;\n }\n }", "protected String getTransactionId() {\n return transactionId;\n }", "public Transaction() {\n this(0, 0, null);\n }", "TransactionContext preAppendTransaction() throws IOException;", "TransactionType createTransactionType();", "public void beginTransaction() throws SQLException {\r\n conn.setAutoCommit(false);\r\n beginTransactionStatement.executeUpdate();\r\n }", "public Long getTransactionId() {\n return this.transactionId;\n }", "public Object getTransactionId() throws StandardException;", "public TransactionID(Sha256Hash txHash, int txIndex) {\n this.txHash = txHash;\n this.txIndex = txIndex;\n }", "public boolean requestTransaction(String name,String reason,double amount){\n Transaction t1 = new Transaction(name,reason,amount);\n boolean done=t1.registertransaction();\n \n return done; \n \n}", "@Override\n\tpublic int createTransaction(BankTransaction transaction) throws BusinessException {\n\t\tint tran = 0;\n\t\t\n\t\ttry {\n\t\t\tConnection connection = PostgresqlConnection.getConnection();\n\t\t\tString sql = \"insert into dutybank.transactions (account_id, transaction_type, amount, transaction_date) values(?,?,?,?)\";\n\t\t\t\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\t\t\t\n\t\t\tpreparedStatement.setInt(1, transaction.getAccountid());\n\t\t\tpreparedStatement.setString(2, transaction.getTransactiontype());\n\t\t\tpreparedStatement.setDouble(3, transaction.getTransactionamount());\n\t\t\tpreparedStatement.setDate(4, new java.sql.Date(transaction.getTransactiondate().getTime()));\n\n\t\t\t\n\t\t\ttran = preparedStatement.executeUpdate();\n\t\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tthrow new BusinessException(\"Some internal error has occurred while inserting data\");\n\t\t}\n\t\t\n\n\t\treturn tran;\n\t}", "public String getTransactionId() {\n return this.transactionId;\n }", "public static void beginTransaction() throws HException {\r\n\t\t\r\n\t\tTransaction tx = (Transaction) threadTransaction.get();\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (tx == null) {\r\n\t\t\t\t// log.debug(\"Starting new database transaction in this\r\n\t\t\t\t// thread.\");\r\n\t\t\t\t//Session =getSession();\r\n\t\t\t\ttx = getSession().beginTransaction();\r\n\t\t\t\tthreadTransaction.set(tx);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tthrow new HException(ex);\r\n\t\t}\r\n\t}", "public static PolyXid generateLocalTransactionIdentifier( final PUID nodeId, final PUID transactionId ) {\n return new PolyXid( nodeId, transactionId );\n }", "public Receipt recordTransaction(Transaction t) throws RemoteException;", "Id createId();", "public final static Transaction getCurrentTransaction() {\n return (Transaction) transactionTable.get();\n }", "public void begin(){\n\t\tTransaction block = new Transaction();\n\t\tblock.setPrev(blocks.getLast());\n\t\tblocks.add(block);\n\t}", "public String getTransactionID() {\n\t return this.transactionID;\n\t}", "public static void createTransaction() throws IOException {\n\t\t\n\t\tDate date = new Date((long) random(100000000));\n\t\tString date2 = \"'19\" + date.getYear() + \"-\" + (random(12)+1) + \"-\" + (random(28)+1) + \"'\";\n\t\tint amount = random(10000);\n\t\tint cid = random(SSNmap.size()) + 1;\n\t\tint vid = random(venders.size()) + 1;\n\t\t\n\t\twhile(ownership.get(cid) == null)\n\t\t\tcid = random(SSNmap.size()) + 1;\n\t\tString cc = ownership.get(cid).get(random(ownership.get(cid).size()));\n\t\t\n\t\twriter.write(\"INSERT INTO Transaction (Id, Date, vid, cid, CCNum, amount) Values (\" + tid++ +\", \" \n\t\t\t\t+ date2 + \", \" + vid + \", \" + cid + \", '\" + cc + \"', \" + amount + line);\n\t\twriter.flush();\n\t}", "private MetaSparqlRequest createRollbackPreInsered() {\n\t\treturn createRollbackMT1();\n\t}", "public String getFirstTxId() {\n\t\t\treturn firstTxId;\n\t\t}", "Transaction getTransctionByTxId(String txId);", "public static Integer getTransactionNumber() {\n\t\tRandom r = new Random(System.currentTimeMillis());\n\t\treturn r.nextInt(100000) * 00001;\n\n\t}", "@Override\n\tpublic void onTransactionStart() {}", "@Override\n\tpublic void createTransaction(Transaction t) { \n\t\t/* begin transaction */ \n\t\tSession session = getCurrentSession(); \n\t\tsession.beginTransaction(); \n\n\t\t/* save */ \n\t\tsession.save(t);\n\n\t\t/* commit */ \n\t\tsession.getTransaction().commit();\n\t}", "private void executeTransaction(ArrayList<Request> transaction) {\n // create a new TransactionMessage\n TransactionMessage tm = new TransactionMessage(transaction);\n //if(tm.getStatementCode(0)!=8&&tm.getStatementCode(0)!=14)\n // return;\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(tm);\n oos.flush();\n\n byte[] data = bos.toByteArray();\n\n byte[] buffer = null;\n long startTime = System.currentTimeMillis();\n buffer = clientShim.execute(data);\n long endTime = System.currentTimeMillis();\n if (reqIndex < maxNoOfRequests && id > 0) {\n System.out.println(\"#req\" + reqIndex + \" \" + startTime + \" \" + endTime + \" \" + id);\n }\n reqIndex++;\n\n father.addTransaction();\n\n // IN THE MEAN TIME THE INTERACTION IS BEING EXECUTED\n\n\t\t\t\t/*\n\t\t\t\t * possible values of r: 0: commit 1: rollback 2: error\n\t\t\t\t */\n int r = ByteBuffer.wrap(buffer).getInt();\n //System.out.println(\"r = \"+r);\n if (r == 0) {\n father.addCommit();\n } else if (r == 1) {\n father.addRollback();\n } else {\n father.addError();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void beginTransaction() throws SQLException\n\t{\n\t\tconn.setAutoCommit(false);\n\t\tbeginTransactionStatement.executeUpdate();\n\t}" ]
[ "0.7354779", "0.7272246", "0.6921341", "0.6894881", "0.6842019", "0.68383026", "0.6773633", "0.6754225", "0.671597", "0.6654376", "0.66420376", "0.6556594", "0.65080327", "0.647724", "0.6476613", "0.6360051", "0.6327908", "0.6322216", "0.6314968", "0.62405974", "0.62252474", "0.62084913", "0.6146472", "0.6130111", "0.6083951", "0.60791403", "0.60732555", "0.60711104", "0.60587394", "0.60556525", "0.6037277", "0.601672", "0.5970782", "0.59478915", "0.59424853", "0.5942163", "0.5929936", "0.59236264", "0.5897143", "0.5874025", "0.5856548", "0.585017", "0.5842225", "0.58387166", "0.5817793", "0.58141845", "0.57893944", "0.576083", "0.5751818", "0.5737647", "0.57308817", "0.57280946", "0.5726003", "0.5718215", "0.57079", "0.5698695", "0.5679164", "0.5660287", "0.5658211", "0.5656928", "0.5656928", "0.56508327", "0.56494683", "0.56494683", "0.56372", "0.56323844", "0.56257355", "0.5623454", "0.5609202", "0.56005216", "0.56005216", "0.55994636", "0.558741", "0.5569461", "0.5554095", "0.5551602", "0.5537006", "0.5516615", "0.55115616", "0.55036175", "0.5502061", "0.54940873", "0.54929477", "0.5485403", "0.5481114", "0.5477392", "0.54648244", "0.54579854", "0.545624", "0.5452549", "0.5451808", "0.54429984", "0.5439408", "0.5432026", "0.542437", "0.54216397", "0.5415639", "0.5402985", "0.5379568", "0.53729504" ]
0.7947532
0
First issue writes to put all of the transaction's writes in the log. Then issue a barrier to the Disk's write queue. Then, mark the log to indicate that the specified transaction has been committed. Then wait until the "commit" is safely on disk (in the log). Then take some action to make sure that eventually the updates in the log make it to their final location on disk. Do not wait for these writes to occur. These writes should be asynchronous. Note: You must ensure that (a) all writes in the transaction are in the log before the commit record is in the log and (b) the commit record is in the log before this method returns. Throws IOException if the disk fails to complete the commit or the log is full. IllegalArgumentException if tid does not refer to an active transaction.
public void commitTransaction(TransID tid) throws IOException, IllegalArgumentException{// Not yet complete try { ADisk_lock.lock(); // Call commit atranslist.get(tid).commit(); Transaction temp = atranslist.remove(tid); wblist.addCommitted(temp); } finally{ ADisk_lock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void commit() throws IOException {\n this.snapLog.commit();\n }", "public void commit(int tid) {\n List<Lock> lockList = null;\n\n // check wheter there is read-only transaction running\n boolean hasRO = _tm.hasRunningReadonly();\n for (Integer varIndex : _lockTable.keySet()) {\n lockList = _lockTable.get(varIndex);\n int size = lockList.size();\n for (int i = size - 1; i >= 0; i--) {\n Lock lc = lockList.get(i);\n if (lc.getTranId() == tid) {\n\n // If the lock type is write, means this transaction writes a variable\n // in uncommitDataMap\n if (lc.getType() == Lock.Type.WRITE) {\n if (_uncommitDataMap.containsKey(varIndex)) {\n List<Data> dataList = _dataMap.get(varIndex);\n Data d = _uncommitDataMap.get(varIndex);\n d.setCommitTime(_tm.getCurrentTime());\n\n // If no read-only transaction, replace the old version\n if (!hasRO) {\n dataList.clear();\n }\n dataList.add(d);\n _uncommitDataMap.remove(varIndex);\n }\n }\n lockList.remove(i);\n break;\n }\n }\n }\n // remove this transaction from accessed list\n _accessedTransactions.remove(tid);\n }", "private final void onDisk(TransactionInternal txn, LogEntry entry) throws BabuDBException {\n \n // append the entry to the DiskLogger if available, wait otherwise\n try {\n \n synchronized (diskLogger) {\n \n while (diskLogger.get() == null) {\n diskLogger.wait();\n }\n \n diskLogger.get().append(entry);\n }\n } catch (InterruptedException ie) {\n \n if (entry != null) entry.free();\n throw new BabuDBException(ErrorCode.INTERRUPTED, \"Operation \" +\n \"could not have been stored persistent to disk and \" +\n \"will therefore be discarded.\", ie.getCause());\n } \n }", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for proj1\n\n \t\n \t//commit, flush the pages\n \tif(commit){\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tflushPage(pageId);\n \t\t\t\tpage.setBeforeImage();\n \t\t\t}\n\n if (page.isDirty() == null) {\n page.setBeforeImage();\n }\n \t\t\t\n \t\t}\n \t}\n \telse{\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page, revert changes\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tNode n = bufferedPages.get(pageId);\n \t\t\t\tn.page = page.getBeforeImage();\n \t\t\t\tbufferedPages.put(pageId, n);\n // updateLruWithNewNode(pageId, page.getBeforeImage());\n \t\t\t}\n \t\t\t\n \t\t}\n \t}\n \t\n \t//release the lock\n \tlockManager.releaseAllTransactionLocks(tid);\n \tcurrentTransactions.remove(tid);\n \t\n }", "public void commitPendingDataToDisk() {\n /*\n r5 = this;\n monitor-enter(r5);\n r1 = r5.mPendingWrite;\t Catch:{ all -> 0x0039 }\n r3 = 0;\n r5.mPendingWrite = r3;\t Catch:{ all -> 0x0039 }\n if (r1 != 0) goto L_0x000a;\n L_0x0008:\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n L_0x0009:\n return;\n L_0x000a:\n r3 = r5.mWriteLock;\t Catch:{ all -> 0x0039 }\n r3.lock();\t Catch:{ all -> 0x0039 }\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n r2 = new java.io.FileOutputStream;\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3 = r3.chooseForWrite();\t Catch:{ IOException -> 0x003c }\n r2.<init>(r3);\t Catch:{ IOException -> 0x003c }\n r3 = r1.marshall();\t Catch:{ IOException -> 0x003c }\n r2.write(r3);\t Catch:{ IOException -> 0x003c }\n r2.flush();\t Catch:{ IOException -> 0x003c }\n android.os.FileUtils.sync(r2);\t Catch:{ IOException -> 0x003c }\n r2.close();\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3.commit();\t Catch:{ IOException -> 0x003c }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0039:\n r3 = move-exception;\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n throw r3;\n L_0x003c:\n r0 = move-exception;\n r3 = \"BatteryStats\";\n r4 = \"Error writing battery statistics\";\n android.util.Slog.w(r3, r4, r0);\t Catch:{ all -> 0x0052 }\n r3 = r5.mFile;\t Catch:{ all -> 0x0052 }\n r3.rollback();\t Catch:{ all -> 0x0052 }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0052:\n r3 = move-exception;\n r1.recycle();\n r4 = r5.mWriteLock;\n r4.unlock();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.internal.os.BatteryStatsImpl.commitPendingDataToDisk():void\");\n }", "@Override\n public void commit() throws IOException {\n if (!committed && currentFile != null) {\n long pos = currentFile.getLineReadPos();\n currentFile.setPos(pos);\n currentFile.setLastUpdated(updateTime);\n committed = true;\n }\n }", "public void commit () throws IOException {\n log.info(\"Internal committing index ... \");\n this.writer().commit();\n commitCounter = 0;\n this.closeReader();\n }", "private static synchronized void writeTransaction( StmTransaction transaction ) {\n\n // Check for conflicts.\n for ( AbstractVersionedItem versionedItem : transaction.versionedItemsRead ) {\n versionedItem.ensureNotWrittenByOtherTransaction();\n }\n\n // Set the revision number to a committed value.\n transaction.targetRevisionNumber.set( lastCommittedRevisionNumber.incrementAndGet() );\n\n }", "public void transactionComplete(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\\\n \t//should always commit, simply call transactionComplete(tid,true)\n \ttransactionComplete(tid, true);\n \t\n }", "public synchronized void writeCommit(Transaction t) {\n\t\tflush();\n\t\tpw.println(t.transactionId() + \" commit\");\t\n\t\tflush();\n\t}", "public void commit() {\n tryCommit(true);\n }", "public void commit() {\n doCommit();\n }", "public void forceCommitTx()\n{\n}", "public void commit(String logMsg) throws IOException {\n if (Utils.plainFilenamesIn(INDEX).size() == 0\n && Utils.plainFilenamesIn(REMOVAL).size() == 0) {\n System.out.println(\"No changes added to the commit.\");\n System.exit(0);\n }\n File head = new File(Main.DOTFILE, \"head\");\n if (head.exists()) {\n String parentCommit = Utils.readObject(head, String.class);\n Commit newCommit = new Commit(logMsg, parentCommit);\n helperCommit(newCommit);\n }\n }", "public void commit() {\n\t\tcommitted = true;\n\t}", "public void storeAndCommit() {\n \tsynchronized(mDB.lock()) {\n \t\ttry {\n \t \t\tstoreWithoutCommit();\n \t \t\tcheckedCommit(this);\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \t}\n }", "private void logTx(String message) throws IOException {\n\t\tlog.write(\"TX \" + System.currentTimeMillis() +\n\t\t\t\": \" + message + \"\\n\");\n\t}", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "void commit() throws CommitException;", "public void commitWait()\n {\n try{\n waitLock.lock();\n while(commitBarrierSector != -1){\n \t commitDone.awaitUninterruptibly();\n }\n return;\n }\n finally{\n waitLock.unlock();\n }\n }", "public void commitChanges(){\r\n try{\r\n //Record the state of unfinished set in unfinished.dat\r\n unfinishedFileOutputStream = new FileOutputStream(UNFINISHED_FILE_PATH);\r\n unfinishedSetOutputStream = new ObjectOutputStream(unfinishedFileOutputStream);\r\n unfinishedSetOutputStream.writeObject(unfinished);\r\n unfinishedSetOutputStream.close();\r\n unfinishedFileOutputStream.close();\r\n\r\n //Record the state of finished list in finished.dat\r\n finishedFileOutputStream = new FileOutputStream(FINISHED_FILE_PATH);\r\n finishedListOutputStream = new ObjectOutputStream(finishedFileOutputStream);\r\n finishedListOutputStream.writeObject(finished);\r\n finishedListOutputStream.close();\r\n finishedFileOutputStream.close();\r\n\r\n //Record the state of activities list in activities.dat\r\n activitiesFileOutputStream = new FileOutputStream(ACTIVITIES_FILE_PATH);\r\n activitiesListOutputStream = new ObjectOutputStream(activitiesFileOutputStream);\r\n activitiesListOutputStream.writeObject(activities);\r\n activitiesListOutputStream.close();\r\n activitiesFileOutputStream.close();\r\n }\r\n catch(Exception e){\r\n System.out.println(\"Stress in commiting changes: \" + e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "public static void log() {\n String branch = commitPointers.readHeadCommit()[0];\n String currName = commitPointers.readHeadCommit()[1];\n File cFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n Commit curr = Utils.readObject(cFile, Commit.class);\n\n while (currName != null) {\n System.out.println(\"===\");\n System.out.println(\"commit \" + curr.commitID);\n if (curr.parentID.size() == 2) {\n System.out.println(\"Merge: \" + curr.parentID.get(0).substring(0, 7) + \" \" + curr.parentID.get(1).substring(0, 7));\n }\n System.out.println(\"Date: \" + curr.timeStamp.format(myFormatObj) + \" -0800\");\n System.out.println(curr.message);\n System.out.println();\n\n currName = curr.parentID.get(0);\n\n if (currName != null) {\n File newcFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n curr = Utils.readObject(newcFile, Commit.class);\n }\n }\n }", "Clock.Entry tryCommit(Transaction transaction, long id);", "private void sendTransactionQueue(final List<TransactionData> queue, final Path path) {\n List<Long> setsToIgnore = new ArrayList<Long>();\n for (TransactionData txn : queue) {\n setsToIgnore.add(txn.currentWriteId);\n }\n\n Node latestState = this.getLatestState(path, setsToIgnore);\n Node snapToSend = latestState;\n String latestHash = \"badhash\";\n if (!hijackHash) {\n latestHash = latestState.getHash();\n }\n\n for (TransactionData txn : queue) {\n hardAssert(\n txn.status\n == TransactionStatus.RUN); // sendTransactionQueue: items in queue should all be run.'\n txn.status = TransactionStatus.SENT;\n txn.retryCount++;\n Path relativePath = Path.getRelative(path, txn.path);\n // If we've gotten to this point, the output snapshot must be defined.\n snapToSend = snapToSend.updateChild(relativePath, txn.currentOutputSnapshotRaw);\n }\n\n Object dataToSend = snapToSend.getValue(true);\n\n final Repo repo = this;\n\n // Send the put.\n connection.compareAndPut(\n path.asList(),\n dataToSend,\n latestHash,\n new RequestResultCallback() {\n @Override\n public void onRequestResult(String optErrorCode, String optErrorMessage) {\n DatabaseError error = fromErrorCode(optErrorCode, optErrorMessage);\n warnIfWriteFailed(\"Transaction\", path, error);\n List<Event> events = new ArrayList<Event>();\n\n if (error == null) {\n List<Runnable> callbacks = new ArrayList<Runnable>();\n for (final TransactionData txn : queue) {\n txn.status = TransactionStatus.COMPLETED;\n events.addAll(\n serverSyncTree.ackUserWrite(\n txn.currentWriteId, /*revert=*/ false, /*persist=*/ false, serverClock));\n\n // We never unset the output snapshot, and given that this\n // transaction is complete, it should be set\n Node node = txn.currentOutputSnapshotResolved;\n final DataSnapshot snap =\n InternalHelpers.createDataSnapshot(\n InternalHelpers.createReference(repo, txn.path), IndexedNode.from(node));\n\n callbacks.add(\n new Runnable() {\n @Override\n public void run() {\n txn.handler.onComplete(null, true, snap);\n }\n });\n // Remove the outstanding value listener that we added\n removeEventCallback(\n new ValueEventRegistration(\n Repo.this,\n txn.outstandingListener,\n QuerySpec.defaultQueryAtPath(txn.path)));\n }\n\n // Now remove the completed transactions\n pruneCompletedTransactions(transactionQueueTree.subTree(path));\n\n // There may be pending transactions that we can now send\n sendAllReadyTransactions();\n\n repo.postEvents(events);\n\n // Finally, run the callbacks\n for (int i = 0; i < callbacks.size(); ++i) {\n postEvent(callbacks.get(i));\n }\n } else {\n // transactions are no longer sent. Update their status appropriately\n if (error.getCode() == DatabaseError.DATA_STALE) {\n for (TransactionData transaction : queue) {\n if (transaction.status == TransactionStatus.SENT_NEEDS_ABORT) {\n transaction.status = TransactionStatus.NEEDS_ABORT;\n } else {\n transaction.status = TransactionStatus.RUN;\n }\n }\n } else {\n for (TransactionData transaction : queue) {\n transaction.status = TransactionStatus.NEEDS_ABORT;\n transaction.abortReason = error;\n }\n }\n\n // since we reverted mergedData, we should re-run any remaining\n // transactions and raise events\n rerunTransactions(path);\n }\n }\n });\n }", "void commit() throws InterruptedException;", "public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}", "public synchronized void commit(int trxnId)\n {\n ResourceManager rm;\n for (Enumeration e = transactionTouch.keys(); e.hasMoreElements();) {\n rm = (ResourceManager)e.nextElement();\n try {\n rm.commit(trxnId);\n } catch (Exception x)\n {\n System.out.println(\"EXCEPTION:\");\n System.out.println(x.getMessage());\n x.printStackTrace();\n }\n }\n transactionTouch.remove(trxnId);\n lm.UnlockAll(trxnId);\n }", "void commit() throws IndexTransactionException;", "private void indexInTransaction(SVNLogEntry logEntry) throws SVNException {\n // Log values\n long revision = logEntry.getRevision();\n String author = logEntry.getAuthor();\n // Date to date time\n Date date = logEntry.getDate();\n DateTime dateTime = new DateTime(date.getTime(), DateTimeZone.UTC);\n // Message\n String message = logEntry.getMessage();\n // Branch for the revision\n String branch = getBranchForRevision(logEntry);\n // Logging\n logger.info(String.format(\"Indexing revision %d\", revision));\n // Inserting or updating the revision\n revisionDao.addRevision(revision, author, dateTime, message, branch);\n // Merge relationships (using a nested SVN client)\n Transaction svn = transactionService.start(true);\n try {\n List<Long> mergedRevisions = subversionService.getMergedRevisions(SVNUtils.toURL(subversionConfigurationExtension.getUrl(), branch), revision);\n revisionDao.addMergedRevisions(revision, mergedRevisions);\n } finally {\n svn.close();\n }\n // Subversion events\n indexSVNEvents(logEntry);\n // Indexes the issues\n indexIssues(logEntry);\n }", "public void commit(Transaction t) {\n\t\ttry {\n\t\t\tArrayList<Record> records = new ArrayList<Record>();\n\t\t\tfor (int i = 0; i < t.noOfBundles; i++) {\n\t\t\t\tString record = \"\";\n\t\t\t\tBundle b = t.bundles[i];\n\t\t\t\tbyte[] recd = b.data;\n\t\t\t\trecord = new String(recd);\n\t\t\t\tString rec[] = record.split(\"\\n\");\n\t\t\t\tRecord r = new Record();\n\t\t\t\tr.rowid = Long.parseLong(rec[0]);\n\t\t\t\tr.groupid = rec[1];\n\t\t\t\tr.key = rec[2];\n\t\t\t\tr.value = rec[3];\n\t\t\t\tr.user = rec[4];\n\t\t\t\tr.datatype = rec[5];\n\t\t\t\tr.timestamp = Long.parseLong(rec[6]);\n\t\t\t\tr.synced = \"Y\";\n\t\t\t\tif (r.datatype.equals(\"file\")) {\n\t\t\t\t\tint l = Integer.parseInt(r.value.substring(0,\n\t\t\t\t\t\t\tr.value.indexOf(' ')));\n\t\t\t\t\tString fileName = r.value\n\t\t\t\t\t\t\t.substring(r.value.indexOf(' ') + 1);\n\t\t\t\t\tfileName = deviceId + \"_\" + t.transactionId + \"_\" + i + \"_\"\n\t\t\t\t\t\t\t+ fileName;\n\t\t\t\t\tString path = storagePath + \"/\" + fileName;\n\t\t\t\t\tFile f = new File(path);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(f);\n\t\t\t\t\tfor (int j = 1; j <= l; j++) {\n\t\t\t\t\t\tb = t.bundles[i + j];\n\t\t\t\t\t\tfos.write(b.data);\n\t\t\t\t\t}\n\t\t\t\t\tfos.close();\n\t\t\t\t\ti += l;\n\t\t\t\t\tr.value = path;\n\t\t\t\t}\n\t\t\t\trecords.add(r);\n\t\t\t}\n\t\t\tdh.putToRepository(records);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void testCommitOrRollback() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n startService();\n Connection conn = sqlDbManager.getConnection();\n Logger logger = Logger.getLogger(\"testCommitOrRollback\");\n SqlDbManager.commitOrRollback(conn, logger);\n SqlDbManager.safeCloseConnection(conn);\n\n conn = null;\n try {\n SqlDbManager.commitOrRollback(conn, logger);\n } catch (NullPointerException sqle) {\n }\n }", "void commit() {\r\n tx.commit();\r\n tx = new Transaction();\r\n }", "private void flushDirtyLogs() {\n logger.debug(\"Checking for dirty logs to flush...\");\n Utils.foreach(logs, new Callable1<Map.Entry<TopicAndPartition, Log>>() {\n @Override\n public void apply(Map.Entry<TopicAndPartition, Log> _) {\n TopicAndPartition topicAndPartition = _.getKey();\n Log log = _.getValue();\n\n try {\n long timeSinceLastFlush = time.milliseconds() - log.lastFlushTime();\n logger.debug(\"Checking if flush is needed on \" + topicAndPartition.topic + \" flush interval \" + log.config.flushMs + \" last flushed \" + log.lastFlushTime() + \" time since last flush: \" + timeSinceLastFlush);\n if (timeSinceLastFlush >= log.config.flushMs)\n log.flush();\n } catch (Throwable e) {\n logger.error(\"Error flushing topic \" + topicAndPartition.topic, e);\n if (e instanceof IOException) {\n logger.error(\"Halting due to unrecoverable I/O error while flushing logs: \" + e.getMessage(), e);\n System.exit(1);\n }\n }\n }\n });\n }", "protected abstract boolean commitTxn(Txn txn) throws PersistException;", "public void commitWriter () {\n try {\n writer.commit();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void commit() throws IOException {\n\t\t\tif (hasErrors) {\n\t\t\t\tcompleteEdit(this, false);\n\t\t\t\tremove(entry.key); // the previous entry is stale\n\t\t\t} else {\n\t\t\t\tcompleteEdit(this, true);\n\t\t\t}\n\t\t}", "public void commit() {\n }", "@Override\n public void beginDatabaseBatchWrite() throws BlockStoreException {\n if (!autoCommit) {\n return;\n }\n if (instrument)\n beginMethod(\"beginDatabaseBatchWrite\");\n\n batch = db.createWriteBatch();\n uncommited = new HashMap<ByteBuffer, byte[]>();\n uncommitedDeletes = new HashSet<ByteBuffer>();\n utxoUncommittedCache = new HashMap<ByteBuffer, UTXO>();\n utxoUncommittedDeletedCache = new HashSet<ByteBuffer>();\n autoCommit = false;\n if (instrument)\n endMethod(\"beginDatabaseBatchWrite\");\n }", "boolean commitEntryMemTableFlush() throws IOException;", "public void log() {\n String headID = head.getCommitID();\n while (headID != null) {\n File curr = new File(\".gitlet/commits/\" + headID);\n Comm currcomm = Utils.readObject(curr, Comm.class);\n System.out.println(\"===\");\n System.out.println(\"commit \" + currcomm.getCommitID());\n if (currcomm.getMergepointer() != null) {\n System.out.println(\"Merge: \"\n + currcomm.getParent().getCommitID()\n .substring(0, 7) + \" \"\n + currcomm.getMergepointer().getCommitID()\n .substring(0, 7));\n }\n System.out.println(\"Date: \" + currcomm.getDate());\n System.out.println(currcomm.getMessage());\n System.out.println();\n if (currcomm.getParent() == null) {\n break;\n } else {\n headID = currcomm.getParent().getCommitID();\n }\n }\n }", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "@Override\n public void commitTx() {\n \n }", "public void commit (boolean force) throws IOException {\n // There is something to commit\n if (commitCounter > 0 || !force)\n this.commit();\n }", "@Override\n public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException,\n RollbackException, SecurityException, SystemException {\n assertActiveTransaction();\n try {\n getTransaction().commit();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n txns.set(null);\n }\n\n }", "public void complete() throws JournalException {\n try {\n // NOTE: The extending class should be able to handle the case of\n // a failure before we can write this complete marker, logging a\n // file version is probably the sanest way of doing so (if the version\n // of the file we were modifying has changed from the journal entry\n // we must've completed the op, but not written to the log).\n log.write(COMPLETE_TOKEN + \"\\n\");\n } catch (IOException e) {\n throw new JournalException(\"Failed to write completion to journal.\");\n }\n\n // garbage collect\n if (pendingOps.isEmpty()) {\n // we want to empty the file, but keep it around\n try {\n this.log = this.node.getWriter(this.filename, false);\n } catch (IOException e) {\n throw new JournalException(\"Failed to garbage collect log file.\");\n }\n }\n }", "public synchronized void setCommittedTx( long tx )\n {\n waitForSyncConnected();\n this.committedTx = tx;\n String root = getRoot();\n String path = root + \"/\" + machineId + \"_\" + sequenceNr;\n byte[] data = dataRepresentingMe( tx );\n try\n {\n zooKeeper.setData( path, data, -1 );\n }\n catch ( KeeperException e )\n {\n throw new ZooKeeperException( \"Unable to set current tx\", e );\n }\n catch ( InterruptedException e )\n {\n Thread.interrupted();\n throw new ZooKeeperException( \"Interrupted...\", e );\n }\n }", "public long commit(Map<String, OperationalSets> sets) {\n sets.forEach((table, set) -> {\n this.writesPerTable.putIfAbsent(table, new HashMap<>());\n this.writesPerTable.get(table).put(this.timestamp, set);\n });\n try {\n rwl.writeLock().lock();\n this.timestamp++;\n return this.timestamp;\n }finally {\n rwl.writeLock().unlock();\n }\n }", "public static void commitTransaction() throws HException {\r\n\t\t\r\n\t\tTransaction tx = (Transaction) threadTransaction.get();\r\n\t\ttry {\r\n\t\t\tif (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) {\r\n\t\t\t\t// log.debug(\"Committing database transaction of this thread.\");\r\n\t\t\t\ttx.commit();\r\n\t\t\t}\r\n\t\t\tthreadTransaction.set(null);\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tthrow new HException(ex);\r\n\t\t}\r\n\t}", "public synchronized void log(String state, Transaction t) {\n\n String logContent = state + \" \" + t.toJSON() + \"\\n\"; \n \n try (FileWriter fw = new FileWriter(path, true)) {\n fw.write(logContent);\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.print(\"Logger::log Content: \" + logContent);\n }", "void commitTransaction(ConnectionContext context) throws IOException;", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\n }", "public void commit();", "void commit(Transaction transaction);", "public ADisk(boolean format)\n { \n\t // build lock\n\t this.setFailureProb(0);\n ADisk_lock = new SimpleLock();\n waitLock = new SimpleLock();\n atranslist = new ActiveTransactionList();\n //initialize lists and logs\n wblist = new WriteBackList(this);\n commitDone = waitLock.newCondition();\n writebackDone = waitLock.newCondition();\n readDone = waitLock.newCondition();\n logReadDone = waitLock.newCondition();\n wbbarrier = waitLock.newCondition();\n commitBarrierSector = -1;\n commitBarrierTid = -1;\n writebackBarrierSector = -1;\n writebackBarrierTid = -1;\n readSector = -1;\n readTid = -1;\n logReadSector = -1;\n logReadTid = -1;\n wbbarrierSec = -1;\n wbbarrierTag = -1;\n \n\t d = null;\n\t try{\n\t d = new Disk(this);\n\t }\n\t catch(FileNotFoundException fnf){\n\t System.out.println(\"Unable to open disk file\");\n\t System.exit(-1);\n\t }\n\t \n\t //create writeback thread\n\t writebackthread = new WriteBackThread();\n try {\n\t if (format == true){\n\t \t lstatus = new LogStatus(this, false);\n\t \t \n\t \t ///wipe the disk\n\t \t /*byte[] blank = new byte[Disk.SECTOR_SIZE];\n\t \t for(int i = 0; i < Disk.SECTOR_SIZE; i++)\n\t \t \tblank[i] = 0x00;\n\t \t for(int i = 0; i < this.getNSectors(); i++){\n\t \t \tif(i == this.getNSectors() - 1){\n\t \t \t\tthis.commitBarrierSector = i;\n\t \t \t\tthis.commitBarrierTid = Disk.SECTOR_SIZE + 10;\n\t \t \t\td.addBarrier(); // must wait for the entire wipe write to be on disk\n\t \t \t}\n\t \t \td.startRequest(Disk.WRITE, Disk.SECTOR_SIZE+10, i, blank);\n\t \t }\n \t \tcommitWait();*/\n\t \t // We decided not to wipe the disk because the instructions were vague and it seems insanely inefficient to wipe the disk and there doesnt seem to be reason to wipe it. It also makes our tests run very slow. \n\t } \n\t else {\n\t \t //RECOVERY\n\t \t lstatus = new LogStatus(this, true);\n\t \t byte[] next = lstatus.recoverNext();\n\t while(next != null){\n\t \t Transaction temp = Transaction.parseLogBytesDebug(next, this);\n\t \t wblist.addCommitted(temp);\t \n\t \t next = lstatus.recoverNext();\n\t } \n\t }\n }\n catch(IOException e){\n\t\t\tSystem.out.println(\"IO exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n catch(IllegalArgumentException e){\n\t\t\tSystem.out.println(\"Illegal Argument exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n \n }", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "protected void commitTaskAndJob(ManifestCommitter committer,\n JobContext jContext,\n TaskAttemptContext tContext) throws IOException {\n try (DurationInfo d = new DurationInfo(LOG,\n \"committing Job %s\", jContext.getJobID())) {\n describe(\"\\ncommitting task\");\n committer.commitTask(tContext);\n describe(\"\\ncommitting job\");\n committer.commitJob(jContext);\n describe(\"commit complete\\n\");\n }\n }", "public abstract void commit();", "protected void commitTask(final ManifestCommitter committer,\n final TaskAttemptContext tContext) throws IOException {\n committer.commitTask(tContext);\n }", "void commit() {\n }", "void commit();", "void commit();", "@Override\n public boolean execute() throws QVCSException {\n if (!getLogFileImpl().getLogFileHeaderInfo().getLogFileHeader().attributes().getIsCheckLock()) {\n // Do not allow a lock operation on a file that\n // does not support locking.\n throw new QVCSException(getLogFileImpl().getShortWorkfileName() + \" does not support locking.\");\n }\n\n return unlockRevision();\n }", "void commit(IDevTree tree, Map options) throws IOException;", "public void commit() throws ResourceException;", "public void rollLog() throws IOException {\n this.snapLog.rollLog();\n resetTxnCount();\n }", "void commit() throws SolrServerException, IOException;", "public void commit() throws ResourceException\n {\n if (inManagedTransaction)\n {\n try\n {\n inManagedTransaction = false;\n con.commit();\n }\n catch (SQLException e)\n {\n checkException(e);\n } // end of try-catch\n } // end of if ()\n else\n {\n throw new JBossResourceException(\"Trying to commit outside of a local tx\");\n } // end of else\n\n }", "TransactionContext preAppendTransaction() throws IOException;", "void commit(String tpcid);", "public void logTransactionEnd();", "void completeCurrentLog() throws IOException;", "void commit() throws StorageException, ValidationException, KeyValueStoreException;", "@Override\n public void commit() {\n }", "@Test\n public void testAllDirtySucceeds()\n throws IOException, DbException, TransactionAbortedException {\n HeapFile f = SystemTestUtil.createRandomHeapFile(2, 512 * 10, null, null);\n Database.resetBufferPool(1);\n\n // BEGIN TRANSACTION\n Transaction t = new Transaction();\n t.start();\n\n // Insert a new row\n TransactionTestUtil.insertRow(f, t);\n\n // Scanning the table must fail because it can't evict the dirty page\n try {\n TransactionTestUtil.findMagicTuple(f, t);\n } catch (DbException e) {\n fail(\"Expected scan to run be able to evict buffer pages\");\n }\n t.commit();\n }", "public void transactionComplete(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "@Override\r\n\t\t\tpublic void progressMade() {\n\t\t\t\twriteReadSemaphore.refreshWriteLock(lockKey, finalWriteToken, lockTimeoutSec);\r\n\t\t\t}", "public void log() {\n\t\tVersion currVersion = myHead;\n\t\twhile (currVersion.getParent() != null) {\n\t\t\tcurrVersion.log();\n\t\t\tcurrVersion = currVersion.getParent();\n\t\t}\n\t\tmyCommit.get(0).log();\n\t}", "private void processCommit() throws HsqlException {\n tokenizer.isGetThis(Token.T_WORK);\n session.commit();\n }", "public static void commit(String message) throws IOException {\n stagingArea = Utils.readObject(STAGING_FILE, HashMap.class);\n stagingRemoveArea = Utils.readObject(STAGING_REMOVE_FILE, HashMap.class);\n\n if (stagingArea.size() == 0 && stagingRemoveArea.size() == 0){\n exitWithError(\"No changes added to the commit.\");\n }\n\n //Gets current head commit Object + name\n String currName = commitPointers.readHeadCommit()[1];\n File cFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n Commit curr = Utils.readObject(cFile, Commit.class);\n\n //creates a list of parent ids for the new commit object\n ArrayList<String> parentsIDs = new ArrayList<String>(1);\n parentsIDs.add(0, currName);\n\n //creates a new commit with the parent IDs, and the bobs contained in headCommit (curr)\n Commit newCommit = new Commit(message, parentsIDs, curr.fileBlobs);\n\n //Staging area work\n //TODO: move line upwards so you can check if staging area is empty before anything else\n newCommit.updateCommitBlobs(stagingArea, stagingRemoveArea);\n\n //makes a new commitID, and saves new commit with that ID\n String newCommitId = Utils.sha1(Utils.serialize(newCommit));\n newCommit.saveCommit(newCommitId);\n\n stagingArea.clear();\n stagingRemoveArea.clear();\n Utils.writeObject(STAGING_FILE, stagingArea);\n Utils.writeObject(STAGING_REMOVE_FILE, stagingRemoveArea);\n\n //TODO: figure out how to send in the correct branch to head\n commitPointers.updateBranches(commitPointers.readHeadCommit()[0], newCommitId);\n commitPointers.updateHead(commitPointers.readHeadCommit()[0], newCommitId);\n }", "@Override\n\t\tpublic void flush() throws IOException {\n\t\t\twriteBlock(true);\n\t\t\tout.flush();\n\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\tif (debug) {\n\t\t\t\tlog.flush();\n\t\t\t}\n\t\t}", "@Test\n public void testCommitterWithDuplicatedCommit() throws Exception {\n describe(\"Call a task then job commit twice;\" +\n \"expect the second task commit to fail.\");\n JobData jobData = startJob(true);\n JobContext jContext = jobData.jContext;\n TaskAttemptContext tContext = jobData.tContext;\n ManifestCommitter committer = jobData.committer;\n\n // do commit\n describe(\"committing task\");\n committer.commitTask(tContext);\n\n // repeated commit while TA dir exists fine/idempotent\n committer.commitTask(tContext);\n\n describe(\"committing job\");\n committer.commitJob(jContext);\n describe(\"commit complete\\n\");\n\n describe(\"cleanup\");\n committer.cleanupJob(jContext);\n // validate output\n validateContent(outputDir, shouldExpectSuccessMarker(),\n committer.getJobUniqueId());\n\n // commit task to fail on retry as task attempt dir doesn't exist\n describe(\"Attempting commit of the same task after job commit -expecting failure\");\n expectFNFEonTaskCommit(committer, tContext);\n }", "@Override\n public abstract void apply(PersistentFileTransaction transaction);", "@Test\n public void testCommitLifecycle() throws Exception {\n describe(\"Full test of the expected lifecycle:\\n\" +\n \" start job, task, write, commit task, commit job.\\n\" +\n \"Verify:\\n\" +\n \"* no files are visible after task commit\\n\" +\n \"* the expected file is visible after job commit\\n\");\n JobData jobData = startJob(false);\n JobContext jContext = jobData.jContext;\n TaskAttemptContext tContext = jobData.tContext;\n ManifestCommitter committer = jobData.committer;\n assertCommitterFactoryIsManifestCommitter(tContext,\n tContext.getWorkingDirectory());\n validateTaskAttemptWorkingDirectory(committer, tContext);\n\n // write output\n describe(\"1. Writing output\");\n final Path textOutputPath = writeTextOutput(tContext);\n describe(\"Output written to %s\", textOutputPath);\n\n describe(\"2. Committing task\");\n Assertions.assertThat(committer.needsTaskCommit(tContext))\n .as(\"No files to commit were found by \" + committer)\n .isTrue();\n commitTask(committer, tContext);\n final TaskManifest taskManifest = requireNonNull(\n committer.getTaskAttemptCommittedManifest(), \"committerTaskManifest\");\n final String manifestJSON = taskManifest.toJson();\n LOG.info(\"Task manifest {}\", manifestJSON);\n int filesCreated = 1;\n Assertions.assertThat(taskManifest.getFilesToCommit())\n .describedAs(\"Files to commit in task manifest %s\", manifestJSON)\n .hasSize(filesCreated);\n Assertions.assertThat(taskManifest.getDestDirectories())\n .describedAs(\"Directories to create in task manifest %s\",\n manifestJSON)\n .isEmpty();\n\n // this is only task commit; there MUST be no part- files in the dest dir\n try {\n RemoteIterators.foreach(getFileSystem().listFiles(outputDir, false),\n (status) ->\n Assertions.assertThat(status.getPath().toString())\n .as(\"task committed file to dest :\" + status)\n .contains(\"part\"));\n } catch (FileNotFoundException ignored) {\n log().info(\"Outdir {} is not created by task commit phase \",\n outputDir);\n }\n\n describe(\"3. Committing job\");\n\n commitJob(committer, jContext);\n\n // validate output\n describe(\"4. Validating content\");\n String jobUniqueId = jobData.jobId();\n ManifestSuccessData successData = validateContent(outputDir,\n true,\n jobUniqueId);\n // look in the SUMMARY\n Assertions.assertThat(successData.getDiagnostics())\n .describedAs(\"Stage entry in SUCCESS\")\n .containsEntry(STAGE, OP_STAGE_JOB_COMMIT);\n IOStatisticsSnapshot jobStats = successData.getIOStatistics();\n // manifest\n verifyStatisticCounterValue(jobStats,\n OP_LOAD_MANIFEST, 1);\n FileStatus st = getFileSystem().getFileStatus(getPart0000(outputDir));\n verifyStatisticCounterValue(jobStats,\n COMMITTER_FILES_COMMITTED_COUNT, filesCreated);\n verifyStatisticCounterValue(jobStats,\n COMMITTER_BYTES_COMMITTED_COUNT, st.getLen());\n\n // now load and examine the job report.\n // this MUST contain all the stats of the summary, plus timings on\n // job commit itself\n\n ManifestSuccessData report = loadReport(jobUniqueId, true);\n Map<String, String> diag = report.getDiagnostics();\n Assertions.assertThat(diag)\n .describedAs(\"Stage entry in report\")\n .containsEntry(STAGE, OP_STAGE_JOB_COMMIT);\n IOStatisticsSnapshot reportStats = report.getIOStatistics();\n verifyStatisticCounterValue(reportStats,\n OP_LOAD_MANIFEST, 1);\n verifyStatisticCounterValue(reportStats,\n OP_STAGE_JOB_COMMIT, 1);\n verifyStatisticCounterValue(reportStats,\n COMMITTER_FILES_COMMITTED_COUNT, filesCreated);\n verifyStatisticCounterValue(reportStats,\n COMMITTER_BYTES_COMMITTED_COUNT, st.getLen());\n\n }", "static void waitForBlockCommit() {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "private int persistenceLog(String logLevelStr, String logTag, String msg) {\n \tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n \tString time = dateFormat.format(new Date());\n \tStringBuilder sb = new StringBuilder();\n \tsb.append(time);\n \tsb.append(\"\\t\");\n \tsb.append(logLevelStr);\n \tsb.append(\"\\t\");\n \tsb.append(logTag);\n \tsb.append(\"\\t\");\n \tsb.append(msg);\n \tsb.append(\"\\n\");\n \tFileWriter writer = null;\n \t\n \tsynchronized (mLogLock) { \t\t\n\t\t\ttry {\n\t\t\t\tFile file = new File(mLogFilePath);\n\t\t\t\tif (!file.exists()) {\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t}\n\t\t\t\twriter = new FileWriter(file, true);\n\t\t\t\twriter.write(sb.toString());\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\treturn -1;\n\t\t\t} catch (IOException e) {\n\t\t\t\treturn -1;\n\t\t\t} finally {\n\t\t\t\tif (writer != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\twriter.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t} \t\t\n\t\t}\n \treturn 0;\t\n\t}", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "private void commit() {\n if (vote != Vote.COMMIT) {\n throw new IllegalStateException(\"Cannot commit transaction with vote: \" + vote);\n }\n\n for (ObjectVersion<V> objectVersion : objectVersions.values()) {\n objectVersion.commit();\n }\n }", "private void concurrencyWrites3() {\n\t\ttry {\n\t\t\tlog.info(\"Starting TrxTableClient5: concurrencyWrites3\");\n\t\t\tlog.info(\"main--put[v1]\");\n\t\t\tlog.info(\"t1-----------beginTrans---put[v2]---------------------------abort\");\n\t\t\tlog.info(\"t2-------------------------------------beginTrans---put[v3]----------commit\");\n\t\t\tlog.info(\"main---get[v1]\");\n\t\t\tSsccTableClientUtils.initialize();\n\t\t\tputValue();\n\n\t\t\tfinal P0Trx21 t1 = new P0Trx21();\n\t\t\tfinal P0Trx22 t2 = new P0Trx22();\n\n\t\t\tnew Thread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tt1.doWork();\n\t\t\t\t\tlog.info(\" Trx1 finished\");\n\t\t\t\t\tcdl3.countDown();\n\t\t\t\t}\n\t\t\t}, \"Trx1\").start();\n\n\t\t\t// to make sure t2 is later than t1\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\n\t\t\t} catch (InterruptedException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\n\t\t\tnew Thread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tt2.doWork();\n\t\t\t\t\tlog.info(\" Trx2 finished\");\n\t\t\t\t\tcdl3.countDown();\n\t\t\t\t}\n\t\t\t}, \"Trx2\").start();\n\n\t\t\tcdl3.await();\n\n\t\t\tSsccTableClientUtils.testSsccBeginTransaction();\n\t\t\tInteger[] result = SsccTableClientUtils.testSsccGet();\n\t\t\tSsccTableClientUtils.testSsccCommitIfPossible();\n\t\t\tlog.info(\"Finish TrxTableClient5: concurrencyWrites3\");\n\n\t\t\tif (result.length == 1 && result[0] == 1) {\n\t\t\t\tsuccessNum++;\n\t\t\t\tlog.info(\"=========================================\");\n\t\t\t\tlog.info(\" \");\n\t\t\t\tlog.info(\"SUCCESS\");\n\t\t\t\tlog.info(\" \");\n\t\t\t\tlog.info(\"=========================================\");\n\t\t\t} else {\n\t\t\t\tlog.info(\"=========================================\");\n\t\t\t\tlog.info(\" \");\n\t\t\t\tlog.info(\"FAILURE\");\n\t\t\t\tlog.info(\" \");\n\t\t\t\tlog.info(\"=========================================\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "boolean shouldCommit();", "void commit() throws SoarException\n {\n // if lazy, commit\n if(db != null && params.lazy_commit.get() == LazyCommitChoices.on)\n {\n // Commit and then start next lazy-commit transaction\n try\n {\n db.commitExecuteUpdate( /* soar_module::op_reinit */);\n db.beginExecuteUpdate( /* soar_module::op_reinit */);\n }\n catch(SQLException e)\n {\n throw new SoarException(\"Error while forcing commit: \" + e.getMessage(), e);\n }\n }\n \n }", "private void log() {\n\t\t\n//\t\tif (trx_loggin_on){\n\t\t\n\t\tif ( transLogModelThreadLocal.get().isTransLoggingOn() ) {\n\t\t\t\n\t\t\tTransLogModel translog = transLogModelThreadLocal.get();\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesConText().entrySet()) {\n\t\t\t\tMDC.put(entry.getKey().toString(), ((entry.getValue() == null)? \"\":entry.getValue()));\n\t\t\t}\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesOnce().entrySet()) {\n\t\t\t\tMDC.put(entry.getKey().toString(), ((entry.getValue() == null)? \"\":entry.getValue()));\n\t\t\t}\n\t\t\ttransactionLogger.info(\"\"); // don't really need a msg here\n\t\t\t\n\t\t\t// TODO MDC maybe conflic with existing MDC using in the project\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesConText().entrySet()) {\n\t\t\t\tMDC.remove(entry.getKey().toString());\n\t\t\t}\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesOnce().entrySet()) {\n\t\t\t\tMDC.remove(entry.getKey().toString());\n\t\t\t}\n\t\t\t\n\t\t\ttranslog.getAttributesOnce().clear();\n\t\t}\n\t\t\n\t}", "public void flushAndClose() throws TxnBatchFailure, TxnFailure, CommitFailure,\n IOException, InterruptedException {\n flush(false);\n close();\n }" ]
[ "0.6463135", "0.63995314", "0.63491136", "0.60487115", "0.59354335", "0.5851189", "0.58375585", "0.58338505", "0.57961124", "0.57314706", "0.5691492", "0.56575", "0.5638561", "0.56190664", "0.5582094", "0.55492187", "0.5505619", "0.55033225", "0.5500747", "0.5452994", "0.54338056", "0.5430614", "0.541447", "0.5392324", "0.537404", "0.5369684", "0.5344383", "0.5331569", "0.533134", "0.5309681", "0.5308195", "0.53013414", "0.52936906", "0.52491134", "0.52468723", "0.5242781", "0.52344424", "0.5221784", "0.5218443", "0.51979476", "0.51926804", "0.51926804", "0.51926804", "0.51926804", "0.51926804", "0.51877636", "0.51877636", "0.51877636", "0.51877636", "0.5169468", "0.5151952", "0.5147275", "0.5141076", "0.51403475", "0.5121777", "0.5120399", "0.51174206", "0.51069975", "0.5106929", "0.510624", "0.509996", "0.50550646", "0.50469506", "0.5038758", "0.50385064", "0.50361645", "0.5033381", "0.5031066", "0.5031066", "0.5027065", "0.50253636", "0.5015665", "0.5014761", "0.5010639", "0.500928", "0.49936706", "0.49760184", "0.4965614", "0.49611443", "0.49584618", "0.49579638", "0.49559733", "0.493526", "0.493163", "0.4931326", "0.492651", "0.49263796", "0.4918812", "0.49125558", "0.4902014", "0.4884713", "0.48828748", "0.48729342", "0.48689324", "0.48657846", "0.48633754", "0.4861527", "0.48604447", "0.48499304", "0.48415166" ]
0.709012
0
Free up the resources for this transaction without committing any of the writes. Throws IllegalArgumentException if tid does not refer to an active transaction.
public void abortTransaction(TransID tid) throws IllegalArgumentException {//done // Check that this is actually an active transaction try { atranslist.get(tid).abort(); } catch (IOException e) { // TODO Auto-generated catch block System.out.println("IO exception"); e.printStackTrace(); System.exit(-1); } atranslist.remove(tid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void commit(int tid) {\n List<Lock> lockList = null;\n\n // check wheter there is read-only transaction running\n boolean hasRO = _tm.hasRunningReadonly();\n for (Integer varIndex : _lockTable.keySet()) {\n lockList = _lockTable.get(varIndex);\n int size = lockList.size();\n for (int i = size - 1; i >= 0; i--) {\n Lock lc = lockList.get(i);\n if (lc.getTranId() == tid) {\n\n // If the lock type is write, means this transaction writes a variable\n // in uncommitDataMap\n if (lc.getType() == Lock.Type.WRITE) {\n if (_uncommitDataMap.containsKey(varIndex)) {\n List<Data> dataList = _dataMap.get(varIndex);\n Data d = _uncommitDataMap.get(varIndex);\n d.setCommitTime(_tm.getCurrentTime());\n\n // If no read-only transaction, replace the old version\n if (!hasRO) {\n dataList.clear();\n }\n dataList.add(d);\n _uncommitDataMap.remove(varIndex);\n }\n }\n lockList.remove(i);\n break;\n }\n }\n }\n // remove this transaction from accessed list\n _accessedTransactions.remove(tid);\n }", "public void abort(int tid) {\n List<Lock> lockList = null;\n for (Integer varIndex : _lockTable.keySet()) {\n lockList = _lockTable.get(varIndex);\n int size = lockList.size();\n for (int i = size - 1; i >= 0; i--) {\n if (lockList.get(i).getTranId() == tid) {\n if (lockList.get(i).getType() == Lock.Type.WRITE) {\n _uncommitDataMap.remove(varIndex);\n }\n lockList.remove(i);\n break;\n }\n }\n }\n // remove this transaction from accessed list\n _accessedTransactions.remove(tid);\n }", "public void commitTransaction(TransID tid) \n throws IOException, IllegalArgumentException{// Not yet complete\n\t try {\n\t\t ADisk_lock.lock();\n\t\t // Call commit\n\t\t atranslist.get(tid).commit();\n\t\t Transaction temp = atranslist.remove(tid);\n\t\t wblist.addCommitted(temp);\t \n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n }", "public void closeTransaction(){\n\t\ttr.rollback();\n\t\ttr = null;\n\t}", "private static void releaseResources(int trans_id) {\n\n\n System.out.println(\"Releasing resources T\" + trans_id);\n // Remove the hold of transaction from the variables\n\n Iterator<Map.Entry<Integer, List<Integer>>> it = transaction_variable_map.entrySet().iterator();\n\n\n while (it.hasNext()) {\n Map.Entry<Integer, List<Integer>> pair = (Map.Entry<Integer, List<Integer>>) it.next();\n List<Integer> list = pair.getValue();\n if (list.contains(trans_id)) {\n // System.out.println(list.toString());\n List<Variable> variables = variable_copies_map.get(pair.getKey());\n for (Variable v : variables) {\n v.unlockVariable();\n }\n // System.out.println(trans);\n list.removeAll(Arrays.asList(trans_id));\n\n if (list.isEmpty()) {\n it.remove();\n }\n }\n\n\n }\n\n // remove from waiting operations\n Transaction txn = transactions.get(trans_id);\n\n Iterator<Tuple<Transaction, Operation>> iter = waitingOperations.iterator();\n while (iter.hasNext()) {\n // get transaction id\n\n // check if read or write operation\n Tuple<Transaction, Operation> t = iter.next();\n\n Transaction tx = t.x;\n if (tx.equals(txn)) {\n iter.remove();\n\n }\n\n }\n\n // Remove the transaction from the current set of transactions\n transactions.remove(trans_id);\n\n // Remove dependency edge if any\n DeadlockHandler.removeDependencyEdge(trans_id);\n\n }", "public void transactionComplete(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\\\n \t//should always commit, simply call transactionComplete(tid,true)\n \ttransactionComplete(tid, true);\n \t\n }", "public synchronized void commit(int trxnId)\n {\n ResourceManager rm;\n for (Enumeration e = transactionTouch.keys(); e.hasMoreElements();) {\n rm = (ResourceManager)e.nextElement();\n try {\n rm.commit(trxnId);\n } catch (Exception x)\n {\n System.out.println(\"EXCEPTION:\");\n System.out.println(x.getMessage());\n x.printStackTrace();\n }\n }\n transactionTouch.remove(trxnId);\n lm.UnlockAll(trxnId);\n }", "void commit() {\r\n tx.commit();\r\n tx = new Transaction();\r\n }", "void rollback() {\r\n tx.rollback();\r\n tx = new Transaction();\r\n }", "public static void clearThreadLocalTransaction() {\n threadlocal.set(null);\n }", "public void releasePage(TransactionId tid, PageId pid) {\n // some code goes here\n // not necessary for proj4\n lockManager.releaseLock(pid, tid);\n }", "public static void releaseAll(Task currTask){\n for(int j = 0 ; j < currTask.resourceHoldings.length; j ++){\n release(j + 1, currTask.resourceHoldings[j], currTask);\n }\n }", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for proj1\n\n \t\n \t//commit, flush the pages\n \tif(commit){\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tflushPage(pageId);\n \t\t\t\tpage.setBeforeImage();\n \t\t\t}\n\n if (page.isDirty() == null) {\n page.setBeforeImage();\n }\n \t\t\t\n \t\t}\n \t}\n \telse{\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page, revert changes\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tNode n = bufferedPages.get(pageId);\n \t\t\t\tn.page = page.getBeforeImage();\n \t\t\t\tbufferedPages.put(pageId, n);\n // updateLruWithNewNode(pageId, page.getBeforeImage());\n \t\t\t}\n \t\t\t\n \t\t}\n \t}\n \t\n \t//release the lock\n \tlockManager.releaseAllTransactionLocks(tid);\n \tcurrentTransactions.remove(tid);\n \t\n }", "public void cleanup() throws GlitterException {\n if (!this.myLock) {\n try {\n BaseSQL.truncateTableWithSessionMayCommit(this.context.getStatementProvider(), this.context.getConnection(), this.context.getConfiguration().getSessionPrefix(), SQLQueryConstants.defaultGraphsTempTable);\n BaseSQL.truncateTableWithSessionMayCommit(this.context.getStatementProvider(), this.context.getConnection(), this.context.getConfiguration().getSessionPrefix(), SQLQueryConstants.namedGraphsTempTable);\n BaseSQL.truncateTableWithSessionMayCommit(this.context.getStatementProvider(), this.context.getConnection(), this.context.getConfiguration().getSessionPrefix(), SQLQueryConstants.tempGraphsTempTable);\n\n } catch (RdbException sqle) {\n if (log.isDebugEnabled()) {\n log.debug(LogUtils.RDB_MARKER, \"Error clearing temporary tables\", sqle);\n }\n }\n }\n if (this.myLock) {\n try {\n this.context.getDatasource().commit(this.context.getConnection(), false, false);\n } catch (AnzoException ae) {\n throw new GlitterException(ae.getErrorCode(), ae);\n }\n }\n }", "public void deleteTuple(TransactionId tid, Tuple t)\n throws DbException, TransactionAbortedException {\n // some code goes here\n // not necessary for lab1\n DbFile dbFile = Database.getCatalog().getDatabaseFile(t.getRecordId().getPageId().getTableId());\n Page affectedPg = dbFile.deleteTuple(tid, t);\n affectedPg.markDirty(true, tid);\n\n // bufferPool.remove(affectedPg.getId());\n bufferPool.put(affectedPg.getId(), affectedPg);\n }", "public synchronized void abort(int trxnId)\n {\n ResourceManager rm;\n for (Enumeration e = transactionTouch.keys(); e.hasMoreElements();) {\n rm = (ResourceManager)e.nextElement();\n try {\n rm.abort(trxnId);\n } catch (Exception x)\n {\n System.out.println(\"EXCEPTION:\");\n System.out.println(x.getMessage());\n x.printStackTrace();\n }\n }\n transactionTouch.remove(trxnId);\n lm.UnlockAll(trxnId);\n }", "public final static void close(Transaction t) {\n Transaction o = (Transaction) transactionTable.get();\n if (o != t) {\n throw new RuntimeException(\"Attempt to close a transaction inappropriately:\\n\"+\n \"\\tPrevious was: \"+o+\"\\n\"+\n \"\\tNext is: \"+t);\n }\n transactionTable.set(null);\n }", "static void closeCurrentTransactionManager() {\n ExecutorDataMap.getDataMap().put(TRANSACTION, null);\n ExecutorDataMap.getDataMap().put(TRANSACTION_CONFIG, null);\n }", "public void deleteTuple(TransactionId tid, Tuple t)\n throws DbException, TransactionAbortedException {\n // some code goes here\n // not necessary for proj1\n try {\n Page page = Database.getCatalog().getDbFile(t.getRecordId()\n .getPageId().getTableId()).deleteTuple(tid, t);\n\n page.markDirty(true, tid);\n //updateLruWithNewNode(page.getId(), page);\n } catch (DbException e) {\n e.printStackTrace();\n System.exit(0);\n } catch (TransactionAbortedException e) {\n e.printStackTrace();\n System.exit(0);\n }\n }", "@Override\n public void abortTx() {\n \tfor (VBox vbox : overwrittenAncestorWriteSet) {\n \t // revert the in-place entry that had overwritten\n \t vbox.inplace = vbox.inplace.next;\n \t}\n \n this.orec.version = OwnershipRecord.ABORTED;\n for (OwnershipRecord mergedLinear : linearNestedOrecs) {\n mergedLinear.version = OwnershipRecord.ABORTED;\n }\n \tfor (ParallelNestedTransaction mergedTx : mergedTxs) {\n \t mergedTx.orec.version = OwnershipRecord.ABORTED;\n \t}\n \t\n\t// give the read set arrays, which were used exclusively by this nested or its children, back to the thread pool\n\tCons<VBox[]> parentArrays = this.getRWParent().bodiesRead;\n\tCons<VBox[]> myArrays = this.bodiesRead;\n\twhile (myArrays != parentArrays) {\n\t returnToPool(myArrays.first());\n\t myArrays = myArrays.rest();\n\t}\n\t\n \tbodiesRead = null;\n \tboxesWritten = null;\n \tboxesWrittenInPlace = null;\n \tperTxValues = null;\n \toverwrittenAncestorWriteSet = null;\n \tmergedTxs = null;\n \tlinearNestedOrecs = null;\n \tcurrent.set(this.getParent());\n }", "public Builder clearTransactions() {\n copyOnWrite();\n instance.clearTransactions();\n return this;\n }", "private void clearTransactions() {\n transactions_ = emptyProtobufList();\n }", "public static void close() {\n HashMap<String, Transaction> map = instance.getTransactions();\n for (Transaction transaction : map.values()) {\n transaction.destroy();\n }\n map.clear();\n instance.transactions.remove();\n }", "void resetTX(Transaction transaction);", "public void flushAndClose() throws TxnBatchFailure, TxnFailure, CommitFailure,\n IOException, InterruptedException {\n flush(false);\n close();\n }", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\n }", "public Page deleteTuple(TransactionId tid, Tuple t) throws DbException,\n TransactionAbortedException {\n // some code goes here\n RecordId rid = t.getRecordId();\n PageId pid = rid.getPageId();\n Page p = Database.getBufferPool().getPage(tid, pid, Permissions.READ_WRITE);\n ((HeapPage) p).deleteTuple(t);\n\n return p;\n // not necessary for proj1\n }", "public Page deleteTuple(TransactionId tid, Tuple t) throws DbException,\n TransactionAbortedException {\n // some code goes here\n RecordId rid=t.getRecordId();\n PageId pid=rid.getPageId();\n Page p=Database.getBufferPool().getPage(tid,pid,Permissions.READ_WRITE);\n HeapPage hp=(HeapPage)p;\n hp.deleteTuple(t);\n hp.markDirty(true, tid);\n return hp;\n // return Database.getBufferPool().getPage(tid,pid,Permissions.READ_ONLY);\n // not necessary for proj1\n }", "public void endTransaction(SpaceTech.TransactionEndType tet) {\n\tfor (int i = 0; i < containers.size(); i++) {\n\t\tcontainers.get(i).Lock();\n\t}\n\tfor (int i = 0; i < containers.size(); i++) {\n\t\tswitch (tet) {\n\t\t\tcase TET_COMMIT:\n\t\t\t\tcontainers.get(i).commitTransaction(this);\n\t\t\t\tbreak;\n\t\t\tcase TET_ROLLBACK: case TET_ABORT:\n\t\t\t\tcontainers.get(i).rollbackTransaction(this);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tfor (int i = 0; i < containers.size(); i++) {\n\t\tcontainers.get(i).Unlock();\n\t}\n }", "protected void clearContextTx(String context)\n\t{\n\t\tString sql = \"DELETE FROM MNEME_QUESTION WHERE CONTEXT=?\";\n\n\t\tObject[] fields = new Object[1];\n\t\tfields[0] = context;\n\n\t\tif (!this.sqlService.dbWrite(sql, fields))\n\t\t{\n\t\t\tthrow new RuntimeException(\"clearContext: dbWrite failed\");\n\t\t}\n\t}", "void endTransaction();", "public Page deleteTuple(TransactionId tid, Tuple t) throws DbException,\n TransactionAbortedException {\n // some code goes here\n \tPageId pgId = t.getRecordId().getPageId();\n \tHeapPage pg = (HeapPage) Database.getBufferPool().getPage(tid, pgId, simpledb.Permissions.READ_WRITE);\n pg.deleteTuple(t);\n return pg;\n // not necessary for proj1\n }", "public Builder clearTransactionId() {\n transactionId_ = getDefaultInstance().getTransactionId();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public void removeAllTransactions() {\n Realm realm = mRealmProvider.get();\n realm.executeTransaction(realm1 -> realm1.deleteAll());\n }", "@Override\n public void rollback()\n throws TransactionException\n {\n Iterator<Buffer> it=branchBuffers.iterator();\n while (it.hasNext())\n { \n it.next().rollback();\n it.remove();\n }\n state=State.ABORTED;\n \n }", "@Override\n public void rollback() throws IllegalStateException, SecurityException, SystemException {\n assertActiveTransaction();\n try {\n getTransaction().rollback();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n txns.set(null);\n }\n }", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "StmTransaction() {\n\n // Spin until we get a next rev number and put it in the queue of rev numbers in use w/o concurrent change.\n // (We avoid concurrent change because if another thread bumped the revisions in use, it might also have\n // cleaned up the revision before we said we were using it.)\n while ( true ) {\n long sourceRevNumber = lastCommittedRevisionNumber.get();\n sourceRevisionsInUse.add( sourceRevNumber );\n if ( sourceRevNumber == lastCommittedRevisionNumber.get() ) {\n this.sourceRevisionNumber = sourceRevNumber;\n break;\n }\n sourceRevisionsInUse.remove( sourceRevNumber );\n }\n\n // Use the next negative pending revision number to mark our writes.\n this.targetRevisionNumber = new AtomicLong( lastPendingRevisionNumber.decrementAndGet() );\n\n // Track the versioned items read and written by this transaction.\n this.versionedItemsRead = new HashSet<>();\n this.versionedItemsWritten = new HashSet<>();\n\n // Flag a write conflict as early as possible.\n this.newerRevisionSeen = false;\n\n // Establish a link for putting this transaction in a linked list of completed transactions.\n this.nextTransactionAwaitingCleanUp = new AtomicReference<>( null );\n\n }", "public void clean(){\n\t\tsynchronized(this.lock){\n\t\t\tint index=0;\n\t\t\tfor(ResourceStatus<T> resourceStatus:this.resourcesStatus){\n\t\t\t\tif(resourceStatus!=null){\n\t\t\t\t\tif(!resourceStatus.isInUse()){\n\t\t\t\t\t\tlong lastTime=resourceStatus.getLastNotInUseTime();\n\t\t\t\t\t\tlong currentTime=System.currentTimeMillis();\n\t\t\t\t\t\tT resource=resourceStatus.getResource();\n\t\t\t\t\t\tif((currentTime-lastTime)>=this.resourceAliveTime){\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tdestroyResource(resource);\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tlogger.error(Constants.Base.EXCEPTION, e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.resourcesStatus[index]=null;\n\t\t\t\t\t\t\tthis.currentSize--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t}", "private void clear() {\n transactionalHooks.clearTransaction();\n transactionDeques.remove();\n }", "public void transactionComplete(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "TransactionContext cancelTransaction() throws IOException;", "public void commitTransaction() {\n final EntityTransaction entityTransaction = em.getTransaction();\n if (!entityTransaction.isActive()) {\n entityTransaction.begin();\n }\n entityTransaction.commit();\n }", "protected abstract void abortTxn(Txn txn) throws PersistException;", "public void release(int ind) { \n if (ind >= maxId) {\n return;\n }\n int expandedInd = ind + maxId - 1;\n idPool.clear(expandedInd);\n setBitsInTree(expandedInd);\n }", "public static void deshacerTransaccion() {\n try {\n con.rollback();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public Page deleteTuple(TransactionId tid, Tuple t)\n throws DbException, TransactionAbortedException {\n BufferPool buffPool = Database.getBufferPool();\n HeapPage gotPage = (HeapPage)buffPool.getPage(tid, t.getRecordId().getPageId(), Permissions.READ_WRITE);\n gotPage.deleteTuple(t);\n return gotPage;\n }", "public void close(){\n\t\tif(tr != null && tr.inTransaction()){\n\t\t\ttr.rollback();\n\t\t}\n\t\ttry{\n\t\t\tif(db != null)\n\t\t\t\tdb.close();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void release() throws SQLException\r\n\t{\r\n\t\tst.close();\r\n\t}", "public Builder clearTid() {\n \n tid_ = getDefaultInstance().getTid();\n onChanged();\n return this;\n }", "public void reset() {\r\n\t\tif (null!=threadTransaction)\r\n\t\t\tthreadTransaction.remove();\r\n\t}", "final void ensureOngoingTransaction() throws SQLException {\n if (!transactionLock.isHeldByCurrentThread()) {\n throw new SQLNonTransientException(Errors.getResources(getLocale())\n .getString(Errors.Keys.ThreadDoesntHoldLock));\n }\n }", "private void clearTransacting(long requestId)\n {\n Logger.Loge(getClass(), \"clear transaction: \" + requestId);\n final ContentResolver cr =\n mContext.getApplicationContext().getContentResolver();\n cr.delete(HaccpContract.Transactions.buildUriForId(requestId), null, null);\n }", "public void rollback() throws ResourceException;", "public static void finishTransaction()\n {\n if (currentSession().getTransaction().isActive())\n {\n try\n {\n System.out.println(\"INFO: Transaction not null in Finish Transaction\");\n Thread.dumpStack();\n rollbackTransaction();\n// throw new UAPersistenceException(\"Incorrect Transaction handling! While finishing transaction, transaction still open. Rolling Back.\");\n } catch (UAPersistenceException e)\n {\n System.out.println(\"Finish Transaction threw an exception. Don't know what to do here. TODO find solution for handling this situation\");\n }\n }\n }", "public void forceCommitTx()\n{\n}", "public void deleteTask(Integer tid);", "public static void close(EntityManager entityManager)\n\t{\n\t\tEntityTransaction tx = entityManager.getTransaction();\n\t\tif (tx != null && tx.isActive()) tx.rollback();\n\t\tentityManager.close();\n\t}", "public void destroyAllResource() {\r\n\t\ttry {\r\n\t\t\tif(outrs != null){\r\n\t\t\t\toutrs.close();\r\n\t\t\t\toutrs=null;\r\n\t\t\t}\r\n\t\t\tif(outstmt != null ){\r\n\t\t\t\toutstmt.close();\r\n\t\t\t\toutstmt=null;\r\n\t\t\t} \r\n\t\t\tif (dbConnection != null){\r\n\t\t\t\tdbConnection.close();\r\n\t\t\t\tdbConnection=null;\r\n\t\t\t} \r\n\t\t}catch (SQLException ex) {\r\n\t\t}\r\n\t}", "@Override\n public void rollbackTx() {\n \n }", "private void basicReleaseLock() {\n if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {\n logger.trace(LogMarker.DLS_VERBOSE, \"[DLockToken.basicReleaseLock] releasing ownership: {}\",\n this);\n }\n\n leaseId = -1;\n lesseeThread = null;\n leaseExpireTime = -1;\n thread = null;\n recursion = 0;\n ignoreForRecovery = false;\n\n decUsage();\n }", "public void close() {\n if (stmt == null) {\n return;\n }\n\n try {\n commit();\n } catch (HandledException ex) {\n Exceptions.ignore(ex);\n }\n\n safeClose();\n context.unregister(this);\n }", "protected void reuseTxn(Txn txn) throws Exception {\r\n }", "@Override\r\n\tpublic void deleteAd(int tid) {\n\t\tQuery query = (Query) session.createQuery(\"delete EP where pid=:id\");\r\n\t\tquery.setParameter(\"id\", tid);\r\n\t\tquery.executeUpdate();//删除\r\n\t\ttr.commit();//提交事务\r\n\t}", "public void unsetEntityContext() {\n _ctx = null;\n }", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder clearTransactionId() {\n transactionId = null;\n fieldSetFlags()[24] = false;\n return this;\n }", "public ArrayList<Page> deleteTuple(TransactionId tid, Tuple t)\n throws DbException, TransactionAbortedException {\n // some code goes here\n return null;\n // not necessary for lab1\n }", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "public final void release() {\n explicitlyLocked = false;\n byteBase.unlock();\n }", "public static void clean(Context context) {\n try (SQLiteDatabase db = new DatabaseFactory(context, null).getWritableDatabase()) {\n UploadingFilesRepository uploadRepo = new UploadingFilesRepository(db);\n Response response = uploadRepo.deleteAll();\n\n SyncQueueRepository syncRepo = new SyncQueueRepository(db);\n List<SyncQueueEntryModel> syncEntries = syncRepo.getAll();\n\n for (SyncQueueEntryModel syncEntry : syncEntries) {\n\n boolean isProcessing = syncEntry.getStatus() == SyncStateEnum.PROCESSING.getValue();\n boolean isQued = syncEntry.getStatus() == SyncStateEnum.QUEUED.getValue();\n\n if (isProcessing || isQued) {\n\n SyncQueueEntryDbo dbo = new SyncQueueEntryDbo(syncEntry);\n dbo.setProp(SynchronizationQueueContract._STATUS, SyncStateEnum.IDLE.getValue());\n\n Response updateResponse = syncRepo.update(dbo.toModel());\n }\n }\n } catch (Exception e) {\n\n }\n }", "public static void closeEntityManager() {\n EntityManager em = tl.get();\n if (em != null) {\n em.close();\n tl.set(null);\n }\n }", "public Builder clearTxIndex() {\n \n txIndex_ = getDefaultInstance().getTxIndex();\n onChanged();\n return this;\n }", "public static void endTransaction(int trans_id) {\n if (transactions.containsKey(trans_id)) {\n if (commitTransaction(trans_id)) {\n // after committing we need to check which other transactions are waiting\n System.out.println(\"T\" + trans_id + \" commits\");\n\n Iterator<Map.Entry<Integer, List<Integer>>> it =\n transaction_variable_map.entrySet().iterator();\n\n\n while (it.hasNext()) {\n Map.Entry<Integer, List<Integer>> pair = (Map.Entry<Integer, List<Integer>>) it.next();\n List<Integer> list = pair.getValue();\n if (list.contains(trans_id)) {\n\n\n list.removeAll(Arrays.asList(trans_id));\n // System.out.println(list.toString());\n if (list.isEmpty())\n it.remove();\n }\n\n\n }\n clearWaitingOperations();\n transactions.remove(trans_id);\n\n }\n\n } else {\n System.out.println(\"T\" + trans_id + \" aborts\");\n }\n }", "public void commit() throws ResourceException\n {\n if (inManagedTransaction)\n {\n try\n {\n inManagedTransaction = false;\n con.commit();\n }\n catch (SQLException e)\n {\n checkException(e);\n } // end of try-catch\n } // end of if ()\n else\n {\n throw new JBossResourceException(\"Trying to commit outside of a local tx\");\n } // end of else\n\n }", "public void flushData (){\n\t\tTransaction tx = this.pm.currentTransaction();\n\t\ttry {\n\t\t\tif (this.pm.currentTransaction().isActive ()){\n\t\t\t\tthis.pm.currentTransaction().commit();\n\t\t\t}\n\t\t} catch (Exception e){\n\t\t\tApplication.getLogger ().error (\"Error flushing data for persistence. \", e);\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t}\n//\t\ttx.begin();\n\t}", "void rollbackTransaction();", "Transaction beginTx();", "private void cleanupAfterCommit(\n final FSDataInputStream inputStream,\n final TaskAttemptContext context)\n throws IOException {\n if (inputStream != null) {\n try {\n inputStream.close();\n } catch (IOException e) {\n LOG.error(\"Could not close input stream\", e);\n throw e;\n }\n }\n cleanupResources(context);\n }", "void rollbackTransaction(ConnectionContext context) throws IOException;", "@Override\n public void rollback() throws SQLException {\n if (isTransActionAlive()) {\n getTransaction().rollback();\n }\n }", "public void setTransactionID(int tid) {\n m_TransactionID = tid;\n // setChanged(true);\n }", "public static void clean() {\n kryoThreadLocalContext.remove();\n }", "@Test\n public void testAllDirtySucceeds()\n throws IOException, DbException, TransactionAbortedException {\n HeapFile f = SystemTestUtil.createRandomHeapFile(2, 512 * 10, null, null);\n Database.resetBufferPool(1);\n\n // BEGIN TRANSACTION\n Transaction t = new Transaction();\n t.start();\n\n // Insert a new row\n TransactionTestUtil.insertRow(f, t);\n\n // Scanning the table must fail because it can't evict the dirty page\n try {\n TransactionTestUtil.findMagicTuple(f, t);\n } catch (DbException e) {\n fail(\"Expected scan to run be able to evict buffer pages\");\n }\n t.commit();\n }", "void cleanupTable(TableName tablename) throws Exception {\n if (tbl != null) {\n tbl.close();\n tbl = null;\n }\n\n ((ClusterConnection) connection).clearRegionCache();\n deleteTable(TEST_UTIL, tablename);\n }", "public void commitTransaction() {\n\r\n\t}", "public void close() throws RemoteException {\r\n tx.commit();\r\n }", "public void free() {\n byteBase.free();\n byteBase = null;\n }", "void commitTransaction();", "public void deleteAllTransactions();", "public static void rollbackTransaction() throws HException {\r\n\t\t\r\n\t\tTransaction tx = (Transaction) threadTransaction.get();\r\n\t\ttry {\r\n\t\t\tthreadTransaction.set(null);\r\n\t\t\tif (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) {\r\n\t\t\t\ttx.rollback();\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\t//closeSession();\r\n\t\t}\r\n\t}", "private void deleteTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n boolean isDebtValid = true;\n if(mDbHelper.getCategory(mTransaction.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n List<Debt> debts = mDbHelper.getAllDebts();\n\n Double repayment = 0.0, borrow = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) { // Repayment\n repayment += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n borrow += debt.getAmount();\n }\n }\n\n if(borrow - mTransaction.getAmount() < repayment) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_delete_invalid));\n }\n }\n\n if(isDebtValid) {\n mDbHelper.deleteTransaction(mTransaction.getId());\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n\n cleanup();\n\n // Return to FragmentListTransaction\n getFragmentManager().popBackStackImmediate();\n LogUtils.logLeaveFunction(Tag);\n }\n }", "public void taint() {\n if (!isTainted.compareAndSet(false, true))\n return;\n\n try {\n Tasks.queue(new CleanTask(getId()));\n } catch (InterruptedException anIE) {\n EventQueue.theLogger.log(Level.WARNING,\n \"Failed to lodge cleanup for: \" + getId(), anIE);\n }\n }", "public void clean() {\n\tmTaskCompletedCallback = null;\n\tmTaskUpdateCallback = null;\n\tmIsDirty = false;\n }", "public PTPTransactionManager () {\n transactions = new HashMap<>();\n completeTransactions = new HashSet<>();\n }", "@Override\n\tpublic void rollback() throws Throwable {\n\t\tthrow new Warning(\"please use rollback(context)\");\n\t}", "public Builder clearTxId() {\n \n txId_ = getDefaultInstance().getTxId();\n onChanged();\n return this;\n }", "@Override\n\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\tclose();\n\t\t\topen();\n\t\t}", "void readOnlyTransaction();", "public void releasePage(TransactionId tid, PageId pid) {\n // some code goes here\n // not necessary for lab1|lab2\n }", "public void resetStore() {\n try {\n db.close();\n uncommited = null;\n uncommitedDeletes = null;\n autoCommit = true;\n bloom = new BloomFilter();\n utxoCache = new LRUCache(openOutCache, 0.75f);\n } catch (IOException e) {\n log.error(\"Exception in resetStore.\", e);\n }\n\n File f = new File(filename);\n if (f.isDirectory()) {\n for (File c : f.listFiles())\n c.delete();\n }\n openDB();\n }" ]
[ "0.6296857", "0.6282669", "0.6051205", "0.5931769", "0.5620978", "0.551087", "0.54268086", "0.52965647", "0.5265593", "0.5240338", "0.52218586", "0.5177042", "0.51462954", "0.5115073", "0.5067541", "0.5056839", "0.50520706", "0.5047713", "0.49582967", "0.49413997", "0.49206153", "0.49144462", "0.4911548", "0.48778966", "0.48776743", "0.48484388", "0.48417976", "0.48284942", "0.4799892", "0.47850958", "0.47641703", "0.47534898", "0.4747671", "0.47387466", "0.47335812", "0.47305337", "0.4727264", "0.47261152", "0.47206995", "0.4715537", "0.47153243", "0.47097644", "0.47022825", "0.4660347", "0.46578783", "0.4654646", "0.46459445", "0.46405515", "0.4622145", "0.46195483", "0.46030882", "0.4599672", "0.4597884", "0.4577047", "0.45702055", "0.45589197", "0.4532657", "0.45268145", "0.45266291", "0.45237878", "0.45215753", "0.45181078", "0.45172966", "0.45119378", "0.4496275", "0.44942153", "0.44894215", "0.4484983", "0.44833308", "0.44829166", "0.44791335", "0.44773647", "0.44761837", "0.44747663", "0.4467912", "0.44528645", "0.4450313", "0.44455233", "0.44423538", "0.44382983", "0.44364238", "0.44309217", "0.4427655", "0.442066", "0.44189498", "0.44183177", "0.4412513", "0.44112924", "0.43970212", "0.43969858", "0.43953127", "0.43892622", "0.4387448", "0.4384887", "0.43789372", "0.43750057", "0.4367968", "0.43654174", "0.43526837", "0.43464386" ]
0.6209546
2
Read the disk sector numbered sectorNum and place the result in buffer. Note: the result of a read of a sector must reflect the results of all previously committed writes as well as any uncommitted writes from the transaction tid. The read must not reflect any writes from other active transactions or writes from aborted transactions. Throws IOException if the disk fails to complete the read. IllegalArgumentException if tid does not refer to an active transaction or buffer is too small to hold a sector. IndexOutOfBoundsException if sectorNum is not a valid sector number
public void readSector(TransID tid, int sectorNum, byte buffer[]) throws IOException, IllegalArgumentException, IndexOutOfBoundsException{ // Not quite done yet try{ ADisk_lock.lock(); readTid = tid.getTidfromTransID(); readSector = sectorNum; d.startRequest(Disk.READ, tid.getTidfromTransID(), sectorNum, buffer); readWait(); wblist.checkRead(sectorNum, buffer); Transaction temp = atranslist.get(tid); if(temp != null) temp.checkRead(sectorNum, buffer); } finally{ ADisk_lock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readSectorDiskOnly(TransID tid, int sectorNum, byte buffer[])\n throws IOException, IllegalArgumentException, \n IndexOutOfBoundsException{\t\t\t\t\t\t\t\t// Not quite done yet\n\t try{\n\t\t ADisk_lock.lock();\n\n\t readTid = tid.getTidfromTransID();\n\t readSector = sectorNum;\n d.startRequest(Disk.READ, tid.getTidfromTransID(), sectorNum, buffer);\n readWait();\n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n}", "public void writeSector(TransID tid, int sectorNum, byte buffer[]){\n\t atranslist.get(tid).addWrite(sectorNum, buffer);\n }", "public void\tread_sector_data_into_buffer(int drive, int side,int data_id,char[] buf, int length);", "public void\twrite_sector_data_from_buffer(int drive, int side,int data_id, char[] buf, int length, int ddam);", "public ByteBuffer read(int fileId) throws IOException {\n Assert.isPositive(fileId, \"File Id must be positive\");\n Assert.isTrue(fileId <= 0xFFFFFF, \"File Id is 3 bytes at most\");\n\n if(fileId * INDEX_BLOCK_LEN >= index.size()) {\n // We avoid slipping off the edge of the file and trying to access data that doesn't exist.\n // This isn't the only possible reason a file doesn't exist though!\n throw new FileNotFoundException(\"no such file (\" + fileId + \")\");\n }\n\n ByteBuffer entry = ByteBuffer.allocate(INDEX_BLOCK_LEN);\n index.read(entry, fileId * INDEX_BLOCK_LEN);\n entry.flip();\n\n int size = readTriByte(entry);\n int nextBlock = readTriByte(entry);\n\n if (nextBlock == 0) {\n throw new FileNotFoundException(\"no such file (\" + fileId + \") - it may have been erased or not initialised\");\n }\n\n ByteBuffer contents = ByteBuffer.allocate(size);\n ByteBuffer chunk = ByteBuffer.allocate(TOTAL_BLOCK_LEN);\n\n int chunkNumber = 0;\n while(contents.remaining() > 0) {\n data.read(chunk, nextBlock * TOTAL_BLOCK_LEN);\n chunk.flip();\n\n Assert.equal(fileId, chunk.getShort() & 0xFFFF);\n Assert.equal(chunkNumber, chunk.getShort() & 0xFFFF);\n\n nextBlock = readTriByte(chunk);\n Assert.equal(indexId, chunk.get());\n\n // We read as much of the chunk as we can, until the buffer is full. Once the buffer\n // is full, the rest of the chunk is garbage (and there should be no more chunks)\n int limit = chunk.limit();\n if(chunk.remaining() > contents.remaining()) {\n chunk.limit(chunk.position() + contents.remaining());\n }\n\n contents.put(chunk);\n chunk.limit(limit);\n\n chunk.flip();\n chunkNumber++;\n }\n\n contents.flip();\n\n return contents;\n }", "void readBlock(int blockId, byte[] buffer, int offset) throws IOException;", "void readBlock(int blockId, byte[] buffer) throws IOException;", "public abstract int Read(byte[] buf, int siz, int offset)\n\t\tthrows IOException, SMBException;", "private int getSector(String key) // returns sector number\n\t\t\t\t\t\t\t\t\t\t// indicated by key\n\t{\n\t\tkey += \" \";// add spaces, enough to\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cover the 27 minimum\n\t\tkey = key.substring(0, 27);// get rid of any extra\n\t\tchar[] k = key.toCharArray();// then convert to char array\n\t\t/*\n\t\t * if it's greater or equal to the first key and less than the next key,\n\t\t * move down a layer\n\t\t * \n\t\t * else move on to the next key and repeat.\n\t\t */\n\t\tint datasector = indexRoot;\n\t\tchar[] sector = new char[512];\n\t\tchar[][] keys = new char[15][27];\n\t\tchar[][] sectornrs = new char[15][6];\n\t\tsector = disk.readSector(datasector);\n\t\t// get the root index...\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tkeys[i] = getPartKey(sector, i);\n\t\t}\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tsectornrs[i] = getPartIndex(sector, i);\n\t\t}\n\n\t\tboolean brk = false;\n\n\t\tfor (int i = 0; i < 14 && !brk; i++) {\n\t\t\t// check the key agains the keys we have\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\t\t\tif ((p >= 0 && q < 0) || (q >= 0 && keys[i + 1][0] == '\\000')) {\n\t\t\t\t// we've got a match.\n\t\t\t\t// get the sector nr\n\t\t\t\tint number = Integer.valueOf(new String(sectornrs[i]).trim());\n\t\t\t\tif (number > 1000 && number < indexStart) {\n\t\t\t\t\tdatasector = number;\n\t\t\t\t\tbrk = true;\n\t\t\t\t} else {\n\t\t\t\t\t/*\n\t\t\t\t\t * proceed to check which one of the next row we need.\n\t\t\t\t\t */\n\t\t\t\t\tfor (int w = 0; w < 14; w++) {\n\n\t\t\t\t\t\tsector = disk.readSector(number + w);\n\t\t\t\t\t\tchar[] t = getPartKey(sector, 0);\n\t\t\t\t\t\tif (w > 1 && compare(t, keys[w - 1]) >= 0) {\n\t\t\t\t\t\t\tkeys[w] = getPartKey(sector, w);\n\t\t\t\t\t\t\tsectornrs[w] = getPartIndex(sector, w);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (int r = 0; r < 27; r++) {\n\t\t\t\t\t\t\t\tkeys[w][r] = '\\000';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (int r = 0; r < 6; r++) {\n\t\t\t\t\t\t\t\tsectornrs[w][r] = '\\000';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// brk=true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t// after the code above we end up at the index of the next index where\n\t\t// there are 15 more possibilities inside the object. That's what we\n\t\t// check here\n\t\t// read the next 15 lines into an array of char[]\n\t\tchar[][] buffers = new char[15][512];\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tchar[] temp = disk.readSector(datasector + i);\n\t\t\tfor (int j = 0; j < 512; j++) {\n\t\t\t\tbuffers[i][j] = temp[j];\n\t\t\t}\n\t\t}\n\n\t\t// get the first key of each buffer\n\t\tkeys = new char[15][27];\n\t\tsectornrs = new char[15][6];\n\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tint j = 0;\n\t\t\tfor (; j < 27; j++) {\n\t\t\t\tkeys[i][j] = buffers[i][j];\n\t\t\t}\n\t\t\tint p = 0;\n\t\t\tfor (; j < 33; j++) {\n\t\t\t\tsectornrs[i][p] = buffers[i][j];\n\t\t\t\tp++;\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < 14; i++) {\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\t\t\t// the item is in this, or falls between the keys.\n\t\t\tif ((p >= 0 && q < 0) || (q >= 0 && keys[i + 1][0] == '\\000')) {\n\t\t\t\t// set all the keys equal to the line at datasector+i\n\t\t\t\tdatasector += i;\n\t\t\t\t// sector = disk.readSector(datasector);\n\t\t\t\ti = 15;\n\t\t\t}\n\t\t}\n\n\t\t// parse the records in this sector\n\t\tkeys = new char[15][27];\n\t\tsectornrs = new char[15][6];\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tint j = 0;\n\n\t\t\tchar[] strk = getPartKey(sector, i);\n\t\t\tchar[] stri = getPartIndex(sector, i);\n\t\t\tfor (; j < 27; j++) {\n\t\t\t\tkeys[i][j] = strk[j];\n\t\t\t}\n\t\t\tint p = 0;\n\t\t\tfor (; j < 33; j++) {\n\t\t\t\tsectornrs[i][p] = stri[p];\n\t\t\t\tp++;\n\t\t\t}\n\t\t}\n\n\t\t// go through each record in this index to find where it would belong\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\n\t\t\t// the item is in this, or falls between the keys.\n\t\t\tif ((p >= 0 && q < 0) || (q >= 0 && keys[i + 1][0] == '\\000')) {\n\t\t\t\t// set all the keys equal to the line at datasector+i\n\t\t\t\tint num = 0;\n\n\t\t\t\tdatasector += num;// set it equal to the number followed by the\n\t\t\t\t\t\t\t\t\t// key...\n\t\t\t\ti = 15;\n\t\t\t}\n\t\t}\n\t\t// inside this index record, find the sector to which the key would\n\t\t// belong\n\t\tsector = disk.readSector(datasector);\n\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tint j = 0;\n\n\t\t\tchar[] strk = getPartKey(sector, i);\n\t\t\tchar[] stri = getPartIndex(sector, i);\n\t\t\tfor (; j < 27; j++) {\n\t\t\t\tkeys[i][j] = strk[j];\n\t\t\t}\n\t\t\tint p = 0;\n\t\t\tfor (; j < 33; j++) {\n\t\t\t\tsectornrs[i][p] = stri[p];\n\t\t\t\tp++;\n\t\t\t}\n\t\t}\n\t\tif (datasector >= 1000 && datasector < indexStart) {\n\t\t\treturn datasector;\n\n\t\t}\n\t\tfor (int i = 0; i < 14; i++) {\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\t\t\t// the item is in this, or falls between the keys.\n\t\t\tif ((p >= 0 && q < 0)) {\n\t\t\t\t// set all the keys equal to the line at datasector+i\n\t\t\t\tdatasector = Integer.parseInt(new String(\n\t\t\t\t\t\tgetPartIndex(sector, i)).trim());// set it equal to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// number followed\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by the key...\n\t\t\t\ti = 15;\n\t\t\t} else if ((q >= 0) && keys[i + 1][0] == '\\000') {\n\t\t\t\t// the next index doesn't exist...\n\t\t\t\tdatasector = Integer.parseInt(new String(getPartIndex(sector,\n\t\t\t\t\t\ti + 1)).trim());// set it equal to the number followed\n\t\t\t\t\t\t\t\t\t\t// by the key...\n\t\t\t\ti = 15;\n\t\t\t} else if (i == 13) {\n\t\t\t\tdatasector = Integer.parseInt(new String(getPartIndex(sector,\n\t\t\t\t\t\ti + 1)).trim());\n\t\t\t}\n\t\t}\n\t\treturn datasector;\n\t}", "public List<Sector> getFreeSectors( int num) {\n\n\t// Get the data of the BAM.\n\tbyte [] bamData = getSector( 18, 0).getDataBytes();\n\n\tList<Sector> result = new ArrayList<Sector>(); // Buffer for the result.\n\n\t// If the user requested 0 sectors, just return the empty list.\n\tif( num == 0) {\n\n\t return result;\n\n\t}\n\n\t// Just count the set bits from 0x04 to 0x8f.\n\tint currentBlockIndex = 0;\n\tfor( int currentByteIndex = 0x04; currentByteIndex <= 0x8f; ++currentByteIndex) {\n\t \n\t // Get the current byte from the BAM.\n\t byte currentBamByte = bamData[ currentByteIndex];\n\n\t // Count the set bits in the current byte.\n\t for( int currentBit = 1; currentBit <= 0x80; currentBit <<= 1) {\n\n\t\tif( ( currentBamByte & currentBit) != 0) { // Is this block available?\n\n\t\t // Yes => add this free sector to the result;\n\t\t Sector nextFreeSector = getSectorForBlockIndex( currentBlockIndex++);\n\n\t\t // If this sector exists, add it to the result.\n\t\t if( nextFreeSector != null) {\n\n\t\t\tresult.add( nextFreeSector);\n\t\t }\n\n\t\t // If the number of free sectors is sufficient, return the result.\n\t\t if( result.size() == num) {\n\n\t\t\treturn result;\n\t\t }\n\t\t}\n\t }\n\t}\t\n\n\treturn null; // Not enough free sectors found.\n }", "protected abstract int readInternal(int index);", "public java.lang.CharSequence getSector() {\n return sector;\n }", "public void read(byte[] buffer, int offset) throws Exception {\n read(new CCompatibleInputStream(new ByteArrayInputStream(buffer, offset,\n buffer.length - offset)));\n }", "public void setSector(java.lang.CharSequence value) {\n this.sector = value;\n }", "int read(long pos, byte[] buf)throws IOException;", "protected int readEncrypted()\n throws IOException\n {\n ByteBuffer buff = f_buffEncIn;\n int ofPos = buff.position();\n int ofLimit = buff.limit();\n int cbRead = 0;\n\n try\n {\n // prep the buffer for additional writes\n if (ofLimit == ofPos)\n {\n buff.clear();\n ofLimit = ofPos = 0;\n }\n else\n {\n buff.position(buff.limit())\n .limit(buff.capacity());\n }\n\n return cbRead = f_delegate.read(buff);\n }\n finally\n {\n // restore the position and limit to reference just the encrypted\n // segment\n buff.position(ofPos)\n .limit(ofLimit + (cbRead < 0 ? 0 : cbRead));\n }\n }", "public java.lang.CharSequence getSector() {\n return sector;\n }", "public static long getNumSector(String requestSize, String sectorSize) {\n Double memSize = Double.parseDouble(requestSize);\n Double sectorBytes = Double.parseDouble(sectorSize);\n Double nSectors = memSize / sectorBytes;\n Double memSizeKB = memSize / 1024;\n Double memSizeGB = memSize / (1024 * 1024 * 1024);\n Double memSize100GB = memSizeGB / 100;\n\n // allocation bitmap file: one bit per sector\n Double allocBitmapSize = nSectors / 8;\n\n // extend overflow file: 4MB, plus 4MB per 100GB\n Double extOverflowFileSize = memSize100GB * 1024 * 1024 * 4;\n\n // journal file: 8MB, plus 8MB per 100GB\n Double journalFileSize = memSize100GB * 1024 * 1024 * 8;\n\n // catalog file: 10bytes per KB\n Double catalogFileSize = memSizeKB * 10;\n\n // hot files: 5bytes per KB\n Double hotFileSize = memSizeKB * 5;\n\n // quota users file and quota groups file\n Double quotaUsersFileSize = (memSizeGB * 256 + 1) * 64;\n Double quotaGroupsFileSize = (memSizeGB * 32 + 1) * 64;\n Double metadataSize = allocBitmapSize + extOverflowFileSize + journalFileSize\n + catalogFileSize + hotFileSize + quotaUsersFileSize + quotaGroupsFileSize;\n\n Double allocSize = memSize + metadataSize;\n Double numSectors = allocSize / sectorBytes;\n\n System.out.println(numSectors.longValue() + 1); // round up\n return numSectors.longValue() + 1;\n }", "private Sector getSectorForBlockIndex( int blockIndex) {\n\n\t// The block index of the first sector of each track.\n\tint [] trackStart = { 0, 21, 42, 63, 84, 105, 126, 147\n\t\t\t , 168, 189, 210, 231, 252, 273, 294, 315\n\t\t\t , 336, 357, 376, 395, 414, 433, 452, 471\n\t\t\t , 490, 508, 526, 544, 562, 580, 598, 615\n\t\t\t , 632, 649, 666, 683, 700, 717, 734, 751\n\t\t\t , 768 };\n\tint currentTrackIndex = 0;\n\tfor( int currentTrackStart : trackStart) {\n\t \n\t if( blockIndex < currentTrackStart) {\n\t\tbreak;\n\t }\n\n\t ++currentTrackIndex; // Check the next track\n\t}\n\n\t// Check, if the track is within a reasonable range.\n\tif( ( currentTrackIndex < 1) || ( currentTrackIndex > 40)) {\n\t \n\t return null; // Ignore tracks > 40 for now.\n\t}\n\n\t// Calculate the sector offset.\n\tint sectorIndex = blockIndex - trackStart[ currentTrackIndex - 1];\n\t\n\t// Try to find the sector with the given track and sector index in this image.\n\treturn getSector( currentTrackIndex, sectorIndex);\n }", "ByteBuffer readKey(int entryIndex) {\n if (entryIndex == Chunk.NONE) {\n return null;\n }\n\n long keyReference = getKeyReference(entryIndex);\n int[] keyArray = longToInts(keyReference);\n int blockID = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] >> KEY_BLOCK_SHIFT;\n int keyPosition = keyArray[POSITION_ARRAY_INDEX];\n int length = keyArray[BLOCK_ID_LENGTH_ARRAY_INDEX] & KEY_LENGTH_MASK;\n\n return memoryManager.getByteBufferFromBlockID(blockID, keyPosition, length);\n }", "public void readBytes(byte[] buffer, int offset, int length) throws IOException;", "public void beginSlice() throws IOException {}", "private Buffer getBufferByPosition(int pos)\n throws IOException\n {\n return getBuffer(pos / BLOCK_SIZE);\n }", "public int setBytes(int index, FileChannel in, long position, int length)\r\n/* 283: */ throws IOException\r\n/* 284: */ {\r\n/* 285:299 */ ensureAccessible();\r\n/* 286: */ try\r\n/* 287: */ {\r\n/* 288:301 */ return in.read((ByteBuffer)internalNioBuffer().clear().position(index).limit(index + length), position);\r\n/* 289: */ }\r\n/* 290: */ catch (ClosedChannelException ignored) {}\r\n/* 291:303 */ return -1;\r\n/* 292: */ }", "public void readBytes(byte[] buffer) throws IOException;", "public int read(ByteBuffer buf, int bufPos, int siz, long filePos)\n\t\t\tthrows IOException, DataArchivedException {\n\t\t// this.addAio();\n\t\tif (SDFSLogger.isDebug())\n\t\t\tSDFSLogger.getLog().debug(\n\t\t\t\t\t\"reading \" + df.getMetaFile().getPath() + \" at \" + filePos\n\t\t\t\t\t\t\t+ \" \" + buf.capacity() + \" bytes\" + \" bufpos=\"\n\t\t\t\t\t\t\t+ bufPos + \" siz=\" + siz);\n\t\tLock l = df.getReadLock();\n\t\tl.lock();\n\t\ttry {\n\t\t\tif (filePos >= df.getMetaFile().length() && !Main.blockDev) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tlong currentLocation = filePos;\n\t\t\tbuf.position(bufPos);\n\t\t\tint bytesLeft = siz;\n\t\t\tlong futureFilePostion = bytesLeft + currentLocation;\n\t\t\tif (Main.blockDev && futureFilePostion > df.getMetaFile().length())\n\t\t\t\tdf.getMetaFile().setLength(futureFilePostion, false);\n\t\t\tif (futureFilePostion > df.getMetaFile().length()) {\n\t\t\t\tbytesLeft = (int) (df.getMetaFile().length() - currentLocation);\n\t\t\t}\n\t\t\tint read = 0;\n\t\t\twhile (bytesLeft > 0) {\n\t\t\t\tDedupChunkInterface readBuffer = null;\n\t\t\t\tint startPos = 0;\n\t\t\t\tbyte[] _rb = null;\n\t\t\t\ttry {\n\t\t\t\t\twhile (readBuffer == null) {\n\t\t\t\t\t\treadBuffer = df.getWriteBuffer(currentLocation);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tstartPos = (int) (currentLocation - readBuffer\n\t\t\t\t\t\t\t\t\t.getFilePosition());\n\t\t\t\t\t\t\tint _len = readBuffer.getLength() - startPos;\n\t\t\t\t\t\t\tif (bytesLeft < _len)\n\t\t\t\t\t\t\t\t_len = bytesLeft;\n\t\t\t\t\t\t\t_rb = readBuffer.getReadChunk(startPos, _len);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbuf.put(_rb);\n\t\t\t\t\t\t\tdf.getMetaFile().getIOMonitor()\n\t\t\t\t\t\t\t\t\t.addBytesRead(_len, true);\n\t\t\t\t\t\t\tcurrentLocation = currentLocation + _len;\n\t\t\t\t\t\t\tbytesLeft = bytesLeft - _len;\n\t\t\t\t\t\t\tread = read + _len;\n\t\t\t\t\t\t\tif (Main.volume.isClustered())\n\t\t\t\t\t\t\t\treadBuffer.flush();\n\t\t\t\t\t\t} catch (BufferClosedException e) {\n\t\t\t\t\t\t\tif (SDFSLogger.isDebug())\n\t\t\t\t\t\t\t\tSDFSLogger.getLog().debug(\n\t\t\t\t\t\t\t\t\t\t\"trying to write again\");\n\t\t\t\t\t\t\treadBuffer = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch(DataArchivedException e) {\n\t\t\t\t\tif(Main.checkArchiveOnRead){\n\t\t\t\t\t\tSDFSLogger.getLog().warn(\"Archived data found in \"+ df.getMetaFile().getPath()+ \" at \" + startPos + \". Recovering data from archive. This may take up to 4 hours\");\n\t\t\t\t\t\tthis.recoverArchives();\n\t\t\t\t\t\tthis.read(buf, bufPos, siz, filePos);\n\t\t\t\t\t}\n\t\t\t\t\telse throw e;\n\t\t\t\t}catch (FileClosedException e) {\n\t\t\t\t\tSDFSLogger.getLog().warn(\n\t\t\t\t\t\t\tdf.getMetaFile().getPath()\n\t\t\t\t\t\t\t\t\t+ \" is closed but still writing\");\n\t\t\t\t\tthis.closeLock.lock();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdf.registerChannel(this);\n\t\t\t\t\t\tthis.closed = false;\n\t\t\t\t\t\tthis.read(buf, bufPos, siz, filePos);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tthis.closeLock.unlock();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSDFSLogger.getLog().fatal(\"Error while reading buffer \", e);\n\n\t\t\t\t\tthrow new IOException(\"Error reading buffer\");\n\t\t\t\t}\n\t\t\t\tif (currentLocation == df.getMetaFile().length()) {\n\t\t\t\t\treturn read;\n\t\t\t\t}\n\n\t\t\t\tthis.currentPosition = currentLocation;\n\t\t\t}\n\t\t\treturn read;\n\t\t} catch (DataArchivedException e) {\n\t\t\tthrow e;\n\t\t} catch (Exception e) {\n\t\t\tSDFSLogger.getLog().error(\n\t\t\t\t\t\"unable to read \" + df.getMetaFile().getPath(), e);\n\t\t\tMain.volume.addReadError();\n\t\t\tthrow new IOException(e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tdf.getMetaFile().setLastAccessed(System.currentTimeMillis());\n\t\t\t} catch (Exception e) {\n\t\t\t}\n\t\t\tl.unlock();\n\t\t\t// this.removeAio();\n\t\t}\n\n\t}", "private int getEntBlock(FileTableEntry ftEnt)\n\t{\n\t\tint block = ftEnt.seekPtr / Disk.blockSize;\n\t\t//get actual block number\n\t\tif (block < Inode.directSize)\n\t\t{\n\t\t\treturn (int)ftEnt.inode.direct[block];\n\t\t}\n\n\t\tbyte[] temp = new byte[Disk.blockSize];\n\t\tSysLib.rawread((int)ftEnt.inode.indirect, temp);\n\t\treturn (int)SysLib.bytes2short(temp, (block - Inode.directSize) * 2);\n\t}", "int read(byte[] buffer, int bufferOffset, int length) throws IOException;", "public synchronized int readBuf(String filename) {\n\t\t\n\t\t// find a buffer id that hasn't been used yet.\n\t\tint bufNum = 0;\n\t\twhile (_bufferMap.containsKey(bufNum))\n\t\t\tbufNum++;\n\n\t\t// add this buffer number to the map\n\t\t_bufferMap.put(bufNum, filename);\n\n\t\t// create and load the buffer\n\t\tsendMessage(\"/b_allocRead\", new Object[] { bufNum, filename });\n\t\tsendMessage(\"/sync\", new Object[]{bufNum + _bufferReadIdOffset});\n\t\treturn bufNum;\n\t}", "public SegmentReader(Configuration conf, FileSystem fs, Path file, int segId, int buffersize,\n long segmentOffset, long segmentLength, long segmentPMSOffset,\n boolean withPageMeta, READMODE readMode) throws IOException {\n this.conf = conf;\n this.istream = fs.open(file, buffersize);\n\n this.segmentOffset = segmentOffset;\n this.segmentLength = segmentLength;\n this.segmentPMSOffset = segmentPMSOffset;\n this.withPageMeta = withPageMeta;\n\n this.mode = readMode;\n this.segId = segId;\n }", "public int getBytes(int index, FileChannel out, long position, int length)\r\n/* 190: */ throws IOException\r\n/* 191: */ {\r\n/* 192:217 */ ensureAccessible();\r\n/* 193:218 */ return getBytes(index, out, position, length, false);\r\n/* 194: */ }", "public int readFile(SrvSession sess, TreeConnection tree, NetworkFile file, byte[] buf, int bufPos, int siz, long pos)\n throws IOException {\n \n // Debug\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"DB readFile() filePos=\" + pos + \", len=\" + siz);\n\n // Access the JDBC context\n\n DBDeviceContext dbCtx = (DBDeviceContext) tree.getContext();\n\n // Check if the database is online\n \n if ( dbCtx.getDBInterface().isOnline() == false)\n throw new DiskOfflineException( \"Database is offline\");\n\n // Check that the network file is our type\n\n int rxsiz = 0;\n \n if (file instanceof DBNetworkFile) {\n\n // Access the JDBC network file\n \n DBNetworkFile jfile = (DBNetworkFile) file;\n\n // Check if there are any locks on the file\n \n // Check if there are any locks on the file\n \n if ( jfile.hasFileState() && jfile.getFileState().hasActiveLocks()) {\n \n // Check if this session has write access to the required section of the file\n \n if ( jfile.getFileState().canReadFile( pos, siz, sess.getProcessId()) == false)\n throw new LockConflictException();\n }\n \n // Debug\n \n if ( jfile.getFileState().getOpenCount() == 0)\n Debug.println(\"**** readFile() Open Count Is ZERO ****\");\n \n // Read from the file\n\n rxsiz = jfile.readFile(buf, siz, bufPos, pos);\n \n // Check if we have reached the end of file\n \n if ( rxsiz == -1)\n rxsiz = 0;\n }\n\n // Return the actual read length\n\n return rxsiz;\n }", "private int getImageBufferStartIndex(int trackNumber, FloppyDriveSide side) {\n return BYTES_PER_SECTOR * (SECTORS_PER_TRACK * (trackNumber * 2 + side.ordinal())\n + sectorIndex);\n }", "public ByteBuffer read(int location)\n throws DataOrderingException;", "public void erase(int sector, int moteID) {\n\t\tmote.erase(sector, moteID);\n\t}", "private final int readBytes( int number ) throws IOException {\n byte[] buffer = new byte[ number ];\n int read = dataSource.read( buffer, 0, number );\n\n if ( read != buffer.length ) {\n if ( read < 0 ) throw new IOException( \"End of Stream\" );\n for ( int i = read; i < buffer.length; i++ ) buffer[ i ] = (byte)readByte();\n }\n \n\t/**\n * Create integer\n */\n switch ( number ) {\n case 1: return (buffer[ 0 ] & 0xff);\n\t case 2: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8);\n\t case 3: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8) | ((buffer[ 2 ] & 0xff) << 16);\n\t case 4: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8) | ((buffer[ 2 ] & 0xff) << 16) | ((buffer[ 3 ] & 0xff) << 24);\n\t default: throw new IOException( \"Illegal Read quantity\" );\n\t}\n }", "private void ensureReadNonBuffered() throws IOException, BadDescriptorException {\n if (reading) {\n if (buffer.hasRemaining()) {\n Ruby localRuntime = getRuntime();\n if (localRuntime != null) {\n throw localRuntime.newIOError(\"sysread for buffered IO\");\n } else {\n throw new IOException(\"sysread for buffered IO\");\n }\n }\n } else {\n // libc flushes writes on any read from the actual file, so we flush here\n flushWrite();\n buffer.clear();\n buffer.flip();\n reading = true;\n }\n }", "protected byte direct_read(int address) {\n return segment_data[address];\n }", "public ByteBuffer get(final int index) {\n\t\tif (!validState) {\n\t\t\tthrow new InvalidStateException();\n\t\t}\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"get(\" + index + \")\");\n\t\t}\n\t\ttry {\n\t\t\tif (useMmap) {\n\t\t\t\tfinal MappedByteBuffer mbb = getMmapForIndex(index);\n\t\t\t\tif (mbb != null) {\n\t\t\t\t\treturn mbb;\n\t\t\t\t}\n\t\t\t\t// Fallback to RAF\n\t\t\t}\n\t\t\tfinal ByteBuffer buf = bufstack.pop();\n\t\t\tfileChannel.position(index * blockSize).read(buf);\n\t\t\tbuf.rewind();\n\t\t\treturn buf;\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Exception in get(\" + index + \")\", e);\n\t\t}\n\t\treturn null;\n\t}", "public Vector getSectorPosition(){\n\t\treturn this.sectorPos;\n\t}", "public byte read(int offset) throws IOException {\n\t\tif (ensureBuffer(offset, 1) > 0) {\n\t\t\tthis.pos = offset + 1;\n\t\t\treturn this.buffer[offset];\n\t\t}\n\t\tthrow new EOFException();\n\t}", "public Data read(Transaction t, int varIndex) {\n if (!_dataMap.containsKey(varIndex)) {\n return null;\n }\n int tid = t.getTranId();\n\n // If the transaction is read-write, get the lock and see whether we have\n // conflict\n if (t.getType() == Transaction.Type.RW) {\n boolean hasConflict = false;\n Lock lock = null;\n if (_lockTable.containsKey(varIndex)) {\n List<Lock> lockList = _lockTable.get(varIndex);\n for (Lock lc : lockList) {\n if (lc.getTranId() == tid) {\n lock = lc;\n } else {\n if (lc.getType() == Lock.Type.WRITE) {\n hasConflict = true;\n }\n }\n }\n }\n\n if (hasConflict) {\n return null;\n } else {\n if (lock == null || lock.getType() == Lock.Type.READ) {\n Data d = getLastCommitData(varIndex);\n // If the variable is available return the variable\n if (d.getAccess()) {\n // If the transaction dosen't have a lock, set read lock\n if (lock == null) {\n setLock(tid, varIndex, Lock.Type.READ);\n }\n // Add this transaction to accessed transactions list\n _accessedTransactions.add(tid);\n return d;\n } else {\n return null;\n }\n } else {\n // if transaction has write lock, read it from uncommitDataMap\n _accessedTransactions.add(tid);\n return _uncommitDataMap.get(varIndex);\n }\n }\n } else {\n // For read-only transaction, get last commit version before it starts.\n List<Data> dataList = _dataMap.get(varIndex);\n Data d = null;\n int ttime = t.getTimestamp();\n for (Data dt : dataList) {\n if (dt.getCommitTime() <= ttime) {\n d = dt;\n } else {\n break;\n }\n }\n if (d == null) {\n return null;\n }\n // if available return the variable\n if (d.getAccess()) {\n return d;\n } else {\n // if not available, check whether it becomes unavailable (site fails)\n // after the read-only transaction begins, if so, the data is still\n // readable.\n if (d.getUnavailableTime() >= ttime) {\n return d;\n } else {\n // Otherwise, cannot be sure that the variable is the last commit\n // before read-only transaction begins\n return null;\n }\n }\n }\n }", "@Override\n\tpublic int Read(byte[] buffer, int offset, int count)\n\t{\n\t\tif (buffer == null)\n\t\t{\n\t\t\tthrow new NullPointerException(\"buffer\");\n\t\t}\n\n\t\tint totalRead = 0;\n\n\t\tif (entryOffset >= entrySize)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tlong numToRead = count;\n\n\t\tif ((numToRead + entryOffset) > entrySize)\n\t\t{\n\t\t\tnumToRead = entrySize - entryOffset;\n\t\t}\n\n\t\tif (readBuffer != null)\n\t\t{\n\t\t\tint sz = (numToRead > readBuffer.length) ? readBuffer.length : (int)numToRead;\n\n\t\t\tSystem.arraycopy(readBuffer, 0, buffer, offset, sz);\n\n\t\t\tif (sz >= readBuffer.length)\n\t\t\t{\n\t\t\t\treadBuffer = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint newLen = readBuffer.length - sz;\n//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:\n//ORIGINAL LINE: byte[] newBuf = new byte[newLen];\n\t\t\t\tbyte[] newBuf = new byte[newLen];\n\t\t\t\tSystem.arraycopy(readBuffer, sz, newBuf, 0, newLen);\n\t\t\t\treadBuffer = newBuf;\n\t\t\t}\n\n\t\t\ttotalRead += sz;\n\t\t\tnumToRead -= sz;\n\t\t\toffset += sz;\n\t\t}\n\n\t\twhile (numToRead > 0)\n\t\t{\n//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:\n//ORIGINAL LINE: byte[] rec = tarBuffer.ReadBlock();\n\t\t\tbyte[] rec = tarBuffer.ReadBlock();\n\t\t\tif (rec == null)\n\t\t\t{\n\t\t\t\t// Unexpected EOF!\n\t\t\t\tthrow new TarException(\"unexpected EOF with \" + numToRead + \" bytes unread\");\n\t\t\t}\n\n\t\t\tint sz = (int)numToRead;\n\t\t\tint recLen = rec.length;\n\n\t\t\tif (recLen > sz)\n\t\t\t{\n\t\t\t\tSystem.arraycopy(rec, 0, buffer, offset, sz);\n//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:\n//ORIGINAL LINE: readBuffer = new byte[recLen - sz];\n\t\t\t\treadBuffer = new byte[recLen - sz];\n\t\t\t\tSystem.arraycopy(rec, sz, readBuffer, 0, recLen - sz);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsz = recLen;\n\t\t\t\tSystem.arraycopy(rec, 0, buffer, offset, recLen);\n\t\t\t}\n\n\t\t\ttotalRead += sz;\n\t\t\tnumToRead -= sz;\n\t\t\toffset += sz;\n\t\t}\n\n\t\tentryOffset += totalRead;\n\n\t\treturn totalRead;\n\t}", "protected int read(byte[] buffer, int offset, int length) throws IOException {\n return mTiffStream.read(buffer, offset, length);\n }", "void readFrom(DataInputStream din) throws IOException {\r\n throw new Error(\"Method no longer available\");\r\n// commit_id = din.readInt();\r\n// table_id = din.readInt();\r\n//// if (table_id != din.readInt()) {\r\n//// throw new IOException(\r\n//// \"'table id' in given format is not the same. Does this journal \" +\r\n//// \"really belong to another table?\");\r\n//// }\r\n// journal_entries = din.readInt();\r\n// command_journal = new byte[journal_entries];\r\n// din.readFully(command_journal, 0, journal_entries);\r\n// int size = din.readInt();\r\n// for (int i = 0; i < size; ++i) {\r\n// command_parameters.addInt(din.readInt());\r\n// }\r\n }", "public void read(int rowId, GenericRow buffer) {\n if (_sortedRowIds != null) {\n rowId = _sortedRowIds[rowId];\n }\n _fileReader.read(rowId, buffer);\n }", "public int read(int position) {\n return isDiskImageMounted() ? readInternal(getPositionIndex(position)) : 0;\n }", "int readNonBlocking(byte[] buffer, int offset, int length);", "public int read(long offset, byte buffer[],int bufferOffset,int nrOfBytes)\n throws VlException\n {\n boolean forceUseStreamRead=false; //true; // default value \n\n// // when reading the first bytes, streamread is faster \n// if (offset==0) \n// forceUseStreamRead=true; \n\n // Try Random Accessable Interface ! \n if ((this instanceof VRandomReadable) && (forceUseStreamRead==false))\n {\n // use Sync Read ! \n return StreamUtil.syncReadBytes((VRandomReadable)this,offset,buffer,bufferOffset,nrOfBytes);\n }\n // else try StreamReadable interface \n else if (this instanceof VStreamReadable)\n {\n //sync stream Read ! \n return streamRead(offset,buffer,bufferOffset,nrOfBytes);\n }\n else\n {\n throw new nl.uva.vlet.exception.ResourceTypeMismatchException(\n \"File type does not support (remote) read access\");\n }\n }", "private int getBytes(int index, FileChannel out, long position, int length, boolean internal)\r\n/* 211: */ throws IOException\r\n/* 212: */ {\r\n/* 213:233 */ ensureAccessible();\r\n/* 214:234 */ ByteBuffer tmpBuf = internal ? internalNioBuffer() : ByteBuffer.wrap(this.array);\r\n/* 215:235 */ return out.write((ByteBuffer)tmpBuf.clear().position(index).limit(index + length), position);\r\n/* 216: */ }", "private int fillBuffer() throws IOException {\r\n int n = super.read(buffer, 0, BUF_SIZE);\r\n if (n >= 0) {\r\n file_pos +=n;\r\n buf_end = n;\r\n buf_pos = 0;\r\n }\r\n return n;\r\n }", "public int streamRead(long offset, byte[] buffer, int bufferOffset, int nrOfBytes) throws VlException\n {\n VStreamReadable rfile = (VStreamReadable) (this);\n InputStream istr = rfile.getInputStream();\n\n if (istr==null)\n return -1; \n\n // implementation move to generic StreamUtil: \n return nl.uva.vlet.io.StreamUtil.syncReadBytes(istr,offset,buffer,bufferOffset,nrOfBytes); \n\n }", "private int handleRead(int fileDescriptor, int buffer, int size){\n\n\t\tif (fileDescriptor < 0 || fileDescriptor > 15){\n\t\t\treturn -1;\t\t// return -1 on error\n\t\t}\n\n\t\tif (size < 0){\n\t\t\treturn -1; \t\t// return -1 on error\n\t\t}\n\n\t\tOpenFile file;\n\n\t\tif (fileDescriptors[fileDescriptor] == null){\n\t\t\treturn -1;\t\t// return -1 on error\n\t\t}else{\n\t\t\tfile = fileDescriptors[fileDescriptor];\n\t\t}\n\n\t\tbyte tempbuff[] = new byte[size];\n\n\t\tint readSize = file.read(tempbuff, 0, size);\n\n\t\tif (readSize < 0){\n\t\t\treturn -1;\t\t// return -1 on error\n\t\t}\n\t\treturn writeVirtualMemory(buffer, tempbuff, 0, readSize);\n\t}", "public abstract void read0(int aPosition, PageIOStream aStream);", "UnalignedRecords read(long position, int size) throws IOException;", "public static void main(String[] args) {\n if (args.length != 2) {\n System.exit(-1);\n }\n String mem = args[0];\n String sector = args[1];\n try {\n getNumSector(mem, sector);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public int readBytes(FileChannel out, long position, int length)\r\n/* 228: */ throws IOException\r\n/* 229: */ {\r\n/* 230:248 */ checkReadableBytes(length);\r\n/* 231:249 */ int readBytes = getBytes(this.readerIndex, out, position, length, true);\r\n/* 232:250 */ this.readerIndex += readBytes;\r\n/* 233:251 */ return readBytes;\r\n/* 234: */ }", "public ByteBuffer nioBuffer(int index, int length)\r\n/* 300: */ {\r\n/* 301:314 */ ensureAccessible();\r\n/* 302:315 */ return ByteBuffer.wrap(this.array, index, length).slice();\r\n/* 303: */ }", "public int read() throws IOException {\n if (!started) {\n start();\n }\n if (buffer == null)\n return -1;\n if (bufpos == buflen) {\n buffer = refreshBuffer();\n if (buffer == null)\n return -1;\n }\n return 0xFF & buffer[bufpos++];\n }", "int readBytes(VRL vrl, long fileOffset, byte[] bytes, int bufferOffset, int nrBytes) throws VRLSyntaxException, IOException, VlException {\n String[] containerAndPath = getContainerAndPath(vrl);\n long end = fileOffset + nrBytes;\n Blob blob = getBlobstore().getBlob(containerAndPath[0], containerAndPath[1], range(fileOffset, end));\n int numRead = blob.getPayload().getInput().read(bytes, bufferOffset, nrBytes);\n// if (numRead != nrBytes) {\n// debug(\"-----------------Asked: \" + nrBytes + \" got: \" + numRead);\n// }\n return numRead;\n }", "public int read() throws IOException;", "public void setIdSector(Integer idSector) {\r\n\t\tthis.idSector = idSector;\r\n\t}", "public int getBytes(int index, FileChannel out, long position, int length)\r\n/* 889: */ throws IOException\r\n/* 890: */ {\r\n/* 891:898 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 892:899 */ return super.getBytes(index, out, position, length);\r\n/* 893: */ }", "public Record getRecord(int index) throws IOException{\n\t\t//buff.checkBuffers(index);\n\t\t//buff=new BufferPool();\n\t\t//System.out.println(\"f\");\n\t\tRecord rec = buff.checkBuffers(index);\n\t\t//System.out.println(\"f\");\n\t\tif(rec.getKey()==-1){\n\t\tRecord recs = buff.doLRU(index);\n\t\t\treturn recs;\n\t\t}\n\t\t\n\t\t//buff.checkBuff(index)\n\t\t\n\t\t\n\t\treturn rec;\n\t\t\n\t\t//looks to see if index is in buffer length.\n\t\t//if not. checks which buffer is dirty\n\t\t//if none, still write buffer back to file if all are full\n\t\t//then read in what hasnt been read from index\n\t\t\n\t\t\n\t}", "public abstract long Seek(long pos, int typ)\n\t\tthrows IOException, SMBException;", "protected void doBeginRead() throws Exception {}", "private long readUntil(long pos) throws IOException {\n/* 86 */ if (pos < this.length) {\n/* 87 */ return pos;\n/* */ }\n/* */ \n/* 90 */ if (this.foundEOS) {\n/* 91 */ return this.length;\n/* */ }\n/* */ \n/* 94 */ int sector = (int)(pos >> 9L);\n/* */ \n/* */ \n/* 97 */ int startSector = this.length >> 9;\n/* */ \n/* */ \n/* 100 */ for (int i = startSector; i <= sector; i++) {\n/* 101 */ byte[] buf = new byte[512];\n/* 102 */ this.data.add(buf);\n/* */ \n/* */ \n/* 105 */ int len = 512;\n/* 106 */ int off = 0;\n/* 107 */ while (len > 0) {\n/* 108 */ int nbytes = this.src.read(buf, off, len);\n/* */ \n/* 110 */ if (nbytes == -1) {\n/* 111 */ this.foundEOS = true;\n/* 112 */ return this.length;\n/* */ } \n/* 114 */ off += nbytes;\n/* 115 */ len -= nbytes;\n/* */ \n/* */ \n/* 118 */ this.length += nbytes;\n/* */ } \n/* */ } \n/* */ \n/* 122 */ return this.length;\n/* */ }", "synchronized ByteBuffer readPage(int clusterId, int pageId, long offset, long length,\n boolean cachePage)\n throws IOException {\n pageLoads++;\n ByteBuffer cachedPage = null;\n if (mode == READMODE.MR) {\n cachedPage = pcp[clusterId].getPage(pageId);\n } else if (mode == READMODE.POINTQUERY) {\n cachedPage = pagecache.getBlock(makePageName(segId, clusterId, pageId));\n }\n if (cachedPage != null) {\n cacheHits++;\n if (reporter != null) {\n if (clusterId < 16) {\n reporter.incrCounter(SegmentCacheHitCounter.values()[clusterId], 1);\n } else {\n reporter.incrCounter(SegmentCacheHitCounter.OTHERCLUSTERS, 1);\n }\n }\n return cachedPage.duplicate();\n }\n\n /**\n * Report the related activities to M/R frameworks, so we will know\n * what happened during query processing\n */\n if (reporter != null) {\n if (clusterId < 16) {\n reporter.incrCounter(SegmentReadPageCounter.values()[clusterId], 1);\n } else {\n reporter.incrCounter(SegmentReadPageCounter.OTHERCLUSTERS, 1);\n }\n\n if (istream.getPos() - offset > 0) {\n reporter.incrCounter(SegmentPosSeekCounter.MOVEBACK, 1);\n } else {\n reporter.incrCounter(SegmentPosSeekCounter.MOVEON, 1);\n }\n }\n\n // ByteBuffer buf = ByteBuffer.allocate(longToInt(length));\n // istream.readFully(offset, buf.array());\n\n // Read the page from filesystem\n InputStream is = new BoundedRangeFileInputStream(istream, offset, length);\n ByteBuffer buf = ByteBuffer.allocate(longToInt(length));\n IOUtils.readFully(is, buf.array(), 0, buf.capacity());\n is.close();\n\n if (cachePage) {\n if (mode == READMODE.MR) {\n pcp[clusterId].cachePage(pageId, buf.duplicate());\n } else if (mode == READMODE.POINTQUERY) {\n pagecache.cacheBlock(makePageName(segId, clusterId, pageId), buf.duplicate(), true);\n }\n }\n return buf;\n }", "public final void getDiskInformation(DiskDeviceContext ctx, SrvDiskInfo info)\n throws IOException {\n\n // Check if there is static disk size information available\n \n if ( ctx.hasDiskInformation())\n info.copyFrom(ctx.getDiskInformation());\n \n // Check that the context is a JDBC context\n \n if ( ctx instanceof DBDeviceContext) {\n \n // Access the associated file loader class, if it implements the disk size interface then call the loader\n // to fill in the disk size details\n \n DBDeviceContext dbCtx = (DBDeviceContext) ctx;\n \n if ( dbCtx.getFileLoader() instanceof DiskSizeInterface) {\n \n // Pass the disk size request to the associated file loader\n \n DiskSizeInterface sizeInterface = (DiskSizeInterface) dbCtx.getFileLoader();\n \n sizeInterface.getDiskInformation(ctx, info);\n \n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"DBDiskDriver getDiskInformation() handed to file loader\");\n }\n }\n \n // Check if there is a quota manager, if so then get the current free space from the quota manager\n \n if ( ctx.hasQuotaManager()) {\n \n // Get the free space, in bytes, from the quota manager\n \n long freeSpace = ctx.getQuotaManager().getAvailableFreeSpace();\n \n // Convert the free space to free units\n \n long freeUnits = freeSpace / info.getUnitSize();\n info.setFreeUnits(freeUnits);\n }\n }", "public export.serializers.avro.DeviceInfo.Builder setSector(java.lang.CharSequence value) {\n validate(fields()[2], value);\n this.sector = value;\n fieldSetFlags()[2] = true;\n return this;\n }", "private boolean readSectorTrailer(APDU apdu) {\r\n\t\t// Check whether buffer contains necessary data\r\n\t\tif (apdu.getIncomingLength() - processed < MiFareImage.BLOCK_LENGTH + 0x01)\r\n\t\t\tISOException.throwIt(ISO7816.SW_DATA_INVALID);\r\n\t\t// Read sector number, move offset\r\n\t\tsector = apdu.getBuffer()[offset++];\r\n\t\tprocessed++;\r\n\t\t// Is sector valid\r\n\t\timage.checkBlock(sector, (byte) 0);\r\n\t\t// Read trailer\r\n\t\timage.setBlock(apdu.getBuffer(), offset, sector,\r\n\t\t\t\t(byte) (image.getBlocksNumber(sector) - 0x01), (byte) 0,\r\n\t\t\t\tMiFareImage.BLOCK_LENGTH);\r\n\t\tprocessed += MiFareImage.BLOCK_LENGTH;\r\n\t\t// Mark sector as personalized\r\n\t\timage.setSectorPersonalized(sector);\r\n\t\t// Try to load next portion\r\n\t\tif (apdu.getIncomingLength() == processed && !readPortion(apdu, false))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "private static int readFromBuffer() throws IOException{\n int n;\n // The number of ints read into the buffer after a read.\n int intsRead;\n // The current position in the byte buffer.\n int pos;\n // The current integer values being processed.\n int x;\n // The current position in the integer array of values to be sorted.\n int index = 0;\n\n // The loop condition reads in the next buffer of bytes from the file, until there are no\n // more bytes to be read in.\n while ((n = fis.read(buf)) != READ_FINISHED) {\n intsRead = n / BYTES_TO_INTS;\n\n // iterate through all the ints currently being held in the byte buffer\n // if they fall in the given bound, add them to the int array to be sorted.\n for (int i = 0; i < intsRead; i++) {\n pos = BYTES_TO_INTS * i;\n\n // Convert the next set of 4 bytes to an integer.\n x = (((int) buf[pos]) & 255) << 24\n | ((((int) buf[pos + 1]) & 255) << 16)\n | ((((int) buf[pos + 2]) & 255) << 8)\n | ((((int) buf[pos + 3]) & 255));\n\n\n // put the current integer into the int array\n ints[index] = x;\n index++;\n }\n }\n\n\n // This returns the number of values selected to be sorted.\n return index;\n }", "public Integer getIdSector() {\r\n\t\treturn idSector;\r\n\t}", "public void read() throws IOException {\n\t\twhile (this.in.getReadBytes() != size) {\n\t\t\tString chunkID;\n\t\t\ttry {\n\t\t\t\tchunkID = readString(4);\n\t\t\t} catch (EmptyReadException e) {\n\t\t\t\t/**\n\t\t\t\t * T4L bug 15259: Some encoders must write a byte \"0\" to signify\n\t\t\t\t * EOF?\n\t\t\t\t */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlong chunkSize = readLong(4);\n\t\t\treadChunk(chunkID, chunkSize);\n\t\t}\n\t}", "public void readWait()\n {\n try{\n waitLock.lock();\n while(readSector != -1){\n \t readDone.awaitUninterruptibly();\n }\n return;\n }\n finally{\n waitLock.unlock();\n }\n }", "public static int read(int fd, byte[] buf, int count)\n throws Exception {\n // check fd\n int status = check_fd_for_read(fd);\n if (status < 0)\n return status;\n\n FileDescriptor file = process.openFiles[fd];\n int offset = file.getOffset();\n int size = file.getSize();\n int blockSize = file.getBlockSize();\n byte[] bytes = file.getBytes();\n int readCount = 0;\n for (int i = 0; i < count; i++) {\n // if we read to the end of the file, stop reading\n if (offset >= size)\n break;\n // if this is the first time through the loop,\n // or if we're at the beginning of a block, load the data block\n if ((i == 0) || ((offset % blockSize) == 0)) {\n status = file.readBlock((short) (offset / blockSize));\n if (status < 0)\n return status;\n }\n // copy a byte from the file buffer to the read buffer\n buf[i] = bytes[offset % blockSize];\n offset++;\n readCount++;\n }\n // update the offset\n file.setOffset(offset);\n\n // return the count of bytes read\n return readCount;\n }", "@Override\n public int read(byte[] byteBuffer) throws IOException {\n return this.read(byteBuffer, 0, byteBuffer.length);\n }", "protected int read(byte[] buffer) throws IOException {\n return mTiffStream.read(buffer);\n }", "String readKeyFromIndex(int position) throws IOException {\n file.seek(indexPositionToKeyFp(position));\n return file.readUTF();\n }", "public static void testBuffer() throws Exception {\n\t\tStopwatch.start();\n\t\t// readWithoutBuffer(new FileInputStream(\"bigdata\"));\n\t\tStopwatch.stop();\n\n\t\t/*\n\t\t * When read a single byte(or small piece of data), BufferedInputStream\n\t\t * improve performance significantly\n\t\t */\n\t\tStopwatch.start();\n\t\treadWithBuffer(new FileInputStream(\"bigdata.data\"));\n\t\tStopwatch.stop();\n\t\t\n\t\t/*\n\t\t * When read a single byte(or small piece of data), BufferedInputStream\n\t\t * improve performance significantly\n\t\t */\n\t\tStopwatch.start();\n\t\treadWithBufferEnhanced(new FileInputStream(\"bigdata.data\"));\n\t\tStopwatch.stop();\n\n\t\t/*\n\t\t * When read a chunk at a time, BufferedInputStream won't help\n\t\t */\n\t\tStopwatch.start();\n\t\treadWithBuffer2(new FileInputStream(\"bigdata.data\"));\n\t\tStopwatch.stop();\n\t\t\n\t\t/*\n\t\t * NIO way, same as chunk read \n\t\t */\n\t\tStopwatch.start();\n\t\treadWithBuffer3(new RandomAccessFile(\"bigdata.data\", \"r\").getChannel());\n\t\tStopwatch.stop();\n\t}", "public abstract void Lock(long offset, long len)\n\t\tthrows IOException, SMBException;", "private int ensureBuffer(int offset, int length) throws IOException {\n\t\tfinal int lastPos = offset + length - 1;\n\t\tfinal int desiredSize = ((lastPos / BUFFER_SIZE) + 1) * BUFFER_SIZE;\n\t\tfinal int currentSize = this.buffer.length;\n\n\t\tif (desiredSize > currentSize) {\n\t\t\tfinal byte[] readBuffer = new byte[desiredSize - currentSize];\n\t\t\tfinal int count = this.in.read(readBuffer);\n\n\t\t\tif (count > 0) {\n\t\t\t\tfinal byte[] newBuffer = new byte[currentSize + count];\n\t\t\t\tSystem.arraycopy(this.buffer, 0, newBuffer, 0, currentSize);\n\t\t\t\tSystem.arraycopy(readBuffer, 0, newBuffer, currentSize, count);\n\t\t\t\tthis.buffer = newBuffer;\n\t\t\t}\n\t\t\treturn (lastPos < this.buffer.length) ? length : length - (lastPos - this.buffer.length + 1);\n\t\t}\n\t\treturn length;\n\t}", "public int getBytes(int index, GatheringByteChannel out, int length)\r\n/* 183: */ throws IOException\r\n/* 184: */ {\r\n/* 185:211 */ ensureAccessible();\r\n/* 186:212 */ return getBytes(index, out, length, false);\r\n/* 187: */ }", "public int read(ByteBuffer directBuffer, int numBytes) {\n directBuffer.rewind();\n // write to the buffer and return number of bytes written.\n return audioRecord.read(directBuffer, numBytes);\n }", "public void read(IORequest request) throws MemoryFault {\n setBaseLimit();\n // sets what we need to be able to read\n int deviceNumber = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc);\n int platter = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 1);\n int platStart = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 2);\n int datasize = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 3);\n int memLoc = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 4) + Process_Table[request.prognum].base;\n// System.out.println(deviceNumber+\"device\");\n// System.out.println(platter+\"plat\");\n// System.out.println(platStart+\"Start\");\n// System.out.println(datasize+\"data\");\n// System.out.println(memLoc+\"mem\");\n\n Process_Table[currentProcess].status = ProcessState.waiting;\n\n machine.devices[deviceNumber].controlRegister.register[0] = DeviceControllerOperations.READ;\n machine.devices[deviceNumber].controlRegister.register[1] = platter;\n machine.devices[deviceNumber].controlRegister.register[2] = platStart;\n machine.devices[deviceNumber].controlRegister.register[3] = datasize;\n machine.devices[deviceNumber].controlRegister.latch();\n for (int i = 0; i < datasize; i++) {\n machine.memory.store(i + memLoc, machine.devices[deviceNumber].buffer[i]);\n\n }\n //System.out.println(waitQ[Machine.DISK1].size() + \" READ\");\n // initiate the latch\n\n }", "public int readBytes(FileChannel out, long position, int length)\r\n/* 903: */ throws IOException\r\n/* 904: */ {\r\n/* 905:910 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 906:911 */ return super.readBytes(out, position, length);\r\n/* 907: */ }", "public void loadTagBuffer() {\r\n\r\n try {\r\n bPtr = 0;\r\n\r\n if (raFile != null) {\r\n fLength = raFile.length();\r\n }\r\n\r\n if (fLength < FileDicomBaseInner.BUFFER_SIZE) {\r\n\r\n if (tagBuffer == null) {\r\n tagBuffer = new byte[(int) fLength];\r\n } else if (fLength > tagBuffer.length) {\r\n tagBuffer = new byte[(int) fLength];\r\n }\r\n } else if (tagBuffer == null) {\r\n tagBuffer = new byte[FileDicomBaseInner.BUFFER_SIZE];\r\n } else if (tagBuffer.length < FileDicomBaseInner.BUFFER_SIZE) {\r\n tagBuffer = new byte[FileDicomBaseInner.BUFFER_SIZE];\r\n }\r\n\r\n raFile.readFully(tagBuffer);\r\n } catch (final IOException ioE) {}\r\n }", "void accessBlock(final long blockId) throws IOException;", "private void readSuperblock() {\n byte blockInfo[] = new byte[Disk.blockSize];\n\n // read in all of the block info into blockInfo buffer\n SysLib.rawread(0, blockInfo);\n\n // read the number of disk blocks from blockInfo\n this.totalBlocks = SysLib.bytes2int(blockInfo, 0);\n this.totalINodes = SysLib.bytes2int(blockInfo, 4);\n this.freeListTail = SysLib.bytes2int(blockInfo, 8);\n this.freeListTail = SysLib.bytes2int(blockInfo, 12);\n }", "void readBytes(byte[] into, int offset, int toRead) throws IOException;", "public void getBlock(byte[] buffer, short offset, byte sector, byte block,\r\n\t\t\tbyte b_offset, byte b_length) {\n\t\tcheckConditionsToInteroperate(JCSystem.getPreviousContextAID());\r\n\t\timage.checkAccess(sector, block);\r\n\t\timage.getBlock(buffer, offset, sector, block, b_offset, b_length);\r\n\t}", "public ADisk(boolean format)\n { \n\t // build lock\n\t this.setFailureProb(0);\n ADisk_lock = new SimpleLock();\n waitLock = new SimpleLock();\n atranslist = new ActiveTransactionList();\n //initialize lists and logs\n wblist = new WriteBackList(this);\n commitDone = waitLock.newCondition();\n writebackDone = waitLock.newCondition();\n readDone = waitLock.newCondition();\n logReadDone = waitLock.newCondition();\n wbbarrier = waitLock.newCondition();\n commitBarrierSector = -1;\n commitBarrierTid = -1;\n writebackBarrierSector = -1;\n writebackBarrierTid = -1;\n readSector = -1;\n readTid = -1;\n logReadSector = -1;\n logReadTid = -1;\n wbbarrierSec = -1;\n wbbarrierTag = -1;\n \n\t d = null;\n\t try{\n\t d = new Disk(this);\n\t }\n\t catch(FileNotFoundException fnf){\n\t System.out.println(\"Unable to open disk file\");\n\t System.exit(-1);\n\t }\n\t \n\t //create writeback thread\n\t writebackthread = new WriteBackThread();\n try {\n\t if (format == true){\n\t \t lstatus = new LogStatus(this, false);\n\t \t \n\t \t ///wipe the disk\n\t \t /*byte[] blank = new byte[Disk.SECTOR_SIZE];\n\t \t for(int i = 0; i < Disk.SECTOR_SIZE; i++)\n\t \t \tblank[i] = 0x00;\n\t \t for(int i = 0; i < this.getNSectors(); i++){\n\t \t \tif(i == this.getNSectors() - 1){\n\t \t \t\tthis.commitBarrierSector = i;\n\t \t \t\tthis.commitBarrierTid = Disk.SECTOR_SIZE + 10;\n\t \t \t\td.addBarrier(); // must wait for the entire wipe write to be on disk\n\t \t \t}\n\t \t \td.startRequest(Disk.WRITE, Disk.SECTOR_SIZE+10, i, blank);\n\t \t }\n \t \tcommitWait();*/\n\t \t // We decided not to wipe the disk because the instructions were vague and it seems insanely inefficient to wipe the disk and there doesnt seem to be reason to wipe it. It also makes our tests run very slow. \n\t } \n\t else {\n\t \t //RECOVERY\n\t \t lstatus = new LogStatus(this, true);\n\t \t byte[] next = lstatus.recoverNext();\n\t while(next != null){\n\t \t Transaction temp = Transaction.parseLogBytesDebug(next, this);\n\t \t wblist.addCommitted(temp);\t \n\t \t next = lstatus.recoverNext();\n\t } \n\t }\n }\n catch(IOException e){\n\t\t\tSystem.out.println(\"IO exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n catch(IllegalArgumentException e){\n\t\t\tSystem.out.println(\"Illegal Argument exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n \n }", "public int read() throws IOException {\n if(available() == 0) throw new EOFException(\"No data available.\");\n int ret = data.getFirst().get();\n updateBufferList();\n return ret;\n }", "public void read_from_buffer(byte[] buffer) throws IOException {\r\n ByteArrayInputStream byte_in = new ByteArrayInputStream(buffer);\r\n DataInputStream in = new DataInputStream(byte_in);\r\n\r\n read_from_buffer(in);\r\n\r\n in.close();\r\n byte_in.close();\r\n }", "public ByteBuffer internalNioBuffer(int index, int length)\r\n/* 311: */ {\r\n/* 312:325 */ checkIndex(index, length);\r\n/* 313:326 */ return (ByteBuffer)internalNioBuffer().clear().position(index).limit(index + length);\r\n/* 314: */ }", "public int setBytes(int index, ScatteringByteChannel in, int length)\r\n/* 271: */ throws IOException\r\n/* 272: */ {\r\n/* 273:289 */ ensureAccessible();\r\n/* 274: */ try\r\n/* 275: */ {\r\n/* 276:291 */ return in.read((ByteBuffer)internalNioBuffer().clear().position(index).limit(index + length));\r\n/* 277: */ }\r\n/* 278: */ catch (ClosedChannelException ignored) {}\r\n/* 279:293 */ return -1;\r\n/* 280: */ }", "public SegmentReader(Configuration conf, FileSystem fs, Path file, int segId, int buffersize,\n long segmentOffset, long segmentLength, long segmentPMSOffset) throws IOException {\n this(conf, fs, file, segId, buffersize, segmentOffset, segmentLength, segmentPMSOffset, true,\n READMODE.MR);\n }", "public byte[] read(int offset, int length) throws IOException {\n\t\tif (ensureBuffer(offset, length) >= length) {\n\t\t\tfinal byte[] array = new byte[length];\n\t\t\tSystem.arraycopy(this.buffer, offset, array, 0, length);\n\t\t\tthis.pos = offset + length;\n\t\t\treturn array;\n\t\t}\n\t\tthrow new EOFException();\n\t}", "public int read() throws IOException {\n if (!_open)\n return -1;\n long _here = position();\n int val = _backing.read();\n if (val >= 0) {\n val = _head.crypt((byte) val, _here);\n }\n return val;\n }", "void read(Buffer buffer);" ]
[ "0.79566896", "0.5594339", "0.55817926", "0.4841465", "0.4833967", "0.4724324", "0.46817657", "0.45610908", "0.44835296", "0.44072214", "0.43571064", "0.4276786", "0.42729765", "0.4267163", "0.42550755", "0.4247804", "0.4228069", "0.42245764", "0.4208341", "0.41515574", "0.41500098", "0.41407484", "0.41054443", "0.4102024", "0.4080123", "0.40788242", "0.4071166", "0.40533498", "0.40454948", "0.40371957", "0.402909", "0.4022614", "0.40128413", "0.40026703", "0.39808923", "0.39765874", "0.3975233", "0.39522612", "0.3950369", "0.3942976", "0.3941727", "0.39309585", "0.39257237", "0.39249188", "0.39151806", "0.3913521", "0.39131412", "0.38949102", "0.38871127", "0.3868636", "0.38682136", "0.38521773", "0.3849646", "0.3827593", "0.3824358", "0.38214016", "0.38059014", "0.38032913", "0.37907347", "0.37871265", "0.37868172", "0.37844163", "0.3779283", "0.3776797", "0.37766367", "0.37763596", "0.3776344", "0.3767065", "0.37644538", "0.37641877", "0.37630484", "0.376152", "0.37577438", "0.37577385", "0.3753415", "0.3746072", "0.374599", "0.37445045", "0.3741626", "0.3740516", "0.37334374", "0.37319717", "0.37268654", "0.3717524", "0.36976337", "0.3692608", "0.3689476", "0.36850902", "0.36789915", "0.36778367", "0.36760694", "0.36754104", "0.36724752", "0.3670973", "0.36676452", "0.36606023", "0.36573446", "0.36526364", "0.36494577", "0.36437404" ]
0.7978177
0
/ Read sector DISK ONLY this is used for debugging to make sure changes were written to disk
public void readSectorDiskOnly(TransID tid, int sectorNum, byte buffer[]) throws IOException, IllegalArgumentException, IndexOutOfBoundsException{ // Not quite done yet try{ ADisk_lock.lock(); readTid = tid.getTidfromTransID(); readSector = sectorNum; d.startRequest(Disk.READ, tid.getTidfromTransID(), sectorNum, buffer); readWait(); } finally{ ADisk_lock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getDisk();", "public native int getDiskIO();", "public long\n getDisk()\n {\n return pDisk;\n }", "com.google.protobuf.ByteString getDiskBytes();", "public String getDisk() {\n return disk;\n }", "public int getDisk()\n {\n return this.disk;\n }", "boolean isMountedDiskImageReadOnly() {\n return (isDiskImageMounted() && isMountedDiskImageReadOnly);\n }", "int getDiskNum();", "public boolean hasSector() {\n return fieldSetFlags()[2];\n }", "public java.lang.CharSequence getSector() {\n return sector;\n }", "public OSDiskImageEncryption osDiskImage() {\n return this.osDiskImage;\n }", "public java.lang.CharSequence getSector() {\n return sector;\n }", "public Boolean isBootDisk() {\n return this.isBootDisk;\n }", "public void changeDisk(){\n if(isFull==true) {\n if (this.type == TYPE.WHITE) {\n this.type = TYPE.BLACK;\n } else {\n type = TYPE.WHITE;\n }\n }\n return;\n }", "public Boolean getIsBootDisk() {\n return this.isBootDisk;\n }", "@Override\r\n protected String getDiskLocation()\r\n {\r\n return dataFile.getFilePath();\r\n }", "DiscFileSystemInfo getFileSystemInfo(String path) throws IOException;", "public String diskAccessId() {\n return this.diskAccessId;\n }", "public SystemDisk getSystemDisk() {\n return this.SystemDisk;\n }", "boolean isDiskImageMounted() {\n return (getMountedDiskImageFileUri() != null);\n }", "public final void getDiskInformation(DiskDeviceContext ctx, SrvDiskInfo info)\n throws IOException {\n\n // Check if there is static disk size information available\n \n if ( ctx.hasDiskInformation())\n info.copyFrom(ctx.getDiskInformation());\n \n // Check that the context is a JDBC context\n \n if ( ctx instanceof DBDeviceContext) {\n \n // Access the associated file loader class, if it implements the disk size interface then call the loader\n // to fill in the disk size details\n \n DBDeviceContext dbCtx = (DBDeviceContext) ctx;\n \n if ( dbCtx.getFileLoader() instanceof DiskSizeInterface) {\n \n // Pass the disk size request to the associated file loader\n \n DiskSizeInterface sizeInterface = (DiskSizeInterface) dbCtx.getFileLoader();\n \n sizeInterface.getDiskInformation(ctx, info);\n \n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"DBDiskDriver getDiskInformation() handed to file loader\");\n }\n }\n \n // Check if there is a quota manager, if so then get the current free space from the quota manager\n \n if ( ctx.hasQuotaManager()) {\n \n // Get the free space, in bytes, from the quota manager\n \n long freeSpace = ctx.getQuotaManager().getAvailableFreeSpace();\n \n // Convert the free space to free units\n \n long freeUnits = freeSpace / info.getUnitSize();\n info.setFreeUnits(freeUnits);\n }\n }", "private int getSector(String key) // returns sector number\n\t\t\t\t\t\t\t\t\t\t// indicated by key\n\t{\n\t\tkey += \" \";// add spaces, enough to\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cover the 27 minimum\n\t\tkey = key.substring(0, 27);// get rid of any extra\n\t\tchar[] k = key.toCharArray();// then convert to char array\n\t\t/*\n\t\t * if it's greater or equal to the first key and less than the next key,\n\t\t * move down a layer\n\t\t * \n\t\t * else move on to the next key and repeat.\n\t\t */\n\t\tint datasector = indexRoot;\n\t\tchar[] sector = new char[512];\n\t\tchar[][] keys = new char[15][27];\n\t\tchar[][] sectornrs = new char[15][6];\n\t\tsector = disk.readSector(datasector);\n\t\t// get the root index...\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tkeys[i] = getPartKey(sector, i);\n\t\t}\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tsectornrs[i] = getPartIndex(sector, i);\n\t\t}\n\n\t\tboolean brk = false;\n\n\t\tfor (int i = 0; i < 14 && !brk; i++) {\n\t\t\t// check the key agains the keys we have\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\t\t\tif ((p >= 0 && q < 0) || (q >= 0 && keys[i + 1][0] == '\\000')) {\n\t\t\t\t// we've got a match.\n\t\t\t\t// get the sector nr\n\t\t\t\tint number = Integer.valueOf(new String(sectornrs[i]).trim());\n\t\t\t\tif (number > 1000 && number < indexStart) {\n\t\t\t\t\tdatasector = number;\n\t\t\t\t\tbrk = true;\n\t\t\t\t} else {\n\t\t\t\t\t/*\n\t\t\t\t\t * proceed to check which one of the next row we need.\n\t\t\t\t\t */\n\t\t\t\t\tfor (int w = 0; w < 14; w++) {\n\n\t\t\t\t\t\tsector = disk.readSector(number + w);\n\t\t\t\t\t\tchar[] t = getPartKey(sector, 0);\n\t\t\t\t\t\tif (w > 1 && compare(t, keys[w - 1]) >= 0) {\n\t\t\t\t\t\t\tkeys[w] = getPartKey(sector, w);\n\t\t\t\t\t\t\tsectornrs[w] = getPartIndex(sector, w);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor (int r = 0; r < 27; r++) {\n\t\t\t\t\t\t\t\tkeys[w][r] = '\\000';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (int r = 0; r < 6; r++) {\n\t\t\t\t\t\t\t\tsectornrs[w][r] = '\\000';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// brk=true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t// after the code above we end up at the index of the next index where\n\t\t// there are 15 more possibilities inside the object. That's what we\n\t\t// check here\n\t\t// read the next 15 lines into an array of char[]\n\t\tchar[][] buffers = new char[15][512];\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tchar[] temp = disk.readSector(datasector + i);\n\t\t\tfor (int j = 0; j < 512; j++) {\n\t\t\t\tbuffers[i][j] = temp[j];\n\t\t\t}\n\t\t}\n\n\t\t// get the first key of each buffer\n\t\tkeys = new char[15][27];\n\t\tsectornrs = new char[15][6];\n\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tint j = 0;\n\t\t\tfor (; j < 27; j++) {\n\t\t\t\tkeys[i][j] = buffers[i][j];\n\t\t\t}\n\t\t\tint p = 0;\n\t\t\tfor (; j < 33; j++) {\n\t\t\t\tsectornrs[i][p] = buffers[i][j];\n\t\t\t\tp++;\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < 14; i++) {\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\t\t\t// the item is in this, or falls between the keys.\n\t\t\tif ((p >= 0 && q < 0) || (q >= 0 && keys[i + 1][0] == '\\000')) {\n\t\t\t\t// set all the keys equal to the line at datasector+i\n\t\t\t\tdatasector += i;\n\t\t\t\t// sector = disk.readSector(datasector);\n\t\t\t\ti = 15;\n\t\t\t}\n\t\t}\n\n\t\t// parse the records in this sector\n\t\tkeys = new char[15][27];\n\t\tsectornrs = new char[15][6];\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tint j = 0;\n\n\t\t\tchar[] strk = getPartKey(sector, i);\n\t\t\tchar[] stri = getPartIndex(sector, i);\n\t\t\tfor (; j < 27; j++) {\n\t\t\t\tkeys[i][j] = strk[j];\n\t\t\t}\n\t\t\tint p = 0;\n\t\t\tfor (; j < 33; j++) {\n\t\t\t\tsectornrs[i][p] = stri[p];\n\t\t\t\tp++;\n\t\t\t}\n\t\t}\n\n\t\t// go through each record in this index to find where it would belong\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\n\t\t\t// the item is in this, or falls between the keys.\n\t\t\tif ((p >= 0 && q < 0) || (q >= 0 && keys[i + 1][0] == '\\000')) {\n\t\t\t\t// set all the keys equal to the line at datasector+i\n\t\t\t\tint num = 0;\n\n\t\t\t\tdatasector += num;// set it equal to the number followed by the\n\t\t\t\t\t\t\t\t\t// key...\n\t\t\t\ti = 15;\n\t\t\t}\n\t\t}\n\t\t// inside this index record, find the sector to which the key would\n\t\t// belong\n\t\tsector = disk.readSector(datasector);\n\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tint j = 0;\n\n\t\t\tchar[] strk = getPartKey(sector, i);\n\t\t\tchar[] stri = getPartIndex(sector, i);\n\t\t\tfor (; j < 27; j++) {\n\t\t\t\tkeys[i][j] = strk[j];\n\t\t\t}\n\t\t\tint p = 0;\n\t\t\tfor (; j < 33; j++) {\n\t\t\t\tsectornrs[i][p] = stri[p];\n\t\t\t\tp++;\n\t\t\t}\n\t\t}\n\t\tif (datasector >= 1000 && datasector < indexStart) {\n\t\t\treturn datasector;\n\n\t\t}\n\t\tfor (int i = 0; i < 14; i++) {\n\t\t\tint p = compare(k, keys[i]);\n\t\t\tint q = compare(k, keys[i + 1]);\n\t\t\t// the item is in this, or falls between the keys.\n\t\t\tif ((p >= 0 && q < 0)) {\n\t\t\t\t// set all the keys equal to the line at datasector+i\n\t\t\t\tdatasector = Integer.parseInt(new String(\n\t\t\t\t\t\tgetPartIndex(sector, i)).trim());// set it equal to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// number followed\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by the key...\n\t\t\t\ti = 15;\n\t\t\t} else if ((q >= 0) && keys[i + 1][0] == '\\000') {\n\t\t\t\t// the next index doesn't exist...\n\t\t\t\tdatasector = Integer.parseInt(new String(getPartIndex(sector,\n\t\t\t\t\t\ti + 1)).trim());// set it equal to the number followed\n\t\t\t\t\t\t\t\t\t\t// by the key...\n\t\t\t\ti = 15;\n\t\t\t} else if (i == 13) {\n\t\t\t\tdatasector = Integer.parseInt(new String(getPartIndex(sector,\n\t\t\t\t\t\ti + 1)).trim());\n\t\t\t}\n\t\t}\n\t\treturn datasector;\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate FileChannel openDiskChannel() throws FileNotFoundException {\n\t\tRandomAccessFile f = new RandomAccessFile(this.underlined_device, \"rw\");\n\t\treturn f.getChannel();\n\t}", "public long getDiskUsage() {\n\t\treturn diskUsage;\n\t}", "public export.serializers.avro.DeviceInfo.Builder clearSector() {\n sector = null;\n fieldSetFlags()[2] = false;\n return this;\n }", "public DiskEncryptionKeyInfo diskEncryptionKeyInfo() {\n return this.diskEncryptionKeyInfo;\n }", "private void updateStatusSDCard(){\n\t\tString status = StorageUtils.getSDcardState();\n\t\tString readOnly = \"\";\n\t\tif (status.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {\n\t\t\tstatus = Environment.MEDIA_MOUNTED;\n\t\t\treadOnly = getResources().getString(R.string.read_only);\n\t\t}\n\n\t\t// Calculate the space of SDcard\n\t\tif (status.equals(Environment.MEDIA_MOUNTED)) {\n\t\t\ttry {\n\t\t\t\tString path = StorageUtils.getSDcardDir();\n\t\t\t\tStatFs stat = new StatFs(path);\n\t\t\t\tlong blockSize = stat.getBlockSize();\n\t\t\t\tlong totalBlocks = stat.getBlockCount();\n\t\t\t\tlong availableBlocks = stat.getAvailableBlocks();\n\t\t\t\tmSdTotalSpace=formatSize(totalBlocks * blockSize);\n\t\t\t\tmSdAvailableSpace=formatSize(availableBlocks * blockSize) + readOnly;\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tstatus = Environment.MEDIA_REMOVED;\n\t\t\t}\n\t\t}else{\n\t\t\tmSdTotalSpace=getResources().getString(R.string.sd_unavailable);\n\t\t\tmSdAvailableSpace=getResources().getString(R.string.sd_unavailable);\n\t\t}\n\t}", "String getDiskFileName();", "public ADisk(boolean format)\n { \n\t // build lock\n\t this.setFailureProb(0);\n ADisk_lock = new SimpleLock();\n waitLock = new SimpleLock();\n atranslist = new ActiveTransactionList();\n //initialize lists and logs\n wblist = new WriteBackList(this);\n commitDone = waitLock.newCondition();\n writebackDone = waitLock.newCondition();\n readDone = waitLock.newCondition();\n logReadDone = waitLock.newCondition();\n wbbarrier = waitLock.newCondition();\n commitBarrierSector = -1;\n commitBarrierTid = -1;\n writebackBarrierSector = -1;\n writebackBarrierTid = -1;\n readSector = -1;\n readTid = -1;\n logReadSector = -1;\n logReadTid = -1;\n wbbarrierSec = -1;\n wbbarrierTag = -1;\n \n\t d = null;\n\t try{\n\t d = new Disk(this);\n\t }\n\t catch(FileNotFoundException fnf){\n\t System.out.println(\"Unable to open disk file\");\n\t System.exit(-1);\n\t }\n\t \n\t //create writeback thread\n\t writebackthread = new WriteBackThread();\n try {\n\t if (format == true){\n\t \t lstatus = new LogStatus(this, false);\n\t \t \n\t \t ///wipe the disk\n\t \t /*byte[] blank = new byte[Disk.SECTOR_SIZE];\n\t \t for(int i = 0; i < Disk.SECTOR_SIZE; i++)\n\t \t \tblank[i] = 0x00;\n\t \t for(int i = 0; i < this.getNSectors(); i++){\n\t \t \tif(i == this.getNSectors() - 1){\n\t \t \t\tthis.commitBarrierSector = i;\n\t \t \t\tthis.commitBarrierTid = Disk.SECTOR_SIZE + 10;\n\t \t \t\td.addBarrier(); // must wait for the entire wipe write to be on disk\n\t \t \t}\n\t \t \td.startRequest(Disk.WRITE, Disk.SECTOR_SIZE+10, i, blank);\n\t \t }\n \t \tcommitWait();*/\n\t \t // We decided not to wipe the disk because the instructions were vague and it seems insanely inefficient to wipe the disk and there doesnt seem to be reason to wipe it. It also makes our tests run very slow. \n\t } \n\t else {\n\t \t //RECOVERY\n\t \t lstatus = new LogStatus(this, true);\n\t \t byte[] next = lstatus.recoverNext();\n\t while(next != null){\n\t \t Transaction temp = Transaction.parseLogBytesDebug(next, this);\n\t \t wblist.addCommitted(temp);\t \n\t \t next = lstatus.recoverNext();\n\t } \n\t }\n }\n catch(IOException e){\n\t\t\tSystem.out.println(\"IO exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n catch(IllegalArgumentException e){\n\t\t\tSystem.out.println(\"Illegal Argument exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n \n }", "public HWDiskStore() {\n this.diskStore = new oshi.hardware.HWDiskStore();\n }", "public VolumeInfo getVolumeInformation(DiskDeviceContext ctx) {\n \n // Check if the context has volume information\n \n VolumeInfo volInfo = ctx.getVolumeInformation();\n \n if ( volInfo == null) {\n \n // Create volume information for the filesystem\n \n volInfo = new VolumeInfo(ctx.getDeviceName());\n \n // Add to the device context\n \n ctx.setVolumeInformation(volInfo);\n }\n\n // Check if the serial number is valid\n \n if ( volInfo.getSerialNumber() == 0) {\n \n // Generate a random serial number\n \n volInfo.setSerialNumber(new java.util.Random().nextInt()); \n }\n \n // Check if the creation date is valid\n \n if ( volInfo.hasCreationDateTime() == false) {\n \n // Set the creation date to now\n \n volInfo.setCreationDateTime(new java.util.Date());\n }\n \n // Return the volume information\n \n return volInfo;\n }", "Long diskSizeBytes();", "public double getHardDisk()\n\t{\n\t\treturn hardDiskSize;\n\t}", "public String getVolumeDiskId() {\n return this.volumeDiskId;\n }", "public Long get_cachenummbwrittentodisk() throws Exception {\n\t\treturn this.cachenummbwrittentodisk;\n\t}", "public int[] getSectors() {\n return sectors;\n }", "public int getDiskUtil() {\n\t\treturn getSize();\n\t}", "public Long get_cachenummbsavedondisk() throws Exception {\n\t\treturn this.cachenummbsavedondisk;\n\t}", "public boolean updateDiskStats() {\n boolean diskFound = false;\n switch (SystemInfo.getCurrentPlatformEnum()) {\n case WINDOWS:\n diskFound = oshi.hardware.platform.windows.WindowsDisks.updateDiskStats(this.diskStore);\n break;\n case LINUX:\n diskFound = oshi.hardware.platform.linux.LinuxDisks.updateDiskStats(this.diskStore);\n break;\n case MACOSX:\n diskFound = oshi.hardware.platform.mac.MacDisks.updateDiskStats(this.diskStore);\n break;\n case SOLARIS:\n diskFound = oshi.hardware.platform.unix.solaris.SolarisDisks.updateDiskStats(this.diskStore);\n break;\n case FREEBSD:\n diskFound = oshi.hardware.platform.unix.freebsd.FreeBsdDisks.updateDiskStats(this.diskStore);\n break;\n default:\n LOG.error(\"Unsupported platform. No update performed.\");\n break;\n }\n return diskFound;\n }", "public void readSector(TransID tid, int sectorNum, byte buffer[])\n throws IOException, IllegalArgumentException, \n IndexOutOfBoundsException{\t\t\t\t\t\t\t\t// Not quite done yet\n\t try{\n\t\t ADisk_lock.lock();\n\n\t\t readTid = tid.getTidfromTransID();\n readSector = sectorNum;\n d.startRequest(Disk.READ, tid.getTidfromTransID(), sectorNum, buffer);\n readWait();\n \n wblist.checkRead(sectorNum, buffer);\n Transaction temp = atranslist.get(tid);\n if(temp != null)\n \t temp.checkRead(sectorNum, buffer);\n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n }", "private int getDisk_wrapper() {\n int result = WsResultType.Success;\n ArrayList<WsFolder> r_wsFolder = new ArrayList<WsFolder>();\n result = ClientWS.getInstance(mContext).getDisk(r_wsFolder);\n for (WsFolder ws_f : r_wsFolder) {\n CloudFile f = new CloudFile();\n f.setFileType(CloudFileType.TYPE_FOLDER);\n f.setRemote_id(ws_f.ID);\n f.setFilePath(ws_f.Name);\n mFolderList.add(f);\n }\n return result;\n }", "boolean hasGcePersistentDiskCsiDriverConfig();", "public String getDiskFileName() {\n return diskFileName;\n }", "String getMountedDiskImageFileUri() {\n return mountedDiskImageFileUri;\n }", "public void setSector(java.lang.CharSequence value) {\n this.sector = value;\n }", "public Hashtable getAllFileDisks(String node) throws IOException {\r\n return getAllAttributesValues(node + \"-dir\");\r\n }", "public void setIsBootDisk(Boolean isBootDisk) {\n this.isBootDisk = isBootDisk;\n }", "private void updateStatusInternal(){\n\t\tFile dataPath = Environment.getDataDirectory();\n\t\tStatFs stat = new StatFs(dataPath.getPath());\n\t\tlong blockSize = stat.getBlockSize();\n\t\tlong availableBlocks = stat.getAvailableBlocks();\n\t\t//show the space of internal storage\n\t\tmExternalTotalSpace=formatSize(availableBlocks * blockSize);\n\t}", "@Override\r\n\tpublic int getVDevInfo() {\r\n\t\treturn 0x08100302; // Diag-x24 Ry on VM/370R6 Sixpack 1.2 for a 3420 as 181 with or without a mounted tape\r\n\t}", "public void setKos(DicomObject dcm) throws IOException\n {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n\t\tDicomOutputStream dout = new DicomOutputStream(bos);\n\t\t\n\t\tthis.kosSopInstanceUid = dcm.getString(Tag.SOPInstanceUID);\n\t\t\n\t\tFileMetaInformation kosFmi =\n\t\t\t\tnew FileMetaInformation(UID.KeyObjectSelectionDocumentStorage, \n\t\t\t\t\t\tkosSopInstanceUid, UID.ImplicitVRLittleEndian);\n\t\tdout.writeFileMetaInformation(kosFmi.getDicomObject());\n\t\t\n\t\tdout.writeDataset(dcm, UID.ImplicitVRLittleEndian);\n\t\t\n\t\tdout.close();\n\t\tkosBytes = bos.toByteArray();\n }", "public int GetDiskUsed (final StreamVersion rkVersion)\r\n {\r\n return super.GetDiskUsed(rkVersion) +\r\n Stream.SIZEOF_BOOLEAN + //sizeof(char) + // Enabled\r\n Stream.SIZEOF_INT + //sizeof(int) + // FrontFace\r\n Stream.SIZEOF_INT; //sizeof(int); // CullFace\r\n }", "public int getLogicalDiskSizeInGB() {\n return this.logicalDiskSizeInGB;\n }", "public int getLogicalDiskSizeInGB() {\n return this.logicalDiskSizeInGB;\n }", "public Long get_cachenummbreadfromdisk() throws Exception {\n\t\treturn this.cachenummbreadfromdisk;\n\t}", "public int get_sectors_per_track(int drive, int physical_side);", "private static boolean readReadWriteFile() {\n File mountFile = new File(\"/proc/mounts\");\n StringBuilder procData = new StringBuilder();\n if (mountFile.exists()) {\n try {\n FileInputStream fis = new FileInputStream(mountFile.toString());\n DataInputStream dis = new DataInputStream(fis);\n BufferedReader br = new BufferedReader(new InputStreamReader(\n dis));\n String data;\n while ((data = br.readLine()) != null) {\n procData.append(data).append(\"\\n\");\n }\n\n br.close();\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n\n String[] tmp = procData.toString().split(\"\\n\");\n for (String aTmp : tmp) {\n // Kept simple here on purpose different devices have\n // different blocks\n if (aTmp.contains(\"/dev/block\")\n && aTmp.contains(\"/system\")) {\n if (aTmp.contains(\"rw\")) {\n // system is rw\n return true;\n } else if (aTmp.contains(\"ro\")) {\n // system is ro\n return false;\n } else {\n return false;\n }\n }\n }\n }\n return false;\n }", "public boolean isMounted();", "public File getDrive(){\n return drv;\n }", "public export.serializers.avro.DeviceInfo.Builder setSector(java.lang.CharSequence value) {\n validate(fields()[2], value);\n this.sector = value;\n fieldSetFlags()[2] = true;\n return this;\n }", "public long getFreeDiskSpace() {\n\n\t// Get the data of the BAM.\n\tbyte [] bamData = getSector( 18, 0).getDataBytes();\n\n\tlong result = 0L; // Buffer for the result.\n\n\t// Just count the set bits from 0x04 to 0x8f.\n\tfor( int currentByteIndex = 0x04; currentByteIndex <= 0x8f; ++currentByteIndex) {\n\t \n\t // Get the current byte from the BAM.\n\t byte currentBamByte = bamData[ currentByteIndex];\n\n\t // Count the set bits in the current byte.\n\t for( int currentBit = 1; currentBit <= 0x80; currentBit <<= 1) {\n\n\t\tif( ( currentBamByte & currentBit) != 0) { // Is this block available?\n\n\t\t // Yes => add this free sector to the result;\n\t\t result += getUnitSize();\n\t\t}\n\t }\n\t}\n\n\treturn result; // Return the result.\n }", "public void testDiskIO() {\n DiskIOThreadPool threadPool = cache.getThreadPool();\n final int N = 103 + rng.nextInt(256);\n byte[][] data = new byte[N][];\n byte[][] key = new byte[N][];\n NodeID[] id = new NodeID[N];\n\n PutBack[] putBack = new PutBack[N];\n for (int i = 0; i < N; i++) {\n int len = 64 + rng.nextInt(128);\n data[i] = new byte[len];\n rng.nextBytes(data[i]);\n key[i] = sha1.digest(data[i]);\n id[i] = new NodeID(key[i]);\n putBack[i] = new PutBack();\n cache.acceptWriteJob(id[i], data[i], putBack[i]);\n }\n waitForCallBacks(putBack);\n for (int i = 0; i < N ; i++) {\n assertEquals(\"callback \" + i + \" not OK: \",\n CallBack.OK, putBack[i].status);\n }\n GetBack[] getBack = new GetBack[N];\n for (int i = 0; i < N; i++) {\n getBack[i] = new GetBack();\n cache.acceptReadJob(id[i], getBack[i]);\n }\n waitForCallBacks(getBack);\n for (int i = 0; i < N ; i++ ) {\n assertEquals(CallBack.OK, getBack[i].status);\n byte[] diskData = getBack[i].data;\n assertNotNull(diskData);\n assertEquals(data[i].length, diskData.length);\n for (int j = 0; j < data[i].length; j++)\n assertEquals (\"data[\" + i + \"][\" + j + \"] discrepency: \",\n data[i][j], diskData[j]);\n }\n }", "public void setDisk(String disk) {\n this.disk = disk == null ? null : disk.trim();\n }", "public static String randomAccessRead() {\n String s = \"\";\n try {\n RandomAccessFile f = new RandomAccessFile(FILES_TEST_PATH, \"r\");\n f.skipBytes(14);\n s = f.readLine();\n f.close();\n } catch(Exception e) {\n e.printStackTrace();\n }\n return s;\n }", "protected DiskData getDiskData(String sessionIdentifier, boolean create)\n\t{\n\t\tif (!create)\n\t\t{\n\t\t\treturn diskDatas.get(sessionIdentifier);\n\t\t}\n\n\t\tDiskData data = new DiskData(this, sessionIdentifier);\n\t\tDiskData existing = diskDatas.putIfAbsent(sessionIdentifier, data);\n\t\treturn existing != null ? existing : data;\n\t}", "private void readSuperblock() {\n byte blockInfo[] = new byte[Disk.blockSize];\n\n // read in all of the block info into blockInfo buffer\n SysLib.rawread(0, blockInfo);\n\n // read the number of disk blocks from blockInfo\n this.totalBlocks = SysLib.bytes2int(blockInfo, 0);\n this.totalINodes = SysLib.bytes2int(blockInfo, 4);\n this.freeListTail = SysLib.bytes2int(blockInfo, 8);\n this.freeListTail = SysLib.bytes2int(blockInfo, 12);\n }", "public void\tread_sector_data_into_buffer(int drive, int side,int data_id,char[] buf, int length);", "public boolean isStorageCardReadOnly() {\n return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED_READ_ONLY);\n }", "public Long get_cachenumobjsavedondisk() throws Exception {\n\t\treturn this.cachenumobjsavedondisk;\n\t}", "public static String readDiskMemory(String address){\n\t\treturn memory.get(address);\n\t}", "private void updateStatusNandflash(){\n\t\tString status = StorageUtils.getFlashState();\n\t\tString readOnly = \"\";\n\t\tif (status.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {\n\t\t\tstatus = Environment.MEDIA_MOUNTED;\n\t\t\treadOnly = getResources().getString(R.string.read_only);\n\t\t}\n\n\t\t// Calculate the space of SDcard\n\t\tif (status.equals(Environment.MEDIA_MOUNTED)) {\n\t\t\ttry {\n\t\t\t\tString path = StorageUtils.getFlashDir();\n\t\t\t\tStatFs stat = new StatFs(path);\n\t\t\t\tlong blockSize = stat.getBlockSize();\n\t\t\t\tlong totalBlocks = stat.getBlockCount();\n\t\t\t\tlong availableBlocks = stat.getAvailableBlocks();\n\t\t\t\tmNANDTotalSpace=formatSize(totalBlocks * blockSize);\n\t\t\t\tmNANDAvailableSpace=formatSize(availableBlocks * blockSize) + readOnly;\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tstatus = Environment.MEDIA_REMOVED;\n\t\t\t\tmNANDTotalSpace=getResources().getString(R.string.nand_unavailable);\n\t\t\t\tmNANDAvailableSpace=getResources().getString(R.string.nand_unavailable);\n\t\t\t}\n\t\t}else{\n\t\t\tmNANDTotalSpace=getResources().getString(R.string.nand_unavailable);\n\t\t\tmNANDAvailableSpace=getResources().getString(R.string.nand_unavailable);\n\t\t}\n\t}", "@Override\n\tpublic String getHDD() {\n\t\treturn null;\n\t}", "public Integer getIdSector() {\r\n\t\treturn idSector;\r\n\t}", "public DiskRequest getRequest () { return this.request; }", "public boolean isDICOM_ver2() throws IOException {\r\n if (raFile == null) {\r\n return false;\r\n }\r\n raFile.seek(0);\r\n boolean endianess = FileBase.LITTLE_ENDIAN;\r\n\r\n // read first byte\r\n byte b = raFile.readByte();\r\n if (b == 8) {\r\n b = raFile.readByte();\r\n if (b == 0) {\r\n // could be dicom 2...need to find at least 1 more 08\r\n // endianess is LITTLE ENDIAN\r\n endianess = FileBase.LITTLE_ENDIAN;\r\n } else {\r\n // definitely not dicom 2....since the first tag is not 08\r\n return false;\r\n }\r\n } else {\r\n if (b == 0) {\r\n b = raFile.readByte();\r\n if (b == 8) {\r\n // could be dicom 2...need to find at least 1 more 08\r\n // endianess is BIG ENDIAN\r\n endianess = FileBase.BIG_ENDIAN;\r\n } else {\r\n // definitely not dicom 2....since the first tag is not 08\r\n return false;\r\n }\r\n } else {\r\n // definitely not dicom 2....since the first tag is not 08\r\n return false;\r\n }\r\n }\r\n\r\n // skip next 2 bytes\r\n raFile.skipBytes(2);\r\n\r\n // read in length...4 bytes long\r\n final byte[] byteBuffer = new byte[4];\r\n int skipLength;\r\n if (endianess == FileBase.LITTLE_ENDIAN) {\r\n byteBuffer[3] = raFile.readByte();\r\n byteBuffer[2] = raFile.readByte();\r\n byteBuffer[1] = raFile.readByte();\r\n byteBuffer[0] = raFile.readByte();\r\n\r\n skipLength = ( (byteBuffer[0] & 0xff) << 24) | ( (byteBuffer[1] & 0xff) << 16)\r\n | ( (byteBuffer[2] & 0xff) << 8) | (byteBuffer[3] & 0xff);\r\n } else {\r\n byteBuffer[0] = raFile.readByte();\r\n byteBuffer[1] = raFile.readByte();\r\n byteBuffer[2] = raFile.readByte();\r\n byteBuffer[3] = raFile.readByte();\r\n\r\n skipLength = ( (byteBuffer[0] & 0xff) << 24) | ( (byteBuffer[1] & 0xff) << 16)\r\n | ( (byteBuffer[2] & 0xff) << 8) | (byteBuffer[3] & 0xff);\r\n }\r\n\r\n // skip over the length\r\n raFile.skipBytes(skipLength);\r\n\r\n if (endianess == FileBase.LITTLE_ENDIAN) {\r\n b = raFile.readByte();\r\n if (b == 8) {\r\n b = raFile.readByte();\r\n if (b == 0) {\r\n // is dicom...since we have at least 2 08 tags\r\n return true;\r\n } else {\r\n // not dicom\r\n return false;\r\n }\r\n } else {\r\n // not dicom\r\n return false;\r\n }\r\n } else {\r\n b = raFile.readByte();\r\n if (b == 0) {\r\n b = raFile.readByte();\r\n if (b == 8) {\r\n // is dicom...since we have at least 2 08 tags\r\n return true;\r\n } else {\r\n // not dicom\r\n return false;\r\n }\r\n } else {\r\n // not dicom\r\n return false;\r\n }\r\n }\r\n }", "public boolean isStorageDeviceProtected() { throw new RuntimeException(\"Stub!\"); }", "public Vector getSectorPosition(){\n\t\treturn this.sectorPos;\n\t}", "@Override\n\tpublic List<String> listSector() {\n\t\treturn repository.distinctSector();\n\t}", "public boolean isReadOnly(SrvSession sess, DeviceContext ctx)\n throws IOException {\n return false;\n }", "public void format( RawDisk disk) {\n \tthis.tempDisk.format();\n }", "public byte getSystem() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readByte(__io__address + 4);\n\t\t} else {\n\t\t\treturn __io__block.readByte(__io__address + 4);\n\t\t}\n\t}", "public synchronized static int findEmptyPartition() {\n int index = NOT_FOUND; // no empty /dev/nbd partition is found\n File file = null;\n\n for (int i = 0; i < NBD_MAX_PART; i++) {\n // means the /dev/nbd[i] is available to map or bind an image\n file = new File(\"/dev/nbd\" + i + \"p\" + PARTITION_NUM);\n if (file.exists() == false) {\n index = i;\n break;\n }\n }\n\n // If all /dev/nbd partitions are busy, then force unmount /dev/nbd0\n if (index == NOT_FOUND) {\n LOG.debug(\"ics.core.io.FileUtils.findEmptyPartition(): Can't find an empty partition. Force unmount /dev/nbd0\");\n\n String command1 = \"sudo umount /dev/nbd0p1\";\n ProcessResult result = ShellUtil.executeShellCommand(command1);\n if (result.getExitCode() != 0) {\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Process exited abnormally. Exit code: \"\n + result.getExitCode());\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Output:\\n\"\n + result.getStandardError());\n }\n\n String command2 = \"sudo qemu-nbd -d /dev/nbd0\";\n result = ShellUtil.executeShellCommand(command2);\n if (result.getExitCode() != 0) {\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Process exited abnormally. Exit code: \"\n + result.getExitCode());\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Output:\\n\"\n + result.getStandardError());\n }\n }\n\n LOG.debug(\"ics.core.io.FileUtils.findEmptyPartition(): Empty partition at /dev/nbd\"\n + index);\n return index;\n }", "public static List<SDCardInfo> getSDCardInfo(Context context) {\n List<SDCardInfo> paths = new ArrayList<>();\n StorageManager sm = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);\n if (sm == null) return paths;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {\n List<StorageVolume> storageVolumes = sm.getStorageVolumes();\n try {\n //noinspection JavaReflectionMemberAccess\n Method getPathMethod = StorageVolume.class.getMethod(\"getPath\");\n for (StorageVolume storageVolume : storageVolumes) {\n boolean isRemovable = storageVolume.isRemovable();\n String state = storageVolume.getState();\n String path = (String) getPathMethod.invoke(storageVolume);\n paths.add(new SDCardInfo(path, state, isRemovable));\n }\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n return paths;\n\n } else {\n try {\n Class<?> storageVolumeClazz = Class.forName(\"android.os.storage.StorageVolume\");\n //noinspection JavaReflectionMemberAccess\n Method getPathMethod = storageVolumeClazz.getMethod(\"getPath\");\n Method isRemovableMethod = storageVolumeClazz.getMethod(\"isRemovable\");\n //noinspection JavaReflectionMemberAccess\n Method getVolumeStateMethod = StorageManager.class.getMethod(\"getVolumeState\", String.class);\n //noinspection JavaReflectionMemberAccess\n Method getVolumeListMethod = StorageManager.class.getMethod(\"getVolumeList\");\n Object result = getVolumeListMethod.invoke(sm);\n final int length = Array.getLength(result);\n for (int i = 0; i < length; i++) {\n Object storageVolumeElement = Array.get(result, i);\n String path = (String) getPathMethod.invoke(storageVolumeElement);\n boolean isRemovable = (Boolean) isRemovableMethod.invoke(storageVolumeElement);\n String state = (String) getVolumeStateMethod.invoke(sm, path);\n paths.add(new SDCardInfo(path, state, isRemovable));\n }\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n return paths;\n }\n }", "public static long getAvailableDiskSpace() {\r\n\t\treturn availableDiskSpace;\r\n\t}", "@Deprecated\r\n\tpublic String readDeviceID(){\r\n\t\treturn mFactoryBurnUtil.readDeviceID();\r\n\t}", "private static boolean isInSafeMode(DistributedFileSystem dfs) throws IOException {\n return dfs.setSafeMode(SAFEMODE_GET, true);\n }", "public byte [] getKos()\n {\n return kosBytes;\n }", "@Override\n public String toString() {\n String returnable = \"\";\n int count = 0;\n int[] localSectors = sectors;\n \n for (int i = 0; i < sectors.length; i++) {\n \n if(count % 20 == 0 && count != 0) {\n returnable += \"\\n\";\n }\n returnable += localSectors[i];\n count++;\n }\n return returnable;\n }", "private Map<String, Object> getSectorData() {\r\n Map<String, Object> data = new LinkedHashMap<String, Object>();\r\n for (String key : sectorData) {\r\n if (lineData.containsKey(key)) {\r\n if (channelMap.containsKey(key)) {\r\n channelMap.put(key, channelMap.get(key) + 1);\r\n }\r\n data.put(key, lineData.get(key));\r\n }\r\n }\r\n return data;\r\n }", "private void setCurrSector ()\r\n\t{\r\n\t\tdouble rotTime = config.getRotTime();\r\n\t\tdouble rotPct = (double)(this.simTime % (long)rotTime) / rotTime;\r\n\t\tthis.sector = (int)Math.round(rotPct * config.getSectors());\r\n\t}", "public java.lang.String getDiskControllerType() {\r\n return diskControllerType;\r\n }", "public List<DataDiskImageEncryption> dataDiskImages() {\n return this.dataDiskImages;\n }", "public void sync()\n {\n byte[] blockData = new byte[Disk.blockSize];\n SysLib.int2bytes(totalBlocks, blockData, 0);\n SysLib.int2bytes(inodeBlocks, blockData, 4);\n SysLib.int2bytes(freeList, blockData, 8);\n SysLib.rawwrite(0, blockData);\n }", "public static MountInfo getSecondaryStorageInfo() {\n File sd = getRemovableStorage();\n if (sd == null) {\n return null;\n };\n try {\n MountInfo mountInfo = new MountInfo();\n mountInfo.mpoint = sd.getAbsolutePath();\n StatFs statFs = new StatFs(mountInfo.mpoint);\n long total = ((long) statFs.getBlockCount() * (long) statFs.getBlockSize());\n long free = (statFs.getAvailableBlocks() * (long) statFs.getBlockSize());\n mountInfo.used = total - free;\n mountInfo.free = free;\n mountInfo.total = total;\n return mountInfo;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "@Resource(resourceId = 2216, operation = Operation.Read)\n public Long readVolume()\t{\n ActionInvocation actionInvocation =\n new ActionInvocation(renderingControlService.getAction(ACTION_GET_VOLUME));\n actionInvocation.setInput(ARG_INSTANCE_ID, new UnsignedIntegerFourBytes(0));\n actionInvocation.setInput(ARG_CHANNEL, VALUE_CHANNEL_MASTER);\n Map<String, ActionArgumentValue> output = UpnpController.getInstance().executeUpnpAction(actionInvocation);\n return ((UnsignedIntegerTwoBytes)output.get(ARG_CURRENT_VOLUME).getValue()).getValue();\n }", "@Override\n\tpublic void shutDown() {\n\t\tSystem.out.println(\"disk shutdown!\");\n\t}", "private void checkState() {\n\tstate=Environment.getExternalStorageState();\n // now cheak what state is if we can access to sd card or not\n if (state.equals(Environment.MEDIA_MOUNTED))//MEDIA_MOUNTED it mean we can read and write\n {\t\n\t CanR=CanW=true;\n }\n else if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY))\n { // read but not write\n \t\n\t\tCanW=false;\n\t\tCanR=true;}\n\t\telse \n\t\t\t//it can't read or write\n\t\t{\n\t\tCanR=CanW=false;}\n\t\n}", "public String getATA_CD() {\n return ATA_CD;\n }", "public void\twrite_sector_data_from_buffer(int drive, int side,int data_id, char[] buf, int length, int ddam);", "private Sector getSectorForBlockIndex( int blockIndex) {\n\n\t// The block index of the first sector of each track.\n\tint [] trackStart = { 0, 21, 42, 63, 84, 105, 126, 147\n\t\t\t , 168, 189, 210, 231, 252, 273, 294, 315\n\t\t\t , 336, 357, 376, 395, 414, 433, 452, 471\n\t\t\t , 490, 508, 526, 544, 562, 580, 598, 615\n\t\t\t , 632, 649, 666, 683, 700, 717, 734, 751\n\t\t\t , 768 };\n\tint currentTrackIndex = 0;\n\tfor( int currentTrackStart : trackStart) {\n\t \n\t if( blockIndex < currentTrackStart) {\n\t\tbreak;\n\t }\n\n\t ++currentTrackIndex; // Check the next track\n\t}\n\n\t// Check, if the track is within a reasonable range.\n\tif( ( currentTrackIndex < 1) || ( currentTrackIndex > 40)) {\n\t \n\t return null; // Ignore tracks > 40 for now.\n\t}\n\n\t// Calculate the sector offset.\n\tint sectorIndex = blockIndex - trackStart[ currentTrackIndex - 1];\n\t\n\t// Try to find the sector with the given track and sector index in this image.\n\treturn getSector( currentTrackIndex, sectorIndex);\n }", "public void sync()\n\t{\n\t\tbyte[] buffer = new byte[Disk.blockSize];\n\n\t\t// Write the totalBlocks, totalInodes, and freeList.\n\t\tSysLib.int2bytes(totalBlocks, buffer, 0);\n\t\tSysLib.int2bytes(totalInodes, buffer, 4);\n\t\tSysLib.int2bytes(freeList, buffer, 8);\n\t\tSysLib.int2bytes(lastFreeBlock, buffer, 12);\n\n\t\t// Write the block back to disk.\n\t\tSysLib.rawwrite(0, buffer);\n\t}" ]
[ "0.6900715", "0.66873854", "0.65194964", "0.6460812", "0.6400139", "0.6340732", "0.6296725", "0.6179094", "0.6078929", "0.5931708", "0.5918935", "0.5902283", "0.58916986", "0.58803916", "0.58408034", "0.57803315", "0.5761086", "0.575453", "0.5623968", "0.56160027", "0.55927896", "0.5583991", "0.55746096", "0.55580443", "0.54801667", "0.54667634", "0.54553795", "0.54537123", "0.54360133", "0.53862643", "0.5383629", "0.5339832", "0.5338763", "0.5330317", "0.5322468", "0.5314059", "0.53100765", "0.5292869", "0.5271833", "0.52702", "0.5267348", "0.52532244", "0.5252247", "0.5250645", "0.5217344", "0.5205678", "0.5168669", "0.51521987", "0.51493156", "0.5138689", "0.5127912", "0.5119398", "0.5119398", "0.51131517", "0.51125026", "0.51094997", "0.51055723", "0.50911313", "0.5082719", "0.50809926", "0.5079895", "0.5059227", "0.505917", "0.50588375", "0.5051715", "0.50455743", "0.5028953", "0.5023239", "0.5008547", "0.5007969", "0.49986544", "0.49845386", "0.49810565", "0.49743342", "0.4973157", "0.49713144", "0.49591058", "0.49498296", "0.49420717", "0.49312416", "0.49256042", "0.4920032", "0.491266", "0.48988298", "0.48954216", "0.4880242", "0.48740664", "0.48714706", "0.48557633", "0.48492977", "0.48460442", "0.48450652", "0.48347923", "0.48339173", "0.48197776", "0.4819594", "0.48131162", "0.4810931", "0.4804952", "0.48008505" ]
0.65300167
2
Buffer the specified update as part of the inmemory state of the specified transaction. Don't write anything to disk yet. Concurrency: The final value of a sector must be the value written by the transaction that commits the latest. Throws IllegalArgumentException if tid does not refer to an active transaction or buffer is too small to hold a sector. IndexOutOfBoundsException if sectorNum is not a valid sector number
public void writeSector(TransID tid, int sectorNum, byte buffer[]){ atranslist.get(tid).addWrite(sectorNum, buffer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void commit(int tid) {\n List<Lock> lockList = null;\n\n // check wheter there is read-only transaction running\n boolean hasRO = _tm.hasRunningReadonly();\n for (Integer varIndex : _lockTable.keySet()) {\n lockList = _lockTable.get(varIndex);\n int size = lockList.size();\n for (int i = size - 1; i >= 0; i--) {\n Lock lc = lockList.get(i);\n if (lc.getTranId() == tid) {\n\n // If the lock type is write, means this transaction writes a variable\n // in uncommitDataMap\n if (lc.getType() == Lock.Type.WRITE) {\n if (_uncommitDataMap.containsKey(varIndex)) {\n List<Data> dataList = _dataMap.get(varIndex);\n Data d = _uncommitDataMap.get(varIndex);\n d.setCommitTime(_tm.getCurrentTime());\n\n // If no read-only transaction, replace the old version\n if (!hasRO) {\n dataList.clear();\n }\n dataList.add(d);\n _uncommitDataMap.remove(varIndex);\n }\n }\n lockList.remove(i);\n break;\n }\n }\n }\n // remove this transaction from accessed list\n _accessedTransactions.remove(tid);\n }", "public void readSector(TransID tid, int sectorNum, byte buffer[])\n throws IOException, IllegalArgumentException, \n IndexOutOfBoundsException{\t\t\t\t\t\t\t\t// Not quite done yet\n\t try{\n\t\t ADisk_lock.lock();\n\n\t\t readTid = tid.getTidfromTransID();\n readSector = sectorNum;\n d.startRequest(Disk.READ, tid.getTidfromTransID(), sectorNum, buffer);\n readWait();\n \n wblist.checkRead(sectorNum, buffer);\n Transaction temp = atranslist.get(tid);\n if(temp != null)\n \t temp.checkRead(sectorNum, buffer);\n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n }", "public void readSectorDiskOnly(TransID tid, int sectorNum, byte buffer[])\n throws IOException, IllegalArgumentException, \n IndexOutOfBoundsException{\t\t\t\t\t\t\t\t// Not quite done yet\n\t try{\n\t\t ADisk_lock.lock();\n\n\t readTid = tid.getTidfromTransID();\n\t readSector = sectorNum;\n d.startRequest(Disk.READ, tid.getTidfromTransID(), sectorNum, buffer);\n readWait();\n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n}", "public void commitTransaction(TransID tid) \n throws IOException, IllegalArgumentException{// Not yet complete\n\t try {\n\t\t ADisk_lock.lock();\n\t\t // Call commit\n\t\t atranslist.get(tid).commit();\n\t\t Transaction temp = atranslist.remove(tid);\n\t\t wblist.addCommitted(temp);\t \n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n }", "protected void txPut(int n) {}", "public abstract void update(byte[] buf, int off, int len);", "public void\twrite_sector_data_from_buffer(int drive, int side,int data_id, char[] buf, int length, int ddam);", "private void updateBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(UPDATE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\t// impossible to start updating from offset larger than max size of file\r\n\t\t// this however does not imply that the file length can not change\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid();\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile) selectedFile).getMaxSize();\r\n\t\tif (offset > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// number of bytes in file starting from offset\r\n\t\t// short remaining = (short) (size - offset);\r\n\t\t// get the new data\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc == 0) || (byteRead == 0))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// update file\r\n\t\tif (offset < 0 || ISO7816.OFFSET_CDATA + lc > buffer.length || offset + lc > size)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t((ElementaryFile) selectedFile).updateData(offset, buffer, ISO7816.OFFSET_CDATA, lc);\r\n\t\t// //@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "void writeBlock(int blockId, byte[] buffer, int offset) throws IOException;", "public void\tread_sector_data_into_buffer(int drive, int side,int data_id,char[] buf, int length);", "@Override\n\t\tpublic CompletableFuture<Void> write(byte[] buffer, long offset) {\n\t\t\t\n\t\t\tsynchronized(roleSwitcherThread) {\n\t\t\t\tif (!RockyController.role.equals(RockyControllerRoleType.Owner)) {\n\t\t\t\t\tSystem.err.println(\"ASSERT: write can be served only by the Owner\");\n\t\t\t\t\tSystem.err.println(\"currently, my role=\" + RockyController.role);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (debugPrintoutFlag) {\n\t\t\t\tSystem.out.println(\"write entered. buffer size=\" + buffer.length);\n\t\t\t\tSystem.out.println(\"offset=\" + offset);\n\t\t\t}\n\t\t\t\n\t\t\tlong firstBlock = offset / blockSize;\n\t\t\tint length = buffer.length;\n\t\t long lastBlock = 0;\n\t\t if (length % blockSize == 0) {\n\t\t \tlastBlock = (offset + length) / blockSize - 1;\n\t\t } else {\n\t\t \tlastBlock = (offset + length) / blockSize;\n\t\t }\n\t\t //long lastBlock = (offset + length) / blockSize;\n\t\t \n\t\t if (debugPrintoutFlag) {\n\t\t \tSystem.out.println(\"firstBlock=\" + firstBlock + \" lastBlock=\" + lastBlock + \" length=\" + length);\n\t\t }\n\t\t \t\n\t\t if (mutationSnapEvalFlag) {\n\t\t \tnumBlockWrites += (int) (lastBlock - firstBlock + 1);\n\t\t }\n\t\t \n//\t\t // we assume that buffer size to be blockSize when it is used\n//\t\t // as a block device properly. O.W. it can be smaller than that.\n//\t\t // To make it compatible with the original intention, when \n//\t\t // we get buffer smaller than blockSize, we increment the loastBlock\n//\t\t // by one.\n//\t\t if (firstBlock == lastBlock) {\n//\t\t \tlastBlock++; \n//\t\t }\n//\t\t for (int i = (int) firstBlock; i < (int) lastBlock; i++) {\n\t \tfor (int i = (int) firstBlock; i <= (int) lastBlock; i++) {\n\t \t\tif (debugPrintoutFlag) {\n\t \t\t\tSystem.out.println(\"setting dirtyBitmap for blockID=\" + i);\n\t \t\t}\n\t \t\tsynchronized(dirtyBitmap) {\n\t\t \t\tdirtyBitmap.set(i);\n\t\t \t}\n\t\t \tWriteRequest wr = new WriteRequest();\n\t\t \tint copySize = 0;\n\t\t \tif (i == lastBlock) {\n\t\t \t\tif (debugPrintoutFlag) {\n\t\t \t\t\tSystem.out.println(\"copySize first\");\n\t\t \t\t}\n\t\t \t\tint residual = buffer.length % blockSize;\n\t\t \t\tif (residual == 0) {\n\t\t \t\t\tcopySize = blockSize;\n\t\t \t\t} else {\n\t\t \t\t\tcopySize = residual;\n\t\t \t\t}\n\t\t \t} else {\n\t\t \t\tif (debugPrintoutFlag) {\n\t\t \t\t\tSystem.out.println(\"copySize second\");\n\t\t \t\t}\n\t\t \t\tcopySize = blockSize;\n\t\t \t}\n\t\t \tbyte[] copyBuf = new byte[copySize];\n\t\t \tif (debugPrintoutFlag) {\n\t\t \t\tSystem.out.println(\"copySize=\" + copySize);\n\t\t \t}\n\t\t \tint bufferStartOffset = (int) ((i - firstBlock) * blockSize);\n\t\t \tif (debugPrintoutFlag) {\n\t\t \t\tSystem.out.println(\"bufferStartOffset=\" + bufferStartOffset + \" i=\" + i + \" firstBlock=\" + firstBlock + \" blockSize=\" + blockSize);\n\t\t \t}\n\t\t \tSystem.arraycopy(buffer, (int) ((i - firstBlock) * blockSize), copyBuf, 0, copySize);\n\t\t \twr.buf = copyBuf;\n\t\t \t//wr.offset = offset;\n\t\t\t wr.offset = i * blockSize;\n\t\t\t try {\n\t\t\t \t//System.out.println(\"[RockyStorage] enqueuing WriteRequest for blockID=\" \n\t\t\t \t//\t\t+ ((int) wr.offset / blockSize));\n\t\t\t\t\tqueue.put(wr);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t\treturn super.write(buffer, offset);\n\t\t}", "void writeBlock(int blockId, byte[] buffer) throws IOException;", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for proj1\n\n \t\n \t//commit, flush the pages\n \tif(commit){\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tflushPage(pageId);\n \t\t\t\tpage.setBeforeImage();\n \t\t\t}\n\n if (page.isDirty() == null) {\n page.setBeforeImage();\n }\n \t\t\t\n \t\t}\n \t}\n \telse{\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page, revert changes\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tNode n = bufferedPages.get(pageId);\n \t\t\t\tn.page = page.getBeforeImage();\n \t\t\t\tbufferedPages.put(pageId, n);\n // updateLruWithNewNode(pageId, page.getBeforeImage());\n \t\t\t}\n \t\t\t\n \t\t}\n \t}\n \t\n \t//release the lock\n \tlockManager.releaseAllTransactionLocks(tid);\n \tcurrentTransactions.remove(tid);\n \t\n }", "public void put(T bufferItem);", "public GlBuffer commit(final Chunk<E> chunk, boolean push){\n //Log.d(TAG,\"update(\"+chunk+\", \"+commit+\")\");\n\t\tint startPosition = 0;\n\t\tint offset = this.stride;\n switch(this.datatype){\n case TYPE_FLOAT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectFloatBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n }\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((FloatBuffer) this.buffer).put(((float[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n case TYPE_INT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectIntBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((IntBuffer) this.buffer).put(((int[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n case TYPE_SHORT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectShortBuffer(this.size >> 1);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 1;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ShortBuffer) this.buffer).put(((short[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n default :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectByteBuffer(this.size);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ByteBuffer) this.buffer).put(((byte[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n\n //Update server if needed\n if(push){\n push();\n }\n\n return this;\n }", "public boolean set(final int index, final ByteBuffer buf) {\n\t\tif (!validState) {\n\t\t\tthrow new InvalidStateException();\n\t\t}\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"set(\" + index + \",\" + buf + \")\");\n\t\t}\n\t\ttry {\n\t\t\tif (buf.limit() > blockSize) {\n\t\t\t\tlog.error(\"ERROR: buffer.capacity=\" + buf.limit() + \" > blocksize=\" + blockSize);\n\t\t\t}\n\t\t\tif (useMmap) {\n\t\t\t\tfinal MappedByteBuffer mbb = getMmapForIndex(index);\n\t\t\t\tif (mbb != null) {\n\t\t\t\t\tmbb.put(buf);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// Fallback to RAF\n\t\t\t}\n\t\t\tfileChannel.position(index * blockSize).write(buf);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Exception in set(\" + index + \")\", e);\n\t\t}\n\t\treturn false;\n\t}", "private static void flushInternalBuffer() {\n\n //Strongly set the last byte to \"0A\"(new line)\n if (mPos < LOG_BUFFER_SIZE_MAX) {\n buffer[LOG_BUFFER_SIZE_MAX - 1] = 10;\n }\n\n long t1, t2;\n\n //Save buffer to SD card.\n t1 = System.currentTimeMillis();\n writeToSDCard();\n //calculate write file cost\n t2 = System.currentTimeMillis();\n Log.i(LOG_TAG, \"internalLog():Cost of write file to SD card is \" + (t2 - t1) + \" ms!\");\n\n //flush buffer.\n Arrays.fill(buffer, (byte) 0);\n mPos = 0;\n }", "public void updateBuffer(final int input) {\n\n // Check for null pointers on buffer line\n if(this.buffer.get(lineT).isEmpty() || this.lineT == this.buffer.get(lineT).size()) \n this.buffer.get(lineT).add(input);\n \n else { \n if(this.inputMode) // Insert mode\n this.buffer.get(lineT).add(columnT, input);\n else // Overwrite mode\n this.buffer.get(lineT).set(columnT, input);\n }\n this.columnT++; // Increase one unit column target position\n }", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "public void bufferPacket(UtpTimestampedPacketDTO pkt) throws IOException {\r\n\t\tint sequenceNumber = pkt.utpPacket().getSequenceNumber() & 0xFFFF;\r\n\t\tint position = sequenceNumber - expectedSequenceNumber;\r\n\t\tdebug_lastSeqNumber = sequenceNumber;\r\n\t\tif (position < 0) {\r\n\t\t\tposition = mapOverflowPosition(sequenceNumber);\r\n\t\t}\r\n\t\tdebug_lastPosition = position;\r\n\t\telementCount++;\r\n\t\ttry {\r\n\t\t\tbuffer[position] = pkt;\t\t\t\r\n\t\t} catch (ArrayIndexOutOfBoundsException ioobe) {\r\n\t\t\tlog.error(\"seq, exp: \" + sequenceNumber + \" \" + expectedSequenceNumber + \" \");\r\n\t\t\tioobe.printStackTrace();\r\n\r\n\t\t\tdumpBuffer(\"oob: \" + ioobe.getMessage());\r\n\t\t\tthrow new IOException();\r\n\t\t}\r\n\r\n\t}", "public void i2cTransaction(int deviceAddress, byte[]writeBuf,\n int writeOffset, int writeLen, byte[] readBuf, int readOffset,\n int readLen);", "public GlBuffer commit(final Chunk<E> chunk){\n return commit(chunk, true);\n }", "public void write(Transaction t, int varIndex, int value) {\n int tid = t.getTranId();\n Lock lc = getLock(tid, varIndex);\n if (hasConflict(tid, varIndex, Lock.Type.WRITE)) {\n return;\n }\n if (lc == null) {\n // if transaction holds no lock, set write lock\n setLock(tid, varIndex, Lock.Type.WRITE);\n } else {\n // if transaction holds read lock before, escalate that lock\n if (lc.getType() == Lock.Type.READ) {\n lc.escalateLock();\n }\n }\n _accessedTransactions.add(tid);\n // put it into uncommitDataMap\n if (_uncommitDataMap.containsKey(varIndex)) {\n Data d = _uncommitDataMap.get(varIndex);\n d.setValue(value);\n } else {\n Data d = new Data(varIndex, value);\n _uncommitDataMap.put(varIndex, d);\n }\n }", "@Override\r\n\tpublic Buffer setBuffer(int pos, Buffer b, int offset, int len) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Buffer setBuffer(int pos, Buffer b) {\n\t\treturn null;\r\n\t}", "@Test\n public void testAllDirtySucceeds()\n throws IOException, DbException, TransactionAbortedException {\n HeapFile f = SystemTestUtil.createRandomHeapFile(2, 512 * 10, null, null);\n Database.resetBufferPool(1);\n\n // BEGIN TRANSACTION\n Transaction t = new Transaction();\n t.start();\n\n // Insert a new row\n TransactionTestUtil.insertRow(f, t);\n\n // Scanning the table must fail because it can't evict the dirty page\n try {\n TransactionTestUtil.findMagicTuple(f, t);\n } catch (DbException e) {\n fail(\"Expected scan to run be able to evict buffer pages\");\n }\n t.commit();\n }", "public abstract void Lock(long offset, long len)\n\t\tthrows IOException, SMBException;", "private void updateBlockBuffer() {\n for (Block b : blockBuffer) {\n if (++b.ttl > BLOCK_CACHE_THRESH) {\n blockBuffer.remove(b);\n }\n }\n\n prevBlockBufferSize = blockBuffer.size();\n }", "synchronized void flushAll(int txnum) {\n for (Buffer buff : bufferpool)\n if (buff.isModifiedBy(txnum))\n buff.flush();\n }", "public void setBufferStock(final SessionContext ctx, final long value)\r\n\t{\r\n\t\tsetBufferStock( ctx,Long.valueOf( value ) );\r\n\t}", "synchronized void flushAll(int txnum) {\n\t \n for (ExerciseBuffer buff : bufferpool)\n if (buff.isModifiedBy(txnum))\n buff.flush();\n }", "public GlBuffer commit(final Chunk<E>[] chunks, boolean push){\n\t\t//android.util.//Log.d(TAG,\"update(\"+chunks+\", \"+commit+\")\");\n\t\tint startPosition = 0;\n\t\tint offset = this.stride;\n\t\tswitch(this.datatype){\n\t\t\tcase TYPE_FLOAT :\n\t\t\t\tif(this.buffer == null){\n\t\t\t\t\tthis.buffer = ByteBufferPool.getInstance().getDirectFloatBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((FloatBuffer)this.buffer).put(((float[])chunk.data),compIndex,chunk.components);\n }\n }\n\t\t\t\tbreak;\n case TYPE_INT :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectIntBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((IntBuffer)this.buffer).put(((int[])chunk.data),compIndex,chunk.components);\n }\n }\n break;\n\t\t\tcase TYPE_SHORT :\n\t\t\t\tif(this.buffer == null){\n\t\t\t\t\tthis.buffer = ByteBufferPool.getInstance().getDirectShortBuffer(this.size >> 1);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 1;\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ShortBuffer)this.buffer).put(((short[])chunk.data),compIndex,chunk.components);\n }\n }\n\t\t\t\tbreak;\n default :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectByteBuffer(this.size);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n for(final Chunk<E> chunk : chunks){\n for(int elementIndex=0, compIndex=0; elementIndex < this.count ; elementIndex++, compIndex+=chunk.components){\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ByteBuffer)this.buffer).put(((byte[])chunk.data),compIndex,chunk.components);\n }\n }\n break;\n\t\t}\n\n //Update server if needed\n if(push){\n push();\n }\n\n\t\treturn this;\n\t}", "private synchronized void flushPage(PageId pid) throws IOException {\n // some code goes here\n // not necessary for lab1\n if (bufferPool.pageIdxMap.containsKey(pid)) {\n Page pg = bufferPool.pageIdxMap.get(pid);\n if (pg.isDirty() != null) {\n Database.getCatalog().getDatabaseFile(pg.getId().getTableId()).writePage(pg);\n }\n }\n\n }", "void writeCurrentBuffer();", "public int setBytes(int index, FileChannel in, long position, int length)\r\n/* 896: */ throws IOException\r\n/* 897: */ {\r\n/* 898:904 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 899:905 */ return super.setBytes(index, in, position, length);\r\n/* 900: */ }", "public void diskUpdate(FlockInfo info) {\n/*\nudanax-top.st:16740:FakePacker methodsFor: 'shepherds'!\n{void} diskUpdate: info {FlockInfo | NULL} \n\t\"The flock identified by token is Dirty!! On some later commit, write it to the disk.\"!\n*/\n}", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\n }", "public synchronized void setCommittedTx( long tx )\n {\n waitForSyncConnected();\n this.committedTx = tx;\n String root = getRoot();\n String path = root + \"/\" + machineId + \"_\" + sequenceNr;\n byte[] data = dataRepresentingMe( tx );\n try\n {\n zooKeeper.setData( path, data, -1 );\n }\n catch ( KeeperException e )\n {\n throw new ZooKeeperException( \"Unable to set current tx\", e );\n }\n catch ( InterruptedException e )\n {\n Thread.interrupted();\n throw new ZooKeeperException( \"Interrupted...\", e );\n }\n }", "void use(ByteBuffer buffer, short id);", "private void assignBuffer(List<TupleReaderBinary> buffers, int bufferID) {\n\t\tif (readerBucketID < prevTotalBuckets && readerBucketID < numInputBuffers * currentGroup) {\n\t\t\tTupleReaderBinary readerBinary = new TupleReaderBinary(DatabaseCatalog.getInstance().getTempDirectory()\n\t\t\t\t\t+ \"/\" + instanceHashcode + \"_\" + (passNumber - 1) + \"_\" + readerBucketID);\n\t\t\treaderBinary.keyNames = ordering;\n\t\t\tbuffers.set(bufferID, readerBinary);\n\t\t\treaderBucketID++;\n\t\t} else {\n\t\t\tbuffers.set(bufferID, null);\n\t\t}\n\t}", "public void getBlock(byte[] buffer, short offset, byte sector, byte block,\r\n\t\t\tbyte b_offset, byte b_length) {\n\t\tcheckConditionsToInteroperate(JCSystem.getPreviousContextAID());\r\n\t\timage.checkAccess(sector, block);\r\n\t\timage.getBlock(buffer, offset, sector, block, b_offset, b_length);\r\n\t}", "public void abort(int tid) {\n List<Lock> lockList = null;\n for (Integer varIndex : _lockTable.keySet()) {\n lockList = _lockTable.get(varIndex);\n int size = lockList.size();\n for (int i = size - 1; i >= 0; i--) {\n if (lockList.get(i).getTranId() == tid) {\n if (lockList.get(i).getType() == Lock.Type.WRITE) {\n _uncommitDataMap.remove(varIndex);\n }\n lockList.remove(i);\n break;\n }\n }\n }\n // remove this transaction from accessed list\n _accessedTransactions.remove(tid);\n }", "boolean commitEntryMemTableFlush() throws IOException;", "public abstract void updateBlockRecord();", "public ADisk(boolean format)\n { \n\t // build lock\n\t this.setFailureProb(0);\n ADisk_lock = new SimpleLock();\n waitLock = new SimpleLock();\n atranslist = new ActiveTransactionList();\n //initialize lists and logs\n wblist = new WriteBackList(this);\n commitDone = waitLock.newCondition();\n writebackDone = waitLock.newCondition();\n readDone = waitLock.newCondition();\n logReadDone = waitLock.newCondition();\n wbbarrier = waitLock.newCondition();\n commitBarrierSector = -1;\n commitBarrierTid = -1;\n writebackBarrierSector = -1;\n writebackBarrierTid = -1;\n readSector = -1;\n readTid = -1;\n logReadSector = -1;\n logReadTid = -1;\n wbbarrierSec = -1;\n wbbarrierTag = -1;\n \n\t d = null;\n\t try{\n\t d = new Disk(this);\n\t }\n\t catch(FileNotFoundException fnf){\n\t System.out.println(\"Unable to open disk file\");\n\t System.exit(-1);\n\t }\n\t \n\t //create writeback thread\n\t writebackthread = new WriteBackThread();\n try {\n\t if (format == true){\n\t \t lstatus = new LogStatus(this, false);\n\t \t \n\t \t ///wipe the disk\n\t \t /*byte[] blank = new byte[Disk.SECTOR_SIZE];\n\t \t for(int i = 0; i < Disk.SECTOR_SIZE; i++)\n\t \t \tblank[i] = 0x00;\n\t \t for(int i = 0; i < this.getNSectors(); i++){\n\t \t \tif(i == this.getNSectors() - 1){\n\t \t \t\tthis.commitBarrierSector = i;\n\t \t \t\tthis.commitBarrierTid = Disk.SECTOR_SIZE + 10;\n\t \t \t\td.addBarrier(); // must wait for the entire wipe write to be on disk\n\t \t \t}\n\t \t \td.startRequest(Disk.WRITE, Disk.SECTOR_SIZE+10, i, blank);\n\t \t }\n \t \tcommitWait();*/\n\t \t // We decided not to wipe the disk because the instructions were vague and it seems insanely inefficient to wipe the disk and there doesnt seem to be reason to wipe it. It also makes our tests run very slow. \n\t } \n\t else {\n\t \t //RECOVERY\n\t \t lstatus = new LogStatus(this, true);\n\t \t byte[] next = lstatus.recoverNext();\n\t while(next != null){\n\t \t Transaction temp = Transaction.parseLogBytesDebug(next, this);\n\t \t wblist.addCommitted(temp);\t \n\t \t next = lstatus.recoverNext();\n\t } \n\t }\n }\n catch(IOException e){\n\t\t\tSystem.out.println(\"IO exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n catch(IllegalArgumentException e){\n\t\t\tSystem.out.println(\"Illegal Argument exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n \n }", "private final void onDisk(TransactionInternal txn, LogEntry entry) throws BabuDBException {\n \n // append the entry to the DiskLogger if available, wait otherwise\n try {\n \n synchronized (diskLogger) {\n \n while (diskLogger.get() == null) {\n diskLogger.wait();\n }\n \n diskLogger.get().append(entry);\n }\n } catch (InterruptedException ie) {\n \n if (entry != null) entry.free();\n throw new BabuDBException(ErrorCode.INTERRUPTED, \"Operation \" +\n \"could not have been stored persistent to disk and \" +\n \"will therefore be discarded.\", ie.getCause());\n } \n }", "public GlBuffer commit(){\n return commit(true);\n }", "private void eraseBinary(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check if access to this file is allowed\r\n\t\tif (!fileAccessAllowed(ERASE_BINARY))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// use P1 and P2 as offset\r\n\t\tshort offset = Util.makeShort(buffer[ISO7816.OFFSET_P1], buffer[ISO7816.OFFSET_P2]);\r\n\t\tJCSystem.beginTransaction();\r\n\t\t//@ open valid(); // hard to eliminate as the conjunct selectedFile.ElementaryFile depends on non-input parameters\r\n\t\tif (selectedFile == masterFile)\r\n\t\t\tISOException.throwIt(ISO7816.SW_FILE_INVALID); //~allow_dead_code Dead because fileAccessAllowed() checks that selectedFile instanceof ElementaryFile and masterFile is not an ElementaryFile.\r\n\t\t// impossible to start erasing from offset large than size of file\r\n\t\t//@ open selected_file_types(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _);\r\n\t\tshort size = ((ElementaryFile)selectedFile).getCurrentSize();\r\n\t\t\r\n\t\tif (offset > size || offset < 0)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t((ElementaryFile) selectedFile).eraseData(offset);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}", "public synchronized void write(int update) throws InterruptedException\n {\n while (!bufferEmpty(\"Producer\"))\n // while (!bufferEmpty)\n {\n //Console.println(\"Producer Waiting on Buffer\");\n\n this.wait();\n\n // bufferEmpty = bufferEmpty(\"Producer\");\n }\n\n // Console.println(\"Producer writing\" + update + \" to Buffer\");\n theBuffer = update;\n this.notify();\n }", "Update withLevel(LockLevel level);", "private void commitAll(){\n if(isDiskBufferEnabled && persistenceService != null){\n persistenceService.commit(WIKIDATA_SYNONYMY_BUFFER);\n persistenceService.commit(WIKIDATA_HYPERNYMY_BUFFER);\n persistenceService.commit(WIKIDATA_ASK_BUFFER);\n }\n }", "private Buffer getBufferByPosition(int pos)\n throws IOException\n {\n return getBuffer(pos / BLOCK_SIZE);\n }", "void tryWriteLockInOMRequest() throws IOException;", "private void flushCurrentIndexBlock() throws IOException {\n if (currentMemoryIndex.documentsInIndex() < 1) {\n return;\n }\n\n logger.info(\"Flushing current memory Index. id = \" + indexBlockCount);\n\n final MemoryIndex flushingMemoryIndex = currentMemoryIndex;\n final File shardFolder = getNextIndexShardFolder(1);\n\n try {\n // reset the current index\n // - this makes the flush operation thread safe while continuing to add new documents.\n resetCurrentMemoryIndex();\n } catch (Exception ex) {\n throw new IOException(ex);\n }\n\n try {\n // first flush the index to disk\n FlushToDisk.flushMemoryIndex(flushingMemoryIndex, shardFolder.getAbsolutePath(), false);\n\n // indicate that the flushing part of this thread is done\n synchronized (geometricParts) {\n // add flushed index to the set of bins -- needs to be a synconeous action\n geometricParts.add(0, shardFolder.getAbsolutePath());\n updateIndex();\n flushingMemoryIndex.close();\n }\n\n } catch (IOException e) {\n logger.severe(e.toString());\n }\n }", "private void updateUnitStatus() {\r\n\t\tint b1 = Sense_NotReady;\r\n\t\tif (this.tapeIo != null) {\r\n\t\t\tb1 = Sense_Ready;\r\n\t\t\tb1 |= (this.currentBlock == this.headLimit) ? Sense_AtLoadPoint : 0;\r\n\t\t\tb1 |= (this.isReadonly) ? Sense_FileProtected : 0;\r\n\t\t}\r\n\t\tthis.senseBytes[1] = (byte)((b1 >> 16) & 0xFF);\r\n\t\t\r\n\t\tint b4 = (this.currentBlock == this.tailLimit) ? Sense_EndOfTape : 0;\r\n\t\tthis.senseBytes[4] = (byte)( ((b4 >> 8) & 0xF0) | (this.senseBytes[4] & 0x0F) );\r\n\t}", "public void update(Transaction trans, DBObject obj, Rowid rowid,\n DBObject old) throws StorageException, LockConflict {\n // TODO: update any associated overflow links as well\n short index = rowid.getIndex();\n\n if (index < 0 || index >= dir.getCount())\n throw new StorageException(\"Update failed: row not found\");\n\n // Acquire X-lock on to-be-updated tuple.\n long previousHolder = lock(trans, index);\n\n // Get the location of the row on this page\n int loc = dir.loc(index);\n\n if (RowHeader.isDeleted(pageBuffer, loc)) {\n // Replace the lock before aborting\n if (previousHolder == 0)\n RowHeader.setLocked(pageBuffer, loc, false);\n else\n RowHeader.setLockHolder(pageBuffer, loc, previousHolder);\n\n throw new StorageException(\"Update failed: row is deleted\");\n }\n\n // Return the old object\n pageBuffer.get(loc + RowHeader.getOverhead(), old);\n\n // Calculate new tuple size\n int tsize = obj.storeSize() + RowHeader.getOverhead();\n\n // Get existing tuple size\n int rsize = dir.sizeAt(index);\n\n // Write UNDO info, which is the existing row, its index identifier, and\n // the previous lock holder\n ByteBuffer bb = attachUndo(UNDO_UPDATE, rsize + 10).getData();\n bb.putShort(index).putLong(previousHolder);\n pageBuffer.get(loc, bb.array(), 10, rsize);\n\n loc -= prepareUpdate(index, loc, tsize, rsize);\n\n // Write the new tuple\n pageBuffer.put(loc + RowHeader.getOverhead(), obj);\n\n // Write REDO info, which is the new row and its index identifier\n bb = attachRedo(REDO_UPDATE, tsize + 2).getData();\n bb.putShort(index);\n pageBuffer.get(loc, bb.array(), 2, tsize);\n }", "private void invalidateBuffer() throws IOException, BadDescriptorException {\n if (!reading) flushWrite();\n int posOverrun = buffer.remaining(); // how far ahead we are when reading\n buffer.clear();\n if (reading) {\n buffer.flip();\n // if the read buffer is ahead, back up\n FileChannel fileChannel = (FileChannel)descriptor.getChannel();\n if (posOverrun != 0) fileChannel.position(fileChannel.position() - posOverrun);\n }\n }", "private static synchronized void writeTransaction( StmTransaction transaction ) {\n\n // Check for conflicts.\n for ( AbstractVersionedItem versionedItem : transaction.versionedItemsRead ) {\n versionedItem.ensureNotWrittenByOtherTransaction();\n }\n\n // Set the revision number to a committed value.\n transaction.targetRevisionNumber.set( lastCommittedRevisionNumber.incrementAndGet() );\n\n }", "void readBlock(int blockId, byte[] buffer, int offset) throws IOException;", "public int setBytes(int index, FileChannel in, long position, int length)\r\n/* 283: */ throws IOException\r\n/* 284: */ {\r\n/* 285:299 */ ensureAccessible();\r\n/* 286: */ try\r\n/* 287: */ {\r\n/* 288:301 */ return in.read((ByteBuffer)internalNioBuffer().clear().position(index).limit(index + length), position);\r\n/* 289: */ }\r\n/* 290: */ catch (ClosedChannelException ignored) {}\r\n/* 291:303 */ return -1;\r\n/* 292: */ }", "private boolean _read(Transaction trans, DBObject obj, int index,\n boolean forUpdate, Filter filter) throws StorageException,\n LockConflict {\n long previousHolder = 0;\n if (forUpdate)\n previousHolder = lock(trans, index);\n\n // Get the location of the row on this page\n int loc = dir.loc(index);\n\n if (!RowHeader.isDeleted(pageBuffer, loc)) {\n // Read the tuple\n pageBuffer.get(loc + RowHeader.getOverhead(), obj);\n\n if (filter == null || filter.passes(obj)) {\n if (forUpdate) {\n // log the lock (needed for multi-versioning undo purposes)\n attachUndo(UNDO_LOCK, 10).getData().putShort((short) index)\n .putLong(previousHolder);\n attachRedo(REDO_LOCK, 10).getData().putShort((short) index)\n .putLong(trans.getTransId());\n }\n return true;\n }\n }\n\n if (forUpdate) {\n // Replace the lock before returning false\n if (previousHolder == 0)\n RowHeader.setLocked(pageBuffer, loc, false);\n else\n RowHeader.setLockHolder(pageBuffer, loc, previousHolder);\n }\n\n return false;\n }", "Clock.Entry tryCommit(Transaction transaction, long id);", "void readBlock(int blockId, byte[] buffer) throws IOException;", "public abstract CacheKey put(Vector primaryKey, Object object, Object writeLockValue, long readTime);", "public synchronized void setCommitted(CommitInfo info) {\n\t\t// We can't be committed twice.\n\t\tAssert.assertTrue(null == _commitInfo);\n\t\t// The commit offset must be a positive number.\n\t\tAssert.assertTrue(info.intentionOffset > 0L);\n\t\t\n\t\t_commitInfo = info;\n\t\tthis.notifyAll();\n\t}", "public void sync(){\n byte[] block = new byte[512];\n SysLib.int2bytes(totalBlocks, block, 0);\n SysLib.int2bytes(totalInodes, block, 4);\n SysLib.int2bytes(freeList, block, 8);\n SysLib.rawwrite(0, block);\n }", "private void setTransactions(\n int index, com.google.protobuf.ByteString value) {\n java.lang.Class<?> valueClass = value.getClass();\n ensureTransactionsIsMutable();\n transactions_.set(index, value);\n }", "@Override\n public void commit() throws IOException {\n if (!committed && currentFile != null) {\n long pos = currentFile.getLineReadPos();\n currentFile.setPos(pos);\n currentFile.setLastUpdated(updateTime);\n committed = true;\n }\n }", "@Override\r\n\tpublic Buffer setBytes(int pos, byte[] b) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic int updateTicket(Booking_ticket bt) {\n\t\treturn 0;\n\t}", "void unlockWrite(long stamp);", "public Builder setTxIndexBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n txIndex_ = value;\n onChanged();\n return this;\n }", "public void sync()\n\t{\n\t\tbyte[] buffer = new byte[Disk.blockSize];\n\n\t\t// Write the totalBlocks, totalInodes, and freeList.\n\t\tSysLib.int2bytes(totalBlocks, buffer, 0);\n\t\tSysLib.int2bytes(totalInodes, buffer, 4);\n\t\tSysLib.int2bytes(freeList, buffer, 8);\n\t\tSysLib.int2bytes(lastFreeBlock, buffer, 12);\n\n\t\t// Write the block back to disk.\n\t\tSysLib.rawwrite(0, buffer);\n\t}", "public Productor(BufferContoler buff, Semaphore mutex, Semaphore empty, Semaphore full) {\n\t\tthis.buffer = buff;\n\t\tthis.mutex = mutex;\n\t\tthis.empty = empty;\n\t\tthis.full = full;\n\n\t}", "public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }", "void setQ( byte[] buffer, short offset, short length) throws CryptoException;", "@Override\n public void queueSecureInputBuffer(\n int index, int offset, CryptoInfo info, long presentationTimeUs, int flags) {\n bufferEnqueuer.queueSecureInputBuffer(index, offset, info, presentationTimeUs, flags);\n }", "public void setBufferStock(final SessionContext ctx, final Long value)\r\n\t{\r\n\t\tsetProperty(ctx, BUFFERSTOCK,value);\r\n\t}", "private void persistUserDataIfNeeded() throws IOException {\n int amountdatasets = 0;\n for (Transaction t : buffer) {\n amountdatasets += t.getDatasets().size();\n }\n //more than 5 datasets in write buffer --> write committed transactions\n if (amountdatasets >= 5) {\n Set<Transaction> todelete = new HashSet<>();\n\n //only one thread at a time should enter this block\n synchronized (this) {\n// System.out.println(\"thread \" + Thread.currentThread().getId() + \" entered persistUserDataIfNeeded sync block\");\n for (Transaction t : buffer) {\n if (t.isCommitted()) {\n for (UserData data : t.getDatasets()) {\n persistData(data);\n }\n todelete.add(t);\n }\n }\n\n //here the deletion happens. Comment out if Abnahme is n�rgeling... :)\n for (Transaction t : todelete) {\n System.out.println(\"removing transaction \" + t.getId() + \" from buffer\");\n buffer.remove(t);\n }\n// System.out.println(\"thread \" + Thread.currentThread().getId() + \" left persistUserDataIfNeeded sync block\");\n }\n }\n }", "synchronized ExerciseBuffer pin(Block blk) {\n\t ExerciseBuffer buff = findExistingBuffer(blk);\n if (buff == null) {\n buff = chooseUnpinnedBuffer();\n if (buff == null)\n return null;\n buff.assignToBlock(blk);\n \n \n }\n if (!buff.isPinned()) numAvailable--;\n \n buff.pin(); // \n \n if(bufferHashTable.containsValue(buff)){ //if value (buffer) is already exist then remove that old key (blk) \n bufferHashTable.remove(blk); \n \n }\n bufferHashTable.put(blk, buff); // adding new key (blk) to HashTable\n \n \n return buff;\n }", "public void BufferUpdates()\n {\n //Clear the dispatch list and start buffering changed entities.\n DispatchList.clear();\n bBufferingUpdates = true;\n }", "public GlBuffer commit(final Chunk<E>[] chunks){\n return commit(chunks, true);\n }", "public void updateTransaction(Transaction trans);", "@Override\n public void update() {\n updateBuffs();\n }", "void putTo(ByteBuffer dst, TcpTxContext tx) {}", "@Override // X.AnonymousClass1cQ\n public final void AAt(@NonNull byte[] bArr, @NonNull Long l, @NonNull MessageDigest messageDigest) {\n Long l2 = l;\n messageDigest.update(bArr);\n ByteBuffer byteBuffer = this.A00;\n synchronized (byteBuffer) {\n byteBuffer.position(0);\n byteBuffer.putLong(l2.longValue());\n messageDigest.update(byteBuffer.array());\n }\n }", "public int setBytes(int index, ScatteringByteChannel in, int length)\r\n/* 362: */ throws IOException\r\n/* 363: */ {\r\n/* 364:376 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 365:377 */ return super.setBytes(index, in, length);\r\n/* 366: */ }", "public void commitPendingDataToDisk() {\n /*\n r5 = this;\n monitor-enter(r5);\n r1 = r5.mPendingWrite;\t Catch:{ all -> 0x0039 }\n r3 = 0;\n r5.mPendingWrite = r3;\t Catch:{ all -> 0x0039 }\n if (r1 != 0) goto L_0x000a;\n L_0x0008:\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n L_0x0009:\n return;\n L_0x000a:\n r3 = r5.mWriteLock;\t Catch:{ all -> 0x0039 }\n r3.lock();\t Catch:{ all -> 0x0039 }\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n r2 = new java.io.FileOutputStream;\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3 = r3.chooseForWrite();\t Catch:{ IOException -> 0x003c }\n r2.<init>(r3);\t Catch:{ IOException -> 0x003c }\n r3 = r1.marshall();\t Catch:{ IOException -> 0x003c }\n r2.write(r3);\t Catch:{ IOException -> 0x003c }\n r2.flush();\t Catch:{ IOException -> 0x003c }\n android.os.FileUtils.sync(r2);\t Catch:{ IOException -> 0x003c }\n r2.close();\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3.commit();\t Catch:{ IOException -> 0x003c }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0039:\n r3 = move-exception;\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n throw r3;\n L_0x003c:\n r0 = move-exception;\n r3 = \"BatteryStats\";\n r4 = \"Error writing battery statistics\";\n android.util.Slog.w(r3, r4, r0);\t Catch:{ all -> 0x0052 }\n r3 = r5.mFile;\t Catch:{ all -> 0x0052 }\n r3.rollback();\t Catch:{ all -> 0x0052 }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0052:\n r3 = move-exception;\n r1.recycle();\n r4 = r5.mWriteLock;\n r4.unlock();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.internal.os.BatteryStatsImpl.commitPendingDataToDisk():void\");\n }", "synchronized ExerciseBuffer pinNew(String filename, PageFormatter fmtr) {\n\t ExerciseBuffer buff = chooseUnpinnedBuffer();\n if (buff == null)\n return null;\n Block blk=buff.assignToNew(filename, fmtr); // return the newly created block\n numAvailable--;\n buff.pin();\n \n if(bufferHashTable.containsValue(buff)){ //if value (buffer) is already exist then remove that key (blk) \n bufferHashTable.remove(blk); \n \n }\n bufferHashTable.put(blk, buff); // adding new key (blk) to HashTable\n \n return buff;\n }", "@Override\n void enqueueBlockRequest(int index, int position, int length) {\n enqueue(pmCache.request(index, position, length));\n }", "public synchronized void updateLastBlk(int numID, int blkNumID) {\n\t\tlastBlk.put(numID, blkNumID);\n\t}", "public void commit(Transaction t) {\n\t\ttry {\n\t\t\tArrayList<Record> records = new ArrayList<Record>();\n\t\t\tfor (int i = 0; i < t.noOfBundles; i++) {\n\t\t\t\tString record = \"\";\n\t\t\t\tBundle b = t.bundles[i];\n\t\t\t\tbyte[] recd = b.data;\n\t\t\t\trecord = new String(recd);\n\t\t\t\tString rec[] = record.split(\"\\n\");\n\t\t\t\tRecord r = new Record();\n\t\t\t\tr.rowid = Long.parseLong(rec[0]);\n\t\t\t\tr.groupid = rec[1];\n\t\t\t\tr.key = rec[2];\n\t\t\t\tr.value = rec[3];\n\t\t\t\tr.user = rec[4];\n\t\t\t\tr.datatype = rec[5];\n\t\t\t\tr.timestamp = Long.parseLong(rec[6]);\n\t\t\t\tr.synced = \"Y\";\n\t\t\t\tif (r.datatype.equals(\"file\")) {\n\t\t\t\t\tint l = Integer.parseInt(r.value.substring(0,\n\t\t\t\t\t\t\tr.value.indexOf(' ')));\n\t\t\t\t\tString fileName = r.value\n\t\t\t\t\t\t\t.substring(r.value.indexOf(' ') + 1);\n\t\t\t\t\tfileName = deviceId + \"_\" + t.transactionId + \"_\" + i + \"_\"\n\t\t\t\t\t\t\t+ fileName;\n\t\t\t\t\tString path = storagePath + \"/\" + fileName;\n\t\t\t\t\tFile f = new File(path);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(f);\n\t\t\t\t\tfor (int j = 1; j <= l; j++) {\n\t\t\t\t\t\tb = t.bundles[i + j];\n\t\t\t\t\t\tfos.write(b.data);\n\t\t\t\t\t}\n\t\t\t\t\tfos.close();\n\t\t\t\t\ti += l;\n\t\t\t\t\tr.value = path;\n\t\t\t\t}\n\t\t\t\trecords.add(r);\n\t\t\t}\n\t\t\tdh.putToRepository(records);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sync()\n {\n byte[] blockData = new byte[Disk.blockSize];\n SysLib.int2bytes(totalBlocks, blockData, 0);\n SysLib.int2bytes(inodeBlocks, blockData, 4);\n SysLib.int2bytes(freeList, blockData, 8);\n SysLib.rawwrite(0, blockData);\n }", "public void endOrAbort(HashMap<String, HashMap<String, Object>> transactions, HashMap<Character, HashMap<String, Object>> locks, String tr, String condition, HashMap<String, LinkedList<String>> blockedOp) throws IOException {\n if (transactions.get(tr).get(\"State\").equals(\"Blocked\") && condition.equals(\"Commited\")) {\n String transaction = ((ArrayList) transactions.get(tr).get(\"Blocked_By\")).get(((ArrayList) transactions.get(tr).get(\"Blocked_By\")).size() - 1).toString();\n blockedOp.get(transaction).addLast(tr);\n ((ArrayList) transactions.get(tr).get(\"Blocked_Operations\")).add(\"e\"+tr.charAt(1));\n fw.write(\"Transaction is \"+transactions.get(tr).get(\"State\")+\" so nothing will happen \\n\");\n return;\n }\n if (condition.equals(\"Commited\")) {\n fw.write(\"Commiting the transaction \" + tr +\"\\n\");\n }\n else {\n fw.write(\"Aborting the transaction \" + tr+\"\\n\");\n }\n /* Updating the Lock Table records with respect to current transaction */\n transactions.get(tr).put(\"State\", condition);\n transactions.get(tr).put(\"Blocked_By\", new ArrayList());\n transactions.get(tr).put(\"Blocked_Operations\", new ArrayList());\n ArrayList<Character> ch = new ArrayList<>();\n for (Character lock : locks.keySet()) {\n HashMap<String, Object> currentLock = locks.get(lock);\n ArrayList<String> tIdList = (ArrayList) currentLock.get(\"tid\");\n if (tIdList.size() > 0 && tIdList.contains(tr)) {\n if (tIdList.size() == 1) {\n ch.add(lock);\n } else {\n ((ArrayList)(locks.get(lock).get(\"tid\"))).remove(tr);\n }\n }\n }\n if (ch.size() > 0) {\n for (Character c : ch) {\n locks.remove(c);\n }\n }\n /*Removing the aborted transaction from blocked by list of every transaction and Activating the blocked transactions which are blocked by current transaction*/\n for (String allTransactions : transactions.keySet()) {\n ArrayList list1 = ((ArrayList) transactions.get(allTransactions).get(\"Blocked_By\"));\n if (!list1.isEmpty()) {\n if (list1.contains(tr)) {\n ((ArrayList) transactions.get(allTransactions).get(\"Blocked_By\")).remove(tr);\n list1 = ((ArrayList) transactions.get(allTransactions).get(\"Blocked_By\"));\n if (list1.size() == 0) {\n transactions.get(allTransactions).put(\"State\", \"Active\");\n ArrayList<String> operations = ((ArrayList) transactions.get(allTransactions).get(\"Blocked_Operations\"));\n ArrayList<String> operationsRef = (ArrayList<String>) operations.clone();\n for (String op : operationsRef) {\n if (blockedOp.containsKey(tr) && blockedOp.get(tr).contains(op))\n ((ArrayList) transactions.get(allTransactions).get(\"Blocked_Operations\")).remove(op);\n }\n }\n }\n }\n }\n /*Running their operations which are activated*/\n if (blockedOp.containsKey(tr)) {\n fw.write(\"Activating if any, the blocked transactions which are blocked by \"+tr+\" and running their operations \\n\");\n for (String op : blockedOp.get(tr)) {\n if (transactions.get(\"T\"+op.charAt(1)).get(\"State\").equals(\"Aborted\") || transactions.get(\"T\"+op.charAt(1)).get(\"State\").equals(\"Commited\"))\n continue;\n fw.write(\"Blocked operation \" + op + \" by \" + tr + \" will be executed \\n\");\n ConcurrencyControl concurrencyControl = new ConcurrencyControl();\n if (op.charAt(0) == 'r') {\n concurrencyControl.readTransaction(transactions, locks, op, blockedOp);\n } else if (op.charAt(0) == 'w') {\n concurrencyControl.writeTransaction(transactions, locks, op, blockedOp);\n } else {\n concurrencyControl.endOrAbort(transactions, locks, \"T\"+op.charAt(1), \"Commited\", blockedOp);\n }\n }\n blockedOp.remove(tr);\n }\n }", "public int replace (byte []buffer, int offset, int length, int oldTag, Params params)\n throws IOException,IllegalArgumentException,IndexOutOfBoundsException\n {\n if (offset < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if (length < 0) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n if ((offset + length) > buffer.length) {\n throw new java.lang.IndexOutOfBoundsException();\n }\n return replaceTagPar (buffer, offset, length, oldTag, params);\n }", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "public void returnBuffer(byte[] current, boolean cdrStr)\n {\n if (current != null)\n {\n int log_curr = calcLog(current.length);\n \n if( log_curr >= MIN_CACHE)\n {\n if( log_curr > maxManagedBufferSize )\n {\n synchronized(this)\n {\n // Only cache if CDROutputStream is called, cache is enabled &\n // the new value is > than the cached value.\n if (cdrStr &&\n (time >= 0 &&\n (bufferMax == null || bufferMax.length < current.length)))\n {\n bufferMax = current;\n }\n return;\n }\n }\n \n int expected = (1 << log_curr + 1) - 1;\n if (current.length != expected)\n {\n if (logger.isWarnEnabled())\n {\n logger.warn (\"BufferManager.returnBuffer, log = \" + log_curr +\n \" got length \" +\n Integer.toHexString (current.length) +\n \" expected length \" +\n Integer.toHexString (expected));\n }\n }\n else\n {\n final Collection s = bufferPool[ log_curr-MIN_CACHE ];\n doReturnBuffer(s, current, threshold);\n }\n }\n }\n }", "private int getBytes(int index, FileChannel out, long position, int length, boolean internal)\r\n/* 211: */ throws IOException\r\n/* 212: */ {\r\n/* 213:233 */ ensureAccessible();\r\n/* 214:234 */ ByteBuffer tmpBuf = internal ? internalNioBuffer() : ByteBuffer.wrap(this.array);\r\n/* 215:235 */ return out.write((ByteBuffer)tmpBuf.clear().position(index).limit(index + length), position);\r\n/* 216: */ }", "public byte[] fillMergeInputBuffers(byte[] buffer, int offset)\r\n throws IOException {\r\n file.seek(offset);\r\n file.read(buffer);\r\n return buffer;\r\n }", "public void update(byte[] input, int offs, int len);" ]
[ "0.58697474", "0.58465147", "0.57209015", "0.53637666", "0.5090268", "0.49590704", "0.49478438", "0.48787296", "0.47150692", "0.47079456", "0.46735984", "0.45946103", "0.45897362", "0.4589561", "0.45854276", "0.45595956", "0.45148817", "0.45111609", "0.45009232", "0.4495593", "0.44947854", "0.44858477", "0.44837505", "0.44601646", "0.44576675", "0.44427928", "0.44074073", "0.44070026", "0.44059524", "0.43897608", "0.43816674", "0.43812406", "0.4381158", "0.43766096", "0.43663824", "0.43366066", "0.43205658", "0.43172905", "0.4295419", "0.4286465", "0.4277043", "0.42699233", "0.42685142", "0.42638594", "0.4255373", "0.42475304", "0.42426723", "0.42422828", "0.4236764", "0.42317855", "0.4223007", "0.42136714", "0.4209157", "0.42060193", "0.41956532", "0.41893038", "0.41868657", "0.41835472", "0.4161952", "0.41569233", "0.41564167", "0.415626", "0.41551018", "0.4149674", "0.41425976", "0.41425505", "0.4136783", "0.41366386", "0.41300616", "0.41277552", "0.41189274", "0.41173372", "0.41122144", "0.4109073", "0.40989348", "0.40928388", "0.40900865", "0.40860876", "0.40840903", "0.40810987", "0.40787664", "0.4073532", "0.40674308", "0.40590957", "0.40575287", "0.40571144", "0.40568325", "0.40567052", "0.40565923", "0.40517712", "0.40486634", "0.40477335", "0.40455544", "0.40453964", "0.40434465", "0.40397668", "0.4034999", "0.402737", "0.40272683", "0.40253466" ]
0.5917592
0
Update the failure probability for testing
public void setFailureProb(float failprob) { this.failprob = failprob; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setProbOfFailure(int prob) {\n \tif( prob <= 100 || prob >= 0){\n \t\tthis.probOfFailure = prob;\n \t}\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult Result) {\n\t\t\r\n\t}", "private void evaluateProbabilities()\n\t{\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\n\t\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\t\n\t\t}", "public int getProbOfFailure() {\n return this.probOfFailure;\n }", "public void calculateProbabilities(){\n\t}", "@Test(timeout = 4000)\n public void test069() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[4];\n evaluation0.updateNumericScores(doubleArray0, doubleArray0, (-1.0));\n assertEquals(Double.NEGATIVE_INFINITY, evaluation0.meanPriorAbsoluteError(), 0.01);\n }", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "private void figureOutProbability() {\n\t\tMysqlDAOFactory mysqlFactory = (MysqlDAOFactory) DAOFactory\n\t\t\t\t.getDAOFactory(DAOFactory.MYSQL);\n\n\t\tstaticPr = new StaticProbability(trialId);\n\t\tstatisticPr = new StatisticProbability(trialId);\n\t\tstaticProbability = staticPr.getProbability();\n\t\tstatisticProbability = statisticPr.getProbability();\n\n\t\tfor (Entry<Integer, BigDecimal> entry : staticProbability.entrySet()) {\n\t\t\ttotalProbability.put(\n\t\t\t\t\tentry.getKey(),\n\t\t\t\t\tentry.getValue().add(statisticProbability.get(entry.getKey())).setScale(2));\n\t\t}\n\n\t\tBigDecimal summaryProbability = BigDecimal.valueOf(0);\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tsummaryProbability = summaryProbability.add(entry.getValue());\n\t\t}\n\t\t\n\t\t// figures out probability\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tentry.setValue(entry.getValue().divide(summaryProbability, 2,\n\t\t\t\t\tBigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Total probability -> \" + totalProbability);\n\t\t\n\t\t// figures out and sets margin\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tBigDecimal probability = entry.getValue();\n\t\t\tBigDecimal winCoefficient = (BigDecimal.valueOf(1.).divide(\n\t\t\t\t\tprobability, 2, BigDecimal.ROUND_HALF_UP))\n\t\t\t\t\t.multiply(BigDecimal.valueOf(1.).subtract(Constants.MARGIN));\n\t\t\tentry.setValue(winCoefficient.setScale(2, BigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Winning coefficient -> \" + totalProbability);\n\t\t\n\t\t// updates info in db\n\t\tTrialHorseDAO trialHorseDAO = mysqlFactory.getTrialHorseDAO();\n\t\tTrialHorseDTO trialHorseDTO = null;\n\t\tfor(Entry<Integer, BigDecimal> entry : totalProbability.entrySet()){\n\t\t\ttrialHorseDTO = trialHorseDAO.findTrialHorseByTrialIdHorseId(trialId, entry.getKey());\n\t\t\ttrialHorseDTO.setWinCoefficient(entry.getValue());\n\t\t\ttrialHorseDAO.updateTrialHorseInfo(trialHorseDTO);\n\t\t}\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t}", "@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }", "@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\tSystem.out.println(\"*********Test onTestFailedButWithinSuccessPercentage :\"+result.getName());\r\n\t}", "@Test(timeout = 4000)\n public void test070() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[7];\n evaluation0.updateNumericScores(doubleArray0, doubleArray0, 0.0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test120() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.pctIncorrect();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n }", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "public void fail() {\r\n\t\tcontestantIt.currentC().updatePoints(-FAIL);\r\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "double getMissChance();", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\n}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\tlogger.info(\"onTestFailedButWithinSuccessPercentage \" + result.getName());\n\t}", "@Test\n public void test02() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[6];\n evaluation0.updateNumericScores(doubleArray0, doubleArray0, '\\u0086');\n assertEquals(Double.POSITIVE_INFINITY, evaluation0.meanPriorAbsoluteError(), 0.01D);\n }", "@Override\n\tpublic void computeFinalProbabilities() {\n\t\tsuper.computeFinalProbabilities();\n\t}", "@Override\npublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\n}", "@Test(timeout = 4000)\n public void test007() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.setNumericPriorsFromBuffer();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "void setExtremeSpikeProbability(double p);", "private void incrementFailures() {\n totalFailures++;\n totalTunitFailures++;\n }", "@Test(timeout = 4000)\n public void test024() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate(\"\");\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.setPriors(instances0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test\n public void test29() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.pctCorrect();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public void setProbability(double pProbability) throws Exception{\r\n\t\tif (pProbability >= 0) probability = pProbability;\r\n\t\telse throw new Exception(\"02; sPro,ProEle\");\r\n\t}", "private void simulateFailOrSleep() throws Exception {\n if ((failProbability != null) && (sleepProbability != null) && (sleepMilisec != null)) {\n int number = new Random().nextInt(100);\n if (number < failProbability) throw new Exception(\"Simulated Exception in Customer Service\");\n else {\n number = new Random().nextInt(100);\n if (number < sleepProbability) Thread.sleep(sleepMilisec);\n }\n }\n }", "@Override\r\npublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\r\n}", "public void setProbMut (float value) {\r\n mut_prob= value;\r\n }", "@Override\r\n\tprotected void updateProbAndRoll(int numDoubles, double multiplier, boolean rollAgain) {\n\t\taddToEndProb(multiplier);\r\n\t}", "@Test(timeout = 4000)\n public void test025() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.setPriors(instances0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "protected Double successProbability(){\n\t\tnodeKValues = collectKValues();\n\t\tList<Integer[]> placements = getDistinctPlacements(getMinKPath());\n\t\tlong maxNumberOfColorings = 0;\n\t\tfor (Integer[] placement : placements){\n\t\t\tlong colorings = numberOfColorings(placement);\n\t\t\tif (colorings > maxNumberOfColorings)\n\t\t\t\tmaxNumberOfColorings = colorings;\n\t\t}\n\t\tDouble probability = 1.0/maxNumberOfColorings;\n\t\tfor (int i=1; i<=pathLength; i++){ // factorial of pathlength\n\t\t\tprobability = probability * i;\n\t\t}\n\t\treturn probability;\n\t}", "public void updateScores(double attempt) {\r\n \tif(previousScore == 0){\r\n \t\tpreviousScore = currentScore;\r\n \t}else{\r\n \t\tbeforePreviousScore = previousScore;\r\n \t\tpreviousScore = currentScore;\r\n \t}\r\n this.currentScore = 100*(attempt \r\n\t\t\t\t- (benchmark - (maximumMark - benchmark)/NUMBEROFLEVEL))\r\n\t\t\t\t/(((maximumMark - benchmark)/NUMBEROFLEVEL)*2);\r\n }", "@Test\n public void testScoreUpdate() {\n try {\n final BestEvalScore score = new BestEvalScore(\"thjtrfwaw\");\n double expected = 0;\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n final Evaluation eval = new Evaluation(2);\n eval.eval(0,1);\n eval.eval(1,1);\n\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(0,1);\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(1,1);\n eval.eval(1,1);\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n\n\n } catch (IOException e) {\n throw new IllegalStateException(\"Failed to create instance!\", e);\n }\n\n\n }", "public void progressInfectionProbV2(int probability){\n int recoveryProb = 0;\n recoveryProb = daysInfected * probability;\n int recov = rand.nextInt(100);\n if (recov < recoveryProb) {\n //recover\n nextState = States.RecoveredVirus2;\n immuneV2 = true;\n } else daysInfected++;\n }", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\tSystem.out.println(\"on failed but within success percentage\");\n\t\t\n\t}", "public double getProbability() {\n\t\treturn getD_errorProbability();\n\t}", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.totalCost();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Override\r\n\tpublic void setProbability(double probability) {\n\t\tthis.probability = probability;\r\n\t}", "void CalculateProbabilities()\n\t{\n\t int i;\n\t double maxfit;\n\t maxfit=fitness[0];\n\t for (i=1;i<FoodNumber;i++)\n\t {\n\t if (fitness[i]>maxfit)\n\t maxfit=fitness[i];\n\t }\n\n\t for (i=0;i<FoodNumber;i++)\n\t {\n\t prob[i]=(0.9*(fitness[i]/maxfit))+0.1;\n\t }\n\n\t}", "@Test\n public void test21() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.errorRate();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.priorEntropy();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "private void fail() {\n mFails++;\n if(mFails > MAX_NUMBER_OF_FAILS) {\n gameOver();\n }\n }", "@Test\n public void test33() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.correct();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, double0, 0.01D);\n }", "@Override\n public int viability() {\n int[] newStats = getNewStats();\n return newStats[0] * newStats[1];\n }", "public void setProbability(double v) {\n probability = v;\n }", "@Test(timeout = 4000)\n public void test036() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate(\"\");\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = evaluation0.makeDistribution(0.95);\n assertNotNull(doubleArray0);\n assertArrayEquals(new double[] {1.0, 0.0}, doubleArray0, 0.01);\n assertEquals(0.0, evaluation0.SFSchemeEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.pctUnclassified();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test\n\tpublic void updateTestPaperQuestion() throws Exception {\n\t}", "@Test\n public void test36() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.incorrect();\n assertEquals(0.0, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public static void setMutationProbability(double value) { mutationProbability = value; }", "@Test(timeout = 4000)\n public void test040() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.falseNegativeRate((-2));\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Override\n\tpublic double probability() {\n\t\treturn 0;\n\n\t}", "public void trainBernoulli() {\t\t\n\t\tMap<String, Cluster> trainingDataSet = readFile(trainLabelPath, trainDataPath, \"training\");\n\t\tMap<String, Cluster> testingDataSet = readFile(testLabelPath, testDataPath, \"testing\");\n\n\t\t// do testing, if the predicted class and the gold class is not equal, increment one\n\t\tdouble error = 0;\n\n\t\tdouble documentSize = 0;\n\n\t\tSystem.out.println(\"evaluate the performance\");\n\t\tfor (int testKey = 1; testKey <= 20; testKey++) {\n\t\t\tCluster testingCluster = testingDataSet.get(Integer.toString(testKey));\n\t\t\tSystem.out.println(\"Cluster: \"+testingCluster.toString());\n\n\t\t\tfor (Document document : testingCluster.getDocuments()) {\n\t\t\t\tdocumentSize += 1; \n\t\t\t\tList<Double> classprobability = new ArrayList<Double>();\n\t\t\t\tMap<String, Integer> testDocumentWordCounts = document.getWordCount();\n\n\t\t\t\tfor (int classindex = 1; classindex <= 20; classindex++) {\n\t\t\t\t\t// used for calculating the probability\n\t\t\t\t\tCluster trainCluster = trainingDataSet.get(Integer.toString(classindex));\n\t\t\t\t\t// System.out.println(classindex + \" \" + trainCluster.mClassId);\n\t\t\t\t\tMap<String, Double> bernoulliProbability = trainCluster.bernoulliProbabilities;\n\t\t\t\t\tdouble probability = Math.log(trainCluster.getDocumentSize()/trainDocSize);\n\t\t\t\t\tfor(int index = 1; index <= voc.size(); index++ ){\n\n\t\t\t\t\t\t// judge whether this word is stop word \n\t\t\t\t\t\tboolean isStopwords = englishStopPosition.contains(index);\n\t\t\t\t\t\tif (isStopwords) continue;\n\n\t\t\t\t\t\tboolean contain = testDocumentWordCounts.containsKey(Integer.toString(index));\t\t\t\t\t\t\n\t\t\t\t\t\tif (contain) {\n\t\t\t\t\t\t\tprobability += Math.log(bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprobability += Math.log(1 - bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// put the probability into the map for the specific class\n\t\t\t\t\tclassprobability.add(probability);\n\t\t\t\t}\n\t\t\t\tObject obj = Collections.max(classprobability);\n\t\t\t\t// System.out.println(classprobability);\n\t\t\t\tString predicte_class1 = obj.toString();\n\t\t\t\t// System.out.println(predicte_class1);\n\t\t\t\t// System.out.println(Double.parseDouble(predicte_class1));\n\t\t\t\tint index = classprobability.indexOf(Double.parseDouble(predicte_class1));\n\t\t\t\t// System.out.println(index);\n\t\t\t\tString predicte_class = Integer.toString(index + 1);\n\n\n\t\t\t\tconfusion_matrix[testKey - 1][index] += 1;\n\n\t\t\t\t// System.out.println(document.docId + \": G, \" + testKey + \"; P: \" + predicte_class);\n\t\t\t\tif (!predicte_class.equals(Integer.toString(testKey))) {\n\t\t\t\t\terror += 1;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize);\n\t\t}\n\n\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize + \" precision rate : \" + (1 - error/documentSize));\n\n\t\t// print confusion matrix\n\t\tprintConfusionMatrix(confusion_matrix);\n\t}", "@Test\n public void ifMyPetIsDrinkingIncreaseInitialValueBy() {\n underTest.tick(1);\n int actualThirstLevel = underTest.getThirstLevel();\n assertThat(actualThirstLevel, is(5));\n\n\n }", "public void testSetPercentToSample()\n {\n double percentToSample = RandomSubVectorThresholdLearner.DEFAULT_PERCENT_TO_SAMPLE;\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n assertEquals(percentToSample, instance.getPercentToSample(), 0.0);\n\n percentToSample = percentToSample / 2.0;\n instance.setPercentToSample(percentToSample);\n assertEquals(percentToSample, instance.getPercentToSample());\n \n percentToSample = 1.0;\n instance.setPercentToSample(percentToSample);\n assertEquals(percentToSample, instance.getPercentToSample());\n\n percentToSample = 0.0;\n instance.setPercentToSample(percentToSample);\n assertEquals(percentToSample, instance.getPercentToSample());\n\n percentToSample = 0.47;\n instance.setPercentToSample(percentToSample);\n assertEquals(percentToSample, instance.getPercentToSample());\n\n boolean exceptionThrown = false;\n try\n {\n instance.setPercentToSample(-0.1);\n }\n catch (IllegalArgumentException e)\n {\n exceptionThrown = true;\n }\n finally\n {\n assertTrue(exceptionThrown);\n }\n assertEquals(percentToSample, instance.getPercentToSample());\n\n exceptionThrown = false;\n try\n {\n instance.setPercentToSample(1.1);\n }\n catch (IllegalArgumentException e)\n {\n exceptionThrown = true;\n }\n finally\n {\n assertTrue(exceptionThrown);\n }\n assertEquals(percentToSample, instance.getPercentToSample());\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[0];\n // Undeclared exception!\n try { \n evaluation0.updateNumericScores(doubleArray0, doubleArray0, (-3363.03107));\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 0\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "@Test(timeout = 4000)\n public void test116() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.correct();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "@Test(timeout = 4000)\n public void test050() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate(\"\");\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.areaUnderPRC((-1));\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate(\"\");\n Evaluation evaluation0 = new Evaluation(instances0);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(2, doubleArray0.length);\n }", "@Override\r\n\tpublic void setNextProbability(double probability) {\n\t\tthis.nextProbability = probability;\r\n\t}", "@Test(timeout = 4000)\n public void test108() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.avgCost();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test\r\n\tpublic void incrementScoretest() \r\n\t{\r\n\t\tscoreBehavior.incrementScore();\r\n\t\tassertEquals(1, scoreBehavior.score());\r\n\t\t\r\n\t\tscoreBehavior.incrementScore();\r\n\t\tassertEquals(2, scoreBehavior.score());\r\n\t}", "private double calcProbability(int index) {\n\t\treturn (double) fitnesses[index] / sumOfFitnesses();\n\t}", "public void testGetPercentToSample()\n {\n this.testSetPercentToSample();\n }", "@Test\n public void test35() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.pctUnclassified();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(Double.NaN, double0, 0.01D);\n }" ]
[ "0.718893", "0.6502335", "0.6502335", "0.6502335", "0.64498866", "0.64385754", "0.64297515", "0.64297515", "0.64297515", "0.64297515", "0.64297515", "0.6428471", "0.6428471", "0.6428471", "0.6428471", "0.6424727", "0.640252", "0.63821995", "0.6352216", "0.63434726", "0.6339586", "0.6339586", "0.6339586", "0.6339586", "0.6339586", "0.6339586", "0.6339586", "0.63285327", "0.6324254", "0.6307482", "0.6307482", "0.6254548", "0.62280685", "0.6227849", "0.6227849", "0.6227849", "0.62190634", "0.62190634", "0.62083775", "0.62083775", "0.62010473", "0.6184445", "0.6176377", "0.6172936", "0.6172936", "0.6170585", "0.6143373", "0.6143373", "0.61252296", "0.6103677", "0.6086255", "0.6081206", "0.60782063", "0.6070767", "0.6050551", "0.6028723", "0.60125905", "0.5987231", "0.5983026", "0.5977849", "0.5959399", "0.59439003", "0.59165365", "0.58829486", "0.58626896", "0.5861114", "0.5840036", "0.5823263", "0.5813202", "0.5790674", "0.57890666", "0.5761401", "0.5731648", "0.5723995", "0.5716663", "0.5709047", "0.5695216", "0.56789815", "0.56770295", "0.5668511", "0.56613857", "0.5652905", "0.56476074", "0.5639138", "0.5626637", "0.56191313", "0.561459", "0.56046283", "0.5599353", "0.55975306", "0.5594364", "0.55397135", "0.55251575", "0.55186385", "0.55080014", "0.5500665", "0.5500621", "0.55001646", "0.54895985", "0.54817665" ]
0.75250614
0
function to wait for commit to write
public void commitWait() { try{ waitLock.lock(); while(commitBarrierSector != -1){ commitDone.awaitUninterruptibly(); } return; } finally{ waitLock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void waitToWrite();", "static void waitForBlockCommit() {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "void commit() throws InterruptedException;", "public synchronized CommitInfo waitForCommitted() throws InterruptedException {\n\t\twhile (null == _commitInfo) {\n\t\t\t// We allow the user to interrupt their own thread.\n\t\t\tthis.wait();\n\t\t}\n\t\treturn _commitInfo;\n\t}", "public void commit() {\n\t\tcommitted = true;\n\t}", "public void commitPendingDataToDisk() {\n /*\n r5 = this;\n monitor-enter(r5);\n r1 = r5.mPendingWrite;\t Catch:{ all -> 0x0039 }\n r3 = 0;\n r5.mPendingWrite = r3;\t Catch:{ all -> 0x0039 }\n if (r1 != 0) goto L_0x000a;\n L_0x0008:\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n L_0x0009:\n return;\n L_0x000a:\n r3 = r5.mWriteLock;\t Catch:{ all -> 0x0039 }\n r3.lock();\t Catch:{ all -> 0x0039 }\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n r2 = new java.io.FileOutputStream;\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3 = r3.chooseForWrite();\t Catch:{ IOException -> 0x003c }\n r2.<init>(r3);\t Catch:{ IOException -> 0x003c }\n r3 = r1.marshall();\t Catch:{ IOException -> 0x003c }\n r2.write(r3);\t Catch:{ IOException -> 0x003c }\n r2.flush();\t Catch:{ IOException -> 0x003c }\n android.os.FileUtils.sync(r2);\t Catch:{ IOException -> 0x003c }\n r2.close();\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3.commit();\t Catch:{ IOException -> 0x003c }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0039:\n r3 = move-exception;\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n throw r3;\n L_0x003c:\n r0 = move-exception;\n r3 = \"BatteryStats\";\n r4 = \"Error writing battery statistics\";\n android.util.Slog.w(r3, r4, r0);\t Catch:{ all -> 0x0052 }\n r3 = r5.mFile;\t Catch:{ all -> 0x0052 }\n r3.rollback();\t Catch:{ all -> 0x0052 }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0052:\n r3 = move-exception;\n r1.recycle();\n r4 = r5.mWriteLock;\n r4.unlock();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.internal.os.BatteryStatsImpl.commitPendingDataToDisk():void\");\n }", "boolean shouldCommit();", "public void commit() {\n tryCommit(true);\n }", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "public void commit() {\n doCommit();\n }", "void commit();", "void commit();", "public void commit() {\n }", "@Override\r\n\t\t\tpublic void progressMade() {\n\t\t\t\twriteReadSemaphore.refreshWriteLock(lockKey, finalWriteToken, lockTimeoutSec);\r\n\t\t\t}", "public void commit();", "void notifyWrite();", "@Override\n public void commit() {\n }", "boolean isAutoCommit();", "void commit() {\n }", "@Override\n\tpublic void commit() {\n\n\t}", "public boolean commit() {\r\n\tboolean result = false;\r\n\r\n\tif (conn != null && isConnected()) {\r\n\t try {\r\n\t\tboolean autoCommit = getAutoCommit();\r\n\r\n\t\tif (!autoCommit) {\r\n\t\t conn.commit();\r\n\t\t result = true;\r\n\t\t}\r\n\t } catch (Exception e) {\r\n\t\te.printStackTrace();\r\n\t }\r\n\t}\r\n\r\n\treturn result;\r\n }", "public abstract void commit();", "public void commitWriter () {\n try {\n writer.commit();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void commit(){\n \n }", "@Override\n public boolean isCommitted() {\n return false;\n }", "public void commit() {\n\t\tcommitted = true;\n\t\tbackUp();\n\t\t//back up the current board info at the meanwhile\n\t}", "public void commitTransaction(TransID tid) \n throws IOException, IllegalArgumentException{// Not yet complete\n\t try {\n\t\t ADisk_lock.lock();\n\t\t // Call commit\n\t\t atranslist.get(tid).commit();\n\t\t Transaction temp = atranslist.remove(tid);\n\t\t wblist.addCommitted(temp);\t \n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n }", "protected void commit()\n\t{\n\t\t_Status = DBRowStatus.Unchanged;\n\t}", "public void forceCommitTx()\n{\n}", "@Override\r\n\tpublic boolean commit() {\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tString sql = \"commit\";\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tps.executeUpdate();\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public synchronized void writeCommit(Transaction t) {\n\t\tflush();\n\t\tpw.println(t.transactionId() + \" commit\");\t\n\t\tflush();\n\t}", "@Override\n\tpublic boolean isCommitted() {\n\t\treturn false;\n\t}", "public void transactionComplete(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\\\n \t//should always commit, simply call transactionComplete(tid,true)\n \ttransactionComplete(tid, true);\n \t\n }", "@Test\r\n\tpublic void testCommit()\r\n\t\tthrows Exception\r\n\t{\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(john, email, johnemail,dirgraph);\r\n\t\r\n\t\t\tassertTrue(\"Uncommitted update should be visible to own connection\",\r\n\t\t\t\t\ttestAdminCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\t\tassertFalse(\"Uncommitted update should only be visible to own connection\",\r\n\t\t\t\t\ttestReaderCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\t\tassertThat(testWriterCon.size(), is(equalTo(0L)));\r\n\t\r\n\t\t\ttestAdminCon.commit();\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tlogger.debug(e.getMessage());\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif(testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\tassertThat(testWriterCon.size(), is(equalTo(1L)));\r\n\t\tassertTrue(\"Repository should contain statement after commit\",\r\n\t\t\t\ttestAdminCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\tassertTrue(\"Committed update will be visible to all connection\",\r\n\t\t\t\ttestReaderCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t}", "private void processCommit() throws HsqlException {\n tokenizer.isGetThis(Token.T_WORK);\n session.commit();\n }", "public boolean fullCommitNeeded ()\n {\n return true;\n }", "private boolean enqueueWrite(ChannelHandlerContext ctx, HttpObject msg, ChannelPromise promise) {\n if (ctx.channel().isWritable() && queuedWrites.isEmpty()) {\n ctx.write(msg, promise);\n return true;\n } else {\n queuedWrites.add(new WriteOperation(msg, promise));\n return false;\n }\n }", "public UpdateResponse commit(boolean waitFlush, boolean waitSearcher, boolean softCommit) throws SolrServerException, IOException {\n return new UpdateRequest().setAction(UpdateRequest.ACTION.COMMIT, waitFlush, waitSearcher, softCommit).process( this );\n }", "void commit() throws CommitException;", "boolean commitEntryMemTableFlush() throws IOException;", "public void commit (boolean force) throws IOException {\n // There is something to commit\n if (commitCounter > 0 || !force)\n this.commit();\n }", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "@Override\n public void commit() throws IOException {\n if (!committed && currentFile != null) {\n long pos = currentFile.getLineReadPos();\n currentFile.setPos(pos);\n currentFile.setLastUpdated(updateTime);\n committed = true;\n }\n }", "@TestFor(issues = \"TW-48463\")\n public void concurrent_commit() throws Exception {\n RepositoryStateData s1 = RepositoryStateData.createVersionState(\"refs/heads/master\", map(\n \"refs/heads/master\", \"f727882267df4f8fe0bc58c18559591918aefc54\"));\n RepositoryStateData s2 = RepositoryStateData.createVersionState(\"refs/heads/master\", map(\n \"refs/heads/master\", \"f727882267df4f8fe0bc58c18559591918aefc54\",\n \"refs/heads/topic2\", \"cc69c22bd5d25779e58ad91008e685cbbe7f700a\"));\n myGit.getCollectChangesPolicy().collectChanges(myRoot, s1, s2, CheckoutRules.DEFAULT);\n\n RepositoryStateData state1 = myGit.getCurrentState(myRoot);\n\n CountDownLatch latch = new CountDownLatch(1);\n CountDownLatch t1Ready = new CountDownLatch(1);\n CountDownLatch t2Ready = new CountDownLatch(1);\n AtomicReference<VcsException> error1 = new AtomicReference<>();\n AtomicReference<VcsException> error2 = new AtomicReference<>();\n Thread t1 = new Thread(() -> {\n CommitPatchBuilder patchBuilder = null;\n try {\n patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.createFile(\"file-to-commit\", new ByteArrayInputStream(\"content1\".getBytes()));\n t1Ready.countDown();\n latch.await();\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Commit1\"));\n } catch (VcsException e) {\n error1.set(e);\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (patchBuilder != null)\n patchBuilder.dispose();\n }\n });\n t1.start();\n Thread t2 = new Thread(() -> {\n CommitPatchBuilder patchBuilder = null;\n try {\n patchBuilder = myCommitSupport.getCommitPatchBuilder(myRoot);\n patchBuilder.createFile(\"file-to-commit\", new ByteArrayInputStream(\"content2\".getBytes()));\n t2Ready.countDown();\n latch.await();\n patchBuilder.commit(new CommitSettingsImpl(\"user\", \"Commit2\"));\n } catch (VcsException e) {\n error2.set(e);\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (patchBuilder != null)\n patchBuilder.dispose();\n }\n });\n t2.start();\n t1Ready.await();\n t2Ready.await();\n latch.countDown();\n t1.join();\n t2.join();\n\n RepositoryStateData state2 = myGit.getCurrentState(myRoot);\n\n List<ModificationData> changes = myGit.getCollectChangesPolicy().collectChanges(myRoot, state1, state2, CheckoutRules.DEFAULT);\n\n then(changes.size() == 2 || (error1.get() != null || error2.get() != null)) //either both commits succeeds, or one finishes with an error\n .overridingErrorMessage(\"Non-fast-forward push succeeds\")\n .isTrue();\n }", "public boolean isCommitted() {\n\t\treturn false;\n\t}", "@Override\r\n\t\t\tpublic void progressMade() {\n\t\t\t\twriteReadSemaphore.refreshReadLock(lockKey, readToken, lockTimeoutSec);\r\n\t\t\t}", "public void commit() throws IOException {\n this.snapLog.commit();\n }", "public UpdateResponse commit(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException {\n return new UpdateRequest().setAction(UpdateRequest.ACTION.COMMIT, waitFlush, waitSearcher).process( this );\n }", "private void waitForAConnection() throws Exception { Wait for either the sql statement to throw an error or the\n // fifo writer to throw an error\n //\n while (!isStopped()){\n data.fifoOpener.join(1000);\n //check if SQL Proces is still running has exited throw Error\n \n if(!checkSqlProcessRunning(data.sqlProcess)){\n throw new Exception(\"Ingres SQL process has stopped\");\n }\n \n \n if (data.fifoOpener.getState() == Thread.State.TERMINATED)\n break;\n \n try{\n data.sqlRunner.checkExcn();\n }\n catch (Exception e){\n // We need to open a stream to the fifo to unblock the fifo writer\n // that was waiting for the sqlRunner that now isn't running\n data.fifoOpener.join();\n logError(\"Make sure user has been granted the FILE privilege.\");\n logError(\"\");\n throw e;\n }\n \n try{\n data.fifoOpener.checkExcn();\n }\n catch (Exception e){\n throw e;\n }\n }\n \n data.fifoStream = data.fifoOpener.getFifoStream();\n \n logDetailed(\"Opened fifo file \" + data.fifoFilename + \" for writing.\");\n }", "public abstract void waitForFilesToBeWritten(CompilerMessageLogger logger) throws InterruptedException;", "protected void post_commit_hook() { }", "public void commit() throws ResourceException;", "public void voteCommit() {\n boolean b = preVote();\n synchronized ( this ) {\n if ( b == true ) \n commitVotes++; \n else {\n rbVotes++;\n votedCommit = false;\n }\n }\n postVote();\n }", "public void waitCommandEnd()\n {\n System.out.println(\"Wait cmd\");\n //Set a flag in order to informe that we wait a end command\n ContextManager.getCMDHandler().setWaiting(true);\n //Wait the command end\n ContextManager.getCMDHandler().waitEndCmd();\n //Remove the flag\n ContextManager.getCMDHandler().setWaiting(false);\n System.out.println(\"End Wait cmd\");\n }", "public void commitChanges(){\r\n try{\r\n //Record the state of unfinished set in unfinished.dat\r\n unfinishedFileOutputStream = new FileOutputStream(UNFINISHED_FILE_PATH);\r\n unfinishedSetOutputStream = new ObjectOutputStream(unfinishedFileOutputStream);\r\n unfinishedSetOutputStream.writeObject(unfinished);\r\n unfinishedSetOutputStream.close();\r\n unfinishedFileOutputStream.close();\r\n\r\n //Record the state of finished list in finished.dat\r\n finishedFileOutputStream = new FileOutputStream(FINISHED_FILE_PATH);\r\n finishedListOutputStream = new ObjectOutputStream(finishedFileOutputStream);\r\n finishedListOutputStream.writeObject(finished);\r\n finishedListOutputStream.close();\r\n finishedFileOutputStream.close();\r\n\r\n //Record the state of activities list in activities.dat\r\n activitiesFileOutputStream = new FileOutputStream(ACTIVITIES_FILE_PATH);\r\n activitiesListOutputStream = new ObjectOutputStream(activitiesFileOutputStream);\r\n activitiesListOutputStream.writeObject(activities);\r\n activitiesListOutputStream.close();\r\n activitiesFileOutputStream.close();\r\n }\r\n catch(Exception e){\r\n System.out.println(\"Stress in commiting changes: \" + e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }", "public void commit(Writer output) throws IOException {\n postData(new StringReader(\"<commit/>\"), output);\n }", "public synchronized void beginWrite() {\n\t\tSystem.out.println(\"WRITER BEGIN: \" + Thread.currentThread().getId());\t\n\t\tint writeTurn = currentTurn;\n\t\tcurrentTurn++;\n\n\t\twhile(writeTurn != nextTurn || numReaders > 0 || numWriters > 0 ){ \n\t\t\t/********WAIT CALL*********/\n\t\t\ttry {\n//\t\t\tSystem.out.println(\"WRITER BLOCKED: \" + Thread.currentThread().getId());\t\n\t\t\t\tthis.wait();\n//\t\t\tSystem.out.println(\"WRITER UNBLOCKED: \" + Thread.currentThread().getId());\t\n\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t/**************************/\n\t\t}\n\t\t\n\t\t//Only increment when the writer is not blocked\n\t\t// (it is at front of queue)\n\t\tnumWriters++;\n\n\t}", "public synchronized void finishWriting() {\n readerNumber++; // readerNumber = -1 + 1 = 0; \n// readerNumber must be 0 at this point \n this.notifyAll(); // notify possible waiting writers or waiting readers \n }", "boolean isFlush();", "public Status waitUntilFinished();", "public void storeAndCommit() {\n \tsynchronized(mDB.lock()) {\n \t\ttry {\n \t \t\tstoreWithoutCommit();\n \t \t\tcheckedCommit(this);\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \t}\n }", "public void commit() {\n\t\ttry {\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"完了したコミット/Commit Done\");\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Commit Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void commitChanges()\n {\n }", "private void sendTransactionQueue(final List<TransactionData> queue, final Path path) {\n List<Long> setsToIgnore = new ArrayList<Long>();\n for (TransactionData txn : queue) {\n setsToIgnore.add(txn.currentWriteId);\n }\n\n Node latestState = this.getLatestState(path, setsToIgnore);\n Node snapToSend = latestState;\n String latestHash = \"badhash\";\n if (!hijackHash) {\n latestHash = latestState.getHash();\n }\n\n for (TransactionData txn : queue) {\n hardAssert(\n txn.status\n == TransactionStatus.RUN); // sendTransactionQueue: items in queue should all be run.'\n txn.status = TransactionStatus.SENT;\n txn.retryCount++;\n Path relativePath = Path.getRelative(path, txn.path);\n // If we've gotten to this point, the output snapshot must be defined.\n snapToSend = snapToSend.updateChild(relativePath, txn.currentOutputSnapshotRaw);\n }\n\n Object dataToSend = snapToSend.getValue(true);\n\n final Repo repo = this;\n\n // Send the put.\n connection.compareAndPut(\n path.asList(),\n dataToSend,\n latestHash,\n new RequestResultCallback() {\n @Override\n public void onRequestResult(String optErrorCode, String optErrorMessage) {\n DatabaseError error = fromErrorCode(optErrorCode, optErrorMessage);\n warnIfWriteFailed(\"Transaction\", path, error);\n List<Event> events = new ArrayList<Event>();\n\n if (error == null) {\n List<Runnable> callbacks = new ArrayList<Runnable>();\n for (final TransactionData txn : queue) {\n txn.status = TransactionStatus.COMPLETED;\n events.addAll(\n serverSyncTree.ackUserWrite(\n txn.currentWriteId, /*revert=*/ false, /*persist=*/ false, serverClock));\n\n // We never unset the output snapshot, and given that this\n // transaction is complete, it should be set\n Node node = txn.currentOutputSnapshotResolved;\n final DataSnapshot snap =\n InternalHelpers.createDataSnapshot(\n InternalHelpers.createReference(repo, txn.path), IndexedNode.from(node));\n\n callbacks.add(\n new Runnable() {\n @Override\n public void run() {\n txn.handler.onComplete(null, true, snap);\n }\n });\n // Remove the outstanding value listener that we added\n removeEventCallback(\n new ValueEventRegistration(\n Repo.this,\n txn.outstandingListener,\n QuerySpec.defaultQueryAtPath(txn.path)));\n }\n\n // Now remove the completed transactions\n pruneCompletedTransactions(transactionQueueTree.subTree(path));\n\n // There may be pending transactions that we can now send\n sendAllReadyTransactions();\n\n repo.postEvents(events);\n\n // Finally, run the callbacks\n for (int i = 0; i < callbacks.size(); ++i) {\n postEvent(callbacks.get(i));\n }\n } else {\n // transactions are no longer sent. Update their status appropriately\n if (error.getCode() == DatabaseError.DATA_STALE) {\n for (TransactionData transaction : queue) {\n if (transaction.status == TransactionStatus.SENT_NEEDS_ABORT) {\n transaction.status = TransactionStatus.NEEDS_ABORT;\n } else {\n transaction.status = TransactionStatus.RUN;\n }\n }\n } else {\n for (TransactionData transaction : queue) {\n transaction.status = TransactionStatus.NEEDS_ABORT;\n transaction.abortReason = error;\n }\n }\n\n // since we reverted mergedData, we should re-run any remaining\n // transactions and raise events\n rerunTransactions(path);\n }\n }\n });\n }", "public boolean syncCommitPhase() {\n return syncCommitPhase;\n }", "public void commit() throws IOException {\n\t\t\tif (hasErrors) {\n\t\t\t\tcompleteEdit(this, false);\n\t\t\t\tremove(entry.key); // the previous entry is stale\n\t\t\t} else {\n\t\t\t\tcompleteEdit(this, true);\n\t\t\t}\n\t\t}", "void commit(String tpcid);", "void commit( boolean onSave );", "private static synchronized void writeTransaction( StmTransaction transaction ) {\n\n // Check for conflicts.\n for ( AbstractVersionedItem versionedItem : transaction.versionedItemsRead ) {\n versionedItem.ensureNotWrittenByOtherTransaction();\n }\n\n // Set the revision number to a committed value.\n transaction.targetRevisionNumber.set( lastCommittedRevisionNumber.incrementAndGet() );\n\n }", "void commit(IDevTree tree, Map options) throws IOException;", "protected void waitUntilCommandFinished() {\n }", "private void doneUpdate(long transaction) throws RequestIsOutException {\n\t\t\tassert this.lastSentTransaction == null || transaction > this.lastSentTransaction;\n\t\t\t\n\t\t\tthis.sendLock.readLock().unlock();\n\t\t}", "private boolean worthWaiting() {\n return !PsiDocumentManager.getInstance(myProject).hasUncommitedDocuments() && !ApplicationManager.getApplication().isWriteAccessAllowed() && !FileEditorsSplitters.isOpenedInBulk(myTextEditor.myFile);\n }", "public synchronized void setCommitted(CommitInfo info) {\n\t\t// We can't be committed twice.\n\t\tAssert.assertTrue(null == _commitInfo);\n\t\t// The commit offset must be a positive number.\n\t\tAssert.assertTrue(info.intentionOffset > 0L);\n\t\t\n\t\t_commitInfo = info;\n\t\tthis.notifyAll();\n\t}", "void waitToRead();", "public void commit () throws IOException {\n log.info(\"Internal committing index ... \");\n this.writer().commit();\n commitCounter = 0;\n this.closeReader();\n }", "public void startFileWrite() {\r\n this.setStatus(false);\r\n this.isFileOutStarted = true;\r\n if (!this.is_alg_started || (this.is_alg_started && ((this.is_already_read_from_DB && this.UseFile.isSelected())\r\n || (!this.is_already_read_from_DB && this.UseDB.isSelected())))) {\r\n this.startALG(true);\r\n } else {\r\n Thread t = new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Controller.this.writeIntoFiles.setVisible(true);\r\n Controller.this.isFileWriteInUse = true;\r\n Controller.this.cw.setWritesOnlyFiles(true);\r\n Controller.this.cw.writeFile(true, true, false);\r\n }// run()\r\n });// Thread\r\n t.start();\r\n Timer timer = new Timer();\r\n timer.schedule(new ObserveProgress(timer, t), 200, 2000);\r\n this.isFileOutStarted = false;\r\n }\r\n }", "@Override\n public void commitTx() {\n \n }", "private void waitForWriting(final Locale locale) {\n final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(\n mContext, locale);\n dict.waitAllTasksForTests();\n }", "public void startDBWrite() {\r\n this.setStatus(false);\r\n this.isDBOutStarted = true;\r\n if (!this.is_alg_started || (this.is_alg_started && ((this.is_already_read_from_DB && this.UseFile.isSelected())\r\n || (!this.is_already_read_from_DB && this.UseDB.isSelected())))) {\r\n this.startALG(true);\r\n } else {\r\n // setStatus(true);\r\n\r\n Thread t = new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Controller.this.isDBWriteInUse = true;\r\n Controller.this.writeIntoDBProgress.setVisible(true);\r\n Controller.this.cw.setWritesOnlyFiles(true);\r\n Controller.this.cw.writeFile(false, false, false);\r\n String pw = \"\";\r\n for (int i = 0; i < Controller.this.rpasswdfield.getPassword().length; i++)\r\n pw += Controller.this.rpasswdfield.getPassword()[i];\r\n\r\n Controller.this.dbc_in = new DBConnect(Controller.this.rhostfield.getText(),\r\n Controller.this.rdatabasefield.getText(), Controller.this.ruserfield.getText(), pw,\r\n Integer.parseInt(Controller.this.rportfield.getText()),\r\n Controller.this.otablenamefield.getText(), COLUMN_NAMES_FOR_DB_OUT);\r\n\r\n // File: Controller.CLASSES_TMP_FILENAME\r\n // Columns: Controller.COLUMN_NAMES_FOR_DB_OUT\r\n try {\r\n Controller.this.dbc_in.stillWorks = true;\r\n Controller.this.dbc_in.maxProgerss = Controller.this.cw.countNodesWithClasses;\r\n Controller.this.dbc_in.writeFromFileIntoDB();\r\n } catch (IOWrapperException iow_e) {\r\n System.err.println(\"Error while writing into DB!\\nConnection failed!\");\r\n JOptionPane.showMessageDialog(null, \"Error while writing into DB!\\nConnection failed!\", \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n Controller.this.dBInError = true;\r\n Controller.this.dbc_in.stillWorks = false;\r\n return;\r\n } catch (IOIteratorException ioi_e) {\r\n System.err.println(\"Error while writing into DB!\\nCould not iterate over results!\");\r\n JOptionPane.showMessageDialog(null,\r\n \"Error while writing into DB!\\nCould not iterate over results!\", \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n Controller.this.dBInError = true;\r\n Controller.this.dbc_in.stillWorks = false;\r\n return;\r\n }\r\n }// run()\r\n });// Thread\r\n\r\n t.start();\r\n Timer timer = new Timer();\r\n timer.schedule(new ObserveProgress(timer, t), 200, 2000);\r\n this.isDBOutStarted = false;\r\n }\r\n }", "void flushBlocking();", "public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }", "public GlBuffer commit(){\n return commit(true);\n }", "public void commit() {\r\n for (Iterator<Connection> it = connections.values().iterator(); it.hasNext();) {\r\n Connection conn = it.next();\r\n try {\r\n conn.commit();\r\n } catch (SQLException ex) {\r\n log.severe(\"Partial commit failure: \" + ex.getMessage());\r\n }\r\n }\r\n closeConnections();\r\n }", "public synchronized void writeCheckpoint() {\n\t\tflush();\n\t\tpw.println(\"CHECKPOINT \" \n\t\t\t\t\t+ TransactionManager.instance().transactionList());\n\t\tflush();\n\t}", "void synchronizationDone();", "public void commit() {\n\t\tif (commit) {\n\t\t\t// Récupérer le path du JSON\n\t\t\tSystem.out.println(ClassLoader.getSystemResource(jsonFile));\n\t\t\tURL url = ClassLoader.getSystemResource(jsonFile);\n\t\t\t// On ouvre un flux d'écriture vers le fichier JSON\n\t\t\ttry (OutputStream ops = new FileOutputStream(Paths.get(url.toURI()).toFile())) {\n\t\t\t\t// Ecriture du fichier JSON avec formatage\n\t\t\t\t// (WithDefaultPrettyPrinter)\n\t\t\t\tobjectMapper.writerWithDefaultPrettyPrinter().writeValue(ops, database);\n\t\t\t\tlogger.info(\"OK - fichier JSON mis à jour \" + jsonFile);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tlogger.info(\"KO - FILE_NOT_FOUND\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - FILE_NOT_FOUND\", e);\n\t\t\t} catch (IOException e) {\n\t\t\t\tlogger.info(\"KO - I/O ERROR\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - I/O ERROR\", e);\n\t\t\t} catch (URISyntaxException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void errorWhenCommitting();", "R commit(C change);", "public boolean commit(Connection conn) throws SQLException {\n boolean status = true;\n try {\n // Start of system transaction\n conn.setAutoCommit(false);\n BookingMapper bm = new BookingMapper();\n status = status && bm.addNewBooking(newBooking, conn);\n status = status && bm.updateBooking(modifiedBooking, conn);\n status = status && bm.deleteBooking(deleteBooking, conn);\n if (!status) {\n\n throw new Exception(\"Business Transaction aborted\");\n }\n // System transaction ends with success\n conn.commit();\n } catch (Exception e) {\n System.out.println(\"fail in UnitOfWork - commit()\");\n System.err.println(e);\n // System transaction fails, rollsback\n conn.rollback();\n status = false;\n }\n return status;\n }", "public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for proj1\n\n \t\n \t//commit, flush the pages\n \tif(commit){\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tflushPage(pageId);\n \t\t\t\tpage.setBeforeImage();\n \t\t\t}\n\n if (page.isDirty() == null) {\n page.setBeforeImage();\n }\n \t\t\t\n \t\t}\n \t}\n \telse{\n \t\tfor(PageId pageId : bufferedPages.keySet()){\n \t\t\tPage page = bufferedPages.get(pageId).page;\n \t\t\t//dirty page, revert changes\n \t\t\tif(page.isDirty() != null && tid.equals(page.isDirty())){\n \t\t\t\tNode n = bufferedPages.get(pageId);\n \t\t\t\tn.page = page.getBeforeImage();\n \t\t\t\tbufferedPages.put(pageId, n);\n // updateLruWithNewNode(pageId, page.getBeforeImage());\n \t\t\t}\n \t\t\t\n \t\t}\n \t}\n \t\n \t//release the lock\n \tlockManager.releaseAllTransactionLocks(tid);\n \tcurrentTransactions.remove(tid);\n \t\n }", "@Test\n public void testCommitLifecycle() throws Exception {\n describe(\"Full test of the expected lifecycle:\\n\" +\n \" start job, task, write, commit task, commit job.\\n\" +\n \"Verify:\\n\" +\n \"* no files are visible after task commit\\n\" +\n \"* the expected file is visible after job commit\\n\");\n JobData jobData = startJob(false);\n JobContext jContext = jobData.jContext;\n TaskAttemptContext tContext = jobData.tContext;\n ManifestCommitter committer = jobData.committer;\n assertCommitterFactoryIsManifestCommitter(tContext,\n tContext.getWorkingDirectory());\n validateTaskAttemptWorkingDirectory(committer, tContext);\n\n // write output\n describe(\"1. Writing output\");\n final Path textOutputPath = writeTextOutput(tContext);\n describe(\"Output written to %s\", textOutputPath);\n\n describe(\"2. Committing task\");\n Assertions.assertThat(committer.needsTaskCommit(tContext))\n .as(\"No files to commit were found by \" + committer)\n .isTrue();\n commitTask(committer, tContext);\n final TaskManifest taskManifest = requireNonNull(\n committer.getTaskAttemptCommittedManifest(), \"committerTaskManifest\");\n final String manifestJSON = taskManifest.toJson();\n LOG.info(\"Task manifest {}\", manifestJSON);\n int filesCreated = 1;\n Assertions.assertThat(taskManifest.getFilesToCommit())\n .describedAs(\"Files to commit in task manifest %s\", manifestJSON)\n .hasSize(filesCreated);\n Assertions.assertThat(taskManifest.getDestDirectories())\n .describedAs(\"Directories to create in task manifest %s\",\n manifestJSON)\n .isEmpty();\n\n // this is only task commit; there MUST be no part- files in the dest dir\n try {\n RemoteIterators.foreach(getFileSystem().listFiles(outputDir, false),\n (status) ->\n Assertions.assertThat(status.getPath().toString())\n .as(\"task committed file to dest :\" + status)\n .contains(\"part\"));\n } catch (FileNotFoundException ignored) {\n log().info(\"Outdir {} is not created by task commit phase \",\n outputDir);\n }\n\n describe(\"3. Committing job\");\n\n commitJob(committer, jContext);\n\n // validate output\n describe(\"4. Validating content\");\n String jobUniqueId = jobData.jobId();\n ManifestSuccessData successData = validateContent(outputDir,\n true,\n jobUniqueId);\n // look in the SUMMARY\n Assertions.assertThat(successData.getDiagnostics())\n .describedAs(\"Stage entry in SUCCESS\")\n .containsEntry(STAGE, OP_STAGE_JOB_COMMIT);\n IOStatisticsSnapshot jobStats = successData.getIOStatistics();\n // manifest\n verifyStatisticCounterValue(jobStats,\n OP_LOAD_MANIFEST, 1);\n FileStatus st = getFileSystem().getFileStatus(getPart0000(outputDir));\n verifyStatisticCounterValue(jobStats,\n COMMITTER_FILES_COMMITTED_COUNT, filesCreated);\n verifyStatisticCounterValue(jobStats,\n COMMITTER_BYTES_COMMITTED_COUNT, st.getLen());\n\n // now load and examine the job report.\n // this MUST contain all the stats of the summary, plus timings on\n // job commit itself\n\n ManifestSuccessData report = loadReport(jobUniqueId, true);\n Map<String, String> diag = report.getDiagnostics();\n Assertions.assertThat(diag)\n .describedAs(\"Stage entry in report\")\n .containsEntry(STAGE, OP_STAGE_JOB_COMMIT);\n IOStatisticsSnapshot reportStats = report.getIOStatistics();\n verifyStatisticCounterValue(reportStats,\n OP_LOAD_MANIFEST, 1);\n verifyStatisticCounterValue(reportStats,\n OP_STAGE_JOB_COMMIT, 1);\n verifyStatisticCounterValue(reportStats,\n COMMITTER_FILES_COMMITTED_COUNT, filesCreated);\n verifyStatisticCounterValue(reportStats,\n COMMITTER_BYTES_COMMITTED_COUNT, st.getLen());\n\n }", "protected abstract long waitOnQueue();", "public int prepare(Xid id) {\n try {\n log.debug(\"Unblocking commit\");\n l.await();\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n return XAResource.XA_OK;\n }", "public void run() {\n\t\twhile(running){\n\t\t\t\n\t\t\tif (!thingsToWrite.isEmpty()){\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tString s = (String) thingsToWrite.get(0);\n\t\t\t\t\tif(s.equals(\"file\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\t//write \"files\"\n\t\t\t\t\t\toos.writeObject(thingsToWrite.getNRemoveFirst());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//need to wait for synchro //HARDCODED, ideal : 1 command\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//write the dataObject\n\t\t\t\t\t\toos.writeObject(thingsToWrite.getNRemoveFirst());\n\n\t\t\t\t\t\t//need to wait for synchro //HARDCODED, ideal : 1 command\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//write the file\n\t\t\t\t\t\tbyte[] content = ( byte[] )thingsToWrite.getNRemoveFirst();\n\t\t\t\t\t\toos.writeObject(content);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"file Sent\");\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(s.startsWith(\"addRepo\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\toos.writeObject(s);\n\t\t\t\t\t\tthingsToWrite.remove(0);\n\t\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\t\toos.writeObject(s);\n\t\t\t\t\t\tthingsToWrite.remove(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (IOException | InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "byte[] submit() throws CommitException;", "public int flush()\n/* */ {\n/* 145 */ return 0;\n/* */ }", "void sync()throws IOException;", "public synchronized void updateCommitNumber()\n\t{\n\t\tm_dbCommitNum++;\n\t}", "protected void submitCommand(ServoCommand cmd){\r\n if(cmd==null){\r\n log.warning(\"null cmd submitted to servo command queue\");\r\n return;\r\n }\r\n if(submittedCmdAfterOpen && cmd.equals(lastCmd)){\r\n return; // don't just duplicate command already sent since open\r\n }\r\n if(errorString!=null){\r\n log.warning(errorString);\r\n close();\r\n return;\r\n }\r\n if(!servoQueue.offer(cmd)){ // if queue is full, just clear it and replace with latest command\r\n servoQueue.clear();\r\n servoQueue.offer(cmd);\r\n submittedCmdAfterOpen=true;\r\n if(clearedQueueWarningCount++%PRINT_QUEUE_CLEARED_INTERVAL==0){\r\n log.warning(\"cleared queue to submit latest command (only logging this warning every \"+PRINT_QUEUE_CLEARED_INTERVAL+\" times)\"); // TODO add limited number of warnings here\r\n }\r\n }\r\n lastCmd=cmd;\r\n Thread.yield(); // let writer thread get it and submit a write\r\n }" ]
[ "0.74132466", "0.72142136", "0.6960489", "0.6522757", "0.6475288", "0.63949835", "0.62955254", "0.62870145", "0.6108766", "0.6102421", "0.60991144", "0.60991144", "0.6054964", "0.6054955", "0.6003422", "0.5989295", "0.5905239", "0.5897995", "0.5891525", "0.5876597", "0.5814583", "0.57966906", "0.57651937", "0.5750597", "0.57219505", "0.57129747", "0.5673563", "0.56728184", "0.565535", "0.56099993", "0.56087", "0.56014365", "0.55996925", "0.5598967", "0.5592091", "0.55876696", "0.55797386", "0.5570495", "0.5542351", "0.55216116", "0.55121547", "0.55104154", "0.55027765", "0.54958355", "0.54954475", "0.5489249", "0.5483501", "0.54693645", "0.5461151", "0.5450828", "0.5447614", "0.5440745", "0.5430924", "0.5421566", "0.54201865", "0.5417863", "0.54171526", "0.54084945", "0.53997576", "0.5399059", "0.53954405", "0.5388509", "0.537689", "0.53635144", "0.5357768", "0.5357161", "0.5349349", "0.53375876", "0.5334128", "0.5319992", "0.53160197", "0.5314809", "0.53133345", "0.53114367", "0.5305826", "0.53047717", "0.5301207", "0.52960896", "0.52872276", "0.5282834", "0.5274354", "0.5253711", "0.5238708", "0.5236235", "0.5223958", "0.5220312", "0.5217272", "0.52127945", "0.5198818", "0.51968235", "0.51937634", "0.5180469", "0.51762724", "0.5172112", "0.51592094", "0.5151587", "0.5139794", "0.51364315", "0.5128243", "0.51197785" ]
0.7228415
1
function to wait for disk read
public void readWait() { try{ waitLock.lock(); while(readSector != -1){ readDone.awaitUninterruptibly(); } return; } finally{ waitLock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void waitToRead();", "void waitToWrite();", "public void logReadWait()\n {\n try{\n waitLock.lock();\n while(logReadSector != -1){\n \t logReadDone.awaitUninterruptibly();\n }\n return;\n }\n finally{\n waitLock.unlock();\n }\n }", "private void waitBetweenRead() {\n\t\ttry {\n\t\t\twait(250); // wait 250 ms before collecting data again\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "public final void waitForData(long tmo) {\n\n\t\t//\tCheck if the file data has been loaded, if not then wait\n\t\t\n\t\tif ( isDataAvailable() == false) {\n\t\t\tsynchronized ( this) {\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t//\tWait for file data\n\t\t\t\t\t\n\t\t\t\t\twait(tmo);\n\t\t\t\t}\n\t\t\t\tcatch ( InterruptedException ex) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void waitForAvailable() throws IOException, ReadTimeoutException {\n\t\tlong expireTime = System.currentTimeMillis() + READ_TIMEOUT;\n\t\twhile (inputStream.available() < 1) {\n\t\t\tif (System.currentTimeMillis() > expireTime) {\n\t\t\t\tthrow new ReadTimeoutException(\"Read Timed Out.\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tThread.sleep(SLEEP_TIME);\n\t\t\t} catch (InterruptedException ie) {\n\t\t\t}\n\t\t}\n\t}", "public void waitUntilReady() throws IOException, InterruptedException {\n while (ready() == 0) {\n Thread.sleep(10);\n }\n }", "public static void waitFilesystemTime() throws InterruptedException {\n /*\n * How much time to wait until we are sure that the file system will update the last\n * modified timestamp of a file. This is usually related to the accuracy of last timestamps.\n * In modern windows systems 100ms be more than enough (NTFS has 100us accuracy --\n * see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724290(v=vs.85).aspx).\n * In linux it will depend on the filesystem. ext4 has 1ns accuracy (if inodes are 256 byte\n * or larger), but ext3 has 1 second.\n */\n Thread.sleep(2000);\n }", "public void waitForData() {\n waitForData(1);\n }", "public native int getDiskIO();", "private void waitOnReceive() throws IOException {\n while (inStream.available() == 0) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException _) {\n }\n }\n }", "public void waitForData(int minNumBytes) {\n try {\n\n while (available() < minNumBytes) {\n Thread.sleep(500);\n }\n }\n catch (InterruptedException e) {\n System.out.println(\"#### Thread interrupted -- could be big trouble\");\n }\n catch(Exception e){}\n }", "protected abstract long waitOnQueue();", "private void waitForFree() throws InterruptedException {\n // Still full?\n while (isFull()) {\n // Park me 'till something is removed.\n block.await();\n }\n }", "@Override\n public void checkTaskStillAvailable(String path) {\n this.watcher\n .getRecoverableZooKeeper()\n .getZooKeeper()\n .getData(path, this.watcher, new GetDataAsyncCallback(),\n Long.valueOf(-1) /* retry count */);\n SplitLogCounters.tot_mgr_get_data_queued.incrementAndGet();\n }", "public void doWait(){\n\t\tsynchronized(m){\n\t\t\ttry{\n\t\t\t\tm.wait(32000,0);\n\t\t\t} catch(InterruptedException e){}\n\t\t}\n\t}", "private int waitUntilReady()\r\n {\r\n int rc = 0;\r\n // If a stock Item is in the Table, We do not want to start\r\n // The Lookup, if the name of the stock has not been identified.\r\n // here we will wait just a couple a second at a time.\r\n // until, the user has entered the name of the stock.\r\n // MAXWAIT is 20 minutes, since we are 1 second loops.\r\n // 60 loops is 1 minute and 20 of those is 20 minutes\r\n final int MAXWAIT = 60 * 20;\r\n int counter = 0;\r\n do\r\n {\r\n try\r\n {\r\n Thread.currentThread().sleep(ONE_SECOND);\r\n }\r\n catch (InterruptedException exc)\r\n {\r\n // Do Nothing - Try again\r\n }\r\n if (counter++ > MAXWAIT)\r\n { // Abort the Lookup for historic data\r\n this.cancel();\r\n return -1;\r\n }\r\n }\r\n while (\"\".equals(sd.getSymbol().getDataSz().trim()));\r\n\r\n return 0;\r\n }", "private void waitUntilReady() {\n\t\t\twhile (deque.isEmpty() && loadThread.isAlive()) {\n//\t\t\t\ttry {\n//\t\t\t\t\tThread.sleep(100);\n//\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\tExceptionUtils.throwAsRuntimeException(e);\n//\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n currentContent = FileAccessServiceLocator.getStockOrderFileAccess().read();\n while (true) {\n String newlyReadContent = FileAccessServiceLocator.getStockOrderFileAccess().read();\n if (!newlyReadContent.equals(currentContent) || !newlyReadContent.isEmpty()){\n notify(newlyReadContent);\n currentContent = newlyReadContent;\n }\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n//end of modifiable zone..................E/bfb5c4c0-88e6-44fa-9add-89d5b4394004\n }", "public final synchronized void signalDataAvailable() {\n\n\t\t//\tNotify any waiting threads that the file data ia available\n\t\t\t\n\t\tnotifyAll();\n\t}", "@Override\n\tpublic void run() {\n\t\twhile(run)\n\t\t{\n\t\t\tSystem.out.println(\"status : \" + this.filesize + \" Byte\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\tThread.sleep(this.wait);\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "long tryReadLock(long timeout) throws InterruptedException;", "public void testDiskIO() {\n DiskIOThreadPool threadPool = cache.getThreadPool();\n final int N = 103 + rng.nextInt(256);\n byte[][] data = new byte[N][];\n byte[][] key = new byte[N][];\n NodeID[] id = new NodeID[N];\n\n PutBack[] putBack = new PutBack[N];\n for (int i = 0; i < N; i++) {\n int len = 64 + rng.nextInt(128);\n data[i] = new byte[len];\n rng.nextBytes(data[i]);\n key[i] = sha1.digest(data[i]);\n id[i] = new NodeID(key[i]);\n putBack[i] = new PutBack();\n cache.acceptWriteJob(id[i], data[i], putBack[i]);\n }\n waitForCallBacks(putBack);\n for (int i = 0; i < N ; i++) {\n assertEquals(\"callback \" + i + \" not OK: \",\n CallBack.OK, putBack[i].status);\n }\n GetBack[] getBack = new GetBack[N];\n for (int i = 0; i < N; i++) {\n getBack[i] = new GetBack();\n cache.acceptReadJob(id[i], getBack[i]);\n }\n waitForCallBacks(getBack);\n for (int i = 0; i < N ; i++ ) {\n assertEquals(CallBack.OK, getBack[i].status);\n byte[] diskData = getBack[i].data;\n assertNotNull(diskData);\n assertEquals(data[i].length, diskData.length);\n for (int j = 0; j < data[i].length; j++)\n assertEquals (\"data[\" + i + \"][\" + j + \"] discrepency: \",\n data[i][j], diskData[j]);\n }\n }", "private native int waitUntilMessageAvailable0(int port, int handle)\n throws IOException;", "protected int waitUntilMessageAvailable00(int handle) \n throws IOException {\n return waitUntilMessageAvailable0(m_iport, handle);\n }", "public static void myWait()\n {\n try \n {\n System.in.read();\n \n System.in.read();\n //pause\n }\n catch(Exception e)\n {\n }\n }", "private void startRead() {\n ExecutorService service = Executors.newFixedThreadPool(this.countReadThreads);\n while (!this.files.isEmpty() || !this.isWorkSearch()) {\n service.submit(this.threads.getReadThread());\n }\n service.shutdown();\n }", "boolean isPendingToRead();", "protected void waitUntilCommandFinished() {\n }", "public int available() throws IOException;", "private void waitFor() {\n if (done) {\n return;\n }\n\n synchronized (waitObj) {\n while (!done) {\n try {\n waitObj.wait();\n } catch (InterruptedException ex) {\n ex.printStackTrace(System.err);\n }\n }\n }\n if (excpetion != null) {\n throw excpetion;\n }\n }", "protected abstract long waitToTravel();", "public Status waitUntilFinished();", "protected void waitDownloads() throws Exception {\n runtimeWrapper.newCommand();\n }", "ProcessRunner waitFor();", "private void doRecoveryRead() {\n if (!promise.isDone()) {\n startEntryToRead = endEntryToRead + 1;\n endEntryToRead = endEntryToRead + clientCtx.getConf().recoveryReadBatchSize;\n new RecoveryReadOp(lh, clientCtx, startEntryToRead, endEntryToRead, this, null)\n .initiate();\n }\n }", "public abstract void executeOnDiskIO(@NonNull Runnable runnable);", "public synchronized void waitForDone() {\n\twhile (!done) myWait();\n }", "public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }", "public synchronized List getBufferForReading() {\n// if some writer is writing, wait until no writer is writing \n while (readerNumber < 0) {\n try {\n this.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n// when readerNumber >= 0 \n readerNumber++;\n return buffer;\n }", "public final void waitFor() {\r\n for (;;) {\r\n synchronized (this) {\r\n if (this.m_b)\r\n return;\r\n try {\r\n this.wait();\r\n } catch (Throwable tt) {\r\n tt.printStackTrace();\r\n }\r\n }\r\n }\r\n }", "void acquireReadLock() throws InterruptedException;", "protected void doBeginRead() throws Exception {}", "public void read() {\n synchronized (this) {\n while (events.size() == 0) {\n try {\n wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n System.out.printf(\"Read :%d,%s\\n\",\n events.size(), events.poll());\n notify();\n }\n }", "public void doWait() {\n\t\tsynchronized(lock) {\n\t\t\twhile(!wasSignalled) {\n\t\t\t\ttry {\n\t\t\t\t\tlock.wait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\twasSignalled = false;\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void progressMade() {\n\t\t\t\twriteReadSemaphore.refreshReadLock(lockKey, readToken, lockTimeoutSec);\r\n\t\t\t}", "static void waitForBlockCommit() {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "protected int getWait() \t\t\t\t{\treturn wait;\t\t}", "public static String monitorDownload() throws InterruptedException, IOException {\n return monitorDownload(downloadDirectory, fileExtension);\n }", "private synchronized void block () throws IOException {\n //assert available == 0;\n int n = selector.select ();\n //assert n == 1;\n selector.selectedKeys().clear();\n available ();\n }", "@Override\n\tpublic void fileAvailable(int arg0, FDFile arg1) {\n\t\t\n\t}", "public void checkReadLock() {\r\n return;\r\n }", "public void waitUntilStarted() {\n mStarted.block();\n }", "public static void waitWhileLoading()\r\n {\r\n while (isLoading())\r\n ThreadUtil.sleep(10);\r\n }", "void confirmRead();", "public boolean fileIsReady()\n\t{\n\t\ttry\n\t\t{\n\t\t\tif(notFound)\n\t\t\t{\n\t\t\t\tisReady = false;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tisReady = reader.ready();\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException ioe)\n\t\t{\n\t\t\t//\n\t\t}\n\n\t\treturn isReady;\n\t}", "public void readSectorDiskOnly(TransID tid, int sectorNum, byte buffer[])\n throws IOException, IllegalArgumentException, \n IndexOutOfBoundsException{\t\t\t\t\t\t\t\t// Not quite done yet\n\t try{\n\t\t ADisk_lock.lock();\n\n\t readTid = tid.getTidfromTransID();\n\t readSector = sectorNum;\n d.startRequest(Disk.READ, tid.getTidfromTransID(), sectorNum, buffer);\n readWait();\n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tboolean bok = checkMinPath();\n\t\t\t\t\t\t\tif (bok) {\n\t\t\t\t\t\t\t\tcanRun = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (exitWhenGetNotLock) {// 获取不到锁,直接不执行,return\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\tif (canRun) {\n\t\t\t\t\t\t\t\t\tboolean bok1 = checkMinPath();\n\t\t\t\t\t\t\t\t\tif (bok1) {// 获取所成功\n\t\t\t\t\t\t\t\t\t\tgetLockSuccess();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"同步等待...\");\n\t\t\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (KeeperException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public synchronized int read() throws InterruptedException\n {\n while (bufferEmpty(\"Consumer\"))\n {\n // Console.println(\"Consumer\" + \" Waiting on Buffer\");\n\n this.wait();\n\n // bufferEmpty = bufferEmpty(\"Consumer\");\n }\n\n int out = theBuffer;\n // Console.println(\"Consumer reading \" + out + \" from Buffer\");\n theBuffer = 0;\n this.notify();\n\n return out;\n }", "public void waitForNewFiles() throws IOException {\n \n WatchService watcher = FileSystems.getDefault().newWatchService();\n Path dir = Paths.get(DATA_DIRECTORY);\n \n dir.register(watcher, ENTRY_CREATE);\n \n for (; ; ) {\n \n // wait for key to be signaled\n WatchKey key;\n try {\n key = watcher.take();\n } catch (InterruptedException x) {\n return;\n }\n \n for (WatchEvent<?> event : key.pollEvents()) {\n WatchEvent.Kind<?> kind = event.kind();\n \n \n if (kind == OVERFLOW) {\n continue;\n }\n \n \n WatchEvent<Path> ev = (WatchEvent<Path>) event;\n Path filename = ev.context();\n \n /* Verify that the new file is a text file.*/\n try {\n \n Path child = dir.resolve(filename);\n if (!Files.probeContentType(child).equals(\"text/plain\")) {\n System.err.format(\"New file '%s'\" +\n \" is not a plain text file.%n\", filename);\n continue;\n }\n \n \n } catch (IOException x) {\n System.err.println(x);\n continue;\n }\n \n \n /* Verify file name */\n if (!filename.toString().startsWith(\"posture_\") || !filename.toString().endsWith(\".txt\")) {\n continue;\n }\n \n \n try {\n processNewFile(DATA_DIRECTORY + filename.toString());\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }\n \n /* reset the key*/\n boolean valid = key.reset();\n if (!valid) {\n break;\n }\n }\n }", "int waitFor(String variable);", "public static void waitOnSafeMode(final Configuration conf, final long wait) throws IOException {\n FileSystem fs = FileSystem.get(conf);\n if (!(fs instanceof DistributedFileSystem)) return;\n DistributedFileSystem dfs = (DistributedFileSystem) fs;\n // Make sure dfs is not in safe mode\n while (isInSafeMode(dfs)) {\n LOG.info(\"Waiting for dfs to exit safe mode...\");\n try {\n Thread.sleep(wait);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw (InterruptedIOException) new InterruptedIOException().initCause(e);\n }\n }\n }", "private void ensureReadNonBuffered() throws IOException, BadDescriptorException {\n if (reading) {\n if (buffer.hasRemaining()) {\n Ruby localRuntime = getRuntime();\n if (localRuntime != null) {\n throw localRuntime.newIOError(\"sysread for buffered IO\");\n } else {\n throw new IOException(\"sysread for buffered IO\");\n }\n }\n } else {\n // libc flushes writes on any read from the actual file, so we flush here\n flushWrite();\n buffer.clear();\n buffer.flip();\n reading = true;\n }\n }", "int poll();", "public Long get_cachenummbreadfromdisk() throws Exception {\n\t\treturn this.cachenummbreadfromdisk;\n\t}", "private void waitConfigData() {\n\t\tstartListening();\n\t\twhile (!configDataSet) {\n\t\t\tsleep(10);\n\t\t}\n\t\tstopListening();\n\t}", "boolean hasRead();", "private static void waitForCrd(KubeClusterResource cluster, String name) {\n cluster.cmdClient().waitFor(\"crd\", name, crd -> {\n JsonNode json = (JsonNode) crd;\n if (json != null\n && json.hasNonNull(\"status\")\n && json.get(\"status\").hasNonNull(\"conditions\")) {\n return true;\n }\n\n return false;\n });\n }", "int waitFor(String variable, int count);", "public synchronized static int findEmptyPartition() {\n int index = NOT_FOUND; // no empty /dev/nbd partition is found\n File file = null;\n\n for (int i = 0; i < NBD_MAX_PART; i++) {\n // means the /dev/nbd[i] is available to map or bind an image\n file = new File(\"/dev/nbd\" + i + \"p\" + PARTITION_NUM);\n if (file.exists() == false) {\n index = i;\n break;\n }\n }\n\n // If all /dev/nbd partitions are busy, then force unmount /dev/nbd0\n if (index == NOT_FOUND) {\n LOG.debug(\"ics.core.io.FileUtils.findEmptyPartition(): Can't find an empty partition. Force unmount /dev/nbd0\");\n\n String command1 = \"sudo umount /dev/nbd0p1\";\n ProcessResult result = ShellUtil.executeShellCommand(command1);\n if (result.getExitCode() != 0) {\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Process exited abnormally. Exit code: \"\n + result.getExitCode());\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Output:\\n\"\n + result.getStandardError());\n }\n\n String command2 = \"sudo qemu-nbd -d /dev/nbd0\";\n result = ShellUtil.executeShellCommand(command2);\n if (result.getExitCode() != 0) {\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Process exited abnormally. Exit code: \"\n + result.getExitCode());\n LOG.error(\"ics.core.io.FileUtils.mountImage(): Output:\\n\"\n + result.getStandardError());\n }\n }\n\n LOG.debug(\"ics.core.io.FileUtils.findEmptyPartition(): Empty partition at /dev/nbd\"\n + index);\n return index;\n }", "@Override\n public boolean hasRemaining() throws IOException\n {\n return randomAccessRead.available() > 0;\n }", "public abstract int waitForObject (String appMapName, String windowName, String compName, long secTimeout)\n\t\t\t\t\t\t\t\t\t\t throws SAFSObjectNotFoundException, SAFSException;", "public void status_wait(UploadHandle h) throws Exception {\n \tStatusHandler sturl = (StatusHandler) h;\n String status = \"NA\";\n Integer time_check = 0;\n while(time_check < sturl.timeout && !status.equals(\"SUCCESS\"))\n {\n HttpResponse response = client.get(new URI(sturl.status_url));\n String statusxml = this.read_http_entity(response.getEntity());\n Document doc = this.db.parse(new ByteArrayInputStream(statusxml.getBytes(\"UTF-8\")));\n XPathExpression status_xpath = this.xPath.compile(\"//step[@id='\"+sturl.step.toString()+\"']/@status\");\n NodeList nodeList = (NodeList)status_xpath.evaluate(doc, XPathConstants.NODESET);\n for(int i=0; i<nodeList.getLength(); i++)\n {\n Node childNode = nodeList.item(i);\n status = childNode.getNodeValue();\n }\n Thread.sleep(1 * 1000);\n time_check++;\n }\n if(time_check == sturl.timeout) { throw new InterruptedException(\"Unable to check for completed upload status.\"); }\n }", "public void readSysCall() {\n read = false;\n clientChannel.read(readBuffer, this, readCompletionHandler);\n }", "private int read()\n\t{\n\t\ttry{\n\t\t\twhile(dev_in.available()==0);\n\t\t\treturn dev_in.read();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\n\t\treturn -1;\n\t}", "private void customWait() throws InterruptedException {\n while (!finished) {\n Thread.sleep(1);\n }\n finished = false;\n }", "@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tTask t = bq.take();\n\n\t\t\t\t\n\t\t\t\tThread.sleep(t.getProcessTime() * 1000);\n\t\t\t\twaitingTime.addAndGet((-1) * t.getProcessTime());\n\t\t\t\tSimulator.getFrame().displayData(\"Client \"+t.getNr()+\" left. \\n\");\n\t\t\t\tsize--;\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void fileReadLock_minLength() throws Exception {\n String filePath = RestAssured.given()\n .contentType(ContentType.BINARY)\n .body(new byte[] {})\n .post(\"/file/create/{name}\", FileRoutes.READ_LOCK_IN)\n .then()\n .statusCode(201)\n .extract()\n .body()\n .asString();\n\n String fileName = Paths.get(filePath).getFileName().toString();\n\n Thread.sleep(10_000L);\n\n // Read the file that should not be there (.done folder)\n RestAssured\n .get(\"/file/get/{folder}/{name}\", FileRoutes.READ_LOCK_IN + \"/.done\", fileName)\n .then()\n .statusCode(204);\n\n // Read the file that should not be there (output folder)\n RestAssured\n .get(\"/file/get/{folder}/{name}\", FileRoutes.READ_LOCK_OUT, fileName)\n .then()\n .statusCode(204);\n\n // Read the file that should be there (input folder)\n RestAssured\n .get(\"/file/get/{folder}/{name}\", FileRoutes.READ_LOCK_IN, fileName)\n .then()\n .statusCode(200);\n }", "public void waitForThread() {\n monitorState = true;\n while (monitorState) {\n synchronized (monitor) {\n try {\n monitor.wait(); // wait until notified\n } catch (Exception e) {}\n }\n }\n }", "synchronized void askForCritical() {\n\nSC=true;\n\nwhile(!Jeton){\n\ttry{\nthis.wait();\n\t}catch( InterruptedException ie ){\n\t\t\n\t}\n}\n}", "public void waitForReport() {\n CountDownLatch localLatch = crashReportDoneLatch;\n if (localLatch != null) {\n try {\n localLatch.await();\n } catch (InterruptedException e) {\n log.debug(\"Wait for report was interrupted!\", e);\n // Thread interrupted. Just exit the function\n }\n }\n }", "public void downloadStarted();", "public abstract boolean inReady() throws JVMIOException;", "private void getDriveContents() {\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n // get only the folders in the root directory of drive account\n List<File> files = getContents(TOP_LEVEL + \" and \" + NOT_TRASHED + \" and \" + FOLDER + \" and \" + NOT_SPREADSHEET);\n \n prune(targetDir, files);\n processLanguages(files);\n }\n });\n t.start();\n }", "public int monitorProgress() {\n int result = 0;\n if(iBypassCache) {\n try {\n result = this.iMaximum - available();\n } catch(IOException ioe) {\n throw new RuntimeException(\"Failure when monitoring real-time read progress!\");\n }\n } else {\n result = this.iMaximum - this.iRemainder;\n }\n return result;\n }", "private void ackRead() throws SIMException\n\t\t{\n\t\t\tfor (;;)\n\t\t\t{\n\t\t\t\t// Read a byte from memory\n\t\t\t\tif ((mode & MODE_TRANSFER_MASK) == MODE_TRANSFER_READ)\n\t\t\t\t{\n\t\t\t\t\tint v = transferFromMemory(this,base.getValue());\n\t\t\t\t\trequestRead.setDmaValue(v);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Increment / decrement address if requested\n\t\t\t\tif (hold == false)\n\t\t\t\t{\n\t\t\t\t\tif ((mode & MODE_DECREMENT) != 0)\n\t\t\t\t\t\tbase.decrement();\n\t\t\t\t\telse\n\t\t\t\t\t\tbase.increment();\n\n\t\t\t\t}\n\n\t\t\t\tif (isTerminate(requestRead))\n\t\t\t\t{\n\t\t\t\t\tterminateDma();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// In single transfer wait another dreq\n\t\t\t\tif ((mode & MODE_DMA_MASK) == MODE_DMA_SINGLE)\n\t\t\t\t{\n\t\t\t\t\tif (requestRead.getDmaDREQ() == false)\n\t\t\t\t\t{\n\t\t\t\t\t\trequest = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "public static void sync() {\n\t\tUiApplication.getUiApplication().addFileSystemJournalListener(fileListener);\n\t\tnew Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t// Find files sdcard\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.SDCARD)) {\n\t\t\t\t\tlogger.debug(\"Finding files on sdcard\");\n\t\t\t\t\tfindFiles(sdcardDir);\n\t\t\t\t}\n\t\t\t\t// Find files on eMMC\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.STORE)) {\n\t\t\t\t\tlogger.debug(\"Finding files on eMMC\");\n\t\t\t\t\tfindFiles(storeDir);\n\t\t\t\t}\n\n\t\t\t\t// Upload files to server\n\t\t\t\tFileLog.upload();\n\n\t\t\t}\n\t\t}.start();\n\t}", "private int requestBlock() throws InodeNotEnoughDiskSpaceExcepcion{\n\t\t\n\t\tint blockAddr;\n\t\t\n\t\tif((blockAddr = DiskFreeSpaceManager.getInstance().firstFreeBlock()) == -1){\n\t\t\tthrow new InodeNotEnoughDiskSpaceExcepcion(\"Not enough disk space.\");\n\t\t}\n\t\t\n\t\treturn blockAddr;\n\t}", "private void _wait() {\n\t\tfor (int i = 1000; i > 0; i--)\n\t\t\t;\n\t}", "@Override\n public void run() {\n downloadFile(Const.MONITOR_SERVER_ADDRESS, downFilePath);\n }", "public void read(IORequest request) throws MemoryFault {\n setBaseLimit();\n // sets what we need to be able to read\n int deviceNumber = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc);\n int platter = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 1);\n int platStart = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 2);\n int datasize = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 3);\n int memLoc = machine.memory.load(Process_Table[request.prognum].base + Process_Table[request.prognum].acc + 4) + Process_Table[request.prognum].base;\n// System.out.println(deviceNumber+\"device\");\n// System.out.println(platter+\"plat\");\n// System.out.println(platStart+\"Start\");\n// System.out.println(datasize+\"data\");\n// System.out.println(memLoc+\"mem\");\n\n Process_Table[currentProcess].status = ProcessState.waiting;\n\n machine.devices[deviceNumber].controlRegister.register[0] = DeviceControllerOperations.READ;\n machine.devices[deviceNumber].controlRegister.register[1] = platter;\n machine.devices[deviceNumber].controlRegister.register[2] = platStart;\n machine.devices[deviceNumber].controlRegister.register[3] = datasize;\n machine.devices[deviceNumber].controlRegister.latch();\n for (int i = 0; i < datasize; i++) {\n machine.memory.store(i + memLoc, machine.devices[deviceNumber].buffer[i]);\n\n }\n //System.out.println(waitQ[Machine.DISK1].size() + \" READ\");\n // initiate the latch\n\n }", "public Path pollFromFilesQueue() {\n Path resultDir;\n if (this.files.isEmpty()) {\n System.out.printf(\"%s.%s\", \"Queue is empty. Waiting\", System.getProperty(\"line.separator\"));\n }\n while (this.files.isEmpty()) {\n try {\n this.files.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n resultDir = this.files.poll();\n return resultDir;\n }", "@Test\n public void readWaiteForWriteTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n int readThreadNum = 5;\n final CountDownLatch countDownLatch = new CountDownLatch(6);\n final Set<Integer> readResult = new HashSet<Integer>();\n readResult.add(999);\n new Thread(new Runnable() {\n @Override\n public void run() {\n testUse.minusCountInWriteLock();\n countDownLatch.countDown();\n }\n }).start();\n Thread.sleep(2000);\n for (int i = 0; i < readThreadNum; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n readResult.add(testUse.getCountInReadLock());\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n Assert.assertEquals(1, readResult.size());\n }", "java.lang.String getDisk();", "Object getUptodatefile();", "public void Wait(){\r\n\t\ttry { worker.join(); }\r\n\t\tcatch (InterruptedException e) { e.printStackTrace(); }\r\n\t}", "public synchronized void beginRead() {\n\t\tSystem.out.println(\"READER BEGIN: \" + Thread.currentThread().getId());\t\n\t\tint readTurn = currentTurn;\n\t\tcurrentTurn++;\n\t\t\n\t\twhile(readTurn!=nextTurn || numWriters > 0 ){\n\t\t\ttry {\n//\t\t\t\tSystem.out.println(\"READER BLOCKED: \" + Thread.currentThread().getId());\t\n\t\t\t\twait();\n//\t\t\t\tSystem.out.println(\"READER UNBLOCKED: \" + Thread.currentThread().getId());\t\n\n\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//number of readers at front of the queue\n\t\t//(unblocked reader)\n\t\tnumReaders ++;\n\n\t}", "public synchronized void makeAvailable(){\n isBusy = false;\n }", "private void waitForServerReady() throws IOException, InterruptedException {\n\t\tfinal var httpget = new HttpGet(getPingUri());\n\t\tvar counter = 0;\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tif (HttpStatus.SC_OK == httpclient.execute(httpget, HttpResponse::getCode)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcheckRetries(counter);\n\t\t\t} catch (final HttpHostConnectException ex) { // NOSONAR - Wait, and check later\n\t\t\t\tlog.info(\"Check failed, retrying...\");\n\t\t\t\tcheckRetries(counter);\n\t\t\t}\n\t\t\tcounter++;\n\t\t}\n\t}", "public abstract void schedRequest (DiskRequest dr);" ]
[ "0.77252656", "0.6775101", "0.6751731", "0.6449337", "0.640364", "0.6296606", "0.61235064", "0.6121833", "0.6112788", "0.59350455", "0.59186774", "0.5816069", "0.5756689", "0.572632", "0.57150865", "0.56983924", "0.5684955", "0.567262", "0.56565505", "0.5636227", "0.563448", "0.5578412", "0.5554394", "0.55395347", "0.55217415", "0.54963064", "0.54854816", "0.5448838", "0.54262966", "0.54145825", "0.53992933", "0.539874", "0.5376392", "0.5358438", "0.5354772", "0.5347089", "0.53103065", "0.53006715", "0.52889556", "0.5278986", "0.5263864", "0.52505064", "0.5241716", "0.5233521", "0.5231591", "0.5200467", "0.5195024", "0.5183833", "0.51823676", "0.51765275", "0.51440006", "0.5135791", "0.5133849", "0.51322377", "0.5126538", "0.5115788", "0.5112605", "0.5107167", "0.5103952", "0.5091637", "0.5090781", "0.5081175", "0.50778586", "0.5074826", "0.5071256", "0.50657696", "0.50650775", "0.50608987", "0.50459486", "0.50294137", "0.5023193", "0.50120944", "0.50081414", "0.50063556", "0.49903584", "0.4989391", "0.49853197", "0.49806112", "0.49730077", "0.49609149", "0.4957773", "0.49543464", "0.4954252", "0.4953993", "0.4948974", "0.49447185", "0.49360093", "0.49304816", "0.4925813", "0.4924276", "0.4914085", "0.49126258", "0.49016842", "0.4900113", "0.48878288", "0.48875642", "0.48855305", "0.48847854", "0.48837927", "0.48793656" ]
0.7172326
1
function to wait for disk log
public void logReadWait() { try{ waitLock.lock(); while(logReadSector != -1){ logReadDone.awaitUninterruptibly(); } return; } finally{ waitLock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void waitToWrite();", "void waitToRead();", "private void waitForLogSpace(Connection conn, JdbcHelper jdbc) {\r\n this.curLogCounter.incrementAndGet();\r\n\r\n // only trigger the check every \"maxLogCounter\" checks\r\n if (this.curLogCounter.get() == maxLogCounter) {\r\n boolean firstTime = true;\r\n\r\n while (true) {\r\n int percentFull = getPercentLogFullInDb(conn, jdbc);\r\n\r\n int thresholdToCheck = firstTime ? stopLogSpaceThreshold : resumeLogSpaceThreshold;\r\n firstTime = false;\r\n\r\n if (percentFull < thresholdToCheck) {\r\n break;\r\n } else {\r\n try {\r\n Seconds seconds = Seconds.seconds(3);\r\n LOG.info(String\r\n .format(\"Pausing for %d seconds as the log level hit a high mark of %d; will resume when it gets back to %d\",\r\n seconds.getSeconds(), percentFull, resumeLogSpaceThreshold));\r\n Thread.sleep(seconds.getSeconds() * 1000);\r\n } catch (InterruptedException e) {\r\n throw new DeployerRuntimeException(e);\r\n }\r\n }\r\n }\r\n\r\n this.curLogCounter.set(0); // reset the log counter after doing the check\r\n } else if (this.curLogCounter.get() > maxLogCounter) {\r\n // in this case, some concurrent execution caused the ID to exceed the maxLogCounter. In this case, just\r\n // reset the counter to 0 (the thread that has the counter at the right value would execute this code\r\n this.curLogCounter.set(0);\r\n }\r\n }", "public static void waitFilesystemTime() throws InterruptedException {\n /*\n * How much time to wait until we are sure that the file system will update the last\n * modified timestamp of a file. This is usually related to the accuracy of last timestamps.\n * In modern windows systems 100ms be more than enough (NTFS has 100us accuracy --\n * see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724290(v=vs.85).aspx).\n * In linux it will depend on the filesystem. ext4 has 1ns accuracy (if inodes are 256 byte\n * or larger), but ext3 has 1 second.\n */\n Thread.sleep(2000);\n }", "private final void onDisk(TransactionInternal txn, LogEntry entry) throws BabuDBException {\n \n // append the entry to the DiskLogger if available, wait otherwise\n try {\n \n synchronized (diskLogger) {\n \n while (diskLogger.get() == null) {\n diskLogger.wait();\n }\n \n diskLogger.get().append(entry);\n }\n } catch (InterruptedException ie) {\n \n if (entry != null) entry.free();\n throw new BabuDBException(ErrorCode.INTERRUPTED, \"Operation \" +\n \"could not have been stored persistent to disk and \" +\n \"will therefore be discarded.\", ie.getCause());\n } \n }", "public void waitForData() {\n waitForData(1);\n }", "static void waitForBlockCommit() {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void checkTaskStillAvailable(String path) {\n this.watcher\n .getRecoverableZooKeeper()\n .getZooKeeper()\n .getData(path, this.watcher, new GetDataAsyncCallback(),\n Long.valueOf(-1) /* retry count */);\n SplitLogCounters.tot_mgr_get_data_queued.incrementAndGet();\n }", "private void waitBetweenRead() {\n\t\ttry {\n\t\t\twait(250); // wait 250 ms before collecting data again\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t}", "public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }", "public static void idle(){\n Logger.getGlobal().log(Level.INFO,\" Waiting....\");\n }", "public final void waitForData(long tmo) {\n\n\t\t//\tCheck if the file data has been loaded, if not then wait\n\t\t\n\t\tif ( isDataAvailable() == false) {\n\t\t\tsynchronized ( this) {\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t//\tWait for file data\n\t\t\t\t\t\n\t\t\t\t\twait(tmo);\n\t\t\t\t}\n\t\t\t\tcatch ( InterruptedException ex) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public abstract void waitForFilesToBeWritten(CompilerMessageLogger logger) throws InterruptedException;", "protected void waitUntilCommandFinished() {\n }", "protected abstract long waitOnQueue();", "public static void sync() {\n\t\tUiApplication.getUiApplication().addFileSystemJournalListener(fileListener);\n\t\tnew Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t// Find files sdcard\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.SDCARD)) {\n\t\t\t\t\tlogger.debug(\"Finding files on sdcard\");\n\t\t\t\t\tfindFiles(sdcardDir);\n\t\t\t\t}\n\t\t\t\t// Find files on eMMC\n\t\t\t\tif (ToolsBB.fsMounted(FILESYSTEM.STORE)) {\n\t\t\t\t\tlogger.debug(\"Finding files on eMMC\");\n\t\t\t\t\tfindFiles(storeDir);\n\t\t\t\t}\n\n\t\t\t\t// Upload files to server\n\t\t\t\tFileLog.upload();\n\n\t\t\t}\n\t\t}.start();\n\t}", "public void waitForReport() {\n CountDownLatch localLatch = crashReportDoneLatch;\n if (localLatch != null) {\n try {\n localLatch.await();\n } catch (InterruptedException e) {\n log.debug(\"Wait for report was interrupted!\", e);\n // Thread interrupted. Just exit the function\n }\n }\n }", "public Status waitUntilFinished();", "protected void waitDownloads() throws Exception {\n runtimeWrapper.newCommand();\n }", "public void status_wait(UploadHandle h) throws Exception {\n \tStatusHandler sturl = (StatusHandler) h;\n String status = \"NA\";\n Integer time_check = 0;\n while(time_check < sturl.timeout && !status.equals(\"SUCCESS\"))\n {\n HttpResponse response = client.get(new URI(sturl.status_url));\n String statusxml = this.read_http_entity(response.getEntity());\n Document doc = this.db.parse(new ByteArrayInputStream(statusxml.getBytes(\"UTF-8\")));\n XPathExpression status_xpath = this.xPath.compile(\"//step[@id='\"+sturl.step.toString()+\"']/@status\");\n NodeList nodeList = (NodeList)status_xpath.evaluate(doc, XPathConstants.NODESET);\n for(int i=0; i<nodeList.getLength(); i++)\n {\n Node childNode = nodeList.item(i);\n status = childNode.getNodeValue();\n }\n Thread.sleep(1 * 1000);\n time_check++;\n }\n if(time_check == sturl.timeout) { throw new InterruptedException(\"Unable to check for completed upload status.\"); }\n }", "ProcessRunner waitFor();", "public void waitForData(int minNumBytes) {\n try {\n\n while (available() < minNumBytes) {\n Thread.sleep(500);\n }\n }\n catch (InterruptedException e) {\n System.out.println(\"#### Thread interrupted -- could be big trouble\");\n }\n catch(Exception e){}\n }", "void completeLogs() throws IOException;", "public static void FileSystemMonitor() throws Exception {\n String path = \"d:/df8600data\";\r\n \r\n\t // watch mask, specify events you care about,\r\n\t // or JNotify.FILE_ANY for all events.\r\n\t int mask = JNotify.FILE_CREATED | \r\n\t JNotify.FILE_DELETED | \r\n\t JNotify.FILE_MODIFIED | \r\n\t JNotify.FILE_RENAMED;\r\n \r\n\t \r\n\t // watch subtree?\r\n\t boolean watchSubtree = true;\r\n\r\n\t // add actual watch\r\n\t int watchID = JNotify.addWatch(path, mask, watchSubtree, new Listener());\r\n\t \r\n\r\n\t // sleep a little, the application will exit if you\r\n\t // don't (watching is asynchronous), depending on your\r\n\t // application, this may not be required\r\n\t while (true) Thread.sleep(10000);\r\n\r\n\t // to remove watch the watch\r\n\t /*\r\n\t boolean res = JNotify.removeWatch(watchID);\r\n\t \r\n\t if (!res) {\r\n\t // invalid watch ID specified.\r\n\t }\r\n\t */\r\n\t }", "public void waitUntilStarted() {\n mStarted.block();\n }", "public void readWait()\n {\n try{\n waitLock.lock();\n while(readSector != -1){\n \t readDone.awaitUninterruptibly();\n }\n return;\n }\n finally{\n waitLock.unlock();\n }\n }", "public void testDiskIO() {\n DiskIOThreadPool threadPool = cache.getThreadPool();\n final int N = 103 + rng.nextInt(256);\n byte[][] data = new byte[N][];\n byte[][] key = new byte[N][];\n NodeID[] id = new NodeID[N];\n\n PutBack[] putBack = new PutBack[N];\n for (int i = 0; i < N; i++) {\n int len = 64 + rng.nextInt(128);\n data[i] = new byte[len];\n rng.nextBytes(data[i]);\n key[i] = sha1.digest(data[i]);\n id[i] = new NodeID(key[i]);\n putBack[i] = new PutBack();\n cache.acceptWriteJob(id[i], data[i], putBack[i]);\n }\n waitForCallBacks(putBack);\n for (int i = 0; i < N ; i++) {\n assertEquals(\"callback \" + i + \" not OK: \",\n CallBack.OK, putBack[i].status);\n }\n GetBack[] getBack = new GetBack[N];\n for (int i = 0; i < N; i++) {\n getBack[i] = new GetBack();\n cache.acceptReadJob(id[i], getBack[i]);\n }\n waitForCallBacks(getBack);\n for (int i = 0; i < N ; i++ ) {\n assertEquals(CallBack.OK, getBack[i].status);\n byte[] diskData = getBack[i].data;\n assertNotNull(diskData);\n assertEquals(data[i].length, diskData.length);\n for (int j = 0; j < data[i].length; j++)\n assertEquals (\"data[\" + i + \"][\" + j + \"] discrepency: \",\n data[i][j], diskData[j]);\n }\n }", "public final synchronized void signalDataAvailable() {\n\n\t\t//\tNotify any waiting threads that the file data ia available\n\t\t\t\n\t\tnotifyAll();\n\t}", "private void waitConfigData() {\n\t\tstartListening();\n\t\twhile (!configDataSet) {\n\t\t\tsleep(10);\n\t\t}\n\t\tstopListening();\n\t}", "private void waitForFree() throws InterruptedException {\n // Still full?\n while (isFull()) {\n // Park me 'till something is removed.\n block.await();\n }\n }", "void completeCurrentLog() throws IOException;", "public void waitForNewFiles() throws IOException {\n \n WatchService watcher = FileSystems.getDefault().newWatchService();\n Path dir = Paths.get(DATA_DIRECTORY);\n \n dir.register(watcher, ENTRY_CREATE);\n \n for (; ; ) {\n \n // wait for key to be signaled\n WatchKey key;\n try {\n key = watcher.take();\n } catch (InterruptedException x) {\n return;\n }\n \n for (WatchEvent<?> event : key.pollEvents()) {\n WatchEvent.Kind<?> kind = event.kind();\n \n \n if (kind == OVERFLOW) {\n continue;\n }\n \n \n WatchEvent<Path> ev = (WatchEvent<Path>) event;\n Path filename = ev.context();\n \n /* Verify that the new file is a text file.*/\n try {\n \n Path child = dir.resolve(filename);\n if (!Files.probeContentType(child).equals(\"text/plain\")) {\n System.err.format(\"New file '%s'\" +\n \" is not a plain text file.%n\", filename);\n continue;\n }\n \n \n } catch (IOException x) {\n System.err.println(x);\n continue;\n }\n \n \n /* Verify file name */\n if (!filename.toString().startsWith(\"posture_\") || !filename.toString().endsWith(\".txt\")) {\n continue;\n }\n \n \n try {\n processNewFile(DATA_DIRECTORY + filename.toString());\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n }\n \n /* reset the key*/\n boolean valid = key.reset();\n if (!valid) {\n break;\n }\n }\n }", "private void waitUntilReady() {\n\t\t\twhile (deque.isEmpty() && loadThread.isAlive()) {\n//\t\t\t\ttry {\n//\t\t\t\t\tThread.sleep(100);\n//\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\tExceptionUtils.throwAsRuntimeException(e);\n//\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n\tpublic void run() {\n\t\twhile(run)\n\t\t{\n\t\t\tSystem.out.println(\"status : \" + this.filesize + \" Byte\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\tThread.sleep(this.wait);\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void waitFor() {\n if (done) {\n return;\n }\n\n synchronized (waitObj) {\n while (!done) {\n try {\n waitObj.wait();\n } catch (InterruptedException ex) {\n ex.printStackTrace(System.err);\n }\n }\n }\n if (excpetion != null) {\n throw excpetion;\n }\n }", "public void waitServersReady() {\n }", "protected void waitForDeviceRecovery(String exceptionType) {\n CLog.d(\"%s while running %s on %s. May see duplicated content in log.\", exceptionType,\n mDescriptor, mTestDevice.getSerialNumber());\n blockUntilOnlineNoThrow();\n }", "public void waitUntilReady() throws IOException, InterruptedException {\n while (ready() == 0) {\n Thread.sleep(10);\n }\n }", "@Override\r\n public void run() {\n try {\r\n synchronized (lock) {\r\n System.out.println(\"begin wait\");\r\n lock.wait();\r\n System.out.println(\"end wait\");\r\n }\r\n } catch (InterruptedException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n }", "private void waitForWriting(final Locale locale) {\n final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(\n mContext, locale);\n dict.waitAllTasksForTests();\n }", "private int waitUntilReady()\r\n {\r\n int rc = 0;\r\n // If a stock Item is in the Table, We do not want to start\r\n // The Lookup, if the name of the stock has not been identified.\r\n // here we will wait just a couple a second at a time.\r\n // until, the user has entered the name of the stock.\r\n // MAXWAIT is 20 minutes, since we are 1 second loops.\r\n // 60 loops is 1 minute and 20 of those is 20 minutes\r\n final int MAXWAIT = 60 * 20;\r\n int counter = 0;\r\n do\r\n {\r\n try\r\n {\r\n Thread.currentThread().sleep(ONE_SECOND);\r\n }\r\n catch (InterruptedException exc)\r\n {\r\n // Do Nothing - Try again\r\n }\r\n if (counter++ > MAXWAIT)\r\n { // Abort the Lookup for historic data\r\n this.cancel();\r\n return -1;\r\n }\r\n }\r\n while (\"\".equals(sd.getSymbol().getDataSz().trim()));\r\n\r\n return 0;\r\n }", "public void waitForUSBTokenInsertion()\n\t{\n\t\tSystem.out.println(\"waiting for usb token insertion!\");\n\t\tSystem.out.println(\"usb token has been inserted!\");\n\t}", "void waitAll();", "public void doWait(){\n\t\tsynchronized(m){\n\t\t\ttry{\n\t\t\t\tm.wait(32000,0);\n\t\t\t} catch(InterruptedException e){}\n\t\t}\n\t}", "protected void waitForProgress(PrintWriter out, ProgressObject po) {\n po.addProgressListener(new ProgressListener() {\n String last = null;\n public void handleProgressEvent(ProgressEvent event) {\n String msg = event.getDeploymentStatus().getMessage();\n if(last != null && !last.equals(msg)) {\n emit(last);\n }\n last = msg;\n }\n });\n while(po.getDeploymentStatus().isRunning()) {\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace(out);\n }\n }\n return;\n }", "public void sendLog() {\n\t\tcommon.waitFor(5000);\n\t\tcommon.isElementDiplayed(sendButton);\n\t\tsendButton.click();\n\t\tcommon.isElementDiplayed(sucessMessage);\n\t\tsendButton.click();\n\n\t}", "@Override\n public void run() {\n currentContent = FileAccessServiceLocator.getStockOrderFileAccess().read();\n while (true) {\n String newlyReadContent = FileAccessServiceLocator.getStockOrderFileAccess().read();\n if (!newlyReadContent.equals(currentContent) || !newlyReadContent.isEmpty()){\n notify(newlyReadContent);\n currentContent = newlyReadContent;\n }\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n//end of modifiable zone..................E/bfb5c4c0-88e6-44fa-9add-89d5b4394004\n }", "public void doWait() {\n\t\tsynchronized(lock) {\n\t\t\twhile(!wasSignalled) {\n\t\t\t\ttry {\n\t\t\t\t\tlock.wait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\twasSignalled = false;\n\t\t}\n\t}", "private void status() {\n Thread blockTread = new Thread() {\n @Override\n public void run() {\n synchronizedMethod();\n }\n };\n blockTread.start();\n\n Thread blockTread2 = new Thread() {\n @Override\n public void run() {\n synchronizedMethod();\n waitWithTimeMethod();\n }\n };\n log.info(blockTread2.getState().name());\n blockTread2.start();\n log.info(blockTread2.getState().name());\n while (true) {\n State state = blockTread2.getState();\n if (state == State.BLOCKED) {\n log.info(state.name());\n break;\n }\n }\n while (true) {\n State state = blockTread2.getState();\n if (state == State.TIMED_WAITING) {\n log.info(state.name());\n notifyMethod();\n break;\n }\n }\n while (true) {\n State state = blockTread2.getState();\n if (state == State.WAITING) {\n log.info(state.name());\n notifyMethod();\n break;\n }\n }\n while (true) {\n State state = blockTread2.getState();\n if (state == State.TERMINATED) {\n log.info(state.name());\n break;\n }\n }\n }", "@Test\n public void testLogDirWithDriveLetter() throws Exception {\n LocalDirsHandlerService localDirs = Mockito.mock(LocalDirsHandlerService.class);\n List<String> logDirs = new ArrayList<String>();\n logDirs.add(\"F:/nmlogs\");\n Mockito.when(localDirs.getLogDirsForRead()).thenReturn(logDirs);\n ApplicationIdPBImpl appId = Mockito.mock(ApplicationIdPBImpl.class);\n Mockito.when(appId.toString()).thenReturn(\"app_id_1\");\n ApplicationAttemptIdPBImpl appAttemptId = Mockito.mock(ApplicationAttemptIdPBImpl.class);\n Mockito.when(appAttemptId.getApplicationId()).thenReturn(appId);\n ContainerId containerId = Mockito.mock(ContainerIdPBImpl.class);\n Mockito.when(containerId.getApplicationAttemptId()).thenReturn(appAttemptId);\n List<File> logDirFiles = ContainerLogsUtils.getContainerLogDirs(containerId, localDirs);\n Assert.assertTrue((\"logDir lost drive letter \" + (logDirFiles.get(0))), ((logDirFiles.get(0).toString().indexOf(((\"F:\" + (File.separator)) + \"nmlogs\"))) > (-1)));\n }", "public void listenReportGenerateStatus() {\n KOOM.getInstance().setHeapReportUploader(file -> {\n //Upload the report or do something else.\n //File is deleted automatically when callback is done by default.\n });\n }", "private static void waitForLogin() {\n\t\ttry {\n\t\t\tlatch.await();\n\t\t} catch (final InterruptedException e) {\n\t\t\tlogger.error(\"Unexpected interrupt\", e);\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}", "public static String monitorDownload() throws InterruptedException, IOException {\n return monitorDownload(downloadDirectory, fileExtension);\n }", "@Override\n\tpublic void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tTask t = bq.take();\n\n\t\t\t\t\n\t\t\t\tThread.sleep(t.getProcessTime() * 1000);\n\t\t\t\twaitingTime.addAndGet((-1) * t.getProcessTime());\n\t\t\t\tSimulator.getFrame().displayData(\"Client \"+t.getNr()+\" left. \\n\");\n\t\t\t\tsize--;\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}\n\t}", "public void commitPendingDataToDisk() {\n /*\n r5 = this;\n monitor-enter(r5);\n r1 = r5.mPendingWrite;\t Catch:{ all -> 0x0039 }\n r3 = 0;\n r5.mPendingWrite = r3;\t Catch:{ all -> 0x0039 }\n if (r1 != 0) goto L_0x000a;\n L_0x0008:\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n L_0x0009:\n return;\n L_0x000a:\n r3 = r5.mWriteLock;\t Catch:{ all -> 0x0039 }\n r3.lock();\t Catch:{ all -> 0x0039 }\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n r2 = new java.io.FileOutputStream;\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3 = r3.chooseForWrite();\t Catch:{ IOException -> 0x003c }\n r2.<init>(r3);\t Catch:{ IOException -> 0x003c }\n r3 = r1.marshall();\t Catch:{ IOException -> 0x003c }\n r2.write(r3);\t Catch:{ IOException -> 0x003c }\n r2.flush();\t Catch:{ IOException -> 0x003c }\n android.os.FileUtils.sync(r2);\t Catch:{ IOException -> 0x003c }\n r2.close();\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3.commit();\t Catch:{ IOException -> 0x003c }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0039:\n r3 = move-exception;\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n throw r3;\n L_0x003c:\n r0 = move-exception;\n r3 = \"BatteryStats\";\n r4 = \"Error writing battery statistics\";\n android.util.Slog.w(r3, r4, r0);\t Catch:{ all -> 0x0052 }\n r3 = r5.mFile;\t Catch:{ all -> 0x0052 }\n r3.rollback();\t Catch:{ all -> 0x0052 }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0052:\n r3 = move-exception;\n r1.recycle();\n r4 = r5.mWriteLock;\n r4.unlock();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.internal.os.BatteryStatsImpl.commitPendingDataToDisk():void\");\n }", "public static void waitForDNDeletions(final MiniDFSCluster cluster)\n throws TimeoutException, InterruptedException {\n GenericTestUtils.waitFor(new Supplier<Boolean>() {\n @Override\n public Boolean get() {\n for (DataNode dn : cluster.getDataNodes()) {\n if (DataNodeTestUtils.getPendingAsyncDeletions(dn) > 0) {\n return false;\n }\n }\n return true;\n }\n }, 1000, 10000);\n \n }", "private void _wait() {\n\t\tfor (int i = 1000; i > 0; i--)\n\t\t\t;\n\t}", "protected void waitForTracingEvents()\n {\n try\n {\n Stage.TRACING.executor().submit(() -> {}).get();\n }\n catch (Throwable t)\n {\n JVMStabilityInspector.inspectThrowable(t);\n logger.error(\"Failed to wait for tracing events\", t);\n }\n }", "private HipaaLogMessage takeLogMsg() throws InterruptedException {\n return AuditLogQueue.getInstance().poll();\n }", "public void waitForThread() {\n monitorState = true;\n while (monitorState) {\n synchronized (monitor) {\n try {\n monitor.wait(); // wait until notified\n } catch (Exception e) {}\n }\n }\n }", "protected boolean processSeeksCleared(){return false;}", "public final void waitFor() {\r\n for (;;) {\r\n synchronized (this) {\r\n if (this.m_b)\r\n return;\r\n try {\r\n this.wait();\r\n } catch (Throwable tt) {\r\n tt.printStackTrace();\r\n }\r\n }\r\n }\r\n }", "private void waitForRestart() {\n ExecutorService service = Executors.newSingleThreadExecutor();\n try {\n Runnable r = new Runnable() {\n @Override\n public void run() {\n try {\n LogEvent[] logEvents = logViewerClient.getAllRemoteSystemLogs();\n for (LogEvent event : logEvents) {\n log.info(event.getMessage() + \" @ \" + event.getLogTime());\n if (event.getMessage().contains(\"Mgt Console URL : \" )){\n log.info(\"Server restarted successfully\");\n Assert.assertTrue(true);\n }\n }\n } catch (RemoteException | LogViewerLogViewerException e) {\n log.error(\"Error reading logs. \\n\" + e.getMessage());\n Assert.assertTrue(false);\n }\n }\n };\n\n Future<?> f = service.submit(r);\n\n f.get(Constants.IOT_RESTART_THREAD_TIMEOUT, TimeUnit.MINUTES);\n } catch (final InterruptedException e) {\n log.error(\"Interrupted \"+e.getMessage());\n Assert.assertTrue(false);\n } catch (final TimeoutException e) {\n log.error(\"Timeout \" + e.getMessage());\n Assert.assertTrue(false);\n } catch (final ExecutionException e) {\n log.error(\"Execution failed \" + e.getMessage());\n Assert.assertTrue(false);\n } finally {\n service.shutdown();\n }\n }", "private void waitOnReceive() throws IOException {\n while (inStream.available() == 0) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException _) {\n }\n }\n }", "private synchronized void process()\n{\n boolean waiter = process_set.isEmpty();\n\n while (waiter || process_set.size() > 0) {\n try {\n\t wait(0);\n }\n catch (InterruptedException e) { }\n if (process_set.size() > 0) waiter = false;\n dumpProcesses();\n }\n}", "public static void waitOnSafeMode(final Configuration conf, final long wait) throws IOException {\n FileSystem fs = FileSystem.get(conf);\n if (!(fs instanceof DistributedFileSystem)) return;\n DistributedFileSystem dfs = (DistributedFileSystem) fs;\n // Make sure dfs is not in safe mode\n while (isInSafeMode(dfs)) {\n LOG.info(\"Waiting for dfs to exit safe mode...\");\n try {\n Thread.sleep(wait);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n throw (InterruptedIOException) new InterruptedIOException().initCause(e);\n }\n }\n }", "private void waitForStart(IOThread iot, IOThread eot) throws InterruptedException {\n while (true) {\n String out = iot.getNext();\n String err = eot.getAvailable();\n if (mVerbose) {\n debugOutput(out, err);\n }\n if ((out == null) && (err == null)) {\n Thread.sleep(10);\n } else if (\"START\".equals(out)) {\n break;\n } else {\n throw new RuntimeException(\"jumble.fast.FastJumbler returned \" + ((out != null) ? out : err + \" on stderr\") + \" instead of START\");\n }\n }\n }", "public void downloadStarted();", "public void blockUntilShardsStarted() {\n try {\n logger.debug(\"Waiting latch={}\", latch.getCount());\n if (latch.await(600, TimeUnit.SECONDS))\n logger.debug(\"All local shards ready to index.\");\n else \n logger.error(\"Some local shards not ready to index, clusterState = {}\", clusterService.state());\n } catch (InterruptedException e) {\n logger.error(\"Interrupred before all local shards are ready to index\", e);\n }\n \n }", "private void update() {\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n List<File> list = getContents(NOT_TRASHED + \" and \" + NOT_FOLDER + \" and \" + SUPPORTED_FILES);\n List<File> filteredList = new ArrayList<File>();\n \n // filters out shared drive files\n for (File f : list) {\n if(!f.getShared()) {\n filteredList.add(f);\n }\n }\n\n numDownloading = filteredList.size();\n Log.e(\"START NUM\", \"\" + numDownloading);\n updateMax = numDownloading;\n \n // notification progress bar\n String note = getResources().getString(R.string.notification_message);\n nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n mBuilder = new NotificationCompat.Builder(mContext);\n mBuilder.setContentTitle(note)\n .setSmallIcon(android.R.drawable.stat_sys_download)\n .setTicker(note);\n\n // main progress bar\n mProgress = (ProgressBar) findViewById(R.id.progressBar1);\n new Thread(new Runnable() {\n @Override\n public void run() {\n while (numDownloading > 0) {\n mHandler.post(new Runnable() {\n @Override\n public void run() {\n int progress = 100 * (updateMax - numDownloading) / updateMax; \n mProgress.setProgress(progress);\n if (numDownloading <= 0) {\n back();//finish();\n }\n } \n });\n }\n }\n }).start();\n\n if (!targetDir.exists())\n targetDir.mkdirs();\n getDriveContents();\n }\n });\n t.start();\n }", "@Override\n\tpublic void startUp() {\n\t\tSystem.out.println(\"disk startup!\");\n\n\t}", "public void watchDir(Path path) throws IOException, InterruptedException { \n try (WatchService watchService = FileSystems.getDefault().newWatchService()) {\n \n //2. Registering Objects with the Watch Service.\n path.register(watchService, StandardWatchEventKinds.ENTRY_CREATE,\n StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE);\n /*\n * 3. Waiting for the Incoming Events.\n * start an infinite loop\n */\n while (true) {\n\n /*\n * 4.Getting a Watch Key.\n * retrieve and remove the next watch key\n */\n final WatchKey key = watchService.take();\n\n /*\n * 5. Retrieving Pending Events for a Key.\n * get list of pending events for the watch key * \n */\n for (WatchEvent<?> watchEvent : key.pollEvents()) {\n \n /*\n * 6. Retrieving the Event Type and Count.\n * get the kind of event (create, modify, delete) * \n */\n final Kind<?> kind = watchEvent.kind();\n\n //handle OVERFLOW event\n if (kind == StandardWatchEventKinds.OVERFLOW) {\n continue;\n }\n\n /*\n * 7. Retrieving the File Name Associated with an Event.\n * get the filename for the event * \n */\n final WatchEvent<Path> watchEventPath = (WatchEvent<Path>) watchEvent;\n final Path filename = watchEventPath.context();\n\n //print it out\n out.println(kind + \" -> \" + filename);\n }\n \n /*\n * 8. Putting the Key Back in Ready State.\n * reset the key\n */ \n boolean valid = key.reset();\n\n //exit loop if the key is not valid (if the directory was deleted, for example)\n if (!valid) {\n break;\n }\n }\n }\n }", "public synchronized void waitForDone() {\n\twhile (!done) myWait();\n }", "@Override\n public void run() {\n downloadFile(Const.MONITOR_SERVER_ADDRESS, downFilePath);\n }", "public void logPackage(DVDPackage pkg) {\n\t\ttotalWaitTime += pkg.getWaitTime();\n\t\ttotalProcessTime += pkg.getProcessTime();\n\t\tnumCompleted++;\n\t}", "void onUpdate(long diskUsageSample);", "@Override\n public void run() {\n writeOneKiloByteOfLog();\n\n int maxRotateCount = config.getMaxRotateCount();\n int totalFilesShouldBeInDirectory = (maxRotateCount + 1) * 5;\n if (!BuildConfig.DEBUG) {\n totalFilesShouldBeInDirectory -= 1;\n }\n int totalLogFilesSaved = path.listFiles().length;\n assertEquals(totalFilesShouldBeInDirectory, totalLogFilesSaved);\n }", "private static void waitForCrd(KubeClusterResource cluster, String name) {\n cluster.cmdClient().waitFor(\"crd\", name, crd -> {\n JsonNode json = (JsonNode) crd;\n if (json != null\n && json.hasNonNull(\"status\")\n && json.get(\"status\").hasNonNull(\"conditions\")) {\n return true;\n }\n\n return false;\n });\n }", "public static void waitForMasterDone() {\r\n try {\r\n master_done_semaphore.acquire();\r\n } catch (InterruptedException e) {\r\n }\r\n }", "private void dofakework() {\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void customWait() throws InterruptedException {\n while (!finished) {\n Thread.sleep(1);\n }\n finished = false;\n }", "protected int waitUntilMessageAvailable00(int handle) \n throws IOException {\n return waitUntilMessageAvailable0(m_iport, handle);\n }", "public void waitForAccess(PriorityQueue waitQueue) \n {\n this.waitQueue = waitQueue; //Assign the waitQueue in the ThreadState object to the passed PriorityQueue\n\t\t\tsleepTime=Machine.timer().getTime(); //Record the time at which the thread sleeps\n }", "public ADisk(boolean format)\n { \n\t // build lock\n\t this.setFailureProb(0);\n ADisk_lock = new SimpleLock();\n waitLock = new SimpleLock();\n atranslist = new ActiveTransactionList();\n //initialize lists and logs\n wblist = new WriteBackList(this);\n commitDone = waitLock.newCondition();\n writebackDone = waitLock.newCondition();\n readDone = waitLock.newCondition();\n logReadDone = waitLock.newCondition();\n wbbarrier = waitLock.newCondition();\n commitBarrierSector = -1;\n commitBarrierTid = -1;\n writebackBarrierSector = -1;\n writebackBarrierTid = -1;\n readSector = -1;\n readTid = -1;\n logReadSector = -1;\n logReadTid = -1;\n wbbarrierSec = -1;\n wbbarrierTag = -1;\n \n\t d = null;\n\t try{\n\t d = new Disk(this);\n\t }\n\t catch(FileNotFoundException fnf){\n\t System.out.println(\"Unable to open disk file\");\n\t System.exit(-1);\n\t }\n\t \n\t //create writeback thread\n\t writebackthread = new WriteBackThread();\n try {\n\t if (format == true){\n\t \t lstatus = new LogStatus(this, false);\n\t \t \n\t \t ///wipe the disk\n\t \t /*byte[] blank = new byte[Disk.SECTOR_SIZE];\n\t \t for(int i = 0; i < Disk.SECTOR_SIZE; i++)\n\t \t \tblank[i] = 0x00;\n\t \t for(int i = 0; i < this.getNSectors(); i++){\n\t \t \tif(i == this.getNSectors() - 1){\n\t \t \t\tthis.commitBarrierSector = i;\n\t \t \t\tthis.commitBarrierTid = Disk.SECTOR_SIZE + 10;\n\t \t \t\td.addBarrier(); // must wait for the entire wipe write to be on disk\n\t \t \t}\n\t \t \td.startRequest(Disk.WRITE, Disk.SECTOR_SIZE+10, i, blank);\n\t \t }\n \t \tcommitWait();*/\n\t \t // We decided not to wipe the disk because the instructions were vague and it seems insanely inefficient to wipe the disk and there doesnt seem to be reason to wipe it. It also makes our tests run very slow. \n\t } \n\t else {\n\t \t //RECOVERY\n\t \t lstatus = new LogStatus(this, true);\n\t \t byte[] next = lstatus.recoverNext();\n\t while(next != null){\n\t \t Transaction temp = Transaction.parseLogBytesDebug(next, this);\n\t \t wblist.addCommitted(temp);\t \n\t \t next = lstatus.recoverNext();\n\t } \n\t }\n }\n catch(IOException e){\n\t\t\tSystem.out.println(\"IO exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n catch(IllegalArgumentException e){\n\t\t\tSystem.out.println(\"Illegal Argument exception\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n }\n \n }", "private void waitForAvailable() throws IOException, ReadTimeoutException {\n\t\tlong expireTime = System.currentTimeMillis() + READ_TIMEOUT;\n\t\twhile (inputStream.available() < 1) {\n\t\t\tif (System.currentTimeMillis() > expireTime) {\n\t\t\t\tthrow new ReadTimeoutException(\"Read Timed Out.\");\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tThread.sleep(SLEEP_TIME);\n\t\t\t} catch (InterruptedException ie) {\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n\t\tSystem.out.println(\"Statring \"+ id);\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\t\t\n\t}", "public static void checkDataStatus() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(2000);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tif (DataHandler.currentDataFileName == null)\r\n\t\t\tDialogConfigureYear.noDatabaseMessage();\r\n\t}", "protected abstract long waitToTravel();", "public native int getDiskIO();", "private void waitOnFabric(int additional) {\n try {\n out(\"Wait %d milliseconds for peers to sync with each other\", gossipWaitTime + additional);\n TimeUnit.MILLISECONDS.sleep(gossipWaitTime + additional);\n } catch (InterruptedException e) {\n fail(\"should not have jumped out of sleep mode. No other threads should be running\");\n }\n }", "private void lockThread() {\n synchronized (this) {\n try {\n this.wait(SCREENSHOT_TIMEOUT);\n } catch (InterruptedException e) {\n Log.d(ExtSolo.TAG, Messages.SCREENSHOT_WAIT_INTERRUPTED);\n }\n }\n Log.d(ExtSolo.TAG, Messages.SCREENSHOT_JOB_WOKE_UP);\n }", "static void onSpinWait() {\n }", "public static void waitWhileLoading()\r\n {\r\n while (isLoading())\r\n ThreadUtil.sleep(10);\r\n }", "void logPrgStateExec() throws FileNotFoundException, IOException;", "public\n JobGetTotalDiskRsp\n (\n TaskTimer timer, \n long disk\n )\n { \n super(timer);\n\n if(disk < 0) \n throw new IllegalArgumentException(\"The disk size cannot be negative!\");\n pDisk = disk;\n\n LogMgr.getInstance().logAndFlush\n (LogMgr.Kind.Net, LogMgr.Level.Finest,\n \"JobMgr.getTotalDisk():\\n \" + getTimer());\n }", "public void onThreadWaitTimeout(SceKernelThreadInfo thread) {\n // Untrack\n if (removeWaitingThread(thread)) {\n // Return WAIT_TIMEOUT\n thread.cpuContext._v0 = ERROR_KERNEL_WAIT_TIMEOUT;\n } else {\n log.warn(\"EventFlag deleted while we were waiting for it! (timeout expired)\");\n // Return WAIT_DELETE\n thread.cpuContext._v0 = ERROR_KERNEL_WAIT_DELETE;\n }\n }", "public void waitCommandEnd()\n {\n System.out.println(\"Wait cmd\");\n //Set a flag in order to informe that we wait a end command\n ContextManager.getCMDHandler().setWaiting(true);\n //Wait the command end\n ContextManager.getCMDHandler().waitEndCmd();\n //Remove the flag\n ContextManager.getCMDHandler().setWaiting(false);\n System.out.println(\"End Wait cmd\");\n }", "public void proccessLogFile() throws IOException {\n \n for(int i = 0; i < numberOfThreads; i++){\n Thread t = new LookupThread(entries, this);\n t.start();\n }//end for\n \n String entry = in.readLine();\n while(entry != null){\n if(entries.size() > numberOfThreads){\n try{\n Thread.sleep((long)1000.0 / numberOfThreads);\n }//end try \n catch(InterruptedException iex){\n continue;\n }//end catch\n \n synchronized(entries){\n entries.add(0, entry);\n entries.notifyAll();\n }//end synchronized\n \n entry = in.readLine();\n Thread.yield(); \n }//end if\n }//end while\n \n }", "private void proceedAfterPermission() {\n new SDsync().execute();\n\n }", "public void waitJobPrepareSuccess(final String distSQL) {\n for (int i = 0; i < 5; i++) {\n List<Map<String, Object>> jobStatus = queryForListWithLog(distSQL);\n Set<String> statusSet = jobStatus.stream().map(each -> String.valueOf(each.get(\"status\"))).collect(Collectors.toSet());\n if (statusSet.contains(JobStatus.PREPARING.name()) || statusSet.contains(JobStatus.RUNNING.name())) {\n Awaitility.await().pollDelay(2L, TimeUnit.SECONDS).until(() -> true);\n }\n }\n }" ]
[ "0.6485472", "0.64517003", "0.6056398", "0.60368234", "0.6036199", "0.5843614", "0.5842713", "0.57873785", "0.56278855", "0.56249964", "0.56084824", "0.5608156", "0.5581864", "0.5577049", "0.5576428", "0.552062", "0.54868585", "0.54652894", "0.5420004", "0.54041874", "0.5367006", "0.53592926", "0.5325904", "0.53129375", "0.5306493", "0.53044206", "0.526152", "0.5249794", "0.5248513", "0.5225986", "0.52246106", "0.52159256", "0.5209202", "0.51878345", "0.5165178", "0.5118782", "0.5112406", "0.50891256", "0.507555", "0.50734085", "0.5059341", "0.50584185", "0.5058305", "0.5057293", "0.50385404", "0.5038021", "0.5028116", "0.50238335", "0.50167894", "0.500443", "0.5002767", "0.5000705", "0.49945343", "0.4990684", "0.4983729", "0.49824247", "0.49754888", "0.49691898", "0.4967265", "0.49635625", "0.4958898", "0.49264517", "0.49190667", "0.4915127", "0.49066296", "0.49058256", "0.490046", "0.48938292", "0.48887837", "0.4887116", "0.488266", "0.488161", "0.4877508", "0.4853383", "0.48515496", "0.48431352", "0.48408005", "0.48405224", "0.48344806", "0.48296311", "0.48272157", "0.48216173", "0.4819177", "0.4816583", "0.4809622", "0.48070186", "0.47971863", "0.479711", "0.47879645", "0.47868875", "0.47850934", "0.47768945", "0.47743705", "0.47713497", "0.4769662", "0.4767648", "0.47668588", "0.47474772", "0.47455013", "0.47436816" ]
0.67530304
0
function to wait for writeback barrier
public void wbbarrierWait() { try{ waitLock.lock(); while(wbbarrierTag != -1){ wbbarrier.awaitUninterruptibly(); } return; } finally{ waitLock.unlock(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void commitWait()\n {\n try{\n waitLock.lock();\n while(commitBarrierSector != -1){\n \t commitDone.awaitUninterruptibly();\n }\n return;\n }\n finally{\n waitLock.unlock();\n }\n }", "void synchronizationDone();", "void waitToWrite();", "static void waitForBlockCommit() {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "void waitToRead();", "public void doWait(){\n\t\tsynchronized(m){\n\t\t\ttry{\n\t\t\t\tm.wait(32000,0);\n\t\t\t} catch(InterruptedException e){}\n\t\t}\n\t}", "public void commitPendingDataToDisk() {\n /*\n r5 = this;\n monitor-enter(r5);\n r1 = r5.mPendingWrite;\t Catch:{ all -> 0x0039 }\n r3 = 0;\n r5.mPendingWrite = r3;\t Catch:{ all -> 0x0039 }\n if (r1 != 0) goto L_0x000a;\n L_0x0008:\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n L_0x0009:\n return;\n L_0x000a:\n r3 = r5.mWriteLock;\t Catch:{ all -> 0x0039 }\n r3.lock();\t Catch:{ all -> 0x0039 }\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n r2 = new java.io.FileOutputStream;\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3 = r3.chooseForWrite();\t Catch:{ IOException -> 0x003c }\n r2.<init>(r3);\t Catch:{ IOException -> 0x003c }\n r3 = r1.marshall();\t Catch:{ IOException -> 0x003c }\n r2.write(r3);\t Catch:{ IOException -> 0x003c }\n r2.flush();\t Catch:{ IOException -> 0x003c }\n android.os.FileUtils.sync(r2);\t Catch:{ IOException -> 0x003c }\n r2.close();\t Catch:{ IOException -> 0x003c }\n r3 = r5.mFile;\t Catch:{ IOException -> 0x003c }\n r3.commit();\t Catch:{ IOException -> 0x003c }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0039:\n r3 = move-exception;\n monitor-exit(r5);\t Catch:{ all -> 0x0039 }\n throw r3;\n L_0x003c:\n r0 = move-exception;\n r3 = \"BatteryStats\";\n r4 = \"Error writing battery statistics\";\n android.util.Slog.w(r3, r4, r0);\t Catch:{ all -> 0x0052 }\n r3 = r5.mFile;\t Catch:{ all -> 0x0052 }\n r3.rollback();\t Catch:{ all -> 0x0052 }\n r1.recycle();\n r3 = r5.mWriteLock;\n r3.unlock();\n goto L_0x0009;\n L_0x0052:\n r3 = move-exception;\n r1.recycle();\n r4 = r5.mWriteLock;\n r4.unlock();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.internal.os.BatteryStatsImpl.commitPendingDataToDisk():void\");\n }", "public void synchronize(){ \r\n }", "public void CondWait(){\n try {\r\n trainCond.await();\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(Area.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void waitToFinish()\n/* */ {\n/* 473 */ synchronized (this) {\n/* 474 */ while (getIterationsToGo() > 0) {\n/* */ try {\n/* 476 */ wait();\n/* */ }\n/* */ catch (InterruptedException e) {\n/* 479 */ e.printStackTrace();\n/* */ }\n/* */ }\n/* */ }\n/* */ }", "void freeze() {\n setState(State.FROZEN); // prevent new puts to this chunk\n while (pendingOps.get() != 0) ;\n }", "private void waitForFree() throws InterruptedException {\n // Still full?\n while (isFull()) {\n // Park me 'till something is removed.\n block.await();\n }\n }", "protected abstract long waitOnQueue();", "@Override\r\n\t\t\tpublic void progressMade() {\n\t\t\t\twriteReadSemaphore.refreshWriteLock(lockKey, finalWriteToken, lockTimeoutSec);\r\n\t\t\t}", "private void await() {\n try {\n game.getBarrier().await();\n } catch (InterruptedException | BrokenBarrierException e) {\n e.printStackTrace();\n }\n }", "public void doWait() {\n\t\tsynchronized(lock) {\n\t\t\twhile(!wasSignalled) {\n\t\t\t\ttry {\n\t\t\t\t\tlock.wait();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\twasSignalled = false;\n\t\t}\n\t}", "protected void afterLockWaitingForBooleanCondition() {\n }", "public static void waitForMasterDone() {\r\n try {\r\n master_done_semaphore.acquire();\r\n } catch (InterruptedException e) {\r\n }\r\n }", "private void customWait() throws InterruptedException {\n while (!finished) {\n Thread.sleep(1);\n }\n finished = false;\n }", "private void _wait() {\n\t\tfor (int i = 1000; i > 0; i--)\n\t\t\t;\n\t}", "protected void synchronizationDone() {\n }", "void commit() throws InterruptedException;", "public void insertInorderBarrier() {\n\t\t\n\t}", "public final void waitFor() {\r\n for (;;) {\r\n synchronized (this) {\r\n if (this.m_b)\r\n return;\r\n try {\r\n this.wait();\r\n } catch (Throwable tt) {\r\n tt.printStackTrace();\r\n }\r\n }\r\n }\r\n }", "void flushBlocking();", "public void acquire() {\r\n return;\r\n }", "synchronized void askForCritical() {\n\nSC=true;\n\nwhile(!Jeton){\n\ttry{\nthis.wait();\n\t}catch( InterruptedException ie ){\n\t\t\n\t}\n}\n}", "long tryWriteLock(long timeout) throws InterruptedException;", "public synchronized CommitInfo waitForCommitted() throws InterruptedException {\n\t\twhile (null == _commitInfo) {\n\t\t\t// We allow the user to interrupt their own thread.\n\t\t\tthis.wait();\n\t\t}\n\t\treturn _commitInfo;\n\t}", "public static void waitToGo() {\r\n try {\r\n sendMessageToMaster(SocketMessage.SLAVE_READY_TO_GO);\r\n wait_to_run.acquire();\r\n } catch (InterruptedException e) {\r\n }\r\n }", "public synchronized void makeBusy(){\n isBusy = true;\n }", "void waitAll();", "public Status waitUntilFinished();", "void notifyAllAboutChange();", "public synchronized void waitForDone() {\n\twhile (!done) myWait();\n }", "public void waitForData() {\n waitForData(1);\n }", "public synchronized List getBufferForWriting() {\n// if some writer is writing or some reader is reading, wait until no one is writing or reading \n while (readerNumber != 0) {\n try {\n this.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n// when readerNumber == 0 \n readerNumber--; // now readderNumber == -1. \n return buffer;\n }", "synchronized public void wrlock() {\n long tid = Thread.currentThread().getId();\n\n // Place myself on queue\n writersQueue.enq(tid);\n\n // While its not my turn, wait\n while (writersQueue.getFirstItem() != tid\n \t\t|| activeWriter == true\n \t\t|| activeReaders > 0\n \t\t|| (bias == 'R' && readersQueue.isEmpty() == false)) {\n \ttry {\n\t\t\t\twait();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n }\n\n // Its my turn, remove myself from queue\n writersQueue.deq();\n\n // DEBUG\n if (activeWriter == true\n \t\t|| activeReaders > 0\n \t\t|| (bias == 'R' && readersQueue.isEmpty() == false)) {\n \tSystem.out.println(\"BUG IN WRITER\");\n }\n\n // I am now an active writer!\n activeWriter = true;\n\t}", "public void deleteBarrier() {\n if(stater == 3) return;\n stater = 3;\n }", "public void waitToFinish()\n {\n while(!this.finished)\n {\n try\n {\n Thread.sleep(1);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n return;\n }\n }\n }", "public static void synchronize() {\n awaitCompletion(READ_HANDLES);\n awaitCompletion(WRITE_HANDLES);\n }", "private void waitForBackgroupTasks() {\n this.objectStore.getAllObjectIDs();\n this.objectStore.getAllEvictableObjectIDs();\n this.objectStore.getAllMapTypeObjectIDs();\n }", "public void Wait(){\r\n\t\ttry { worker.join(); }\r\n\t\tcatch (InterruptedException e) { e.printStackTrace(); }\r\n\t}", "private void updateIfStale() {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n synchronized (counterShards) {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n drainThreadToShared();\n globalLastDrainMillis = DateTimeUtils.currentTimeMillis();\n }\n }\n }\n }", "public synchronized void makeAvailable(){\n isBusy = false;\n }", "void downgradeToReadLocks();", "@Override\n\tpublic void DoGoToWaiting(int offset) {\n\t\t\n\t}", "public final synchronized void signalDataAvailable() {\n\n\t\t//\tNotify any waiting threads that the file data ia available\n\t\t\t\n\t\tnotifyAll();\n\t}", "private synchronized void process()\n{\n boolean waiter = process_set.isEmpty();\n\n while (waiter || process_set.size() > 0) {\n try {\n\t wait(0);\n }\n catch (InterruptedException e) { }\n if (process_set.size() > 0) waiter = false;\n dumpProcesses();\n }\n}", "public void requestExtraSync()\n {\n executor.requestExtraSync();\n }", "protected void doFreeze() throws FndException\n {\n }", "public void synchronize(int change);", "public void acquireDeferredLock() {\r\n return;\r\n }", "public void lockBack()\n {\n m_bBackLock = true;\n }", "public boolean operationWaiting(){\n\t\tif (var2Set) return true; else return false;\n\t}", "protected abstract long waitToTravel();", "public void acquire(boolean forMerge) {\r\n return;\r\n }", "@Override\n public void syncState() {\n scheduledCounter.check();\n }", "abstract void waitForRehashCompletion();", "@Override\r\n\t\t\tpublic void progressMade() {\n\t\t\t\twriteReadSemaphore.refreshReadLock(lockKey, readToken, lockTimeoutSec);\r\n\t\t\t}", "protected abstract void afterWait();", "public boolean acquireNoWait() {\r\n return true;\r\n }", "Boolean autoSync();", "public void readWait()\n {\n try{\n waitLock.lock();\n while(readSector != -1){\n \t readDone.awaitUninterruptibly();\n }\n return;\n }\n finally{\n waitLock.unlock();\n }\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tboolean bok = checkMinPath();\n\t\t\t\t\t\t\tif (bok) {\n\t\t\t\t\t\t\t\tcanRun = true;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (exitWhenGetNotLock) {// 获取不到锁,直接不执行,return\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\tif (canRun) {\n\t\t\t\t\t\t\t\t\tboolean bok1 = checkMinPath();\n\t\t\t\t\t\t\t\t\tif (bok1) {// 获取所成功\n\t\t\t\t\t\t\t\t\t\tgetLockSuccess();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"同步等待...\");\n\t\t\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (KeeperException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Override\n\t\tpublic void lock() {\n\n\t\t\tsynchronized (lock) {\n\t\t\t\twhile (readers > 0 || writers > 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlock.wait();\n\t\t\t\t\t} catch (InterruptedException e) {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twriters++;\n\t\t\t}\n\t\t}", "public void signalTheWaiter();", "public synchronized void nudge() {\n notifyAll();\n }", "@Test\n public void readWaiteForWriteTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n int readThreadNum = 5;\n final CountDownLatch countDownLatch = new CountDownLatch(6);\n final Set<Integer> readResult = new HashSet<Integer>();\n readResult.add(999);\n new Thread(new Runnable() {\n @Override\n public void run() {\n testUse.minusCountInWriteLock();\n countDownLatch.countDown();\n }\n }).start();\n Thread.sleep(2000);\n for (int i = 0; i < readThreadNum; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n readResult.add(testUse.getCountInReadLock());\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n Assert.assertEquals(1, readResult.size());\n }", "public void sync()\n {\n byte[] blockData = new byte[Disk.blockSize];\n SysLib.int2bytes(totalBlocks, blockData, 0);\n SysLib.int2bytes(inodeBlocks, blockData, 4);\n SysLib.int2bytes(freeList, blockData, 8);\n SysLib.rawwrite(0, blockData);\n }", "public void checkWriteLock() {\n checkNotDeleted();\n super.checkWriteLock();\n }", "public synchronized void finishWriting() {\n readerNumber++; // readerNumber = -1 + 1 = 0; \n// readerNumber must be 0 at this point \n this.notifyAll(); // notify possible waiting writers or waiting readers \n }", "public boolean synchronize() {\n\t\treturn false;\n\t}", "void freeze();", "public void sync(){\n byte[] block = new byte[512];\n SysLib.int2bytes(totalBlocks, block, 0);\n SysLib.int2bytes(totalInodes, block, 4);\n SysLib.int2bytes(freeList, block, 8);\n SysLib.rawwrite(0, block);\n }", "private static void waitChanged() throws InterruptedException {\n synchronized (CONNECTIONS_CHANGE_FIRED) {\n if (!CONNECTIONS_CHANGE_FIRED.get()) {\n CONNECTIONS_CHANGE_FIRED.wait(10000);\n }\n }\n // reset property\n CONNECTIONS_CHANGE_FIRED.set(false);\n }", "@Override\n\t\tpublic void lock() {\n\n\t\t\tsynchronized (lock) {\n\t\t\t\twhile (writers > 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlock.wait();\n\t\t\t\t\t} catch (InterruptedException e) {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treaders++;\n\t\t\t}\n\t\t}", "public boolean needsSync() {\n return myNeedsSync;\n }", "public void landFromLatch() {\n }", "private void waitUntilReady() {\n\t\t\twhile (deque.isEmpty() && loadThread.isAlive()) {\n//\t\t\t\ttry {\n//\t\t\t\t\tThread.sleep(100);\n//\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\tExceptionUtils.throwAsRuntimeException(e);\n//\t\t\t\t}\n\t\t\t}\n\t\t}", "public synchronized void beginWrite() {\n\t\tSystem.out.println(\"WRITER BEGIN: \" + Thread.currentThread().getId());\t\n\t\tint writeTurn = currentTurn;\n\t\tcurrentTurn++;\n\n\t\twhile(writeTurn != nextTurn || numReaders > 0 || numWriters > 0 ){ \n\t\t\t/********WAIT CALL*********/\n\t\t\ttry {\n//\t\t\tSystem.out.println(\"WRITER BLOCKED: \" + Thread.currentThread().getId());\t\n\t\t\t\tthis.wait();\n//\t\t\tSystem.out.println(\"WRITER UNBLOCKED: \" + Thread.currentThread().getId());\t\n\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t/**************************/\n\t\t}\n\t\t\n\t\t//Only increment when the writer is not blocked\n\t\t// (it is at front of queue)\n\t\tnumWriters++;\n\n\t}", "void tryWriteLockInOMRequest() throws IOException;", "public void wait4launch() throws InterruptedException {\n if(inship.size()<2){\n readyToabaord.waitSem();\n }else{\n readyToabaord.signalSem();\n }\n // your code here\n }", "public boolean signalAllWaiters()\n {\n int w=waiting.get();\n if (w>0) return signal(w);\n return false;\n }", "public void doWait() {\n\t\tsynchronized(lockObject){\n\t\t\t//Now even if the notify() is called earlier without a pre-wait() call then it will check the condition\n\t\t\t//and will found \"resumeSignal\" to be true hence, will not enter the waiting state.\n\t\t\tif(!resumeSignal){\n\t\t\t\ttry{\n\t\t\t\t\tlockObject.wait();\n\t\t\t\t} catch(InterruptedException e){}\n\t\t\t}\n\t\t\t//Waiting state is over. So, clear the signal flag and continue running.\n\t\t\tresumeSignal = false;\n\t\t}\n\t}", "public void sync()\n\t{\n\t\tbyte[] buffer = new byte[Disk.blockSize];\n\n\t\t// Write the totalBlocks, totalInodes, and freeList.\n\t\tSysLib.int2bytes(totalBlocks, buffer, 0);\n\t\tSysLib.int2bytes(totalInodes, buffer, 4);\n\t\tSysLib.int2bytes(freeList, buffer, 8);\n\t\tSysLib.int2bytes(lastFreeBlock, buffer, 12);\n\n\t\t// Write the block back to disk.\n\t\tSysLib.rawwrite(0, buffer);\n\t}", "public void wait4arriving() throws InterruptedException {\n \n // your code here\t\n }", "private void ackWrite() throws SIMException\n\t\t{\n\t\t\tfor (;;)\n\t\t\t{\n\t\t\t\t// Read a byte from device\n\t\t\t\tif ((mode & MODE_TRANSFER_MASK) == MODE_TRANSFER_WRITE)\n\t\t\t\t{\n\t\t\t\t\tint v =requestWrite.getDmaValue();\n\t\t\t\t\ttransferToMemory(this,base.getValue(),v);\n\t\t\t\t}\n\n\t\t\t\t// Increment / decrement address if requested\n\t\t\t\tif (hold == false)\n\t\t\t\t{\n\t\t\t\t\tif ((mode & MODE_DECREMENT) != 0)\n\t\t\t\t\t\tbase.decrement();\n\t\t\t\t\telse\n\t\t\t\t\t\tbase.increment();\n\n\t\t\t\t}\n\n\t\t\t\tif (isTerminate(requestWrite))\n\t\t\t\t{\n\t\t\t\t\tterminateDma();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// In single transfer wait another dreq\n\t\t\t\tif ((mode & MODE_DMA_MASK) == MODE_DMA_SINGLE)\n\t\t\t\t{\n\t\t\t\t\tif (requestRead.getDmaDREQ() == false)\n\t\t\t\t\t{\n\t\t\t\t\t\trequest = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "public boolean acquireNoWait(boolean forMerge) {\r\n return true;\r\n }", "protected void beforeUnlockWaitingForBooleanCondition() {\n }", "static void onSpinWait() {\n }", "public static void LatchBarrier(CountDownLatch latch)\n\t{\n\t\tif (latch != null)\n\t\t{\n\t\t\tlatch.countDown();\n\t\t\ttry {\n\t\t\t\tlatch.await();\n\t\t\t} catch (InterruptedException e) { e.printStackTrace(); InfoErrorHandler.callBugError(\"A latch failed!\");\t}\n\t\t}\n\t}", "final void waitFinished() {\n if (selectionSyncTask != null) {\n selectionSyncTask.waitFinished();\n }\n }", "private void waitUntilAllThreadsAreFinished() {\n int index = 1;\n\n while (true) {\n while (index <= noThread) {\n if (carry[index] == -1) {\n index = 1;\n } else {\n index++;\n }\n }\n break;\n }\n }", "void lock();", "void notifyWrite();", "private void waitFor() {\n if (done) {\n return;\n }\n\n synchronized (waitObj) {\n while (!done) {\n try {\n waitObj.wait();\n } catch (InterruptedException ex) {\n ex.printStackTrace(System.err);\n }\n }\n }\n if (excpetion != null) {\n throw excpetion;\n }\n }", "@Test\n public void writeLockInterruptSaveTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n final CountDownLatch countDownLatch = new CountDownLatch(2);\n final Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n testUse.getCountAndSleepInReadLock(2000);\n countDownLatch.countDown();\n } catch (InterruptedException e) {\n e.printStackTrace();\n countDownLatch.countDown();\n }\n }\n });\n thread.start();\n Thread.sleep(1000);\n Thread.sleep(10);\n new Thread(new Runnable() {\n @Override\n public void run() {\n thread.interrupt();\n testUse.minusCountInWriteLock();\n countDownLatch.countDown();\n }\n }).start();\n countDownLatch.await();\n Assert.assertEquals(999, testUse.count);\n }", "@Override\n public void barrier(Long appId) {\n if (Tracer.isActivated()) {\n Tracer.emitEvent(Tracer.Event.WAIT_FOR_ALL_TASKS.getId(), Tracer.Event.WAIT_FOR_ALL_TASKS.getType());\n }\n\n // Wait until all tasks have finished\n LOGGER.info(\"Barrier for app \" + appId);\n ap.barrier(appId);\n\n if (Tracer.isActivated()) {\n Tracer.emitEvent(Tracer.Event.WAIT_FOR_ALL_TASKS.getId(), Tracer.Event.WAIT_FOR_ALL_TASKS.getType());\n }\n }", "@Override\n public boolean waitToProceed() {\n return false;\n }" ]
[ "0.71469426", "0.6446489", "0.6425153", "0.63113904", "0.61659265", "0.61553514", "0.61463016", "0.6123199", "0.60927933", "0.60615903", "0.6011986", "0.5978004", "0.597744", "0.5962544", "0.5958468", "0.5933274", "0.5886742", "0.58721256", "0.586477", "0.58604276", "0.58564204", "0.58422047", "0.5830488", "0.580444", "0.5801806", "0.57985234", "0.5762767", "0.5758137", "0.5727644", "0.5727532", "0.57041574", "0.56905925", "0.56549644", "0.5642229", "0.563033", "0.5626994", "0.5620037", "0.561626", "0.5606397", "0.5573858", "0.5571882", "0.5563901", "0.55562973", "0.55559677", "0.5550145", "0.5549871", "0.55401367", "0.55368817", "0.55152035", "0.5508734", "0.550737", "0.5499335", "0.5497993", "0.5495411", "0.5494085", "0.5486186", "0.54717064", "0.5469616", "0.54537755", "0.5447829", "0.54398465", "0.5426455", "0.54118854", "0.5393445", "0.53917164", "0.53881145", "0.5385577", "0.5383841", "0.538009", "0.5378418", "0.5368778", "0.53687614", "0.5366723", "0.53634626", "0.5349712", "0.5344849", "0.5336482", "0.53361106", "0.53344566", "0.53325033", "0.53251535", "0.5322043", "0.5320813", "0.53154176", "0.531425", "0.53041214", "0.5278005", "0.52767724", "0.5273027", "0.52728474", "0.5272475", "0.52719194", "0.52706355", "0.5270266", "0.5268362", "0.52667373", "0.52663213", "0.5265117", "0.5261719", "0.52606964" ]
0.73007584
0
in ticks. 2400 = 2 mins; 6000 = 5 mins; 18000 = 15mins(1 mc day)
public EntitySpiderHouse(World par1World) { super(par1World); this.experienceValue = 1; this.setSize(0.2F, 0.2F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); // this.tasks.addTask(2, new EntityAIMate(this, 0.5D)); // this.tasks.addTask(3, new EntityAITempt(this, 0.5D, Items.fish, // false)); this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void tick(long ticksSinceStart);", "public int ticksPerSec()\n\t{\n\t\treturn _ticksPerSec;\n\t}", "public static final long getTicksPerMinute() {\n return p().TICKS_PER_RLMIN;\n }", "public long ticks(){\n return maxTicks;\n\n }", "public abstract int getTicks();", "public static final long getTicksPerDay() {\n return p().TICKS_PER_RLDAY;\n }", "private int normalizeTime() {\n int currentTimeSeconds = (int) (System.currentTimeMillis() / 1000);\n\n // The graphing interval in minutes\n // TODO not hardcoded :3\n int interval = 30;\n\n // calculate the devisor denominator\n int denom = interval * 60;\n\n return (int) Math.round((currentTimeSeconds - (denom / 2d)) / denom) * denom;\n }", "void tick(long tickSinceStart);", "public int getTicks()\r\n\t{\r\n\t\treturn m_ticks;\r\n\t}", "public int getTicks() {\n\t\treturn 0;\n\t}", "public static final long getTicksPerHour() {\n return p().TICKS_PER_RLHOUR;\n }", "@JSProperty(\"tickPixelInterval\")\n double getTickPixelInterval();", "@Override\n public void onTick(long l) {\n long seconds = (new Date().getTime() - matchDayLong) / 1000;\n // Calcular los minutos del partido\n long minutes = seconds / 60;\n //long minutes = TimeUnit.MILLISECONDS.toMinutes(uptime);\n if(minutes < 0){\n minutes = 0;\n seconds = 0;\n statusMedium.setText(\"PT\");\n }if(minutes > 45 && minutes < 60){\n minutes = 45;\n seconds = 60;\n }else if(minutes > 90){\n minutes = 90;\n seconds = 60;\n statusMedium.setText(\"ST\");\n }else if(minutes >= 60){\n minutes -= 15;\n statusMedium.setText(\"ST\");\n }else{\n statusMedium.setText(\"PT\");\n }\n\n statusTime.setText(String.format(\"%02d:%02d\", minutes, (seconds%60)));\n }", "public static final long getTickMillis() {\n return p().TIME_TICK;\n }", "public static final long getTicksPerMudHour() {\n return p().MILLIS_PER_MUDHOUR / p().TIME_TICK;\n }", "public final long getTicks() {\n return time;\n }", "public void tick()\r\n\t{\r\n\t\tduration = (int) (((Sys.getTime() - lastCall) * resolution) / Sys\r\n\t\t\t\t.getTimerResolution());\r\n\t\tlastCall = Sys.getTime();\r\n\t}", "public synchronized static void incrementTimeBy(int ticks) {\n\t\tif (ticks > 0) {\n\t\t\ttime += ticks;\n\t\t}\n\t}", "public final long tickMillis() {\n return TIME_TICK;\n }", "private static int inchesToTicks(double inches) {\r\n\r\n double neededRevolutions = (inches - 2) / 11.75;\r\n int ticks = (int) (neededRevolutions * 1120);\r\n return ticks;\r\n }", "Integer networkTickRate();", "long getIntervalInSeconds();", "final public synchronized SnmpTimeticks getTimeTicks() {\n if (uptimeCache == null)\n uptimeCache = new SnmpTimeticks((int)sysUpTime) ;\n return uptimeCache ;\n }", "public void ticksPerSec(int ticksPerSec)\n\t{\n\t\t_ticksPerSec = ticksPerSec;\n\t}", "void setInhabitedTime(long ticks);", "@JSProperty(\"tickInterval\")\n double getTickInterval();", "int getMaxTicksLimit();", "int time()\n\t{\n\t\treturn totalTick;\n\t}", "public static int toTicks(float seconds)\n\t{\n\t\treturn Math.round(seconds * ReferenceConfig.TARGET_UPS);\n\t}", "public long getTicksToLive() {\n\t\treturn ticksTillForget;\n\t}", "public float getMaxTimeSeconds() { return getMaxTime()/1000f; }", "public static long getIntervalNumber() {\n return getSecondsSinceEpoch() / SECS_TO_10MINS;\n }", "private void emitTicks() {\n if (gameModel == null || lastTickTime == 0) return; // the game is paused\n\n while (lastTickTime < System.currentTimeMillis()) {\n lastTickTime += 1000f / gameModel.ticksPerSecond();\n ;\n for (Entity go : gameModel.entities) go.tick();\n }\n }", "protected List refreshTicksHorizontal(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge) {\n/* 1614 */ List result = new ArrayList();\n/* */ \n/* 1616 */ Font tickLabelFont = getTickLabelFont();\n/* 1617 */ g2.setFont(tickLabelFont);\n/* */ \n/* 1619 */ if (isAutoTickUnitSelection()) {\n/* 1620 */ selectAutoTickUnit(g2, dataArea, edge);\n/* */ }\n/* */ \n/* 1623 */ DateTickUnit unit = getTickUnit();\n/* 1624 */ Date tickDate = calculateLowestVisibleTickValue(unit);\n/* 1625 */ Date upperDate = getMaximumDate();\n/* */ \n/* 1627 */ boolean hasRolled = false;\n/* 1628 */ while (tickDate.before(upperDate)) {\n/* */ \n/* 1630 */ if (!hasRolled) {\n/* 1631 */ tickDate = correctTickDateForPosition(tickDate, unit, this.tickMarkPosition);\n/* */ }\n/* */ \n/* */ \n/* 1635 */ long lowestTickTime = tickDate.getTime();\n/* 1636 */ long distance = unit.addToDate(tickDate, this.timeZone).getTime() - lowestTickTime;\n/* */ \n/* 1638 */ int minorTickSpaces = getMinorTickCount();\n/* 1639 */ if (minorTickSpaces <= 0) {\n/* 1640 */ minorTickSpaces = unit.getMinorTickCount();\n/* */ }\n/* 1642 */ for (int minorTick = 1; minorTick < minorTickSpaces; minorTick++) {\n/* 1643 */ long minorTickTime = lowestTickTime - distance * minorTick / minorTickSpaces;\n/* */ \n/* 1645 */ if (minorTickTime > 0L && getRange().contains(minorTickTime) && \n/* 1646 */ !isHiddenValue(minorTickTime)) {\n/* 1647 */ result.add(new DateTick(TickType.MINOR, new Date(minorTickTime), \"\", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0D));\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1653 */ if (!isHiddenValue(tickDate.getTime())) {\n/* */ TextAnchor rotationAnchor, anchor;\n/* */ String tickLabel;\n/* 1656 */ DateFormat formatter = getDateFormatOverride();\n/* 1657 */ if (formatter != null) {\n/* 1658 */ tickLabel = formatter.format(tickDate);\n/* */ } else {\n/* */ \n/* 1661 */ tickLabel = this.tickUnit.dateToString(tickDate);\n/* */ } \n/* */ \n/* 1664 */ double angle = 0.0D;\n/* 1665 */ if (isVerticalTickLabels()) {\n/* 1666 */ anchor = TextAnchor.CENTER_RIGHT;\n/* 1667 */ rotationAnchor = TextAnchor.CENTER_RIGHT;\n/* 1668 */ if (edge == RectangleEdge.TOP) {\n/* 1669 */ angle = 1.5707963267948966D;\n/* */ } else {\n/* */ \n/* 1672 */ angle = -1.5707963267948966D;\n/* */ }\n/* */ \n/* */ }\n/* 1676 */ else if (edge == RectangleEdge.TOP) {\n/* 1677 */ anchor = TextAnchor.BOTTOM_CENTER;\n/* 1678 */ rotationAnchor = TextAnchor.BOTTOM_CENTER;\n/* */ } else {\n/* */ \n/* 1681 */ anchor = TextAnchor.TOP_CENTER;\n/* 1682 */ rotationAnchor = TextAnchor.TOP_CENTER;\n/* */ } \n/* */ \n/* */ \n/* 1686 */ Tick tick = new DateTick(tickDate, tickLabel, anchor, rotationAnchor, angle);\n/* */ \n/* 1688 */ result.add(tick);\n/* 1689 */ hasRolled = false;\n/* */ \n/* 1691 */ long currentTickTime = tickDate.getTime();\n/* 1692 */ tickDate = unit.addToDate(tickDate, this.timeZone);\n/* 1693 */ long nextTickTime = tickDate.getTime();\n/* 1694 */ for (int minorTick = 1; minorTick < minorTickSpaces; \n/* 1695 */ minorTick++) {\n/* 1696 */ long minorTickTime = currentTickTime + (nextTickTime - currentTickTime) * minorTick / minorTickSpaces;\n/* */ \n/* */ \n/* 1699 */ if (getRange().contains(minorTickTime) && \n/* 1700 */ !isHiddenValue(minorTickTime)) {\n/* 1701 */ result.add(new DateTick(TickType.MINOR, new Date(minorTickTime), \"\", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0D));\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ continue;\n/* */ } \n/* */ \n/* */ \n/* 1710 */ tickDate = unit.rollDate(tickDate, this.timeZone);\n/* 1711 */ hasRolled = true;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1716 */ return result;\n/* */ }", "public void tickTock() {\n Calendar t2 = Calendar.getInstance();//gets current time\n t2.add(Calendar.MILLISECOND, 580);//adds time to time retrieved\n Date t = t2.getTime();//set t to time gotten\n time = timeFormat.format(t);//formats the time for the timeLabel\n timeLabel.setText(\" \" + time + \" \");//sets the time for the time label\n day = dayFormat.format(t);\n dayLabel.setText(\" \" + day + \" \");\n date = dateFormat.format(t);\n dateLabel.setText(date);\n\n/*public void setImage() {\n ImageIcon icon = new ImageIcon(\"geometric-cool-elephant-wall-clocks.jpg\");\n image = new JLabel();\n image.setIcon(icon);\n add(image);\n }\n*/\n }", "public float getTimeSeconds() { return getTime()/1000f; }", "@JSProperty(\"tickPixelInterval\")\n void setTickPixelInterval(double value);", "@JSProperty(\"tickInterval\")\n void setTickInterval(double value);", "public long getElapsedTicks() {\n\t\tlong elapsed;\n\t\tif (running) {\n\t\t\telapsed = (System.nanoTime() - startTime);\n\t\t} else {\n\t\t\telapsed = (stopTime - startTime);\n\t\t}\n\t\treturn elapsed / nsPerTick;\n\t}", "public void timeTick()\r\n\t{\r\n\t\tnumberDisplay1.increment();\r\n\t}", "int getTtiSeconds();", "public void setTicks(final int t) {\r\n ticks = t;\r\n }", "public static final double getTickMillisD() {\n return p().TIME_TICK_DOUBLE;\n }", "public void timer() \r\n\t{\r\n\t\tSeconds.tick();\r\n\t \r\n\t if (Seconds.getValue() == 0) \r\n\t {\r\n\t \tMinutes.tick();\r\n\t \r\n\t \tif (Minutes.getValue() == 0)\r\n\t \t{\r\n\t \t\tHours.tick();\r\n\t \t\t\r\n\t \t\tif(Hours.getValue() == 0)\r\n\t \t\t{\r\n\t \t\t\tHours.tick();\r\n\t \t\t}\r\n\t \t}\r\n\t }\t\t\r\n\t \r\n\t updateTime();\r\n\t }", "int getTickLength();", "public void tick(double dt) {\n }", "public static float toSeconds(int tick)\n\t{\n\t\treturn (float) tick / ReferenceConfig.TARGET_UPS;\n\t}", "private int toTime(int i) {\n int count = 0;\n\n //hours units\n count += toLeds((i / 6000) % 10);\n //hours tens\n count += toLeds(((i / 6000) % 100) / 10);\n\n //minutes units\n count += toLeds((i / 60) % 10);\n //minutes tens\n count += toLeds(((i / 60) % 100) / 10);\n\n //seconds units\n count += toLeds((i % 60) % 10);\n //seconds tens\n count += toLeds(((i % 60) % 100) / 10);\n\n return count;\n }", "protected List refreshTicksVertical(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge) {\n/* 1732 */ List result = new ArrayList();\n/* */ \n/* 1734 */ Font tickLabelFont = getTickLabelFont();\n/* 1735 */ g2.setFont(tickLabelFont);\n/* */ \n/* 1737 */ if (isAutoTickUnitSelection()) {\n/* 1738 */ selectAutoTickUnit(g2, dataArea, edge);\n/* */ }\n/* 1740 */ DateTickUnit unit = getTickUnit();\n/* 1741 */ Date tickDate = calculateLowestVisibleTickValue(unit);\n/* 1742 */ Date upperDate = getMaximumDate();\n/* */ \n/* 1744 */ boolean hasRolled = false;\n/* 1745 */ while (tickDate.before(upperDate)) {\n/* */ \n/* */ \n/* 1748 */ if (!hasRolled) {\n/* 1749 */ tickDate = correctTickDateForPosition(tickDate, unit, this.tickMarkPosition);\n/* */ }\n/* */ \n/* */ \n/* 1753 */ long lowestTickTime = tickDate.getTime();\n/* 1754 */ long distance = unit.addToDate(tickDate, this.timeZone).getTime() - lowestTickTime;\n/* */ \n/* 1756 */ int minorTickSpaces = getMinorTickCount();\n/* 1757 */ if (minorTickSpaces <= 0) {\n/* 1758 */ minorTickSpaces = unit.getMinorTickCount();\n/* */ }\n/* 1760 */ for (int minorTick = 1; minorTick < minorTickSpaces; minorTick++) {\n/* 1761 */ long minorTickTime = lowestTickTime - distance * minorTick / minorTickSpaces;\n/* */ \n/* 1763 */ if (minorTickTime > 0L && getRange().contains(minorTickTime) && \n/* 1764 */ !isHiddenValue(minorTickTime)) {\n/* 1765 */ result.add(new DateTick(TickType.MINOR, new Date(minorTickTime), \"\", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0D));\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 1770 */ if (!isHiddenValue(tickDate.getTime())) {\n/* */ TextAnchor rotationAnchor, anchor;\n/* */ String tickLabel;\n/* 1773 */ DateFormat formatter = getDateFormatOverride();\n/* 1774 */ if (formatter != null) {\n/* 1775 */ tickLabel = formatter.format(tickDate);\n/* */ } else {\n/* */ \n/* 1778 */ tickLabel = this.tickUnit.dateToString(tickDate);\n/* */ } \n/* */ \n/* 1781 */ double angle = 0.0D;\n/* 1782 */ if (isVerticalTickLabels()) {\n/* 1783 */ anchor = TextAnchor.BOTTOM_CENTER;\n/* 1784 */ rotationAnchor = TextAnchor.BOTTOM_CENTER;\n/* 1785 */ if (edge == RectangleEdge.LEFT) {\n/* 1786 */ angle = -1.5707963267948966D;\n/* */ } else {\n/* */ \n/* 1789 */ angle = 1.5707963267948966D;\n/* */ }\n/* */ \n/* */ }\n/* 1793 */ else if (edge == RectangleEdge.LEFT) {\n/* 1794 */ anchor = TextAnchor.CENTER_RIGHT;\n/* 1795 */ rotationAnchor = TextAnchor.CENTER_RIGHT;\n/* */ } else {\n/* */ \n/* 1798 */ anchor = TextAnchor.CENTER_LEFT;\n/* 1799 */ rotationAnchor = TextAnchor.CENTER_LEFT;\n/* */ } \n/* */ \n/* */ \n/* 1803 */ Tick tick = new DateTick(tickDate, tickLabel, anchor, rotationAnchor, angle);\n/* */ \n/* 1805 */ result.add(tick);\n/* 1806 */ hasRolled = false;\n/* */ \n/* 1808 */ long currentTickTime = tickDate.getTime();\n/* 1809 */ tickDate = unit.addToDate(tickDate, this.timeZone);\n/* 1810 */ long nextTickTime = tickDate.getTime();\n/* 1811 */ for (int minorTick = 1; minorTick < minorTickSpaces; \n/* 1812 */ minorTick++) {\n/* 1813 */ long minorTickTime = currentTickTime + (nextTickTime - currentTickTime) * minorTick / minorTickSpaces;\n/* */ \n/* */ \n/* 1816 */ if (getRange().contains(minorTickTime) && \n/* 1817 */ !isHiddenValue(minorTickTime)) {\n/* 1818 */ result.add(new DateTick(TickType.MINOR, new Date(minorTickTime), \"\", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0D));\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ continue;\n/* */ } \n/* */ \n/* 1826 */ tickDate = unit.rollDate(tickDate, this.timeZone);\n/* 1827 */ hasRolled = true;\n/* */ } \n/* */ \n/* 1830 */ return result;\n/* */ }", "public void _setTicks() {\n if (!Double.isNaN(tickIncrement)) {\n setTicksByIncr(tickIncrement);\n return;\n }\n double diff = Math.abs(max - min);\n if (!(diff > 0.)) {\n int tn = 2;\n tn += nanW > 0 ? 2 : 0;\n tn += negW > 0 ? 2 : 0;\n tn += nanW > 0 || negW > 0 ? 2 : 0;\n tn += posW > 0 ? 4 : 0;\n ticks = new double[tn];\n int i = 0;\n if (nanW > 0) {\n ticks[i++] = 0.;\n ticks[i++] = Double.NaN;\n if (!(negW > 0)) {\n ticks[i++] = 0. + nanW;\n ticks[i++] = Double.NaN;\n }\n }\n if (negW > 0) {\n ticks[i++] = 0. + nanW;\n ticks[i++] = Double.NEGATIVE_INFINITY;\n ticks[i++] = 0. + nanW + negW;\n ticks[i++] = Double.NEGATIVE_INFINITY;\n }\n ticks[i++] = 0. + nanW + posW;\n ticks[i++] = min;\n if (posW > 0) {\n ticks[i++] = size-posW+1;\n ticks[i++] = Double.POSITIVE_INFINITY;\n ticks[i++] = size-1;\n ticks[i++] = Double.POSITIVE_INFINITY;\n }\n return;\n }\n double exp = Math.log(diff) * 0.43429448190325176; // log10\n int expi = -(int)Math.floor(exp);\n double scale = Math.pow(10.,expi);\n double smin = Math.floor(min * scale);\n double smax = Math.ceil(max * scale);\n int siz = size - nanW - negW - nanW;\n int sdiff = (int)(smax - smin);\n if (sdiff > siz/2)\n scale *= .5;\n else if (sdiff < 3)\n scale *= 4;\n else if (sdiff < 5)\n scale *= 2;\n double incr = 1./scale;\n int count = 0;\n double sval = smin / scale;\n if (max > min) {\n smin = Math.ceil(min * scale);\n smax = Math.floor(max * scale) / scale + .2 * incr;\n sval = smin / scale;\n while ( sval <= smax ) {\n count+=2;\n sval += incr;\n }\n } else {\n incr *= -1.;\n smin = Math.floor(min * scale);\n smax = Math.ceil(max * scale) / scale + .2 * incr;\n sval = smin / scale;\n while ( sval >= smax ) {\n count+=2;\n sval += incr;\n }\n }\n int tn = count;\n tn += nanW > 0 ? 2 : 0;\n tn += negW > 0 ? 2 : 0;\n tn += nanW > 0 || negW > 0 ? 2 : 0;\n tn += posW > 0 ? 4 : 0;\n sval = smin / scale;\n ticks = new double[tn];\n int pi = 0; // pixelIndex\n if (nanW > 0 && pi < tn) {\n ticks[pi++] = 0.;\n ticks[pi++] = Double.NaN;\n if (!(negW > 0)) {\n ticks[pi++] = 0. + nanW;\n ticks[pi++] = Double.NaN;\n }\n }\n if (negW > 0 && pi < tn) {\n ticks[pi++] = 0. + nanW;\n ticks[pi++] = Double.NEGATIVE_INFINITY;\n ticks[pi++] = 0. + nanW + negW;\n ticks[pi++] = Double.NEGATIVE_INFINITY;\n }\n for (int i = 0; i < count && pi < tn; i += 2) {\n ticks[pi++] = nanW + negW + (siz - 1) * ((sval - min ) / (max - min));\n ticks[pi++] = Math.round(sval*scale)/scale;\n sval += incr;\n }\n if (posW > 0 && pi < tn) {\n ticks[pi++] = size-posW+1;\n ticks[pi++] = Double.POSITIVE_INFINITY;\n ticks[pi++] = size-1;\n ticks[pi++] = Double.POSITIVE_INFINITY;\n }\n }", "public static long timestampMicros()\n {\n return currentTimeMillis() * 1000;\n }", "public void updateTicksCount(int ticks) {\r\n\t\tsimTicks.setText(\"Ticks: \" + ticks);\r\n\t}", "long getTimeInMilliSeconds();", "public long getTimeDisplay(long nowm) {\n checkRunningExpired(nowm); // Pour éviter le cas (nowm - timeStart) > timeDef, cad nowm > timeExp, pour un timer\n long tacc = timeAcc;\n if (running) {\n tacc = tacc + nowm - timeStart;\n }\n long taus = timeAccUntilSplit;\n if (mode.equals(MODES.TIMER)) {\n tacc = -tacc;\n taus = -taus;\n }\n return (timeDef + (splitted ? taus : tacc)) % TIME_UNITS.DAY.DURATION_MS(); // => Retour à 00:00:00.00 après 23:59:59.99\n }", "public StockDateTime getTicks(Boolean ticks) {\n StockDateTime item = new StockDateTime(jsBase + \".ticks(\" + ticks + \")\");\n getTicks2.add(item);\n return item;\n }", "public static double getTimeMs(){\n return System.nanoTime()*nanoToMs;\n }", "public double getTime()\n {\n long l = System.currentTimeMillis()-base;\n return l/1000.0;\n }", "@Override\n public int getTimeForNextTicInSeconds() {\n int seconds = Calendar.getInstance().get(Calendar.SECOND);\n return 60 - seconds;\n }", "public static int getTimeSeconds() {\n return Atlantis.getBwapi().getFrameCount() / 30;\n }", "public int getIntervalMinutes();", "public long getElapsedTimeMili() {\n return running ? ((System.currentTimeMillis() - startTime)/100) % 1000 : 0;\n }", "public int getUpSeconds() {\n return (int)((_uptime % 60000) / 1000);\n }", "@Override\n public void onTick(long arg0) {\n }", "public static double tic() {\n\t\tt = System.currentTimeMillis() / 1000d;\n\t\treturn t;\n\t}", "private long timeNow()\n {\n // The value of 3506716800000000L is the BAT as at midnight on\n // 1-Jan-1970, which is the base of the time that the system\n // gives us. It has to be adjusted for leap seconds though.\n return (System.currentTimeMillis() * 1000L) + DUTC.get() * 1000000L + 3506716800000000L;\n }", "public Tick() {\n\t\tthis.start = System.currentTimeMillis();\n\t\tthis.last = start;\n\t}", "@Override\n public void onTick(long leftTimeInMilliseconds) {\n long seconds = leftTimeInMilliseconds / 1000;\n if(counter == 15){\n pgBarCountDown.setProgress(100);\n }\n else {\n pgBarCountDown.setProgress(counter * 6);\n }\n\n tv_timer_text.setText(counter+\" \" +\"Sec\");\n // format the textview to show the easily readable format\n counter++;\n\n }", "public double readClock()\n {\n return (System.currentTimeMillis() - startingTime) / 1000.0;\n }", "public void onTick(long millisecondsUnitlFinished){\n\n Log.i(\"info\", String.valueOf(millisecondsUnitlFinished / 1000));\n\n }", "double convertRpmToTicksPer100ms(double rpm) {\n return rpm / SECONDS_PER_MINUTE * TALON_TICKS_PER_REV / HUNDRED_MS_PER_SECOND;\n }", "public Integer getTicksPerBeat() {\n int ticks = 1;\n int gcd;\n for (int i = 0; i < phrases.size(); i++) {\n int phraseTicks = phrases.get(i).getTicks();\n /**\n * Computing the gcd of the two will help us compute the LCM.\n */\n gcd = 1;\n if (phraseTicks % 2 == 0 && ticks % 2 == 0)\n gcd = 2;\n for (int j = 3; j <= Math.min(phraseTicks, ticks); j++) {\n if (phraseTicks % j == 0 && ticks % j == 0) {\n gcd = j;\n }\n }\n /**\n * Compute the least common multiple of ticks and phraseTicks\n */\n ticks = phraseTicks * ticks / gcd;\n }\n return ticks;\n }", "public StockTicks getTicks() {\n if (getTicks == null)\n getTicks = new StockTicks(jsBase + \".ticks()\");\n\n return getTicks;\n }", "public final double encoderTicksToInches(double ticks) {\n return WHEEL_RADIUS * 2 * Math.PI * GEAR_RATIO * ticks / TICKS_PER_REV;\n }", "double convertTicksPer100msToRPM(double ticks) {\n return ticks * HUNDRED_MS_PER_SECOND / TALON_TICKS_PER_REV * SECONDS_PER_MINUTE;\n }", "public int getTime(){\n return (timerStarted > 0) ? (int) ((System.currentTimeMillis() - timerStarted) / 1000L) : 0;\n }", "public void tickerNeuStarten( int ms ) \n {\n anzeige.tickerAbmelden( this );\n anzeige.tickerAnmelden( this , ms );\n }", "void updateMaxTick();", "public void tick(){\r\n if(timer != 0)\r\n timer++;\r\n }", "private static float tock(){\n\t\treturn (System.currentTimeMillis() - startTime);\n\t}", "public void presetTime(long tick,int ento){\r\n\r\n\t}", "@JSProperty(\"minTickInterval\")\n double getMinTickInterval();", "public void addTicks(int toAdd)\r\n\t{\r\n\t\tm_ticks += toAdd;\r\n\t}", "private String intTime(long l){\r\n String s=\"\";\r\n s+=(char)(((l/1000)/60)+'0')+\":\"+(char)((((l/1000)%60)/10)+'0')+(char)((((l/1000)%60)%10)+'0'); \r\n return s;\r\n }", "public static void main(String[] args) {\n System.out.println(\"Eight Hours in Millis (Direct Conversion): \" + (8*60*60*1000));\n\n long eightHoursInMillisTimeUnit = TimeUnit.HOURS.toMillis(8);\n System.out.println(\"Eight Hours in Millis using TimeUnit: \" + eightHoursInMillisTimeUnit);\n }", "public int getMiliSeconds() {\r\n\t\treturn milis;\r\n\t}", "@Override\n\tpublic void onTickInGame() {\n\t\tticksExisted += 1;\n\t}", "@Override\n\t\tpublic void onTick(long arg0) {\n\t\t\t\n\t\t}", "public int tickRate(World p_149738_1_) {\n\t\treturn 2;\n\t}", "int getTimeInstants();", "public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}", "public void update() {\r\n\t\tlabel.setText(time / 60 + \":\" + ((time % 60 <= 9)? (\"0\" + time % 60) : (time % 60)));\r\n\t}", "private int calcTotalTime() {\n\t\tint time = 0;\n\t\tfor (Taxi taxi : taxis) {\n\t\t\ttime += taxi.calcTotalTime();\n\t\t}\n\t\treturn time;\n\t}", "private String tick() {\r\n\t\tString out=\"Tick: \"+tile.getTick();\r\n\t\treturn out;\r\n\t}", "public long getTick() {\n return tick;\n }", "public long getTick() {\n return tick;\n }", "public StockDateTime getTicks(String ticks) {\n StockDateTime item = new StockDateTime(jsBase + \".ticks(\" + wrapQuotes(ticks) + \")\");\n getTicks1.add(item);\n return item;\n }", "public DateTickUnit getTickUnit() { return this.tickUnit; }", "public synchronized void scheduleTick(long deltat){\n\t\tscheduler.schedule(tickTask, deltat, TimeUnit.MILLISECONDS);\n\t}", "public static float getCurrentTime(){\n return (float)(System.currentTimeMillis()-t0)/1000.0f;\r\n }", "public static long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}", "public abstract EnumSet<TickType> ticks();" ]
[ "0.6682091", "0.65507996", "0.6530086", "0.65278465", "0.6516906", "0.6394278", "0.63570946", "0.6284592", "0.62457067", "0.6203247", "0.61339587", "0.61182654", "0.6117566", "0.61163443", "0.6096013", "0.60806733", "0.60351753", "0.60343087", "0.6014341", "0.598145", "0.5950511", "0.5924303", "0.5918487", "0.58989054", "0.58870167", "0.5876893", "0.5858861", "0.5854942", "0.58265084", "0.5824166", "0.58129597", "0.579261", "0.57898474", "0.5789124", "0.5777593", "0.5776595", "0.5775448", "0.5756042", "0.57350355", "0.57330257", "0.57236874", "0.56974113", "0.5693985", "0.56753254", "0.5672578", "0.5639725", "0.56281495", "0.5610037", "0.56047493", "0.55849385", "0.5569626", "0.5568056", "0.5563114", "0.55558974", "0.5550939", "0.55181813", "0.55165434", "0.5514913", "0.5499249", "0.5497243", "0.54848427", "0.5463786", "0.54518336", "0.54247385", "0.54111415", "0.53944755", "0.5391754", "0.5380728", "0.5364746", "0.5362395", "0.5353922", "0.53530186", "0.53438556", "0.5329357", "0.5326408", "0.5319344", "0.5315852", "0.5307635", "0.5306512", "0.530482", "0.52942", "0.52933294", "0.5291875", "0.5290581", "0.5284083", "0.5283532", "0.528161", "0.52798855", "0.52766496", "0.5268852", "0.5261989", "0.525895", "0.52576417", "0.52563053", "0.52563053", "0.52548546", "0.5254625", "0.5254573", "0.52389085", "0.5237344", "0.5235758" ]
0.0
-1
removes chance of spider jockey
public void initCreature() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void killAndHunt() {\n\t\tRandom random = new Random();\n\t\tint currentIndex = random.nextInt(N);\t\n\t\tkill(currentIndex);\n\t}", "public void NPSShot()\n\t{\n\t\t//can only occur if a friendly missile and \n\t\t//a NPS are spawned\n\t\tif(gameObj[2].size() > 0 && gameObj[4].size() > 0)\n\t\t{\n\t\t\tint nps = new Random().nextInt(gameObj[2].size());\n\t\t\tint mis = new Random().nextInt(gameObj[4].size());\n\t\t\tgameObj[2].remove(nps);\n\t\t\tgameObj[4].remove(mis);\n\t\t\tscore += 500;\n\t\t\tSystem.out.println(\"A player misile has struck a NPS! +500 points\");\n\t\t}else\n\t\t\tSystem.out.println(\"An NPS and a friendly missile are not spawned\");\n\t}", "private void reviveAttacker() {\n\t\tString type = (mRandom.nextFloat() > mKnightSpawnChance) ? \"normal\" : \"knight\";\n\t\treviveAttacker(type);\n\t}", "public void unsetChanceCardShuffle() {\n ChanceCardShuffle = false;\n }", "public void dropItLikeItsHot(){\n\t\tint score_increment = 0;\n\t\tPoint test_location = new Point(pieceOrigin);\n\t\twhile(true){\n\t\t\ttest_location.y += 1;\n\t\t\tif(!collides(test_location, currentPiece)){\n\t\t\t\tpieceOrigin.y += 1;\n\t\t\t\tscore_increment += 1;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tscore += score_increment*100;\n\t\tgossipGirl();\n\t\trepaint();\n\t}", "void nuke() {\n\t\tfor (int a = 0; a < height; a++) {\n\t\t\tfor (int b = 0; b < width; b++) {\n\t\t\t\tif (FWorld[a][b] != null) {\n\t\t\t\t\tEZ.removeEZElement(FWorld[a][b]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEZ.removeEZElement(background);\n\t\tEZ.removeEZElement(explosion);\n\t\tturtle.kill();\n\t}", "public static void kill() {\n Iterator<Recipe> recipes = tj.getServer().recipeIterator();\r\n Recipe recipe;\r\n\r\n while (recipes.hasNext()) {\r\n recipe = recipes.next();\r\n\r\n if (recipe != null && customItems.containsValue(recipe.getResult()))\r\n recipes.remove();\r\n }\r\n\r\n tj = null;\r\n messages = null;\r\n playerDataFolder = null;\r\n players = null;\r\n customItems = null;\r\n }", "public void removeMissiles(){\n nunMissiles--;\n }", "public void unleash() {\n\t\tlocked = false;\n\t\tfloat percent = framesAccelerated/60.0f;\n\t\tif (percent > 1) percent = 2 - percent;\n\t\tif (percent < 0) percent = 0;\n\t\t\n\t\tif (player.aiControlled()) {\n\t\t\tpercent = AIcontroller.randomStartBoost();\n\t\t}\n\t\t\n\t\tspeed = MAX_SPEED * percent;\n\t}", "void unsetSingleBetMinimum();", "double getMissChance();", "private void resetCooldown() {\n nextAttack = tower.getFireFrequency();\n }", "public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {}", "public void setDropChance(double dropChance) {\n _dropChance = dropChance;\n }", "public void vanish(Player p){\n if(boostType.equals(\"force\")){\n p.setStrength(p.getStrength() - 1);\n }else if(boostType.equals(\"life\")){\n p.modifyLife(-1);\n }else if(boostType.equals(\"force+\")){\n p.setStrength(p.getStrength() - 2);\n }else if(boostType.equals(\"life+\")) {\n p.modifyLife(-2);\n }else if(boostType.equals(\"force++\")){\n p.setStrength(p.getStrength() - 3);\n }else if(boostType.equals(\"life++\")) {\n p.modifyLife(-3);\n }\n }", "public Critter1() {\r\n\t\tnumberSpawned = 0;\r\n\t\twhile (fearfullness < 50) {//at minimum fearfullness is 50%\r\n\t\t\tfearfullness = getRandomInt(100);\r\n\t\t}\r\n\t}", "@Override\n protected void dropFewItems(boolean hit, int looting) {\n super.dropFewItems(hit, looting);\n for (int i = this.rand.nextInt(2 + looting); i-- > 0;) {\n this.dropItem(Items.ender_pearl, 1);\n }\n }", "public void perdEnergieRandom() {\r\n Random rd = new Random();\r\n robots.get(rd.nextInt(robots.size() - 1)).perdEnergie(5);\r\n }", "public void youBrokeSon(){\n\t\tcoinList.clear();\n\t}", "public void kill()\r\n {\n if(isTouching(TopDownPlayer.class))\r\n {\r\n health(1);\r\n\r\n getWorld().removeObject(player);\r\n //getWorld().addObject (new Test(), 20, 20);\r\n\r\n }\r\n // if(healthCount >= 1)\r\n // {\r\n // World world;\r\n // world = getWorld();\r\n // getWorld().removeObject(player);\r\n // \r\n // getWorld().addObject (new Test(), 20, 20);\r\n // }\r\n }", "public void forgetStats() {\n this.name = generateIdiotName();\n hitPoints = HeroesVersusMonsters.randInt(70, 200);\n //Without this line forgetStats() would be a very overpowered healing ability\n subtractHitPointsSilently(this.damageTaken);\n attackSpeed = HeroesVersusMonsters.randInt(2, 6);\n damageMax = HeroesVersusMonsters.randInt(30, 60);\n damageMin = HeroesVersusMonsters.randInt(15, 30);\n chanceToHit = HeroesVersusMonsters.randDouble(0.6D, 0.8D);\n chanceToBlock = HeroesVersusMonsters.randDouble(0.2D, 0.4D);\n Interface.showln(\"You are now \" + this.getName() + \", a forgetful idiot with a max health of \" + this.getHitPoints());\n Interface.showln(\"You have an attack speed of \" + this.getAttackSpeed() + \" and deal damage ranging from \" + this.getDamageMin() + \" to \" + this.getDamageMax());\n Interface.showln(\"You have a \" + (int) (this.getchanceToHit() * 100) + \"% chance to hit, and a \" + (int) (this.getChanceToBlock() * 100) + \"% chance to block\");\n }", "private final void kill() {\n\t\tgrown=false;\t\t\n\t}", "private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}", "public static boolean purge(){\r\n if((Math.random()*1000)<5) return true;\r\n return false;\r\n }", "@Override\n\tprotected void killReward() {\n\t\t\n\t}", "public void killBoss() {\n\t\tSystem.out.println(this.name+\"已经击杀一名敌方英雄...\");\n\t}", "public void die(){\n \tif (resetdelay<=0){ //if he didn't just die\r\n \t\tresetdelay = 100; //gives the frog 100 frames of invincibility\r\n \t\tlives-=1;\r\n \t}\r\n }", "public void removePawn() {\n lives = 0;\n }", "public void PSShot()\n\t{\n\t\t//collision can only occur if an enemy missile and a PlayerShip are spawned\n\t\tif(gameObj[1].size() > 0 && gameObj[3].size() > 0)\n\t\t{\n\t\t\tint mis = new Random().nextInt(gameObj[3].size());\n\t\t\tgameObj[1].remove(0);\n\t\t\tgameObj[3].remove(mis);\n\t\t\tlives--;\n\t\t\tSystem.out.println(\"An enemy missile has struck a PS -1 life\");\n\t\t\tif(lives >0) \n\t\t\t\tSystem.out.println(\"you have \" + lives + \" left\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Game over\");\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship and an enemy missile are not spawned\");\t\t\n\t}", "private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Unpaid charges. Go to jail\");\n setJail(currentPlayer);\n }\n if(randomNum == 3){\n convertTextToSpeech(\"Build a rooftop swimming pool on your apartment, pay 300\");\n if(m_manageFunds) {\n currentPlayer.subtractMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n m_freeParking += 300;\n Log.d(\"chance subtract 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance free parking\", String.valueOf(m_freeParking));\n }\n }\n }", "public void recover(){\n\tint hp = (int)((Math.random() * health)*.5);\n\n\thealth += hp;\n\t\t\n\tSystem.out.print(\"You catch your breath and pick yourself up. Recover : \");\n\tSystem.out.print(hp);\n\tSystem.out.println(\" health.\\n\"); \n }", "public void loseNoise()\n {\n if(!mute)\n {\n try { \n URL url = this.getClass().getClassLoader().getResource(\"Doh.wav\"); \n \n double c = Math.random();\n \n if(crash())\n {\n if(c>.20 && c<.45)\n url = this.getClass().getClassLoader().getResource(\"Doh2.wav\");\n else if(c>=.45 && c<.75)\n url = this.getClass().getClassLoader().getResource(\"Doh3.wav\");\n else if(c>=.75 && c<=1)\n url = this.getClass().getClassLoader().getResource(\"Doh4.wav\");\n }\n \n else if(outOfBounds())\n //else\n {\n url = this.getClass().getClassLoader().getResource(\"MM Game Over.wav\");\n if(c>.50 && c<=.75)\n url = this.getClass().getClassLoader().getResource(\"SM3 Game Over.wav\");\n if(c>.75 && c<=1)\n url = this.getClass().getClassLoader().getResource(\"DK Game Over.wav\");\n }\n if(modeT)\n {\n url = this.getClass().getClassLoader().getResource(\"MM Game Over.wav\");\n if(c>.50 && c<=.75)\n url = this.getClass().getClassLoader().getResource(\"SM3 Game Over.wav\");\n if(c>.75 && c<=1)\n url = this.getClass().getClassLoader().getResource(\"DK Game Over.wav\");\n }\n \n if(difficult.equals(\"GHOST\"))\n {\n //if(outOfBounds())\n url = this.getClass().getClassLoader().getResource(\"PM Game Over.wav\");\n //else if(crash())\n // url = this.getClass().getClassLoader().getResource(\"PM2 Game Over.wav\");\n }\n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n lclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n lclip.open(audioIn); \n \n lclip.start();\n \n \n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n } \n }\n }", "@Override\r\n\tpublic final void purge() {\r\n\t\tthis.members.clear();\r\n\t\tthis.age++;\r\n\t\tthis.gensNoImprovement++;\r\n\t\tthis.spawnsRequired = 0;\r\n\r\n\t}", "public Builder clearMinigameDefenseChancesLeft() {\n \n minigameDefenseChancesLeft_ = 0;\n onChanged();\n return this;\n }", "@Override\n protected void dropFewItems(boolean hit, int looting) {\n super.dropFewItems(hit, looting);\n if (hit && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + looting) > 0)) {\n Item drop = null;\n switch (this.rand.nextInt(5)) {\n case 0:\n drop = Items.gunpowder;\n break;\n case 1:\n drop = Items.sugar;\n break;\n case 2:\n drop = Items.spider_eye;\n break;\n case 3:\n drop = Items.fermented_spider_eye;\n break;\n case 4:\n drop = Items.speckled_melon;\n break;\n }\n if (drop != null) {\n this.dropItem(drop, 1);\n }\n }\n }", "public void removeGold(int g){\n this.gold = this.gold - g;\n }", "void unsetProbables();", "@Override\n public void exit() {\n player.steeringBehaviorsManager.removeBehavior(ballPursuit);\n }", "void unsetMultipleBetMinimum();", "private void dance() {\n\t\t// if they are done dancing, start sleeping\n\t\tif(danceDuration <= 0){\n\t\t\thive.dancingBees.remove(this);\n\t\t\tstate = \"SLEEPING\";\n\t\t}\n\t\telse{ // otherwise keep dancing and decrease duration of dance\n\t\t\tdanceDuration--;\n\t\t}\n\t}", "public void removeRandom() {\n Node[] nodes = getRandomNonterminalNode(false);\n if (nodes == null)\n return;\n \n // Generate random DecisionNode to replace\n DecisionNode replacementNode = DecisionNode.getRandom();\n \n // Update prev reference\n if (nodes[PREV].left == nodes[CURR]){\n nodes[PREV].left = replacementNode;\n } else {\n nodes[PREV].right = replacementNode;\n }\n }", "public void playCard(int joshleisajoke)\r\n\t{\n\t\tCard thing = hand.remove(joshleisajoke);\r\n\t\tw.build(thing);\r\n\t\tif(thing.getCost().containsKey(\"coin\"))\r\n\t\t\tcoins--;\r\n\t\tdoEffect(thing);\r\n\t}", "public void kill() {\n // leben abziehen und geister sowie pacman respawnen\n lives--;\n pacman.respawn(level.getRandomPacmanSpawn());\n for (GameEntity entity : entities)\n if (entity instanceof Ghost)\n ((Ghost) entity).respawn(level.getNextGhostSpawn());\n }", "public void unsetChestCardShuffle() {\n ChanceCardShuffle = false;\n }", "@Inject(\n at = @At(\"HEAD\"),\n method = \"tick\",\n cancellable = true)\n\n private void removeWeakenedIfPCEnchant(CallbackInfo ci) {\n if ((Object) this instanceof PlayerEntity) {\n PlayerEntity entity = (PlayerEntity) (Object) this;\n ItemStack mainHand = getMainHandStack();\n\n if (EnchantmentHelper.getLevel(EnchantsRegistry.WEAKENING, mainHand) >= 1\n || mainHand.getItem() == ItemRegistry.getItem(\"sword_nameless_blade\").asItem()) {\n this.removeStatusEffect(StatusEffects.WEAKNESS);\n }\n }\n }", "public void premesaj() {\r\n Collections.shuffle(kup);\r\n }", "private void DeleteBurnInsOnPreviousSamples() {\n\t\tif (gibbs_sample_num <= num_gibbs_burn_in + 1 && gibbs_sample_num >= 2){\n\t\t\tgibbs_samples_of_bart_trees[gibbs_sample_num - 2] = null;\n\t\t}\n\t}", "public int hideBomb() {\r\n\r\n\t\tint randomLocation = (int) Math.floor(Math.random() * 9);\r\n\t\trandomLocation = Math.round(randomLocation);\r\n\r\n\t\treturn randomLocation; \r\n\r\n\t}", "public void birdDeath(){\n birdDeath[(int)(Math.random()*3)].play(1f);\n }", "public void fixShield(CrewMember member) {\n\t\t\n\t\tmember.minusAction();\n\t\t\n\t\tRandom rand = new Random();\n\t\tint randomElement = rand.nextInt(100);\n\t\t\n\t\tif(randomElement <= member.getRepair()) {\n\t\t\t// Increases progress bar\n\t\t\tshieldLevel += 1;\n\t\t}\n\t\t\n\t\tif (! (member instanceof Engineer)) {\n\t\t\tmember.minusTiredness(20);\n\t\t\t} \n\t}", "public void reduceAnimalHappiness() {\n\t\thappiness -= 10;\n\t}", "public void randomMove(){\n ArrayList<Hole> availableHoles = availableMoves(nextToPlay);\n int holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n ArrayList<Korgool> korgools = availableHoles.get(holeIndex).getKoorgools();\n while(korgools.size() == 0){\n holeIndex = (int)(Math.random() * (((availableHoles.size()-1) - 0) + 1)) + 0;\n korgools = availableHoles.get(holeIndex).getKoorgools();\n }\n redistribute(availableHoles.get(holeIndex).getHoleIndex());\n }", "public void killAllArmorstands(JuggernautPlayer player){\n player.removeEntities(armorstandProgressbarID, armorstandItemID, armorstandClaimProgressID, armorstandResetChestID, armorstandInfoID, armorstandClaimInfoID);\n }", "public void kill() {\n this.hp = 0;\n }", "public void reset() {\n if (id.equals(new ResourceLocation(\"minecraft:planks\"))) {\n whitelist(Range.closed(0, 5));\n } else\n whitelist(Range.closed(0, 15));\n }", "public void forceDiscard(TurnTracker turn_tracker_pointer, int player_index) throws Exception;", "private void remindGoal()\n {\n System.out.println(\"you have to Pick up all three items and get back outside!\");\n }", "public void infect() {\n\n if (random.getRandom() <= getProbability()) {\n isInfected = true;\n isInfectedOnThisStep = true;\n }\n }", "public float getSpawningChance()\n {\n return 0.1F;\n }", "public double getDropChance() {\n return _dropChance;\n }", "public void defend(){\n\tdefense += (int)(Math.random() * defense * .45 + 5);\n\tstrength -= 3;\n\tif (defense > 70) {\n\t defense = 70;\n\t}\t \n\tcounterDef += 1;\n\tif (counterDef == 2){\n\t counterDef = 0;\n\t recover();\n\t}\n\tSystem.out.println(\"You brace yourself with your bow.\");\n }", "public void highscorenoise()\n {\n if(!mute)\n {\n try\n { \n URL url = this.getClass().getClassLoader().getResource(\"Darkmoon Caverns.wav\");\n double c = Math.random();\n if(c<=.25)\n url = this.getClass().getClassLoader().getResource(\"Mario Kart Win.wav\");\n else if(c<=.50)\n url = this.getClass().getClassLoader().getResource(\"Pirate Lagoon.wav\");\n else if(c<=.75)\n url = this.getClass().getClassLoader().getResource(\"Crescent Island.wav\"); \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n hclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n hclip.open(audioIn); \n \n hclip.start();\n hclip.loop(Clip.LOOP_CONTINUOUSLY);\n \n } \n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n } \n catch (IOException e) \n {\n e.printStackTrace();\n } \n catch (LineUnavailableException e) \n {\n e.printStackTrace();\n } \n }\n }", "public void lowerHealth() {\n Greenfoot.playSound(\"hit.wav\");\n lives--;\n move(-100);\n if (lives == 0) {\n die();\n }\n }", "void bust() {\n\t\t_loses++;\n\t\t//_money -= _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }", "@Override\n public boolean ignoreAbsorbedDamage() {\n return false;\n }", "@Override\n public void dropBlockAsItemWithChance(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state, float chance, int fortune)\n {\n }", "public void kill () throws GameExceptions.GameException {\n if (!this.hasCounter) {\n this.play ();\n this.power++;\n this.toughness++;\n this.hasCounter = true;\n } else {\n this.power--;\n this.toughness--;\n this.hasCounter = false;\n this.place(GameEnums.Zone.GRAVEYARD);\n }\n }", "public void remove() {\n\t\tstopFloating();\t\n\t\tPacketHandler.toggleRedTint(player, false);\n\t\tplayer.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 30, 1));\n\t\tplayer.stopSound(Sound.MUSIC_DISC_CHIRP);\n\t\tcleanTasks();\n\t\tactiveScenarios.remove(player.getUniqueId());\n\t}", "public final void reset() {\n\t\tscore = 0;\n\t\tlives = 10;\n\t\tshields = 3;\n\t}", "public void playerHasNoSword() {\n\t\tthis.state = cannotBeKilled;\n\t}", "public void discardPotion(Bucket b) \n\t{\n\t\t//run through the contents of the potion and then add them to the bucket\n\t\tfor (int i=0; i < this.ingredients.length(); i++ ) \n\t\t{\n\t\t\tb.dumpIngredient(ingredients.charAt(i));\n\t\t}\n\t\t//clear the ingredients in the bottle\n\t\tthis.ingredients=\"\";\n\t}", "public void setGreatMurderSequence() {\n\t\tfor (int i = 0; i < killers.size(); i++) {\n\t\t\tint sequence = getMurderSequence(killers.get(i).getName());\n\t\t\tkillers.get(i).setMurderSequence(sequence);\n\t\t}\n\t}", "public static void genocide() {\n //Assigns fitness levels\n evaluateFitnesses();\n\n //Sorts by fitness\n sortByFitlvl();\n\n //Simple genocide, kills off all until population size.\n for (int i = Population.size() - 1; i >= populationSize; i--) {\n Population.remove(i);\n }\n\n /*\n //Different kind of Genocide, selects organisms based on gaussian distribution\n\n while(Population.size() > populationSize){\n int randomOrganism = (int)(Population.size() - (Population.size()*Utilities.sharpGauss(2)));\n Population.remove(randomOrganism);\n }\n */\n }", "@Override\n\tpublic void remove()\n\t{\n\t\tsuper.remove();\n\t\tgetMyPlayer().getGoldMines().remove(this);\n\t}", "public void decreaseHealingNumber() {\n healingNumber--;\n }", "public void discardItem(LoopManiaWorld world) {\n super.discardItem(world, PRICE);\n }", "public boolean tryToKill(Sick s)\n\t{\n\t\tlong time=Math.abs(s.getContagiousTime()-Clock.now());\n\t\t//if the age of the person is 55 and up ,if not it will change properly\n\t\tdouble result=Math.max(0,death_up55-0.01*death_up55*Math.pow(time-15,2));\n\t\t\n\t\tif(s.getAge()<=18)\n\t\t{\n\t\t\tresult=Math.max(0,death_18-0.01*death_18*Math.pow(time-15,2));\n\t\t}\n\t\telse if(s.getAge()>18 && s.getAge()<=55)\n\t\t{\n\t\t\tresult=Math.max(0,death_18_55-0.01*death_18_55*Math.pow(time-15,2));\n\t\t}\n\t\treturn result>=Math.random();\n\t}", "public void eliminateSleep(boolean flag) { \n\t\tif (flag) {\n\t\t\tsleepTime = 5;\n\t\t} else {\n\t\t\tsleepTime = 250;\n\t\t}\n\t}", "public void onImpact() {\r\n die();\r\n }", "public void onImpact() {\n die();\r\n this.getArrow().remove();\r\n }", "public static void eggDrop() {\n\t\tint trials = eggDrop(2, 100);\n\t\tSystem.out.println(\"trials for \"+trials);\n\t}", "public void takeDamage()\n {\n if(getWorld()!= null)\n {\n if(this.isTouching(Enemies.class))\n {\n Life = Life - Enemies.damage;\n if(Life <=0)\n {\n getWorld().removeObject(this);\n Store.wealth += Game.credit;\n }\n }\n }\n }", "public void repair(){\n if(health < 9) {\n this.health++;\n }\n }", "private void notWorthy(final Player player) {\n\t\tplayer.getInterfaceManager().closeChatBoxInterface();\n\t\tplayer.lock(15);\n\t\tplayer.setNextFaceWorldTile(new WorldTile(3084, 3483, 0));\n\t\tWorldTasksManager.schedule(new WorldTask() {\n\t\t\tint phase = 0;\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal int[] randomNPC = { 6935, 3283, 4344, 6966 };\n\t\t\t\tswitch (phase) {\n\t\t\t\tcase 0:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(915));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(randomNPC[Utils.random(randomNPC.length - 1)]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tplayer.setNextForceTalk(new ForceTalk(\".... what in Helwyr is going on..!?\"));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(-1);\n\t\t\t\t\tplayer.setNextAnimation(new Animation(10070));\n\t\t\t\t\t//player.setNextForceMovement(new ForceMovement(new WorldTile(3084, 3485, 0), 0, 2));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t//player.setNextWorldTile(new WorldTile(3084, 3485, 0)); TODO find out why force movement doesn't work <.>\n\t\t\t\t\tNPC guard = World.findNPC(5941);\n\t\t\t\t\tsendNPCDialogue(4405, GOOFY_LAUGH, \"Looks like Dahmaroc had a sense of humour!\");\n\t\t \t // player.faceEntity(guard);\n\t\t \t // guard.faceEntity(player);\n\t\t\t\t\tplayer.unlock();\n\t\t\t\t\tstage = 99;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tphase++;\n\t\t\t}\n\t\t}, 0, 2);\n\t}", "public void loseLife() {\n\t\tfor (int i = 0; i < game.e.preds.size(); i++) {\n\t\t\tif (game.e.preds.get(i).hitPred(this) > 0) {\n\t\t\t\tlife -= 1;\n\t\t\t\tlifeTime = game.getTime();\n\t\t\t\tRandom rand = new Random();\n\n\t\t\t\tword = rand.nextInt(10) + 1;\n\t\t\t\tif (game.e.preds.get(i).hitPred(this) == 1) {\n\t\t\t\t\tyPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = true;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 2){\n\t\t\t\t\tyPos += 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = true;\n\t\t\t\t} \n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 5) {\n\t\t\t\t\tyPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = true;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 3) {\n\t\t\t\t\txPos += 60;\n\t\t\t\t\thitRight = true;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = false;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 4){\n\t\t\t\t\txPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = true;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t\telse if (game.e.preds.get(i).hitPred(this) == 6) {\n\t\t\t\t\txPos -= 60;\n\t\t\t\t\thitRight = false;\n\t\t\t\t\thitUp = false;\n\t\t\t\t\thitLeft = true;\n\t\t\t\t\thitDown = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n void negativeQuality() {\n Item[] items = new Item[]{new Item(\"noValue\", 2, 0)};\n GildedRose app = new GildedRose(items);\n app.updateQuality();\n\n assertEquals(0, app.items[0].quality, \"Quality shouldn't drop below 0\");\n }", "public void kill() {\r\n\t\t\tfor(Guerre war : aggresiveWar) {\r\n\t\t\t\twar.finalize();\r\n\t\t\t}\r\n\t\t\tfor(Guerre war : defensiveWar) {\r\n\t\t\t\twar.finalize();\r\n\t\t\t}\r\n\t\t\tfor(Case c : caseOwned) {\r\n\t\t\t\tc.liberate();\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(nom + \" n'a pas su s'adapter aux nombreux dangers environnants, l'Histoire oublie les faibles.\");\r\n\t\t\t\r\n\t\t\tfor(String str : saveStats()) System.out.println(str);\r\n\t\t\t//finalisation de la mort\r\n\t\t\tthis.die();\r\n\t\t\tSystem.out.println(\"Une civilisation c'est éteinte...\");\r\n\t\t\t//finalize(); //bloque la sauvegarde et case les relations avec les autres (du à la recherche de la civ par id dans l'arraylist\r\n\t\t}", "private void loseLife() {\r\n\t\thitGraphic(player);\r\n\t\tif (hits ==1) {\r\n\t\t\tlifeBar.scale(.67, 1);\r\n\t\t\tlifeBar.setColor(Color.ORANGE);\r\n\t\t} else if (hits == 2) {\r\n\t\t\tlifeBar.scale(.5, 1);\r\n\t\t\tlifeBar.setColor(Color.RED);\r\n\t\t} else if (hits == 3) {\r\n\t\t\tremove(lifeBar);\r\n\t\t\tlifeBar = null;\r\n\t\t}\r\n\t}", "protected void reset() {\n speed = 2.0;\n max_bomb = 1;\n flame = false;\n }", "public void takeDamage(int damage) {\n Random rand = new Random();\n int game = rand.nextInt(51) + 75;\n double game2 = (double) game;\n double percDamage = game2/100.0;\n double realSomething = (double) damage;\n double actualDamageNotReal = realSomething * percDamage;\n int actualDamage = (int) actualDamageNotReal;\n int actualDmg = actualDamage - this.armour;\n if (actualDmg <= 0){\n actualDmg = 0;\n }\n this.health -= actualDmg;\n slowDisplay(String.format(\"%s takes %s damage, now at %s\\n\",this.name,actualDmg,this.health));\n\n }", "@Override\r\n\tpublic void resetTurn() {\r\n\t\tmoveDistanceRemaining = 3;\r\n\t\thasAttackedOrDefended = false;\r\n\t\tif (isRested) {\r\n\t\t\thealth += Math.floor(Math.random()*(6)+5); // add between 5 and 10 health to character\r\n\t\t\thealth = Math.min(health, 100);\r\n\t\t}\r\n\t}", "private void reshuffleDiscardPile() {\n ICard topCard = discardPile.pop();\n\n drawPile.addAll(discardPile);\n Collections.shuffle(drawPile, rng);\n\n discardPile.clear();\n discardPile.add(topCard);\n }", "public void removeRobotsAndRubble() {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() != PlayerType.Agent) {\n\t\t\t\tremovePosition(p.getPosition());\n\t\t\t\tremovePlayer(p.getName());\n\t\t\t}\n\t\t\telse \n\t\t\t\tp.resetRobotsFollowing();\n\t\t}\n\t}", "static double removeHeuristic2(GameState c, boolean isMaxNode) {\n\t\treturn addHeuristic4(c, isMaxNode);\n\t}", "@Override\n\tpublic int vanish() {\n\t\treturn 1;\n\t}", "public void die() {\r\n final Entity e = entity;\r\n final EnchantArrow arrow = this;\r\n Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Storage.zenchantments, () -> {\r\n if (Storage.advancedProjectiles.containsKey(e)) {\r\n if (Storage.advancedProjectiles.get(e).size() == 1) {\r\n Storage.advancedProjectiles.remove(e);\r\n } else {\r\n Storage.advancedProjectiles.get(e).remove(arrow);\r\n }\r\n }\r\n }, 1);\r\n }", "public void dropExperience() {\n\t\tif (experience == 0) return;\n\t\tExperienceOrb orb = location.getWorld().spawn(location, ExperienceOrb.class);\n\t\torb.setExperience(experience);\n\t\texperience = 0;\n\t}", "public void updatePatience(){\n Patience = Patience - 1;\n }", "private void reapDeadRabbits() {\n for (int i = (rabbitList.size() - 1); i >= 0; i--) {\n RabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n if (rabbit.getEnergy() <= 0) {\n space.removeRabbitAt(rabbit.getX(), rabbit.getY());\n rabbitList.remove(i);\n }\n }\n }", "public void makesNotHere(){this.piece.unAffect();}" ]
[ "0.6798435", "0.67211264", "0.6438594", "0.6095973", "0.6030904", "0.60224056", "0.60057455", "0.5992866", "0.5964302", "0.5893588", "0.58879775", "0.5837674", "0.5801693", "0.5795823", "0.57840407", "0.5783704", "0.57794", "0.57708746", "0.574292", "0.57280207", "0.5703089", "0.56923753", "0.5672726", "0.56687367", "0.5655417", "0.5655061", "0.5654921", "0.564339", "0.56352293", "0.56193227", "0.5609978", "0.5603553", "0.5601817", "0.56002927", "0.55982894", "0.559234", "0.5587471", "0.55783504", "0.55482846", "0.5548136", "0.55403066", "0.55370617", "0.553034", "0.5528892", "0.55209494", "0.55188304", "0.5517026", "0.55170137", "0.55168486", "0.55140805", "0.55119187", "0.5505517", "0.54920566", "0.54886734", "0.54877377", "0.54722834", "0.5464849", "0.5464265", "0.54619014", "0.5454893", "0.5454605", "0.5453837", "0.5453276", "0.54523057", "0.5449951", "0.5449951", "0.54346323", "0.54298925", "0.5428411", "0.54268515", "0.54258317", "0.54257244", "0.5424202", "0.54160833", "0.54113936", "0.54037607", "0.5397891", "0.53966784", "0.53959274", "0.5391232", "0.5387965", "0.5383918", "0.5381292", "0.5378876", "0.537565", "0.53690445", "0.5367623", "0.53617936", "0.5358358", "0.53530556", "0.5337311", "0.53341794", "0.533344", "0.5328159", "0.5327795", "0.5326761", "0.532446", "0.53239816", "0.53211874", "0.53180367", "0.5314167" ]
0.0
-1
int a = myhost.getTotalCpu()myhost.getAvaliableCpu(); int b = myhost.getTotalCpu();
public double getUtilization(Myhost myhost) { return ((double)(myhost.getTotalCpu()-myhost.getAvaliableCpu()) / myhost.getTotalCpu()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native int getCpuUsage();", "public int getCpuLoad() { return cpuLoad; }", "public Long getCpu() {\n return this.Cpu;\n }", "private double getCpuStatistic(String args) throws Exception\n {\n /*\n ORDER OF COLLUMNS FROM PROC/STAT\n user: normal processes executing in user mode\n nice: niced processes executing in user mode\n system: processes executing in kernel mode\n idle: twiddling thumbs\n iowait: waiting for I/O to \"complete\n irq: servicing interrupts\n softirq: servicing softirqs\n */\n //TODO:IMPLEMENT CPU STATISTICS\n RandomAccessFile reader;\n reader = new RandomAccessFile(\"/proc/stat\", \"r\");\n String cpuInfo = reader.readLine();\n String[] parts = cpuInfo.split(\" \");\n if(args.toLowerCase() == userArg)\n {\n return(Integer.decode(parts[2]));\n }\n else if(args.toLowerCase() == systemArg)\n {\n return(Integer.decode(parts[4]));\n }\n else if(args.toLowerCase() == idleArg)\n {\n return(Integer.decode(parts[5]));\n }\n else\n {\n int total = 0;\n int idle = Integer.decode(parts[5]);;\n for (int i = 2; i < parts.length; i++)\n {\n total += Integer.decode(parts[i]);\n }\n double retVal = (double)idle / (double) total;\n return (retVal);\n }\n }", "public double getCpuUsage() {\n \t\tif (cpuUsage > 100) {\n \t\t\treturn 100;\n \t\t}\n \t\treturn cpuUsage;\n \t}", "public double evaluateLoad() {\n double result = 0;\n result += cpuLoad;\n if (freeSystemMem < 1024 * 100) result += 80;\n if (freeSystemMem < 1024 * 20) result += 100;\n if (diskUsage>50)result+=10;\n if (diskUsage>80)result+=40;\n if (diskUsage>90)result+=150;\n if (diskUsage>95)result+=200;\n System.out.println(diskUsage);\n return result;\n }", "String getCpusetcpus();", "private void getCpuInfo() {\n\t\ttry {\n\t\t\tRandomAccessFile reader = new RandomAccessFile(\"/proc/stat\", \"r\");\n\t\t\tString load = reader.readLine();\n\n\t\t\tString[] toks = load.split(\" \");\n\n\t\t\tlong idle1 = Long.parseLong(toks[5]);\n\t\t\tlong cpu1 = Long.parseLong(toks[2]) + Long.parseLong(toks[3])\n\t\t\t\t\t+ Long.parseLong(toks[4]) + Long.parseLong(toks[6])\n\t\t\t\t\t+ Long.parseLong(toks[7]) + Long.parseLong(toks[8]);\n\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (Exception e) {\n\n\t\t\t}\n\t\t\t//get process name list in this time\n\t\t\tgetTopCpu();\n\n\t\t\treader.seek(0);\n\t\t\tload = reader.readLine();\n\t\t\treader.close();\n\n\t\t\ttoks = load.split(\" \");\n\n\t\t\t// find right data is the key\n\t\t\t// System.out.println(toks[0]+\" 1 \"+toks[1]+\" 2 \"+toks[2]+\" \"+toks[3]+\" \"+toks[4]+\" \"+toks[5]+\" \"+toks[6]+\" \"+toks[7]+\" 8 \"+toks[8]);\n\t\t\tlong idle2 = Long.parseLong(toks[5]);\n\t\t\tlong cpu2 = Long.parseLong(toks[2]) + Long.parseLong(toks[3])\n\t\t\t\t\t+ Long.parseLong(toks[4]) + Long.parseLong(toks[6])\n\t\t\t\t\t+ Long.parseLong(toks[7]) + Long.parseLong(toks[8]);\n\n\t\t\t// System.out.println(idle2+\" \"+cpu2);\n\t\t\trate = (float) (cpu2 - cpu1)\n\t\t\t\t\t/ (float) ((cpu2 + idle2) - (cpu1 + idle1));\n\t\t\t// System.out.println(rate);\n\t\t\tint temprate = (int) ((rate + 0.05) * 100);\n\t\t\tif (temprate < 0 || temprate > 100) {\n\t\t\t\t// System.out.println(toks[0]+\" 1 \"+toks[1]+\" 2 \"+toks[2]+\" \"+toks[3]+\" \"+toks[4]+\" \"+toks[5]+\" \"+toks[6]+\" \"+toks[7]+\" 8 \"+toks[8]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcpuChart.addData(temprate);\n\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public float getCpuUsage() {\n try {\n mReader = new BufferedReader(new FileReader(mCpuUsageFilePath));\n mSa = mReader.readLine().split(\"[ ]+\", 9);\n\n mWork = Long.parseLong(mSa[1]) + Long.parseLong(mSa[2]) + Long.parseLong(mSa[3]);\n mTotal = mWork + Long.parseLong(mSa[4]) + Long.parseLong(mSa[5]) + Long.parseLong(mSa[6]) + Long.parseLong(mSa[7]);\n\n if (mTotalBefore != 0) {\n mTotalT = mTotal - mTotalBefore;\n mWorkT = mWork - mWorkBefore;\n mCpuTotal = restrictPercentage(mWorkT * 100 / (float) mTotalT);\n //Log.d(TAG, \"CPU Usage: \" + restrictPercentage(mWorkT * 100 / (float) mTotalT) + \"%\");\n }\n mTotalBefore = mTotal;\n mWorkBefore = mWork;\n\n mReader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return mCpuTotal;\n }", "private float getCpuUsage() {\n\t\tString processName = ManagementFactory.getRuntimeMXBean().getName();\n\t\tString processId = processName.split(\"@\")[0];\n\n\t\tlong utimeBefore, utimeAfter, totalBefore, totalAfter;\n\t\tfloat usage = 0;\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"/proc/\" + processId + \"/stat\"));\n\t\t\tString line = br.readLine();\n\t\t\tutimeBefore = Long.parseLong(line.split(\" \")[13]);\n\t\t\tbr.close();\n\n\t\t\ttotalBefore = 0;\n\t\t\tbr = new BufferedReader(new FileReader(\"/proc/stat\"));\n\t\t\tline = br.readLine();\n\t\t\twhile (line != null) {\n\t\t\t\tString[] items = line.split(\" \");\n\t\t\t\tif (items[0].equals(\"cpu\")) {\n\t\t\t\t\tfor (int i = 1; i < items.length; i++)\n\t\t\t\t\t\tif (!items[i].trim().equals(\"\") && items[i].matches(\"[0-9]*\"))\n\t\t\t\t\t\t\ttotalBefore += Long.parseLong(items[i]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\n\t\t\tThread.sleep(1000);\n\n\t\t\tbr = new BufferedReader(new FileReader(\"/proc/\" + processId + \"/stat\"));\n\t\t\tline = br.readLine();\n\t\t\tutimeAfter = Long.parseLong(line.split(\" \")[13]);\n\t\t\tbr.close();\n\n\t\t\ttotalAfter = 0;\n\t\t\tbr = new BufferedReader(new FileReader(\"/proc/stat\"));\n\t\t\tline = br.readLine();\n\t\t\twhile (line != null) {\n\t\t\t\tString[] items = line.split(\" \");\n\t\t\t\tif (items[0].equals(\"cpu\")) {\n\t\t\t\t\tfor (int i = 1; i < items.length; i++)\n\t\t\t\t\t\tif (!items[i].trim().equals(\"\") && items[i].matches(\"[0-9]*\"))\n\t\t\t\t\t\t\ttotalAfter += Long.parseLong(items[i]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\n\t\t\tusage = 100f * (utimeAfter - utimeBefore) / (totalAfter - totalBefore);\n\t\t} catch (Exception e) {}\n\t\treturn usage;\n\t}", "public static void getCpuUsage(){\r\n CPUmeasurement currentCpuUsage = new CPUmeasurement();\r\n cpuUsageList.add(currentCpuUsage);\r\n //CPUmeasurement.printCpuUsage(currentCpuUsage);\r\n }", "int getCPU_time();", "public double getCpuTimeSec() {\n\treturn getCpuTime() / Math.pow(10, 9);\t\t\n}", "Optional<Duration> totalCpuTime();", "public static int getSpeedCpuSO() {\n int retorno = 0;\n\n //Try necessário para os casos onde as DLLs não estão presentes.\n try {\n Sigar.load();\n retorno = new Sigar().getCpuInfoList()[0].getMhz();\n\n } catch (SigarException e) {\n CSPLog.error(\"problema ao coletar informacoes da maquina\");\n CSPException.register(e);\n }\n\n return retorno;\n }", "public static double doCPU_usage() {\n double totalProgramRunTime = endProgramTime - startProgramTime;\n return (processingTimeTotal / totalProgramRunTime) * 100;\n }", "public long getJVMCpuTime( ) {\n OperatingSystemMXBean bean =\n ManagementFactory.getOperatingSystemMXBean( );\n if ( ! (bean instanceof\n com.sun.management.OperatingSystemMXBean) )\n return 0L;\n return ((com.sun.management.OperatingSystemMXBean)bean)\n .getProcessCpuTime( );\n}", "private void collectCpuMemoryUsage(){\r\n\t\tHmDomain hmDomain = CacheMgmt.getInstance().getCacheDomainByName(\"home\");\r\n\t\tfloat cpuUsage = LinuxSystemInfoCollector.getInstance().getCpuInfo() * 100;\r\n\t\tfloat memoryUsage = 0;\r\n\t\ttry {\r\n\t\t\tlong count[] = LinuxSystemInfoCollector.getInstance().getMemInfo();\r\n\t\t\tif(count[0] != 0){\r\n\t\t\t\tmemoryUsage = ((float)(count[0] - count[1] - count[2] - count[3]) * 100 / count[0]);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tBeLogTools.error(HmLogConst.M_PERFORMANCE,\"calculate memory usage failure.\", e);\r\n\t\t}\r\n\t\tCpuMemoryUsage cmu = new CpuMemoryUsage();\r\n\t\tcmu.setCpuUsage(cpuUsage);\r\n\t\tcmu.setMemUsage(memoryUsage);\r\n\t\tcmu.setOwner(hmDomain);\r\n\t\tcmu.setTimeStamp((new Date()).getTime());\r\n\t\ttry {\r\n\t\t\tQueryUtil.createBo(cmu);\r\n\t\t} catch (Exception e) {\r\n\t\t\tBeLogTools.error(HmLogConst.M_PERFORMANCE,\"create CpuMemoryUsage failure.\", e);\r\n\t\t}\r\n\t}", "public float getCPUCost() {\n return this.cpuCost;\n }", "public static String getCpuInfo() {\n String result = \"\";\n ProcessBuilder cmd;\n try {\n String[] args = {COMMAND_LINE, PATH_CPU};\n cmd = new ProcessBuilder(args);\n Process process = cmd.start();\n InputStream in = process.getInputStream();\n byte[] re = new byte[24];\n while (in.read(re) != -1) {\n result = result + new String(re);\n }\n in.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n result = \"N/A\";\n }\n return result.trim();\n }", "BigInteger getLeftoverCPU() {\n return pm.getCPU().subtract(used_cpu);\n }", "public int getCurrentCpuFailoverResourcesPercent() {\r\n return currentCpuFailoverResourcesPercent;\r\n }", "public double getOccupiedCpus () { return getCpuBaseResource().getOccupiedCapacity(); }", "@Override\r\n\t\tpublic int getStandbyCap() {\n\t\t\treturn 2 * Runtime.getRuntime().availableProcessors();\r\n\t\t}", "private long getCpuTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : 0L;\n }", "@Test\n public void testCpuMetric() {\n MetricValue mv = new MetricValue.Builder().load(30).add();\n\n CPU_METRICS.forEach(cmt -> testUpdateMetricWithoutId(cmt, mv));\n CPU_METRICS.forEach(cmt -> testLoadMetric(nodeId, cmt, mv));\n }", "public double CPUServiceTime()\r\n\t{\r\n\t\treturn Math.random()* (30.0 - 10.0) + 10.0;\r\n\t}", "public CPU getCPU() {\r\n\t\treturn cpu;\r\n\t}", "private int getStartStopThreadsInternal() {\n\t\tint result = getStartStopThreads();\n\n\t\t// Positive values are unchanged\n\t\tif (result > 0) {\n\t\t\treturn result;\n\t\t}\n\n\t\t// Zero == Runtime.getRuntime().availableProcessors()\n\t\t// -ve == Runtime.getRuntime().availableProcessors() + value\n\t\t// These two are the same\n\t\tresult = Runtime.getRuntime().availableProcessors() + result;\n\t\tif (result < 1) {\n\t\t\tresult = 1;\n\t\t}\n\t\treturn result;\n\t}", "public Cpu getCpu(){\n return maquina;\n }", "@ApiModelProperty(required = true, value = \"The number (across all cores) of micro-seconds per second.\")\n public BigDecimal getCpu() {\n return cpu;\n }", "public double getAverageUsage() {\n \tif(lastData.size() > 0) {\n\t \tdouble total = 0.0;\n\t \t\n\t \tfor(double data : lastData) {\n\t \t\ttotal += data;\n\t \t}\n\t \t\n \t\tSystem.out.println(\"Current average load (last minute): \" + total / lastData.size());\n\t \t\n\t \treturn total / lastData.size();\n \t} else {\n \t\t// Calculate CPU usage\n \t\tdouble per = 0;\n\t\t\ttry {\n\t\t\t\tper = sigar.getCpuPerc().getCombined();\n\t\t\t} catch (SigarException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n \t\t\n \t\treturn per;\n \t}\n }", "@Override\n\tpublic String getCPU() {\n\t\treturn null;\n\t}", "public long getCpuTime() {\n\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\treturn bean.isCurrentThreadCpuTimeSupported() ?\n\t\t\tbean.getCurrentThreadCpuTime() : 0L;\n\t\n}", "public int getNumberOfCores();", "private void calculateAndGraph(ArrayList<String> first, ArrayList<String> second) {\n\t\tfor(int i = 0; i < numCores; i++) {\n\t\t\t\tString[] firstTokens = first.get(i).split(\" \");\n\t\t\t\tString[] secondTokens = second.get(i).split(\" \");\n\t\t\t\t\n\t\t\t\t// calculate user2 - user1\n\t\t\t\tdouble user = Double.parseDouble(secondTokens[0]);\n\t\t\t\tdouble userPrevious = Double.parseDouble(firstTokens[0]);\n\t\t\t\tdouble userDiff = Math.abs(user-userPrevious);\n\t\t\t\t\n\t\t\t\t// calculate system2 - system1\n\t\t\t\tdouble system = Double.parseDouble(secondTokens[1]);\n\t\t\t\tdouble systemPrevious = Double.parseDouble(firstTokens[1]);\n\t\t\t\tdouble systemDiff = Math.abs(system-systemPrevious);\n\t\t\t\t\n\t\t\t\t// calculate nice2 - nice1\n\t\t\t\tdouble nice = Double.parseDouble(secondTokens[2]);\n\t\t\t\tdouble nicePrevious = Double.parseDouble(firstTokens[2]);\n\t\t\t\tdouble niceDiff = Math.abs(nice-nicePrevious);\n\t\t\t\t\n\t\t\t\t// calculate idle2 - idle1\n\t\t\t\tdouble idle = Double.parseDouble(secondTokens[3]);\n\t\t\t\tdouble idlePrevious = Double.parseDouble(firstTokens[3]);\n\t\t\t\tdouble idleDiff = Math.abs(idle-idlePrevious);\n\t\t\t\t\t\t\t\t\n//\t\t\t\t// calculate CPU usage using method from http://www.pplusdomain.net/cgi-bin/blosxom.cgi/2009/04/02\n//\t\t\t\tdouble total = userDiff + systemDiff + niceDiff + idleDiff;\n//\t\t\t\tdouble idlePercent = idleDiff / total * 100;\n//\t\t\t\tint cpuUtil2 = (int) (100.0 - idlePercent);\n\t\t\t\t\n\t\t\t\t// calculate CPU usage using method from https://piazza.com/class/ic02ole9e534k8?cid=137\n\t\t\t\tdouble numerator = systemDiff + userDiff;\n\t\t\t\tdouble denominator = numerator + idleDiff;\n\t\t\t\tint cpuUtil = (int) ((numerator / denominator) * 100.0);\n\t\t\t\t\n\t\t\t\t// Write cpu usage for this core to the graph\n\t\t\t\tuserInterface.getCPUGraph().addDataPoint(i, cpuUtil);\n\t\t\t\tuserInterface.getCPUGraph().repaint();\n\t\t}\n\t}", "public long cpuMicros() {\n return this.cpuNanos / 1000;\n }", "@Test\n public void test4(){\n System.out.println(Runtime.getRuntime().availableProcessors());\n }", "@Nullable\n Integer getVcpuCount();", "public int getAvgExecs()\n/* */ {\n/* 55 */ return this.avgExecs;\n/* */ }", "public Integer getCpus() {\n return cpus;\n }", "CpuUtilizationType createCpuUtilizationType();", "private double getSystemCallStatistics()\n {\n return(-1);\n }", "public double getTotalNumCpus () { return n.getResources(RESOURCETYPE_CPU).stream().mapToDouble(r->r.getCapacity()).sum (); }", "public String processamento(){\n \n List<com.profesorfalken.jsensors.model.components.Cpu> cpus = JSensors.get.components().cpus;\n if(cpus.isEmpty()) return \"40.0\";\n \n for (final com.profesorfalken.jsensors.model.components.Cpu cpu : cpus) {\n List<Load> loads = cpu.sensors.loads;\n for (final Load load : loads) {\n if(load.name.equals(\"Load CPU Total\"))\n return String.valueOf(load.value);\n }\n }\n return \"40.0\";\n }", "@Override\n\tpublic String getUsedCpuTime() {\n\t\treturn model.getUsedCpuTime();\n\t}", "public void readCpuStat() {\n\t\ttry {\n\t\t\t// monitor total and idle cpu stat of certain process\n\t\t\tRandomAccessFile cpuInfo = new RandomAccessFile(\"/proc/stat\", \"r\");\n\t\t\tString[] toks = cpuInfo.readLine().split(\"\\\\s+\");\n\t\t\tidleCpu = Long.parseLong(toks[4]);\n\t\t\ttotalCpu = Long.parseLong(toks[1]) + Long.parseLong(toks[2])\n\t\t\t\t\t+ Long.parseLong(toks[3]) + Long.parseLong(toks[4])\n\t\t\t\t\t+ Long.parseLong(toks[6]) + Long.parseLong(toks[5])\n\t\t\t\t\t+ Long.parseLong(toks[7]);\n\t\t\tcpuInfo.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t} catch (IOException e) {\n\t\t}\n\t}", "private void updateCpuStats() {\n\t\tmNumStatsUpdated = 0;\n\t\tList<String> stats = ShellHelper.getProc(CPU_STAT_PROC);\n\t\tif (stats == null || stats.isEmpty()) return;\n\t\t\n\t\tString[] parts = null;\n\t\tString line = null;\n\t\tfor (int i = 0; i < stats.size(); ++i) {\n\t\t\tline = stats.get(i);\n\t\t\tif (line.startsWith(\"cpu\")) { //TODO if 0% usage the cpu is omitted\n\t\t\t\tparts = line.split(\"\\\\s+\");\t\t\t\t\n\t\t\t\tif (parts[0].endsWith(String.valueOf(i - 1))) {\n\t\t\t\t\tif (mLogicalCpus.size() >= i &&\n\t\t\t\t\t\t\tmLogicalCpus.get(i - 1).getCpuStat().update(parts)) {\t\t\t\t\t\n\t\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mCpuStat.update(parts)) {\n\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private double pingGetLatency(){\n\t\t int NUMBER_OF_PACKTETS=10;\n\t String pingCommand = \"/system/bin/ping -c \" + NUMBER_OF_PACKTETS + \" \" + ip;\n\t String inputLine = \"\";\n\t double avgRtt = 0;\n\n\t try {\n\t // execute the command on the environment interface\n\t Process process = Runtime.getRuntime().exec(pingCommand);\n\t // gets the input stream to get the output of the executed command\n\t BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));\n\n\t inputLine = bufferedReader.readLine();\n\t while ((inputLine != null)) {\n\t if (inputLine.length() > 0 && inputLine.contains(\"avg\")) { // when we get to the last line of executed ping command\n\t break;\n\t }\n//\t \t if (inputLine.length()>0) inputLine = bufferedReader.readLine();\n\t inputLine = bufferedReader.readLine();\n\t }\n\t }\n\t catch (IOException e){\n\t \t pingParameters=\"Error in ping\";\n\t e.printStackTrace();\n\t }\n\n\t // Extracting the average round trip time from the inputLine string\n\t String afterEqual = inputLine.substring(inputLine.indexOf(\"=\"), inputLine.length()).trim();\n\t String afterFirstSlash = afterEqual.substring(afterEqual.indexOf('/') + 1, afterEqual.length()).trim();\n\t String strAvgRtt = afterFirstSlash.substring(0, afterFirstSlash.indexOf('/'));\n\t avgRtt = Double.valueOf(strAvgRtt);\n\t pingParameters=inputLine;\n\t return avgRtt;\n\t }", "@DISPID(23)\r\n\t// = 0x17. The runtime will prefer the VTID if present\r\n\t@VTID(25)\r\n\tjava.lang.String averageCPUTime();", "int getProcessorCount();", "public float getExecFreq(){return 0.0f;}", "public Integer getCpus() {\n return cpus;\n }", "int getTotalFree();", "@Override\n\tpublic void setCpu() {\n\t\tcom.setCpu(\"i7\");\n\t}", "@Override\n public double evaluate(DataCenterInterface dataCenter,\n double binCpuRemain,\n double binMemRemain,\n double binActualCpuUsed,\n double binActualMemUsed,\n double itemCpuUsed,\n double itemMemUsed,\n double itemActualCpuUsed,\n double itemActualMemUsed) {\n return 0;\n }", "@DISPID(70)\r\n\t// = 0x46. The runtime will prefer the VTID if present\r\n\t@VTID(68)\r\n\tint averageCPUTime_Seconds();", "public String getCpuTemperature_Xperia(){\n\n double maxTemp = 0.0;\n RandomAccessFile reader;\n //////// core 1\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone7/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n //////// core 2\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone8/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n //////// core 3\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone9/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n //////// core 4\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone10/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n\n return String.valueOf(maxTemp / 4);\n }", "public static int performanceCountGet() { return 0; }", "public static int availableProcessors() {\n/* 98 */ return holder.availableProcessors();\n/* */ }", "public boolean hasCpuLoadPerCore() {\n return result.hasCpuLoadPerCore();\n }", "public long getStartCpuTime() {\r\n return startCpuTime;\r\n }", "public static long getCpuTime(){\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ?\n bean.getCurrentThreadCpuTime() : 0L;\n }", "private double getOEEPerformance(Batch batch) {\n return 1;\n }", "@DISPID(21)\r\n\t// = 0x15. The runtime will prefer the VTID if present\r\n\t@VTID(23)\r\n\tjava.lang.String actualCPUTime();", "public void increaseCpuUsage(double val) {\n \t\tcpuUsage += val;\n \n \t}", "public long getTotalRam();", "public long getTotalThreadCpuTime(long[] tids) {\t\t\t\t//get multiple threads cpu time usage to prevent overhead for multiple \n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\t\t//method invocations of getThreadCpuTime(long tid)\n\t\tif(!bean.isThreadCpuTimeSupported()) \t\t\t\t\t\t\t//If JVM supports for CPU time measurement for any thread, it returns true\n\t\t\treturn -1L;\n\t\tfor(long i : tids) {\n\t\t\tlong currentTime = bean.getThreadCpuTime(i);\n\t\t\tif(currentTime != -1) {\t\t\t\t\t\t\t\t\t\t//Check if the thread CPU measurement is enableed.\n\t\t\t\ttotalTime += currentTime;\n\t\t\t}\n\t\t}\n\t\treturn totalTime;\n\t}", "public static double getFactorExec() {\n return (moreFactorExec_ - lessFactorExec_) / 2;\n }", "public void cpu() {\n\n\t\tint bytecode;\n\t\tint v1, v2;\n\t\tint address;\n\t\twhile (true) {\n\t\t\tbytecode = code[ip++]; // fetch\n\t\t\t\n\t\t\t//Decode\n\t\t\tswitch (bytecode) {\n\t\t\t\n\t\t\tcase VMParser.PUSH:\n\t\t\t\t//System.out.println(\"PUSH\");\n\t\t\t\tpush(code[ip++]);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.POP:\n\t\t\t\t//System.out.println(\"POP\");\n\t\t\t\tpop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.ADD:\n\t\t\t\t//System.out.println(\"ADD\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 + v2);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SUB:\n\t\t\t\t//System.out.println(\"SUB\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 - v2);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.MULT:\n\t\t\t\t//System.out.println(\"MULT\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 * v2);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.DIV:\n\t\t\t\t//System.out.println(\"DIV\");\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tpush(v1 / v2);\n\t\t\t\tbreak;\n\n\t\t\tcase VMParser.SW:\n\t\t\t\t//System.out.println(\"SW\");\n\t\t\t\taddress = pop();\n\t\t\t\tv2 = pop();\n\t\t\t\tmemory[address] = v2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LW:\n\t\t\t\t//System.out.println(\"LW\");\n\t\t\t\taddress = pop();\n\t\t\t\tpush(memory[address]);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.BRANCHEQUAL:\n\t\t\t\t//System.out.println(\"BRANCHEQUAL\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tif (v1 == v2)\n\t\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.JS:\n\t\t\t\t//System.out.println(\"JS\");\n\t\t\t\tra = ip;\n\t\t\t\taddress = pop();\n\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LRA:\n\t\t\t\t//System.out.println(\"LRA\");\n\t\t\t\tpush(ra);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SRA:\n\t\t\t\t//System.out.println(\"SRA\");\n\t\t\t\tra = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LRV:\n\t\t\t\t//System.out.println(\"LRV\");\n\t\t\t\tpush(rv);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SRV:\n\t\t\t\t//System.out.println(\"SRV\");\n\t\t\t\trv = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LHP:\n\t\t\t\t//System.out.println(\"LHP\");\n\t\t\t\tpush(hp);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SHP:\n\t\t\t\t//System.out.println(\"SHP\");\n\t\t\t\thp = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.LFP:\n\t\t\t\t//System.out.println(\"LFP\");\n\t\t\t\tpush(fp);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.SFP:\n\t\t\t\t//System.out.println(\"SFP\");\n\t\t\t\tfp = pop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.CFP:\n\t\t\t\t//System.out.println(\"CFP\");\n\t\t\t\tfp = sp;\n\t\t\t\tbreak;\n\n\n\t\t\tcase VMParser.BRANCH:\n\t\t\t\t//System.out.println(\"BRANCH\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tip = address;\n\t\t\t\tbreak;\n\n\t\t\tcase VMParser.BRANCHLESS:\n\t\t\t\t//System.out.println(\"BRANCHLESS\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tif (v1 <= v2)\n\t\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.BRANCHGREAT:\n\t\t\t\t//System.out.println(\"BRANCHGREAT\");\n\t\t\t\taddress = code[ip++];\n\t\t\t\tv2 = pop();\n\t\t\t\tv1 = pop();\n\t\t\t\tif (v1 >= v2)\n\t\t\t\t\tip = address;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase VMParser.PRINT:\n\t\t\t\t//System.out.println(\"PRINT\");\n\t\t\t\tSystem.out.println(memory[sp]);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\tcase VMParser.HALT:\n\t\t\t\t//System.out.println(\"HALT\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public static long getCpuTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n bean.getCurrentThreadCpuTime(): 0L;\n }", "public CPUCore getCpuCore() {\n return cpuCore;\n }", "public int getProcessorSpeed()\n\t{\n\t\treturn speed;\n\t}", "@Test\n public void runNormally() throws ReflectionException, InstanceNotFoundException {\n List<Attribute> dummyLoadList = new ArrayList<>();\n //The hundred because the system gives it back as percent with 0-1\n dummyLoadList.add(new Attribute(\"ProcessCpuLoad\", 123.4 / 2 / 100));\n MBeanServer mockBeanServer = Mockito.mock(MBeanServer.class);\n Runtime mockRuntime = Mockito.mock(Runtime.class);\n UpdateCpuLoadTask taskToTest = $UpdateCpuLoadTask().withMBeanServer(mockBeanServer).withRuntime(mockRuntime).build();\n when(mockBeanServer.getAttributes(any(ObjectName.class), any(String[].class)))\n .thenReturn(new AttributeList(dummyLoadList));\n when(mockRuntime.availableProcessors()).thenReturn(2);\n\n taskToTest.run();\n\n assertThat(taskToTest.getLastLoad()).isEqualTo(123.4);\n }", "public long getCurrentThreadCpuTime() {\t\t\t\t\t\t//Total CPU time usage\n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\t\treturn bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : -1L;\n\t}", "public static long getCpuTime( ) {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n\n bean.getCurrentThreadCpuTime( ) : 0L;\n\n }", "int getHPPerSecond();", "public static String getCurCpuFreq() {\n String result = \"N/A\";\n try {\n FileReader fr = new FileReader(PATH_CUR);\n BufferedReader br = new BufferedReader(fr);\n String text = br.readLine();\n result = text.trim();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return result;\n }", "public double evaluate(\n DataCenterInterface dataCenter,\n double binCpuConfiguration,\n double binMemOverhead,\n double binCpuOverheadRate,\n double binCpuRemain,\n double binMemRemain,\n double itemCpuRequire,\n double itemMemRequire) {\n double[] normalizedBin;\n double[] normalizedItem;\n double[] normalizedOverhead;\n double value = 0;\n\n\n // We use PM to normalize both, therefore, the type is null.\n normalizedBin = norm.normalize(binCpuRemain, binMemRemain);\n normalizedItem = norm.normalize(itemCpuRequire, itemMemRequire);\n normalizedOverhead = norm.normalize(binCpuConfiguration * binCpuOverheadRate, binMemOverhead);\n\n double leftVmCpu = normalizedBin[0] - normalizedItem[0];\n double leftVmMem = normalizedBin[1] - normalizedItem[1];\n double normalizedItemCpu = normalizedItem[0];\n double normalizedItemMem = normalizedItem[1];\n double normalizedVmCpuOverhead = normalizedOverhead[0];\n double normalizedVmMemOverhead = normalizedOverhead[1];\n\n\n// double coCpuDivPmMem = normalizedItemCpu / leftVmMem;\n\n Parser parser = new Parser();\n\n try {\n ExpressionNode expr = parser.parse(expression);\n expr.accept(new SetVariable(\"normalizedItemMem\", normalizedItemMem));\n expr.accept(new SetVariable(\"normalizedItemCpu\", normalizedItemCpu));\n expr.accept(new SetVariable(\"leftVmMem\", leftVmMem));\n expr.accept(new SetVariable(\"leftVmCpu\", leftVmCpu));\n expr.accept(new SetVariable(\"normalizedVmCpuOverhead\", normalizedVmCpuOverhead));\n expr.accept(new SetVariable(\"normalizedVmMemOverhead\", normalizedVmMemOverhead));\n// expr.accept(new SetVariable(\"CoCPUdivPmMem\", coCpuDivPmMem));\n value = expr.getValue();\n\n } catch (ParserException e) {\n System.out.println(e.getMessage());\n } catch (EvaluationException e) {\n System.out.println(e.getMessage());\n }\n\n return value;\n }", "public int getThreadUsed();", "public long getSystemTotal() {\n\t\t\treturn mSystem + mIntr + mSoftIrq;\n\t\t}", "@DISPID(55)\r\n\t// = 0x37. The runtime will prefer the VTID if present\r\n\t@VTID(53)\r\n\tint actualCPUTime_Seconds();", "long memoryUsed();", "public static float getCpuTemperature() throws IOException, InterruptedException, NumberFormatException {\n \treturn pi4jSystemInfoConnector.getCpuTemperature();\r\n }", "public int getCurrentMemoryFailoverResourcesPercent() {\r\n return currentMemoryFailoverResourcesPercent;\r\n }", "int getMPPerSecond();", "public long getSystemTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n (bean.getCurrentThreadCpuTime( ) - bean.getCurrentThreadUserTime( )) : 0L;\n}", "public static int getNumberOfCpuThreads() {\n\t\treturn Runtime.getRuntime().availableProcessors();\n\t}", "public static long getCpuTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadCpuTime( ) : 0L;\n }", "private void computePerformance(int ticks) {\n System.out.println(\"Avergae number of packets in queue: \" + (_cumulativePacketsInQueue / (double)ticks));\n \n // Average time spent in queue per packet\n System.out.println(\"Average sojurn time: \" + (_totalSojurnTime / (double)_numPacketsProcessed));\n\n // Percentage idle time\n System.out.println(\"Percentage idle time: \" + ((_totalIdleTime / (double)ticks) * 100) + \"%\");\n\n // Packet loss probability\n System.out.println(\"Packet loss proability: \" + ((_numPacketsDropped / (double)(_numPacketsDropped + _numPacketsProcessed)) * 100) + \"%\");\n }", "private long getPTSUs() {\n long result = System.nanoTime() / 1000L;\n if (result < prevOutputPTSUs)\n result = (prevOutputPTSUs - result) + result;\n return result;\n }", "public double measurePowerUsage(String packageNameString, HashMap<String, Long> appCpuTimeBefor, long r_time) {\n //targetAppTime: CPU Running time of app, totalTime: Total CPU Running time\n HashMap<String, Long> appCpuTimeAfter = new HashMap<String, Long>();\n appCpuTimeAfter = getAppCpuTime(packageNameString);\n\n double targetAppTimeAfter = appCpuTimeAfter.get(\"targetAppTime\");\n double targetAppTimeBefor = appCpuTimeBefor.get(\"targetAppTime\");\n Log.i(TAG, \"appCpuTimeAfter \" + targetAppTimeAfter);\n Log.i(TAG, \"appCpuTimeBefor \" + targetAppTimeBefor);\n\n double totalTimeAfter = appCpuTimeAfter.get(\"totalTime\");\n double totalTimeBefor = appCpuTimeBefor.get(\"totalTime\");\n Log.i(TAG, \"totalTimeAfter \" + totalTimeAfter);\n Log.i(TAG, \"totalTimeBefor \" + totalTimeBefor);\n\n double ratio = (targetAppTimeAfter - targetAppTimeBefor + r_time ) / (totalTimeAfter - totalTimeBefor + r_time);\n Log.i(TAG, \"ratio \" + ratio);\n double[] currentSteps = getCurrentSteps();\n\n Log.i(TAG, \"currentSteps.length \" + currentSteps.length);\n\n\n return ratio; //second to hour\n }", "int getTotalLeased();", "java.lang.String getMinCpuPlatform();", "public void compute() {}", "public static void compute() {\n\n }", "public void utilization() {\r\n\t\tfloat fAktuell = this.aktuelleLast;\r\n\t\tfloat fMax = this.raumsonde.getMaxNutzlast();\r\n\t\tfloat prozent = fAktuell / fMax * 100;\r\n\r\n\t\tSystem.out.println(\" \" + fAktuell + \"/\" + fMax + \" (\" + prozent + \"%)\");\r\n\t}", "public Double getTotalAvailable(){\n return totalAvailable;\n }", "public double measurePowerUsage(String packageNameString, HashMap<String, Long> appCpuTimeBefor, long r_time) {\n HashMap<String, Long> appCpuTimeAfter = new HashMap<String, Long>();\n appCpuTimeAfter = getAppCpuTime(packageNameString);\n\n double totalPower = 0;\n double targetAppTimeAfter = appCpuTimeAfter.get(\"targetAppTime\");\n double targetAppTimeBefor = appCpuTimeBefor.get(\"targetAppTime\");\n Log.i(\"TAG\", \"appCpuTimeAfter \" + targetAppTimeAfter);\n Log.i(\"TAG\", \"appCpuTimeBefor \" + targetAppTimeBefor);\n\n double totalTimeAfter = appCpuTimeAfter.get(\"totalTime\");\n double totalTimeBefor = appCpuTimeBefor.get(\"totalTime\");\n Log.i(\"TAG\", \"totalTimeAfter \" + totalTimeAfter);\n Log.i(\"TAG\", \"totalTimeBefor \" + totalTimeBefor);\n\n Log.i(\"AAAAAAAAA\", \"targetAppTimeAfter-targetAppTimeBefor\"+String.valueOf(targetAppTimeAfter-targetAppTimeBefor));\n Log.i(\"AAAAAAAAA\", \"totalTimeAfter-totalTimeBefor\"+String.valueOf(totalTimeAfter-totalTimeBefor));\n //double ratio = (targetAppTimeAfter - targetAppTimeBefor + r_time) / (totalTimeAfter - totalTimeBefor + r_time);\n //double ratio = (targetAppTimeAfter - targetAppTimeBefor ) / (totalTimeAfter - totalTimeBefor );\n //double ratio = (targetAppTimeAfter - targetAppTimeBefor + r_time/10) / (totalTimeAfter - totalTimeBefor + r_time/10);\n double ratio= (r_time/10)/(totalTimeAfter - totalTimeBefor);\n\n Log.i(\"TAG\", \"ratio\" + ratio);\n\n return ratio; //second to hour\n }", "private double getThreadStatistics(String args) throws Exception\n {\n //TODO: IMPLEMENT THIS IF WE HAVE TIME, CURRENTLY CANT GET ALL PIDS\n /*\n File f = new File(\"/proc/\" + args + \"/stat\");\n if(f.exists() && !f.isDirectory()) { //if valid pid passed as arg\n RandomAccessFile reader = new RandomAccessFile(\"/proc/\" + args + \"/stat\", \"r\");\n String newLine = reader.readLine();\n String[] parts = newLine.split(\" \");\n return(Double.parseDouble(parts[20]));\n }\n else if(args.toLowerCase() == defaultArg)\n {\n int[] allPids = getAllPids(contextToUse);\n double retVal = 0;\n for(int i = 0; i < allPids.length; i++)\n {\n retVal += getThreadStatistics(\"\" + allPids[i], contextToUse) + 1;\n }\n return(retVal);\n }\n else\n {\n return(-1);\n }\n */\n return(-1);\n }" ]
[ "0.74369013", "0.7303724", "0.7050024", "0.69332635", "0.6928802", "0.6865772", "0.67550325", "0.6746786", "0.66893965", "0.6627166", "0.65796703", "0.6548292", "0.6504724", "0.6504067", "0.6478482", "0.64719355", "0.6471557", "0.64119655", "0.6398293", "0.63008034", "0.62766683", "0.6264826", "0.6219891", "0.6188804", "0.61852765", "0.6154191", "0.61456823", "0.6115932", "0.6110374", "0.6081177", "0.6043048", "0.60245", "0.6023861", "0.6011921", "0.6002281", "0.59838927", "0.5981766", "0.5964708", "0.59618545", "0.5947691", "0.59028345", "0.5899172", "0.58916485", "0.58855844", "0.58837277", "0.5874068", "0.58624643", "0.5856119", "0.5851996", "0.585173", "0.5835167", "0.5831777", "0.58284754", "0.5820968", "0.5809098", "0.5808729", "0.5807584", "0.58054847", "0.5804078", "0.57929033", "0.57888895", "0.5786817", "0.5783309", "0.57803464", "0.57699984", "0.57699", "0.5767943", "0.5725985", "0.5716728", "0.57155514", "0.57153356", "0.5695665", "0.56526345", "0.5651066", "0.5641452", "0.5623278", "0.5614241", "0.56131387", "0.5593423", "0.55913305", "0.558827", "0.5581797", "0.5577711", "0.556679", "0.5564112", "0.5553512", "0.5545744", "0.55397314", "0.5537387", "0.5529189", "0.552752", "0.5527288", "0.5521111", "0.55170274", "0.55134743", "0.55081034", "0.55071497", "0.5506043", "0.5502855", "0.54770154" ]
0.73188204
1
double cpuUtilization = (double) (myhost.getTotalCpu()myhost.getAvaliableCpu()+vm.getMips())/myhost.getTotalCpu(); int cpuUtilization = myhost.getTotalCpu()myhost.getAvaliableCpu();
public double calculateTemper(Double utilization) { float a = (float) 32.4031331148812; float b = (float) -0.105871112063592; float c = (float) 0.019012207217; float d = (float) -0.000103336673855697; double targetTemper = a + b * utilization + Math.pow(c,2) * utilization + Math.pow(d,3) * utilization; return targetTemper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getUtilization(Myhost myhost)\n {\n return ((double)(myhost.getTotalCpu()-myhost.getAvaliableCpu()) / myhost.getTotalCpu());\n }", "public double getCpuUsage() {\n \t\tif (cpuUsage > 100) {\n \t\t\treturn 100;\n \t\t}\n \t\treturn cpuUsage;\n \t}", "public native int getCpuUsage();", "public int getCpuLoad() { return cpuLoad; }", "public float getCpuUsage() {\n try {\n mReader = new BufferedReader(new FileReader(mCpuUsageFilePath));\n mSa = mReader.readLine().split(\"[ ]+\", 9);\n\n mWork = Long.parseLong(mSa[1]) + Long.parseLong(mSa[2]) + Long.parseLong(mSa[3]);\n mTotal = mWork + Long.parseLong(mSa[4]) + Long.parseLong(mSa[5]) + Long.parseLong(mSa[6]) + Long.parseLong(mSa[7]);\n\n if (mTotalBefore != 0) {\n mTotalT = mTotal - mTotalBefore;\n mWorkT = mWork - mWorkBefore;\n mCpuTotal = restrictPercentage(mWorkT * 100 / (float) mTotalT);\n //Log.d(TAG, \"CPU Usage: \" + restrictPercentage(mWorkT * 100 / (float) mTotalT) + \"%\");\n }\n mTotalBefore = mTotal;\n mWorkBefore = mWork;\n\n mReader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return mCpuTotal;\n }", "public double evaluateLoad() {\n double result = 0;\n result += cpuLoad;\n if (freeSystemMem < 1024 * 100) result += 80;\n if (freeSystemMem < 1024 * 20) result += 100;\n if (diskUsage>50)result+=10;\n if (diskUsage>80)result+=40;\n if (diskUsage>90)result+=150;\n if (diskUsage>95)result+=200;\n System.out.println(diskUsage);\n return result;\n }", "private float getCpuUsage() {\n\t\tString processName = ManagementFactory.getRuntimeMXBean().getName();\n\t\tString processId = processName.split(\"@\")[0];\n\n\t\tlong utimeBefore, utimeAfter, totalBefore, totalAfter;\n\t\tfloat usage = 0;\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(\"/proc/\" + processId + \"/stat\"));\n\t\t\tString line = br.readLine();\n\t\t\tutimeBefore = Long.parseLong(line.split(\" \")[13]);\n\t\t\tbr.close();\n\n\t\t\ttotalBefore = 0;\n\t\t\tbr = new BufferedReader(new FileReader(\"/proc/stat\"));\n\t\t\tline = br.readLine();\n\t\t\twhile (line != null) {\n\t\t\t\tString[] items = line.split(\" \");\n\t\t\t\tif (items[0].equals(\"cpu\")) {\n\t\t\t\t\tfor (int i = 1; i < items.length; i++)\n\t\t\t\t\t\tif (!items[i].trim().equals(\"\") && items[i].matches(\"[0-9]*\"))\n\t\t\t\t\t\t\ttotalBefore += Long.parseLong(items[i]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\n\t\t\tThread.sleep(1000);\n\n\t\t\tbr = new BufferedReader(new FileReader(\"/proc/\" + processId + \"/stat\"));\n\t\t\tline = br.readLine();\n\t\t\tutimeAfter = Long.parseLong(line.split(\" \")[13]);\n\t\t\tbr.close();\n\n\t\t\ttotalAfter = 0;\n\t\t\tbr = new BufferedReader(new FileReader(\"/proc/stat\"));\n\t\t\tline = br.readLine();\n\t\t\twhile (line != null) {\n\t\t\t\tString[] items = line.split(\" \");\n\t\t\t\tif (items[0].equals(\"cpu\")) {\n\t\t\t\t\tfor (int i = 1; i < items.length; i++)\n\t\t\t\t\t\tif (!items[i].trim().equals(\"\") && items[i].matches(\"[0-9]*\"))\n\t\t\t\t\t\t\ttotalAfter += Long.parseLong(items[i]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\n\t\t\tusage = 100f * (utimeAfter - utimeBefore) / (totalAfter - totalBefore);\n\t\t} catch (Exception e) {}\n\t\treturn usage;\n\t}", "public Long getCpu() {\n return this.Cpu;\n }", "public static void getCpuUsage(){\r\n CPUmeasurement currentCpuUsage = new CPUmeasurement();\r\n cpuUsageList.add(currentCpuUsage);\r\n //CPUmeasurement.printCpuUsage(currentCpuUsage);\r\n }", "private void collectCpuMemoryUsage(){\r\n\t\tHmDomain hmDomain = CacheMgmt.getInstance().getCacheDomainByName(\"home\");\r\n\t\tfloat cpuUsage = LinuxSystemInfoCollector.getInstance().getCpuInfo() * 100;\r\n\t\tfloat memoryUsage = 0;\r\n\t\ttry {\r\n\t\t\tlong count[] = LinuxSystemInfoCollector.getInstance().getMemInfo();\r\n\t\t\tif(count[0] != 0){\r\n\t\t\t\tmemoryUsage = ((float)(count[0] - count[1] - count[2] - count[3]) * 100 / count[0]);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tBeLogTools.error(HmLogConst.M_PERFORMANCE,\"calculate memory usage failure.\", e);\r\n\t\t}\r\n\t\tCpuMemoryUsage cmu = new CpuMemoryUsage();\r\n\t\tcmu.setCpuUsage(cpuUsage);\r\n\t\tcmu.setMemUsage(memoryUsage);\r\n\t\tcmu.setOwner(hmDomain);\r\n\t\tcmu.setTimeStamp((new Date()).getTime());\r\n\t\ttry {\r\n\t\t\tQueryUtil.createBo(cmu);\r\n\t\t} catch (Exception e) {\r\n\t\t\tBeLogTools.error(HmLogConst.M_PERFORMANCE,\"create CpuMemoryUsage failure.\", e);\r\n\t\t}\r\n\t}", "private double getCpuStatistic(String args) throws Exception\n {\n /*\n ORDER OF COLLUMNS FROM PROC/STAT\n user: normal processes executing in user mode\n nice: niced processes executing in user mode\n system: processes executing in kernel mode\n idle: twiddling thumbs\n iowait: waiting for I/O to \"complete\n irq: servicing interrupts\n softirq: servicing softirqs\n */\n //TODO:IMPLEMENT CPU STATISTICS\n RandomAccessFile reader;\n reader = new RandomAccessFile(\"/proc/stat\", \"r\");\n String cpuInfo = reader.readLine();\n String[] parts = cpuInfo.split(\" \");\n if(args.toLowerCase() == userArg)\n {\n return(Integer.decode(parts[2]));\n }\n else if(args.toLowerCase() == systemArg)\n {\n return(Integer.decode(parts[4]));\n }\n else if(args.toLowerCase() == idleArg)\n {\n return(Integer.decode(parts[5]));\n }\n else\n {\n int total = 0;\n int idle = Integer.decode(parts[5]);;\n for (int i = 2; i < parts.length; i++)\n {\n total += Integer.decode(parts[i]);\n }\n double retVal = (double)idle / (double) total;\n return (retVal);\n }\n }", "public static double doCPU_usage() {\n double totalProgramRunTime = endProgramTime - startProgramTime;\n return (processingTimeTotal / totalProgramRunTime) * 100;\n }", "private void getCpuInfo() {\n\t\ttry {\n\t\t\tRandomAccessFile reader = new RandomAccessFile(\"/proc/stat\", \"r\");\n\t\t\tString load = reader.readLine();\n\n\t\t\tString[] toks = load.split(\" \");\n\n\t\t\tlong idle1 = Long.parseLong(toks[5]);\n\t\t\tlong cpu1 = Long.parseLong(toks[2]) + Long.parseLong(toks[3])\n\t\t\t\t\t+ Long.parseLong(toks[4]) + Long.parseLong(toks[6])\n\t\t\t\t\t+ Long.parseLong(toks[7]) + Long.parseLong(toks[8]);\n\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (Exception e) {\n\n\t\t\t}\n\t\t\t//get process name list in this time\n\t\t\tgetTopCpu();\n\n\t\t\treader.seek(0);\n\t\t\tload = reader.readLine();\n\t\t\treader.close();\n\n\t\t\ttoks = load.split(\" \");\n\n\t\t\t// find right data is the key\n\t\t\t// System.out.println(toks[0]+\" 1 \"+toks[1]+\" 2 \"+toks[2]+\" \"+toks[3]+\" \"+toks[4]+\" \"+toks[5]+\" \"+toks[6]+\" \"+toks[7]+\" 8 \"+toks[8]);\n\t\t\tlong idle2 = Long.parseLong(toks[5]);\n\t\t\tlong cpu2 = Long.parseLong(toks[2]) + Long.parseLong(toks[3])\n\t\t\t\t\t+ Long.parseLong(toks[4]) + Long.parseLong(toks[6])\n\t\t\t\t\t+ Long.parseLong(toks[7]) + Long.parseLong(toks[8]);\n\n\t\t\t// System.out.println(idle2+\" \"+cpu2);\n\t\t\trate = (float) (cpu2 - cpu1)\n\t\t\t\t\t/ (float) ((cpu2 + idle2) - (cpu1 + idle1));\n\t\t\t// System.out.println(rate);\n\t\t\tint temprate = (int) ((rate + 0.05) * 100);\n\t\t\tif (temprate < 0 || temprate > 100) {\n\t\t\t\t// System.out.println(toks[0]+\" 1 \"+toks[1]+\" 2 \"+toks[2]+\" \"+toks[3]+\" \"+toks[4]+\" \"+toks[5]+\" \"+toks[6]+\" \"+toks[7]+\" 8 \"+toks[8]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcpuChart.addData(temprate);\n\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public double getCpuTimeSec() {\n\treturn getCpuTime() / Math.pow(10, 9);\t\t\n}", "Optional<Duration> totalCpuTime();", "public long getJVMCpuTime( ) {\n OperatingSystemMXBean bean =\n ManagementFactory.getOperatingSystemMXBean( );\n if ( ! (bean instanceof\n com.sun.management.OperatingSystemMXBean) )\n return 0L;\n return ((com.sun.management.OperatingSystemMXBean)bean)\n .getProcessCpuTime( );\n}", "public double getOccupiedCpus () { return getCpuBaseResource().getOccupiedCapacity(); }", "public int getCurrentCpuFailoverResourcesPercent() {\r\n return currentCpuFailoverResourcesPercent;\r\n }", "public float getCPUCost() {\n return this.cpuCost;\n }", "@ApiModelProperty(required = true, value = \"The number (across all cores) of micro-seconds per second.\")\n public BigDecimal getCpu() {\n return cpu;\n }", "@Nullable\n Integer getVcpuCount();", "public double getAverageUsage() {\n \tif(lastData.size() > 0) {\n\t \tdouble total = 0.0;\n\t \t\n\t \tfor(double data : lastData) {\n\t \t\ttotal += data;\n\t \t}\n\t \t\n \t\tSystem.out.println(\"Current average load (last minute): \" + total / lastData.size());\n\t \t\n\t \treturn total / lastData.size();\n \t} else {\n \t\t// Calculate CPU usage\n \t\tdouble per = 0;\n\t\t\ttry {\n\t\t\t\tper = sigar.getCpuPerc().getCombined();\n\t\t\t} catch (SigarException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n \t\t\n \t\treturn per;\n \t}\n }", "private void updateCpuStats() {\n\t\tmNumStatsUpdated = 0;\n\t\tList<String> stats = ShellHelper.getProc(CPU_STAT_PROC);\n\t\tif (stats == null || stats.isEmpty()) return;\n\t\t\n\t\tString[] parts = null;\n\t\tString line = null;\n\t\tfor (int i = 0; i < stats.size(); ++i) {\n\t\t\tline = stats.get(i);\n\t\t\tif (line.startsWith(\"cpu\")) { //TODO if 0% usage the cpu is omitted\n\t\t\t\tparts = line.split(\"\\\\s+\");\t\t\t\t\n\t\t\t\tif (parts[0].endsWith(String.valueOf(i - 1))) {\n\t\t\t\t\tif (mLogicalCpus.size() >= i &&\n\t\t\t\t\t\t\tmLogicalCpus.get(i - 1).getCpuStat().update(parts)) {\t\t\t\t\t\n\t\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mCpuStat.update(parts)) {\n\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public double getTotalNumCpus () { return n.getResources(RESOURCETYPE_CPU).stream().mapToDouble(r->r.getCapacity()).sum (); }", "public double getPUtilization() {\n return pUtilization;\n }", "String getCpusetcpus();", "public void increaseCpuUsage(double val) {\n \t\tcpuUsage += val;\n \n \t}", "public Cpu getCpu(){\n return maquina;\n }", "CpuUtilizationType createCpuUtilizationType();", "public static int getSpeedCpuSO() {\n int retorno = 0;\n\n //Try necessário para os casos onde as DLLs não estão presentes.\n try {\n Sigar.load();\n retorno = new Sigar().getCpuInfoList()[0].getMhz();\n\n } catch (SigarException e) {\n CSPLog.error(\"problema ao coletar informacoes da maquina\");\n CSPException.register(e);\n }\n\n return retorno;\n }", "@Override\n\tpublic String getUsedCpuTime() {\n\t\treturn model.getUsedCpuTime();\n\t}", "public void utilization() {\r\n\t\tfloat fAktuell = this.aktuelleLast;\r\n\t\tfloat fMax = this.raumsonde.getMaxNutzlast();\r\n\t\tfloat prozent = fAktuell / fMax * 100;\r\n\r\n\t\tSystem.out.println(\" \" + fAktuell + \"/\" + fMax + \" (\" + prozent + \"%)\");\r\n\t}", "public CPU getCPU() {\r\n\t\treturn cpu;\r\n\t}", "@Test\n public void testCpuMetric() {\n MetricValue mv = new MetricValue.Builder().load(30).add();\n\n CPU_METRICS.forEach(cmt -> testUpdateMetricWithoutId(cmt, mv));\n CPU_METRICS.forEach(cmt -> testLoadMetric(nodeId, cmt, mv));\n }", "@DISPID(70)\r\n\t// = 0x46. The runtime will prefer the VTID if present\r\n\t@VTID(68)\r\n\tint averageCPUTime_Seconds();", "private long getCpuTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : 0L;\n }", "public Integer getCpus() {\n return cpus;\n }", "public void readCpuStat() {\n\t\ttry {\n\t\t\t// monitor total and idle cpu stat of certain process\n\t\t\tRandomAccessFile cpuInfo = new RandomAccessFile(\"/proc/stat\", \"r\");\n\t\t\tString[] toks = cpuInfo.readLine().split(\"\\\\s+\");\n\t\t\tidleCpu = Long.parseLong(toks[4]);\n\t\t\ttotalCpu = Long.parseLong(toks[1]) + Long.parseLong(toks[2])\n\t\t\t\t\t+ Long.parseLong(toks[3]) + Long.parseLong(toks[4])\n\t\t\t\t\t+ Long.parseLong(toks[6]) + Long.parseLong(toks[5])\n\t\t\t\t\t+ Long.parseLong(toks[7]);\n\t\t\tcpuInfo.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t} catch (IOException e) {\n\t\t}\n\t}", "int getCPU_time();", "public Integer getCpus() {\n return cpus;\n }", "public int getAvgExecs()\n/* */ {\n/* 55 */ return this.avgExecs;\n/* */ }", "public double CPUServiceTime()\r\n\t{\r\n\t\treturn Math.random()* (30.0 - 10.0) + 10.0;\r\n\t}", "@DISPID(23)\r\n\t// = 0x17. The runtime will prefer the VTID if present\r\n\t@VTID(25)\r\n\tjava.lang.String averageCPUTime();", "public static float getCpuTemperature() throws IOException, InterruptedException, NumberFormatException {\n \treturn pi4jSystemInfoConnector.getCpuTemperature();\r\n }", "@Override\n\tpublic String getCPU() {\n\t\treturn null;\n\t}", "double getLeftoverCPUPercentile() {\n return MathUtils.toPercentile(getLeftoverCPU(), pm.getCPU());\n }", "private SensorData collectCPUUsageInfo() throws SigarException {\n \n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Collecting CPU Usage Information\");\n }\n SensorData data = new SensorData();\n \n CpuPerc cpuPerc = sigar.getCpuPerc();\n \n data.add(SensorAttributeConstants.CPUConstants.CPU_IDLE, (cpuPerc.getIdle() * 100));\n data.add(SensorAttributeConstants.CPUConstants.CPU_USAGE_USER, (cpuPerc.getUser() * 100));\n data.add(SensorAttributeConstants.CPUConstants.CPU_USAGE_SYSTEM, (cpuPerc.getSys() * 100));\n data.add(SensorAttributeConstants.CPUConstants.CPU_USAGE_TOTAL, (cpuPerc.getCombined() * 100));\n \n return data;\n }", "public long cpuMicros() {\n return this.cpuNanos / 1000;\n }", "public String getCpuTemperature_Xperia(){\n\n double maxTemp = 0.0;\n RandomAccessFile reader;\n //////// core 1\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone7/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n //////// core 2\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone8/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n //////// core 3\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone9/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n //////// core 4\n try {\n reader = new RandomAccessFile( \"/sys/class/thermal/thermal_zone10/temp\", \"r\" );\n boolean done = false;\n while ( ! done ) {\n String line = reader.readLine();\n if ( null == line ) {\n done = true;\n break;\n }\n maxTemp += Double.parseDouble(line);\n }\n\n } catch ( IOException ex ) {\n ex.printStackTrace();\n }\n\n return String.valueOf(maxTemp / 4);\n }", "public long getCpuTime() {\n\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\treturn bean.isCurrentThreadCpuTimeSupported() ?\n\t\t\tbean.getCurrentThreadCpuTime() : 0L;\n\t\n}", "public String processamento(){\n \n List<com.profesorfalken.jsensors.model.components.Cpu> cpus = JSensors.get.components().cpus;\n if(cpus.isEmpty()) return \"40.0\";\n \n for (final com.profesorfalken.jsensors.model.components.Cpu cpu : cpus) {\n List<Load> loads = cpu.sensors.loads;\n for (final Load load : loads) {\n if(load.name.equals(\"Load CPU Total\"))\n return String.valueOf(load.value);\n }\n }\n return \"40.0\";\n }", "@Override\n public double evaluate(DataCenterInterface dataCenter,\n double binCpuRemain,\n double binMemRemain,\n double binActualCpuUsed,\n double binActualMemUsed,\n double itemCpuUsed,\n double itemMemUsed,\n double itemActualCpuUsed,\n double itemActualMemUsed) {\n return 0;\n }", "BigInteger getLeftoverCPU() {\n return pm.getCPU().subtract(used_cpu);\n }", "@Override\n\tpublic double getAvgUtilization() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void setCpu() {\n\t\tcom.setCpu(\"i7\");\n\t}", "public int getCurrentMemoryFailoverResourcesPercent() {\r\n return currentMemoryFailoverResourcesPercent;\r\n }", "public Integer getUtilizationStart(){\n String value = (String)getProp().get(\"UTILIZATION_START\");\n if (value == null){\n return 1;\n } else {\n return Integer.parseInt(value);\n }\n }", "public static String getCpuInfo() {\n String result = \"\";\n ProcessBuilder cmd;\n try {\n String[] args = {COMMAND_LINE, PATH_CPU};\n cmd = new ProcessBuilder(args);\n Process process = cmd.start();\n InputStream in = process.getInputStream();\n byte[] re = new byte[24];\n while (in.read(re) != -1) {\n result = result + new String(re);\n }\n in.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n result = \"N/A\";\n }\n return result.trim();\n }", "public static long getCpuTime(){\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ?\n bean.getCurrentThreadCpuTime() : 0L;\n }", "@DISPID(55)\r\n\t// = 0x37. The runtime will prefer the VTID if present\r\n\t@VTID(53)\r\n\tint actualCPUTime_Seconds();", "public int getNumberOfCores();", "public CPUCore getCpuCore() {\n return cpuCore;\n }", "public void setCpu(Long Cpu) {\n this.Cpu = Cpu;\n }", "private double getOEEPerformance(Batch batch) {\n return 1;\n }", "public long getStartCpuTime() {\r\n return startCpuTime;\r\n }", "@DISPID(69)\r\n\t// = 0x45. The runtime will prefer the VTID if present\r\n\t@VTID(67)\r\n\tint averageCPUTime_Minutes();", "private int getCPUNumCoresInt() {\n\t\tclass CpuFilter implements FileFilter {\n\t\t\t@Override\n\t\t\tpublic boolean accept(File pathname) {\n\t\t\t\t// Check if filename is \"cpu\", followed by a single digit number\n\t\t\t\tif (Pattern.matches(\"cpu[0-9]\", pathname.getName())) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Get directory containing CPU info\n\t\t\tFile dir = new File(\"/sys/devices/system/cpu/\");\n\t\t\t// Filter to only list the devices we care about\n\t\t\tFile[] files = dir.listFiles(new CpuFilter());\n\t\t\t// Return the number of cores (virtual CPU devices)\n\t\t\treturn files.length;\n\t\t} catch (Exception e) {\n\t\t\t// Default to return 1 core\n\t\t\treturn 1;\n\t\t}\n\t}", "private void calculateAndGraph(ArrayList<String> first, ArrayList<String> second) {\n\t\tfor(int i = 0; i < numCores; i++) {\n\t\t\t\tString[] firstTokens = first.get(i).split(\" \");\n\t\t\t\tString[] secondTokens = second.get(i).split(\" \");\n\t\t\t\t\n\t\t\t\t// calculate user2 - user1\n\t\t\t\tdouble user = Double.parseDouble(secondTokens[0]);\n\t\t\t\tdouble userPrevious = Double.parseDouble(firstTokens[0]);\n\t\t\t\tdouble userDiff = Math.abs(user-userPrevious);\n\t\t\t\t\n\t\t\t\t// calculate system2 - system1\n\t\t\t\tdouble system = Double.parseDouble(secondTokens[1]);\n\t\t\t\tdouble systemPrevious = Double.parseDouble(firstTokens[1]);\n\t\t\t\tdouble systemDiff = Math.abs(system-systemPrevious);\n\t\t\t\t\n\t\t\t\t// calculate nice2 - nice1\n\t\t\t\tdouble nice = Double.parseDouble(secondTokens[2]);\n\t\t\t\tdouble nicePrevious = Double.parseDouble(firstTokens[2]);\n\t\t\t\tdouble niceDiff = Math.abs(nice-nicePrevious);\n\t\t\t\t\n\t\t\t\t// calculate idle2 - idle1\n\t\t\t\tdouble idle = Double.parseDouble(secondTokens[3]);\n\t\t\t\tdouble idlePrevious = Double.parseDouble(firstTokens[3]);\n\t\t\t\tdouble idleDiff = Math.abs(idle-idlePrevious);\n\t\t\t\t\t\t\t\t\n//\t\t\t\t// calculate CPU usage using method from http://www.pplusdomain.net/cgi-bin/blosxom.cgi/2009/04/02\n//\t\t\t\tdouble total = userDiff + systemDiff + niceDiff + idleDiff;\n//\t\t\t\tdouble idlePercent = idleDiff / total * 100;\n//\t\t\t\tint cpuUtil2 = (int) (100.0 - idlePercent);\n\t\t\t\t\n\t\t\t\t// calculate CPU usage using method from https://piazza.com/class/ic02ole9e534k8?cid=137\n\t\t\t\tdouble numerator = systemDiff + userDiff;\n\t\t\t\tdouble denominator = numerator + idleDiff;\n\t\t\t\tint cpuUtil = (int) ((numerator / denominator) * 100.0);\n\t\t\t\t\n\t\t\t\t// Write cpu usage for this core to the graph\n\t\t\t\tuserInterface.getCPUGraph().addDataPoint(i, cpuUtil);\n\t\t\t\tuserInterface.getCPUGraph().repaint();\n\t\t}\n\t}", "private double pingGetLatency(){\n\t\t int NUMBER_OF_PACKTETS=10;\n\t String pingCommand = \"/system/bin/ping -c \" + NUMBER_OF_PACKTETS + \" \" + ip;\n\t String inputLine = \"\";\n\t double avgRtt = 0;\n\n\t try {\n\t // execute the command on the environment interface\n\t Process process = Runtime.getRuntime().exec(pingCommand);\n\t // gets the input stream to get the output of the executed command\n\t BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));\n\n\t inputLine = bufferedReader.readLine();\n\t while ((inputLine != null)) {\n\t if (inputLine.length() > 0 && inputLine.contains(\"avg\")) { // when we get to the last line of executed ping command\n\t break;\n\t }\n//\t \t if (inputLine.length()>0) inputLine = bufferedReader.readLine();\n\t inputLine = bufferedReader.readLine();\n\t }\n\t }\n\t catch (IOException e){\n\t \t pingParameters=\"Error in ping\";\n\t e.printStackTrace();\n\t }\n\n\t // Extracting the average round trip time from the inputLine string\n\t String afterEqual = inputLine.substring(inputLine.indexOf(\"=\"), inputLine.length()).trim();\n\t String afterFirstSlash = afterEqual.substring(afterEqual.indexOf('/') + 1, afterEqual.length()).trim();\n\t String strAvgRtt = afterFirstSlash.substring(0, afterFirstSlash.indexOf('/'));\n\t avgRtt = Double.valueOf(strAvgRtt);\n\t pingParameters=inputLine;\n\t return avgRtt;\n\t }", "public long getCurrentThreadCpuTime() {\t\t\t\t\t\t//Total CPU time usage\n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\n\t\treturn bean.isCurrentThreadCpuTimeSupported() ? bean.getCurrentThreadCpuTime() : -1L;\n\t}", "public Double getTotalAvailable(){\n return totalAvailable;\n }", "public static long getCpuTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n bean.getCurrentThreadCpuTime(): 0L;\n }", "@DISPID(21)\r\n\t// = 0x15. The runtime will prefer the VTID if present\r\n\t@VTID(23)\r\n\tjava.lang.String actualCPUTime();", "public static String retornaPercentualUsadoDeMemoriaJVM() {\r\n\t\tRuntime runtime = Runtime.getRuntime();\r\n\t\t\r\n\t\tlong max = runtime.maxMemory();\r\n\t\tlong free = runtime.freeMemory();\r\n\t\tlong used = max - free;\r\n\r\n\t\tNumberFormat format = NumberFormat.getInstance();\r\n\r\n\t\t// Retorna o percentual da memoria usada\r\n\t\tString percentualMemoriaUsada = format.format(((used * 100) / max));\r\n\r\n\t\treturn percentualMemoriaUsada;\r\n\t}", "@Override\n\tint use() {\n\t\treturn (int)(primaryStat*1.2);\n\t}", "public static String getCurCpuFreq() {\n String result = \"N/A\";\n try {\n FileReader fr = new FileReader(PATH_CUR);\n BufferedReader br = new BufferedReader(fr);\n String text = br.readLine();\n result = text.trim();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return result;\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCpuinfo = ShellHelper.getProc(CPU_INFO_PROC);\n\t\t\t\tupdateCpuStats();\n\t\t\t\tfor (LogicalCpu c : mLogicalCpus) {\n\t\t\t\t\tc.updateFrequency();\n\t\t\t\t\tc.updateGovernor();\n\t\t\t\t\tc.updateTimeInFrequency();\n\t\t\t\t\tc.updateTotalTransitions();\n\t\t\t\t}\n\t\t\t}", "private float getMemoryUsage() {\n\t\tRuntime runtime = Runtime.getRuntime();\n\t\tlong allocatedMemory = runtime.totalMemory();\n\t\tlong freeMemory = runtime.freeMemory();\n\t\treturn (allocatedMemory - freeMemory);\n\t}", "public double measurePowerUsage(String packageNameString, HashMap<String, Long> appCpuTimeBefor, long r_time) {\n //targetAppTime: CPU Running time of app, totalTime: Total CPU Running time\n HashMap<String, Long> appCpuTimeAfter = new HashMap<String, Long>();\n appCpuTimeAfter = getAppCpuTime(packageNameString);\n\n double targetAppTimeAfter = appCpuTimeAfter.get(\"targetAppTime\");\n double targetAppTimeBefor = appCpuTimeBefor.get(\"targetAppTime\");\n Log.i(TAG, \"appCpuTimeAfter \" + targetAppTimeAfter);\n Log.i(TAG, \"appCpuTimeBefor \" + targetAppTimeBefor);\n\n double totalTimeAfter = appCpuTimeAfter.get(\"totalTime\");\n double totalTimeBefor = appCpuTimeBefor.get(\"totalTime\");\n Log.i(TAG, \"totalTimeAfter \" + totalTimeAfter);\n Log.i(TAG, \"totalTimeBefor \" + totalTimeBefor);\n\n double ratio = (targetAppTimeAfter - targetAppTimeBefor + r_time ) / (totalTimeAfter - totalTimeBefor + r_time);\n Log.i(TAG, \"ratio \" + ratio);\n double[] currentSteps = getCurrentSteps();\n\n Log.i(TAG, \"currentSteps.length \" + currentSteps.length);\n\n\n return ratio; //second to hour\n }", "public static long getCpuTime( ) {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n\n bean.getCurrentThreadCpuTime( ) : 0L;\n\n }", "int getHPPerSecond();", "public long getTotalThreadCpuTime(long[] tids) {\t\t\t\t//get multiple threads cpu time usage to prevent overhead for multiple \n\t\tThreadMXBean bean = ManagementFactory.getThreadMXBean();\t\t//method invocations of getThreadCpuTime(long tid)\n\t\tif(!bean.isThreadCpuTimeSupported()) \t\t\t\t\t\t\t//If JVM supports for CPU time measurement for any thread, it returns true\n\t\t\treturn -1L;\n\t\tfor(long i : tids) {\n\t\t\tlong currentTime = bean.getThreadCpuTime(i);\n\t\t\tif(currentTime != -1) {\t\t\t\t\t\t\t\t\t\t//Check if the thread CPU measurement is enableed.\n\t\t\t\ttotalTime += currentTime;\n\t\t\t}\n\t\t}\n\t\treturn totalTime;\n\t}", "public long getTotalRam();", "public double measurePowerUsage(String packageNameString, HashMap<String, Long> appCpuTimeBefor, long r_time) {\n HashMap<String, Long> appCpuTimeAfter = new HashMap<String, Long>();\n appCpuTimeAfter = getAppCpuTime(packageNameString);\n\n double totalPower = 0;\n double targetAppTimeAfter = appCpuTimeAfter.get(\"targetAppTime\");\n double targetAppTimeBefor = appCpuTimeBefor.get(\"targetAppTime\");\n Log.i(\"TAG\", \"appCpuTimeAfter \" + targetAppTimeAfter);\n Log.i(\"TAG\", \"appCpuTimeBefor \" + targetAppTimeBefor);\n\n double totalTimeAfter = appCpuTimeAfter.get(\"totalTime\");\n double totalTimeBefor = appCpuTimeBefor.get(\"totalTime\");\n Log.i(\"TAG\", \"totalTimeAfter \" + totalTimeAfter);\n Log.i(\"TAG\", \"totalTimeBefor \" + totalTimeBefor);\n\n Log.i(\"AAAAAAAAA\", \"targetAppTimeAfter-targetAppTimeBefor\"+String.valueOf(targetAppTimeAfter-targetAppTimeBefor));\n Log.i(\"AAAAAAAAA\", \"totalTimeAfter-totalTimeBefor\"+String.valueOf(totalTimeAfter-totalTimeBefor));\n //double ratio = (targetAppTimeAfter - targetAppTimeBefor + r_time) / (totalTimeAfter - totalTimeBefor + r_time);\n //double ratio = (targetAppTimeAfter - targetAppTimeBefor ) / (totalTimeAfter - totalTimeBefor );\n //double ratio = (targetAppTimeAfter - targetAppTimeBefor + r_time/10) / (totalTimeAfter - totalTimeBefor + r_time/10);\n double ratio= (r_time/10)/(totalTimeAfter - totalTimeBefor);\n\n Log.i(\"TAG\", \"ratio\" + ratio);\n\n return ratio; //second to hour\n }", "public Float getInUtilization() {\r\n return inUtilization;\r\n }", "public synchronized float getLoadFactor() {\n return (float)entries / (float)slots;\n }", "public static double adjustCpuForConstrainedScan(double cpu) {\n return cpu * CONSTRAINED_SCAN_CPU_MULTIPLIER;\n }", "public float getLoad(){\n\t\treturn 1.0f*size/capacity;\n\t}", "public Float getOutUtilization() {\r\n return outUtilization;\r\n }", "public double evaluate(\n DataCenterInterface dataCenter,\n double binCpuConfiguration,\n double binMemOverhead,\n double binCpuOverheadRate,\n double binCpuRemain,\n double binMemRemain,\n double itemCpuRequire,\n double itemMemRequire) {\n double[] normalizedBin;\n double[] normalizedItem;\n double[] normalizedOverhead;\n double value = 0;\n\n\n // We use PM to normalize both, therefore, the type is null.\n normalizedBin = norm.normalize(binCpuRemain, binMemRemain);\n normalizedItem = norm.normalize(itemCpuRequire, itemMemRequire);\n normalizedOverhead = norm.normalize(binCpuConfiguration * binCpuOverheadRate, binMemOverhead);\n\n double leftVmCpu = normalizedBin[0] - normalizedItem[0];\n double leftVmMem = normalizedBin[1] - normalizedItem[1];\n double normalizedItemCpu = normalizedItem[0];\n double normalizedItemMem = normalizedItem[1];\n double normalizedVmCpuOverhead = normalizedOverhead[0];\n double normalizedVmMemOverhead = normalizedOverhead[1];\n\n\n// double coCpuDivPmMem = normalizedItemCpu / leftVmMem;\n\n Parser parser = new Parser();\n\n try {\n ExpressionNode expr = parser.parse(expression);\n expr.accept(new SetVariable(\"normalizedItemMem\", normalizedItemMem));\n expr.accept(new SetVariable(\"normalizedItemCpu\", normalizedItemCpu));\n expr.accept(new SetVariable(\"leftVmMem\", leftVmMem));\n expr.accept(new SetVariable(\"leftVmCpu\", leftVmCpu));\n expr.accept(new SetVariable(\"normalizedVmCpuOverhead\", normalizedVmCpuOverhead));\n expr.accept(new SetVariable(\"normalizedVmMemOverhead\", normalizedVmMemOverhead));\n// expr.accept(new SetVariable(\"CoCPUdivPmMem\", coCpuDivPmMem));\n value = expr.getValue();\n\n } catch (ParserException e) {\n System.out.println(e.getMessage());\n } catch (EvaluationException e) {\n System.out.println(e.getMessage());\n }\n\n return value;\n }", "int getProcessorCount();", "private double getSystemCallStatistics()\n {\n return(-1);\n }", "public static int performanceCountGet() { return 0; }", "int getPercentageHeated();", "public int getProcessorSpeed()\n\t{\n\t\treturn speed;\n\t}", "public static long getCpuTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n bean.getCurrentThreadCpuTime( ) : 0L;\n }", "private long getPTSUs() {\n long result = System.nanoTime() / 1000L;\n if (result < prevOutputPTSUs)\n result = (prevOutputPTSUs - result) + result;\n return result;\n }", "public double usagePercentage() {\n return 1.0 * (this.rectangleCount() - 1) / (this.M * this.nodeCount()); // -1 in order to ignore de root\n }", "int getTotalFree();", "public double getPercentRem(){\n return ((double)freeSpace / (double)totalSpace) * 100d;\n }", "int getMPPerSecond();" ]
[ "0.8082374", "0.7819267", "0.75847346", "0.75787413", "0.7547533", "0.7346381", "0.73427284", "0.73038554", "0.7247134", "0.72044396", "0.718422", "0.71494603", "0.68973374", "0.67899466", "0.6754471", "0.6745265", "0.6735059", "0.6726127", "0.6689123", "0.66268975", "0.66184676", "0.65953946", "0.6590559", "0.6584663", "0.65596133", "0.6550884", "0.653445", "0.6522833", "0.6520413", "0.64792836", "0.64709115", "0.644798", "0.64339304", "0.6424703", "0.6412364", "0.6405725", "0.64054066", "0.6373837", "0.63609713", "0.6335241", "0.63097805", "0.6297798", "0.62642413", "0.6262179", "0.6228693", "0.6201714", "0.6191498", "0.6191138", "0.6171322", "0.6164668", "0.6162244", "0.6145978", "0.6094919", "0.6092103", "0.60762256", "0.60716754", "0.6070044", "0.60579556", "0.60341555", "0.60213023", "0.6020205", "0.6017808", "0.6008165", "0.6001294", "0.59953094", "0.5992217", "0.5979437", "0.5963678", "0.59599376", "0.5951427", "0.5944181", "0.59431833", "0.59386253", "0.59336394", "0.5913433", "0.59129614", "0.5912863", "0.58988386", "0.5880951", "0.5876864", "0.5876518", "0.5874844", "0.5872219", "0.58609176", "0.58434004", "0.5843365", "0.5836985", "0.58331186", "0.58238006", "0.58160776", "0.5809453", "0.57991415", "0.5795277", "0.5791539", "0.57896537", "0.5783781", "0.5774025", "0.5773292", "0.57727045", "0.5751867", "0.57496697" ]
0.0
-1
QuestionDTO question = questionService.getById(id);
@GetMapping("/insertdepartment/{id}") public String edit(@PathVariable(name = "id") Integer id, Model model){ departmentDTO department = departmentService.getById(id); model.addAttribute("dpmtid",department.getDpmtid()); model.addAttribute("dpmtname",department.getDpmtname()); model.addAttribute("dpmtinfo",department.getDpmtinfo()); return "insertdepartment"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public QuestionDTO getByID(Integer id) {\n QuestionExample questionExample = new QuestionExample();\n questionExample.createCriteria().andIdEqualTo(id);\n List<Question> questions = questionMapper.selectByExample(questionExample);\n if(questions.size()==0){\n throw new CustomizeException(CustomizeErrorCode.QUESTION_NOT_FOUND);\n }\n QuestionDTO questionDTO = new QuestionDTO();\n BeanUtils.copyProperties(questions.get(0),questionDTO);\n //User user = userMapper.findByID(question.getCreator());\n UserExample userExample = new UserExample();\n userExample.createCriteria().andAccountIdEqualTo(questions.get(0).getCreator().toString());\n List<User> users = userMapper.selectByExample(userExample);\n questionDTO.setUser(users.get(0));\n return questionDTO;\n }", "Question getQuestion(String questionId);", "SurveyQuestionDTO convertSurveyQuestionToSurveyQuestionDTO(SurveyQuestion question);", "public ItemTypeDTO findById(String id);", "@GetMapping (\"/getOneQuestion\")\n @ResponseBody\n public Question getOneQuestion(long id){\n Optional<Question> oquestion = this.questionRepository.findById(id);\n if(oquestion.isPresent()){\n return oquestion.get();\n }\n return null;\n }", "@Test\n @Transactional\n public void testGetOneQuestion() throws RecordNotFoundException {\n when(questionRepository.findById(anyLong())).thenReturn(Optional.of(createNewQuestion()));\n Optional<GetQuestionResponseDto> getQuestionResponseDto = questionService.getQuestion(1L);\n assertTrue(getQuestionResponseDto.isPresent());\n assertEquals(\"Author1\", getQuestionResponseDto.get().getAuthor());\n assertEquals(\"Message1\", getQuestionResponseDto.get().getMessage());\n assertEquals(new ArrayList<>(), getQuestionResponseDto.get().getReplies());\n assertEquals(Long.valueOf(1), getQuestionResponseDto.get().getId());\n }", "EmployeeDTO findById(Long employeeId);", "Optional<Question> findByIdWithAllDetails(QuestionId id);", "Optional<LectureDTO> findOne(Long id);", "public interface PersonQuestionService {\n /*\n *增加个人测试结果\n */\n public int addPersonQuestion(PersonQuestion t);\n\n /*\n *删除个人测试结果\n */\n public int deletePersonQuestion(String uq_id);\n\n /*\n *更新个人测试结果\n */\n public int updatePersonQuestion(PersonQuestion t);\n\n /*\n *通过id获取指定个人测试结果\n */\n public PersonQuestion getPersonQuestionById(String u_id,String question_id);\n}", "public interface IAdminQuestionService {\n\n public AdminDTO<List<Question>> findAll(Integer pageNo , Integer pageSize);\n\n public AdminDTO addReply (Long questionId,String replyContent,Long userId,String quetsionTitle);\n\n public AdminDTO deleteQuestion(Long[] questionId);\n\n public Integer questionCount();\n\n public AdminDTO checkQuestion(Long questionId);\n\n}", "PeopleDTO findOne(Long id);", "NoteDTO findOne(Long id);", "Optional<InterviewEventDTO> findOne(Long id);", "List<SurveyQuestionDTO> getSurveyQuestionDtosByQuestions(List<Question> questions);", "ExerciseDTO convertToExerciseDTO(Exercise exercise);", "public PersonaDTO consultarPersona(Long idPersona) ;", "@Repository\npublic interface ExamQuestionMapper {\n\n Integer addExamQuestion(ExamQuestionVO examQuestionVO);\n\n Integer updateExamQuestion(ExamQuestionVO examQuestionVO);\n\n ExamQuestionDO findDetailExamQuestion(ExamQuestionVO examQuestionVO);\n\n List<ExamQuestionDO> listExamQuestion(ExamQuestionVO examQuestionVO);\n\n List<ExamQuestionDO> listExamQuestionPage(ExamQuestionVO examQuestionVO);\n\n Integer countExamQuestion(ExamQuestionVO examQuestionVO);\n\n Integer deleteExamQuestion(ExamQuestionVO examQuestionVO);\n\n List<QuestionManageVO> listExamQuestionByExam(QuestionManageQuery query);\n}", "PaperDTO findOne(Long id);", "public List<QuestionDTO> list() {\n QuestionExample questionExample = new QuestionExample();\n questionExample.createCriteria();\n List<Question> list = questionMapper.selectByExample(questionExample);\n List<QuestionDTO> questionDTOList = new ArrayList<>();\n for(Question question:list){\n //User user = userMapper.findByID(question.getCreator());\n UserExample userExample = new UserExample();\n userExample.createCriteria().andAccountIdEqualTo(question.getCreator().toString());\n List<User> users = userMapper.selectByExample(userExample);\n QuestionDTO questionDTO = new QuestionDTO();\n BeanUtils.copyProperties(question,questionDTO);\n questionDTO.setUser(users.get(0));\n questionDTOList.add(questionDTO);\n }\n return questionDTOList;\n }", "Optional<CardDTO> findOne(String id);", "@Query(\"SELECT * FROM wellbeing_questions WHERE wellbeing_question_id == :id\")\n WellbeingQuestion getQuestionById(long id);", "InvoiceDTO fetchByID(int id);", "ExercisePo getExerciseById(Long id);", "Optional<VitalDTO> findOne(Long id);", "List<SurveyQuestionDTO> getSurveyQuestionDtos(List<SurveyQuestion> surveyQuestions);", "CustomerDto findById(Long id);", "@Override\n\t@Transactional\n\tpublic Question getQuestionById(int id) {\n\t\treturn questionDao.getQuestionById(id);\n\t}", "OptionDTO getOptionById(Integer optionId);", "public TripDTO findTripById(Long id);", "SeminarioDTO findOne(Long id);", "UserDTO findUserById(Long id);", "@Test\n @Transactional\n public void testGetOneQuestionWithReply() throws RecordNotFoundException {\n QuestionEntity questionEntityWithReply = createNewQuestion();\n questionEntityWithReply.setReplies(Arrays.asList(createReplyEntity()));\n when(questionRepository.findById(anyLong())).thenReturn(Optional.of(questionEntityWithReply));\n Optional<GetQuestionResponseDto> getQuestionResponseDto = questionService.getQuestion(1L);\n assertTrue(getQuestionResponseDto.isPresent());\n assertEquals(\"Author1\", getQuestionResponseDto.get().getAuthor());\n assertEquals(\"Message1\", getQuestionResponseDto.get().getMessage());\n assertEquals(\"reply-author\", getQuestionResponseDto.get().getReplies().get(0).getAuthor());\n assertEquals(\"reply-message\", getQuestionResponseDto.get().getReplies().get(0).getMessage());\n assertEquals(Long.valueOf(1), getQuestionResponseDto.get().getId());\n }", "ProjectsDTO findOne(String id);", "public Question getQuestionbyId(int sid,int qid);", "OperationDTO findOperation(Long id);", "TeamDTO findOne(Long id);", "@GetMapping(value=\"/getQuestion/{questionId}\")\n\tpublic Question getQuestion(@PathVariable(\"questionId\") int id) throws QuestionException{\n\t\tLOGGER.info(\"Viewing Question By Id\");\n\t\treturn questionObj.viewQuestionById(id);\n\t}", "public QuestionListDTO()\r\n\t{\r\n\r\n\t}", "public UsuarioDTO consultarUsuario(String idUsuario);", "Optional<ConsultationInfoDTO> findOne(Long id);", "AttendanceDTO get(long id);", "Optional<ServiceUserDTO> findOne(Long id);", "public interface AnswerRepository extends JpaRepository<Answer, Integer> {\n\n List<Answer> findByQuestionId(Integer questionId);\n}", "public Long getQuestionId();", "Optional<SuppliesDTO> findOne(Long id);", "RocketDTO findRocketById(Long id);", "public QuizDTO getQuiz(long quizId) {\n QuizDTO newQuizDTO = new QuizDTO();\n Quiz quiz = quizRepository.findByQuizId(quizId);\n newQuizDTO.setQuizId(quiz.getQuizId());\n newQuizDTO.setQuizQuestion(quiz.getQuizQuestion());\n newQuizDTO.setQuizOptionDTOList(getOptionDTO(quiz));\n return newQuizDTO;\n }", "@Repository\npublic interface QuestionRepository extends CrudRepository<Question, Long> {\n\n}", "ProjectDTO findProjectById(Long id);", "Optional<SygTypeServiceDTO> findOne(Long id);", "@Transactional(readOnly = true)\n public Optional<TechPracticesDTO> findOne(Long id) {\n log.debug(\"Request to get TechPractices : {}\", id);\n return techPracticesRepository.findById(id)\n .map(techPracticesMapper::toDto);\n }", "public Service findById(int theId);", "@Override\n\tpublic Question getQuestion(Integer qid) {\n\t\treturn questionDao.getEntity(qid);\n\t}", "@GetMapping(\"/{id}\")\n @Transactional\n public PostulantExamResultResponse getById(@PathVariable Long id) {\n return postulantExamService.getById(id);\n }", "PokemonDTO getPokemonById(Long id);", "public interface LectureService {\n\n /**\n * Save a lecture.\n *\n * @param lectureDTO the entity to save\n * @return the persisted entity\n */\n LectureDTO save(LectureDTO lectureDTO);\n\n /**\n * Get all the lectures.\n *\n * @return the list of entities\n */\n List<LectureDTO> findAll();\n\n\n /**\n * Get the \"id\" lecture.\n *\n * @param id the id of the entity\n * @return the entity\n */\n Optional<LectureDTO> findOne(Long id);\n\n /**\n * Delete the \"id\" lecture.\n *\n * @param id the id of the entity\n */\n void delete(Long id);\n\n /**\n * Search for the lecture corresponding to the query.\n *\n * @param query the query of the search\n * \n * @return the list of entities\n */\n List<LectureDTO> search(String query);\n}", "Optional<EstimateProductDTO> findOne(Long id);", "@Transactional(readOnly = true)\n public Optional<MSituationDTO> findOne(Long id) {\n log.debug(\"Request to get MSituation : {}\", id);\n return mSituationRepository.findById(id)\n .map(mSituationMapper::toDto);\n }", "Optional<ChatDTO> findOne(Long id);", "PostSaveDTO queryDetailById(String postId);", "BaacDTO findOne(Long id);", "public Data findById(Object id);", "Optional<SchoolProgressDTO> findOne(Long id);", "Optional<TypeBonDTO> findOne(Long id);", "public Pregunta getPregunta(int id);", "Question selectByPrimaryKey(String id);", "Optional<DomainRelationshipDTO> findOne(UUID id);", "Question getQuestionInPick(String questionId);", "@Transactional(readOnly = true)\n public Optional<CompetitionDTO> findOne(Long id) {\n log.debug(\"Request to get Competition : {}\", id);\n return competitionRepository.findById(id)\n .map(competitionMapper::toDto);\n }", "Question getQuestion();", "@Transactional(readOnly = true)\n public Optional<RecipeDTO> findOne(Long id) {\n log.debug(\"Request to get Recipe : {}\", id);\n return recipeRepository.findById(id)\n .map(recipeMapper::toDto);\n }", "public MobileTaskAssignmentDTO getByIdDTO(int taskId) {\r\n\t\treturn (MobileTaskAssignmentDTO) sessionFactory.getCurrentSession().createQuery(\r\n\t\t\t\t\"select mob.taskId as taskId, mob.orderId as orderId, mob.orderDate as orderDate, mob.customerId as customerId, \" +\r\n\t\t\t\t\t\t\"mob.customerName as customerName, mob.customerAddress as customerAddress, \" +\r\n\t\t\t\t\t\t\"mob.customerPhone as customerPhone, mob.customerZipcode as customerZipcode, mob.customerSubZipcode as customerSubZipcode, \" +\r\n\t\t\t\t\t\t\"mob.customerRt as customerRt, mob.customerRw as customerRw, mob.priority as priority, \" +\r\n\t\t\t\t\t\t\"mob.notes as notes, mob.verifyBy as verifyBy, mob.verifyDate as verifyDate, \" +\r\n\t\t\t\t\t\t\"mob.assignmentDate as assignmentDate, mob.retrieveDate as retrieveDate, mob.submitDate as submitDate, \" +\r\n\t\t\t\t\t\t\"mob.finalizationDate as finalizationDate, mob.receiveDate as receiveDate, mob.assignmentStatus as assignmentStatus, \" +\r\n\t\t\t\t\t\t\"mob.user.userId as userId, mob.user.userCode as userCode, mob.user.userName as userName, \" +\r\n\t\t\t\t\t\t\"mob.office.officeId as officeId, mob.office.officeCode as officeCode, mob.office.officeName as officeName, \" +\r\n\t\t\t\t\t\t\"mob.office.company.coyId as coyId, mob.office.company.coyCode as coyCode, mob.office.company.coyName as coyName, \" +\r\n\t\t\t\t\t\t\"mob.product.productId as productId, mob.product.productCode as productCode, mob.product.productName as productName, \" +\r\n\t\t\t\t\t\t\"mob.product.template.tempId as tempId, mob.product.template.tempLabel as tempLabel, \" +\r\n\t\t\t\t\t\t\"mob.taskStatus.taskStatusId as taskStatusId, mob.taskStatus.taskStatusCode as taskStatusCode, mob.taskStatus.taskStatusName as taskStatusName \" +\r\n\t\t\t\t\t\t\"from \" + domainClass.getName() + \" mob \" +\r\n\t\t\t\t\t\t\"where mob.taskId = :taskId\")\r\n\t\t\t\t\t\t.setInteger(\"taskId\", taskId)\r\n\t\t\t\t\t\t.setResultTransformer(Transformers.aliasToBean(MobileTaskAssignmentDTO.class))\r\n\t\t\t\t\t\t.uniqueResult();\r\n\t}", "@Override\n @Transactional(readOnly = true)\n public SintomaDTO findOne(Long id) {\n log.debug(\"Request to get Sintoma : {}\", id);\n Sintoma sintoma = sintomaRepository.findOne(id);\n return sintomaMapper.toDto(sintoma);\n }", "public Department getDepartmentById(Integer id);", "public Doctor findById(int id);", "Optional<RequestOtherNiazsanjiDTO> findOne(Long id);", "PersonaDTO PersonaToPersonaDTO(Persona persona);", "@RequestMapping(value = \"/loadQuestionDetails\", method = RequestMethod.POST)\r\n\tpublic @ResponseBody Question loadQuestionDetails(@RequestParam String questionId) {\r\n\t\tQuestion question = new Question();\r\n\t\tif (null != questionId && !questionId.equalsIgnoreCase(\"\")) {\r\n\t\t\tquestion = questionService.getQuestionById(Integer.parseInt(questionId));\r\n\t\t}\r\n\t\treturn question;\r\n\t}", "CustDataNotesResponseDTO getById(String id) throws Exception;", "QuestionOne selectByPrimaryKey(Integer id);", "ProgramFeedBackDTO findOne(Long id);", "@GetMapping(\"/getquestion/{id}\")\n public ResponseEntity<List<Questions>> getQuestion(@PathVariable Long id) {\n\n List<Questions> q = this.userServices.getquetion(id);\n\n if (q.size() <= 0) {\n\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\n }\n\n return ResponseEntity.status(HttpStatus.CREATED).body(q);\n\n }", "public interface ExpertService {\n\n /**\n * Save a expert.\n *\n * @param expert the entity to save\n * @return the persisted entity\n */\n Expert save(Expert expert);\n\n /**\n * Get all the experts.\n *\n * @param pageable the pagination information\n * @return the list of entities\n */\n Page<Expert> findAll(Pageable pageable);\n\n\n /**\n * Get the \"id\" expert.\n *\n * @param id the id of the entity\n * @return the entity\n */\n Optional<Expert> findOne(Long id);\n\n /**\n * Delete the \"id\" expert.\n *\n * @param id the id of the entity\n */\n void delete(Long id);\n}", "VehicleTypeDto findByID(Long idVehicleType);", "D mapToDTO(E entity);", "public UserTO getUser (String id);", "E mapToEntity(D dto);", "StudentDTO toStudentDTO(Student student);", "Question selectByPrimaryKey(String questionId);", "OrderDTO findBy(String id);", "@Transactional(readOnly = true)\n public Optional<SolicitacaoExameDTO> findOne(Long id) {\n log.debug(\"Request to get SolicitacaoExame : {}\", id);\n return solicitacaoExameRepository.findById(id)\n .map(solicitacaoExameMapper::toDto);\n }", "@Override\n public RecipeEntity getRecipeDto(long id)\n {\n return this.load(RecipeEntity.class, id);\n }", "public abstract CarTO findCarById(Long id);", "TicketDTO ticketToTicketDTO(Ticket ticket);", "MVoucherDTO selectByPrimaryKey(String id);", "Optional<ParaUserDTO> findOne(Long id);", "public IBaseDTO getInquiryCardInfo(String id) {\n\t\tOperInquiryCard po=(OperInquiryCard)dao.loadEntity(OperInquiryCard.class, id);\n\t\tIBaseDTO dto = new DynaBeanDTO();\n\t\tdto.set(\"questionType\", po.getDictQuestionType());\n\t\tdto.set(\"question\",po.getQuestion());\n\t\tdto.set(\"alternatives\",po.getAlternatives());\n\t\tdto.set(\"id\",po.getId());\n\t\tdto.set(\"createTime\",TimeUtil.getTheTimeStr(po.getCreateTime(),\"yyyy-MM-dd\"));\n\t\treturn dto;\n\t}", "@GetMapping(value = \"/{id}\")\n public ResponseEntity<TechnicianDTO> findById(@PathVariable Long id) {\n TechnicianDTO objDTO = new TechnicianDTO(technicianService.findById(id));\n return ResponseEntity.ok().body(objDTO);\n }", "@Transactional(readOnly = true) \n public PtoPeriodDTO findOne(Long id) {\n log.debug(\"Request to get PtoPeriod : {}\", id);\n PtoPeriod ptoPeriod = ptoPeriodRepository.findOne(id);\n PtoPeriodDTO ptoPeriodDTO = ptoPeriodMapper.ptoPeriodToPtoPeriodDTO(ptoPeriod);\n return ptoPeriodDTO;\n }", "ClientDTO findOne(final Long id);" ]
[ "0.7791128", "0.7343613", "0.71437603", "0.7070561", "0.6891103", "0.6890419", "0.6792597", "0.6764233", "0.6758476", "0.66875446", "0.6654503", "0.66438127", "0.6636609", "0.66053617", "0.65964216", "0.65602493", "0.653994", "0.65306705", "0.65283686", "0.650335", "0.64897037", "0.64385456", "0.64369845", "0.64313316", "0.64194995", "0.64165956", "0.6415478", "0.6388657", "0.63730514", "0.6369942", "0.6351051", "0.6341206", "0.63410676", "0.6335184", "0.6313071", "0.6312127", "0.63116205", "0.62853944", "0.6279208", "0.6262945", "0.6225107", "0.62166566", "0.6205398", "0.6199875", "0.61978245", "0.6185796", "0.6183112", "0.6179158", "0.6170256", "0.61663413", "0.61525774", "0.6149567", "0.6143044", "0.6129106", "0.6127648", "0.61276466", "0.6125052", "0.6123556", "0.6120892", "0.6112619", "0.6112253", "0.6106053", "0.60962594", "0.6092901", "0.60897183", "0.60888", "0.60852385", "0.6084824", "0.6084132", "0.60796326", "0.6079454", "0.6075539", "0.60731465", "0.60677826", "0.60647917", "0.606444", "0.60607094", "0.60574514", "0.6053533", "0.60510725", "0.60502833", "0.60334426", "0.6021021", "0.60164803", "0.60148466", "0.60112953", "0.6008199", "0.60077393", "0.60077363", "0.6002779", "0.60019624", "0.5998134", "0.5996139", "0.5994037", "0.59919083", "0.59864026", "0.59838104", "0.59787405", "0.5976037", "0.59667283", "0.59605837" ]
0.0
-1
Initialize the row with the given array of pieces. The row is located at the given row index.
public Row(Piece[] pieces, int index) { this.index = index; spaces = new ArrayList<>(); for (int column = 0; column < 8; column++) { spaces.add(new Space(index, column, pieces[column])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Row(int index) {\n this.index=index;\n row = new ArrayList<>(8);\n }", "public Board(int[][] grid, Tetrimino piece) {\n //initComponents();\n this.grid = grid;\n this.piece = piece;\n setLayout(new GridLayout(grid.length-4, grid[0].length));\n init();\n }", "public void initRow(int row){\n ICalculator[] calcs = getRow(row);\n for (int i = 0; i < calcs.length; i++) {\n calcs[i].init();\n }\n }", "private static boolean[] initRow(int rowNumber){\n boolean[] row = new boolean[TOTAL_TILES];\n\n while(rowNumber % TILES_PER_ROW != 0){\n row[rowNumber] = true;\n rowNumber++;\n }\n return row;\n }", "public Row(int rowNumber, int numberOfSeats, boolean wheelchair) {\n this.rowNumber = rowNumber;\n this.numberOfSeats = numberOfSeats;\n this.wheelchair = wheelchair;\n this.seats = new ArrayList<>();\n for(int i = 0; i < numberOfSeats; i++){\n this.seats.add(i, new Seat(Character.toString(alphabet.charAt(i)), null));\n }\n }", "public void setRow(Board board, int[] row, int rowNum) {\n for (int i = 0; i < 9; i++) {\n board.setNum(i, rowNum, row[i]);\n }\n }", "public static Row createRow(String[] rowAsArray, int lineCount) {\n\n\t\t//Row is initialized to null so that we don't get an error if ININC is blank\n\t\t//Row object requires ININC number in constructor\n\t\tRow outputRow = new Row(lineCount);\n\n\t\t//First check if ININC column is empty for current row data\n\t\tif(rowAsArray[11].isEmpty()) {\n\t\t\tGUI.sendError(\"Error: ININC# does not exist for row \"+lineCount+\".\");\n\t\t}\n\t\telse {\n\t\t\t//If not, try to parse what is there\n\t\t\t//It should be a long integer\n\t\t\ttry {\n\t\t\t\toutputRow.setIninc(Long.parseLong(rowAsArray[11]));\n\t\t\t}\n\t\t\tcatch (NumberFormatException e) {\n\t\t\t\t//Otherwise we get an error and this row is set to invalid\n\t\t\t\t//A message is printed informing what the error is and the line in which the error occurred\n\t\t\t\tGUI.sendError(\"Error: ININC# is invalid (not a number) for row \"+lineCount+\".\");\n\t\t\t\toutputRow.setValid(false);\n\t\t\t}\n\t\t}\n\n\n\t\t//try/catch for INPRTY\n\t\t//Any numerical values have to be parsed, which allows for an exception if the String is not numerical\n\t\t//The try/catch statements handle the NumberFormatException that could potentially be thrown\n\t\ttry {\n\t\t\toutputRow.setPriority((int) Double.parseDouble(rowAsArray[0]));\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\t//If there is not a valid number where there should be, print an error and set this row to invalid\n\t\t\t//Data in this row must be corrected in GUI to make it valid again\n\t\t\tGUI.sendError(\"Error: INPRTY is invalid (not a number) for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\n\n\t\t//address block\n\t\t//error handling tbd\n\t\toutputRow.setAddress(rowAsArray[1].trim());\n\n\t\tif(rowAsArray[2] != null) {\n\t\t\toutputRow.setCross(rowAsArray[2].trim());\n\t\t}\n\t\telse {\n\t\t\toutputRow.setCross(\"\");\n\t\t}\n\t\t//end address block\n\n\n\t\t//Date block\n\t\t//DateTimeFormatter is created to specify format that we expect the date/time to be in\n\t\t//This is consistent with what is usually found in the Excel/CSV\n\t\t//If the date/time read from CSV is not able to be read by this formatter, an error will be thrown\n\t\t//And this line of data will not be included\n\t\tDateTimeFormatter dateAndTimeFormatter = DateTimeFormatter.ofPattern(\"M/d/yyyy H:mm[:ss]\");\n\t\ttry {\n\t\t\toutputRow.setDispatch(LocalDateTime.parse(rowAsArray[3].trim(), dateAndTimeFormatter));\n\t\t\toutputRow.setArrive(LocalDateTime.parse(rowAsArray[4].trim(), dateAndTimeFormatter));\n\t\t}\n\t\tcatch (DateTimeParseException e) {\n\t\t\tGUI.sendError(\"Error: could not parse dispatch and/or arrive time for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\n\t\t//See above comments about parsing numbers\n\t\t//This block attempts to parse the RESPONSE variable as a double\n\t\ttry {\n\t\t\toutputRow.setResponseDouble(Double.parseDouble(rowAsArray[5]));\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\tGUI.sendError(\"Error: RESPONSE is invalid (not a number) for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\t\t//If parsing was successful, we can also check that the number parsed is still valid\n\t\t//Response time logically must be at least zero, so any negative response time results in a warning\n\t\t//Warning (as opposed to error) means the row will still be valid, but there is possibly something wrong with the data\n\t\tif(outputRow.getResponseDouble() < 0) {\n\t\t\tGUI.sendInfo(\"Warning: RESPONSE is invalid (less than zero) for row \"+lineCount+\".\");\n\t\t\tGUI.sendInfo(\"This will be overwritten by a manually calculated response time, but still worth noting.\");\n\t\t}\n\n\n\t\toutputRow.setStaffing(rowAsArray[6].trim());\n\t\t//Quick validation check to ensure Staffing is either Volunteer or Career Staffing\n\t\tif(outputRow.getStaffing().toLowerCase().compareTo(\"volunteer\") != 0 && outputRow.getStaffing().toLowerCase().compareTo(\"career staff\") != 0) {\n\t\t\tGUI.sendError(\"Error: Staffing is unexpected value (neither Volunteer nor Career Staffing) for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\n\t\t//The following code ensures that the day of week is a valid day of week\n\t\t//Since is this isn't an entirely essential variable, a warning is thrown if day of week is invalid\n\t\t//Again, the data will still be included, but it does suggest there is an issue with it\n\t\toutputRow.setDay(rowAsArray[7].trim());\n\t\tswitch (outputRow.getDay().toLowerCase()) {\n\t\tcase \"monday\":\n\t\t\tbreak;\n\t\tcase \"tuesday\":\n\t\t\tbreak;\n\t\tcase \"wednesday\":\n\t\t\tbreak;\n\t\tcase \"thursday\":\n\t\t\tbreak;\n\t\tcase \"friday\":\n\t\t\tbreak;\n\t\tcase \"saturday\":\n\t\t\tbreak;\n\t\tcase \"sunday\":\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tGUI.sendError(\"Error: Day of Week is invalid for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t\tbreak;\n\t\t}\n\n\n\t\t//SSA validation moved to row class\n\t\toutputRow.setSsa(rowAsArray[8].trim());\n\n\t\t//Try/catch for district number to ensure data is numerical and avoid error causing crash\n\t\ttry {\n\t\t\toutputRow.setDistrict((int) Double.parseDouble(rowAsArray[9]));\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\tGUI.sendError(\"Error: District number is invalid (not a number) for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\t\t//moved district number validation to row class\n\n\n\t\t//not sure about validation for these\n\t\toutputRow.setInori(rowAsArray[10].trim());\n\t\toutputRow.setInunit(rowAsArray[12].trim());\n\t\toutputRow.setInbdg(rowAsArray[13].trim());\n\t\toutputRow.setInitype(rowAsArray[14].trim());\n\n\n\t\t//INSECT variable is numerical so try/catch to avoid errors\n\t\ttry {\n\t\t\toutputRow.setInsect((int) Double.parseDouble(rowAsArray[15]));\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\tGUI.sendError(\"Error: INSECT is invalid (not a number) for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\n\n\t\t//see above comments on numerical variables\n\t\ttry {\n\t\t\toutputRow.setCadinc(Long.parseLong(rowAsArray[16]));\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\tGUI.sendError(\"Error: CAD_INC is invalid (not a number) for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\n\n\t\t//Service_type should be either FIRE or EMS\n\t\t//We can check this easily, if it is neither than throw an error and skip this row of data\n\t\t//Subject to change \n\t\tif(rowAsArray[17].compareTo(\"FIRE\") == 0) {\n\t\t\toutputRow.setServiceType(ServiceType.FIRE);\n\t\t}\n\t\telse if (rowAsArray[17].compareTo(\"EMS\") == 0) {\n\t\t\toutputRow.setServiceType(ServiceType.EMS);\n\t\t}\n\t\telse {\n\t\t\tGUI.sendError(\"Error: SERVICE_TYPE is invalid for row \"+lineCount+\".\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\n\t\toutputRow.setFua(rowAsArray[18].trim());\n\n\n\t\tif(outputRow.getDispatchTime() != null && outputRow.getArriveTime() != null) {\n\t\t\t//for calculating response time\n\t\t\t//first calculates total number of minutes between dispatch and arrive\n\t\t\tint responseTimeMinutesValue = (int) ChronoUnit.MINUTES.between(outputRow.getDispatchTime(), outputRow.getArriveTime());\n\t\t\tint responseTimeHoursValue = 0;\n\t\t\t//If minutes is 60 or greater, than response time is over an hour, so we have to account for that\n\t\t\twhile(responseTimeMinutesValue > 59) {\n\t\t\t\tresponseTimeMinutesValue -= 60;\n\t\t\t\tresponseTimeHoursValue++;\n\t\t\t}\n\t\t\t//Once hours and minutes are calculated, move on to seconds\n\t\t\tint responseTimeSecondsValue = (int) ChronoUnit.SECONDS.between(outputRow.getDispatchTime(), outputRow.getArriveTime());\n\t\t\t//Here we check to ensure that DISPATCH comes before ARRIVE, otherwise throw an error since we have a time traveler on our hands\n\t\t\tif(responseTimeSecondsValue < 0) {\n\t\t\t\tGUI.sendError(\"Error: Response time less than zero (calculated from Dispatch and Arrive) for row \"+lineCount+\".\");\t\n\t\t\t\toutputRow.setValid(false);\n\t\t\t}\n\t\t\t//Assuming that check passes, we can finalize the value of the seconds variable by calculating it modulo 60\n\t\t\tresponseTimeSecondsValue = responseTimeSecondsValue%60;\n\n\t\t\t//now make sure hours is 23 or less\n\t\t\tif(responseTimeHoursValue > 23) {\n\t\t\t\tresponseTimeHoursValue = 23;\n\t\t\t\tGUI.sendError(\"Error: Response time exceeds 1 day for row \"+lineCount+\". Response time value in table may not be accurate; check Dispatch and Arrival times.\");\n\t\t\t}\n\t\t\t//Then use the calculated variables for hours, minutes, and seconds to create the responseTime variable\n\t\t\tLocalTime responseTime = LocalTime.of(responseTimeHoursValue, responseTimeMinutesValue, responseTimeSecondsValue);\n\t\t\toutputRow.setResponseTime(responseTime);\n\t\t}\n\t\telse {\n\t\t\tGUI.sendError(\"Error: Dispatch and/or Response time are null for row \"+lineCount+\", so response time could not be calculated.\");\n\t\t\toutputRow.setValid(false);\n\t\t}\n\t\t//Now that all of the data has been imported into the Row object, return the Row object so it can be added to ArrayList\n\t\treturn outputRow;\n\t}", "private Board(int[][] array)\n\t{\n\t\tcols = 0;\n\t\trows = array.length;\n\t\tif (rows > 0)\n\t\t\tcols = array[0].length;\n\t\t\n\t\tpieces = new int[rows][cols];\n\t\tif (pieces.length > 0)\n\t\t{\n\t\t\tfor (int i = 0; i < pieces.length; i++)\n\t\t\t\tfor (int j = 0; j < pieces[0].length; j++)\n\t\t\t\t\tpieces[i][j] = array[i][j];\n\t\t}\n\t}", "public Piece(int a_row, int a_col)\n {\n this.tileLocation = Pair.create(a_row,a_col);\n }", "private void generateRows() {\n\t\tfor (int i=0; i<squares.length; i++) {\n\t\t\trows[i]=new Row(squares[i]);\n\t\t}\n\t}", "public Classroom(int rowNum, int columnNum) {\r\n this.arrangement = new Student[rowNum][columnNum];\r\n\r\n //Initialize the seats to the default name \"bar/foo\"\r\n for (int i = 0; i < rowNum; i++) {\r\n for (int j = 0; j < columnNum; j++) {\r\n this.arrangement[i][j] = new Student(\"bar/foo\");\r\n }\r\n }\r\n }", "public void init(int rows, int columns){\n\n\t\tblock = new String[rows][columns];\n\n\t\tfor (int i = 0; i < rows; i++) {\n\t\t\tfor (int j = 0; j < columns; j++) {\n\t\t\t\tblock[i][j] = \".\";\n\t\t\t}\n\t\t}\n\t}", "public Row(int width) {\n data = new Object[width];\n }", "public void startField(int v[]) { \n\t\tfor (int i = 0; i < getRows(); i++) {\n\t\t\tfor (int j = 0; j < getColumns(); j++) {\n\t\t\t\tcells[i][j] = new Square(i, j, v[getRows()*i+j]); \n\t\t\t}\n\t\t} \n\t}", "public Tile(int row, int column, Piece piece) {\n this.row = row;\n this.column = column;\n this.piece = piece;\n this.setBorder(javax.swing.BorderFactory.createEmptyBorder());\n }", "public static void initialiseGameBoard(){\n\n for ( int row = 0 ; row < 6 ; row++ ){\n for ( int column = 0 ; column < 7 ; column++ ){\n gameBoard[row][column] = \"-\";\n }\n }\n }", "public Battleship(int row, int N){\r\n\t\tisDestroyed = false;\r\n\t\t\r\n\t\tparts = new ArrayList<Part>();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tparts.add(new Part(row, i));\r\n\t\t}\r\n\t}", "public Tile(int row, int column){\n this.row = row;\n this.column = column;\n this.piece = null;\n }", "public Board(ArrayList<Piece> pieces)\n {\n squares = new Square[Chess.ROWS][Chess.COLUMNS];\n setLayout(new GridLayout(Chess.ROWS,Chess.COLUMNS,0,0));\n firstSelected = null;\n mainBoard=true;\n turn = 0;\n fiftyMove = 0;\n for (int i = 0; i < Chess.ROWS; i++)\n for (int j = 0; j < Chess.COLUMNS; j++)\n {\n squares[i][j] = new Square(i,j,this);\n for (Piece p: pieces)\n if (p.getOrigin().equals(new Location(i,j)))\n squares[i][j].setPiece(p);\n add(squares[i][j]);\n }\n positions = new ArrayList<>();\n positions.add(toString());\n }", "Board(Piece[][] initialContents, Piece turn) {\n initialize(initialContents, turn);\n }", "protected void setUp(int slices, int rows, int columns) {\n\tsetUp(slices,rows,columns,0,0,0,rows*columns,columns,1);\n}", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public void initFirstXRows(int rowCount){\n for(int i= 0; i < rowCount; i++){\n initRow(i);\n }\n }", "public Row(TableBase table, Object[] data) {\n this.table = table;\n this.rowData = data;\n }", "public void initialize_it(){\n\t\treadScoreFromFile();\n\t\twell = new Color[14][25];\n\t\tfor(int i = 0; i < well.length; i++){\n\t\t\tfor(int j = 0; j < well[0].length; j++){\n\t\t\t\tif(i == 0 || i == well.length-1 || j == well[0].length - 1)\n\t\t\t\t\twell[i][j] = Color.GRAY;\n\t\t\t\telse\n\t\t\t\t\twell[i][j] = Color.WHITE;\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0; i < next_pieces_array.length; i++){\n\t\t\tfor(int j = 0; j<next_pieces_array[0].length; j++){\n\t\t\t\t\tnext_pieces_array[i][j] = Color.WHITE;\n\t\t\t}\n\t\t}\n\t\tscore = 0;\n\t\tgetNewPiece();\n\t\tsetNewPiece();\n\t\tgetNewPiece();\n\t}", "public Row(String pegstring){\n\t\titems = new ArrayList<Peg>();\n\t\t//parse row string, create peg object and add to items array\n\t\tfor (int i = 0; i < pegstring.length();i++){\n\n\t\t\titems.add(new Peg(pegstring.charAt(i)));\n\n\t\t}// end for\n\n\t}", "private void createPieces() {\n\t\t// Create and fill up the array, iterating by piece row and piece column.\n\t\tpieces = new ArrayList<CvMat>();\n\t\tfor (int pi = 0; pi < prows; pi++) {\n\t\t\tfor (int pj = 0; pj < pcols; pj++) {\n\t\t\t\tCvMat piece = CvMat.create(pieceHeight, pieceWidth, image.type());\n\t\t\t\tpieces.add(piece);\n\t\t\t\t// Copy pixels from image to piece (as usual, do it by hand rather than OpenCV).\n\t\t\t\tfor (int i = 0; i < pieceHeight; i++) {\n\t\t\t\t\tfor (int j = 0; j < pieceWidth; j++) {\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\t\tpiece.put(i, j, c, image.get(i + pi * pieceHeight, j + pj * pieceWidth, c));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public final void setRow(int row, float x, float y, float z) {\n\tif (row == 0) {\n\t m00 = x;\n\t m01 = y;\n\t m02 = z;\n\t} else if (row == 1) {\n\t m10 = x;\n\t m11 = y;\n\t m12 = z;\n\t} else if (row == 2) {\n\t m20 = x;\n\t m21 = y;\n\t m22 = z;\n\t} else {\n\t throw new ArrayIndexOutOfBoundsException(\"row must be 0 to 2 and is \" + row);\n\t}\n }", "public final void setRow(int row, float v[]) {\n\tif (row == 0) {\n\t m00 = v[0];\n\t m01 = v[1];\n\t m02 = v[2];\n\t} else if (row == 1) {\n\t m10 = v[0];\n\t m11 = v[1];\n\t m12 = v[2];\n\t} else if (row == 2) {\n\t m20 = v[0];\n\t m21 = v[1];\n\t m22 = v[2];\n\t} else {\n\t throw new ArrayIndexOutOfBoundsException(\"row must be 0 to 2 and is \" + row);\n\t}\n }", "public OthelloBoard (int height, int width){\n super(height, width);\n m_Pieces = new OthelloPiece[WIDTH][HEIGHT];\n m_PieceCount+=4;\n \n }", "public void initFromRows(String filename) throws IOException {\n long numLines = Util.getNumLinesOfFile(filename);\n if (numLines != this.numRows) {\n throw new IllegalStateException(\n String.format(\"Rows file has %d lines, expecting %d\", numLines, this.numRows)\n );\n }\n\n // Read from file\n BufferedReader br = new BufferedReader(new FileReader(filename));\n initFromRows(new FileLineIterator(br));\n br.close();\n }", "private Row(byte[] data)\n\t\t{\n\t\t\tArrayList<Byte> al = new ArrayList<Byte>(data.length);\n\t\t\tfor(byte b: data)\n\t\t\t\tal.add(b);\n\t\t\tObservableList<Byte> ol = FXCollections.observableArrayList(al);\n\t\t\tsetColumns(new SimpleListProperty<Byte>(ol));\n\t\t}", "private void fillFirstRow() {\n\t\tputBeeper();\n\t\tputEveryOtherBeeper();\t\t\n\t}", "public void initialize(){ \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tfor (int j=0; j<3; j++){\r\n\t\t\t\tboard [i][j] = '-';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "Row createRow();", "private void _initialize(long[][] value, int copy) {\n\t\t_rowCount = value.length;\n\t\t_columnCount = value[0].length;\n\t\t_value = LongMatrixMath.fromMatrixToArray(value);\n\t}", "public final void setRow(int row, Vector3f v) {\n\tif (row == 0) {\n\t m00 = v.x;\n\t m01 = v.y;\n\t m02 = v.z;\n\t} else if (row == 1) {\n\t m10 = v.x;\n\t m11 = v.y;\n\t m12 = v.z;\n\t} else if (row == 2) {\n\t m20 = v.x;\n\t m21 = v.y;\n\t m22 = v.z;\n\t} else {\n\t throw new ArrayIndexOutOfBoundsException(\"row must be 0 to 2 and is \" + row);\n\t}\n }", "private GamePiece[][] initBoard(int rows, int cols, Random rand) {\n gameBoard = new GamePiece[rows][cols];\n curPlayerRow = 0;\n curPlayerCol = 0;\n for(int i = 0; i < rows; i++){\n for(int j = 0; j < cols; j++){\n gameBoard[i][j] = new EmptyPiece();\n }\n }\n gameBoard[0][0] = new PlayerPiece(INIT_PLAYER_POINTS);\n curTrollRow = getRandTrollRow(rand, rows);\n curTrollCol = getRandTrollCol(rand, cols);\n while(curTrollRow == 7 && curTrollCol == 9){\n curTrollRow = getRandTrollRow(rand, rows);\n curTrollCol = getRandTrollCol(rand, cols);\n }\n gameBoard[curTrollRow][curTrollCol] = new TrollPiece();\n gameBoard[7][9] = new TreasurePiece(TREASURE_POINTS);\n return gameBoard;\n }", "public void setRow(int row)\n\t{\n\t\tthis.row = row;\n\t}", "public void setRow(int row)\n\t{\n\t\tthis.row = row;\n\t}", "private void createBoardRow(int row, int startState, int endState) {\n\t\tLog.d(LOG_TAG, String.format(\"Create board row %s with start state: %s and end state: %s\",row,startState,endState));\n\t\tBoardSquareInfo[][] squares = getBoardGame();\n\t\t\n\t\tfor(int col=0; col<COLUMNS; col++) {\n\t\t\tint id = row*COLUMNS+col;\n\t\t\tint state = (col%2 == 0)? startState: endState;\n\t\t\tint chip = (state == PLAYER1_STATE || state == PLAYER2_STATE)? PAWN_CHIP: EMPTY_CHIP;\n\t\t\t\n\t\t\tsquares[row][col] = new BoardSquareInfo(id,row,col,state,chip);\n\t\t}\n\t}", "public Builder setRows(\n int index, String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureRowsIsMutable();\n rows_.set(index, value);\n onChanged();\n return this;\n }", "private void initGameBoard(int rows, int cols)\n {\n //GameBoard = new Cell[ROWS][COLS];\n\n for(int i = 0; i < rows; i++)\n {\n for(int j = 0; j < cols; j++)\n {\n GameBoard[i][j] = new Cell(i,j, Color.BLUE,false);\n }\n\n }\n }", "public void setRow(int row) {\n\t\tthis.row = row; \n\t}", "public void setRow(int i) {\n\t\tif (row != Integer.MIN_VALUE) explicitRow = true; \n\t\trow = i;\t\t\n\t}", "public void addRow(int[] row) {\n board[counter] = row;\n counter += 1;\n if (counter == 9) {\n startingBoard = copyBoard();\n }\n }", "public void seatsInitialisation(int numOfRows ,int numOfColumns){\n this.numOfRows = numOfColumns;\n this.numOfColumns = numOfColumns;\n this.occupancy = (this.numOfRows * this.numOfColumns);\n seats = new Seats[numOfRows][numOfColumns];\n for(int i=0; i<numOfRows; i++) {\n for (int j = 0; j <numOfColumns; j++) {\n seats[i][j] = new Seats(i, j, SeatStatus.AVAILABLE);\n }\n\n }\n }", "public TrapCell(int index){\n super(index);\n }", "private void setGridElement (int row, int column, Player player)\n {\n mGrid[row][column] = new Move(player, row, column);\n }", "public void setRow(int row) {\n\t\tthis.row = row;\n\t}", "public void setRow(int row) {\n\t\tthis.row = row;\n\t}", "public GameBoard(PlayerPiece[] playerPieces, Position[] playerPiecePositions,\n FloorTile[] fixedTiles, Position[] fixedTilePositions,\n FloorTile[] tiles, int nCols, int nRows, String name) {\n this.playerPieces = playerPieces;\n this.playerPiecePositions = playerPiecePositions;\n this.name = name;\n this.nRows = nRows;\n this.nCols = nCols;\n this.board = new FloorTile[nRows][nCols];\n\n insertTilesAtPositions(fixedTiles, fixedTilePositions);\n insertTiles(tiles);\n }", "public void setRow(int row) {\n\t\t\tif (row > 0)\n\t\t\t\tthis.row = row;\n\t\t}", "public GameBoard(PlayerPiece[] playerPieces, Position[] playerPiecePositions,\n FloorTile[] tiles, int nCols, int nRows, String name) {\n this.playerPieces = playerPieces;\n this.playerPiecePositions = playerPiecePositions;\n this.name = name;\n this.nRows = nRows;\n this.nCols = nCols;\n this.board = new FloorTile[nRows][nCols];\n\n insertTiles(tiles);\n }", "Board (boolean[][] board, List<Piece> pieces) {\n\n this.board = board;\n unusedPieces = new ArrayList<>(pieces);\n List<Piece> possiblePieces = new ArrayList<>(pieces);\n tessellate(possiblePieces.get(0));\n }", "public TicTacToeBoard() {board = new int[rows][columns];}", "public Pieces(int row, int column, PieceType piece, PieceColor color){\r\n\t\tthis.piece = piece;\r\n\t\tthis.row = row;\r\n\t\tthis.column = column;\r\n\t\tthis.color = color;\r\n\t\tthis.moved = false;\r\n\t}", "public ColumnRow ()\r\n {\r\n super();\r\n }", "protected void populateDynamicCells(int resultsRow) {\n }", "public void setRow(int row) {\n setRowAndColumn(row, column);\n }", "public Board()\n\t{\n\t\tcols = DEFAULT_WIDTH;\n\t\trows = DEFAULT_HEIGHT;\n\t\t\n\t\tpieces = new int[rows][cols];\n\t\tif (pieces.length > 0)\n\t\t{\n\t\t\tfor (int i = 0; i < pieces.length; i++)\n\t\t\t\tfor (int j = 0; j < pieces[0].length; j++)\n\t\t\t\t\tpieces[i][j] = -1;\n\t\t}\n\t}", "void initialize(Piece[][] contents, Piece side) {\n _moves.clear();\n for (int r = 1; r <= M; r += 1) {\n for (int c = 1; c <= M; c += 1) {\n set(c, r, contents[r - 1][c - 1]);\n }\n }\n _turn = side;\n }", "public Cell(int row, int column){\r\n this.row = row;\r\n this.column = column;\r\n }", "public Board() {\n\n for(int row = 0; row < size; row++) {\n for(int col = 0; col < size; col++) {\n\n grid[row][col] = \"-\";\n\n }\n }\n\n }", "public Cell(int col, int row){ // constructor\n this.col = col;\n this.row = row;\n }", "public Battleship(int row) {\r\n\t\tthis(row, 5);\r\n\t}", "public TableRow(DocumentElement... elements){\n\t\tthis();\n\t\tfor(DocumentElement e : elements){\n\t\t\tcells.add(new TableCell(e));\n\t\t}\n\t}", "public Board(List<Piece> pieceList)\n\t{\n\t\tCoordinate aux = new Coordinate();\n\t\t\n\t\tfor (int x = 0; x < board_size; x++)\n\t\t{\n\t\t\tfor (int y = 0; y < board_size; y++)\n\t\t\t{\n\t\t\t\taux.set(x, y);\n\t\t\t\tsetPiece(null, aux);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (Piece piece : pieceList) {setPiece(piece, piece.getCoord());}\n\t}", "private void initialize() {\r\n\t\tfor (int i = -1; i < myRows; i++)\r\n\t\t\tfor (int j = -1; j < myColumns; j++) {\r\n\t\t\t\tCell.CellToken cellToken = new Cell.CellToken(j, i);\r\n\r\n\t\t\t\tif (i == -1) {\r\n\t\t\t\t\tif (j == -1)\r\n\t\t\t\t\t\tadd(new JLabel(\"\", null, SwingConstants.CENTER));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tadd(new JLabel(cellToken.columnString(), null,\r\n\t\t\t\t\t\t\t\tSwingConstants.CENTER));\r\n\t\t\t\t} else if (j == -1)\r\n\t\t\t\t\tadd(new JLabel(Integer.toString(i), null,\r\n\t\t\t\t\t\t\tSwingConstants.CENTER));\r\n\t\t\t\telse {\r\n\t\t\t\t\tcellArray[i][j] = new CellsGUI(cellToken);\r\n\r\n\t\t\t\t\tsetCellText(cellArray[i][j]);\r\n\t\t\t\t\tcellArray[i][j].addMouseListener(new MouseCellListener());\r\n\t\t\t\t\tcellArray[i][j].addKeyListener(new KeyCellListener());\r\n\t\t\t\t\tcellArray[i][j].addFocusListener(new FocusCellListener());\r\n\r\n\t\t\t\t\tadd(cellArray[i][j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}", "public abstract void initCell(\r\n int row,\r\n int col,\r\n double valueToInitialise);", "private void init() {\r\n\t\tint linePos = this.playBoard.length / 2;\r\n\t\tint columnPos = this.playBoard[0].length / 2;\r\n\t\tfor (int i = 0; i < playBoard.length; i++) {\r\n\t\t\tfor (int j = 0; j < playBoard[0].length; j++) {\r\n\t\t\t\tplayBoard[i][j] = '-';\r\n\t\t\t}\r\n\t\t}\r\n\t\tplayBoard[linePos - 1][columnPos - 1] = 'W';\r\n\t\tplayBoard[linePos - 1][columnPos] = 'B';\r\n\t\tplayBoard[linePos][columnPos] = 'W';\r\n\t\tplayBoard[linePos][columnPos - 1] = 'B';\r\n\t}", "Rows createRows();", "public Board() {\n //Create all pieces\n board[0][0] = new Rook(\"black\", 0, 0);\n board[0][1] = new Knight(\"black\", 0, 1);\n board[0][2] = new Bishop(\"black\", 0, 2);\n board[0][3] = new Queen(\"black\", 0, 3);\n board[0][4] = new King(\"black\", 0, 4);\n board[0][5] = new Bishop(\"black\", 0, 5);\n board[0][6] = new Knight(\"black\", 0, 6);\n board[0][7] = new Rook(\"black\", 0, 7);\n\n board[7][0] = new Rook(\"white\", 7, 0);\n board[7][1] = new Knight(\"white\", 7, 1);\n board[7][2] = new Bishop(\"white\", 7, 2);\n board[7][3] = new Queen(\"white\", 7, 3);\n board[7][4] = new King(\"white\", 7, 4);\n board[7][5] = new Bishop(\"white\", 7, 5);\n board[7][6] = new Knight(\"white\", 7, 6);\n board[7][7] = new Rook(\"white\", 7, 7);\n\n for (int j = 0; j < 8; j++) {\n board[1][j] = new Pawn(\"black\", 1, j);\n board[6][j] = new Pawn(\"white\", 6, j);\n }\n\n //Printing everything\n for (Piece[] a : board) {\n for (Piece b : a) {\n System.out.printf(\"%-15s\", \"[\" + b + \"]\");\n }\n System.out.println(\"\");\n }\n }", "public void setRow(int value) {\n this.row = value;\n }", "private void initializeBoard() {\n\n squares = new Square[8][8];\n\n // Sets the initial turn to the White Player\n turn = white;\n\n final int maxSquares = 8;\n for(int i = 0; i < maxSquares; i ++) {\n for (int j = 0; j < maxSquares; j ++) {\n\n Square square = new Square(j, i);\n Piece piece;\n Player player;\n\n if (i < 2) {\n player = black;\n } else {\n player = white;\n }\n\n if (i == 0 || i == 7) {\n switch(j) {\n case 3:\n piece = new Queen(player, square);\n break;\n case 4:\n piece = new King(player, square);\n break;\n case 2:\n case 5:\n piece = new Bishop(player, square);\n break;\n case 1:\n case 6:\n piece = new Knight(player, square);\n break;\n default:\n piece = new Rook(player, square);\n }\n square.setPiece(piece);\n } else if (i == 1 || i == 6) {\n piece = new Pawn(player, square);\n square.setPiece(piece);\n }\n squares[j][i] = square;\n }\n }\n }", "public void initFromRows(SimpleIterator<String> lines) {\n this.reset();\n int rowId = 0;\n Optional<String> lineOpt;\n Int2ObjectMap<IntArrayList> colsMap = new Int2ObjectOpenHashMap<>();\n int maxColId = -1;\n while (true) {\n lineOpt = lines.next();\n if (!lineOpt.isPresent()) {\n break;\n } else {\n String line = lineOpt.get().trim();\n if (!line.isEmpty()) {\n String[] tokens = line.split(\"\\\\s+\");\n int[] row = new int[tokens.length];\n for (int i = 0; i < tokens.length; i++) {\n int colId = Integer.parseInt(tokens[i]) - 1; // convert to 0-based\n if (colId < 0) {\n throw new RuntimeException(\n String.format(\n \"Column %d smaller than 1, in line number %d, line:'%s'\",\n colId + 1, rowId + 1, line\n )\n );\n }\n row[i] = colId;\n if (!colsMap.containsKey(colId)) {\n colsMap.put(colId, new IntArrayList());\n }\n colsMap.get(colId).add(rowId);\n if (colId > maxColId) {\n maxColId = colId;\n }\n }\n Arrays.sort(row);\n this.rows[rowId] = row;\n }\n rowId++;\n if (rowId > this.numRows) {\n throw new RuntimeException(\n \"More rows in input rows file than the expected \" + this.numRows\n );\n }\n }\n }\n if (maxColId > this.numCols) {\n this.numCols = maxColId + 1;\n this.cols = new IntSet[this.numCols];\n }\n for (int colId = 0; colId < this.numCols; colId++) {\n if (colsMap.containsKey(colId) && !colsMap.get(colId).isEmpty()) {\n this.cols[colId] = new IntOpenHashSet(colsMap.get(colId));\n } else {\n this.cols[colId] = new IntOpenHashSet();\n }\n }\n }", "Piece(int row, int col, int player) {\n this(row, col);\n if (player == 0 || player == 1)\n this.player = player;\n }", "public void constructArray(){\n\t\tfor (int col = 0; col < cols; col++){\n\t\t\tfor (int row = 0; row < rows; row++){\n\t\t\t\tmap[col][row] = new Pixel();\n\t\t\t}\n\t\t}\n\t}", "public final void getRow(int row, float v[]) {\n\tif (row == 0) {\n\t v[0] = m00;\n\t v[1] = m01;\n\t v[2] = m02;\n\t} else if (row == 1) {\n\t v[0] = m10;\n\t v[1] = m11;\n\t v[2] = m12;\n\t} else if (row == 2) {\n\t v[0] = m20;\n\t v[1] = m21;\n\t v[2] = m22;\n\t} else {\n\t throw new ArrayIndexOutOfBoundsException(\"row must be 0 to 2 and is \" + row);\n\t}\n }", "public void setRow(int newRow) {\n this.row = newRow;\n }", "public void initializeBoard() {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tthis.board[i] = \"-\";\n\n\t\t}\n\n\t}", "public void initChessBoardAutomaticly() {\r\n\t\tthis.initPieces();\r\n\t\tthis.clearBoard();\r\n\t\tfor (int i=0; i<board.size(); i++) {\r\n\t\t\tChessBoardBlock b = board.get(order[i]);\r\n\t\t\tb.setBorderPainted(false);\r\n\t\t}\r\n\t\tfor (int i = 0, w = 0, b = 0, s = 0; i < 8 * 8; i++) {\r\n\r\n\t\t\t// Assign1, Disable board clickable\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setEnabled(false);\r\n\r\n\t\t\t// Assign1, Put black pieces and record the position\r\n\t\t\tif (i % 2 != 1 && i >= 8 && i < 16) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t} else if (i % 2 != 0 && (i < 8 || (i > 16 && i < 24))) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Assign1, Put white pieces and record the position\r\n\t\t\telse if (i % 2 != 0 && i > 48 && i < 56) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t} else if (i % 2 != 1\r\n\t\t\t\t\t&& ((i >= 40 && i < 48) || (i >= 56 && i < 64))) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\t\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t}\r\n\r\n\t\t\t// Assign1, Put empty pieces on the board\r\n\t\t\t// Actually, empty pieces will not display on the board, they are\r\n\t\t\t// not existing\r\n\t\t\t// to chess players, just for calculation\r\n\t\t\telse {\r\n\t\t\t\tChessPiece spacePiece = spacePieces[s];\r\n\t\t\t\tspacePiece.position = order[i];\r\n\t\t\t\tbody.add(spacePiece);\r\n\t\t\t\tpiece.put(order[i], spacePiece);\r\n\t\t\t\tspacePiece.setVisible(false);\r\n\t\t\t\ts++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.setText(\"Chess Board has been initialized automatically\");\r\n\t\tthis.startGame();\r\n\t}", "private void populate ()\n\t{\n\t\t//create a random object\n\t\tRandom rand = new Random(); \n\t\t//for loop for row\n\t\tfor (int row =0; row < currentVersion.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor(int column = 0; column < currentVersion[row].length; column++)\n\t\t\t{\n\t\t\t\t//assign byte values from [0 to state-1] into array\n\t\t\t\tcurrentVersion[row][column] = (byte) rand.nextInt((this.state-1));\n\t\t\t}\n\t\t}\n\t}", "void fill(Row row) {\n if (row == null) return;\n for (Column column : getColumns()) {\n String name = column.getName();\n Object value = row.get(name);\n Classes.setFieldValue(this, name, value);\n }\n }", "public abstract Piece setLocation(int row, int column);", "private Board(Piece[][] initialContents, Side player) {\n assert player != null && initialContents.length == 8;\n Piece p;\n for (int i = 0; i < 8; i++) {\n for(int j = 0; j < 8; j++) {\n p = initialContents[i][j];\n if (p.side() != null) {\n if (p.side() == BLACK) {\n _countBlack += 1;\n } else {\n _countWhite += 1;\n }\n addPiece(j + 1, i + 1);\n }\n _pieces[i][j] = p\n }\n }\n _turn = player;\n }", "@Override\n public void initializeBoard(int r, int c) {\n\n grid = new Tile[HEIGHT][WIDTH];\n\n for (int row = 0; row < grid.length; row++) {\n for (int col = 0; col < grid[0].length; col++) {\n grid[row][col] = new Tile(Tile.BLANK, row, col);\n }\n }\n\n Random random = new Random();\n for (int i = 0; i < numMines; i++) {\n int row = random.nextInt(HEIGHT);\n int col = random.nextInt(WIDTH);\n if ((row == r && col == c) || grid[row][col].getType() == Tile.MINE || grid[row][col].getType() == Tile.NUMBER) {\n i--;\n } else {\n grid[row][col] = new Tile(Tile.MINE, row, col);\n }\n }\n\n for (int row = 0; row < grid.length; row++) {\n for (int col = 0; col < grid[0].length; col++) {\n if (getNumNeighboringMines(row, col) > 0 && grid[row][col].getType() != Tile.MINE) {\n Tile tile = new Tile(Tile.NUMBER, getNumNeighboringMines(row, col), row, col);\n grid[row][col] = tile;\n }\n }\n }\n }", "public Grid(int[] intBoard)\n\t{\n\t\tfor (int x =0;x<=8;x++)\n\t\t\tthis.grid[x]= intBoard[x];\n\t}", "public static void initialize()\n {\n\n for(int i = 0; i < cellViewList.size(); i++)\n cellList.add(new Cell(cellViewList.get(i).getId()));\n for (int i = 76; i < 92; i++)\n {\n if (i < 80)\n {\n cellList.get(i).setChess(PlayerController.getPlayer(0).getChess(i-76));\n }\n else if (i < 84)\n {\n cellList.get(i).setChess(PlayerController.getPlayer(1).getChess(i-80));\n }\n else if (i < 88)\n {\n cellList.get(i).setChess(PlayerController.getPlayer(2).getChess(i-84));\n }\n else\n {\n cellList.get(i).setChess(PlayerController.getPlayer(3).getChess(i-88));\n }\n }\n }", "public PlayField() {\n cells = new Block[24][10];\n }", "public Grid(int rows, int cols, String[] vals)\r\n\t{\r\n\t}", "public void aiInitBoard(){\n for(int i = 0; i < boardSize; i++) {\n for (int j = 0; j < boardSize; j++) {\n board[i][j] = 'O';\n }\n }\n }", "public void initialize() {\n\t\t// set seed, if defined\n\t\tif (randomSeed > Integer.MIN_VALUE) {\n\t\t\tapp.randomSeed(randomSeed);\n\t\t}\n\n\t\tfor (int x = 0; x < gridX; x++) {\n\t\t\tfor (int y = 0; y < gridY; y++) {\n\t\t\t\tCell c = new Cell(\n\t\t\t\t\tapp,\n\t\t\t\t\tcellSize,\n\t\t\t\t\tcolors[(int)app.random(colors.length)],\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\tc.position = PVector.add(offset, new PVector(x * cellSize, y * cellSize));\n\t\t\t\tcells[x + (y * gridX)] = c;\n\t\t\t\tnewCells[x + (y * gridX)] = c;\n\t\t\t}\n\t\t}\n\t}", "public Table() {\n // <editor-fold desc=\"Initialize Cells\" defaultstate=\"collapsed\">\n for (int row = 0; row < 3; row++) {\n for (int column = 0; column < 3; column++) {\n if (cells[row][column] == null) {\n cells[row][column] = new Cell(row, column);\n }\n }\n }\n // </editor-fold>\n }", "public void setLoadedSongRow(int row) {\n this.loadedSongRow = row;\n }", "private Row() {\n }", "private void initObjects()\n {\n //creating a new board of 8x8 array \n board = new Disc[Constants.ROWS][Constants.COLUMNS];\n //loops through and creates all empty discs to be filled\n for(int row = 0; row < Constants.ROWS; row++)\n {\n for(int col = 0; col < Constants.COLUMNS; col++)\n {\n board[row][col] = new Disc();\n }\n }\n//initial board setup \n board[3][3].setDisColor(Constants.LIGHT);\n board[3][4].setDisColor(Constants.DARK);\n board[4][3].setDisColor(Constants.DARK);\n board[4][4].setDisColor(Constants.LIGHT);\n \n }", "public Board(char[][] board) {\n this.boardWidth = board.length;\n this.boardHeight = board[0].length;\n this.board = board;\n this.numShips = 0;\n boardInit();\n }", "public TableRow(TableCell... cells) throws NullPointerException {\n\t\tthis.cells = Arrays.asList(cells);\n\t}", "public Molecule(final String[] rows){\n relMin = null;\n actor = null;\n chkArr = new int[rows.length][rows[0].length()];\n atomInPlace = new boolean[rows.length][rows[0].length()];\n offsetX = 9999;\n offsetY = 9999;\n x0 = 0;\n for(int i = 0; i < rows.length; i++){\n for(int j = 0; j < rows[0].length(); j++){\n if(rows[i].charAt(j) == '.'){\n atomInPlace[i][j] = true;\n chkArr[i][j] = 0;\n }else {\n atomInPlace[i][j] = false;\n chkArr[i][j] = Integer.parseInt(String.valueOf(rows[i].charAt(j)));\n }\n }\n }\n }" ]
[ "0.64817935", "0.5876861", "0.5753828", "0.5723619", "0.5678148", "0.56495315", "0.564649", "0.5635651", "0.55914485", "0.55208313", "0.54893404", "0.5488868", "0.54410934", "0.5427122", "0.54034376", "0.53892094", "0.5378247", "0.5377157", "0.5355166", "0.53297186", "0.53048015", "0.5296611", "0.52950186", "0.52903336", "0.52882457", "0.5286361", "0.5281241", "0.5265287", "0.5257999", "0.5257872", "0.52502984", "0.5226215", "0.5222427", "0.52197564", "0.52123475", "0.5204891", "0.5178121", "0.51631004", "0.51484424", "0.51484424", "0.51395595", "0.51390076", "0.5133938", "0.51338315", "0.51068664", "0.5104314", "0.5088484", "0.5087973", "0.50835204", "0.5076358", "0.5076358", "0.5053521", "0.5052555", "0.50457495", "0.5045459", "0.5043387", "0.50418", "0.50387675", "0.5030549", "0.502765", "0.50276375", "0.5024878", "0.5022189", "0.50191444", "0.5018956", "0.50088423", "0.50050896", "0.5005039", "0.50033987", "0.49997458", "0.49850547", "0.4982799", "0.49789968", "0.4958227", "0.49463877", "0.49448818", "0.49408624", "0.49381766", "0.49377972", "0.49320984", "0.4930324", "0.49288282", "0.49248296", "0.4913954", "0.4911828", "0.49095988", "0.4905246", "0.4901911", "0.48976052", "0.48972195", "0.4894221", "0.48930907", "0.48913622", "0.4889427", "0.48782778", "0.4873142", "0.48643225", "0.48635668", "0.48586652", "0.48568583" ]
0.7682281
0
Returns the row index of this row.
public int getIndex() { return index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getRowNo() {\n return rowIndex+1;\n }", "public int getRowNumber()\r\n\t{\r\n\t\treturn this.rowNumber;\r\n\t}", "public int getRowIndex() {\r\n\t\treturn rowIndex;\r\n\t}", "public int getRow() {\n\t\t\treturn rowNumber;\n\t\t}", "public int getRow()\r\n\t{\r\n\t\treturn this.row;\r\n\t}", "public int getRow() {\r\n\t\treturn this.row;\r\n\t}", "public int getRow() {\r\n\t\treturn row;\r\n\t}", "public int getRow() {\r\n\t\treturn row;\r\n\t}", "public int getRowNumber() {\n\t\treturn rowNumber;\n\t}", "public int getRow() {\n\t\treturn row;\n\t}", "public int getRow() {\n\t\treturn row;\n\t}", "public int getRow() {\n\t\t\treturn row;\n\t\t}", "public int getRow() {\n\t\t\treturn row;\n\t\t}", "public int getRow() {\n\t\treturn row; \n\t}", "public int getRow() {\r\n return this.row;\r\n }", "public int getRow() {\n return this.row;\n }", "public int getRow() {\n return this.row;\n }", "public int getRow(){\r\n\t\treturn this.row;\r\n\t}", "public int getRow()\n\t{\n\t\treturn row;\n\t}", "public int getRow()\n\t{\n\t\treturn row;\n\t}", "public int getRow()\n\t{\n\t\treturn row;\n\t}", "public int getRow() {\r\n return row;\r\n }", "public int getRow()\r\n {\r\n return row;\r\n }", "public int getRow() {\n\t\treturn i;\n\t}", "public int getRow() {\n return row;\n }", "public int getRow() {\n return row;\n }", "public int getRow() {\n return row;\n }", "public int getRow() {\n return row;\n }", "public int getRow() {\n return row;\n }", "public int getRow() {\n return row;\n }", "public int row() {\r\n\t\treturn row;\r\n\t}", "public Integer getRowNo() {\n return rowNo;\n }", "public int getRow()\n\t\t{\n\t\t\treturn m_row;\n\t\t}", "public int getRow()\n {\n return row;\n }", "public int getRow() {\n return mRow;\n }", "protected int getRow() {\r\n\t\treturn this.row;\r\n\t}", "public int getRow() { return _row; }", "public Integer getRowNumber() {\n\t\tif (isRowNumber) {\n\t\t\treturn (int) lineId;\n\t\t}\n\t\treturn null;\n\t}", "@Override\r\n public int getRow() {\r\n return this.row;\r\n }", "public int getRow()\n {\n return row;\n }", "int getRowIndex();", "public int getRowNum(){ return this.rowNum; }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRow() throws SQLException {\n\n try {\n debugCodeCall(\"getRow\");\n checkClosed();\n int rowId = result.getRowId();\n if (rowId >= result.getRowCount()) { return 0; }\n return rowId + 1;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public int getRowIndex(Comparable key) { return this.underlying.getRowIndex(key); }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRowId() {\n return rowId_;\n }", "public int getRow() throws SQLException\n {\n return m_rs.getRow();\n }", "public int getRowid() {\n\t\treturn rowid;\n\t}", "public int getRow(){\r\n // return statement\r\n return row;\r\n }", "public long getRowID()\n\t{ return m_nRowID ; }", "public int getRow() {\n // YOUR CODE HERE\n return this.row;\n }", "public int getRowNumber() {\n return cols;\n }", "public int row();", "private int getRow() {\n return binaryPartition(row);\n }", "public Integer getRowId() {\n return rowId;\n }", "int getRow();", "public int getCurrentRowNumber() throws SQLException {\n/* 174 */ return this.currentPositionInEntireResult + 1;\n/* */ }", "public int getColumnNumber() {\n return rows;\n }", "@Override\n\t\t\tpublic int getRow() {\n\t\t\t\treturn count;\n\t\t\t}", "public Long getRowKey() {\n return (Long) getAttributeInternal(ROWKEY);\n }", "public int getPositionRow(){return this.positionRow;}", "public int rowIndexOf(T dataObject)\n {\n return myRowDataProvider.rowIndexOf(dataObject);\n }", "public int getStartRow();", "public int getRow() {\r\n\t\treturn slot / 9;\r\n\t}", "public Object getRowKey()\n {\n if (isRowAvailable())\n {\n Object rowKey = _getRowKey();\n return rowKey;\n }\n else\n {\n return null;\n }\n }", "public int getOrigRow() {\n return origRow;\n }", "public int getSelectedRow()\n {\n \treturn this.getSelectedIndex();\n }", "private Object _getRowKey()\n {\n Object data = getRowData();\n \n assert (_rowKeyProperty != null);\n return __resolveProperty(data, _rowKeyProperty);\n }", "int atRow();", "public RowID getRowID() {\n return (RowID)getAttributeInternal(ROWID);\n }", "public RowID getRowID() {\n return (RowID)getAttributeInternal(ROWID);\n }", "int getColumnIndex();", "int getColumnIndex();", "int getColumnIndex();", "@Override\n public int rowNumber() throws IOException {\n return recordNumber;\n }", "int getRowId();", "int getRowId();", "int getRowId();", "int getRowId();", "int getRowId();", "public int GetRow(){\n return row;\n }", "public int getRowCount() \n\t{ return rowcounter; }", "public int getRowIndex(T obj) {\r\n\t\tlogger.trace(\"Enter getRowIndex\");\r\n\t\tlogger.trace(\"Exit getRowIndex\");\r\n\t\treturn data.indexOf(obj);\r\n\t}", "public int getRequiredRow() {\n\t\tint rowNumber = 0;\n\t\tfor(int i=0;i<=sheet.getLastRowNum();i++) {\n\t\t\t//System.out.println(testCaseName+sheet.getRow(i).getCell(0).toString());\n\t\t\tif(testCaseName.equals(sheet.getRow(i).getCell(0).toString())) {\n\t\t\t\trowNumber = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn rowNumber;\n\t}", "public int getRowIndex(Feature f){\n return fc.indexOf(f);\n }", "public int getrow()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\treturn height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn width;\n\t\t}\t\t\n\t}", "String get_row_id()\n {\n return row_id;\n }", "public Comparable getRowKey(int row) { return this.underlying.getRowKey(row); }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }", "public int getRowCount() {\n return row_.size();\n }" ]
[ "0.81914216", "0.80605125", "0.8001524", "0.7996014", "0.79572415", "0.79314387", "0.79230905", "0.79230905", "0.7906542", "0.79051036", "0.79051036", "0.7904015", "0.7904015", "0.78842115", "0.787522", "0.7858693", "0.7858693", "0.7856855", "0.7852411", "0.7852411", "0.7852411", "0.78503764", "0.7847274", "0.78429", "0.7812651", "0.7812651", "0.7812651", "0.7812651", "0.7812651", "0.7812651", "0.7786543", "0.7726924", "0.77197343", "0.7715429", "0.7695589", "0.76413006", "0.75612706", "0.7551596", "0.74239564", "0.7386541", "0.7310867", "0.7265322", "0.7241298", "0.7241298", "0.7241298", "0.7241298", "0.7241298", "0.7226202", "0.71734565", "0.7163077", "0.7163077", "0.7163077", "0.7163077", "0.7163077", "0.7144857", "0.71400476", "0.71070236", "0.7070393", "0.7055019", "0.70493376", "0.7011888", "0.70061564", "0.7003895", "0.6992957", "0.69561166", "0.6914742", "0.6874252", "0.68697816", "0.68176156", "0.67783064", "0.6776462", "0.6713671", "0.6709107", "0.66779923", "0.666135", "0.6641177", "0.66332275", "0.6618878", "0.6618878", "0.6611093", "0.6611093", "0.6611093", "0.6591303", "0.6571303", "0.6571303", "0.6571303", "0.6571303", "0.6571303", "0.6560601", "0.654928", "0.65256196", "0.6523768", "0.65182734", "0.65105134", "0.6478585", "0.6473731", "0.64603215", "0.64603215", "0.64603215", "0.64603215", "0.64603215" ]
0.0
-1
Creates an iterable for the Spaces in this Row for the freemarker template to work with.
public Iterator<Space> iterator() { return spaces.iterator(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Iterator<Space> iterator() {\n return row.iterator();\n }", "public ArrayList<Space> getSpaces()\r\n\t{\r\n\t\treturn new ArrayList<Space>(_spaces.values());\r\n\t}", "public ArrayList<String> getSpaces(){\n return this.spaces; //allows us to get \n }", "protected List<AccountingLineTableRow> createRowsForFields() {\n List<AccountingLineTableRow> rows = new ArrayList<AccountingLineTableRow>();\n \n int countForThisRow = 0;\n AccountingLineTableRow row = new AccountingLineTableRow();\n for (AccountingLineViewField field : fields) {\n row.addCell(createHeaderCellForField(field));\n row.addCell(createCellForField(field));\n countForThisRow += 1;\n \n if (countForThisRow == definition.getColumnCount()) {\n rows.add(row);\n countForThisRow = 0;\n row = new AccountingLineTableRow();\n }\n }\n if (countForThisRow > 0) { // oops! we stopped mid-row and now need to fill it out\n while (countForThisRow < definition.getColumnCount()) {\n row.addCell(createPaddingCell());\n countForThisRow += 1;\n }\n rows.add(row);\n }\n \n return rows;\n }", "@Override\n public Iterator<Row> iterator() {\n\n return new Iterator<Row>() {\n\n private final Row row = new Row(TableSlice.this);\n\n @Override\n public Row next() {\n return row.next();\n }\n\n @Override\n public boolean hasNext() {\n return row.hasNext();\n }\n };\n }", "public List<Space> getSubSpaces() {\n\t\treturn subSpaces;\n\t}", "@Override\n public void buildGrid(){\n for(int column=0; column<columns; column++){\n for(int row=0; row<rows; row++){\n grid[column][row] = \"[ ]\";\n }\n }\n }", "private void generateRows() {\n\t\tfor (int i=0; i<squares.length; i++) {\n\t\t\trows[i]=new Row(squares[i]);\n\t\t}\n\t}", "public String[][] getSpace() {\n return this.space;\n }", "public void createGrid() {\r\n generator.generate();\r\n }", "@Override\n\tpublic List<Space> findAllSpace() throws Exception {\n\t\treturn spaceDao.findAllSpace();\n\t}", "private void getTiles() {\n for (int i=0; i<rows.size(); i++) {\n LinearLayout row = rows.get(i);\n int count = row.getChildCount();\n for (int j=0; j<count; j++) {\n LinearLayout tile = (LinearLayout) row.getChildAt(j);\n TextView textView = (TextView) tile.getChildAt(1);\n String text = (String) textView.getText();\n String id = \"tile\" + text.replaceAll(\"\\\\s+\",\"\");\n tiles.put(id, tile);\n }\n }\n }", "public Collection<Space> split(ItemPlacement placement)\n {\n List<Space> spaces = new ArrayList<>();\n Dimension size = placement.getPlacement().getDimensions();\n Point position = placement.getPlacement().getPosition();\n spaces.add(new Space(\n new Dimension(\n this.dimensions.getWidth() - size.getWidth(),\n this.dimensions.getHeight(),\n this.dimensions.getLength()\n ),\n new Point(\n this.position.getX() + position.getX(),\n this.position.getY(),\n this.position.getZ()\n )\n ));\n spaces.add(new Space(\n new Dimension(\n this.dimensions.getWidth(),\n this.dimensions.getHeight() - size.getHeight(),\n this.dimensions.getLength()\n ),\n new Point(\n this.position.getX(),\n this.position.getY() + position.getY(),\n this.position.getZ()\n )\n ));\n spaces.add(new Space(\n new Dimension(\n this.dimensions.getWidth(),\n this.dimensions.getHeight(),\n this.dimensions.getLength() - size.getLength()\n ),\n new Point(\n this.position.getX(),\n this.position.getY(),\n this.position.getZ() + position.getZ()\n )\n ));\n spaces.add(new Space(\n new Dimension(\n this.dimensions.getWidth() + size.getWidth(),\n this.dimensions.getHeight(),\n this.dimensions.getLength() - size.getLength()\n ),\n new Point(\n this.position.getX() + position.getX(),\n this.position.getY(),\n this.position.getZ() + position.getZ()\n )\n ));\n\n spaces.removeIf(Space::isEmpty);\n return spaces;\n }", "@Override\n public Iterator<Entry<Integer, T>> iterator() {\n List<Entry<Integer, T>> pairs = new ArrayList<Entry<Integer, T>>(count);\n\n for(int i = 0; i < count; i++) {\n pairs.add(new MapEntry<T>(extractKey(buckets[i]), (T)data[i]));\n }\n\n return pairs.iterator();\n }", "public Iterator<Hex> iterator() {\n return new Iterator<Hex>() {\n private int g = 0;\n private int h = 0;\n @Override\n public boolean hasNext() {\n return g < hexWidth && h < hexHeight;\n }\n @Override\n public Hex next() {\n Hex result = hexes[g][h];\n if (++g == hexWidth) {\n g = 0;\n h++;\n }\n return result;\n }\n @Override\n public void remove() {\n throw new UnsupportedOperationException();\n }\n };\n }", "@Override\n public Iterator<Iterable<T>> iterator() {\n return new TableIterator();\n }", "@Override\r\n\tpublic Iterator<TableEntry<K, V>> iterator() {\r\n\t\treturn new IteratorImpl();\r\n\t}", "protected Space getSpace() {\n return space;\n }", "private static void assembleRosterTable(){\n for (int i = 0; i < 10; i++) {\n rosterTable.insertRow(i);\n }\n }", "public void generateShipmentList(String fileName){\n Shipment sh;\n ShipmentValidation shValid = new ShipmentValidation();\n Template rf = new Template();\n rf.setTemplateFileName(fileName);\n rf.generateListExcel();\n ArrayList<Shipment> arrTemp = new ArrayList<>();\n\n for (Object item: rf.getArrList()\n ) {\n sh = new Shipment(((HashMap<Integer, String>) item).get(0),((HashMap<Integer, String>) item).get(1),((HashMap<Integer, String>) item).get(2),((HashMap<Integer, String>) item).get(3),((HashMap<Integer, String>) item).get(4)\n ,((HashMap<Integer, String>) item).get(5),((HashMap<Integer, String>) item).get(6),((HashMap<Integer, String>) item).get(7),((HashMap<Integer, String>) item).get(8),((HashMap<Integer, String>) item).get(9)\n ,((HashMap<Integer, String>) item).get(10),((HashMap<Integer, String>) item).get(11),((HashMap<Integer, String>) item).get(12),((HashMap<Integer, String>) item).get(13),((HashMap<Integer, String>) item).get(14)\n ,((HashMap<Integer, String>) item).get(15),((HashMap<Integer, String>) item).get(16),((HashMap<Integer, String>) item).get(17),((HashMap<Integer, String>) item).get(18),((HashMap<Integer, String>) item).get(19)\n ,((HashMap<Integer, String>) item).get(20),((HashMap<Integer, String>) item).get(21),((HashMap<Integer, String>) item).get(22),((HashMap<Integer, String>) item).get(23),((HashMap<Integer, String>) item).get(24)\n ,((HashMap<Integer, String>) item).get(25),((HashMap<Integer, String>) item).get(26),((HashMap<Integer, String>) item).get(27),((HashMap<Integer, String>) item).get(28),((HashMap<Integer, String>) item).get(29)\n ,((HashMap<Integer, String>) item).get(30),((HashMap<Integer, String>) item).get(31),((HashMap<Integer, String>) item).get(32),((HashMap<Integer, String>) item).get(33),((HashMap<Integer, String>) item).get(34)\n ,((HashMap<Integer, String>) item).get(35),((HashMap<Integer, String>) item).get(36),((HashMap<Integer, String>) item).get(37),((HashMap<Integer, String>) item).get(38),((HashMap<Integer, String>) item).get(39)\n ,((HashMap<Integer, String>) item).get(40),((HashMap<Integer, String>) item).get(41),((HashMap<Integer, String>) item).get(42),((HashMap<Integer, String>) item).get(43),((HashMap<Integer, String>) item).get(44)\n ,((HashMap<Integer, String>) item).get(45),((HashMap<Integer, String>) item).get(46),((HashMap<Integer, String>) item).get(47),((HashMap<Integer, String>) item).get(48),((HashMap<Integer, String>) item).get(49)\n ,((HashMap<Integer, String>) item).get(50),((HashMap<Integer, String>) item).get(51),((HashMap<Integer, String>) item).get(52),((HashMap<Integer, String>) item).get(53),((HashMap<Integer, String>) item).get(54)\n ,((HashMap<Integer, String>) item).get(55),((HashMap<Integer, String>) item).get(56),((HashMap<Integer, String>) item).get(57),((HashMap<Integer, String>) item).get(58),((HashMap<Integer, String>) item).get(59)\n ,((HashMap<Integer, String>) item).get(60),((HashMap<Integer, String>) item).get(61),((HashMap<Integer, String>) item).get(62),((HashMap<Integer, String>) item).get(63));\n sh.setErrorMsg(shValid.FindError(sh));\n\n arrTemp.add(sh);\n }\n\n this.setShipmentList(arrTemp);\n }", "private TilePane createGrid() {\n\t\tTilePane board = new TilePane();\n\t\tboard.setPrefRows(9);\n\t\tboard.setPrefColumns(9);\n\t\tboard.setPadding(new Insets(3,3,3,3));\n\t\tboard.setHgap(3); //Horisontal gap between tiles\n\t\tboard.setVgap(3); //Vertical gap between tiles\n\t\t\n\t\t//Creates and colors tiles\n\t\tfor(int i = 0; i < 9; i++){\n\t\t\tfor(int k = 0; k < 9; k++){\n\t\t\t\tLetterTextField text = new LetterTextField();\n\t\t\t\ttext.setPrefColumnCount(1);\n\t\t\t\t\n\t\t\t\tif(!(i/3 == 1 || k/3 == 1) || (i/3 == 1 && k/3 == 1)){\n\t\t\t\t\ttext.setStyle(\"-fx-background-color: #daa520;\");\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfield[i][k] = text;\n\t\t\t\tboard.getChildren().add(text);\n\t\t\t}\n\t\t}\t\t\n\t\treturn board;\n\t}", "private void Spacing() {\n\n try {\n while (true) {\n try {\n Space();\n } catch (SyntaxError e) {\n Comment();\n }\n }\n } catch (SyntaxError e) {\n }\n }", "@Override\n protected void populate()\n {\n for (int i = 0; i < getHeight(); i++)\n {\n add(new Tile(), 1, i);\n add(new Block(), 2, i);\n add(new Tile(), 3, i);\n }\n for (int i = 2; i < 5; i++)\n {\n add(new LightableTile(), 4, i);\n }\n }", "private List<Tile> makeTiles() {\n List<Tile> tiles = new ArrayList<>();\n Board board = (Board) boardManager.getBoard();\n final int numTiles = board.getNumRows() * board.getNumCols();\n for (int tileNum = 0; tileNum != numTiles; tileNum++) {\n tiles.add(new Tile(tileNum + 1, tileNum, 4));\n }\n\n return tiles;\n }", "public Space getSpace() {\n return space;\n }", "public ComboBox<String> getSpaces() {\n return spaces;\n }", "@Override\r\n\tprotected List<CreateKeyspaceSpecification> getKeyspaceCreations() {\r\n\t\tCreateKeyspaceSpecification specification = CreateKeyspaceSpecification.createKeyspace(KEYSPACE);\r\n\t\treturn Arrays.asList(specification);\r\n\t}", "public List<Field> iterateThroughAllFields() {\n\n List<Field> listOfFields = new ArrayList<Field>(fields.length * fields.length);\n // TODO: n**m complexity\n for (int i = 0; i < this.fields.length; i++) {\n for (int j = 0; j < this.fields.length; j++) {\n listOfFields.add(this.fields[i][j]);\n }\n }\n return listOfFields;\n }", "@Override\n protected void generateTiles() {\n }", "public DbIterator iterator() {\n \tTupleDesc td = generateTupleDesc();\n List<Tuple> tuples = new ArrayList<Tuple>();\n if(gbField == NO_GROUPING){\n \tTuple tuple = new Tuple(td);\n \ttuple.setField(0, new IntField(tupleCounts.get(null)));\n \ttuples.add(tuple);\n } else {\n \tfor(Object key : tupleCounts.keySet()){\n \t\tTuple tuple = new Tuple(td);\n \t\ttuple.setField(0, (Field)key);\n \t\ttuple.setField(1, new IntField(tupleCounts.get(key)));\n \t\ttuples.add(tuple);\n \t}\n }\n return new TupleIterator(td, tuples);\n }", "Rows createRows();", "public static String spaces(int i){\n String spaces = \"\";\n for(int j = 0; j < i; j++)\n {\n spaces = \" \" + spaces;\n }\n return spaces;\n }", "private void getRows() {\n int count = metroTileView.getChildCount();\n for (int i=0; i<count; i++) {\n LinearLayout layout = (LinearLayout) metroTileView.getChildAt(i);\n rows.add(layout);\n }\n }", "static Extractor bySpaces() {\n\t\t\treturn Splitter.SPACE_EXTRACTOR;\n\t\t}", "@Override\n public void printGrid(){\n for(int row = 0; row < rows; row++){\n System.out.print(\"\\n\");\n if(row==0){\n char row_char='A';\n System.out.print(\" |\");\n for(int i=0; i<rows; i++){\n System.out.print(\"[\" + row_char + \"]\");\n row_char++;\n }\n System.out.print(\"\\n\");\n System.out.print(\"---|\");\n for(int i=0; i<rows;i++){\n System.out.print(\"---\");\n }\n System.out.print(\"\\n\");\n }\n\n for(int column = 0; column < columns; column++){\n if (column==0){System.out.print(\"[\"+row+\"]|\");}\n System.out.print(grid[row][column]);\n }\n }\n }", "@Override\n\tpublic boolean takeCellSpace() {\n\t\treturn true;\n\t}", "@Override\n public Object[] createRow() {\n ObjectDescriptor.TypeObject newTypeObjectInstance = ObjectDescriptor.newInstance();\n List<PropertyDescriptor> descriptors = typeObjectDescriptor.getObjectProperties();\n InitValuesFiller.fill(newTypeObjectInstance, descriptors);\n\n return new Object[]{ StringUtils.EMPTY, newTypeObjectInstance };\n }", "@Override\n public Iterator<T> iterator() {\n return new CLITableIterator<T>(createNew(tables, cursor, rowIndex));\n }", "public Row(int width) {\n data = new Object[width];\n }", "@Override\n\tpublic void createCellStructure() {\n\t\t\n\t}", "private List<WebElement> findSpacesListElements(WebDriver d) {\n\t\treturn d.findElements(By.cssSelector(\"td.space-name>a\"));\n\t}", "public ArrayList<Vector2D> getPositions() {\n ArrayList<Vector2D> positions = new ArrayList<>();\n for (Vector2D pos : this.template) {\n positions.add(pos.addVectorGetNewVector(this.center));\n }\n return positions;\n }", "public List<Site> getSpaces() {\n SiteQuery sq = new SiteQuery.Builder().withSiteTypes(SiteType.SPACE).build();\n List<Site> s = PortalRequest.getInstance().getPortal().findSites(sq);\n return s;\n }", "@Override public List<String> gridRepresentation() {\n assert(checkRep());\n return representation;\n }", "public List<Render.ReservationStationEntryWrapper> toList() {\n List<Render.ReservationStationEntryWrapper> ret = new ArrayList<>();\n for (int i = 0; i < table.length; i++) {\n Render.ReservationStationEntryWrapper wrapper = new Render.ReservationStationEntryWrapper(table[i], i);\n ret.add(wrapper);\n }\n return ret;\n }", "public List<TemplItem> template() {\n List<TemplItem> items = new ArrayList<>();\n int l;\n int n;\n\n boolean done = false;\n while (!done) {\n DNAToken token = parser.step();\n\n switch (token) {\n case CONT:\n break;\n case C:\n items.add(new TemplItem(TemplItem.Type.BASE, 'I'));\n break;\n case F:\n items.add(new TemplItem(TemplItem.Type.BASE, 'C'));\n break;\n case P:\n items.add(new TemplItem(TemplItem.Type.BASE, 'F'));\n break;\n case IC:\n items.add(new TemplItem(TemplItem.Type.BASE, 'P'));\n break;\n case IP:\n case IF:\n l = parser.nat();\n n = parser.nat();\n items.add(new TemplItem(TemplItem.Type.PROT, n, l));\n break;\n case IIP:\n n = parser.nat();\n items.add(new TemplItem(TemplItem.Type.LEN, n));\n break;\n case IIF:\n case IIC:\n done = true;\n break;\n case III:\n rna.concat(dna.substring(0, 7));\n dna.trunc(7);\n break;\n case DONE:\n done = true;\n break;\n default:\n finish();\n }\n }\n\n return items;\n }", "public HashMap<Integer, List<TemplateAttribute>> getAttrsByTemplate() {\n if (t_attrs == null) {\n t_attrs = new HashMap<Integer, List<TemplateAttribute>>();\n }\n return t_attrs;\n }", "public List<String> getNextSpace() {\n\t\treturn next;\n\t}", "public int getSlots() {\n\t\treturn this.rows * 9;\n\t}", "private void createRenderables()\n {\n this.gridElements = new ArrayList<GridElement>();\n\n ArrayList<Position> positions = new ArrayList<Position>();\n double step = sector.getDeltaLatDegrees() / this.divisions;\n\n // Generate meridians with labels\n double lon = sector.getMinLongitude().degrees + (this.level == 0 ? 0 : step);\n while (lon < sector.getMaxLongitude().degrees - step / 2)\n {\n Angle longitude = Angle.fromDegrees(lon);\n // Meridian\n positions.clear();\n positions.add(new Position(this.sector.getMinLatitude(), longitude, 0));\n positions.add(new Position(this.sector.getMaxLatitude(), longitude, 0));\n\n Object polyline = createLineRenderable(positions, Polyline.LINEAR);\n Sector sector = Sector.fromDegrees(\n this.sector.getMinLatitude().degrees, this.sector.getMaxLatitude().degrees, lon, lon);\n String lineType = lon == this.sector.getMinLongitude().degrees ?\n GridElement.TYPE_LINE_WEST : GridElement.TYPE_LINE;\n GridElement ge = new GridElement(sector, polyline, lineType);\n ge.value = lon;\n this.gridElements.add(ge);\n\n // Increase longitude\n lon += step;\n }\n\n // Generate parallels\n double lat = this.sector.getMinLatitude().degrees + (this.level == 0 ? 0 : step);\n while (lat < this.sector.getMaxLatitude().degrees - step / 2)\n {\n Angle latitude = Angle.fromDegrees(lat);\n positions.clear();\n positions.add(new Position(latitude, this.sector.getMinLongitude(), 0));\n positions.add(new Position(latitude, this.sector.getMaxLongitude(), 0));\n \n Object polyline = createLineRenderable(positions, Polyline.LINEAR);\n Sector sector = Sector.fromDegrees(\n lat, lat, this.sector.getMinLongitude().degrees, this.sector.getMaxLongitude().degrees);\n String lineType = lat == this.sector.getMinLatitude().degrees ?\n GridElement.TYPE_LINE_SOUTH : GridElement.TYPE_LINE;\n GridElement ge = new GridElement(sector, polyline, lineType);\n ge.value = lat;\n this.gridElements.add(ge);\n\n // Increase latitude\n lat += step;\n }\n }", "private void populateLetterList() {\n int numberOfTabs = LETTERS_IN_ALPHABET / numberInGroup;\n\n if (LETTERS_IN_ALPHABET % numberInGroup != 0) {\n numberOfTabs++;\n }\n for (int i = 0; i < numberOfTabs; i++) {\n Character startLetter = (char) ((i * numberInGroup) + 65);\n Character endLetter = (char) (startLetter + numberInGroup - 1);\n if ((int) endLetter > (25 + 65)) {\n endLetter = (char) (25 + 65);\n }\n startLetterList.put(startLetter, endLetter);\n }\n }", "@Override\n\tpublic void placementcell() {\n\t\t\n\t}", "@Override\n\tprotected void generateTiles() {\n\t}", "@Override\n\tpublic String toString() {\n\t\tString grid = \"\";\n\t\tfor (int i = 0; i < this.getNumRow(); i++) {\n\t\t\tgrid = grid + this.storage.get(i).toString() + \"\\n\";\n\t\t}\n\t\tSystem.out.println(grid);\n\t\treturn grid;\n\t}", "protected AccountingLineTableCell createPaddingCell() {\n AccountingLineTableCell cell = new AccountingLineTableCell();\n cell.setColSpan(2);\n cell.setNeverEmpty(true);\n return cell;\n }", "void addSpaces() {\n\t\tSystem.out.print(\" \");\n\t\tfor (int j = 0; j < 3; j++)\n\t\t\tSystem.out.print(\"| \");\n\t\tSystem.out.println(\"|\");\n\t}", "List<WebElement> getCells() {\n return row.findElements(By.tagName(\"td\"));\n }", "public Long getSPACE() {\n return SPACE;\n }", "public List<Move> getAvailableSpaces() {\n List<Move> availableMoves = new ArrayList<>();\n for (int i = 0; i < LENGTH; i++) {\n for (int j = 0; j < LENGTH; j++) {\n Move move = new Move(i, j);\n if (isValidMove(move)) {\n availableMoves.add(move);\n }\n }\n }\n return availableMoves;\n }", "@Override\n public java.util.List<KeySpace> getKeyspacesList() {\n return keyspaces_;\n }", "public double getSpace() {\n\treturn space;\n }", "@Override\n\t\tpublic Iterator<Word> iterator() {\n\t\t\treturn new HashTableIterator();\n\t\t}", "ArrayList<ArrayList<GamePiece>> makeBoard() {\n ArrayList<ArrayList<GamePiece>> row = new ArrayList<ArrayList<GamePiece>>();\n for (int i = 0; i < this.width; i++) {\n ArrayList<GamePiece> column = new ArrayList<GamePiece>();\n for (int j = 0; j < this.height; j++) {\n GamePiece temp = new GamePiece(i, j);\n column.add(temp);\n nodes.add(temp);\n }\n row.add(column);\n }\n return row;\n }", "private SlotIterator createIterator(int rows, int columns) {\n InventoryManager manager = mock(InventoryManager.class);\n\n SmartInventory inv = mock(SmartInventory.class);\n when(inv.getRows()).thenReturn(rows);\n when(inv.getColumns()).thenReturn(columns);\n when(inv.getManager()).thenReturn(manager);\n\n InventoryContents contents = new InventoryContents.Impl(inv, null);\n return contents.newIterator(SlotIterator.Type.HORIZONTAL, 0, 0);\n }", "public static void spaces() {\r\n // prints 13 spaces\r\n for (int space = 0; space < 15; space++) {\r\n System.out.println(\"\");\r\n }\r\n\r\n }", "@Override\r\n\tpublic String getGridText()\r\n\t{\r\n\t\t// TODO Auto-generated method stub\\\r\n\t\tString sheet = \"\";\r\n\t\tfor(int i = 0; i <= 20; i++) { //20 rows\r\n\t\t\tfor(char j = 'A'; j <= 'L';j++) { //A through L\r\n\t\t\t\tif(i == 0) { //Creates row headers\r\n\t\t\t\t\tif(j == 'A') { // Creates letter headers\r\n\t\t\t\t\t\tsheet += \" |\"; //pads for headers\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsheet += String.format(\"%-10c|\",j);\r\n\t\t\t\t} else{\r\n\t\t\t\t\tif(j == 'A') {\r\n\t\t\t\t\t\tsheet += String.format(\"%-3d|\", i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsheet += cells[i-1][j-'A'].abbreviatedCellText() + \"|\"; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//enters new row\r\n\t\t\tsheet += \"\\n\";\r\n\t\t}\r\n\t\t//prints sheet\r\n\t\treturn sheet;\r\n\t}", "public DbIterator iterator() {\n // some code goes here\n //throw new UnsupportedOperationException(\"please implement me for proj2\");\n List<Tuple> tuparr = new ArrayList<Tuple>();\n Type[] typearr = new Type[]{gbfieldtype, Type.INT_TYPE};\n TupleDesc fortup = new TupleDesc(typearr, new String[]{null, null});\n Object[] keys = groups.keySet().toArray();\n for (int i = 0; i < keys.length; i++) {\n \n int key = (Integer) keys[i];\n \n Tuple tup = new Tuple(fortup);\n if (gbfieldtype == Type.STRING_TYPE) {\n tup.setField(0, hashstr.get(key));\n }\n else {\n tup.setField(0, new IntField(key));\n }\n //tup.setField(0, new IntField(key));\n tup.setField(1, new IntField(groups.get(key)));\n tuparr.add(tup); \n\n }\n List<Tuple> immutable = Collections.unmodifiableList(tuparr);\n TupleIterator tupiter = new TupleIterator(fortup, immutable);\n if (gbfield == NO_GROUPING) {\n List<Tuple> tuparr1 = new ArrayList<Tuple>();\n TupleDesc fortup1 = new TupleDesc(new Type[]{Type.INT_TYPE}, new String[]{null});\n Tuple tup1 = new Tuple(fortup1);\n tup1.setField(0, new IntField(groups.get(-1)));\n tuparr1.add(tup1);\n List<Tuple> immutable1 = Collections.unmodifiableList(tuparr1);\n TupleIterator tupiter1 = new TupleIterator(fortup1, immutable1);\n \n return (DbIterator) tupiter1;\n }\n return (DbIterator) tupiter;\n }", "public Space()\n {\n this._valuesToPut = new ArrayList<>();\n this._defaultSpace = false;\n this._lock = false;\n }", "public String getSPACE_TYPE() {\n return SPACE_TYPE;\n }", "public String row(int i)\n //centered block works differently when you give separate textlines vs. text blocks \n throws Exception\n {\n int spacing = ((this.width - this.text.width()) / 2);\n //set right and left indent\n StringBuffer output = new StringBuffer(this.width);\n for (int count = 0; count < this.width; count++)\n {\n output.append(\" \");\n } //for loop to create indents\n try\n {\n output.replace(spacing, this.text.width() + spacing, this.text.row(i));\n }\n catch (Exception e)\n {\n throw new Exception(\"Can only update once\");\n }\n return output.toString();\n }", "public void generateLineItems(){\n for(int i=0; i<purch.getProdIdx().length; i++){\r\n \r\n prod= new Product(db.getProductDbItem(purch.getProductItem(i)));\r\n \r\n LineItem[] tempL=new LineItem[lineItem.length+1];\r\n System.arraycopy(lineItem,0,tempL,0,lineItem.length);\r\n lineItem=tempL;\r\n lineItem[lineItem.length-1]= new LineItem(prod.getProdId(),purch.getQtyAmtItm(i), \r\n prod.getProdUnitPrice(), prod.getProdDesc(), prod.getProdDiscCode()); \r\n totalPurch += (purch.getQtyAmtItm(i) * prod.getProdUnitPrice());\r\n totalDisc += lineItem[lineItem.length-1].getDiscAmt();\r\n \r\n }\r\n }", "private void setCellGrid(){\n count=0;\n status.setText(\"Player 1 Move\");\n field = new ArrayList<>();\n for (int i=0; i< TwoPlayersActivity.CELL_AMOUNT; i++) {\n field.add(new Cell(i));\n }\n }", "private void placeRooms() {\n if (roomList.size() == 0) {\n throw new IllegalArgumentException(\"roomList must have rooms\");\n }\n // This is a nice cool square\n map = new int[MAP_SIZE][MAP_SIZE];\n\n for (Room room : roomList) {\n assignPosition(room);\n }\n }", "public List getRows() \n {\n return rows;\n }", "public void generateStockListTable() {\n\t\t\tDisplayMetrics dm = new DisplayMetrics();\n\t\t\tgetWindowManager().getDefaultDisplay().getMetrics(dm);\n\t\t\tscreenWidth = dm.widthPixels;\n\t\t\tscreenHeight = dm.heightPixels;\n\n\t\t\ttableLayout = (TableLayout) this.findViewById(R.id.tablelayout);\n\t\t\ttableLayout.setStretchAllColumns(true);\n//\t\t\ttableLayout.setBackgroundResource(R.drawable.shape_nzx50);\n\t//\n//\t\t\tTextView textview = (TextView) this.findViewById(R.id.textview);\n//\t\t\ttextview.setVisibility(View.INVISIBLE);\n\t\t\tStockCodeToNameMapper mapper = new StockCodeToNameMapper();\n\t\t\tfor (int i = 0; i < stockList.size(); i++) {\n\t\t\t\tfinal Stock stock = stockList.get(i);\n\n\t\t\t\tTableRow tableRow = new TableRow(this);\n\t\t\t\ttableRow.setBackgroundColor(Color.rgb(255, 255, 255));\n\t\t\t\t\n\n\t\t\t\tTextView textView1 = new TextView(this);\n\t\t\t\ttextView1.setText(stock.getStockCode());\n\t\t\t\ttextView1.setSingleLine(true);\n\t\t\t\ttextView1.setGravity(Gravity.CENTER);\n\t\t\t\ttextView1.setBackgroundResource(R.drawable.shape_nzx50);\n\t\t\t\ttextView1.setHeight((int) (screenHeight * 0.088));\n\n\t\t\t\tTextView textView2 = new TextView(this);\n\t\t\t\ttextView2.setText(mapper.getStockName(stock.getStockCode()));\n\t\t\t\ttextView2.setWidth((int) (screenWidth * 0.5));\n\t\t\t\ttextView2.setSingleLine(true);\n\t\t\t\ttextView2.setEllipsize(TruncateAt.END);\n\t\t\t\ttextView2.setGravity(Gravity.CENTER_VERTICAL);\n\t\t\t\ttextView2.setBackgroundResource(R.drawable.shape_nzx50);\n\t\t\t\ttextView2.setHeight((int) (screenHeight * 0.088));\n\t\t\t\t\n\n\t\t\t\tTextView textView3 = new TextView(this);\n\t\t\t\tif (stock.getStockVariation().contains(\"+\")) {\n\t\t\t\t\tdrawable = getResources().getDrawable(R.drawable.up);\n\t\t\t\t} else if (stock.getStockVariation().contains(\"-\")) {\n\t\t\t\t\tdrawable = getResources().getDrawable(R.drawable.down);\n\t\t\t\t} else {\n\t\t\t\t\tdrawable = getResources().getDrawable(R.drawable.unchanged);\n\t\t\t\t}\n\t\t\t\ttextView3.setCompoundDrawables(setDrawbleBound(drawable), null,\n\t\t\t\t\t\tnull, null);\n\t\t\t\ttextView3.setSingleLine(true);\n\t\t\t\ttextView3.setGravity(Gravity.CENTER);\n\t\t\t\ttextView3.setBackgroundResource(R.drawable.shape_nzx50);\n\t\t\t\ttextView3.setHeight((int) (screenHeight * 0.088));\n\t\t\t\t\n\n\n\t\t\t\tfinal ImageButton iButton=new ImageButton(this,null,android.R.attr.buttonStyleSmall);\n\t\t\t\tiButton.setVisibility(View.VISIBLE);\n//\t\t\t\tiButton.setBackgroundColor(Color.rgb(255, 255, 255));\n\t\t\t\tiButton.setImageResource(R.drawable.bookmark_no);\n\t\t\t\t\n\t\t\t\tIterator<Stock> stockIterator=watchlistStocks.iterator();\n\t\t\t\twhile(stockIterator.hasNext()){\n\t\t\t\t\tStock s=stockIterator.next();\n\t\t\t\t\tString sCode=s.getStockCode();\n\t\t\t\t\t\n\t\t\t\t\tif(sCode.equalsIgnoreCase(stock.getStockCode())){\n\t\t\t\t\t\tstock.setBookmarked(true);\n\t\t\t\t\t\tiButton.setImageResource(R.drawable.bookmark_yes);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tstock.setBookmarked(false);\n\t\t\t\t\t\tiButton.setImageResource(R.drawable.bookmark_no);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tiButton.setImageResource(R.drawable.bookmark_no);\n//\t\t\t\tiButton.setImageResource(R.drawable.bookmark_yes);\n\t\t\t\tiButton.setBackgroundResource(R.drawable.shape_nzx50);\n\t\t\t\t\n\t\t\t\tiButton.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tif(!stock.isBookmarked()){\n\t\t\t\t\t\t\tToast.makeText(StockListActivity.this, stock.getStockCode().toString()+\" added to Watchlist \",Toast.LENGTH_SHORT).show\n\n\t();\n\t\t\t\t\t\t\tstock.setBookmarked(true);\n\t\t\t\t\t\t\taddToWatchlist(stock);\n\t\t\t\t\t\t\tiButton.setImageResource(R.drawable.bookmark_yes);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tToast.makeText(StockListActivity.this, stock.getStockCode().toString()+\" removed from Watchlist \",Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\tstock.setBookmarked(false);\n\t\t\t\t\t\t\tremoveFromWatchlist(stock);\n\t\t\t\t\t\t\tiButton.setImageResource(R.drawable.bookmark_no);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\ttableRow.addView(textView1);\n\t\t\t\ttableRow.addView(textView2);\n\t\t\t\ttableRow.addView(textView3);\n\t\t\t\ttableRow.addView(iButton);\n\n\t\t\t\t//tableRow.setBackgroundResource(R.drawable.shape_nzx50);\n\n\n\t\t\t\ttableLayout.addView(tableRow);// adding rows to table\n\t\t\t}\n\t\t}", "public void createSpaceClasses(){\n\t//add the number of classe demand in a list of superchannel\n\t\tspaceSC_List = new ArrayList<OpticalSuperChannel>();\n\t\tfor ( int i = 1 ; i < this.spatialDimension+1 ; i++ ) {\n\t\t\tspaceSC_List.add(new OpticalSuperChannel( i , this.signalBw, this.channelSpacing, this.bandGuard,\n\t\t\t\t\tthis.slotBw, this.modulationFormat));\n\t\t}\n\n\n\t}", "public GridElement(int rows, int cols)\n\t{\n\t\tm_rows = rows;\n\t\tm_cols = cols;\n\t\tm_textLayout = new TextLayout[rows][cols];\n\t\tm_iterator = new AttributedCharacterIterator[rows][cols];\n\t\tm_rowHeight = new int[rows];\n\t\tm_colWidth = new int[cols];\n\t\t//\texplicit init\n\t\tfor (int r = 0; r < m_rows; r++)\n\t\t{\n\t\t\tm_rowHeight[r] = 0;\n\t\t\tfor (int c = 0; c < m_cols; c++)\n\t\t\t{\n\t\t\t\tm_textLayout[r][c] = null;\n\t\t\t\tm_iterator[r][c] = null;\n\t\t\t}\n\t\t}\n\t\tfor (int c = 0; c < m_cols; c++)\n\t\t\tm_colWidth[c] = 0;\n\t}", "public ListIterator<T> getAllByColumnsIterator() {\n\t\tAllByColumnsIterator it = new AllByColumnsIterator();\n\t\treturn it;\n\t}", "public float getSpace() {\r\n return space;\r\n }", "public java.util.List<org.apache.xmlbeans.XmlString> xgetMappingFieldsList()\n {\n final class MappingFieldsList extends java.util.AbstractList<org.apache.xmlbeans.XmlString>\n {\n public org.apache.xmlbeans.XmlString get(int i)\n { return OOSOrderLineItemTypeImpl.this.xgetMappingFieldsArray(i); }\n \n public org.apache.xmlbeans.XmlString set(int i, org.apache.xmlbeans.XmlString o)\n {\n org.apache.xmlbeans.XmlString old = OOSOrderLineItemTypeImpl.this.xgetMappingFieldsArray(i);\n OOSOrderLineItemTypeImpl.this.xsetMappingFieldsArray(i, o);\n return old;\n }\n \n public void add(int i, org.apache.xmlbeans.XmlString o)\n { OOSOrderLineItemTypeImpl.this.insertNewMappingFields(i).set(o); }\n \n public org.apache.xmlbeans.XmlString remove(int i)\n {\n org.apache.xmlbeans.XmlString old = OOSOrderLineItemTypeImpl.this.xgetMappingFieldsArray(i);\n OOSOrderLineItemTypeImpl.this.removeMappingFields(i);\n return old;\n }\n \n public int size()\n { return OOSOrderLineItemTypeImpl.this.sizeOfMappingFieldsArray(); }\n \n }\n \n synchronized (monitor())\n {\n check_orphaned();\n return new MappingFieldsList();\n }\n }", "public List(int row, char charColumn) {\n\t\tthis.column = charColumn;\n\t\tthis.row = row;\n\t\tmirror = ' ';\n\t\tsetContent(\"[ ]\");\n\t}", "public Couple cellContent(int x, int y);", "public List<List<Box>> finish() {\n\t\treturn cells;\n\t}", "public Iterable<Place> places(){\n return places;\n }", "private void addColumn() {\n for (int j = 0; j < gridHeight; j++) {\n EscapeBlock block = new EscapeBlock(gridWidth,j);\n block.setLocation(margin + gridWidth * (Block.length+1) ,\n margin + topMargin + j * (Block.length+1)); \n this.add(block);\n grid.get(j).add(block);\n }\n gridWidth++;\n }", "@Override\r\n public String toString() { return new String( \"(\" + row + \", \" + col + \")\" ); }", "@Override\n public Tile[][] getGrid() { return grid; }", "private ContainerTag generateTableRow(HtmlData rowData) {\n ContainerTag row = tr();\n for (String entry : rowData.getFields()) {\n row.with(td(entry));\n }\n return row;\n }", "public Iterable<HashNode> iterator() {\n\t\treturn bucket;\n\t\t//for(HashTable<Character, Integer>.HashNode x : HT.iterator()) {\n\t}", "public Iterable<MapElement> elements() {\n return new MapIterator() {\n\n @Override\n public MapElement next() {\n return findNext(true);\n }\n \n };\n }", "@Override\n\tpublic List<List<Cell>> setUpCells(Grid grid, int width, int height,\n\t\t\tMap<String, Double> map) {\n\t\treturn setUpRandomCells(grid, width, height, map, 2);\n\t}", "public Grid grid() { return grid; }", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "public ArrayList<Item> createItemList() {\n return itemLines\n .stream()\n .map(this::writeLineItemNumber)\n .map(this::createItem)\n .collect(Collectors.toCollection(ArrayList::new));\n }", "public ListIterator<T> getAllByRowsIterator() {\n\t\tAllByRowsIterator it = new AllByRowsIterator();\n\t\treturn it;\n\t}", "public Iterator<I> getReservables(){\n IterI iter = new IterI();\n return iter;\n }", "public DbIterator iterator() {\n // some code goes here\n if (gbfield == Aggregator.NO_GROUPING) {\n Type[] tp = new Type[1];\n tp[0] = Type.INT_TYPE;\n String[] fn = new String[1];\n fn[0] = aop.toString();\n TupleDesc td = new TupleDesc(tp, fn);\n Tuple t = new Tuple(td);\n t.setField(0, new IntField(gbCount.get(null)));\n ArrayList<Tuple> a = new ArrayList<>();\n a.add(t);\n return new TupleIterator(td, a);\n } else {\n Type[] tp = new Type[2];\n tp[0] = gbfieldtype;\n tp[1] = Type.INT_TYPE;\n String[] fn = new String[2];\n fn[0] = gbname;\n fn[1] = aop.toString();\n TupleDesc td = new TupleDesc(tp, fn);\n ArrayList<Tuple> a = new ArrayList<>();\n for (Field f : gbCount.keySet()) {\n Tuple t = new Tuple(td);\n t.setField(0, f);\n t.setField(1, new IntField(gbCount.get(f)));\n a.add(t);\n }\n return new TupleIterator(td, a);\n }\n }", "private static void generateWorld(){\n for(int i = 0; i < SIZE*SIZE; i++){\n new Chunk();\n }\n }", "protected List<FloorDef> genEntities() {\n List<FloorDef> list = new ArrayList<>();\n\n // MUST ADD THE WORK IDS AFTER\n\n list.add(new FloorDef(1, 10, 7001));\n list.add(new FloorDef(2, 3, 7002));\n list.add(new FloorDef(3, 10, 7003));\n list.add(new FloorDef(4, 0, 7004));\n\n //int[] workIDs = new int[]{};\n\n //for (int i = 0; i < workIDs.length)\n\n return list;\n }", "public Grid generateGrid(){\n myGrid = new RectGrid();\n myStates = new HashMap<>();\n\n for(int row = 0; row < imageHeight; row++){\n for(int column = 0; column < imageWidth; column++){\n int color = myImage.getRGB(column, row);\n int blue = color & 0xff;\n int green = (color & 0xff00) >> 8;\n int red = (color & 0xff0000) >> 16;\n\n int stateValue = color*-1;\n System.out.println(stateValue);\n //int stateValue = Integer.parseInt(hex, 16);\n //System.out.println(stateValue);\n\n Cell myCell = new RPSCell();\n myCell.setState(stateValue);\n myGrid.placeCell(row, column, myCell);\n\n Color myColor = Color.rgb(red, green, blue);\n myStates.put(stateValue, myColor);\n }\n }\n return myGrid;\n }" ]
[ "0.6084436", "0.5640425", "0.5427704", "0.5426168", "0.5112136", "0.5106309", "0.49946356", "0.49883857", "0.49595785", "0.4922822", "0.48946294", "0.48798323", "0.4863312", "0.48164177", "0.48069945", "0.47876376", "0.47747266", "0.4771726", "0.4717886", "0.4717147", "0.46821484", "0.46455577", "0.46402067", "0.4633009", "0.46276233", "0.45781323", "0.45590192", "0.4554438", "0.45369214", "0.4536326", "0.45362902", "0.45264524", "0.45139515", "0.45124853", "0.45032743", "0.44875604", "0.44861776", "0.4480576", "0.4479641", "0.4472237", "0.44716147", "0.44700032", "0.44653168", "0.44579163", "0.44556767", "0.44437614", "0.4431559", "0.44253537", "0.44247016", "0.44096467", "0.44037512", "0.44005954", "0.43984902", "0.43957683", "0.4378432", "0.43783146", "0.43768242", "0.43732712", "0.4369027", "0.43685383", "0.43681595", "0.43658987", "0.4365199", "0.4354654", "0.43433738", "0.4341108", "0.4340713", "0.4333735", "0.43328872", "0.43248308", "0.432415", "0.43139923", "0.4299967", "0.42972478", "0.42933542", "0.4291515", "0.4290521", "0.42851496", "0.42812753", "0.4280875", "0.4278451", "0.4277056", "0.42627782", "0.42550504", "0.4252785", "0.4244344", "0.42340213", "0.42314547", "0.42309648", "0.42294887", "0.42284298", "0.42259768", "0.42235905", "0.42229742", "0.42161733", "0.4212133", "0.42118308", "0.42098495", "0.4207961", "0.42049572" ]
0.56869376
1
Overriding equals() for deep equality between Row Objects. This method is used for testing.
@Override public boolean equals(Object obj){ if(this == obj){ return true; } else if(!(obj instanceof Row)){ return false; } Row row2 = (Row)obj; return this.index == row2.index && this.spaces.equals(row2.spaces); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean equals (Object o) {\n if (!(o instanceof Row)) return false;\n\n Row other = (Row)o;\n if(index!=other.getIndex())\n return false;\n for (int i = 0; i < row.size(); i++)\n if (!row.get(i).equals(other.get(i)))\n return false;\n return true;\n }", "public boolean equals(Object obj) {\n\n if (obj == this) {\n return true;\n }\n\n if (obj instanceof Row) {\n return ((Row) obj).table == table\n && ((Row) obj).position == position;\n }\n\n return false;\n }", "public boolean equals(Object obj)\n {\n if (! (obj instanceof TableRow))\n return false;\n \n return data.equals(((TableRow) obj).data);\n }", "@Override\npublic boolean equals(Object tbl) {\n Table table;\n\n try {\n table = (Table) tbl;\n } catch (Exception e) {\n return false;\n }\n\n if (getNumRows() != table.getNumRows()) {\n return false;\n }\n\n if (getNumColumns() != table.getNumColumns()) {\n return false;\n }\n\n for (int i = 0; i < getNumRows(); i++) {\n\n for (int j = 0; j < getNumColumns(); j++) {\n\n if (!getObject(i, j).equals(table.getObject(i, j))) {\n return false;\n }\n }\n }\n\n return true;\n\n }", "public boolean equals(Object o) {\r\n if (!(o instanceof ColumnRow)) return false;\r\n \r\n if (((ColumnRow)o).getColumnaBD().equals(this.columnaBD) &&\r\n ((ColumnRow)o).getColumnaSistema().equals(this.columnaSistema)) \r\n return true;\r\n \r\n else\r\n return false;\r\n }", "@Override\n public boolean equals(Object obj) {\n if (obj == this) {\n return true;\n }\n\n if (!(obj instanceof Table)) {\n return false;\n }\n\n Table rhs = (Table) obj;\n\n return model.equals(rhs.model)\n && color.equals(rhs.color);\n }", "@Override\r\n public boolean equals(Object obj) {\r\n if (!(obj instanceof Position))\r\n return false;\r\n Position pos = (Position)obj;\r\n return ((pos.getRowIndex() == this.rowIndex) && (pos.getColumnIndex() == this.colIndex));\r\n }", "public boolean equals(Object x){\n if (!(x instanceof Matrix)) return false;\n Matrix m = (Matrix) x;\n if(m.nnz != this.nnz){\n return false;\n }\n if(m.matrixSize != this.matrixSize){\n return false;\n }\n for(int i = 0; i<matrixSize; i++){\n if(!(m.rows[i].equals(rows[i]))){\n return false;\n }\n }\n return true;\n }", "@Override\n\tpublic abstract boolean equals(Object other);", "@Override\n public abstract boolean equals(Object other);", "@Override\n public abstract boolean equals(Object other);", "@Override public boolean equals(Object object);", "@SuppressWarnings(\"unchecked\")\r\n\t\tpublic boolean equals(Object other) {\r\n\t\t\tboolean flag = false;\r\n\r\n\t\t\tif (other instanceof TableElement) {\r\n\t\t\t\tTableElement<K, V> candidate = (TableElement<K, V>) other;\r\n\r\n\t\t\t\tif ((this.getKey()).equals(candidate.getKey()))\r\n\t\t\t\t\tflag = true;\r\n\t\t\t}\r\n\r\n\t\t\treturn flag;\r\n\t\t}", "public boolean equals(Object x){\n if(this==x) {\n return true;\n }\n Matrix L=(Matrix) x;\n for(int i=1;i<L.newsize;i++) {\n List first=L.row[i];\n List second=this.row[i];\n if(first.equals(second)==false)\n return false;\n }\n return true;\n }", "@Override\n public final boolean equals(final Object other) {\n return super.equals(other);\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tState State = (State) obj;\n\t\tSquare aux = null;\n\t\tboolean isequal = true;\n\t\tif (getTractor().getColumn()!=State.getTractor().getColumn() || getTractor().getRow()!=State.getTractor().getRow())\n\t\t\tisequal = false;\n\t\telse {\n\t\t\tfor (int i = 0;i<getRows() && isequal; i++) {\n\t\t\t\tfor (int j = 0;j < getColumns() && isequal; j++) {\n\t\t\t\t\taux = new Square (i,j);\n\t\t\t\t\tif (cells[i][j].getSand() != State.getSquare(aux).getSand()) \n\t\t\t\t\t\tisequal = false; \n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t\treturn isequal;\n\t}", "public abstract boolean equals(Object other);", "@Override\n public boolean equals(Object o) {\n //if the other object is null, they're not equal\n if (o == null) { return false; }\n\n //check if it's a coordinate and if so, if it's a matching coordinate\n if (o instanceof Coordinate) {\n Coordinate other = (Coordinate) o;\n return col == other.col && row == other.row;\n }\n\n return false;\n }", "@Override\n public abstract boolean equals(Object obj);", "public void testEqualsObject()\n {\n // Null check\n assertFalse(b1.equals(null));\n // Type mismatch\n assertFalse(b1.equals(\"a\"));\n\n // Reflexive\n assertTrue(b1.equals(b1));\n\n // In general, two empty boards\n assertTrue(b1.equals(b2));\n\n // Different contents\n b1.setCell(0, 0, Cell.RED1);\n assertFalse(b1.equals(b2));\n\n // Same Contents\n b2.setCell(0, 0, Cell.RED1);\n assertTrue(b1.equals(b2));\n\n // Some more complex cases\n b1.fromString(\"RRRBEEBBE\");\n assertFalse(b1.equals(b2));\n b2.fromString(\"RRRBEEBBE\");\n assertTrue(b1.equals(b2));\n\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tMove other = (Move) obj;\n\t\tif (col != other.col)\n\t\t\treturn false;\n\t\tif (row != other.row)\n\t\t\treturn false;\n\t\treturn true;\n\t}", "@Override\n boolean equals(Object other);", "@Override\n public boolean equals(Object o) {\n\tif (o == null)\n\t return false; \n\telse {\n\t Square p = (Square) o; \n\t return ( (rowIndex == p.rowIndex) && (colIndex == p.colIndex) );\n\t} \n }", "public abstract boolean equals(Object o);", "@Override\n public abstract boolean equals(final Object o);", "@Override\n public abstract boolean equals(final Object o);", "@Override\n public boolean equals(Object obj) {\n if (!(obj instanceof BoardPosition))\n return false;\n BoardPosition b = (BoardPosition) obj;\n return (this.getRow() == b.getRow()) && (this.getColumn() == b.getColumn()) && (this.getPlayer() == b.getPlayer());\n }", "@Override\n boolean equals(Object o);", "@Override\n public boolean equals(Object other) {\n return this == other;\n }", "@Override \n boolean equals(Object obj);", "@Override\n public boolean equals(Object other) {\n return super.equals(other);\n }", "@Override\n boolean equals(Object obj);", "@Override\n public boolean equals(Object obj) {\n return this == obj;\n }", "@Override\n public boolean equals(Object o) {\n return this == o;\n }", "@Override\n public boolean equals(Object o) {\n if (!(o instanceof Matrix)) return false;\n Matrix B = (Matrix) o;\n Matrix A = this;\n if (B.M != A.M || B.N != A.N) return false;\n for (int i = 0; i < M; i++)\n for (int j = 0; j < N; j++)\n if (A.data[i][j] != B.data[i][j]) return false;\n return true;\n }", "@Override\n public boolean equals(final Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final Result other = (Result) obj;\n if (!Arrays.deepEquals(this.cellAnnotations, other.cellAnnotations)) {\n return false;\n }\n if (this.columnRelationAnnotations == null) {\n if (other.columnRelationAnnotations != null) {\n return false;\n }\n } else if (!this.columnRelationAnnotations.equals(other.columnRelationAnnotations)) {\n return false;\n }\n if (this.headerAnnotations == null) {\n if (other.headerAnnotations != null) {\n return false;\n }\n } else if (!this.headerAnnotations.equals(other.headerAnnotations)) {\n return false;\n }\n if (this.subjectColumnsPositions == null) {\n if (other.subjectColumnsPositions != null) {\n return false;\n }\n } else if (!this.subjectColumnsPositions.equals(other.subjectColumnsPositions)) {\n return false;\n }\n if (this.statisticalAnnotations == null) {\n if (other.statisticalAnnotations != null) {\n return false;\n }\n } else if (!this.statisticalAnnotations.equals(other.statisticalAnnotations)) {\n return false;\n }\n if (this.columnProcessingAnnotations == null) {\n if (other.columnProcessingAnnotations != null) {\n return false;\n }\n } else if (!this.columnProcessingAnnotations.equals(other.columnProcessingAnnotations)) {\n return false;\n }\n if (this.warnings == null) {\n if (other.warnings != null) {\n return false;\n }\n } else if (!this.warnings.equals(other.warnings)) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object obj) {\n return this == obj;\n }", "public boolean equals(Object obj){\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (obj == this)\n\t\t\treturn true;\n\t\tif (!(obj instanceof Date))\n\t\t return false;\n\t\tFlatCell flatCell = (FlatCell) obj;\n\t\treturn (flatCell.day == this.day && flatCell.flatCalendar == this.flatCalendar);\n\t}", "public boolean equals(@org.jetbrains.annotations.Nullable java.lang.Object r3) {\n /*\n r2 = this;\n if (r2 == r3) goto L_0x001f\n boolean r0 = r3 instanceof com.bitcoin.mwallet.core.models.user.User\n if (r0 == 0) goto L_0x001d\n com.bitcoin.mwallet.core.models.user.User r3 = (com.bitcoin.mwallet.core.models.user.User) r3\n com.bitcoin.mwallet.core.models.user.UserId r0 = r2.f373id\n com.bitcoin.mwallet.core.models.user.UserId r1 = r3.f373id\n boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r1)\n if (r0 == 0) goto L_0x001d\n com.bitcoin.mwallet.core.models.credential.CredentialId r0 = r2.credentialId\n com.bitcoin.mwallet.core.models.credential.CredentialId r3 = r3.credentialId\n boolean r3 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r3)\n if (r3 == 0) goto L_0x001d\n goto L_0x001f\n L_0x001d:\n r3 = 0\n return r3\n L_0x001f:\n r3 = 1\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.bitcoin.mwallet.core.models.user.User.equals(java.lang.Object):boolean\");\n }", "@Test\n public void testEqualsReturnsTrueOnSelfArg() {\n boolean equals = record.equals(record);\n\n assertThat(equals, is(true));\n }", "public boolean equals(Object obj) {\n\n if (obj instanceof Location) {\n\n Location other = (Location) obj;\n\n return row == other.getRow() && col == other.getCol();\n\n } else {\n\n return false;\n\n }\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof Matrix)) return false;\n\n Matrix matrix = (Matrix) o;\n\n if (m != matrix.m) return false;\n if (n != matrix.n) return false;\n\n return Arrays.deepEquals(data, matrix.data);\n }", "@Override\n public boolean equals(Object other) {\n if (other.getClass() == getClass()) {\n return hashCode() == other.hashCode();\n }\n\n return false;\n }", "@Override\n\tpublic boolean equal() {\n\t\treturn false;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Relation)) {\r\n return false;\r\n }\r\n Relation other = (Relation) object;\r\n return !((this.relationPK == null && other.relationPK != null) || (this.relationPK != null && !this.relationPK.equals(other.relationPK)));\r\n }", "@Test \n\tpublic void checkEquality() {\n\t\tassertTrue(testCell.equals(testCell));\n\t\tassertFalse(testCell.equals(new Cell(false)));\n\n\t}", "@Override\n public final boolean equals( Object obj ) {\n return super.equals(obj);\n }", "protected abstract boolean isEqual(E entryA, E entryB);", "public boolean equals(Object o) {\n if (o == this) {\n return true;\n }\n if (o instanceof SortKey) {\n return (((SortKey) o).column == column && ((SortKey) o).sortOrder == sortOrder);\n }\n return false;\n }", "@Override\n public boolean equals(Object object)\n {\n if (!(object instanceof MatchEntryPK))\n {\n return false;\n }\n MatchEntryPK other = (MatchEntryPK) object;\n if (this.id != other.id)\n {\n return false;\n }\n if (this.formatId != other.formatId)\n {\n return false;\n }\n return this.formatGameId == other.formatGameId;\n }", "@Test\n public void testEqualsReturnsTrueOnIdenticalRecords() {\n boolean equals = record.equals(otherRecord);\n\n assertThat(equals, is(true));\n }", "@Override\n public boolean equals(Object obj) {\n return super.equals(obj);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Driver)) {\n return false;\n }\n Driver other = (Driver) object;\n if ((this.driverPK == null && other.driverPK != null) || (this.driverPK != null && !this.driverPK.equals(other.driverPK))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Item)) {\n return false;\n }\n Item other = (Item) object;\n if ((this.itemPK == null && other.itemPK != null) || (this.itemPK != null && !this.itemPK.equals(other.itemPK))) {\n return false;\n }\n return true;\n }", "public boolean equals(Object y) {\n if (y == this) return true;\n if (y == null) return false;\n if (y.getClass() != this.getClass()) return false;\n Board other = (Board) y;\n if (this.N != other.N) return false;\n for (int row = 0; row < N; ++row) {\n for (int col = 0; col < N; ++col) {\n if (this.tiles[row][col] != other.tiles[row][col]) {\n return false;\n }\n }\n }\n return true;\n }", "@Override\n public final boolean equals(Object obj) {\n return super.equals(obj);\n }", "@Override\n\tpublic boolean equals(Object o) {\n\t\treturn super.equals(o);\n\t}", "@Test\n public void testEquals_2()\n throws Exception {\n ColumnPreferences fixture = new ColumnPreferences(\"\", \"\", 1, ColumnPreferences.Visibility.HIDDEN, ColumnPreferences.Hidability.HIDABLE);\n fixture.setVisible(true);\n Object obj = new Object();\n\n boolean result = fixture.equals(obj);\n\n assertEquals(false, result);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof TableLayout)) {\n return false;\n }\n TableLayout other = (TableLayout) object;\n if ((this.layoutId == null && other.layoutId != null) || (this.layoutId != null && !this.layoutId.equals(other.layoutId))) {\n return false;\n }\n return true;\n }", "@Test\n public void equalsTest() {\n prepareEntitiesForEqualityTest();\n\n assertEquals(entity0, entity1);\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\r\n\t}", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\r\n\t}", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\r\n\t}", "public boolean equals(Object object) {\n/* 4770 */ if (this == object)\n/* */ {\n/* 4772 */ return true;\n/* */ }\n/* 4774 */ if (object != null && object.getClass() == getClass()) {\n/* */ \n/* 4776 */ VolaTile tile = (VolaTile)object;\n/* 4777 */ return (tile.getTileX() == this.tilex && tile.getTileY() == this.tiley && tile.surfaced == this.surfaced);\n/* */ } \n/* 4779 */ return false;\n/* */ }", "@Override\n\t\tpublic boolean equals(Object obj) {\n\t\t\treturn super.equals(obj);\n\t\t}", "@Override public boolean equals(Object o) { // since 1.3.1\n // should these ever match actually?\n return (o == this);\n }", "public boolean equals(Object y) {\n if (y == this) return true;\n if (y == null) return false;\n if (y.getClass() != this.getClass()) return false;\n Board that = (Board) y;\n if (this.dimension() != that.dimension()) return false;\n int sz = this.dimension();\n for (int i = 0; i < sz; i++) {\n for (int j = 0; j < sz; j++) {\n if (this.matrix[i][j] != that.matrix[i][j])\n return false;\n }\n }\n return true;\n }", "@Override\n public boolean equals(Object obj) {\n \n //TODO: Complete Method\n \n return true;\n }", "public boolean equals(XObject obj2) {\n/* */ try {\n/* 262 */ if (4 == obj2.getType())\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 268 */ return obj2.equals(this);\n/* */ }\n/* 270 */ if (1 == obj2.getType())\n/* */ {\n/* 272 */ return (bool() == obj2.bool());\n/* */ }\n/* 274 */ if (2 == obj2.getType())\n/* */ {\n/* 276 */ return (num() == obj2.num());\n/* */ }\n/* 278 */ if (4 == obj2.getType())\n/* */ {\n/* 280 */ return xstr().equals(obj2.xstr());\n/* */ }\n/* 282 */ if (3 == obj2.getType())\n/* */ {\n/* 284 */ return xstr().equals(obj2.xstr());\n/* */ }\n/* 286 */ if (5 == obj2.getType())\n/* */ {\n/* */ \n/* */ \n/* 290 */ return xstr().equals(obj2.xstr());\n/* */ }\n/* */ \n/* */ \n/* 294 */ return super.equals(obj2);\n/* */ \n/* */ }\n/* 297 */ catch (TransformerException te) {\n/* */ \n/* 299 */ throw new WrappedRuntimeException(te);\n/* */ } \n/* */ }", "@Test\n public void testEquals_4()\n throws Exception {\n ColumnPreferences fixture = new ColumnPreferences(\"\", \"\", 1, ColumnPreferences.Visibility.HIDDEN, ColumnPreferences.Hidability.HIDABLE);\n fixture.setVisible(true);\n Object obj = new ColumnPreferences(\"\", \"\", 1, ColumnPreferences.Visibility.HIDDEN, ColumnPreferences.Hidability.HIDABLE);\n\n boolean result = fixture.equals(obj);\n\n assertEquals(true, result);\n }", "@Override\r\n public boolean equals(Object obj) {\r\n return super.equals(obj);\r\n }", "public boolean equals(Object other) {\n if (other == this) return true;\n if (other == null) return false;\n if (other.getClass() != this.getClass()) return false;\n Board that = (Board) other;\n if (this.dimension() != that.dimension()) return false;\n for (int i = 0; i < dimension(); i++){\n for (int j = 0; j < dimension(); j++){\n if (that.blocks[i][j] != blocks[i][j])\n return false;\n }\n }\n return true;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\n\t}", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\n\t}", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\n\t}", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\n\t}", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\n\t}", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\n\t}", "@Override\n public boolean equals(Object obj) {\n return super.equals(obj);\n }", "@Override\n public boolean equals(final Object obj) {\n return super.equals(obj);\n }", "@Test\n\tpublic void test_TCM__boolean_equals_Object() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\");\n\n assertFalse(\"attribute equal to null\", attribute.equals(null));\n\n final Object object = attribute;\n assertTrue(\"object not equal to attribute\", attribute.equals(object));\n assertTrue(\"attribute not equal to object\", object.equals(attribute));\n\n // current implementation checks only for identity\n// final Attribute clonedAttribute = (Attribute) attribute.clone();\n// assertTrue(\"attribute not equal to its clone\", attribute.equals(clonedAttribute));\n// assertTrue(\"clone not equal to attribute\", clonedAttribute.equals(attribute));\n\t}", "@Override\n public boolean equals(Object o) {\n final BoardCell secondCell = (BoardCell) o;\n return((this.xCor==secondCell.xCor)\n &&(this.yCor==secondCell.yCor));\n }", "@Override\n public boolean equals(Object inst) {\n if (inst == this)\n {\n return true;\n }\n if (!(inst instanceof BoardPosition))\n {\n return false;\n }\n BoardPosition pos = (BoardPosition) inst;\n return column == pos.column && row == pos.row;\n }", "@Test\n public void testEquals() {\n ColumnType typeBool = new ColumnType(-7, \"bool\");\n ColumnType typeBoolean = new ColumnType(16, \"boolean\");\n ColumnType typeBool2 = new ColumnType(-7, \"bool\");\n assertEquals(\"Expected bool types are equal\", typeBool, typeBool2);\n assertNotSame(\"Expected bool and boolean are not equal\", typeBool, typeBoolean);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof AdDatasetTable)) {\r\n return false;\r\n }\r\n AdDatasetTable other = (AdDatasetTable) object;\r\n if ((this.adDatasetTableId == null && other.adDatasetTableId != null) || (this.adDatasetTableId != null && !this.adDatasetTableId.equals(other.adDatasetTableId))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object obj) {\n if (!(obj instanceof Entry<?>)) {\n return false;\n }\n\n var entry = (Entry<?>) obj;\n\n if (!this.registry.equals(entry.registry)) {\n return false;\n }\n\n if (this.index != entry.index) {\n return false;\n }\n\n if (this.value.getClass() != entry.value.getClass()) {\n return false;\n }\n\n return true;\n }", "public boolean equals(Object y) {\n if (y == this) return true;\n if (y == null) return false;\n if (y.getClass() != this.getClass()) return false;\n Board that = (Board) y;\n if (that.dimension() != this.dimension())\n return false;\n for (int i = 0; i < this.N; i++) {\n for (int j = 0; j < this.N; j++) {\n if (this.tiles[i][j] != that.tiles[i][j]) {\n return false;\n }\n }\n }\n return true;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj instanceof RevisionData) {\n\t\t\treturn this.getRevision().equals(((RevisionData) obj).getRevision());\n\t\t}\n\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean equals(Object obj){\n\t\treturn super.equals(obj);\n\t}", "public boolean equal(int row, int col){ \n return this.row == row && this.col == col;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof TblTipoExamenes)) {\r\n return false;\r\n }\r\n TblTipoExamenes other = (TblTipoExamenes) object;\r\n if ((this.idTipoExamen == null && other.idTipoExamen != null) || (this.idTipoExamen != null && !this.idTipoExamen.equals(other.idTipoExamen))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn EqualsBuilder.reflectionEquals(this, obj);\n\t}", "@Override\n public boolean equals(Object object)\n {\n if (!(object instanceof ProductsFactorTbl))\n {\n return false;\n }\n ProductsFactorTbl other = (ProductsFactorTbl) object;\n if ((this.idProductsFactor == null && other.idProductsFactor != null) || (this.idProductsFactor != null && !this.idProductsFactor.equals(other.idProductsFactor)))\n {\n return false;\n }\n return true;\n }", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof GroupTablePK)) {\r\n return false;\r\n }\r\n GroupTablePK other = (GroupTablePK) object;\r\n if ((this.idUser == null && other.idUser != null) || (this.idUser != null && !this.idUser.equals(other.idUser))) {\r\n return false;\r\n }\r\n if ((this.idGroup == null && other.idGroup != null) || (this.idGroup != null && !this.idGroup.equals(other.idGroup))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n try {\n final CustomerTabu other = (CustomerTabu) obj;\n if (this.getCustomer() != other.getCustomer()) {\n return false;\n }\n try {\n final CustomerRouteTabu other2 = (CustomerRouteTabu) obj;\n if (this.getRoute() != other2.getRoute()) {\n return false;\n }\n try {\n final CustomerRouteTabuPosition other3 = (CustomerRouteTabuPosition) obj;\n if (this.laterCustomer != other3.laterCustomer || \n this.previousCustomer != other3.previousCustomer) {\n return false;\n }\n return true;\n } catch (ClassCastException cce) {\n return true;\n }\n } catch (ClassCastException cce) {\n return true;\n }\n } catch (ClassCastException cce) {\n return false;\n }\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif(obj!=null && obj instanceof Test1){\n\t\t\tTest1 obj2 = (Test1)obj;\n\t\t\tif(x==obj2.x && y==obj2.y){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public abstract boolean equals(Object abc);", "@Override\n public boolean equals(Object other) {\n return this == other || (other instanceof TdOrder && hashCode() == other.hashCode());\n }", "@Override\n public boolean equals(Object o) {\n return true;\n }" ]
[ "0.7989067", "0.7596177", "0.73764366", "0.71412146", "0.71147376", "0.6808455", "0.67554444", "0.6605768", "0.652433", "0.6513969", "0.6513969", "0.6461881", "0.64483416", "0.6446753", "0.64393616", "0.6427913", "0.640866", "0.6408487", "0.6402441", "0.63966894", "0.63916314", "0.6382646", "0.638114", "0.63626677", "0.635829", "0.635829", "0.6354264", "0.6351375", "0.6344372", "0.6319721", "0.6308709", "0.62866604", "0.6263767", "0.6256726", "0.6245071", "0.6239934", "0.62344927", "0.62127227", "0.62061816", "0.61974317", "0.61967385", "0.6195375", "0.6193875", "0.61905557", "0.61860794", "0.6180763", "0.61706346", "0.6169448", "0.61619335", "0.61572105", "0.6132363", "0.6120098", "0.6115331", "0.6096546", "0.60891694", "0.606545", "0.6060882", "0.60549057", "0.6053312", "0.605241", "0.60415804", "0.60415804", "0.60415804", "0.6040168", "0.60382134", "0.6035961", "0.60356003", "0.60328084", "0.6025193", "0.6024558", "0.6020439", "0.6012554", "0.60106766", "0.60106766", "0.60106766", "0.60106766", "0.60106766", "0.60106766", "0.60031575", "0.60020053", "0.5998894", "0.59939456", "0.59856355", "0.59720224", "0.5967973", "0.59593767", "0.5959178", "0.595447", "0.5951802", "0.59469056", "0.5941348", "0.59383017", "0.5937843", "0.5935705", "0.5935674", "0.59250885", "0.59150344", "0.59025687", "0.59009826", "0.58996797" ]
0.8028251
0
return null; List allmovie=movieRepository.findAll();
@Override public List<Movie> getAllMovie() { return movieRepository.findAll();}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Transactional(readOnly = true)\n public List<Movie> findAll() {\n log.debug(\"Request to get all MovieS\");\n return movieRepository.findAll();\n }", "@GetMapping(\"/\")\n\tpublic List<Movie> getListMovie(){\n\t\tList<Movie> list = repo.findAll();\n\t\t\n\t\treturn list;\n\t}", "@Override\n\tpublic List<Movie> findAllMovie() {\n\t\treturn repository.findAllMovie();\n\t}", "@GetMapping\n\tpublic ResponseEntity<List<Movie>> fetchAllMovies(){\n\t\treturn new ResponseEntity<List<Movie>>(movieService.listAllMovies(), HttpStatus.OK);\n\t}", "@Override\n public List<Caja> buscarMovimientos(){\n List<Caja> listaCaja= cajaRepository.findAll();\n\n return listaCaja;\n\n }", "public List<Movie> getMovies();", "List<Movie> getMovie(String movieId);", "@GetMapping(\"/movies\")\n public List<Movie> getAllMovies() {\n movies = new ArrayList<Movie>();\n movies.add(new Movie(1,\"The Godfather\",\"Crime/Thriller\"));\n movies.add(new Movie(2,\"Star Wars\",\"Sci-Fi\"));\n movies.add(new Movie(3,\"The Mask\",\"Comedy\"));\n movies.add(new Movie(4,\"Die Hard\",\"Action\"));\n movies.add(new Movie(5,\"The Exorcist\",\"Horror\"));\n movies.add(new Movie(6,\"The Silence of the Lambs\",\"Drama\"));\n\n return movies;\n }", "@Override\n\tpublic List<Movie> getAllMovies() {\n\t\treturn movieRepository.getAllMovies();\n\t}", "List<Movie> getAllMovies(String name, String director, String movieId);", "public List<CategoriaUsuario> findall(){\n return categoriaUsuarioRepository.findAll();\n }", "@Override\n\tpublic List<MovieBean> listOfMovies() {\n\n\t\treturn dao.listOfMovies();\n\t}", "public interface MovieRepository extends JpaRepository<Movie, Long> {\n Movie findByTitle(String title);\n}", "public List<Employee> listAllCrud(){\n return employeeCrudRepository.findAll();\n }", "List<Reservation> findByMovie(Movie movie);", "public List<Employee> listAll(){\n return employeeRepository.findAll();\n }", "public List<Categoria> listarCategorias(){\n //este metodo devuelve una lista.\n return categoriaRepo.findAll(); \n\n }", "public List<Film> findAllByGenre(String genre);", "@GetMapping(\"/movies\")\n @Timed\n public List<Movie> getAllMovies() {\n log.debug(\"REST request to get all Movies\");\n List<Movie> movies = movieRepository.findAll();\n return movies;\n }", "public ResponseEntity<List<Movie>> getAllMovies() {\n List<Movie> movies = movieRepository.findAll();\n return new ResponseEntity<>(movies, HttpStatus.OK);\n }", "public interface FilmRepository extends JpaRepository<Film , Integer> {\n\n Page<Film> findByYear(Short year, Pageable pageable);\n\n List<Film> findByYear(Short year);\n\n List<Film> findFilmDistinctByYearIsNotNull();\n\n\n @Query(value = \"Select DISTINCT(f.year) From Film f ORDER BY f.year desc \")\n List<Short> findYearDistinct();\n\n @Query(value = \"Select h.name From f_entity_human h where h.jobs = '导演' ORDER BY h.name desc \")\n List<String> findDirectorDistinct();\n\n}", "@Override\r\n\tpublic List<Film> findAllFilms() {\n\t\treturn filmRepository.findAll();\r\n\t}", "public List<PedidoMaterialModel> findAll(){\n \n List<PedidoMaterialModel> pedidosM = new ArrayList<>();\n \n return pedidosM = pedidoMaterialConverter.entitiesToModels(pedidoMaterialRepository.findAll());\n }", "public List<CatMovie> getAllCatMovies() throws DalException\n {\n ArrayList<CatMovie> allCatMovies = new ArrayList<>();\n // Attempts to connect to the database.\n try ( Connection con = dbCon.getConnection())\n {\n // SQL code. \n String sql = \"SELECT * FROM CatMovie;\";\n // Create statement.\n Statement statement = con.createStatement();\n // Attempts to execute the statement.\n ResultSet rs = statement.executeQuery(sql);\n while (rs.next())\n {\n // Add all to a list\n CatMovie catMovie = new CatMovie();\n catMovie.setCategoryId(rs.getInt(\"categoryId\"));\n catMovie.setMovieId(rs.getInt(\"movieId\"));\n\n allCatMovies.add(catMovie);\n }\n //Return\n return allCatMovies;\n\n } catch (SQLException ex)\n {\n Logger.getLogger(CatMovieDBDAO.class\n .getName()).log(Level.SEVERE, null, ex);\n throw new DalException(\"Can´t do that\");\n }\n }", "public List<Car>getAllCars(){\r\n return (List<Car>) repository.findAll();\r\n }", "@Override\n public List<Movie> findAllById(Iterable<Integer> id) {\n return movieRepository.findAllById(id);\n }", "@Test\n\tpublic void findAll() {\n\t\tList<Farm> list = (List<Farm>) farmRepository.findAll();\n\n\t\tSystem.out.println(\"info:\"+ list);\n\t\tassert(true);\n\n\t}", "public List<Ramen> getAllRamen(){\r\n //return ramens;\r\n // Originally (above) for hardcoded list, but now it's looking into Crud Repository\r\n List<Ramen> ramens = new ArrayList<>();\r\n ramenRepository.findAll() //An iterable\r\n .forEach(ramens::add); //Lambda expression. For each in iterable, adds to ramens\r\n return ramens;\r\n }", "public List<Movie> getAllMovies() {\n SQLiteDatabase database = this.getWritableDatabase();\n List<Movie> movieList = new ArrayList<>();\n String selectQuery = \" SELECT * FROM \" + MoviesEntry.TABLE_NAME;\n Cursor cursor = database.rawQuery(selectQuery, null);\n\n if (cursor.moveToFirst()) {\n do {\n Movie movie = getMovieFromCursor(cursor);\n movieList.add(movie);\n } while (cursor.moveToNext());\n }\n database.close();\n\n return movieList;\n }", "@Override\n public MovieListing getMovies() {\n // inventory.whatsAvailable()\n // inventory.whatIsUnavailable();\n return movieRepo.getMovies();\n }", "public ResultSet getFullMovieList(){\r\n\t\t\r\n\t\ttry{\r\n\t\t\t//Connect();\r\n\t\t\tStatement dbStatement = conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE,\r\n\t\t\t\tResultSet.CONCUR_READ_ONLY );\r\n\t\t\t//DatabaseMetaData m = conn.getMetaData();\r\n\t\t\t//m.getColumns();\r\n\r\n\t\t\treturn dbStatement.executeQuery(\"select movieid, title from movie_title\");\r\n\r\n\t\t}catch( Exception x ){\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t}", "public interface MovieRepository extends JpaRepository<MoviePo,Integer> {\n\n @Query(\"select m.identifier from MoviePo m\")\n List<String> findIdentifier();\n\n MoviePo findByIdentifier(String identifier);\n\n}", "public List<TodoItemEntity> findAll(){\n return todoItemRepository.findAll();\n }", "List<T> findAll() ;", "public List<Movie> getMovies() {\n return movies;\n }", "private List<MusicVideo> selectAllMusicVideosFromDB(){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query<MusicVideo> query = session.createQuery(\"FROM MusicVideo mv JOIN FETCH mv.artiste JOIN FETCH mv.genre\", MusicVideo.class) ;\n List<MusicVideo> listOfMusicVideos = query.getResultList() ;\n session.close() ;\n return listOfMusicVideos ;\n }", "public List<Rating> findRatingByMovie(String movieID);", "public List<Usuario> listarUsuario() {\n \n List<Usuario> lista = usuarioDAO.findAll();\n return lista;\n \n \n\n }", "@Nullable\n MoviePage getMovies();", "public List<News> getAll()\n {\n\n return newsRepository.findAllByOrderByIdAsc();\n }", "@Override\n public List<Promocion> findAll() {\n return promocionRepository.findAll();\n }", "@GetMapping(\"/listAllMovies\")\n public String showAllMovies(Model model) {\n\n Iterable<Movie> movielist = movieRepo.findAll();\n\n model.addAttribute(\"allmovies\", movielist);\n return \"listAllMovies\";\n }", "public Movie findByTitle(String title);", "public interface MovieDao{\n\n int deleteByPrimaryKey(Integer id);\n\n int insert(Movie record);\n\n Movie selectByPrimaryKey(Integer id);\n\n /**\n * 分页查询所有\n * @return\n */\n Page<Movie> selectAllMovie();\n\n /**\n * 查询大图\n * @return\n */\n List<Movie> selectIndexMovie();\n\n /**\n * 通过电影名字查询\n * @param name\n * @return\n */\n Movie selectByName(String name);\n}", "@Override\n\tpublic List<Oeuvre> findAll() {\n\t\treturn oeuvreDao.findAll();\n\t}", "@GetMapping(\"/favourites\")\n public ResponseEntity<List<Favourite>> getAll() {\n\n\n logger.info(\"The Favourite List is Successfully found.\");\n\n return new ResponseEntity<>( favouriteDao.getAll(), HttpStatus.OK);\n }", "@Override\n\tpublic Page<Movie> findAll(Pageable pageable) {\n\t\treturn null;\n\t}", "List<MovieCinema> findAllByMovieNameContaining(String name);", "@Override\n @Transactional(readOnly = true)\n public List<MuseumDTO> findAll() {\n log.debug(\"Request to get all Museums\");\n return museumRepository.findAll().stream()\n .map(museumMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public ArrayList<String> getMovies(){\n\t\tArrayList<String> movies = new ArrayList<String>();\n\t\tString sql = \"SELECT * FROM movies\";\n\t\tPreparedStatement ps = null;\n\t\ttry {\n\t\t\tps = conn.prepareStatement(sql);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\twhile(rs.next()){\n\t\t\t\tmovies.add(rs.getString(\"name\"));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tps.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn movies;\t\n\t}", "@Override\n\tpublic List<MedioPago> getall() {\n\t\treturn (List<MedioPago>) iMedioPagoDao.findAll();\t\t\n\t}", "public List<Musuarios> findAll2() {\n Query q = em.createQuery(\"SELECT m FROM Musuarios m\");\n //q.setParameter(\"Rut_Usuario\",\"13274161-1\");\n //List<Musuarios> usr;\n //objmusuarios = new Musuarios[10];\n List<Musuarios> usr = q.getResultList();\n //for(int i = 0; i++; i > usr.\n return usr;\n }", "@Transactional(readOnly = true) \r\n public List<OsiMenuEntriesDTO> findAll() {\r\n log.debug(\"Request to get all OsiMenuEntries\");\r\n /* List<OsiMenuEntriesDTO> result = osiMenuEntriesRepository.findAll().stream()\r\n .map(osiMenuEntriesMapper::osiMenuEntriesToOsiMenuEntriesDTO)\r\n .collect(Collectors.toCollection(LinkedList::new));\r\n\r\n return result;*/\r\n return null;\r\n }", "public List findAll() {\n\t\treturn null;\r\n\t}", "public List<Movie> getMovie(String name){\n return _movieRepo.getMovie(name);\n }", "@Test\n public void test3FindAll() {\n SpecialityFactory factory = new MysqlSpecialityDAOFactry();\n SpecialityDAO dao = factory.create();\n List<SpecialityDTO> lista=(List<SpecialityDTO>)dao.findAll(); \n System.out.println(lista);\n assertTrue(!lista.isEmpty());\n }", "@Override\n\tpublic List<Dispositivo> getAll() {\n\t\treturn (List<Dispositivo>) dispositivoDao.findAll();\n\t}", "@Repository(\"videoRepository\")\npublic interface VideoRepository extends JpaRepository<Video,Long> {\n List<Video> findAll();\n\n Video findByVideoid(String s);\n\n// ArrayList<String> findAllVideoId();\n\n @Query(\"SELECT videoid FROM Video\")\n ArrayList<String> findAllVideoId();\n}", "public interface UniversidadRepository extends CrudRepository<Universidad,String> {\n\n List<Universidad> findAll();\n\n}", "public List<StatusDemande> getStatusDemandes(){\n return statusDemandeRepository.findAll();\n }", "@Override\n\tpublic Movie searchMovieById(int movieid) {\n\t\tString sql=\"Select * from movie where MOVIE_ID=\"+movieid+\"\";\n\t\tJdbcTemplate jdbcTemplate=JdbcTemplateFactory.getJdbcTemplate();\n\t\tList<Movie> idMList=jdbcTemplate.query(sql, new MovieRowMapper());\n\t\tif(idMList==null||idMList.isEmpty()){\n\t\t\treturn null;\n\t\t}\n\t\treturn idMList.get(0);\n\t}", "public List<E> findAll() ;", "@Transactional(readOnly = true)\n public List<HarnaisDTO> findAll() {\n log.debug(\"Request to get all Harnais\");\n return harnaisRepository.findAll().stream()\n .map(harnaisMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public List<EspecieEntity> encontrarTodos(){\r\n Query todos =em.createQuery(\"select p from EspecieEntity p\");\r\n return todos.getResultList();\r\n }", "@Dao\npublic interface MovieDao {\n\n\n @Insert\n void insert(Movie... movies);\n\n @Query(\"SELECT * FROM Movie WHERE id = :Id\")\n Maybe<Movie> ISFavorit(int Id);\n\n\n @Query(\"SELECT * FROM Movie\")\n Flowable<List<Movie>> getAll();\n\n @Delete\n void delete(Movie movie);\n}", "public List<Skill> findAll(){\n return (List<Skill>) skillRepository.findAll();\n }", "public List<TVShow> getAllShows(){\n\tList<TVShow> shows = new ArrayList<>();\n\ttvShowRepo.findAll().forEach(show->shows.add(show));\n\treturn shows;\n}", "public List findAll() {\n\t\treturn dao.findAll();\r\n\t}", "List<Videoinfo> selectAll();", "@Dao\npublic interface MovieDao {\n\n @Insert(onConflict = REPLACE)\n void insert(Movie movie);\n\n @Delete\n void delete(Movie movie);\n\n @Query(\"DELETE FROM movie\")\n void deleteAll();\n\n @Query(\"DELETE FROM movie WHERE id =:id\")\n void deleteByID(String id);\n\n @Update\n void update(Movie movie);\n\n @Query(\"SELECT * FROM movie\")\n Flowable<List<Movie>> getAll();\n\n @Query(\"SELECT * FROM movie WHERE id =:ids\")\n Movie getById(int ids);\n\n @Insert(onConflict = REPLACE)\n void insertGenres(Genres.Genre genre);\n\n @Query(\"SELECT * FROM genre\")\n Single<List<Genres.Genre>> getAllGenre();\n\n\n}", "@Dao\npublic interface MovieDao {\n @Query(\"select * from movies\")\n LiveData<List<MovieEntity>> load();\n\n @Insert(onConflict = OnConflictStrategy.REPLACE)\n void insertAll(List<MovieEntity> movies);\n\n @Query(\"select * from movies where rating >= :min and rating <= :max\")\n LiveData<List<MovieEntity>> getWithRatingsFilter(int min, int max);\n\n @Query(\"select * from movies where releaseYear >= :min and releaseYear <= :max\")\n LiveData<List<MovieEntity>> getWithYearFilter(int min, int max);\n\n @Query(\"select releaseYear from movies order by releaseYear asc limit 1\")\n int getMinReleaseYear();\n\n @Query(\"select releaseYear from movies order by releaseYear desc limit 1\")\n int getMaxReleaseYear();\n\n @Query(\"select rating from movies order by rating asc limit 1\")\n double getMinRating();\n\n @Query(\"select rating from movies order by rating desc limit 1\")\n double getMaxRating();\n\n @Query(\"select genre from movies\")\n List<String> getGenres();\n\n @Query(\"select * from movies where genre like :genre\")\n LiveData<List<MovieEntity>> getWithGenreFilter(String genre);\n\n @Query(\"delete from movies\")\n void deleteAll();\n}", "@Override\n\tpublic List<Movie> findAllMovieByType(String type) {\n\t\tList<Movie> movies= repository.findAllMovieByType(type);\n\t\tif(movies.size()==0){\n\t\t\treturn null;\n\t\t}\n\t\treturn movies;\n\t\t\n\t}", "@Secured({\"ROLE_USER\", \"ROLE_ADMIN\"}) \r\n\tMovie findByMovieID(Long movieID);", "@Transactional(readOnly = true)\n public List<Exam> findAll() {\n log.debug(\"Request to get all Exams\");\n return examRepository.findAll();\n }", "public Movie getMovie() { return movie; }", "public List<Producto> traerTodos () {\n \n return jpaProducto.findProductoEntities();\n \n \n \n }", "List<Product> findAll();", "List<Product> findAll();", "@Override\r\n\tpublic Object getQuestionear() throws DataAccessException,SQLException {\n\t\tlogger.info(\"start : getQuestionear UsersMngDaoImpl \");\r\n\t\tObject obj = questionRepository.findAll();\r\n\t\tlogger.info(\"End : getQuestionear UsersMngDaoImpl \");\r\n\t\treturn obj;\r\n\t}", "List<Video> getAll();", "public List<Books> showAllBooks(){\n String sql=\"select * from Book\";\n BaseDao baseDao=dao.executeQuery(sql,new Object[]{});\n List<Books> list=new ArrayList<>();\n list=resultSetToBook(baseDao);\n return list;\n }", "List<Book> findAll();", "public interface VideoRepository extends JpaRepository<VideoPO, Integer> {\n\n public VideoPO findByVideoName(String videoName);\n\n public List<VideoPO> findByChapterId(Integer userId);\n public List<VideoPO> findByCourseId(Integer courseId);\n}", "List<T> findAll();", "List<T> findAll();", "List<T> findAll();", "public List <reclamation> findall(){\n\t\tList<reclamation> a = reclamationRepository.findAll();\n\t\t\n\t\tfor(reclamation reclamations : a)\n\t\t{\n\t\t\tL.info(\"reclamations :\"+ reclamations);\n\t\t\t\n\t\t}\n\t\treturn a;\n\t\t}", "@Override\r\n\tpublic List findAll() {\n\t\treturn usermaindao.findAll();\r\n\t}", "List<Videogioco> findAllVideogioco();", "@Override\n\tpublic List<Movie> searchMovieByGen(String genere) {\n\t\tString sql=\"Select * from movie where GENERE='\"+genere+\"'\";\n\t\tJdbcTemplate jdbcTemplate=JdbcTemplateFactory.getJdbcTemplate();\n\t\tList<Movie> genMList=jdbcTemplate.query(sql, new MovieRowMapper());\n\t\tif(genMList==null||genMList.isEmpty()){\n\t\t\treturn null;\n\t\t}\n\t\treturn genMList;\n\t}", "public List<Book> findAll()\r\n\t{\r\n\t\tList<Book> booklist= null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbookdao.openCurrentSession();\r\n\t\t booklist=bookdao.findAll();\r\n\t\t\tbookdao.closeCurrentSession();\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn booklist;\r\n\t}", "@Override\n public List<User> findAll() {\n return null;\n }", "@Transactional\n\t@Override\n\tpublic List<Detail> findAll() {\n\t\treturn null;\n\t}", "@Transactional(readOnly = true)\n\t@Override\n\tpublic List<T> findAll() {\n\t\treturn (List<T>) registroDao.findAll();\n\t}", "@Override\r\n\tpublic List<Object> findAll() {\n\t\treturn null;\r\n\t}", "public List<Tblproductos> getAll(){\n String hql = \"Select tp from Tblproductos tp\";\n try{\n em = getEntityManager();\n Query q = em.createQuery(hql);\n List<Tblproductos> listProductos = q.getResultList();\n return listProductos; \n }catch(Exception e){\n e.printStackTrace();\n }\n return null;\n }", "List<Horario_Disponible> findAll();", "public List<Professor> findAll();", "@Override\n public List<DetalleVenta> all() {\n return detalleVentaJpaRepository.findAll();\n }", "public List<Product> findAll();" ]
[ "0.794825", "0.76561606", "0.75115246", "0.7212687", "0.7128883", "0.7079648", "0.7038824", "0.7011067", "0.6994522", "0.6954428", "0.6835985", "0.677025", "0.67661774", "0.67346", "0.673055", "0.6713696", "0.6707287", "0.67069906", "0.66675925", "0.6664199", "0.66622394", "0.66564", "0.66449255", "0.66417265", "0.66281205", "0.6599314", "0.65970063", "0.65899765", "0.65845853", "0.658333", "0.65414554", "0.6533695", "0.6521902", "0.65116954", "0.6476565", "0.647222", "0.64537525", "0.64522827", "0.64331305", "0.64285725", "0.6424331", "0.6421103", "0.64052445", "0.6402428", "0.6386439", "0.63843364", "0.638203", "0.6376715", "0.6375039", "0.63678783", "0.6361033", "0.6353538", "0.63524765", "0.63399404", "0.6339759", "0.63248557", "0.62901974", "0.6288022", "0.62808514", "0.6274258", "0.62731266", "0.62717396", "0.6271649", "0.62679636", "0.6254889", "0.62507755", "0.62474406", "0.6245343", "0.6237891", "0.6235501", "0.6230085", "0.62217355", "0.62212217", "0.62199736", "0.6215423", "0.6212298", "0.6206204", "0.6206204", "0.6205424", "0.62031376", "0.62028515", "0.6199397", "0.6198284", "0.61944866", "0.61944866", "0.61944866", "0.61842203", "0.61810493", "0.61801463", "0.61798954", "0.61751026", "0.617189", "0.61648494", "0.6158233", "0.61509067", "0.6150029", "0.6147914", "0.614744", "0.61469084", "0.6146671" ]
0.8525924
0
Service Interface for managing Company's employee entities.
public interface CompanyEmployeeService extends AbstractService<CompanyEmployee, Long, CompanyEmployeeDTO> { /** * Find all employee by Company id. * * @return the list of entities */ List<CompanyEmployeeDTO> findAllByCompanyId(Long id); /** * Find all employees by type. * * @param type the employee type * @return the list of entities */ List<CompanyEmployeeDTO> findAllByType(EmployeeType type); /** * Find all employees by company id znd employee type. * * @param companyId the company id * @param employeeType the employee type * @return the list of entities */ List<CompanyEmployeeDTO> findAllByCompanyIdAndEmployeeType(Long companyId, EmployeeType employeeType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface CompanyService {\n void addEmployee(CompanyId companyId, Employee employee);\n\n void removeEmployee(CompanyId companyId, Employee employee);\n\n Employee getEmployee(CompanyId companyId, EmployeeId employeeId);\n\n List<Employee> getCompanyEmployees(CompanyId companyId);\n}", "public interface EmployeeService {\n\n\t\n\tList<EmployeeEntity> queryObjectByCondition(Map<String,Object> map);\n\tList<EmployeeEntity> queryBack(Map<String,Object> map);\n\t\n\tEmployeeEntity queryByPhone(String phone);\n\t\n\tlong login(String mobile, String password);\n\t\n\tEmployeeEntity queryObject(Long empid);\n\t\n\tList<EmployeeEntity> queryList(Map<String, Object> map);\n\t\n\tint queryTotal(Map<String, Object> map);\n\t\n\tvoid save(EmployeeEntity employee);\n\t\n\tvoid update(EmployeeEntity employee);\n\t\n\tvoid delete(Long empid);\n\t\n\tvoid deleteBatch(Long[] empids);\n}", "public interface EmployeeService {\n\n List<Employee> findAllEmployees();\n Employee findOneEmployee(String idEmployee);\n void deleteOneEmployee(String idEmployee);\n String addOneEmployee();\n\n}", "public interface EmployeeService {\n List<Employee> getAll();\n void create(Employee employee);\n}", "public interface IEmployeeService {\n\n /**\n * Return the complete list of employees.\n *\n * @return\n */\n public List<EmployeeDto> retrieveEmployees();\n\n /**\n * Get an employee via its id.\n *\n * @param employeeId\n * @return\n * @throws ApiDemoBusinessException in case of unknow user\n */\n public EmployeeDto getEmployee(Long employeeId) throws ApiDemoBusinessException;\n\n /**\n * Add a new employee to the database with a new generated id.\n *\n * @param employee\n */\n public void saveEmployee(CreateOrEditEmployeeRequestDto employee);\n\n /**\n * Delete an employee via its id.\n *\n * @param employeeId target employee\n * @throws ApiDemoBusinessException in case of unknow user\n */\n public void deleteEmployee(Long employeeId) throws ApiDemoBusinessException;\n\n /**\n * Update an employee to a new value.\n *\n * @param employeeId targeted employee id\n * @param employee new value\n * @throws ApiDemoBusinessException mismatched ids or unknow user\n */\n public void updateEmployee(Long employeeId, CreateOrEditEmployeeRequestDto employee) throws ApiDemoBusinessException;\n}", "public interface IEmployeeService {\n\n List<Employee> getAll();\n\n Employee get(int id);\n\n void save(Employee employee);\n\n void delete(int id);\n\n}", "@Override\n\tpublic void getAllEmployee() {\n\t\t\n\t}", "@Override\n\tpublic void ModifyEmployee() {\n\t\t\n\t}", "@Override\n\tpublic void updateEmployee() {\n\n\t}", "@Transactional\n\t\tpublic void saveEmployee(EmployeeEntity employeeEntity) {\n\t\t\temployeedao.saveEmployee(employeeEntity);\n\t\t}", "public void saveEmployee(Employe employee) {\n\t\t\n\t}", "public interface EmployeeDao {\n List<Employee> getAllEmployees() throws ParseException, SQLException;\n\n Employee getEmployeeById(Integer id) throws ParseException, SQLException;\n\n Collection<Employee> getEmployeesByTitle(String title) throws ParseException;\n\n Collection<Employee> getEmployeesWithSalaryHigherTham(Integer salary) throws ParseException;\n\n Collection<Employee> getEmployeesWithNameStartsWith(String firstLetter) throws ParseException;\n\n Collection<Employee> getSubordinatesByManagerId(Integer managerId) throws ParseException;\n\n void saveEmployee(Employee employee) throws SQLException;\n\n void updateEmployee(Employee employee);\n\n void deleteEmployee(Employee employee);\n\n void setManagerForEmployee(Employee employee, Employee manager);\n\n Collection<Employee> getEmployeesByName(String name) throws SQLException;\n}", "public void addEmployee(Employee employee) {\n employeeRepository.save(employee);\n }", "public interface EmpService {\n Boolean addEmp(EMP emp);\n\n EMP getEmpName(String name);\n\n List<EMP> getEmp(@Param(\"did\") Integer d_id, @Param(\"state\") Integer e_state);\n\n List<EMP> getEmpLimits(Integer d_id, int currentPage, int pages, Integer e_state);\n\n List<EMP> getEmpLimit(Integer d_id, int currentPage, int pages, Integer e_state, Integer position);\n\n EMP empLogin(EMP emp);\n\n List<EMP_TRAIN> getEmpAndTrain(EMP emp);\n\n List<EMP_TRAIN> getEmpAndTrainLimit(EMP emp, int currentPage, int pages);\n}", "@Override\n\tpublic void updateEmployee(List<Employee> employees) {\n\t\t\n\t}", "public void setEmployeeId(long employeeId);", "public interface EmployeeService {\n /**\n * finds the Employee by id\n *\n * @param id of Employee\n * @return found Employee\n */\n public Employee findEmployee(Long id);\n\n public void addEmployee(Employee employee);\n\n public void editEmployee(Employee employee);\n\n public void deleteEmployee(Long id);\n\n public List<Employee> getListEmployee();\n\n public List<Employee> getListFirstNameStarts(String word);\n\n public List<Employee> getListStarts(String word);\n}", "void addEmployee(Employee emp){\n\t\tEntityManager em = emf.createEntityManager();\n\t\tEntityTransaction tx = em.getTransaction();\n\t\ttx.begin();\n\t\tem.persist(emp);\n\t\ttx.commit();\n\t\tem.close();\n\t}", "public void updateEmployee(Employe employee) {\n\t\t\n\t}", "@Override\n\tpublic void createEmployee(Employee e) {\n\t\t\n\t}", "public interface EmployeeController {\n\n\t/**\n\t * GET EMPLOYEE METHOD\n\t * \n\t * @param employeeId\n\t * @return\n\t */\n\tpublic Employee getEmployee(int employeeId);\n\n\t/**\n\t * INSERT EMPLOYEE METHOD\n\t * \n\t * @param employee\n\t * @return\n\t */\n\tpublic String createEmployee(Employee employee);\n\n\t/**\n\t * UPDATE EMPLOYEE METHOD\n\t * \n\t * @param employee\n\t * @return\n\t */\n\tpublic String updateEmployee(Employee employee);\n\n\t/**\n\t * DELETE EMPLOYEE METHOD\n\t * \n\t * @param employee\n\t * @return\n\t */\n\tpublic String deleteEmployee(Employee employee);\n\n\t/**\n\t * FIND EMPLOYEE METHOD\n\t * \n\t * @param emailColumnValue\n\t * @param firstNameColumnValue\n\t * @param lastNameColumnValue\n\t * @return\n\t * @throws SQLException\n\t */\n\tpublic Employee findEmployee(String emailColumnValue, String firstNameColumnValue, String lastNameColumnValue)\n\t\t\tthrows SQLException;\n\n}", "public void addEmployee(Employee emp) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void saveEmployee(Employee employee) {\n\t\t\r\n\t}", "public EmployeeDTO updateEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;", "public void updateEmployees(List<Employe> employees) {\n\t\t\n\t}", "public void update(Employee employee){\n employeeRepository.save(employee);\n }", "@Override\n\tpublic void updateEmployee(Employee e) {\n\t\t\n\t}", "public interface IEmployeeDAO {\n\t\n\tpublic boolean insertEmployee(Employee emp);\n\tpublic List<Employee> getAllEmployees(); \n\tpublic Employee getEmployee(int empId);\n\tpublic boolean updateEmp(int empId, double newSal); \n\tpublic boolean deleteEmp(int empId); \n\n}", "@Override\n\tpublic Employee saveEmployee(Employee emp) {\n\t\tlog.debug(\"EmplyeeService.saveEmployee(Employee emp) save Employee object\");\n\t\treturn repositary.save(emp);\n\t}", "public void updateemployee(Employeee em) {\n\t\temployeerepo.save(em);\n\t}", "@PostMapping(value = \"/addEmployee\")\n\tpublic void addEmployee() {\n\t\tEmployee e = new Employee(\"Iftekhar Khan\");\n\t\tdataServiceImpl.add(e);\n\t}", "public interface EmployeeDAO {\r\n\r\n\t\t\tpublic List<Employee> findAll();\r\n\r\n\t\t\tpublic Employee findById(int theId);\r\n\t\t\t\r\n\t\t\tpublic void save(Employee theEmployee);\r\n\r\n\t\t\tpublic void deleteById(int theId);\r\n}", "public void saveEmployee(CreateOrEditEmployeeRequestDto employee);", "@Override\r\n\tpublic Result update(Employees employees) {\n\t\treturn null;\r\n\t}", "public interface EmployeeFacade {\n\n /**\n * Get employee by given ID.\n */\n EmployeeDTO findById(Long employeeId);\n\n /**\n * Get employee by given email.\n */\n EmployeeDTO findByEmail(String email);\n\n /**\n * Register the given employee with the given unencrypted password.\n */\n Long create(EmployeeDTO u, String unencryptedPassword);\n\n /**\n * Get all registered employees\n */\n Collection<EmployeeDTO> getAll();\n\n /**\n * Try to authenticate a employee. Return true only if the hashed password matches the records.\n */\n boolean authenticate(PersonAuthenticateDTO p);\n\n /**\n * Remove employee by given email.\n */\n void delete(Long id);\n\n /**\n * Get all employees with specific name.\n */\n List<EmployeeDTO> findByName(String name);\n}", "@Override\n\tpublic void addEmployee(Employee employee) {\n\t\tem.getTransaction().begin();\n\t\tem.persist(employee);\n\t\tem.getTransaction().commit();\n\t\tSystem.out.println(\"Data Added successfully\");\n\t\tlogger.log(Level.INFO, \"Data Added successfully\");\n\n\t}", "public void setEmployeeId(long employeeId) {\n this.employeeId = employeeId;\n }", "List<CompanyEmployeeDTO> findAllByCompanyId(Long id);", "public void createemployee(Employeee em) {\n\t\temployeerepo.save(em);\n\t}", "public interface EmployeeService {\n\n /**\n * 员工申请\n * @return\n */\n @POST(\"employee/apply.do\")\n Observable<HttpResult<String>> apply(@Body EmployeeApplyBean employeeApplyBean);\n\n\n /**\n * 获取申请列表\n * @param accountId\n * @param type\n * @param isAudit\n * @param status\n * @param start\n * @param rows\n * @return\n */\n @GET(\"employee/applyList.do\")\n Observable<HttpResult<PageBean<LeaveBean>>> getApplyList(@Query(\"accountId\") String accountId, @Query(\"type\") int type, @Query(\"isAudit\") int isAudit, @Query(\"status\") int status, @Query(\"start\") int start, @Query(\"rows\") int rows);\n\n\n /**\n * 获取申请详情\n * @param accountId\n * @param applyInfoId\n * @return\n */\n @GET(\"employee/apply.do\")\n Observable<HttpResult<LeaveDetailBean>> getDetail(@Query(\"accountId\") String accountId, @Query(\"applyInfoId\") String applyInfoId);\n\n /**\n * 获取员工审批列表\n * @param accountId\n * @return\n */\n @GET(\"employee/auditors.do\")\n Observable<HttpResult<List<DepartMentBean>>> getAuditors(@Query(\"accountId\") String accountId);\n\n\n /**\n * 审批申请\n * @param accountId\n * @param applyInfoId\n * @param Status\n * @return\n */\n @PUT(\"employee/apply.do\")\n Observable<HttpResult<List<DepartMentBean>>> applyStatus(@Query(\"accountId\") String accountId, @Query(\"applyInfoId\") String applyInfoId, @Query(\"status\") int Status, @Body SchduleCarBodyBean schduleCarBodyBean);\n\n /**\n * 就餐扫码\n * @param accountId\n * @param code\n * @return\n */\n @POST(\"employee/dining.do\")\n Observable<HttpResult<String>> dinning(@Query(\"accountId\") String accountId, @Query(\"code\") String code);\n\n /**\n * 就餐列表\n * @param accountId\n * @param start\n * @param rows\n * @return\n */\n @GET(\"employee/dining.do\")\n Observable<HttpResult<PageBean<EatHistoryBean>>> eatList(@Query(\"accountId\") String accountId, @Query(\"start\") int start, @Query(\"rows\") int rows);\n\n /**\n * 车辆调度\n * @param accountId\n * @param schduleCarBodyBean\n * @return\n */\n @GET(\"employee/{accountId}/schedule.do\")\n Observable<HttpResult<PageBean<EatHistoryBean>>> schdueCar(@Path(\"accountId\") String accountId, @Body SchduleCarBodyBean schduleCarBodyBean);\n\n}", "@RequestMapping(value = \"/employee\", method = RequestMethod.POST)\r\n\tpublic Employee addEmployee(@RequestBody Employee employee) throws EmployeeMaintainceException {\r\n\r\n\t\ttry {\r\n\t\t\treturn eService.addEmp(employee);\r\n\t\t}\r\n\r\n\t\tcatch (Exception e) {\r\n\t\t\tthrow new EmployeeMaintainceException(400, e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public interface ICompanyService {\r\n /**\r\n * 根据公司名字和唯一码查询公司信息\r\n *\r\n * @param company\r\n * @return\r\n */\r\n List<Company> findCompanyByCompany(Company company);\r\n List<Company> findCompanyByCompany(Company company,PageBounds pageBounds);\r\n\r\n /**\r\n * 根据公司code查询公司信息\r\n *\r\n * @param companyCode\r\n * @return\r\n */\r\n Company findCompanyByCompanyCode(String companyCode);\r\n\r\n /**\r\n * 根据公司id查询\r\n *\r\n * @param id\r\n * @return\r\n */\r\n Company findCompanyByid(String id);\r\n\r\n /**\r\n * 修改公司信息\r\n * @param company 公司基本信息\r\n */\r\n void modifyCompanyInfo(Company company)throws Exception;\r\n\r\n void removeCompany(String companyId);\r\n\r\n /**\r\n * 创建公司\r\n *\r\n * @param company\r\n * @param permissionIds\r\n */\r\n void addCompany(Company company, String permissionIds);\r\n\r\n /**\r\n * 更新公司权限\r\n *\r\n * @param company\r\n * @param permissionIds\r\n */\r\n void modifyCompanyPermission(Company company, String permissionIds);\r\n}", "public void setEmployees(ArrayList<Employee> employees) { \r\n this.employees = employees;\r\n }", "@Override\n\tpublic void deleteEmployee() {\n\n\t}", "public void setEmployeeId(String employeeId) {\n this.employeeId = employeeId;\n }", "@Override\n public void setEmployees() throws EmployeeCreationException {\n\n }", "public EmpleadoService() {\n super();\n emf = Persistence.createEntityManagerFactory(\"up_h2\");\n empDAO = new EmpleadoDAO(emf);\n }", "@RequestMapping(value = \"/employee/{empId}\", method = RequestMethod.PUT)\r\n\tpublic Employee updateEmployee(@RequestBody Employee employee, @PathVariable int empId)\r\n\t\t\tthrows EmployeeMaintainceException {\r\n\t\ttry {\r\n\t\t\treturn eService.updateEmployee(employee, empId);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new EmployeeMaintainceException(400, e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public EmployeeService getEmployeeService() {\r\n\t\treturn employeeService;\r\n\t}", "@Override\n\tpublic Employee updateEmployee(Employee emp) {\n\t\tlog.debug(\"EmplyeeService.updateEmployee(Employee emp) update Employee object whos id is\" + emp.getId());\n\t\treturn repositary.save(emp);\n\t}", "public Employee save(Employee employee){\n return employeeRepository.save(employee);\n }", "@RequestMapping(\"/employee\")\n\tpublic List<Employee> getAllEmplyee() {\n\t\treturn service.getAllEmplyee();\n\t}", "@Override\r\n\tpublic void updateEmployee(Employee t) {\n\t\t\r\n\t}", "@Override\r\n\tpublic int updateEmployee(Connection con, Employee employee) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic int saveEmployee() {\n\t\tEmployeeDao dao= new EmployeeDao();\n\t\tint result=dao.saveEmployee(new Employee(101349, \"Deevanshu\", 50000));\n\t\treturn result;\n\t}", "@Override\r\n\tpublic void post(Employee employee) {\n\t\t empdao.save(employee);\r\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\t\n\t\tlog.debug(\"EmplyeeService.getAllEmployee() return list of employees\");\n\t\treturn repositary.findAll();\n\t}", "public void update(Employee e) {\n\t\t\r\n\t}", "@Override\n\tpublic void save(Employee theEmployee) {\n\t\t\n\t}", "@PutMapping(\"/employees/{employeeId}\")\r\n\tpublic Employee updateEmployee(@RequestBody Employee theEmployee) {\r\n\t\t\r\n\t\t\temployeeService.saveEmployee(theEmployee);\r\n\t\t\r\n\t\treturn theEmployee;\r\n\t}", "List<CompanyEmployeeDTO> findAllByCompanyIdAndEmployeeType(Long companyId, EmployeeType employeeType);", "public interface CompanyService {\n\n\tCompanyDto save(CompanyDto companyDto);\n\n\tCompanyDto findById(long id);\n\n\tvoid delete(CompanyDto parkingDto);\n\n\tList<CompanyDto> findAll();\n\n\tCompanyDto findByCompanyCode(String companyCode);\n\n}", "public List<Employee> getAllEmployees() {\n return employeeRepository.findAll();\n }", "public interface SalesRepresentativeService {\n void addEmployee(Context context, SalesRepresentative employee);\n void updateEmployee(Context context, SalesRepresentative employee);\n}", "public abstract void updateEmployee(int id, Employee emp) throws DatabaseExeption;", "public void updateEmployeeDetails(EmployeeDetails employeeDetails);", "@Override\n\tpublic void add(Employee employee) {\n\t\temployeeDao.save(employee);\t\t\n\t}", "@PutMapping(\"/update\")\n\t public Employee updateEmployee(@RequestBody Employee emp)\n\t {\n\t\treturn employeeService.editEmployee(emp);\n\t }", "public void addEmployee(ActionRequest request, ActionResponse response)\n\t\t\tthrows SystemException, IOException, PortalException {\n\t\tlong employeeId = CounterLocalServiceUtil.increment(Employee.class.getName());\n\t\tEmployee employee = null;\n\t\temployee = EmployeeLocalServiceUtil.createEmployee(employeeId);\n\t\temployee.setEmployeeName(ParamUtil.getString(request, \"employeeName\"));\n\t\temployee.setEmployeeDesignation(ParamUtil.getString(request, \"employeeDesignation\"));\n\t\temployee.setAddress(ParamUtil.getString(request, \"address\"));\n\t\temployee.setEmail(ParamUtil.getString(request, \"email\"));\n\t\temployee.setPhoneNumber(ParamUtil.getString(request, \"phoneNumber\"));\n\t\t/* Uploading employee documents */\n\t\tThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);\n\t\t// Checking permission for ADD_EMPLOYEE\n//\t\tEmployeePermission.insertPermission(themeDisplay);\n\t\tcreateFolder(request, themeDisplay);\n\t\tlong fileEntryId = fileUpload(employee, themeDisplay, request);\n\t\temployee.setFileEntryId(fileEntryId);\n\t\t// setting groupId\n\t\temployee.setGroupId(themeDisplay.getScopeGroupId());\n\t\tEmployeeLocalServiceUtil.addEmployee(employee);\n\t\tResourceLocalServiceUtil.addResources(themeDisplay.getCompanyId(), themeDisplay.getScopeGroupId(),\n\t\t\t\tthemeDisplay.getUserId(), Employee.class.getName(), employeeId, false, true, true);\n\t}", "@Override\n public void setDepartmentEmployee(Employee employee, int departmentId) {\n\n }", "public void setEmployees(int _employees){\n employees = _employees;\n }", "public void updateEmployee(Long employeeId, CreateOrEditEmployeeRequestDto employee) throws ApiDemoBusinessException;", "public interface EmpService {\n List<Emp> queryEmp();\n}", "@Override\n\tpublic void save(Employee employee) {\n\t\temployeeDao.save(employee);\n\t\t\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employees;\r\n\t}", "public void setEmployeeID(int employeeID) { this.employeeID = employeeID; }", "interface Services {\n\tpublic int addEmployee(Connection conn, String empDesignation);\n\n\tpublic void promote(Connection conn);\n\n\tpublic void deleteEmployee(Connection conn, int empId);\n\n\tpublic void changeSupervisor(Connection conn);\n\n\t// public void showEmployeesUnderMe(Map<Integer, Employee> employees, int\n\t// empId);\n}", "public EmployeeDTO createEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;", "public void setEmployeeId(int employeeId) {\r\n\t\r\n\t\tthis.employeeId = employeeId;\r\n\t}", "public ResponseEntity<List<Employee>> getAllEmployees() {\n \tList<Employee> emplist=empService.getAllEmployees();\n\t\t\n\t\tif(emplist==null) {\n\t\t\tthrow new ResourceNotFoundException(\"No Employee Details found\");\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<>(emplist,HttpStatus.OK);\t\t\n }", "@Override\r\n\tpublic Employee save(Employee emp) {\n\t\t return empdao.save(emp);\r\n\t}", "void save(Employee employee);", "@Override\n\tpublic List<Employee> getEmpleados() {\n\t\treturn repositorioEmployee.findAll();\n\t}", "@Override\r\n\tpublic boolean updateEmployee(EmployeeEO employeeEORef) {\n\t\tif(employeeDAORepoRef.findById(employeeEORef.getEmployeeId()).equals(null))\r\n\t\treturn false;\r\n\t\telse {\r\n\t\t\temployeeDAORepoRef.save(employeeEORef);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "@PostMapping(\"/employees\")\n\tpublic Employee addEmployee(@RequestBody Employee theEmployee) {\n\t\t theEmployee.setId(0);\n\t\t employeeService.save(theEmployee);\n\t\t \n\t return theEmployee;\n\t}", "@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_employee.setCompanyId(companyId);\n\t}", "@Override\n\t//业务层修改员工方法\n\tpublic void update(Employee employee) {\n\t\temployeeDao.update(employee);\n\t}", "@PostMapping(\"/employees\")\r\n\tpublic Employee addEmployee(@RequestBody Employee theEmployee) {\r\n\t\t\r\n\t\t// also just in case the pass an id in JSON... set id to 0\r\n\t\t// this force a save of new item...instead of update\r\n\t\ttheEmployee.setId(0);\r\n\t\t\r\n\t\temployeeService.saveEmployee(theEmployee);\r\n\t\t\r\n\t\treturn theEmployee;\r\n\t\t\r\n\t}", "public interface EmpService {\n //查询一页数据\n Result<TbEmpPage> getList(Page page,Order order,EmpQuery empQuery);\n //删除制定的id,其实是修改状态\n int updateEmpsByIds(List<Integer> ids);\n}", "@Override\r\n\tpublic void updateEmployee(long employeeId, Employee updateEmployee) {\n\t\t\r\n\t}", "void assign (int departmentId, AssignEmployeeRequest empList);", "@Override\n\tpublic void save(EmpType entity) {\n\t\t\n\t}", "@Override\r\n\tpublic Employee addEmployeeData(Employee emp) {\n\t\treturn employeeDAO.addEmployee(emp);\r\n\t}", "@Override\n\tpublic void update(Employee employee) {\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployeeList() throws Exception {\n\t\t\r\n\t\treturn (List<Employee>) employeeRepository.findAll();\r\n\t}", "@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}", "@Transactional\n\t@CacheEvict(cacheNames = {\"allEmployeesCache\"}, allEntries = true)\n\tpublic void addEmployee(Employee employee) throws Exception {\n\t\tString password = passwordService.createPassword();\n\t\tString passwordEncode = passwordEncoder.encode(password);\n\t\tUser user = employee.getUser();\n\t\tuser.setEnabled(true);\n\t\tuser.setPassword(passwordEncode);\n\t\tOptional<Role> role1 = roleRepository.findById(1L);\n\t\tOptional<Role> role4 = roleRepository.findById(4L);\n List<Role> roles = new ArrayList<>();\n roles.add(role1.get());\n roles.add(role4.get());\n user.setRoles(roles);\n employee.setRegisterDateTime(LocalDateTime.now());\n final User userFromRequest = getUserFromRequest();\n employee.setUserRegister(userFromRequest);\n\t\temployeeRepository.save(employee);\n\t\tsendEmailForAddAdminEmployee(employee, password);\n\t}", "public void employeeServiceApprove() {\n\t\t\n\t\tEmployee employee = new Employee();\n\t\t employee.approve();\n\t}", "@Override\n\t@Transactional\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn employeeDao.getAllEmployees();\n\t}", "@Override\n\tpublic List<Employee> findAllEmployees() {\n\t\treturn employeeRepository.findAllEmployess();\n\t}" ]
[ "0.73957103", "0.71779823", "0.71598303", "0.6745142", "0.6635274", "0.662474", "0.6569178", "0.65630764", "0.6560681", "0.65388465", "0.64526975", "0.6425565", "0.64149505", "0.63739467", "0.6360219", "0.6332639", "0.6323049", "0.63169336", "0.6312255", "0.6293665", "0.6277698", "0.62720674", "0.62670076", "0.6241909", "0.6239539", "0.62319064", "0.6219103", "0.6210059", "0.6208846", "0.62087977", "0.619006", "0.61803335", "0.61746234", "0.6173135", "0.6171975", "0.61575663", "0.61438185", "0.61294544", "0.6128189", "0.6121792", "0.61215186", "0.60971946", "0.60939986", "0.6091279", "0.6082026", "0.6079776", "0.6074664", "0.6074292", "0.6064014", "0.60631156", "0.6062862", "0.6014812", "0.60120195", "0.6011927", "0.6004578", "0.59998125", "0.5983578", "0.5982257", "0.5973776", "0.59666574", "0.59550864", "0.595432", "0.59451973", "0.59430915", "0.5942388", "0.5936448", "0.5933652", "0.5925102", "0.59201205", "0.59102106", "0.5908181", "0.5902979", "0.5901218", "0.5897906", "0.5888698", "0.58867234", "0.5881242", "0.58648056", "0.58618283", "0.58595604", "0.58520895", "0.5848707", "0.5841512", "0.5840272", "0.5838524", "0.5836766", "0.5831369", "0.5829449", "0.5820123", "0.5810363", "0.5808803", "0.58083695", "0.5802817", "0.5798066", "0.57940686", "0.5792096", "0.57910466", "0.578599", "0.57841927", "0.5780883" ]
0.6973321
3
Find all employee by Company id.
List<CompanyEmployeeDTO> findAllByCompanyId(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getFindByIdCompany() {\n log.info(\"CompaniesContactsBean => method : getFindByIdCompany()\");\n\n log.info(\"ID company\" + companiesBean.getCompaniesEntity().getId());\n this.companiesContactsEntityList = findByIdCompany(companiesBean.getCompaniesEntity());\n }", "public Company findCompany(long id);", "List<CompanyEmployeeDTO> findAllByCompanyIdAndEmployeeType(Long companyId, EmployeeType employeeType);", "protected List<CompaniesContactsEntity> findByIdCompany(CompaniesEntity companiesEntity) {\n\n log.info(\"CompaniesContactsBean => method : findByIdCompany()\");\n\n FacesMessage facesMessage;\n\n if (companiesContactsEntity == null) {\n log.error(\"Companies entity is null\");\n facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, JsfUtils.returnMessage(getLocale(), \"company.error\"), null);\n FacesContext.getCurrentInstance().addMessage(null, facesMessage);\n return null;\n }\n\n EntityManager em = EMF.getEM();\n\n List<CompaniesContactsEntity> companiesContactsEntities = companiesContactsDao.findByIdCompany(em, companiesEntity.getId());\n\n em.clear();\n em.close();\n\n return companiesContactsEntities;\n }", "public Employee findEmployee(Long id);", "public java.util.List<Todo> findByCompanyId(long companyId);", "List<Employee> findAll();", "@Override\r\n\tpublic List<Employee> selectEmployeeByAll(Connection con) {\n\t\treturn null;\r\n\t}", "@Query(value = \"select * from Employee as e where e.project_Id = ?1\", nativeQuery = true)\n\tList<Employee> findAllByProjectId(Long id);", "public Employee getEmployeeById(String id) {\r\n for(int i = 0; i < companyDirectory.size(); i++) {\r\n\t for(int j = 0; j < companyDirectory.get(i).getLocations().size(); j++) {\r\n\t\t for(int k = 0; k < companyDirectory.get(i).getLocations().get(j).getEmployees().size(); k++) {\t\t\r\n\t\t if(companyDirectory.get(i).getLocations().get(j).getEmployees().get(k).getId().equals(id)) \r\n\t\t \treturn companyDirectory.get(i).getLocations().get(j).getEmployees().get(k);\r\n\t\t }\r\n\t\t}\r\n\t }\r\n return null;\r\n\t}", "public List<EmployeeManage> queryEmployeeId(int id) {\n\t\treturn \temployeeManageDao.queryEmployeeId(id);\r\n\t}", "@Override\r\n\tpublic Company getAllCompaniesById(Integer id) {\r\n\t\tString methodName = \"getAllCompaniesById(Integer id)\";\r\n\t\tlog.info(className+\",\"+methodName);\r\n\t\tlog.debug(\"id value is::\"+id);\r\n\t\treturn companyRepository.findCompanyById(id.longValue());\r\n\t}", "@Override\r\n\tpublic List<Employee> findAllEMployees() {\n\t\tList<Employee> employees = new ArrayList<Employee>();\r\n\t\tString findData = \"select * from employee\";\r\n\r\n\t\ttry {\r\n\t\t\tStatement s = dataSource.getConnection().createStatement();\r\n\r\n\t\t\tResultSet set = s.executeQuery(findData);\r\n\r\n\t\t\twhile (set.next()) {\r\n\t\t\t\tString name = set.getString(1);\r\n\t\t\t\tint id = set.getInt(\"empId\");\r\n\t\t\t\tint sal = set.getInt(\"salary\");\r\n\t\t\t\tString tech = set.getString(\"technology\");\r\n\t\t\t\tEmployee employee = new Employee(id, sal, name, tech);\r\n\t\t\t\temployees.add(employee);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn employees;\r\n\r\n\t}", "public List<Employee> getAllEmployees(){\n\t\tList<Employee> employees = employeeDao.findAll();\n\t\tif(employees != null)\n\t\t\treturn employees;\n\t\treturn null;\n\t}", "@Secured({ })\n\t@RequestMapping(value = \"/contacts/findBycompany/{key}\", method = RequestMethod.GET, headers = \"Accept=application/json\")\n\tpublic List<Contact> findBycompany(@PathVariable(\"key\") Long idcompany) {\n\t\tList<Contact> list = contactService.findBycompany(idcompany);\n\t\treturn list;\n\t}", "public List<Employee> getAllEmployees() {\n return employeeRepository.findAll();\n }", "public List<Employee> getAllEmployee(){\n List<Employee> employee = new ArrayList<Employee>();\n employeeRepository.findAll().forEach(employee::add);\n return employee;\n }", "List<CompanyEmployeeDTO> findAllByType(EmployeeType type);", "@Override\n\tpublic List<Emp> findAll() {\n\t\treturn eb.findAll();\n\t}", "@GET(API_ROUTE + \"/contactos-empleado/{emp_id}\")\n Call<List<Persona>> getContactsByEmployeeId(@Path(\"emp_id\") long emp_id);", "@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}", "Employee findById(int id);", "public interface CompanyEmployeeService extends AbstractService<CompanyEmployee, Long, CompanyEmployeeDTO> {\n\n /**\n * Find all employee by Company id.\n *\n * @return the list of entities\n */\n List<CompanyEmployeeDTO> findAllByCompanyId(Long id);\n\n /**\n * Find all employees by type.\n *\n * @param type the employee type\n * @return the list of entities\n */\n List<CompanyEmployeeDTO> findAllByType(EmployeeType type);\n\n /**\n * Find all employees by company id znd employee type.\n *\n * @param companyId the company id\n * @param employeeType the employee type\n * @return the list of entities\n */\n List<CompanyEmployeeDTO> findAllByCompanyIdAndEmployeeType(Long companyId, EmployeeType employeeType);\n}", "public List<Employee> getAll() {\n\t\treturn edao.listEmploye();\n\t}", "Collection<EmployeeDTO> getAll();", "Company getCompany(int id);", "public List<Employee> findAll() {\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\t\n\t\tlog.debug(\"EmplyeeService.getAllEmployee() return list of employees\");\n\t\treturn repositary.findAll();\n\t}", "public List<Employee> getAllEmployees(){\n\t\tFaker faker = new Faker();\n\t\tList<Employee> employeeList = new ArrayList<Employee>();\n\t\tfor(int i=101; i<=110; i++) {\n\t\t\tEmployee myEmployee = new Employee();\n\t\t\tmyEmployee.setId(i);\n\t\t\tmyEmployee.setName(faker.name().fullName());\n\t\t\tmyEmployee.setMobile(faker.phoneNumber().cellPhone());\n\t\t\tmyEmployee.setAddress(faker.address().streetAddress());\n\t\t\tmyEmployee.setCompanyLogo(faker.company().logo());\n\t\t\temployeeList.add(myEmployee);\n\t\t}\n\t\treturn employeeList;\n\t}", "public List<Employee> listAll(){\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<Employee> queryAll() {\n\t\treturn dao.queryAll();\n\t}", "public List<User> getAllEmployees(String companyShortName);", "public void getByIdemployee(int id){\n\t\tEmployeeDTO employee = getJerseyClient().resource(getBaseUrl() + \"/employee/\"+id).get(EmployeeDTO.class);\n\t\tSystem.out.println(\"Nombre: \"+employee.getName());\n\t\tSystem.out.println(\"Apellido: \"+employee.getSurname());\n\t\tSystem.out.println(\"Direccion: \"+employee.getAddress());\n\t\tSystem.out.println(\"RUC: \"+employee.getRUC());\n\t\tSystem.out.println(\"Telefono: \"+employee.getCellphone());\n\t}", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\tList<Employee> employee = new ArrayList<>();\n\t\tlogger.info(\"Getting all employee\");\n\t\ttry {\n\t\t\temployee = employeeDao.getAllEmployee();\n\t\t\tlogger.info(\"Getting all employee = {}\",employee.toString());\n\t\t} catch (Exception exception) {\n\t\t\tlogger.error(exception.getMessage());\n\t\t}\n\t\treturn employee;\n\t}", "@Override\n\tpublic List<Employee> getEmpleados() {\n\t\treturn repositorioEmployee.findAll();\n\t}", "@Override\r\n\tpublic DataResult<Employees> getById(int id) {\n\t\treturn null;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\tfinal Session session = sessionFactory.getCurrentSession();\t\t\r\n\t\tfinal Query query = session.createQuery(\"from Employee e order by id desc\");\r\n\t\t//Query q = session.createQuery(\"select NAME from Customer\");\r\n\t\t//final List<Employee> employeeList = query.list(); \r\n\t\treturn (List<Employee>) query.list();\r\n\t}", "public List<Employee> selectAllEmployee() {\n\n\t\t// using try-with-resources to avoid closing resources (boiler plate code)\n\t\tList<Employee> emp = new ArrayList<>();\n\t\t// Step 1: Establishing a Connection\n\t\ttry (Connection connection = dbconnection.getConnection();\n\n\t\t\t\t// Step 2:Create a statement using connection object\n\t\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(SELECT_ALL_employe);) {\n\t\t\tSystem.out.println(preparedStatement);\n\t\t\t// Step 3: Execute the query or update query\n\t\t\tResultSet rs = preparedStatement.executeQuery();\n\n\t\t\t// Step 4: Process the ResultSet object.\n\t\t\twhile (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString employeename = rs.getString(\"employeename\");\n\t\t\t\tString address = rs.getString(\"address\");\n\t\t\t\tint mobile = rs.getInt(\"mobile\");\n\t\t\t\tString position = rs.getString(\"position\");\n\t\t\t\tint Salary = rs.getInt(\"Salary\");\n\t\t\t\tString joineddate = rs.getString(\"joineddate\");\n\t\t\t\tString filename =rs.getString(\"filename\");\n\t\t\t\tString path = rs.getString(\"path\");\n\t\t\t\temp.add(new Employee(id, employeename, address, mobile, position, Salary, joineddate,filename,path));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tdbconnection.printSQLException(e);\n\t\t}\n\t\treturn emp;\n\t}", "@Override\n\tpublic Employee findById(int id) {\n\t\tList<Employee> employeeList= \n\t\tlistEmployee().stream().filter((e -> e.getId()==id)).collect(Collectors.toList());\n\t\t\n\t\treturn (Employee)employeeList.get(0);\n\t}", "@Override\n\tpublic List<Company> queryCompanyAll() {\n\t\treturn companyDao.queryCompanyAll();\n\t}", "@Override\n\tpublic List<Employee> findAllEmployees() {\n\t\treturn employeeRepository.findAllEmployess();\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\ttry {\n\t\t\tList<Employee> empList = new ArrayList<Employee>();\n\t\t\tList<Map<String, Object>> rows = template.queryForList(\"select * from employee\");\n\t\t\tfor(Map<?, ?> rowNum : rows) {\n\t\t\t\tEmployee emp = new Employee();\n\t\t\t\temp.setEmployeeId((Integer)rowNum.get(\"empid\"));\n\t\t\t\temp.setFirstName((String)rowNum.get(\"fname\"));\n\t\t\t\temp.setLastName((String)rowNum.get(\"lname\"));\n\t\t\t\temp.setEmail((String)rowNum.get(\"email\"));\n\t\t\t\temp.setDesignation((String)rowNum.get(\"desig\"));\n\t\t\t\temp.setLocation((String)rowNum.get(\"location\"));\n\t\t\t\temp.setSalary((Integer)rowNum.get(\"salary\"));\n\t\t\t\tempList.add(emp);\n\t\t\t}\n\t\t\treturn empList;\n\t\t} catch (DataAccessException excep) {\n\t\t\treturn null;\n\t\t}\n\t}", "public CompanyEntity[] getAllCompanies() throws Exception {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n\n try {\n //Establish a connection from the connection manager\n connection = JdbcUtils.getConnection();\n\n //Creating the SQL query\n String sqlStatement = \"SELECT * FROM companies\";\n\n //Combining between the syntax and our connection\n preparedStatement = connection.prepareStatement(sqlStatement);\n\n //Executing the update\n ResultSet resultSet = preparedStatement.executeQuery();\n\n if (!resultSet.next()) {\n throw new ApplicationException(ErrorType.GENERAL_ERROR, \"Cannot retrieve information\");\n }\n// getting the number of rows returned to create an array of companies\n int numberOfRows = MyUtils.getRowCount(resultSet);\n if (numberOfRows == 0) {\n throw new ApplicationException(ErrorType.GENERAL_ERROR, \"0 companies in the table\");\n }\n// creating an array of companies\n CompanyEntity[] companies = new CompanyEntity[numberOfRows];\n int i = 0;\n while (resultSet.next()) {\n companies[i].setCompanyId(resultSet.getLong(\"id\"));\n companies[i].setCompanyName(resultSet.getString(\"company_name\"));\n companies[i].setCompanyEmail(resultSet.getString(\"company_email\"));\n companies[i].setCompanyPhone(resultSet.getString(\"company_phone\"));\n companies[i].setCompanyAddress(resultSet.getString(\"company_address\"));\n i++;\n }\n\n return companies;\n\n } catch (Exception e) {\n //\t\t\te.printStackTrace();\n throw new Exception(\"Failed to retrieve data\", e);\n } finally {\n //Closing the resources\n JdbcUtils.closeResources(connection, preparedStatement);\n }\n }", "List<Employee> findAllByName(String name);", "public List<Employee> getAllEmployeeDetail() {\n\t\treturn dao.getAllEmployeeDetail();\n\t}", "@GetMapping(\"/findAllEmployees\")\n\tpublic List<Employee> getAll() {\n\t\treturn testService.getAll();\n\t}", "@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}", "public List<Employee> getListOfAllEmployees() {\n\t\tlista = employeeDao.findAll();\r\n\r\n\t\treturn lista;\r\n\t}", "@Override\r\n\tpublic Employee findEmployeeById(int empId) {\n\t\tEmployee employee = null;\r\n\t\tString findData = \"select * from employee where empId=?\";\r\n\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = dataSource.getConnection().prepareStatement(findData);\r\n\t\t\tps.setInt(1, empId);\r\n\r\n\t\t\tResultSet set = ps.executeQuery();\r\n\r\n\t\t\twhile (set.next()) {\r\n\t\t\t\tString name = set.getString(1);\r\n\t\t\t\tint id = set.getInt(\"empId\");\r\n\t\t\t\tint sal = set.getInt(\"salary\");\r\n\t\t\t\tString tech = set.getString(\"technology\");\r\n\t\t\t\temployee = new Employee(id, sal, name, tech);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn employee;\r\n\r\n\t}", "@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}", "public Employee getEmployeeById(Long employeeId) {\n return employeeRepository.findEmployeeById(employeeId);\n }", "@Override\r\n\tpublic Employee getEmployee(int id) {\n\t\treturn employees.stream().filter(emp -> emp.getEmpId()==(id)).findFirst().get();\r\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employees;\r\n\t}", "@Override\r\n\tpublic List<Employee> findAll(Iterable<Long> arg0) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employeeDao.getAllEmployee();\r\n\t}", "@Transactional\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn accountDao.getAllEmployee();\n\t}", "@Override\n\tpublic void getAllEmployee() {\n\t\t\n\t}", "public List<Employees> getEmployeesList()\n {\n return employeesRepo.findAll();\n }", "public Employee SearchEmployee(int idEmployee)\n\t{\n\t\tfor(int i = 0; i < departments.size() ; i++)\n\t\t{\n\t\t\tfor(Employee emp : departments.get(i).getEmployeeList())\n\t\t\t{\n\t\t\t\tif(emp.getIdEmployee()==idEmployee) return emp;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "List<Company> getCompanyList() throws DAOException ;", "List<Employee> findByName(String name);", "public void searchCompanies() {\r\n\t\tResourceBundle bundle = ControladorContexto.getBundle(\"mensaje\");\r\n\t\ttry {\r\n\t\t\tbusiness = businessDao.searchBusinessForNameOrNit(searchCompany);\r\n\t\t\tif (business == null || business.size() <= 0) {\r\n\t\t\t\tControladorContexto.mensajeInformacion(\r\n\t\t\t\t\t\t\"frmAsociarPermisos:empresas\",\r\n\t\t\t\t\t\tbundle.getString(\"message_no_existen_registros\"));\r\n\t\t\t} else {\r\n\t\t\t\tBusinessAction businessAction = ControladorContexto\r\n\t\t\t\t\t\t.getContextBean(BusinessAction.class);\r\n\t\t\t\tbusinessAction.setListBusiness(new ArrayList<Business>());\r\n\t\t\t\tbusinessAction.setListBusiness(business);\r\n\t\t\t\tbusinessAction.loadDetailsBusiness();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}", "public List<Employeee> findAll(Class c) {\n\t\treturn employeerepo.findAll();\n\t}", "public Cliente[] findWhereIdEmpresaEquals(int idEmpresa) throws ClienteDaoException;", "@Transactional(readOnly = true)\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\treturn em.createQuery(\"select e from Employee e order by e.office_idoffice\").getResultList();\r\n\t}", "@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }", "List<Employee> allEmpInfo();", "@GET\n @Path(\"/company/{companyId}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response findAllUserByCompanyId(@PathParam(\"companyId\") Long companyId) throws Exception {\n\n return this.authorize(\"standard\", () -> {\n\n try (UserManager manager = new UserManager()) {\n\n ResponseDataPaging res = manager.findAllUserByCompanyId(companyId);\n\n if (res.getStatus() == Status.OK.getStatusCode()) {\n return ok(res);\n } else {\n return noContent(res);\n }\n }\n });\n }", "public Employee listEmployeeById(int id) throws SQLException {\n\t\t\treturn employeeDAO.listEmployeeById(id);\n\t\t}", "@Override\n\tpublic List<EmployeeBean> getAllEmployees() {\n\t\tLOGGER.info(\"starts getAllEmployees method\");\n\t\tLOGGER.info(\"Ends getAllEmployees method\");\n\t\t\n\t\treturn adminEmployeeDao.getAllEmployees();\n\t}", "public Project[] findWhereCompanyIdEquals(int companyId) throws ProjectDaoException {\n\t\treturn findByDynamicSelect(SQL_SELECT + \" WHERE COMPANY_ID = ? ORDER BY COMPANY_ID\", new Object[] { new Integer(companyId) });\n\t}", "public List<Employees> findAllByEmploymentTypeIdName(String Name);", "@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED)\r\n\t@Override\r\n\tpublic List<Employee> getAllEmployee(Long id, String firstname, String lastname, String email) {\n\t\tCriterion firstnameCriterion = null;\r\n\t\tCriterion lastCriterion = null;\r\n\t\tCriterion emailCriterion = null;\r\n\t\tCriterion idCriterion = null;\r\n\r\n\t\tCriteria criteria = sessionFactory.getCurrentSession().createCriteria(Employee.class);\r\n\r\n\t\tif (!StringUtils.isEmpty(firstname)) {\r\n\t\t\tfirstnameCriterion = Restrictions.ilike(\"firstname\", firstname, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(lastname)) {\r\n\t\t\tlastCriterion = Restrictions.ilike(\"lastname\", firstname, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(email)) {\r\n\t\t\temailCriterion = Restrictions.ilike(\"email\", email, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(id)) {\r\n\t\t\tidCriterion = Restrictions.eq(\"id\", id);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(idCriterion)) {\r\n\t\t\tcriteria.add(idCriterion);\r\n\t\t}\r\n\t\tDisjunction disjunctions = Restrictions.disjunction();\r\n\r\n\t\tif (null != firstnameCriterion) {\r\n\t\t\tdisjunctions.add(firstnameCriterion);\r\n\t\t}\r\n\r\n\t\tif (null != lastCriterion) {\r\n\t\t\tdisjunctions.add(lastCriterion);\r\n\t\t}\r\n\r\n\t\tif (null != emailCriterion) {\r\n\t\t\tdisjunctions.add(emailCriterion);\r\n\t\t}\r\n\r\n\t\tcriteria.add(disjunctions);\r\n\r\n\t\treturn criteria.list();\r\n\t}", "public List<Employe> findAllEmployees() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployeeList() throws Exception {\n\t\t\r\n\t\treturn (List<Employee>) employeeRepository.findAll();\r\n\t}", "public static HashSet<Employee> find(HashSet<Employee> emplists, int id) {\n\n\t\tEmployee em = new Employee();\n\n\t\tHashSet<Employee> findList = new HashSet<Employee>();\n\t\t\n\t\tfor (Employee emp : emplists) {\n\n\t\t\tif (id == emp.getEmpId()) {\n\t\t\t\tem.setEmpId(emp.getEmpId());\n\t\t\t\tem.setEmpName(emp.getEmpName());\n\t\t\t\tem.setEmpAge(emp.getEmpAge());\n\t\t\t\tem.setEmpSalary(emp.getEmpSalary());\n\t\t\t\tfindList.add(em);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn findList;\n\t}", "public Employee getEmployeeById(int id) {\n Employee foundedEmployee = null;\n String SQL = \"SELECT * FROM `employees` WHERE `idEmployee` =\" + id + \"\";\n MysqlDbManager dbManager = MysqlDbManager.getInstance();\n try {\n ResultSet resultSet = dbManager.getResultSet(SQL);\n while (resultSet.next()) {\n foundedEmployee = new Employee(resultSet);\n }\n } catch (SQLException e) {\n LOGGER.log(Level.SEVERE, \"SQLException\" + e.toString());\n } finally {\n try {\n if (!dbManager.getPreparedStatement().isClosed()) {\n dbManager.getPreparedStatement().close();\n }\n if (!dbManager.getResultSet().isClosed()) {\n dbManager.getResultSet().close();\n }\n } catch (SQLException e) {\n LOGGER.log(Level.SEVERE, \"SQLException\" + e.toString());\n }\n }\n return foundedEmployee;\n }", "public List<EmployeeTO> getAllEmployees() {\n\t\t\r\n\t\treturn EmployeeService.getInstance().getAllEmployees();\r\n\t}", "public List<Employee> listAllCrud(){\n return employeeCrudRepository.findAll();\n }", "@Override\n\tpublic List<Employee> viewAllEmployees() {\n\t\t CriteriaBuilder cb = em.getCriteriaBuilder();\n\t\t CriteriaQuery<Employee> cq = cb.createQuery(Employee.class);\n\t\t Root<Employee> rootEntry = cq.from(Employee.class);\n\t\t CriteriaQuery<Employee> all = cq.select(rootEntry);\n\t \n\t\t TypedQuery<Employee> allQuery = em.createQuery(all);\n\t\t return allQuery.getResultList();\n\t}", "@SuppressWarnings(\"unchecked\")\n private List<Hall> getHalls(Session session, int idCompany) {\n Query query = session.createQuery(\"FROM Hall WHERE idCompany = :id\");\n query.setParameter(\"id\", idCompany);\n return query.list();\n }", "@Override\n\tpublic List<Employee> getAll() {\n\t\tList<Employee> list =null;\n\t\tEmployeeDAO employeeDAO = DAOFactory.getEmployeeDAO();\n\t\ttry {\n\t\t\tlist=employeeDAO.getAll();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "EmployeeDTO findById(Long employeeId);", "public List<Employee> findEmployee(String name) {\n\t\tCriteriaQuery<Employee> createQuery = emp.getCriteriaBuilder().createQuery(Employee.class);\n\t\tRoot<Employee> root = createQuery.from(Employee.class);\n\t\tcreateQuery.where(root.get(\"name\").in(name));\n\t\treturn emp.createQuery(createQuery).getResultList();\n\t}", "List<EmployeeDTO> findByName(String name);", "@Override\r\n\tpublic List<Company> getAllCompanies() {\r\n\t\tString methodName = \"getAllCompanies()\";\r\n\t\tlog.info(className+\",\"+methodName);\r\n\t\treturn companyRepository.findAll();\r\n\t\t\r\n\t}", "@Override\n\tpublic List<Employee> findAllEmployee() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> findAll() {\n\t\t\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t\t\t// create a query\n\t\t\t\tQuery<Employee> theQuery = currentSession.createQuery(\"from Employee\", Employee.class);\n\t\t\t\t\n\t\t\t\t// execute a query and get the result list\n\t\t\t\tList<Employee> employeeList = theQuery.getResultList();\n\t\t\t\t\n\t\t\t\t// return the result list\n\t\t\t\treturn employeeList;\n\t}", "public Employee getEmployeeById(Long custId)throws EmployeeException;", "@GetMapping(\"/emloyees\")\n public List<Employee> all() {\n return employeeRepository.findAll();\n }", "public abstract List<Company> getAll();", "public List<Employee> getEmployees() {\n\n\t\tList<Employee> employees = new ArrayList<Employee>();\n\t\t\n\t\t/*Sample data begins\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tEmployee employee = new Employee();\n\t\t\temployee.setEmail(\"[email protected]\");\n\t\t\temployee.setFirstName(\"Shiyong\");\n\t\t\temployee.setLastName(\"Lu\");\n\t\t\temployee.setAddress(\"123 Success Street\");\n\t\t\temployee.setCity(\"Stony Brook\");\n\t\t\temployee.setStartDate(\"2006-10-17\");\n\t\t\temployee.setState(\"NY\");\n\t\t\temployee.setZipCode(11790);\n\t\t\temployee.setTelephone(\"5166328959\");\n\t\t\temployee.setEmployeeID(\"631-413-5555\");\n\t\t\temployee.setHourlyRate(100);\n\t\t\temployees.add(employee);\n\t\t}\n\t\tSample data ends*/\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tConnection con = DriverManager.getConnection(\"jdbc:mysql://mysql3.cs.stonybrook.edu:3306/mwcoulter?useSSL=false\",\"mwcoulter\",\"111030721\");\n\t\t\tStatement st = con.createStatement();\n\t\t\tResultSet rs = st.executeQuery(\"SELECT P.*, E.StartDate, E.HourlyRate, E.Email, E.ID, L.* \"\n\t\t\t\t\t+ \"FROM Employee E, Person P, Location L\"\n\t\t\t\t\t+ \" WHERE P.SSN = E.SSN AND L.ZipCode = P.ZipCode\");\n\t\t\twhile(rs.next()) {\n\t\t\t\tEmployee employee = new Employee();\n\t\t\t\temployee.setEmail(rs.getString(\"Email\"));\n\t\t\t\temployee.setFirstName(rs.getString(\"FirstName\"));\n\t\t\t\temployee.setLastName(rs.getString(\"LastName\"));\n\t\t\t\temployee.setAddress(rs.getString(\"Address\"));\n\t\t\t\temployee.setCity(rs.getString(\"City\"));\n\t\t\t\temployee.setStartDate(String.valueOf(rs.getDate(\"StartDate\")));\n\t\t\t\temployee.setState(rs.getString(\"State\"));\n\t\t\t\temployee.setZipCode(rs.getInt(\"ZipCode\"));\n\t\t\t\temployee.setTelephone(String.valueOf(rs.getLong(\"Telephone\")));\n\t\t\t\temployee.setEmployeeID(String.valueOf(rs.getInt(\"SSN\")));\n\t\t\t\temployee.setHourlyRate(rs.getInt(\"HourlyRate\"));\n\t\t\t\temployees.add(employee);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t\treturn employees;\n\t}", "public List<Company> companies() {\n StandardServiceRegistry registry = new StandardServiceRegistryBuilder().configure().build();\n SessionFactory sessionFactory = null;\n try {\n\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n Session session = sessionFactory.getCurrentSession();\n session.beginTransaction();\n List<Company> listOfCompanies = session.createQuery(\"FROM Company\").getResultList();\n session.getTransaction().commit();\n return listOfCompanies;\n\n } finally {\n if (sessionFactory != null) {\n sessionFactory.close();\n }\n }\n }", "@Override\n\tpublic Page<Employee> findAllByIdsIn(List<Long> ids, GlobalSearch globalSearch, Pageable pageable) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Employee> findAll() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<Employee> findAll() {\n\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t\n\t\t\n\t\t//create a query\n\t\t\n\t\tQuery<Employee> theQuery= currentSession.createQuery(\"from Employee\",Employee.class);\n\t\t\n\t\tList<Employee> theEmployees=theQuery.list();\n\t\treturn theEmployees;\n\t}", "@Override\n\tpublic Emp findbyId(int eid) {\n\t\treturn eb.findbyId(eid);\n\t}", "public static List<Employee> getAllEmployees(){\n\t\t// Get the Datastore Service\n\t\tlog.severe(\"datastoremanager-\" + 366);\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tlog.severe(\"datastoremanager-\" + 368);\n\t\tQuery q = buildAQuery(null);\n\t\tlog.severe(\"datastoremanager-\" + 370);\n\t\t// Use PreparedQuery interface to retrieve results\n\t\tPreparedQuery pq = datastore.prepare(q);\n\t\tlog.severe(\"datastoremanager-\" + 373);\n\t\t//List for returning\n\t\tList<Employee> returnedList = new ArrayList<>();\n\t\tlog.severe(\"datastoremanager-\" + 376);\n\t\t//Loops through all results and add them to the returning list \n\t\tfor (Entity result : pq.asIterable()) {\n\t\t\tlog.severe(\"datastoremanager-\" + 379);\n\t\t\t//Vars to use\n\t\t\tString actualFirstName = null;\n\t\t\tString actualLastName = null;\n\t\t\tBoolean attendedHrTraining = null;\n\t\t\tDate hireDate = null;\n\t\t\tBlob blob = null;\n\t\t\tbyte[] photo = null;\n\t\t\t\n\t\t\t//Get results via the properties\n\t\t\ttry {\n\t\t\t\tactualFirstName = (String) result.getProperty(\"firstName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tactualLastName = (String) result.getProperty(\"lastName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tattendedHrTraining = (Boolean) result.getProperty(\"attendedHrTraining\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\thireDate = (Date) result.getProperty(\"hireDate\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tblob = (Blob) result.getProperty(\"picture\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tphoto = blob.getBytes();\n\t\t\t} catch (Exception e){}\n\t\t\tlog.severe(\"datastoremanager-\" + 387);\n\t\t\t\n\t\t\t//Build an employee (If conditionals for nulls)\n\t\t\tEmployee emp = new Employee();\n\t\t \temp.setFirstName((actualFirstName != null) ? actualFirstName : null);\n\t\t \temp.setLastName((actualLastName != null) ? actualLastName : null);\n\t\t \temp.setAttendedHrTraining((attendedHrTraining != null) ? attendedHrTraining : null);\n\t\t \temp.setHireDate((hireDate != null) ? hireDate : null);\n\t\t \temp.setPicture((photo != null) ? photo : null);\n\t\t \tlog.severe(\"datastoremanager-\" + 395);\n\t\t \treturnedList.add(emp);\n\t\t}\n\t\tlog.severe(\"datastoremanager-\" + 398);\n\t\treturn returnedList;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn employeeDao.getAllEmployees();\n\t}", "public NominaPuesto[] findWhereIdEmpresaEquals(int idEmpresa) throws NominaPuestoDaoException;" ]
[ "0.75379306", "0.70871985", "0.6997461", "0.69794387", "0.67503774", "0.66399354", "0.662703", "0.65855116", "0.6571396", "0.65570515", "0.6509131", "0.64596003", "0.64562476", "0.6441718", "0.6424856", "0.6408035", "0.6397774", "0.63738817", "0.63724494", "0.63708365", "0.6370804", "0.63666254", "0.63481605", "0.6334616", "0.6332487", "0.6327231", "0.631327", "0.6303172", "0.62913054", "0.62831306", "0.62767947", "0.62730896", "0.6269549", "0.6265462", "0.6262167", "0.62472373", "0.62438804", "0.6232906", "0.6231211", "0.6223063", "0.6210516", "0.6200011", "0.6196008", "0.6192692", "0.6183947", "0.61730176", "0.61726", "0.6172392", "0.61711127", "0.61633915", "0.6157099", "0.6149451", "0.6137211", "0.6134865", "0.61343247", "0.6131666", "0.6125226", "0.61242104", "0.612174", "0.61208767", "0.61167306", "0.6114957", "0.6107563", "0.6105563", "0.6103426", "0.6099264", "0.60979944", "0.6097538", "0.60895276", "0.6087228", "0.60794884", "0.60635954", "0.6057198", "0.6054454", "0.6042735", "0.60367346", "0.60322726", "0.60299474", "0.60265696", "0.60204214", "0.60188556", "0.6010716", "0.6010278", "0.60098976", "0.5997275", "0.59953934", "0.5994313", "0.59746444", "0.5961974", "0.5961582", "0.5948691", "0.5947019", "0.5946674", "0.5944819", "0.59432673", "0.5940123", "0.5939704", "0.593883", "0.5934852", "0.59306264" ]
0.79846853
0
Find all employees by type.
List<CompanyEmployeeDTO> findAllByType(EmployeeType type);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<E> findAll(Class<E> type){\n transaction.begin();\n List<E> types = entityManager.createQuery(\" from \" + type.getName()).getResultList();\n transaction.commit();\n return types;\n }", "@Override\n\tpublic List<EmploieType> findAll() {\n\t\treturn emploieTypeRepository.findAll();\n\t}", "List<CompanyEmployeeDTO> findAllByCompanyIdAndEmployeeType(Long companyId, EmployeeType employeeType);", "public List<Employees> findAllByEmploymentTypeIdName(String Name);", "List<Employee> findAll();", "@Override\r\n\tpublic List<AsxDataVO> findByType(int type) {\n\t\treturn mongoTemplate.find(new Query(Criteria.where(\"type\").is(type)), AsxDataVO.class);\r\n\t}", "@Override\n public Class<Employee> getType() {\n return Employee.class;\n }", "@Override\r\n\tpublic List<Employee> findAllEMployees() {\n\t\tList<Employee> employees = new ArrayList<Employee>();\r\n\t\tString findData = \"select * from employee\";\r\n\r\n\t\ttry {\r\n\t\t\tStatement s = dataSource.getConnection().createStatement();\r\n\r\n\t\t\tResultSet set = s.executeQuery(findData);\r\n\r\n\t\t\twhile (set.next()) {\r\n\t\t\t\tString name = set.getString(1);\r\n\t\t\t\tint id = set.getInt(\"empId\");\r\n\t\t\t\tint sal = set.getInt(\"salary\");\r\n\t\t\t\tString tech = set.getString(\"technology\");\r\n\t\t\t\tEmployee employee = new Employee(id, sal, name, tech);\r\n\t\t\t\temployees.add(employee);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn employees;\r\n\r\n\t}", "@Override\n public List<Complaint> viewComplaintsForEmployee(final String type) {\n\n String SELECT = \"SELECT * FROM complaints WHERE typeOfComplaint = ? ORDER BY complaintId ASC\";\n\n return jdbcTemplate.query(SELECT, new PreparedStatementSetter() {\n @Override\n public void setValues(PreparedStatement preparedStatement) throws SQLException {\n preparedStatement.setString(1, type);\n }\n }, getComplaintMapper());\n }", "List<Employee> findAllByName(String name);", "public List<Employe> findAllEmployees() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Record> getRecordsByType(Type type) {\n\t\tSession session=HibernateSessionFactory.getSession();\n\t\tTransaction tx=session.beginTransaction();\n\t\tList<Record> list=new ArrayList<Record>();\n\t\tRecordDAO recordDAO=new RecordDAO();\n\t\t\n\t\ttry{\n\t\t\tlist=recordDAO.getRecordsByType(type);\n\t\t\ttx.commit();\n\t\t}catch(RuntimeException e){\n\t\t\te.printStackTrace();\n\t\t\ttx.rollback();\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t\treturn list;\n\t}", "List<Employee> findByName(String name);", "List<ReportType> findTypes();", "public List<Employeee> findAll(Class c) {\n\t\treturn employeerepo.findAll();\n\t}", "public List<Employee> getAllEmployees() {\n\t\tList<Employee> list = new ArrayList<Employee>();\n\t\tlist = template.loadAll(Employee.class);\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<Employee> findAll() {\n\t\treturn null;\r\n\t}", "public Items[] findWhereTypeEquals(String type) throws ItemsDaoException;", "@Override\n\tpublic List<Employee> findAllEmployees() {\n\t\treturn employeeRepository.findAllEmployess();\n\t}", "public List<EmployeeTO> getAllEmployees() {\n\t\t\r\n\t\treturn EmployeeService.getInstance().getAllEmployees();\r\n\t}", "public List<Employee> findAll() {\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\t\n\t\tlog.debug(\"EmplyeeService.getAllEmployee() return list of employees\");\n\t\treturn repositary.findAll();\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\tfinal Session session = sessionFactory.getCurrentSession();\t\t\r\n\t\tfinal Query query = session.createQuery(\"from Employee e order by id desc\");\r\n\t\t//Query q = session.createQuery(\"select NAME from Customer\");\r\n\t\t//final List<Employee> employeeList = query.list(); \r\n\t\treturn (List<Employee>) query.list();\r\n\t}", "public List<PojoUser> getUsersByType(String type) {\n\t\tList<PojoUser> userByType = new ArrayList<PojoUser>();\n\t\tfor (User user : repo.getUsers()) {\n\t\t\tfor (String userType : user.getUserType()) {\n\t\t\t\tif (type.equals(userType)) {\n\t\t\t\t\tPojoUser pojo= new PojoUser();\n\t\t\t\t\tpojo.setFullName(user.getFullName());\n\t\t\t\t\tpojo.setMail(user.getEmail());\n\t\t\t\t\tuserByType.add(pojo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn userByType;\n\t}", "@Override\n\tpublic List<EmpType> findList(Integer currentPage, Integer pageSize,\n\t\t\tEmpTypeVo vo) {\n\t\treturn null;\n\t}", "public List<Employee> getAllEmployees(){\n\t\tList<Employee> employees = employeeDao.findAll();\n\t\tif(employees != null)\n\t\t\treturn employees;\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> findAll() {\n\t\t\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t\t\t// create a query\n\t\t\t\tQuery<Employee> theQuery = currentSession.createQuery(\"from Employee\", Employee.class);\n\t\t\t\t\n\t\t\t\t// execute a query and get the result list\n\t\t\t\tList<Employee> employeeList = theQuery.getResultList();\n\t\t\t\t\n\t\t\t\t// return the result list\n\t\t\t\treturn employeeList;\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employees;\r\n\t}", "@Override\n\tpublic List<Employee> findAllEmployee() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> findAll() {\n\t\tSession currentSession = entityManager.unwrap(Session.class);\n\t\t\n\t\t\n\t\t//create a query\n\t\t\n\t\tQuery<Employee> theQuery= currentSession.createQuery(\"from Employee\",Employee.class);\n\t\t\n\t\tList<Employee> theEmployees=theQuery.list();\n\t\treturn theEmployees;\n\t}", "public List<Employee> getAllEmployee(){\n List<Employee> employee = new ArrayList<Employee>();\n employeeRepository.findAll().forEach(employee::add);\n return employee;\n }", "public List<Employee> getAllEmployees() {\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<Emp> findAll() {\n\t\treturn eb.findAll();\n\t}", "@Override\n\tpublic List<Employee> getEmpleados() {\n\t\treturn repositorioEmployee.findAll();\n\t}", "public List<Employee> getAll() {\n\t\treturn edao.listEmploye();\n\t}", "public List<Employee> getListOfAllEmployees() {\n\t\tlista = employeeDao.findAll();\r\n\r\n\t\treturn lista;\r\n\t}", "List<Employee> allEmpInfo();", "public <T extends IDBEntities> List<T> retrieveAll(Class<? extends IDBEntities> type) {\n\t\tif (type == null)\n\t\t\treturn new ArrayList<>();\n\t\tList<T> result;\n\t\tEntityManager em = getEM();\n\t\ttry {\n\t\t\tQuery q = em.createNamedQuery(type.getSimpleName() + \".findAll\", type);\n\t\t\tresult = q.getResultList();\n\t\t} catch (Exception ex) {\n\t\t\t// No records exist\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\t\t// Dealing with EclipseLink Vector overriding issues (iterators don't work properly)\n\t\tList<T> output = new ArrayList<>();\n\t\toutput.addAll(result);\n\t\treturn output;\n\t}", "@Override\n\tpublic List<Employee> queryAll() {\n\t\treturn dao.queryAll();\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<HospitalDto> getHospital(String type, String code) throws Exception {\n\t\treturn sqlSession.getMapper(HouseMapper.class).getHospital(type, code);\n\t}", "@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}", "List<EmployeeDTO> findByName(String name);", "@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}", "@GetMapping(\"/findAllEmployees\")\n\tpublic List<Employee> getAll() {\n\t\treturn testService.getAll();\n\t}", "List<Office> findAll();", "public List<Resource> findByType(ResourceType type) {\n\t\tMap<String, Object> typeFilter = new HashMap<>(1);\n\n\t\ttypeFilter.put(\"type\", new ValueParameter(type));\n\n\t\treturn this.filter(typeFilter);\n\t}", "<T> Set<T> lookupAll(Class<T> type);", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\ttry {\n\t\t\tList<Employee> empList = new ArrayList<Employee>();\n\t\t\tList<Map<String, Object>> rows = template.queryForList(\"select * from employee\");\n\t\t\tfor(Map<?, ?> rowNum : rows) {\n\t\t\t\tEmployee emp = new Employee();\n\t\t\t\temp.setEmployeeId((Integer)rowNum.get(\"empid\"));\n\t\t\t\temp.setFirstName((String)rowNum.get(\"fname\"));\n\t\t\t\temp.setLastName((String)rowNum.get(\"lname\"));\n\t\t\t\temp.setEmail((String)rowNum.get(\"email\"));\n\t\t\t\temp.setDesignation((String)rowNum.get(\"desig\"));\n\t\t\t\temp.setLocation((String)rowNum.get(\"location\"));\n\t\t\t\temp.setSalary((Integer)rowNum.get(\"salary\"));\n\t\t\t\tempList.add(emp);\n\t\t\t}\n\t\t\treturn empList;\n\t\t} catch (DataAccessException excep) {\n\t\t\treturn null;\n\t\t}\n\t}", "Collection<EmployeeDTO> getAll();", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<TypeContratEmployee> Getdetail(TypeContrat e) {\n\t\treturn rep.findAllByPkContratContrat(e);\n\t}", "@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }", "Page<EnumEmpTypeDTO> findAll(Pageable pageable);", "public static List<Employee> getAllEmployees(){\n\t\t// Get the Datastore Service\n\t\tlog.severe(\"datastoremanager-\" + 366);\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tlog.severe(\"datastoremanager-\" + 368);\n\t\tQuery q = buildAQuery(null);\n\t\tlog.severe(\"datastoremanager-\" + 370);\n\t\t// Use PreparedQuery interface to retrieve results\n\t\tPreparedQuery pq = datastore.prepare(q);\n\t\tlog.severe(\"datastoremanager-\" + 373);\n\t\t//List for returning\n\t\tList<Employee> returnedList = new ArrayList<>();\n\t\tlog.severe(\"datastoremanager-\" + 376);\n\t\t//Loops through all results and add them to the returning list \n\t\tfor (Entity result : pq.asIterable()) {\n\t\t\tlog.severe(\"datastoremanager-\" + 379);\n\t\t\t//Vars to use\n\t\t\tString actualFirstName = null;\n\t\t\tString actualLastName = null;\n\t\t\tBoolean attendedHrTraining = null;\n\t\t\tDate hireDate = null;\n\t\t\tBlob blob = null;\n\t\t\tbyte[] photo = null;\n\t\t\t\n\t\t\t//Get results via the properties\n\t\t\ttry {\n\t\t\t\tactualFirstName = (String) result.getProperty(\"firstName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tactualLastName = (String) result.getProperty(\"lastName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tattendedHrTraining = (Boolean) result.getProperty(\"attendedHrTraining\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\thireDate = (Date) result.getProperty(\"hireDate\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tblob = (Blob) result.getProperty(\"picture\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tphoto = blob.getBytes();\n\t\t\t} catch (Exception e){}\n\t\t\tlog.severe(\"datastoremanager-\" + 387);\n\t\t\t\n\t\t\t//Build an employee (If conditionals for nulls)\n\t\t\tEmployee emp = new Employee();\n\t\t \temp.setFirstName((actualFirstName != null) ? actualFirstName : null);\n\t\t \temp.setLastName((actualLastName != null) ? actualLastName : null);\n\t\t \temp.setAttendedHrTraining((attendedHrTraining != null) ? attendedHrTraining : null);\n\t\t \temp.setHireDate((hireDate != null) ? hireDate : null);\n\t\t \temp.setPicture((photo != null) ? photo : null);\n\t\t \tlog.severe(\"datastoremanager-\" + 395);\n\t\t \treturnedList.add(emp);\n\t\t}\n\t\tlog.severe(\"datastoremanager-\" + 398);\n\t\treturn returnedList;\n\t}", "public List<Employee> getAllEmployees(){\n\t\tFaker faker = new Faker();\n\t\tList<Employee> employeeList = new ArrayList<Employee>();\n\t\tfor(int i=101; i<=110; i++) {\n\t\t\tEmployee myEmployee = new Employee();\n\t\t\tmyEmployee.setId(i);\n\t\t\tmyEmployee.setName(faker.name().fullName());\n\t\t\tmyEmployee.setMobile(faker.phoneNumber().cellPhone());\n\t\t\tmyEmployee.setAddress(faker.address().streetAddress());\n\t\t\tmyEmployee.setCompanyLogo(faker.company().logo());\n\t\t\temployeeList.add(myEmployee);\n\t\t}\n\t\treturn employeeList;\n\t}", "public List<T> findAll() {\n\n\t\tConnection dbConnection = ConnectionFactory.getConnection();\n\t\tPreparedStatement findStatement = null;\n\t\tResultSet rs = null;\n\t\tString findStatementString = \"SELECT * FROM \" + type.getSimpleName();\n\n\t\ttry {\n\t\t\tfindStatement = dbConnection.prepareStatement(findStatementString);\n\t\t\trs = findStatement.executeQuery();\n\t\t\treturn createObjects(rs);\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.log(Level.WARNING, type.getName() + \"DAO:findAll\" + e.getMessage());\n\t\t} finally {\n\t\t\tConnectionFactory.close(rs);\n\t\t\tConnectionFactory.close(findStatement);\n\t\t\tConnectionFactory.close(dbConnection);\n\t\t}\n\t\treturn null;\n\t}", "ResultSet searchType(String type) {\n \ttry {\n \t\tStatement search = this.conn.createStatement();\n \tString query = \"SELECT * \"\n \t\t\t+ \"FROM Pokemon AS P, Types AS T \"\n \t\t\t+ \"WHERE (P.Type1=T.TypeID OR P.Type2 = T.TypeID) AND \"\n \t\t\t+ \"T.name = \" + \"'\" + type + \"'\";\n \t\n \treturn search.executeQuery(query);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n }", "@Override\r\n\tpublic List<Employee> getAllEmployeeList() throws Exception {\n\t\t\r\n\t\treturn (List<Employee>) employeeRepository.findAll();\r\n\t}", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn null;\n\t}", "Page<Employee> findAll(Pageable page);", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\tList<Employee> employee = new ArrayList<>();\n\t\tlogger.info(\"Getting all employee\");\n\t\ttry {\n\t\t\temployee = employeeDao.getAllEmployee();\n\t\t\tlogger.info(\"Getting all employee = {}\",employee.toString());\n\t\t} catch (Exception exception) {\n\t\t\tlogger.error(exception.getMessage());\n\t\t}\n\t\treturn employee;\n\t}", "@Override\r\n\tpublic List<Employee> selectAllEmployee() {\n\t\treturn null;\r\n\t}", "public List<Objet> getObjetsFindByIdTypeObjet(long idTypeObjet) {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> viewAllEmployees() {\n\t\t CriteriaBuilder cb = em.getCriteriaBuilder();\n\t\t CriteriaQuery<Employee> cq = cb.createQuery(Employee.class);\n\t\t Root<Employee> rootEntry = cq.from(Employee.class);\n\t\t CriteriaQuery<Employee> all = cq.select(rootEntry);\n\t \n\t\t TypedQuery<Employee> allQuery = em.createQuery(all);\n\t\t return allQuery.getResultList();\n\t}", "public List<Employee> findEmployee(String name) {\n\t\tCriteriaQuery<Employee> createQuery = emp.getCriteriaBuilder().createQuery(Employee.class);\n\t\tRoot<Employee> root = createQuery.from(Employee.class);\n\t\tcreateQuery.where(root.get(\"name\").in(name));\n\t\treturn emp.createQuery(createQuery).getResultList();\n\t}", "public List<Employees> getEmployeesList()\n {\n return employeesRepo.findAll();\n }", "public List<Employee> getEmployeesOnly() {\n\t\treturn edao.listEmployeOnly();\n\t}", "public List<Employee> selectAllEmployee() {\n\n\t\t// using try-with-resources to avoid closing resources (boiler plate code)\n\t\tList<Employee> emp = new ArrayList<>();\n\t\t// Step 1: Establishing a Connection\n\t\ttry (Connection connection = dbconnection.getConnection();\n\n\t\t\t\t// Step 2:Create a statement using connection object\n\t\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(SELECT_ALL_employe);) {\n\t\t\tSystem.out.println(preparedStatement);\n\t\t\t// Step 3: Execute the query or update query\n\t\t\tResultSet rs = preparedStatement.executeQuery();\n\n\t\t\t// Step 4: Process the ResultSet object.\n\t\t\twhile (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString employeename = rs.getString(\"employeename\");\n\t\t\t\tString address = rs.getString(\"address\");\n\t\t\t\tint mobile = rs.getInt(\"mobile\");\n\t\t\t\tString position = rs.getString(\"position\");\n\t\t\t\tint Salary = rs.getInt(\"Salary\");\n\t\t\t\tString joineddate = rs.getString(\"joineddate\");\n\t\t\t\tString filename =rs.getString(\"filename\");\n\t\t\t\tString path = rs.getString(\"path\");\n\t\t\t\temp.add(new Employee(id, employeename, address, mobile, position, Salary, joineddate,filename,path));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tdbconnection.printSQLException(e);\n\t\t}\n\t\treturn emp;\n\t}", "@Override\n\tpublic List<FoodType> FindAllType() {\n\t\treturn ftb.FindAllType();\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic List<eventuales> findBytipoEventuales(int tipo) {\n\t\treturn dao.findBytipoEventuales(tipo);\r\n\t}", "@Override\r\n\tpublic List<UserType> finds() {\n\t\tMyBatisCriteria example = new MyBatisCriteria();\r\n\t\ttry {\r\n\t\t\treturn this.userTypeMapper.selectByExample(example);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new DatabaseException(e);\r\n\t\t}\r\n\t}", "@SuppressWarnings({ \"unchecked\", \"static-access\" })\n\t@Override\n\t/**\n\t * Leo todos los empleados.\n\t */\n\tpublic List<Employees> readAll() {\n\t\tList<Employees> ls = null;\n\n\t\tls = ((SQLQuery) sm.obtenerSesionNueva().createQuery(\n\t\t\t\tInstruccionesSQL.CONSULTAR_TODOS)).addEntity(Employees.class)\n\t\t\t\t.list();// no creo que funcione, revisar\n\n\t\treturn ls;\n\t}", "@Override\n\tpublic List queryfind(String type, String query)\n\t{\n\t\treturn teataskMapper.queryfind(type, query);\n\t}", "@Override\n public List<Employee> getAllEmployees() {\n return null;\n }", "public List<Employee> getEmployees();", "public List<E> findAll();", "public List<Employee> listAll(){\n return employeeRepository.findAll();\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic List<T> getAll(Class<T> type) {\n\t\treturn super.getSessionFactory().getCurrentSession().createQuery(\"from \"+type.getName()+\"\").list();\r\n\t}", "@Override\n\tpublic List<Subordination> findBySender(Employee employee, DocumentType docType) throws DBOperationException {\n\t\tPreparedStatement statement = null;\n\t\tList<Subordination> subList = new ArrayList<>();\n\t\tSubordination sub = null;\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(SUBORDINATION_BY_SENDER_DOCTYPE);\n\t\t\tstatement.setInt(1, employee.getEmployeeID());\n\t\t\tstatement.setInt(2, docType.getDocTypeID());\n\t\t\tResultSet rSet = statement.executeQuery();\n\t\t\twhile (rSet.next()) {\n\t\t\t\tsub = new Subordination();\n\t\t\t\tinitSubordination(rSet, sub);\n\t\t\t\tsubList.add(sub);\n\t\t\t}\n\t\t\tstatement.close();\n\t\t\trSet.close();\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DBOperationException(\"Subordination not found. DB error.\", e);\n\t\t} \n\t\treturn subList;\n\t}", "public <T extends IDBEntities> List<T> find(Class<? extends IDBEntities> type,\n\t\t\tISearchQueries query, String val) {\n\t\t// Transient search is meaningless\n\t\tif (val == null)\n\t\t\treturn null;\n\t\t// Query name must begin in uppercase, yet the actual parameter name starts with lowercase\n\t\tchar first = Character.toLowerCase(query.toString().charAt(0));\n\t\tString parameter = first + query.toString().substring(1);\n\t\tEntityManager em = getEM();\n\t\tQuery q = em.createNamedQuery(type.getSimpleName() + \".findBy\" + query.toString());\n\t\t// value to search for can by either int or String\n\t\t// Try parsing as int:\n\t\ttry {\n\t\t\tint intVal = Integer.parseInt(val);\n\t\t\tq.setParameter(parameter, intVal);\n\t\t}\n\t\t// Value was a String:\n\t\tcatch (NumberFormatException ex) {\n\t\t\tq.setParameter(parameter, val);\n\t\t}\n\n\t\tList<T> result;\n\t\ttry {\n\t\t\tresult = q.getResultList();\n\t\t} catch (Exception ex) {\n\t\t\treturn null;\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\t\t// Dealing with EclipseLink Vector overriding issues (iterators don't work properly)\n\t\tList<T> output = new ArrayList<>();\n\t\toutput.addAll(result);\n\t\treturn output;\n\t}", "public List<Employee> getEmployeesByOffice(String officeCode) {\n return employeeDao.selectOfficeCode(officeCode);\n// return getAll().stream().filter(emp -> emp.getOfficeCode() == null\n// ? null\n// : emp.getOfficeCode().equals(officeCode))\n// .collect(Collectors.toList());\n }", "@Override\n\tpublic void getAllEmployee() {\n\t\t\n\t}", "List<Employee> findByNameAndLocation(String name, String location);", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn employeeDao.getAllEmployees();\n\t}", "List<E> findAll();", "List<E> findAll();", "List<E> findAll();", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employeeDao.getAllEmployee();\r\n\t}", "@Override\r\n\tpublic Page<Employee> findAll(Pageable arg0) {\n\t\treturn null;\r\n\t}", "public List<User> findEmployees(String companyShortName, int start, int rows, String sortBy, String sortHow);", "@Transactional(readOnly = true)\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\treturn em.createQuery(\"select e from Employee e order by e.office_idoffice\").getResultList();\r\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic List<eventuales> findBytipo(int tipo) {\n\t\treturn (List<eventuales>) dao.findBytipo(tipo);\r\n\t}", "@Override\n\tpublic List<EmployeeBean> getAllEmployees() {\n\t\tLOGGER.info(\"starts getAllEmployees method\");\n\t\tLOGGER.info(\"Ends getAllEmployees method\");\n\t\t\n\t\treturn adminEmployeeDao.getAllEmployees();\n\t}", "public List<Product> findByVehicleType(String typeOfVehicle);", "public Object searchEmployeeDatabase(String searchTerm, String searchType) {\n\n Object completedSearch = null;\n\n completedSearch = queryDatabase(searchType, searchTerm);\n\n return completedSearch;\n }", "public Page<Event> findEventsByEventTypeId(Long typeId , Pageable pageable);", "public static ArrayList<Employee> getAllEmployee() throws SQLException {\n\t\tConnection connection = DatabaseConnection.getConnection();\n\t\tArrayList<Employee> employee = new ArrayList<>();\n\t\tString query = \"SELECT * FROM EMPLOYEE\";\n\t\tPreparedStatement pStatement = connection.prepareStatement(query);\n\t\tResultSet resultSet = pStatement.executeQuery();\n\t\twhile (resultSet.next()) {\n\t\t\temployee.add(new Employee(resultSet.getString(\"empId\"), resultSet\n\t\t\t\t\t.getString(\"ename\")));\n\t\t}\n\t\treturn employee;\n\t}", "public List<Employee> findAllByPosition(String position);" ]
[ "0.7137625", "0.71026224", "0.66383743", "0.6450968", "0.6400926", "0.63909", "0.6336264", "0.61468965", "0.60287565", "0.6012398", "0.59986377", "0.59584284", "0.59554875", "0.5916455", "0.5913966", "0.5913556", "0.5901193", "0.588589", "0.5870141", "0.5869387", "0.5864047", "0.58596665", "0.5848728", "0.5843267", "0.5838886", "0.5826415", "0.5825559", "0.5802736", "0.57795656", "0.5771216", "0.57678497", "0.57596296", "0.5753276", "0.5748612", "0.57184464", "0.5716651", "0.56865203", "0.5683426", "0.5681575", "0.56721896", "0.56668544", "0.5665694", "0.5665188", "0.5662877", "0.5659493", "0.5640692", "0.56230104", "0.5621973", "0.5614866", "0.56027305", "0.55961615", "0.55961615", "0.55938053", "0.5584344", "0.5581374", "0.55699515", "0.5568217", "0.5550359", "0.5548612", "0.5545395", "0.5535521", "0.55331975", "0.55127186", "0.55122626", "0.55083615", "0.55019444", "0.55005914", "0.55004334", "0.5486407", "0.5485803", "0.54805833", "0.547946", "0.547019", "0.5460629", "0.5459941", "0.5451228", "0.544069", "0.543813", "0.5437744", "0.5427952", "0.5420697", "0.5417141", "0.5416009", "0.5414964", "0.541228", "0.54109097", "0.5403673", "0.5403673", "0.5403673", "0.5402772", "0.53955954", "0.53952384", "0.5394778", "0.53915226", "0.53910804", "0.538508", "0.53849596", "0.5382047", "0.5376723", "0.5345607" ]
0.7975587
0
Find all employees by company id znd employee type.
List<CompanyEmployeeDTO> findAllByCompanyIdAndEmployeeType(Long companyId, EmployeeType employeeType);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<CompanyEmployeeDTO> findAllByType(EmployeeType type);", "List<CompanyEmployeeDTO> findAllByCompanyId(Long id);", "public List<Employees> findAllByEmploymentTypeIdName(String Name);", "public List<User> getAllEmployees(String companyShortName);", "public interface CompanyEmployeeService extends AbstractService<CompanyEmployee, Long, CompanyEmployeeDTO> {\n\n /**\n * Find all employee by Company id.\n *\n * @return the list of entities\n */\n List<CompanyEmployeeDTO> findAllByCompanyId(Long id);\n\n /**\n * Find all employees by type.\n *\n * @param type the employee type\n * @return the list of entities\n */\n List<CompanyEmployeeDTO> findAllByType(EmployeeType type);\n\n /**\n * Find all employees by company id znd employee type.\n *\n * @param companyId the company id\n * @param employeeType the employee type\n * @return the list of entities\n */\n List<CompanyEmployeeDTO> findAllByCompanyIdAndEmployeeType(Long companyId, EmployeeType employeeType);\n}", "List<Employee> findAll();", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\tfinal Session session = sessionFactory.getCurrentSession();\t\t\r\n\t\tfinal Query query = session.createQuery(\"from Employee e order by id desc\");\r\n\t\t//Query q = session.createQuery(\"select NAME from Customer\");\r\n\t\t//final List<Employee> employeeList = query.list(); \r\n\t\treturn (List<Employee>) query.list();\r\n\t}", "public List<Employeee> findAll(Class c) {\n\t\treturn employeerepo.findAll();\n\t}", "public List<Employee> getAllEmployees(){\n\t\tFaker faker = new Faker();\n\t\tList<Employee> employeeList = new ArrayList<Employee>();\n\t\tfor(int i=101; i<=110; i++) {\n\t\t\tEmployee myEmployee = new Employee();\n\t\t\tmyEmployee.setId(i);\n\t\t\tmyEmployee.setName(faker.name().fullName());\n\t\t\tmyEmployee.setMobile(faker.phoneNumber().cellPhone());\n\t\t\tmyEmployee.setAddress(faker.address().streetAddress());\n\t\t\tmyEmployee.setCompanyLogo(faker.company().logo());\n\t\t\temployeeList.add(myEmployee);\n\t\t}\n\t\treturn employeeList;\n\t}", "@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}", "public List<Employee> getAllEmployees(){\n\t\tList<Employee> employees = employeeDao.findAll();\n\t\tif(employees != null)\n\t\t\treturn employees;\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Employee> findAllEMployees() {\n\t\tList<Employee> employees = new ArrayList<Employee>();\r\n\t\tString findData = \"select * from employee\";\r\n\r\n\t\ttry {\r\n\t\t\tStatement s = dataSource.getConnection().createStatement();\r\n\r\n\t\t\tResultSet set = s.executeQuery(findData);\r\n\r\n\t\t\twhile (set.next()) {\r\n\t\t\t\tString name = set.getString(1);\r\n\t\t\t\tint id = set.getInt(\"empId\");\r\n\t\t\t\tint sal = set.getInt(\"salary\");\r\n\t\t\t\tString tech = set.getString(\"technology\");\r\n\t\t\t\tEmployee employee = new Employee(id, sal, name, tech);\r\n\t\t\t\temployees.add(employee);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn employees;\r\n\r\n\t}", "public List<EmployeeTO> getAllEmployees() {\n\t\t\r\n\t\treturn EmployeeService.getInstance().getAllEmployees();\r\n\t}", "public Employee findEmployee(Long id);", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\t\n\t\tlog.debug(\"EmplyeeService.getAllEmployee() return list of employees\");\n\t\treturn repositary.findAll();\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\ttry {\n\t\t\tList<Employee> empList = new ArrayList<Employee>();\n\t\t\tList<Map<String, Object>> rows = template.queryForList(\"select * from employee\");\n\t\t\tfor(Map<?, ?> rowNum : rows) {\n\t\t\t\tEmployee emp = new Employee();\n\t\t\t\temp.setEmployeeId((Integer)rowNum.get(\"empid\"));\n\t\t\t\temp.setFirstName((String)rowNum.get(\"fname\"));\n\t\t\t\temp.setLastName((String)rowNum.get(\"lname\"));\n\t\t\t\temp.setEmail((String)rowNum.get(\"email\"));\n\t\t\t\temp.setDesignation((String)rowNum.get(\"desig\"));\n\t\t\t\temp.setLocation((String)rowNum.get(\"location\"));\n\t\t\t\temp.setSalary((Integer)rowNum.get(\"salary\"));\n\t\t\t\tempList.add(emp);\n\t\t\t}\n\t\t\treturn empList;\n\t\t} catch (DataAccessException excep) {\n\t\t\treturn null;\n\t\t}\n\t}", "public List<Employe> findAllEmployees() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic DataResult<Employees> getById(int id) {\n\t\treturn null;\r\n\t}", "public List<Employee> getAll() {\n\t\treturn edao.listEmploye();\n\t}", "List<Employee> allEmpInfo();", "public static List<Employee> getAllEmployees(){\n\t\t// Get the Datastore Service\n\t\tlog.severe(\"datastoremanager-\" + 366);\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tlog.severe(\"datastoremanager-\" + 368);\n\t\tQuery q = buildAQuery(null);\n\t\tlog.severe(\"datastoremanager-\" + 370);\n\t\t// Use PreparedQuery interface to retrieve results\n\t\tPreparedQuery pq = datastore.prepare(q);\n\t\tlog.severe(\"datastoremanager-\" + 373);\n\t\t//List for returning\n\t\tList<Employee> returnedList = new ArrayList<>();\n\t\tlog.severe(\"datastoremanager-\" + 376);\n\t\t//Loops through all results and add them to the returning list \n\t\tfor (Entity result : pq.asIterable()) {\n\t\t\tlog.severe(\"datastoremanager-\" + 379);\n\t\t\t//Vars to use\n\t\t\tString actualFirstName = null;\n\t\t\tString actualLastName = null;\n\t\t\tBoolean attendedHrTraining = null;\n\t\t\tDate hireDate = null;\n\t\t\tBlob blob = null;\n\t\t\tbyte[] photo = null;\n\t\t\t\n\t\t\t//Get results via the properties\n\t\t\ttry {\n\t\t\t\tactualFirstName = (String) result.getProperty(\"firstName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tactualLastName = (String) result.getProperty(\"lastName\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tattendedHrTraining = (Boolean) result.getProperty(\"attendedHrTraining\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\thireDate = (Date) result.getProperty(\"hireDate\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tblob = (Blob) result.getProperty(\"picture\");\n\t\t\t} catch (Exception e){}\n\t\t\ttry {\n\t\t\t\tphoto = blob.getBytes();\n\t\t\t} catch (Exception e){}\n\t\t\tlog.severe(\"datastoremanager-\" + 387);\n\t\t\t\n\t\t\t//Build an employee (If conditionals for nulls)\n\t\t\tEmployee emp = new Employee();\n\t\t \temp.setFirstName((actualFirstName != null) ? actualFirstName : null);\n\t\t \temp.setLastName((actualLastName != null) ? actualLastName : null);\n\t\t \temp.setAttendedHrTraining((attendedHrTraining != null) ? attendedHrTraining : null);\n\t\t \temp.setHireDate((hireDate != null) ? hireDate : null);\n\t\t \temp.setPicture((photo != null) ? photo : null);\n\t\t \tlog.severe(\"datastoremanager-\" + 395);\n\t\t \treturnedList.add(emp);\n\t\t}\n\t\tlog.severe(\"datastoremanager-\" + 398);\n\t\treturn returnedList;\n\t}", "List<Employee> findAllByName(String name);", "public List<Employee> getAllEmployees() {\n return employeeRepository.findAll();\n }", "@Override\n\tpublic void getAllEmployee() {\n\t\t\n\t}", "List<Employee> findByName(String name);", "public List<EmployeeManage> queryEmployeeId(int id) {\n\t\treturn \temployeeManageDao.queryEmployeeId(id);\r\n\t}", "public List<Employee> getEmployees() {\n\n\t\tList<Employee> employees = new ArrayList<Employee>();\n\t\t\n\t\t/*Sample data begins\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tEmployee employee = new Employee();\n\t\t\temployee.setEmail(\"[email protected]\");\n\t\t\temployee.setFirstName(\"Shiyong\");\n\t\t\temployee.setLastName(\"Lu\");\n\t\t\temployee.setAddress(\"123 Success Street\");\n\t\t\temployee.setCity(\"Stony Brook\");\n\t\t\temployee.setStartDate(\"2006-10-17\");\n\t\t\temployee.setState(\"NY\");\n\t\t\temployee.setZipCode(11790);\n\t\t\temployee.setTelephone(\"5166328959\");\n\t\t\temployee.setEmployeeID(\"631-413-5555\");\n\t\t\temployee.setHourlyRate(100);\n\t\t\temployees.add(employee);\n\t\t}\n\t\tSample data ends*/\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tConnection con = DriverManager.getConnection(\"jdbc:mysql://mysql3.cs.stonybrook.edu:3306/mwcoulter?useSSL=false\",\"mwcoulter\",\"111030721\");\n\t\t\tStatement st = con.createStatement();\n\t\t\tResultSet rs = st.executeQuery(\"SELECT P.*, E.StartDate, E.HourlyRate, E.Email, E.ID, L.* \"\n\t\t\t\t\t+ \"FROM Employee E, Person P, Location L\"\n\t\t\t\t\t+ \" WHERE P.SSN = E.SSN AND L.ZipCode = P.ZipCode\");\n\t\t\twhile(rs.next()) {\n\t\t\t\tEmployee employee = new Employee();\n\t\t\t\temployee.setEmail(rs.getString(\"Email\"));\n\t\t\t\temployee.setFirstName(rs.getString(\"FirstName\"));\n\t\t\t\temployee.setLastName(rs.getString(\"LastName\"));\n\t\t\t\temployee.setAddress(rs.getString(\"Address\"));\n\t\t\t\temployee.setCity(rs.getString(\"City\"));\n\t\t\t\temployee.setStartDate(String.valueOf(rs.getDate(\"StartDate\")));\n\t\t\t\temployee.setState(rs.getString(\"State\"));\n\t\t\t\temployee.setZipCode(rs.getInt(\"ZipCode\"));\n\t\t\t\temployee.setTelephone(String.valueOf(rs.getLong(\"Telephone\")));\n\t\t\t\temployee.setEmployeeID(String.valueOf(rs.getInt(\"SSN\")));\n\t\t\t\temployee.setHourlyRate(rs.getInt(\"HourlyRate\"));\n\t\t\t\temployees.add(employee);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t\treturn employees;\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employees;\r\n\t}", "List<EmployeeDTO> findByName(String name);", "public List<Employee> getAllEmployees() {\n\t\tList<Employee> list = new ArrayList<Employee>();\n\t\tlist = template.loadAll(Employee.class);\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<Employee> selectEmployeeByAll(Connection con) {\n\t\treturn null;\r\n\t}", "public Employee SearchEmployee(int idEmployee)\n\t{\n\t\tfor(int i = 0; i < departments.size() ; i++)\n\t\t{\n\t\t\tfor(Employee emp : departments.get(i).getEmployeeList())\n\t\t\t{\n\t\t\t\tif(emp.getIdEmployee()==idEmployee) return emp;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Collection<EmployeeDTO> getAll();", "public void getFindByIdCompany() {\n log.info(\"CompaniesContactsBean => method : getFindByIdCompany()\");\n\n log.info(\"ID company\" + companiesBean.getCompaniesEntity().getId());\n this.companiesContactsEntityList = findByIdCompany(companiesBean.getCompaniesEntity());\n }", "public Employee getEmployeeById(String id) {\r\n for(int i = 0; i < companyDirectory.size(); i++) {\r\n\t for(int j = 0; j < companyDirectory.get(i).getLocations().size(); j++) {\r\n\t\t for(int k = 0; k < companyDirectory.get(i).getLocations().get(j).getEmployees().size(); k++) {\t\t\r\n\t\t if(companyDirectory.get(i).getLocations().get(j).getEmployees().get(k).getId().equals(id)) \r\n\t\t \treturn companyDirectory.get(i).getLocations().get(j).getEmployees().get(k);\r\n\t\t }\r\n\t\t}\r\n\t }\r\n return null;\r\n\t}", "public List<Employee> getListOfAllEmployees() {\n\t\tlista = employeeDao.findAll();\r\n\r\n\t\treturn lista;\r\n\t}", "@Override\n\tpublic List<Employee> findAllEmployees() {\n\t\treturn employeeRepository.findAllEmployess();\n\t}", "@GetMapping(\"/findAllEmployees\")\n\tpublic List<Employee> getAll() {\n\t\treturn testService.getAll();\n\t}", "@Override\n\tpublic List<EmployeeBean> getAllEmployees() {\n\t\tLOGGER.info(\"starts getAllEmployees method\");\n\t\tLOGGER.info(\"Ends getAllEmployees method\");\n\t\t\n\t\treturn adminEmployeeDao.getAllEmployees();\n\t}", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\tList<Employee> employee = new ArrayList<>();\n\t\tlogger.info(\"Getting all employee\");\n\t\ttry {\n\t\t\temployee = employeeDao.getAllEmployee();\n\t\t\tlogger.info(\"Getting all employee = {}\",employee.toString());\n\t\t} catch (Exception exception) {\n\t\t\tlogger.error(exception.getMessage());\n\t\t}\n\t\treturn employee;\n\t}", "public void getByIdemployee(int id){\n\t\tEmployeeDTO employee = getJerseyClient().resource(getBaseUrl() + \"/employee/\"+id).get(EmployeeDTO.class);\n\t\tSystem.out.println(\"Nombre: \"+employee.getName());\n\t\tSystem.out.println(\"Apellido: \"+employee.getSurname());\n\t\tSystem.out.println(\"Direccion: \"+employee.getAddress());\n\t\tSystem.out.println(\"RUC: \"+employee.getRUC());\n\t\tSystem.out.println(\"Telefono: \"+employee.getCellphone());\n\t}", "@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}", "@Transactional(readOnly = true)\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Employee> getAllEmployees() {\r\n\t\treturn em.createQuery(\"select e from Employee e order by e.office_idoffice\").getResultList();\r\n\t}", "public List<Employee> getAllEmployee(){\n List<Employee> employee = new ArrayList<Employee>();\n employeeRepository.findAll().forEach(employee::add);\n return employee;\n }", "@Override\r\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\r\n\t}", "public List<Employee> getEmployeesByOffice(String officeCode) {\n return employeeDao.selectOfficeCode(officeCode);\n// return getAll().stream().filter(emp -> emp.getOfficeCode() == null\n// ? null\n// : emp.getOfficeCode().equals(officeCode))\n// .collect(Collectors.toList());\n }", "@Override\n\tpublic List<Employee> viewAllEmployees() {\n\t\t CriteriaBuilder cb = em.getCriteriaBuilder();\n\t\t CriteriaQuery<Employee> cq = cb.createQuery(Employee.class);\n\t\t Root<Employee> rootEntry = cq.from(Employee.class);\n\t\t CriteriaQuery<Employee> all = cq.select(rootEntry);\n\t \n\t\t TypedQuery<Employee> allQuery = em.createQuery(all);\n\t\t return allQuery.getResultList();\n\t}", "public List<Employee> selectAllEmployee() {\n\n\t\t// using try-with-resources to avoid closing resources (boiler plate code)\n\t\tList<Employee> emp = new ArrayList<>();\n\t\t// Step 1: Establishing a Connection\n\t\ttry (Connection connection = dbconnection.getConnection();\n\n\t\t\t\t// Step 2:Create a statement using connection object\n\t\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(SELECT_ALL_employe);) {\n\t\t\tSystem.out.println(preparedStatement);\n\t\t\t// Step 3: Execute the query or update query\n\t\t\tResultSet rs = preparedStatement.executeQuery();\n\n\t\t\t// Step 4: Process the ResultSet object.\n\t\t\twhile (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString employeename = rs.getString(\"employeename\");\n\t\t\t\tString address = rs.getString(\"address\");\n\t\t\t\tint mobile = rs.getInt(\"mobile\");\n\t\t\t\tString position = rs.getString(\"position\");\n\t\t\t\tint Salary = rs.getInt(\"Salary\");\n\t\t\t\tString joineddate = rs.getString(\"joineddate\");\n\t\t\t\tString filename =rs.getString(\"filename\");\n\t\t\t\tString path = rs.getString(\"path\");\n\t\t\t\temp.add(new Employee(id, employeename, address, mobile, position, Salary, joineddate,filename,path));\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tdbconnection.printSQLException(e);\n\t\t}\n\t\treturn emp;\n\t}", "@Query(value = \"select * from Employee as e where e.project_Id = ?1\", nativeQuery = true)\n\tList<Employee> findAllByProjectId(Long id);", "public List<User> findEmployees(String companyShortName, int start, int rows, String sortBy, String sortHow);", "@Override\n\tpublic List<Employee> queryAll() {\n\t\treturn dao.queryAll();\n\t}", "@Override\n\tpublic List<Employee> getEmpleados() {\n\t\treturn repositorioEmployee.findAll();\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployeeList() throws Exception {\n\t\t\r\n\t\treturn (List<Employee>) employeeRepository.findAll();\r\n\t}", "@GET(API_ROUTE + \"/contactos-empleado/{emp_id}\")\n Call<List<Persona>> getContactsByEmployeeId(@Path(\"emp_id\") long emp_id);", "public List<EmployeeEntity> retrieveAllEmployeeData(StorageContext context) throws PragmaticBookSelfException {\n\t\tList<EmployeeEntity> listOfEmployeeData = null;\n\n\t\tSession hibernateSession = context.getHibernateSession();\n\n\t\tString queryString = \"FROM EmployeeEntity\"; // select * from employee;//\n\t\ttry {\n\t\t\tQuery query = hibernateSession.createQuery(queryString);\n\t\t\tlistOfEmployeeData = query.list();\n\t\t} catch (HibernateException he) {\n\t\t\tthrow new PragmaticBookSelfException(he);\n\t\t}\n\t\treturn listOfEmployeeData;\n\t}", "public Employeedetails getEmployeeDetailByName(String employeeId);", "@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }", "public Company findCompany(long id);", "public List<Employee> getAllEmployeeDetail() {\n\t\treturn dao.getAllEmployeeDetail();\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn null;\n\t}", "public List<Employee> findAll() {\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Employee> getAllEmployee() {\n\t\treturn employeeDao.getAllEmployee();\r\n\t}", "public List<Employee> listAll(){\n return employeeRepository.findAll();\n }", "@Override\n\tpublic List<Employee> findAllEmployee() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Emp> findAll() {\n\t\treturn eb.findAll();\n\t}", "public List<Employees> getEmployeesList()\n {\n return employeesRepo.findAll();\n }", "@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}", "public List<Employee> getEmployees();", "@Override\n public List<Employee> getAllEmployees() {\n return null;\n }", "public Employee getEmployeeById(Long custId)throws EmployeeException;", "public List<Employee> getEmployeesOnly() {\n\t\treturn edao.listEmployeOnly();\n\t}", "@Override\n\tpublic List<Employee> getAllEmployees() {\n\t\treturn employeeDao.getAllEmployees();\n\t}", "@Override\n\tpublic TypeContratEmployee getbyid(TypeContratEmployeeId e) {\n\t\t\n\t\treturn rep.findByPkContrat(e);\n\t}", "Employee findById(int id);", "@Query(value = \"SELECT * FROM position_employee pe WHERE pe.position_employee_code = :positionEmployeeCode AND pe.company_id = :companyID\", nativeQuery = true)\n PositionEmployeeEntity findPositionEmployeeByPositionEmployeeCodeAndCompanyID(@Param(\"positionEmployeeCode\") String positionEmployeeCode, @Param(\"companyID\") int companyID);", "public List<Employee> findEmployee(String name) {\n\t\tCriteriaQuery<Employee> createQuery = emp.getCriteriaBuilder().createQuery(Employee.class);\n\t\tRoot<Employee> root = createQuery.from(Employee.class);\n\t\tcreateQuery.where(root.get(\"name\").in(name));\n\t\treturn emp.createQuery(createQuery).getResultList();\n\t}", "public List<Employee> findAllByPosition(String position);", "@Override\r\n\tpublic Employee getEmployee(int id) {\n\t\treturn employees.stream().filter(emp -> emp.getEmpId()==(id)).findFirst().get();\r\n\t}", "@Override\r\n\tpublic List<Employee> selectAllEmployee() {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic List<EmployeeBean> getAllData() {\n\r\n\t\tEntityManager manager = entityManagerFactory.createEntityManager();\r\n\r\n\t\tString query = \"from EmployeeBean\";\r\n\r\n\t\tjavax.persistence.Query query2 = manager.createQuery(query);\r\n\r\n\t\tList<EmployeeBean> list = query2.getResultList();\r\n\t\tif (list != null) {\r\n\t\t\treturn list;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Override\n\tpublic Employee findById(int id) {\n\t\tList<Employee> employeeList= \n\t\tlistEmployee().stream().filter((e -> e.getId()==id)).collect(Collectors.toList());\n\t\t\n\t\treturn (Employee)employeeList.get(0);\n\t}", "@Override\r\n\tpublic List<Employee> findAll() {\n\t\treturn null;\r\n\t}", "@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED)\r\n\t@Override\r\n\tpublic List<Employee> getAllEmployee(Long id, String firstname, String lastname, String email) {\n\t\tCriterion firstnameCriterion = null;\r\n\t\tCriterion lastCriterion = null;\r\n\t\tCriterion emailCriterion = null;\r\n\t\tCriterion idCriterion = null;\r\n\r\n\t\tCriteria criteria = sessionFactory.getCurrentSession().createCriteria(Employee.class);\r\n\r\n\t\tif (!StringUtils.isEmpty(firstname)) {\r\n\t\t\tfirstnameCriterion = Restrictions.ilike(\"firstname\", firstname, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(lastname)) {\r\n\t\t\tlastCriterion = Restrictions.ilike(\"lastname\", firstname, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(email)) {\r\n\t\t\temailCriterion = Restrictions.ilike(\"email\", email, MatchMode.ANYWHERE);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(id)) {\r\n\t\t\tidCriterion = Restrictions.eq(\"id\", id);\r\n\t\t}\r\n\r\n\t\tif (!StringUtils.isEmpty(idCriterion)) {\r\n\t\t\tcriteria.add(idCriterion);\r\n\t\t}\r\n\t\tDisjunction disjunctions = Restrictions.disjunction();\r\n\r\n\t\tif (null != firstnameCriterion) {\r\n\t\t\tdisjunctions.add(firstnameCriterion);\r\n\t\t}\r\n\r\n\t\tif (null != lastCriterion) {\r\n\t\t\tdisjunctions.add(lastCriterion);\r\n\t\t}\r\n\r\n\t\tif (null != emailCriterion) {\r\n\t\t\tdisjunctions.add(emailCriterion);\r\n\t\t}\r\n\r\n\t\tcriteria.add(disjunctions);\r\n\r\n\t\treturn criteria.list();\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tEntityManager em = PersistanceManager.INSTANCE.getEntityManager();\r\n\t\tSystem.out.println(\"Print ALL\");\r\n\t\tQuery query = em.createQuery(\"FROM Employee e\");\r\n\t\tArrayList<Employee> result = (ArrayList<Employee>) query.getResultList();\r\n\t\tfor (Employee current : result)\r\n\t\t\tSystem.out.println(current.toString());\r\n\t\tSystem.out.println(\"Print id = 3\");\r\n\t\tQuery query1 = em.createQuery(\"FROM Employee e where e.id=3\");\r\n\t\tArrayList<Employee> result1 = (ArrayList<Employee>) query1.getResultList();\r\n\t\tfor (Employee current : result1)\r\n\t\t\tSystem.out.println(current.toString());\r\n\t\tSystem.out.println(\"Print Named Query \");\r\n\t\tArrayList<Employee> result2 = (ArrayList<Employee>) em.createNamedQuery(\"Employee.searchAll\").setParameter(\"empName\", \"D%\")\r\n\t\t\t\t.getResultList();\r\n\t\tfor (Employee current : result2)\r\n\t\t\tSystem.out.println(current.toString());\r\n\t}", "public static ArrayList<Employee> getAllEmployee() throws SQLException {\n\t\tConnection connection = DatabaseConnection.getConnection();\n\t\tArrayList<Employee> employee = new ArrayList<>();\n\t\tString query = \"SELECT * FROM EMPLOYEE\";\n\t\tPreparedStatement pStatement = connection.prepareStatement(query);\n\t\tResultSet resultSet = pStatement.executeQuery();\n\t\twhile (resultSet.next()) {\n\t\t\temployee.add(new Employee(resultSet.getString(\"empId\"), resultSet\n\t\t\t\t\t.getString(\"ename\")));\n\t\t}\n\t\treturn employee;\n\t}", "public Employee listEmployeeById(int id) throws SQLException {\n\t\t\treturn employeeDAO.listEmployeeById(id);\n\t\t}", "@Override\n\tpublic List<Employee> queryEmp() {\n\t\treturn null;\n\t}", "@Override\n public List<Complaint> viewComplaintsForEmployee(final String type) {\n\n String SELECT = \"SELECT * FROM complaints WHERE typeOfComplaint = ? ORDER BY complaintId ASC\";\n\n return jdbcTemplate.query(SELECT, new PreparedStatementSetter() {\n @Override\n public void setValues(PreparedStatement preparedStatement) throws SQLException {\n preparedStatement.setString(1, type);\n }\n }, getComplaintMapper());\n }", "@Override\r\n\tpublic List<Employee> findAll(Iterable<Long> arg0) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<Employee> getAll() {\n\t\tList<Employee> list =null;\n\t\tEmployeeDAO employeeDAO = DAOFactory.getEmployeeDAO();\n\t\ttry {\n\t\t\tlist=employeeDAO.getAll();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<Employe> getEmployes() {\n\t\treturn dao.getEmployes();\r\n\t}", "@Override\n\tpublic List<EmploieType> findAll() {\n\t\treturn emploieTypeRepository.findAll();\n\t}", "public Employee getEmployeeByID(int id) {\n\t\t\r\n\t\ttry {\r\n\t\t\tEmployee f = temp.queryForObject(\"Select * from fm_employees where EID =?\",new EmployeeMapper(),id);\r\n\t\t\treturn f;\r\n\t\t} catch (EmptyResultDataAccessException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public Employee findEmployee(IncomingReport incoming_report) throws IllegalArgumentException, DAOException;", "protected List<CompaniesContactsEntity> findByIdCompany(CompaniesEntity companiesEntity) {\n\n log.info(\"CompaniesContactsBean => method : findByIdCompany()\");\n\n FacesMessage facesMessage;\n\n if (companiesContactsEntity == null) {\n log.error(\"Companies entity is null\");\n facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, JsfUtils.returnMessage(getLocale(), \"company.error\"), null);\n FacesContext.getCurrentInstance().addMessage(null, facesMessage);\n return null;\n }\n\n EntityManager em = EMF.getEM();\n\n List<CompaniesContactsEntity> companiesContactsEntities = companiesContactsDao.findByIdCompany(em, companiesEntity.getId());\n\n em.clear();\n em.close();\n\n return companiesContactsEntities;\n }", "public Employee getEmployeebyId(int id) {\r\n\t\tEmployee e = SQLUtilityEmployees.getEmpByID(id);\r\n\t\treturn e;\r\n\t\t\r\n\t}", "EmployeeDTO findById(Long employeeId);", "@Override\r\n\tpublic List<Employee> departmentHaveEmployee(int id) {\n\t\treturn employeedao.departmentHaveEmployee(id);\r\n\t}" ]
[ "0.75530803", "0.728679", "0.6629198", "0.6620717", "0.65089494", "0.6485262", "0.6465409", "0.6432106", "0.64266473", "0.6397246", "0.6353752", "0.6340332", "0.6326923", "0.63143927", "0.6311902", "0.62903976", "0.6280655", "0.6264428", "0.62455004", "0.6241828", "0.62241787", "0.6207899", "0.62063885", "0.6189288", "0.6178578", "0.6176278", "0.61638", "0.6150349", "0.61446804", "0.6141904", "0.61394703", "0.61346066", "0.61267334", "0.61218846", "0.6109932", "0.6108992", "0.61030596", "0.6079382", "0.6078235", "0.6075042", "0.60705936", "0.6066455", "0.60620785", "0.6057672", "0.6051832", "0.6051332", "0.60433525", "0.60261524", "0.60245264", "0.60203624", "0.6014379", "0.60140294", "0.6006382", "0.6002863", "0.5998651", "0.59966147", "0.59920406", "0.5971121", "0.5968501", "0.5961203", "0.5961203", "0.59609604", "0.595632", "0.595375", "0.59482324", "0.5944053", "0.59370804", "0.5930553", "0.5929529", "0.59214026", "0.5920479", "0.5905996", "0.58868617", "0.5886507", "0.58732516", "0.58687174", "0.5857417", "0.5846313", "0.5844574", "0.5829133", "0.5820882", "0.58208", "0.58150715", "0.58121955", "0.580844", "0.58047295", "0.5793641", "0.57888955", "0.5788595", "0.5788336", "0.5780768", "0.5774151", "0.5773566", "0.5766582", "0.57647663", "0.5750682", "0.57468706", "0.57463664", "0.57401246", "0.57190824" ]
0.75697273
0
Constructor for the item.
public PoisonPack(Battle battle, String name){ //calls the ItemDrop constructor super(true, 200, 0, false, battle); this.name = name; this.imageName = "poison.png"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Item()\n {\n super();\n }", "public Item(){}", "private Item(){}", "public Item() {}", "public Item() {\n\t}", "public Item() {\n\t}", "@SuppressWarnings(\"unused\")\n public Item() {\n }", "public Item() {\n }", "public Item() {\n }", "public Item()\r\n {\r\n // Initialize instance variables\r\n \r\n }", "protected Item() {\n }", "public Item() \r\n\t{\r\n\t\tname = \"AbstractItem\";\r\n\t\tdescription = \"Example Item Generated\";\r\n\t\tprice = 0;\r\n\t}", "public ItemRecord() {\n super(Item.ITEM);\n }", "Item(){\r\n\t\tthis(0, new Weight(5), new DukatAmount(0));\r\n\t}", "public Item_Record() {\n super(Item_.ITEM_);\n }", "public ItemInfo () {}", "public EnterpriseBeansItem() {\n super();\n }", "public Item(){\n description = \"No description avaible for this item\";\n weight = 0;\n }", "public Item()\r\n\t{\r\n\t\tserialNum = 00000;\r\n\t\tweight = 0.0;\r\n\t}", "public PurchaseOrderItem () {\n\t\tsuper();\n\t}", "public Item(String itemName, String itemDescription){\n this.itemName = itemName;\n this.itemDescription = itemDescription;\n}", "public DessertItem() {\n this(\"\");\n }", "public Items(String image, int y, int x) {\r\n\t\tsuper(image, y, x);\r\n\t}", "public Item() {\r\n this.name = \"\";\r\n this.description = \"\";\r\n this.price = 0F;\r\n this.type = \"\";\r\n this.available = 0;\r\n this.wholesaler = new Wholesaler();\r\n this.wholesalerId = 0;\r\n this.category = new Category();\r\n this.categoryId = 0; \r\n }", "public NewItems() {\n super();\n }", "public ModuleObjectAttributeItem() {}", "public OrderItem() {}", "public Item(String initName, String itemDesc)\n {\n // initialise instance variables\n name = initName;\n desc = itemDesc;\n }", "public Item() {\n\t\tmenu.add(new Item(\"Snickers\", 10, 1.50, \"1\"));\n\t\tmenu.add(new Item(\"Chips\", 10, .50, \"2\"));\n\t\tmenu.add(new Item(\"Coke\", 10, 1.75, \"3\"));\n\n\t}", "public POJOCompteItem() {\n compte = new TreeMap<Date, Integer>();\n items = new ArrayList<Item>();\n }", "public ItemMenu() {\n super(null, null);\n }", "public Item()\r\n {\r\n gen = new Random();\r\n color = new Color(gen.nextInt());\r\n x = 200;\r\n w = 100;\r\n h = 18;\r\n }", "public Item(Integer itemSlot) {\n this.itemSlot = itemSlot;\n }", "public TitleIconItem(){}", "public Item(Environment e) {\n\t\tthis(0,0,e);\n }", "protected Item(Point pos)\n\t{\n\t\tthis.pos = pos;\n\t}", "public Item(String input) {\n name = input;\n }", "public LaPatilla()\n\t{\n\t\tsuper(TAG_ITEM_ITEMS,\n\t\t\t\tnew int[]{TAG_TITLE},\n\t\t\t\tnew int[]{TAG_LINK},\n\t\t\t\tnew int[]{TAG_DESCRIPTION},\n\t\t\t\tnew int[]{TAG_CONTENT_ENCODED},\n\t\t\t\tnew int[]{TAG_PUBDATE},\n\t\t\t\tnew int[]{TAG_CATEGORY},\n\t\t\t\tnew int[]{},\n\t\t\t\t\"\");\n\t}", "public Item(String name, ItemType type)\n {\n\tthis.name = name;\n\tthis.type = type;\n }", "public RecentItem() {\n }", "public ListItems() {\n itemList = new ArrayList();\n }", "public InventoryItem(String name) { \n\t\tthis(name, 1);\n\t}", "public OrderItem_() {\n }", "public Item(\n int itemId ,\n int currentQty ,\n int minQty ,\n int maxQty ,\n BufferedImage icon ,\n String label, \n String desc ,\n String attr)\n {\n this.itemId = itemId ;\n this.currentQty=currentQty;\n this.minQty=minQty;\n this.maxQty=maxQty;\n this.icon=icon;\n this.label=label;\n }", "public TileItem(Game game, Element e) {\n super(game, e);\n }", "public Item(int weigth, String name, String description) {\n this.weigth = weigth;\n this.name = name;\n this.description = description;\n }", "public Item(String description) {\n this.description = description;\n }", "public CartItem() {\n }", "Item(DukatAmount price){\r\n\t\tthis(0, new Weight(5), price);\r\n\t}", "Item(Weight weight){\r\n\t\tthis(0, weight, new DukatAmount(0));\r\n\t}", "public QuestionPoolItemData(){\n }", "public FSItem(String itemPath) {\n this.fsItemPath = itemPath;\n this.itemProperties = new FSItemProperties();\n }", "public TreeItem() {\n\t\tsuper();\n\t\tdecideNorm = true;\n\t\tisNorm = true;\n\n\t}", "Items(){\n}", "public ItemManager() {\n itemMap = new HashMap<>();\n importantItemList = new ArrayList<>();\n\n }", "public Item() {\n\t\tthis(rand.nextDouble() * GameManager.NATIVE_WIDTH, -30.0, PowerUp[new Random().nextInt(PowerUp.length)]);\n\t}", "public ItemCommand() {\n }", "private Item initItem() {\n String name = inputName.getText().toString();\n int quantityToBuy = -1;\n if (!inputQuantityToBuy.getText().toString().equals(\"\"))\n quantityToBuy = Integer.parseInt(inputQuantityToBuy.getText().toString());\n String units = inputUnits.getText().toString();\n double price = 0;\n if (!inputPrice.getText().toString().equals(\"\"))\n price = Double.parseDouble(inputPrice.getText().toString());\n int calories = 0;\n if (!inputCalories.getText().toString().equals(\"\"))\n calories = Integer.parseInt(inputCalories.getText().toString());\n ArrayList<String> allergies = allergyActions.getAllergies();\n return new Item(name, 0, units, quantityToBuy, 0, allergies, calories, price);\n }", "Item(int x, int y) {\n this.posX = x;\n this.posY = y;\n }", "private TaskItem()\n {\n }", "public GItem(Item i) {\n this.mGItem = i.getId();\n this.title = i.getTitle();\n\n if (!i.getAddress().equals(\"\")){\n this.address = i.getAddress();\n }\n\n if (i instanceof OfficerItem){\n this.type = 1;\n\n } else if (i instanceof CompanyItem){\n this.type = 0;\n }\n\n }", "public Item(double x, double y, String itemName) {\n\t\tsuper(x, y);\n\t\tswitch (itemName) {\n\t\tcase \"Powerup_Health\":\n\t\t\turl = \"img/Powerup_Health.png\";\n\t\t\tbreak;\n\t\tcase \"Powerup_Ammo\":\n\t\t\turl = \"img/Powerup_Ammo.png\";\n\t\t\tbreak;\n\t\t}\n\t\tthis.itemName = itemName;\n\t\tsprite = new ImageSprite(this, new Image(url, 48, 29, true, true));\n\t\tsprite.setZ(80);\n\t\taddScript(new ConstantSpeedMove(0, 2)).addScript(new ColliderBox(sprite.getHeight(), sprite.getWidth()))\n\t\t\t\t.addScript(new AutoRemove());\n\t}", "public ShoppingListItem() {}", "public Item(E val) {\n value = val;\n }", "Item(int i, String n, String c, double p) {\n this.id = i;\n this.name = n;\n this.category = c;\n this.price = p;\n }", "public InventoryItem(){\r\n this.itemName = \"TBD\";\r\n this.sku = 0;\r\n this.price = 0.0;\r\n this.quantity = 0;\r\n nItems++;\r\n }", "ItemType(String itemCode) {\n code = itemCode;\n }", "public KeyedItem(int key,\n T item)\n {\n this(new Integer(key), item);\n }", "public ItemSummary() {\n }", "public ActiveSurveyQuestionItem() {\n }", "public Item(final int t, final int i, final int c) {\n\t\ttype = t;\n\t\tid = i;\n\t\tcount = c;\n\t\t//type = ItemType.BLOCK;\n\t}", "public Item(String id, int index) {\n this.id = id;\n this.itemIndex = index;\n this.dataBank = new DataBank();\n this.usersRatings = new SortedRatingList();\n }", "public ItemmatlBean() {\n }", "public Item(String itemName, String itemList, String itemNote, int itemNumStocks, String itemExpireDate, int itemID) {\n this.itemName = itemName;\n this.itemList = itemList;\n this.itemNote = itemNote;\n this.itemNumStocks = itemNumStocks;\n this.itemExpireDate = itemExpireDate;\n this.itemID = itemID;\n }", "public Item(String des, double w){\n description = des;\n weight = w;\n }", "public UseCaseItem() {\n delegate = new MyModel.Builder().build();\n }", "public RestaurantItem() {\n }", "public DataNode(Item item, ParentNode parent) {\n m_item = item;\n m_parent = parent;\n AnnotatedBase comp = item.getSchemaComponent();\n int comptype = comp.type();\n m_named = (comptype == SchemaBase.ATTRIBUTE_TYPE || comptype == SchemaBase.ELEMENT_TYPE) &&\n ((INamed)comp).getName() != null;\n Item topmost = item.getTopmost();\n boolean optional = topmost.isOptional();\n if (parent != null && ((GroupItem)parent.getItem()).isInline() && !parent.isNamed()) {\n optional = optional || parent.isOptional();\n }\n m_optional = optional;\n m_ignored = item.isIgnored();\n if (m_ignored) {\n m_type = null;\n m_collection = false;\n } else {\n boolean collection = topmost.isCollection();\n if (item instanceof ValueItem) {\n \n // value item will always be a primitive or wrapper value\n JavaType jtype = ((ValueItem)item).getType();\n m_type = jtype.getPrimitiveName();\n if (m_type == null || topmost.isOptional() || topmost.isCollection() || parent.isCollection()) {\n m_type = jtype.getClassName();\n }\n \n } else if (item instanceof ReferenceItem) {\n \n // reference item as value will always be a reference to the definition class\n m_type = ((ReferenceItem)item).getDefinition().getGenerateClass().getFullName();\n \n } else if (item instanceof AnyItem) {\n \n // xs:any handling determines value type\n switch (item.getComponentExtension().getAnyType()) {\n \n case NestingCustomBase.ANY_DISCARD:\n m_type = null;\n collection = false;\n break;\n \n case NestingCustomBase.ANY_DOM:\n m_type = \"org.w3c.dom.Element\";\n break;\n \n case NestingCustomBase.ANY_MAPPED:\n m_type = \"java.lang.Object\";\n break;\n \n default:\n throw new IllegalStateException(\"Internal error - unknown xs:any handling\");\n \n }\n \n } else if (!((GroupItem)item).isInline()) {\n \n // group item as value will always be a reference to the group class\n m_type = ((GroupItem)item).getGenerateClass().getFullName();\n \n }\n m_collection = collection;\n }\n if (parent != null) {\n parent.addChild(this);\n }\n }", "public GIPIQuoteItemMC()\t{\n \t}", "protected Item(String name, int level, String location){\r\n this.name = name;\r\n this.level = level;\r\n this.location = location;\r\n }", "public FlyerFeaturedItem() {}", "public PurchaseOrderItem (\n\t\t Integer in_purchaseOrderItemId\n\t\t) {\n\t\tsuper (\n\t\t in_purchaseOrderItemId\n\t\t);\n\t}", "public Item(Item item) {\n setId(item.getId());\n setName(item.getName());\n setPrice(item.getPrice());\n setWasPurchased(item.wasPurchased());\n setOrder(item.getOrder());\n setStoreName(item.getStoreName());\n }", "public ItemRecord(String itemid, String productid, BigDecimal listprice, BigDecimal unitcost, Integer supplier, String status, String attr1, String attr2, String attr3, String attr4, String attr5) {\n super(Item.ITEM);\n\n set(0, itemid);\n set(1, productid);\n set(2, listprice);\n set(3, unitcost);\n set(4, supplier);\n set(5, status);\n set(6, attr1);\n set(7, attr2);\n set(8, attr3);\n set(9, attr4);\n set(10, attr5);\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }", "public EntityHierarchyItem() {\n }", "public TheHeraldScotland()\n\t{\n\t\tsuper(TAG_ITEM_ITEMS,\n\t\t\t\tnew int[]{TAG_TITLE},\n\t\t\t\tnew int[]{TAG_LINK},\n\t\t\t\tnew int[]{TAG_DESCRIPTION},\n\t\t\t\tnew int[]{},\n\t\t\t\tnew int[]{TAG_PUBDATE},\n\t\t\t\tnew int[]{},\n\t\t\t\tnew int[]{TAG_MEDIA_CONTENT},\n\t\t\t\t\"\");\n\t}", "protected StockItem()\r\n \t{\r\n \t\tlimit = new LimitSystem(this);\r\n \t}", "public Order() {\n\t\tsuper();\n\t\titems = new HashMap<>();\n\t}", "public Item(int photo, int name, int address, int info) {\n //The variables take the value of the arguments\n mImageResourceId = photo;\n mName = name;\n mAddress = address;\n mInfo = info;\n }", "AdapterItems(int ID, String product)\n {\n this.ID=ID;\n this.product=product;\n //this. Description=Description;\n }", "public ConfigurationItem(URI _uri, InputStream _item, RevisionID _revision)\r\n\t{\r\n\t\titem \t= _item;\r\n\t\turi \t= _uri;\r\n\t\trevision= _revision;\r\n\t\ttype \t= null;\r\n\t\tuser \t= null;\r\n\t}", "public Item(String name, int hp, int mana, int ad, int ap, int arm, int mrst, int movespeed, int attackspeed, double hpregen,\n\tdouble manaregen, int lifeSteal, int spellVamp, int cdr, int tenacity, int crit, int arp, int mpen, String icon){\n\t\t\n\t\tthis.name = name;\n\t\tthis.hp = hp;\n\t\tthis.mana = mana;\n\t\tthis.ad = ad;\n\t\tthis.ap = ap;\n\t\tthis.arm = arm;\n\t\tthis.mrst = mrst;\n\t\tthis.movespeed = movespeed;\n\t\tthis.attackspeed = attackspeed;\n\t\tthis.hpregen = hpregen;\n\t\tthis.manaregen = manaregen;\n\t\tthis.lifeSteal = lifeSteal;\t\n\t\tthis.spellVamp = spellVamp;\t\t\n\t\tthis.cdr = cdr;\t\t\t\n\t\tthis.tenacity = tenacity;\t\t\n\t\tthis.crit = crit;\t\n\t\tthis.arp = arp;\n\t\tthis.mpen = mpen;\n\t\titem = new JButton(new ImageIcon(icon));\n\t\t\t\n\t}", "public Inventory(){\n this.items = new ArrayList<InventoryItem>(); \n }", "public OrderAdapter() {\n super(new ArrayList<MultiItemEntity>());\n addItemType(TYPE_HEAD, R.layout.item_order_head);\n addItemType(TYPE_CONTENT, R.layout.item_order_content);\n addItemType(TYPE_FOOTER, R.layout.item_order_foot);\n }", "public CustomerCartItem() {\n }", "public ItemsAdapter() {\n\n\n }", "public TreeItem(String label ) {\r\n\t\tthis( label, null );\r\n\t}", "public OrderItem(MenuItem item, int qty){\r\n\t\tthis.menuItem = item;\r\n\t\tthis.quantity = qty;\r\n\t}", "public VKApiItem() {\n\n }" ]
[ "0.8405709", "0.83424646", "0.8295188", "0.8212352", "0.8111174", "0.8111174", "0.80430615", "0.8040832", "0.8040832", "0.7979504", "0.7877473", "0.774453", "0.76846766", "0.76710445", "0.766868", "0.76572716", "0.76544166", "0.757744", "0.75321525", "0.74896234", "0.74471897", "0.74121696", "0.7400976", "0.7379069", "0.7311453", "0.73101705", "0.72267663", "0.7185576", "0.7149877", "0.71286654", "0.7111213", "0.7042536", "0.7035693", "0.69735724", "0.695497", "0.693818", "0.69304943", "0.69282734", "0.6919776", "0.6908396", "0.6905392", "0.68950367", "0.68765146", "0.68531245", "0.6850888", "0.6846515", "0.6845666", "0.6841741", "0.68361145", "0.6835503", "0.68321097", "0.68309206", "0.6830892", "0.68144125", "0.68093324", "0.68066114", "0.68056417", "0.6771185", "0.6765872", "0.6761644", "0.6738334", "0.6736011", "0.67318606", "0.67314595", "0.6718628", "0.67090744", "0.6708895", "0.6695156", "0.66904", "0.6683757", "0.66631866", "0.6657393", "0.6643975", "0.6641445", "0.6639591", "0.6638179", "0.661581", "0.6603083", "0.6596554", "0.6594532", "0.65904325", "0.65889424", "0.6586824", "0.6581373", "0.65806687", "0.65806687", "0.65747756", "0.6545966", "0.6528582", "0.6527347", "0.6513502", "0.6503211", "0.6497743", "0.6493227", "0.647165", "0.647155", "0.64659506", "0.6464187", "0.64629054", "0.6455345", "0.64403576" ]
0.0
-1
Decreases the energy of the robot that hits the item by 15.
public void doItemEffect(RobotPeer robot){ //System.out.println("Energy = " + robot.getEnergy()); robot.updateEnergy(-15); //System.out.println("Poison item USED"); //System.out.println("Energy = " + robot.getEnergy()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void move() {\n energy -= 0.03;\n if (energy < 0) {\n energy = 0;\n }\n }", "public void buyDecreaseDamage() {\n this.decreaseDamage++;\n }", "public static void decreaseDifficaulty() {\r\n\t\tif (Enemy._timerTicker < 70)\r\n\t\t\tEnemy._timerTicker += 3;\r\n\t\tif (Player._timerTicker > 4)\r\n\t\t\tPlayer._timerTicker -= 2;\r\n\t}", "public void reduceHealth(int ammo_damage){\n this.health -= ammo_damage;\n }", "public void decreaseHealth() {\n setHealth(getHealth()-1);\n }", "public void expendFuel(double distance) {\n fuelAmount -= distance;\n }", "public void stay() {\n energy -= 0.01;\n if (energy < 0) {\n energy = 0;\n }\n }", "private void subtractEnemyMissile() {\n this.enemyMissile -= 1;\n }", "void decreaseStrength() {\n if (this.strokeStrength - 0.25 >= 1) {\n this.strokeStrength -= 0.25;\n }\n this.updateAcc();\n this.updateStick();\n }", "public void consumeFuel(double amount);", "public void deductHealth( int amt) {\n currentHealth = currentHealth - amt;\n }", "public void decreaseSpeed() {\n\t\tif(this.getSpeed() > 0) {\n\t\t\tthis.setSpeed(this.getSpeed() - 5);\n\t\t\tSystem.out.println(\"decrease speed by 5\\n\");\n\t\t}else {\n\t\t\tSystem.out.println(\"You already reach at the mimimum speed 0\\n\");\n\t\t}\n\t}", "public void buyFuel() {\n this.fuelMod++;\n fuelMax += +750 * fuelMod;\n }", "public void reduceHealth(int damage){\n health -= damage;\n }", "void setExtremeSpikeIncrease(VariableAmount increase);", "public void use(Consume item)\r\n {\r\n int gain = item.getRating();\r\n health += gain;\r\n \r\n if (health > maxHealth)\r\n health = maxHealth;\r\n \r\n say(\"I gained \" + gain + \" health by using \" + item.getName() + \" and now have \" + health + \"/\" + maxHealth);\r\n \r\n items.remove(item);\r\n }", "public void decreasePrice() {\n //price halved\n //is it okay if the price becomes 0?\n itemToSell.setBuyPrice(itemToSell.getBuyPrice() / 2);\n }", "public void decreaseQuantity(int amount) {\n this.currentQuantity -= amount;\n }", "private void subtractPlayerMissile() {\n this.playerMissile -= 1;\n }", "void decrease();", "void decrease();", "private void sharplyChange(){\r\n\t\t\tgovernmentLegitimacy -= 0.3;\r\n\t\t}", "public void downGrade(){\n\t\tlevel -= level;\n\t\tConstants.FARMS -= 1;\n\t\tConstants.FOOD -= 20;\n\t}", "protected void pickItem(int x ){\r\n this.level -=x;\r\n }", "@Override\r\n\tpublic float getEnergyConsumption() {\r\n\t\treturn 2500 - robot.getBatteryLevel();\r\n\t}", "private void devolver100() {\n cambio = cambio - 100;\n de100--;\n cambio100++;\n }", "public void reduceAnimalHealth() {\n\t\thealth -= 10;\n\t}", "public void decrease() {\r\n\r\n\t\tdecrease(1);\r\n\r\n\t}", "public void decreaseQuantity() {\n this.quantity--;\n this.updateTotalPrice();\n }", "void unsetValueQuantity();", "public void stopRobot(){\n LAM.setPower(0);\n RAM.setPower(0);\n ILM.setPower(0);\n IRM.setPower(0);\n BLM.setPower(0);\n BRM.setPower(0);\n FLM.setPower(0);\n FRM.setPower(0);\n }", "public void decreaseVolume()\r\n {\r\n volume--;\r\n }", "public void takedmg(int dmg){\n curHp -= dmg;\n }", "public void setEnergy(double energy) { this.energy = energy; }", "public void minusShield(int down) {\n\t\tshieldLevel -= down;\n\t}", "void takeDamage(int points) {\n this.health -= points;\n }", "public final void decreaseShields() {\n\t\tshields--;\n\t}", "void decreaseHealth(Float damage);", "private void subtractEnemySheild(int damage) {\n this.enemyShield -= damage;\n }", "public void takeDamage(int dmg){\r\n this.currHP -= dmg;\r\n }", "private void takeDamage(int damage){ health -= damage;}", "public void decFuelLevel() {\n\t\tif (fuelLevel > 0) {\n\t\t\tfuelLevel--;\n\t\t} else {\n\t\t\tSystem.out.println(\"Fuel is empty!\");\n\t\t} // if\n\t}", "public void reduceHealth() {\n\t}", "public void depolarize(){\n\t\t\tif(sodiumChannel.getGateStatus().equalsIgnoreCase(\"open\")) {\n\t\t\t\tfor(int i = 1; i <= threshold; i++) {\n\t\t\t\t\tcurrentVoltage = currentVoltage + sodiumIon;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void decreaseFruitQuantity(double amount) {\r\n\t\tif (amount > 0) {\r\n\t\t\tthis.fruitQuantity -= amount;\r\n\t\t}\r\n\t}", "public void decreaseHealth(int hp) {\n this.decreaseLife();\n }", "public void Down4()\r\n {\r\n if(By2>0 && By2<900){\r\n \r\n By2+=2.5;\r\n }\r\n }", "public void fruitDrop()\n {\n fruit.slowMoveVertical(60);\n }", "public void Down(){\r\n \r\n if(By>0 && By<900){\r\n \r\n By+=2;\r\n }\r\n }", "public void decrease(int Quantity) {\r\n\r\n\t\tif (getAmount() == 0 || (getAmount() - Quantity) < 0)\r\n\r\n\t\t\treturn;\r\n\r\n\t\tsetAmount(getAmount() - Quantity);\r\n\r\n\t}", "public void gerak() \n {\n setLocation(getX(),getY()-5);\n if(getY()<20){\n getWorld().removeObject(this);\n }else\n cek_kena();\n \n }", "public void eat(int newEnergy)\n {\n if(energy+newEnergy > maxEnergy)\n {\n newEnergy = maxEnergy - energy;\n }\n\n energy += newEnergy;\n animalHungry = false;\n //no bo zwierzaczek juz nie jest glodny\n }", "public void decreaseVolume() {\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.DECREASE_VOLUME));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.DECREASE_VOLUME) {\n isDecreasingVolume = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n };\n }", "public void hurt (int amount) {\r\n\t\thealth -= amount;\r\n\t\tif(health <= 0) {\r\n\t\t\thealth = 0; //I will be using this later when entity is knocked out\r\n\t\t\tactive = false;\r\n//\t\t\tdestroy();\r\n\t\t}\r\n\t}", "void easy_ride_from_70kmh_down (double min_lift) { \n double start_speed = 70; // kmh\n double pitch = 0;\n double min_drag = 10000.0;\n double step = -10;\n velocity = start_speed;\n for (int count = 0; count < 10000; count++) {\n trace(\"velocity: \" + velocity + \" step: \" + step);\n steady_flight_at_given_speed(5, 0);\n double total_drag = total_drag();\n double foil_lift = foil_lift();\n if (Math.abs(step) < 0.01) break;\n if ((step < 0 && velocity+step <= 0) ||\n // (step > 0 && velocity >= 70) ||\n foil_lift < load ||\n total_drag > min_drag) { // can't pivot because of local max of drag before taking off.... \n velocity -= step;\n step *= 0.5;\n } else {\n velocity += step;\n min_drag = total_drag;\n }\n }\n make_cruising_info(min_lift, min_drag, velocity); \n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n }", "void hurt(int strength) {\n life -= strength;\n if (life < 0)\n life = 0;\n }", "public void decreaseMeatQuantity(double amount) {\r\n\t\tif (amount > 0) {\r\n\t\t\tthis.meatQuantity -= amount;\r\n\t\t}\r\n\t}", "void decreaseAngle() {\n this.strokeAngle -= 3;\n this.updateAcc();\n this.updateStick();\n }", "@Override\n protected void execute() {\n Robot.elevator.elevatorDown();\n }", "public void decreaseVolume() {\r\n\t\tvolume--;\r\n\t}", "public void act() \n {\n setLocation(getX(),getY()+1);\n givePower();\n delete();\n }", "public void decrease() {\r\n --lives;\r\n }", "Builder extremeSpikeIncrease(VariableAmount increase);", "void deductFromAmount(double amount) {\n this.currentAmount -= amount;\n }", "public void recieveDamage(){\n this.health--;\n }", "public void hide() {\n energy = 0;\n redBull = 1;\n gun = 0;\n target = 1;\n }", "public void doAction(int action){\n this.hp -= action;\n }", "public void act()\n {\n // if (claimer ==null){\n // this.setClaim(false);\n //}\n if(claimer == null){\n setClaim(false);\n }\n if (energy>0){\n \n removeEnergy(decayRate);\n\n }\n else {\n // getWorld().removeObject(this);\n\n }\n \n //check the energy decay\n //change size and weight\n //\n }", "public void depleteFood(float dt){\n\t\tthis.foodLevel -= dt* this.starvationRate;\n\t\t\n\t}", "public void decreaseHealth(int amount)\n\t{\n\t\thealth = health - amount;\n\t}", "public void stop()\n {\n robot.FL_drive.setPower(0);\n robot.FR_drive.setPower(0);\n robot.BL_drive.setPower(0);\n robot.BR_drive.setPower(0);\n }", "public void takeDamage(double damage){\n damage -= this.armor;\n this.health -= damage;\n }", "public void liftArm(){armLifty.set(-drivePad.getThrottle());}", "public void setEnergy (double energy) {\n\t this.energy = energy;\n\t}", "public static void setNewHP(int newHP){\r\n\t\thp -= newHP;\r\n\t}", "private void drink()\n { \n if(i.item3 == true && i.used == false)\n {\n p.energy += 70;\n i.item3 = false;\n i.used = true;\n System.out.println(\"Energy: \" + p.energy);\n }\n else if(i.used == true && i.item3 == false) \n {\n System.out.println(\"You already drank a redbull!\"); \n }\n else if(i.item3 == false && i.used == false)\n {\n System.out.println(\"no more drinks left!\");\n }\n }", "public void damage(int amount) {\n \tshield = shield - amount;\n }", "public void action() {\n x = x + dx;\n y = y + dy;\n\n // deluppgift 6\n if( this.growing ) {\n this.setDiameter( this.diameter + 5 );\n this.growing = (this.diameter > 25) ? false : true;\n }\n else {\n this.setDiameter( this.diameter - 4 );\n this.growing = (this.diameter < 5 ) ? true : false;\n }\n constrain();\n }", "public void setFuel(int amount) {\r\n this.fuel = amount;\r\n }", "public void decreaseStrength(int f) {\r\n\t\tstrength -= f;\r\n\t}", "public void drive(double distance)\n {\n fuelInTank -= distance / fuelEfficiency; \n }", "public void raise(){\r\n elevatorTalon1.set(basePWM);\r\n elevatorTalon2.set(basePWM * pwmModifier);\r\n }", "public void brake() {\n\t\tsetPower(Motor.STOP);\r\n\t}", "public void setRemainingAir ( int ticks ) {\n\t\texecute ( handle -> handle.setRemainingAir ( ticks ) );\n\t}", "public void sell(int number) {\r\n quantity -= number;\r\n }", "public void brake(){\n if (speed <= 0){\n speed = 0;\n }\n else{\n speed -= 5;\n }\n }", "public void depreciate(){\r\n float amountN = getAmount();\r\n float reduce = amountN*(rate/100);\r\n amountN = amountN - reduce;\r\n this.amount = amountN;\r\n }", "public void takeDamage(int amount){\r\n\t\tthis.life = this.life - amount;\r\n\t}", "public void setEnergy(int energy) {\r\n\t\tthis.energy = energy;\r\n\t}", "public void useItem(Human user){\n user.addEnergy(10);\n user.removefromInv(this); \n }", "public void decreaseQuantity(View view) {\n Log.d(\"Method\", \"decreaseQuantity()\");\n updateQuantity(-1);\n }", "public void decreaseSpeed(int time) {\n\t\tvelocity -= acceleration;\r\n\t}", "public void diminuiQntdItem(int valorSubtraido) {\r\n\t\tthis.qntd -= valorSubtraido;\r\n\t}", "private void subtractPlayerSheild(int damage) {\n this.playerShield -= damage;\n }", "protected int dropOff(int amt) {\n delayElevator();\n return load.addAndGet(-amt);\n }", "public void shootGun() {\n\t\tammo--;\n\t}", "public void decrease() {\n if(this.value>0){\n value--;\n }\n }", "public void arm_down() {\n arm_analog(-RobotMap.Arm.arm_speed);\n }", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "void removeUses(Equipment oldUses);" ]
[ "0.64242965", "0.62189955", "0.6093392", "0.60858953", "0.5964599", "0.5930495", "0.59023786", "0.5868056", "0.57915026", "0.5757231", "0.5751094", "0.5718905", "0.56897396", "0.56795824", "0.5664517", "0.56521535", "0.56305164", "0.56298995", "0.5597419", "0.5577469", "0.5577469", "0.5571095", "0.55679286", "0.55678207", "0.556695", "0.5565778", "0.55609256", "0.55601555", "0.5537137", "0.5517609", "0.5491476", "0.54899144", "0.5484913", "0.54695624", "0.5463465", "0.546149", "0.5457915", "0.5442767", "0.54419446", "0.5438989", "0.54238737", "0.5416272", "0.54131985", "0.540507", "0.53996366", "0.5395766", "0.5389069", "0.5378429", "0.53703135", "0.53658825", "0.5362379", "0.53601784", "0.5354032", "0.53493184", "0.53460497", "0.53440285", "0.5340343", "0.5324985", "0.532332", "0.5322114", "0.5319098", "0.5315718", "0.5315081", "0.53085166", "0.5308432", "0.5303786", "0.52924734", "0.5284588", "0.5282696", "0.528115", "0.5279727", "0.52777886", "0.5272674", "0.52723044", "0.5249762", "0.5240524", "0.5231947", "0.523149", "0.522859", "0.52248544", "0.5222388", "0.52219486", "0.5221367", "0.5214229", "0.52113676", "0.52103174", "0.5200849", "0.5200347", "0.5197021", "0.51962614", "0.519278", "0.51782805", "0.5177419", "0.516824", "0.51662207", "0.5152286", "0.51444006", "0.51426685", "0.51382023", "0.51373464" ]
0.64883554
0